From 567024be71d304430133627a24f1e61a29e222a5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Dec 2016 12:37:06 +0100 Subject: [PATCH] Bug 17600: continue replace of EXPORT with EXPORT_OK --- C4/Accounts.pm | 7 +++-- C4/Acquisition.pm | 11 +++----- C4/AuthoritiesMarc.pm | 55 +++++++++++++++++++-------------------- C4/Budgets.pm | 10 +++---- C4/Contract.pm | 10 +++---- C4/Creators.pm | 9 ++++--- C4/Creators/Lib.pm | 8 ++++-- C4/External/Amazon.pm | 8 +++--- C4/External/OverDrive.pm | 6 +++-- C4/External/Syndetics.pm | 8 +++--- C4/Images.pm | 7 ++--- C4/Log.pm | 12 ++++++--- C4/MarcModificationTemplates.pm | 9 ++++--- C4/NewsChannels.pm | 10 ++++--- C4/OAI/Sets.pm | 7 ++--- C4/Patroncards.pm | 10 ++++--- C4/Patroncards/Lib.pm | 9 +++++-- C4/Print.pm | 9 ++++--- C4/Record.pm | 11 ++++---- C4/Ris.pm | 13 +++++---- C4/RotatingCollections.pm | 10 +++---- C4/Serials/Frequency.pm | 9 ++++--- C4/Serials/Numberpattern.pm | 8 +++--- C4/Stats.pm | 16 +++++++----- C4/XSLT.pm | 9 ++++--- Koha/DateUtils.pm | 13 ++++++--- Koha/I18N.pm | 11 +++++++- Koha/List/Patron.pm | 13 ++++++--- Koha/Patron/Debarments.pm | 23 +++++++++------- Koha/Util/Normalize.pm | 21 +++++++++------ acqui/pdfformat/layout2pages.pm | 8 +++--- acqui/pdfformat/layout2pagesde.pm | 8 +++--- acqui/pdfformat/layout3pages.pm | 9 +++---- acqui/pdfformat/layout3pagesfr.pm | 8 +++--- 34 files changed, 224 insertions(+), 171 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 3942c39..c0ec6af 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -30,12 +30,11 @@ use Koha::Account::Lines; use Data::Dumper qw(Dumper); -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &manualinvoice &getnextacctno &getcharges diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 2bb97a9..9f94973 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -41,11 +41,12 @@ use MARC::Record; use Time::localtime; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); + @ISA = qw( Exporter ); + @EXPORT = qw( &GetBasket &NewBasket &CloseBasket &ReopenBasket &DelBasket &ModBasket &GetBasketAsCSV &GetBasketGroupAsCSV @@ -93,10 +94,6 @@ BEGIN { ); } - - - - sub GetOrderFromItemnumber { my ($itemnumber) = @_; my $dbh = C4::Context->dbh; diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 87620b4..11f1418 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -35,37 +35,36 @@ use Koha::Authority; use Koha::SearchEngine; use Koha::SearchEngine::Search; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetTagsLabels - &GetAuthMARCFromKohaField - - &AddAuthority - &ModAuthority - &DelAuthority - &GetAuthority - &GetAuthorityXML - - &CountUsage - &CountUsageChildren - &SearchAuthorities - - &BuildSummary - &BuildAuthHierarchies - &BuildAuthHierarchy - &GenerateHierarchy - - &merge - &FindDuplicateAuthority + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( + &GetTagsLabels + &GetAuthMARCFromKohaField + + &AddAuthority + &ModAuthority + &DelAuthority + &GetAuthority + &GetAuthorityXML - &GuessAuthTypeCode - &GuessAuthId - ); + &CountUsage + &CountUsageChildren + &SearchAuthorities + + &BuildSummary + &BuildAuthHierarchies + &BuildAuthHierarchy + &GenerateHierarchy + + &merge + &FindDuplicateAuthority + + &GuessAuthTypeCode + &GuessAuthId + ); } diff --git a/C4/Budgets.pm b/C4/Budgets.pm index c68fbec..26c83f1 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -22,13 +22,13 @@ use strict; use C4::Context; use Koha::Database; use C4::Debug; -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &GetBudget &GetBudgetByOrderNumber &GetBudgetByCode @@ -37,7 +37,7 @@ BEGIN { &GetBudgetsReport &GetBudgetReport &GetBudgetHierarchy - &AddBudget + &AddBudget &ModBudget &DelBudget &GetBudgetSpent diff --git a/C4/Contract.pm b/C4/Contract.pm index 0de49ad..5356bd9 100644 --- a/C4/Contract.pm +++ b/C4/Contract.pm @@ -23,18 +23,18 @@ use strict; use C4::Context; use Koha::Database; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &GetContracts &GetContract &AddContract &ModContract &DelContract - ); + ); } =head1 NAME diff --git a/C4/Creators.pm b/C4/Creators.pm index f73a6fc..bc37972 100644 --- a/C4/Creators.pm +++ b/C4/Creators.pm @@ -17,10 +17,13 @@ package C4::Creators; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . +our (@ISA, @EXPORT_OK); BEGIN { - use vars qw(@EXPORT @ISA); - @ISA = qw(Exporter); - our @EXPORT = qw(get_all_templates + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( + get_all_templates get_all_layouts get_all_profiles get_all_image_names diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index eb97bc1..b6821dd 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -25,9 +25,13 @@ use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; use C4::Debug; +our (@ISA, @EXPORT_OK); BEGIN { - use base qw(Exporter); - our @EXPORT = qw(get_all_templates + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( + get_all_templates get_all_layouts get_all_profiles get_all_image_names diff --git a/C4/External/Amazon.pm b/C4/External/Amazon.pm index a76ab86..7901cfa 100644 --- a/C4/External/Amazon.pm +++ b/C4/External/Amazon.pm @@ -21,12 +21,12 @@ package C4::External::Amazon; use strict; use warnings; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( get_amazon_tld ); } diff --git a/C4/External/OverDrive.pm b/C4/External/OverDrive.pm index 9044169..0ec5772 100644 --- a/C4/External/OverDrive.pm +++ b/C4/External/OverDrive.pm @@ -28,10 +28,12 @@ use HTTP::Request::Common; use LWP::Authen::Basic; use LWP::UserAgent; +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - our @ISA = qw( Exporter ) ; - our @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( IsOverDriveEnabled GetOverDriveToken ); diff --git a/C4/External/Syndetics.pm b/C4/External/Syndetics.pm index 0570d0f..384687c 100644 --- a/C4/External/Syndetics.pm +++ b/C4/External/Syndetics.pm @@ -26,12 +26,12 @@ use HTTP::Request::Common; use strict; use warnings; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &get_syndetics_index &get_syndetics_summary &get_syndetics_toc diff --git a/C4/Images.pm b/C4/Images.pm index 37b2417..950b487 100644 --- a/C4/Images.pm +++ b/C4/Images.pm @@ -25,13 +25,14 @@ use 5.010; use C4::Context; use GD; -use vars qw($debug $noimage @ISA @EXPORT); +use vars qw($debug $noimage); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &PutImage &RetrieveImage &ListImagesForBiblio diff --git a/C4/Log.pm b/C4/Log.pm index d8ea168..44e395a 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -30,12 +30,16 @@ use C4::Context; use Koha::DateUtils; use Koha::Logger; -use vars qw(@ISA @EXPORT); + +our ( @ISA, @EXPORT_OK ); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw(&logaction &cronlogaction &GetLogStatus &displaylog &GetLogs); + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( + &logaction &cronlogaction &GetLogStatus &displaylog &GetLogs + ); } =head1 NAME diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index cbd4204..e409f34 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -24,13 +24,14 @@ use DateTime; use C4::Context; use Koha::SimpleMARC; -use vars qw(@ISA @EXPORT); - use constant DEBUG => 0; +our ( @ISA, @EXPORT_OK ); BEGIN { - @ISA = qw(Exporter); - @EXPORT = qw( + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &GetModificationTemplates &AddModificationTemplate &DelModificationTemplate diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index 8e261db..6a3023b 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -22,11 +22,13 @@ use Modern::Perl; use C4::Context; use Koha::DateUtils; -use vars qw(@ISA @EXPORT); +our ( @ISA, @EXPORT_OK ); -BEGIN { - @ISA = qw(Exporter); - @EXPORT = qw( +BEGIN { + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &GetNewsToDisplay &add_opac_new &upd_opac_new &del_opac_new &get_opac_new &get_opac_news ); diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm index e2d8586..6d70803 100644 --- a/C4/OAI/Sets.pm +++ b/C4/OAI/Sets.pm @@ -32,12 +32,13 @@ OAI Set description can be found L qw(Dumper); use C4::Context; use C4::Debug; +our ( @ISA, @EXPORT_OK ); + BEGIN { - use base qw(Exporter); - our @EXPORT = qw(unpack_UTF8 + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( + unpack_UTF8 text_alignment leading box diff --git a/C4/Print.pm b/C4/Print.pm index d0f2642..2765d01 100644 --- a/C4/Print.pm +++ b/C4/Print.pm @@ -21,12 +21,13 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Context; -use vars qw(@ISA @EXPORT); +our ( @ISA, @EXPORT_OK ); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw(&NetworkPrint); + + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw(&NetworkPrint); } =head1 NAME diff --git a/C4/Record.pm b/C4/Record.pm index abc0075..09e7835 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -40,14 +40,13 @@ use Koha::CsvProfiles; use Koha::AuthorisedValues; use Carp; -use vars qw(@ISA @EXPORT); +our ( @ISA, @EXPORT_OK ); +BEGIN { -@ISA = qw(Exporter); - -# only export API methods - -@EXPORT = qw( + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( &marc2endnote &marc2marc &marc2marcxml diff --git a/C4/Ris.pm b/C4/Ris.pm index 5bf8ecc..0cca87e 100644 --- a/C4/Ris.pm +++ b/C4/Ris.pm @@ -63,19 +63,18 @@ package C4::Ris; use Modern::Perl; use List::MoreUtils qw/uniq/; -use vars qw(@ISA @EXPORT); use C4::Biblio qw(GetMarcSubfieldStructureFromKohaField); use Koha::SimpleMARC qw(read_field); +our ( @ISA, @EXPORT_OK ); -@ISA = qw(Exporter); +BEGIN { -# only export API methods - -@EXPORT = qw( - &marc2ris -); + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw(&marc2ris); +} our $marcprint = 0; # Debug flag; diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 709eaf2..9a4213e 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -33,9 +33,6 @@ use DBI; use Data::Dumper; -use vars qw(@ISA @EXPORT); - - =head1 NAME C4::RotatingCollections - Functions for managing rotating collections @@ -44,10 +41,13 @@ C4::RotatingCollections - Functions for managing rotating collections =cut +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw( Exporter ); - @EXPORT = qw( + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( CreateCollection UpdateCollection DeleteCollection diff --git a/C4/Serials/Frequency.pm b/C4/Serials/Frequency.pm index 509f680..9d567cc 100644 --- a/C4/Serials/Frequency.pm +++ b/C4/Serials/Frequency.pm @@ -22,12 +22,13 @@ use warnings; use C4::Context; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( &GetSubscriptionFrequencies &GetSubscriptionFrequency &AddSubscriptionFrequency diff --git a/C4/Serials/Numberpattern.pm b/C4/Serials/Numberpattern.pm index 210b8dd..42ce363 100644 --- a/C4/Serials/Numberpattern.pm +++ b/C4/Serials/Numberpattern.pm @@ -22,13 +22,13 @@ use warnings; use C4::Context; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( &GetSubscriptionNumberpatterns &GetSubscriptionNumberpattern &GetSubscriptionNumberpatternByName diff --git a/C4/Stats.pm b/C4/Stats.pm index 54e3a39..1aa3765 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -24,16 +24,18 @@ require Exporter; use Carp; use C4::Context; use C4::Debug; -use vars qw(@ISA @EXPORT); our $debug; - +our (@ISA, @EXPORT_OK); BEGIN { - @ISA = qw(Exporter); - @EXPORT = qw( - &UpdateStats - &TotalPaid - ); + + require Exporter; + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( + &UpdateStats + &TotalPaid + ); } diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 8813da0..36d7943 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -36,17 +36,18 @@ use Koha::Libraries; use Encode; -use vars qw(@ISA @EXPORT); - my $engine; #XSLT Handler object my %authval_per_framework; # Cache for tagfield-tagsubfield to decode per framework. # Should be preferably be placed in Koha-core... +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( &XSLTParse4Display ); $engine=Koha::XSLT_Handler->new( { do_not_return_source => 1 } ); diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 51d3d93..13578c1 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -21,11 +21,16 @@ use DateTime; use C4::Context; use Carp; -use base 'Exporter'; +our (@ISA, @EXPORT_OK); +BEGIN { -our @EXPORT = ( - qw( dt_from_string output_pref format_sqldatetime ) -); + require Exporter; + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( + dt_from_string output_pref format_sqldatetime + ); +} =head1 DateUtils diff --git a/Koha/I18N.pm b/Koha/I18N.pm index 33730f9..d6e90fc 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -34,7 +34,16 @@ use Locale::Maketext::Lexicon { '_style' => 'gettext', }; -our @EXPORT = qw( gettext ); +our (@ISA, @EXPORT_OK); +BEGIN { + + require Exporter; + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( + gettext + ); +} my %language_handles; diff --git a/Koha/List/Patron.pm b/Koha/List/Patron.pm index 1baa3b0..d60ccf2 100644 --- a/Koha/List/Patron.pm +++ b/Koha/List/Patron.pm @@ -31,9 +31,14 @@ use Carp; use Koha::Database; -use base 'Exporter'; -our @EXPORT = ( - qw( +our (@ISA, @EXPORT_OK); +BEGIN { + + require Exporter; + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( + GetPatronLists DelPatronList @@ -42,7 +47,7 @@ our @EXPORT = ( AddPatronsToList DelPatronsFromList - ) + ) ); =head2 GetPatronLists diff --git a/Koha/Patron/Debarments.pm b/Koha/Patron/Debarments.pm index 9fc2724..321c6cf 100644 --- a/Koha/Patron/Debarments.pm +++ b/Koha/Patron/Debarments.pm @@ -21,19 +21,24 @@ use Modern::Perl; use C4::Context; -use parent qw( Exporter ); +our (@ISA, @EXPORT_OK); +BEGIN { -our @EXPORT = qw( - GetDebarments + require Exporter; + @ISA = qw( Exporter ); - AddDebarment - DelDebarment - ModDebarment + @EXPORT_OK = qw( + GetDebarments - AddUniqueDebarment - DelUniqueDebarment + AddDebarment + DelDebarment + ModDebarment -); + AddUniqueDebarment + DelUniqueDebarment + + ); +} =head1 Koha::Patron::Debarments diff --git a/Koha/Util/Normalize.pm b/Koha/Util/Normalize.pm index a654c3f..5cc96cc 100644 --- a/Koha/Util/Normalize.pm +++ b/Koha/Util/Normalize.pm @@ -19,14 +19,19 @@ package Koha::Util::Normalize; use Modern::Perl; -use parent qw( Exporter ); - -our @EXPORT = qw( - legacy_default - remove_spaces - upper_case - lower_case -); +our (@ISA, @EXPORT_OK); +BEGIN { + + require Exporter; + @ISA = qw( Exporter ); + + @EXPORT_OK = qw( + legacy_default + remove_spaces + upper_case + lower_case + ); +} =head1 NAME diff --git a/acqui/pdfformat/layout2pages.pm b/acqui/pdfformat/layout2pages.pm index 7e7bc3d..f008f44 100644 --- a/acqui/pdfformat/layout2pages.pm +++ b/acqui/pdfformat/layout2pages.pm @@ -32,11 +32,11 @@ use Koha::Number::Price; use Koha::DateUtils; use Koha::Libraries; +our (@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( printpdf ); } diff --git a/acqui/pdfformat/layout2pagesde.pm b/acqui/pdfformat/layout2pagesde.pm index 69c7082..f0b42e0 100644 --- a/acqui/pdfformat/layout2pagesde.pm +++ b/acqui/pdfformat/layout2pagesde.pm @@ -31,11 +31,11 @@ use Koha::Number::Price; use Koha::DateUtils; use Koha::Libraries; +our(@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( printpdf ); } diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm index f825ed3..4c9375c 100644 --- a/acqui/pdfformat/layout3pages.pm +++ b/acqui/pdfformat/layout3pages.pm @@ -33,14 +33,13 @@ use Koha::Number::Price; use Koha::DateUtils; use Koha::Libraries; +our (@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( printpdf ); } - #be careful, all the sizes (height, width, etc...) are in mm, not PostScript points (the default measurment of PDF::API2). #The constants exported transform that into PostScript points (/mm for milimeter, /in for inch, pt is postscript point, and as so is there only to show what is happening. use constant mm => 25.4 / 72; diff --git a/acqui/pdfformat/layout3pagesfr.pm b/acqui/pdfformat/layout3pagesfr.pm index 14b0cc0..3413bab 100644 --- a/acqui/pdfformat/layout3pagesfr.pm +++ b/acqui/pdfformat/layout3pagesfr.pm @@ -32,11 +32,11 @@ use Koha::Number::Price; use Koha::DateUtils; use Koha::Libraries; +our (@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw( Exporter ); + @EXPORT_OK = qw( printpdf ); } -- 2.9.3