Koha-clms/Koha
Jonathan Druart 9d6d641d1f Bug 17600: Standardize our EXPORT_OK
On bug 17591 we discovered that there was something weird going on with
the way we export and use subroutines/modules.
This patch tries to standardize our EXPORT to use EXPORT_OK only.

That way we will need to explicitely define the subroutine we want to
use from a module.

This patch is a squashed version of:
Bug 17600: After export.pl
Bug 17600: After perlimport
Bug 17600: Manual changes
Bug 17600: Other manual changes after second perlimports run
Bug 17600: Fix tests

And a lot of other manual changes.

export.pl is a dirty script that can be found on bug 17600.

"perlimport" is:
git clone https://github.com/oalders/App-perlimports.git
cd App-perlimports/
cpanm --installdeps .
export PERL5LIB="$PERL5LIB:/kohadevbox/koha/App-perlimports/lib"
find . \( -name "*.pl" -o -name "*.pm" \) -exec perl App-perlimports/script/perlimports --inplace-edit --no-preserve-unused --filename {} \;

The ideas of this patch are to:
* use EXPORT_OK instead of EXPORT
* perltidy the EXPORT_OK list
* remove '&' before the subroutine names
* remove some uneeded use statements
* explicitely import the subroutines we need within the controllers or
modules

Note that the private subroutines (starting with _) should not be
exported (and not used from outside of the module except from tests).

EXPORT vs EXPORT_OK (from
https://www.thegeekstuff.com/2010/06/perl-exporter-examples/)
"""
Export allows to export the functions and variables of modules to user’s namespace using the standard import method. This way, we don’t need to create the objects for the modules to access it’s members.

@EXPORT and @EXPORT_OK are the two main variables used during export operation.

@EXPORT contains list of symbols (subroutines and variables) of the module to be exported into the caller namespace.

@EXPORT_OK does export of symbols on demand basis.
"""

If this patch caused a conflict with a patch you wrote prior to its
push:
* Make sure you are not reintroducing a "use" statement that has been
removed
* "$subroutine" is not exported by the C4::$MODULE module
means that you need to add the subroutine to the @EXPORT_OK list
* Bareword "$subroutine" not allowed while "strict subs"
means that you didn't imported the subroutine from the module:
  - use $MODULE qw( $subroutine list );
You can also use the fully qualified namespace: C4::$MODULE::$subroutine

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-16 08:58:47 +02:00
..
Account Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Acquisition Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
App
…
ArticleRequest
…
Authority Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BackgroundJob Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BiblioUtils Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Cache Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Cash Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Charges Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Checkouts Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Club Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Config Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Course Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Edifact Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Exceptions Bug 26312: (follow-up) Fix passing of exception messages 2021-04-16 11:48:31 +02:00
Exporter Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ExternalContent Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Filter/MARC Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Illrequest Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Indexer
…
Item Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Library Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
List Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MetadataRecord Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Middleware
…
Misc
…
Notice Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Number
…
OAI/Server Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Object Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Objects Bug 23271: Prevent crash if called without parameters 2021-04-21 15:25:07 +02:00
Old Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patron Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patrons Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Plugins Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
REST Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
RecordProcessor
…
SMS Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SMTP Bug 26595: Remove password from the smtp_server API object 2020-10-14 15:53:38 +02:00
Schema Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchEngine Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Serial Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Sitemapper Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Subscription Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SuggestionEngine Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Tags Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Template/Plugin Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Util Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
XSLT Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Z3950Responder Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
pdfformat Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Account.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ActionLog.pm
…
ActionLogs.pm
…
AdditionalField.pm
…
AdditionalFieldValue.pm
…
AdditionalFieldValues.pm
…
AdditionalFields.pm
…
AdvancedEditorMacro.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AdvancedEditorMacros.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ApiKey.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ApiKeys.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ArticleRequest.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ArticleRequests.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AudioAlert.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AudioAlerts.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthUtils.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthorisedValue.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthorisedValueCategories.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthorisedValueCategory.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthorisedValues.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Authorities.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Authority.pm
…
BackgroundJob.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BackgroundJobs.pm
…
Biblio.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BiblioFramework.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BiblioFrameworks.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
BiblioUtils.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblioitem.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblioitems.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblios.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Cache.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Caches.pm
…
Calendar.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Checkout.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Checkouts.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CirculationRule.pm
…
CirculationRules.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Cities.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
City.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRule.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRules.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSource.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSources.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSplitRule.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSplitRules.pm
…
Club.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Clubs.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Config.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Course.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Courses.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CoverImage.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CoverImages.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CsvProfile.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CsvProfiles.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Database.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
DateUtils.pm
…
Desk.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Desks.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
EDI.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Edifact.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Email.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Exceptions.pm Bug 26518: Raise exception if the insert failed 2020-11-25 15:18:17 +01:00
ExternalContent.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
FrameworkPlugin.pm
…
Hold.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Holds.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
I18N.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Illcomment.pm
…
Illcomments.pm
…
Illrequest.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Illrequestattribute.pm
…
Illrequestattributes.pm
…
Illrequests.pm
…
ImportBatch.pm Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages 2020-11-11 15:55:49 +01:00
ImportBatchProfile.pm Bug 23019: (follow-up) Fix other things 2020-11-11 15:55:49 +01:00
ImportBatchProfiles.pm Bug 23019: (follow-up) Fix other things 2020-11-11 15:55:49 +01:00
ImportBatches.pm Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages 2020-11-11 15:55:49 +01:00
Item.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ItemType.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ItemTypes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Items.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
KeyboardShortcut.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
KeyboardShortcuts.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Libraries.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Library.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Linktracker.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Localization.pm
…
Localizations.pm
…
Logger.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Manual.pm Bug 26944: Point help link to automatic item mod in manual 2020-11-18 12:03:03 +01:00
MarcSubfieldStructure.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MarcSubfieldStructures.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MessageAttribute.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MessageAttributes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MetaSearcher.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MetadataIterator.pm
…
MetadataRecord.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MoreUtils.pm
…
News.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
NewsItem.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
OAuth.pm
…
OAuthAccessToken.pm
…
OAuthAccessTokens.pm
…
Object.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Objects.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patron.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patrons.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Plugins.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ProblemReport.pm
…
ProblemReports.pm
…
PseudonymizedTransaction.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
PseudonymizedTransactions.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Quote.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Quotes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
RDF.pm
…
Rating.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Ratings.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
RecordProcessor.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Report.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Reports.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Review.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Reviews.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Schema.pm
…
Script.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchEngine.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchField.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchFields.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchMarcMap.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchMarcMaps.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Serial.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Serials.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SharedContent.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SimpleMARC.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Sitemapper.pm
…
Statistic.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Statistics.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
StockRotationItem.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
StockRotationItems.pm
…
StockRotationRota.pm
…
StockRotationRotas.pm
…
StockRotationStage.pm
…
StockRotationStages.pm
…
Subscription.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Subscriptions.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Suggestion.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SuggestionEngine.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Suggestions.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Tag.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Tags.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Token.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
UploadedFile.pm Bug 28123: Quote filename value in Content-Disposition header 2021-04-16 12:28:18 +02:00
UploadedFiles.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Uploader.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelf.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelfcontent.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelfcontents.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelfshare.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelfshares.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelves.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Z3950Responder.pm Bug 25292: Flushing L1 on every Z3950 server search 2021-01-11 10:27:37 +01:00
Z3950Server.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Z3950Servers.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00