Bugzilla – Attachment 186655 Details for
Bug 40680
Many warnings on Perl 5.40 due to importing methods from not yet defined packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40680: Move EXPORT_OK right after Modern::Perl
Bug-40680-Move-EXPORTOK-right-after-ModernPerl.patch (text/plain), 72.97 KB, created by
Jonathan Druart
on 2025-09-22 09:00:08 UTC
(
hide
)
Description:
Bug 40680: Move EXPORT_OK right after Modern::Perl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-22 09:00:08 UTC
Size:
72.97 KB
patch
obsolete
>From a06435f38c7975923d69f7d35ceef1daa225b2d3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 2 Sep 2025 11:22:06 +0200 >Subject: [PATCH] Bug 40680: Move EXPORT_OK right after Modern::Perl > >So it is done before the other use statements. > >Also uniformize the pattern, must now be: >``` >use Modern::Perl; >use base 'Exporter'; >BEGIN { > our @EXPORT_OK = qw(subroutine list); >} >``` >--- > C4/Accounts.pm | 20 +++--- > C4/Acquisition.pm | 60 ++++++++-------- > C4/Auth.pm | 27 ++++--- > C4/Auth_with_cas.pm | 17 ++--- > C4/Auth_with_ldap.pm | 14 ++-- > C4/Auth_with_shibboleth.pm | 15 ++-- > C4/AuthoritiesMarc.pm | 58 +++++++-------- > C4/Biblio.pm | 10 +-- > C4/Breeding.pm | 15 ++-- > C4/Budgets.pm | 23 +++--- > C4/Charset.pm | 22 +++--- > C4/Circulation.pm | 110 ++++++++++++++--------------- > C4/ClassSortRoutine.pm | 12 ++-- > C4/ClassSource.pm | 18 ++--- > C4/ClassSplitRoutine.pm | 12 ++-- > C4/CourseReserves.pm | 28 ++++---- > C4/External/BakerTaylor.pm | 13 ++-- > C4/Heading.pm | 6 ++ > C4/HoldsQueue.pm | 33 ++++----- > C4/ImportBatch.pm | 56 +++++++-------- > C4/ImportExportFramework.pm | 24 +++---- > C4/InstallAuth.pm | 20 +++--- > C4/Items.pm | 9 +-- > C4/Koha.pm | 23 +++--- > C4/Languages.pm | 27 +++---- > C4/Letters.pm | 44 ++++++------ > C4/Members.pm | 21 +++--- > C4/Members/Messaging.pm | 12 +++- > C4/Members/Statistics.pm | 13 ++-- > C4/Output.pm | 25 +++---- > C4/Overdues.pm | 40 +++++------ > C4/Reports.pm | 15 ++-- > C4/Reports/Guided.pm | 40 +++++------ > C4/Reserves.pm | 85 +++++++++++----------- > C4/SIP/Logger.pm | 2 +- > C4/SIP/Sip/Checksum.pm | 11 ++- > C4/Scheduler.pm | 12 ++-- > C4/Search.pm | 35 +++++---- > C4/Serials.pm | 72 +++++++++---------- > C4/ShelfBrowser.pm | 19 ++--- > C4/Stats.pm | 11 ++- > C4/Suggestions.pm | 35 ++++----- > C4/Tags.pm | 28 ++++---- > C4/TmplTokenType.pm | 9 +-- > C4/XISBN.pm | 17 ++--- > C4/XSLT.pm | 27 ++++--- > Koha/AuthUtils.pm | 13 ++-- > Koha/DateUtils.pm | 18 ++--- > Koha/Devel/Files.pm | 1 - > Koha/EDI.pm | 27 +++---- > Koha/I18N.pm | 37 +++++----- > Koha/Item/Search/Field.pm | 8 +-- > Koha/List/Patron.pm | 16 ++--- > Koha/Patron/Debarments.pm | 24 +++---- > Koha/Patron/Password/Recovery.pm | 25 +++---- > Koha/SimpleMARC.pm | 12 ++-- > Koha/TemplateUtils.pm | 12 ++-- > Koha/Util/FrameworkPlugin.pm | 12 ++-- > Koha/Util/StockRotation.pm | 19 ++--- > Koha/pdfformat/layout1page.pm | 13 ++-- > Koha/pdfformat/layout2pages.pm | 13 ++-- > Koha/pdfformat/layout2pagesde.pm | 13 ++-- > Koha/pdfformat/layout3pages.pm | 15 ++-- > Koha/pdfformat/layout3pagesfr.pm | 15 ++-- > misc/translator/VerboseWarnings.pm | 34 +++------ > 65 files changed, 684 insertions(+), 888 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 15bac2ad363..0e913241b39 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -18,6 +18,15 @@ package C4::Accounts; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT = qw( >+ chargelostitem >+ purge_zero_balance_fees >+ ); >+} >+ > use C4::Context; > use C4::Stats; > use C4::Members; >@@ -26,17 +35,6 @@ use Koha::Account::Lines; > use Koha::Account::Offsets; > use Koha::Items; > >-use vars qw(@ISA @EXPORT); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT = qw( >- chargelostitem >- purge_zero_balance_fees >- ); >-} >- > =head1 NAME > > C4::Accounts - Functions for dealing with Koha accounts >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 3b5d444d458..bc34efe2c0e 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -18,39 +18,10 @@ package C4::Acquisition; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Carp qw( carp croak ); >-use Text::CSV_XS; >-use C4::Context; >-use C4::Suggestions qw( GetSuggestion GetSuggestionFromBiblionumber ModSuggestion ); >-use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ); >-use C4::Contract qw( GetContract ); >-use C4::Log qw( logaction ); >-use C4::Templates qw(gettemplate); >-use Koha::DateUtils qw( dt_from_string ); >-use Koha::Acquisition::Baskets; >-use Koha::Acquisition::Booksellers; >-use Koha::Acquisition::Invoices; >-use Koha::Acquisition::Orders; >-use Koha::AdditionalFieldValue; >-use Koha::Biblios; >-use Koha::Exceptions; >-use Koha::Items; >-use Koha::Number::Price; >-use Koha::Libraries; >-use Koha::CsvProfiles; >-use Koha::Patrons; >- >-use C4::Koha; >- >-use MARC::Field; >-use JSON qw( to_json ); >- >-our ( @ISA, @EXPORT_OK ); >+use base 'Exporter'; > > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetBasket NewBasket ReopenBasket ModBasket > GetBasketAsCSV GetBasketGroupAsCSV > GetBasketsByBookseller GetBasketsByBasketgroup >@@ -95,6 +66,33 @@ BEGIN { > ); > } > >+use Carp qw( carp croak ); >+use Text::CSV_XS; >+use C4::Context; >+use C4::Suggestions qw( GetSuggestion GetSuggestionFromBiblionumber ModSuggestion ); >+use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ); >+use C4::Contract qw( GetContract ); >+use C4::Log qw( logaction ); >+use C4::Templates qw(gettemplate); >+use Koha::DateUtils qw( dt_from_string ); >+use Koha::Acquisition::Baskets; >+use Koha::Acquisition::Booksellers; >+use Koha::Acquisition::Invoices; >+use Koha::Acquisition::Orders; >+use Koha::AdditionalFieldValue; >+use Koha::Biblios; >+use Koha::Exceptions; >+use Koha::Items; >+use Koha::Number::Price; >+use Koha::Libraries; >+use Koha::CsvProfiles; >+use Koha::Patrons; >+ >+use C4::Koha; >+ >+use MARC::Field; >+use JSON qw( to_json ); >+ > =head1 NAME > > C4::Acquisition - Koha functions for dealing with orders and acquisitions >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 87fd18dd167..b4b06cdd057 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -17,8 +17,17 @@ package C4::Auth; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT_OK = qw( >+ checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash >+ get_all_subpermissions get_cataloguing_page_permissions get_user_subpermissions in_iprange >+ get_template_and_user haspermission create_basic_session >+ ); >+} >+ > use Carp qw( croak ); > > use Digest::MD5 qw( md5_base64 ); >@@ -60,20 +69,10 @@ use Koha::Session; > # use utf8; > > use vars qw($ldap $cas $caslogout); >-our ( @ISA, @EXPORT_OK ); > > BEGIN { > C4::Context->set_remote_address; > >- require Exporter; >- @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >- checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash >- get_all_subpermissions get_cataloguing_page_permissions get_user_subpermissions in_iprange >- get_template_and_user haspermission create_basic_session >- ); >- > $cas = C4::Context->preference('casAuthentication'); > $caslogout = C4::Context->preference('casLogout'); > >@@ -1245,7 +1244,7 @@ sub checkauth { > : Koha::Cash::Registers->search( > { branch => $branchcode, branch_default => 1 }, > { rows => 1 } >- )->single; >+ )->single; > $register_id = $register->id if ($register); > $register_name = $register->name if ($register); > } >@@ -1455,7 +1454,7 @@ sub checkauth { > # get the inputs from the incoming query > my @inputs = (); > my @inputs_to_clean = qw( login_userid login_password ticket logout.x otp_token ); >- foreach my $name ( param $query) { >+ foreach my $name ( param $query ) { > next if grep { $name eq $_ } @inputs_to_clean; > my @value = $query->multi_param($name); > push @inputs, { name => $name, value => $_ } for @value; >diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm >index f35b7e68711..d6e381f2517 100644 >--- a/C4/Auth_with_cas.pm >+++ b/C4/Auth_with_cas.pm >@@ -17,8 +17,13 @@ package C4::Auth_with_cas; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT_OK = >+ qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required multipleAuth getMultipleAuth); >+} > > use C4::Context; > use Koha::AuthUtils qw( get_script_name ); >@@ -29,14 +34,6 @@ use URI::Escape; > > use Koha::Logger; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = >- qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required multipleAuth getMultipleAuth); >-} > my $defaultcasserver; > my $casservers; > my $yamlauthfile = C4::Context->config('intranetdir') . "/C4/Auth_cas_servers.yaml"; >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index b962294d341..c44afcfa602 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -18,6 +18,12 @@ package C4::Auth_with_ldap; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT_OK = qw( checkpw_ldap ); >+} >+ > use Carp qw( croak ); > > use C4::Context; >@@ -29,14 +35,6 @@ use Koha::AuthUtils qw( hash_password ); > use Net::LDAP; > use Net::LDAP::Filter; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( checkpw_ldap ); >-} >- > # Redefine checkpw_ldap: > # connect to LDAP (named or anonymous) > # ~ retrieves $userid from KOHA_CONF mapping >diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm >index ccaf9f1a085..73d1935010e 100644 >--- a/C4/Auth_with_shibboleth.pm >+++ b/C4/Auth_with_shibboleth.pm >@@ -18,6 +18,11 @@ package C4::Auth_with_shibboleth; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT_OK = qw(shib_ok logout_shib login_shib_url checkpw_shib get_login_shib); >+} > > use C4::Context; > use Koha::AuthUtils qw( get_script_name ); >@@ -30,14 +35,6 @@ use List::MoreUtils qw( any ); > > use Koha::Logger; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw(shib_ok logout_shib login_shib_url checkpw_shib get_login_shib); >-} >- > # Check that shib config is not malformed > > sub shib_ok { >@@ -158,7 +155,7 @@ sub _autocreate { > module => 'members', > letter_code => 'WELCOME', > branchcode => $patron->branchcode, >- , >+ > lang => $patron->lang || 'default', > tables => { > 'branches' => $patron->branchcode, >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index dfc07498619..29b719a83de 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -18,38 +18,11 @@ package C4::AuthoritiesMarc; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >-use MARC::Field; >-use Scalar::Util qw(blessed); >-use Try::Tiny qw( try catch ); >- >-use C4::Context; >-use C4::Biblio qw( ModBiblio ); >-use C4::Search qw( FindDuplicate new_record_from_zebra ); >-use C4::AuthoritiesMarc::MARC21; >-use C4::AuthoritiesMarc::UNIMARC; >-use C4::Charset qw( SetUTF8Flag ); >-use C4::Log qw( logaction ); >-use Koha::MetadataRecord::Authority; >-use Koha::Authorities; >-use Koha::Authority::MergeRequests; >-use Koha::Authority::Types; >-use Koha::Authority; >-use Koha::Database; >-use Koha::Libraries; >-use Koha::RecordProcessor; >-use Koha::SearchEngine; >-use Koha::SearchEngine::Indexer; >-use Koha::SearchEngine::Search; >- >-our ( @ISA, @EXPORT_OK ); >+use Modern::Perl; >+use base 'Exporter'; > > BEGIN { >- >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetTagsLabels > GetAuthMARCFromKohaField > >@@ -79,6 +52,29 @@ BEGIN { > ); > } > >+use MARC::Field; >+use Scalar::Util qw(blessed); >+use Try::Tiny qw( try catch ); >+ >+use C4::Context; >+use C4::Biblio qw( ModBiblio ); >+use C4::Search qw( FindDuplicate new_record_from_zebra ); >+use C4::AuthoritiesMarc::MARC21; >+use C4::AuthoritiesMarc::UNIMARC; >+use C4::Charset qw( SetUTF8Flag ); >+use C4::Log qw( logaction ); >+use Koha::MetadataRecord::Authority; >+use Koha::Authorities; >+use Koha::Authority::MergeRequests; >+use Koha::Authority::Types; >+use Koha::Authority; >+use Koha::Database; >+use Koha::Libraries; >+use Koha::RecordProcessor; >+use Koha::SearchEngine; >+use Koha::SearchEngine::Indexer; >+use Koha::SearchEngine::Search; >+ > =head1 NAME > > C4::AuthoritiesMarc >@@ -532,7 +528,7 @@ ORDER BY tagfield, display_order, tagsubfield" > > while ( > ( >- $tag, $subfield, $liblibrarian,, $libopac, $tab, >+ $tag, $subfield, $liblibrarian, $libopac, $tab, > $mandatory, $repeatable, $authorised_value, $authtypecode, > $value_builder, $kohafield, $seealso, $hidden, > $isurl, $defaultvalue, $display_order >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index c5e9e612b4a..2813f50019d 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -20,14 +20,10 @@ package C4::Biblio; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use vars qw(@ISA @EXPORT_OK); >+use base 'Exporter'; > > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > AddBiblio > GetBiblioData > GetISBDView >@@ -1565,7 +1561,7 @@ sub GetAuthorisedValueDesc { > Koha::AuthorisedValues->search( > { category => $category }, > { columns => [ 'authorised_value', 'lib_opac', 'lib' ] } >- )->as_list >+ )->as_list > }; > $cache->set_in_cache( $cache_key, $av_descriptions ); > } >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 538436d9a0a..ee8a95efb97 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -18,8 +18,11 @@ package C4::Breeding; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(BreedingSearch ImportBreedingAuth Z3950Search Z3950SearchAuth); >+} > > use C4::Biblio qw(TransformMarcToKoha); > use C4::Koha qw( GetVariationsOfISBN ); >@@ -32,14 +35,6 @@ use C4::Languages; > use Koha::Database; > use Koha::XSLT::Base; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw(BreedingSearch ImportBreedingAuth Z3950Search Z3950SearchAuth); >-} >- > =head1 NAME > > C4::Breeding : module to add biblios to import_records via >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 83acec0a925..50ca959d136 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -18,20 +18,9 @@ package C4::Budgets; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use JSON; >-use C4::Context; >-use Koha::Database; >-use Koha::Patrons; >-use Koha::Acquisition::Invoice::Adjustments; >-use C4::Acquisition; >-use C4::Log qw(logaction); >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > > GetBudget > GetBudgetByOrderNumber >@@ -84,6 +73,14 @@ BEGIN { > ); > } > >+use JSON; >+use C4::Context; >+use Koha::Database; >+use Koha::Patrons; >+use Koha::Acquisition::Invoice::Adjustments; >+use C4::Acquisition; >+use C4::Log qw(logaction); >+ > # ----------------------------BUDGETS.PM-----------------------------"; > > =head1 FUNCTIONS ABOUT BUDGETS >diff --git a/C4/Charset.pm b/C4/Charset.pm >index 8e45344e805..ea42bf49860 100644 >--- a/C4/Charset.pm >+++ b/C4/Charset.pm >@@ -18,20 +18,9 @@ package C4::Charset; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use MARC::Charset; >-use Text::Iconv; >-use Unicode::Normalize qw( NFC NFD ); >-use Encode; >- >-use Koha::Logger; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > NormalizeString > IsStringUTF8ish > MarcToUTF8Record >@@ -43,6 +32,13 @@ BEGIN { > ); > } > >+use MARC::Charset; >+use Text::Iconv; >+use Unicode::Normalize qw( NFC NFD ); >+use Encode; >+ >+use Koha::Logger; >+ > =encoding UTF-8 > > =head1 NAME >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e03a5e27fb7..ca17d3f5800 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -19,66 +19,12 @@ package C4::Circulation; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use DateTime; >-use POSIX qw( floor ); >-use Encode; >-use Try::Tiny; >-use JSON; >- >-use C4::Context; >-use C4::Stats qw( UpdateStats ); >-use C4::Reserves >- qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority IsAvailableForItemLevelRequest ); >-use C4::Biblio qw( UpdateTotalIssues ); >-use C4::Items qw( ModItemTransfer ModDateLastSeen CartToShelf ); >-use C4::Accounts; >-use C4::ItemCirculationAlertPreference; >-use C4::Message; >-use C4::Log qw( logaction ); # logaction >-use C4::Overdues; >-use C4::RotatingCollections qw(GetCollectionItemBranches); >-use Algorithm::CheckDigits qw( CheckDigits ); >- >-use Data::Dumper qw( Dumper ); >-use Koha::Account; >-use Koha::AuthorisedValues; >-use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue; >-use Koha::Biblioitems; >-use Koha::DateUtils qw( dt_from_string ); >-use Koha::Calendar; >-use Koha::Checkouts; >-use Koha::ILL::Requests; >-use Koha::Items; >-use Koha::Patrons; >-use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment ); >-use Koha::Database; >-use Koha::Libraries; >-use Koha::Account::Lines; >-use Koha::Holds; >-use Koha::Account::Lines; >-use Koha::Account::Offsets; >-use Koha::Config::SysPrefs; >-use Koha::Charges::Fees; >-use Koha::Config::SysPref; >-use Koha::Checkouts::ReturnClaims; >-use Koha::SearchEngine::Indexer; >-use Koha::Exceptions::Checkout; >-use Koha::Plugins; >-use Koha::Recalls; >-use Koha::Library::Hours; >-use Carp qw( carp ); >-use List::MoreUtils qw( any ); >-use Scalar::Util qw( looks_like_number blessed ); >-use Date::Calc qw( Date_to_Days ); >-our ( @ISA, @EXPORT_OK ); > >+use base 'Exporter'; > BEGIN { > >- require Exporter; >- @ISA = qw(Exporter); >- > # FIXME subs that should probably be elsewhere >- push @EXPORT_OK, qw( >+ our @EXPORT_OK = qw( > barcodedecode > LostItem > ReturnLostItem >@@ -129,6 +75,58 @@ BEGIN { > push @EXPORT_OK, '_GetCircControlBranch'; # This is wrong! > } > >+use DateTime; >+use POSIX qw( floor ); >+use Encode; >+use Try::Tiny; >+use JSON; >+ >+use C4::Context; >+use C4::Stats qw( UpdateStats ); >+use C4::Reserves >+ qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority IsAvailableForItemLevelRequest ); >+use C4::Biblio qw( UpdateTotalIssues ); >+use C4::Items qw( ModItemTransfer ModDateLastSeen CartToShelf ); >+use C4::Accounts; >+use C4::ItemCirculationAlertPreference; >+use C4::Message; >+use C4::Log qw( logaction ); # logaction >+use C4::Overdues; >+use C4::RotatingCollections qw(GetCollectionItemBranches); >+use Algorithm::CheckDigits qw( CheckDigits ); >+ >+use Data::Dumper qw( Dumper ); >+use Koha::Account; >+use Koha::AuthorisedValues; >+use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue; >+use Koha::Biblioitems; >+use Koha::DateUtils qw( dt_from_string ); >+use Koha::Calendar; >+use Koha::Checkouts; >+use Koha::ILL::Requests; >+use Koha::Items; >+use Koha::Patrons; >+use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment ); >+use Koha::Database; >+use Koha::Libraries; >+use Koha::Account::Lines; >+use Koha::Holds; >+use Koha::Account::Lines; >+use Koha::Account::Offsets; >+use Koha::Config::SysPrefs; >+use Koha::Charges::Fees; >+use Koha::Config::SysPref; >+use Koha::Checkouts::ReturnClaims; >+use Koha::SearchEngine::Indexer; >+use Koha::Exceptions::Checkout; >+use Koha::Plugins; >+use Koha::Recalls; >+use Koha::Library::Hours; >+use Carp qw( carp ); >+use List::MoreUtils qw( any ); >+use Scalar::Util qw( looks_like_number blessed ); >+use Date::Calc qw( Date_to_Days ); >+ > =head1 NAME > > C4::Circulation - Koha circulation module >diff --git a/C4/ClassSortRoutine.pm b/C4/ClassSortRoutine.pm >index d3d830cd687..30ff89ea8d1 100644 >--- a/C4/ClassSortRoutine.pm >+++ b/C4/ClassSortRoutine.pm >@@ -18,20 +18,16 @@ package C4::ClassSortRoutine; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use Class::Factory::Util; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetSortRoutineNames > GetClassSortKey > ); > } > >+use Class::Factory::Util; >+ > =head1 NAME > > C4::ClassSortRoutine - base object for creation of classification sorting >diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm >index 0488b45b02d..cbd105796df 100644 >--- a/C4/ClassSource.pm >+++ b/C4/ClassSource.pm >@@ -17,18 +17,9 @@ package C4::ClassSource; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use C4::Context; >-use C4::ClassSortRoutine qw( GetClassSortKey ); >- >-use Koha::Cache::Memory::Lite; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetClassSources > GetClassSource > GetClassSortRule >@@ -36,6 +27,11 @@ BEGIN { > ); > } > >+use C4::Context; >+use C4::ClassSortRoutine qw( GetClassSortKey ); >+ >+use Koha::Cache::Memory::Lite; >+ > =head1 NAME > > C4::ClassSources - handle classification sources in Koha >diff --git a/C4/ClassSplitRoutine.pm b/C4/ClassSplitRoutine.pm >index 7ea7ab4282a..839cb991c36 100644 >--- a/C4/ClassSplitRoutine.pm >+++ b/C4/ClassSplitRoutine.pm >@@ -18,19 +18,15 @@ package C4::ClassSplitRoutine; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use Class::Factory::Util; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetSplitRoutineNames > ); > } > >+use Class::Factory::Util; >+ > =head1 NAME > > C4::ClassSplitRoutine - base object for creation of classification splitting routines >diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm >index 794c49b3270..b65ec4dab75 100644 >--- a/C4/CourseReserves.pm >+++ b/C4/CourseReserves.pm >@@ -16,24 +16,10 @@ package C4::CourseReserves; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use List::MoreUtils qw( any ); >- >-use C4::Context; >- >-use Koha::Courses; >-use Koha::Course::Instructors; >-use Koha::Course::Items; >-use Koha::Course::Reserves; >-use Koha::Checkouts; >- >+use base 'Exporter'; > use vars qw(@FIELDS); >-our ( @ISA, @EXPORT_OK ); >- > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetCourse > ModCourse > GetCourses >@@ -58,6 +44,16 @@ BEGIN { > @FIELDS = ( 'itype', 'ccode', 'homebranch', 'holdingbranch', 'location' ); > } > >+use List::MoreUtils qw( any ); >+ >+use C4::Context; >+ >+use Koha::Courses; >+use Koha::Course::Instructors; >+use Koha::Course::Items; >+use Koha::Course::Reserves; >+use Koha::Checkouts; >+ > =head1 NAME > > C4::CourseReserves - Koha course reserves module >diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm >index 5129fc4af7e..37e668d9e18 100644 >--- a/C4/External/BakerTaylor.pm >+++ b/C4/External/BakerTaylor.pm >@@ -18,21 +18,20 @@ package C4::External::BakerTaylor; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(availability content_cafe_url image_url link_url http_jacket_link); >+} >+ > use XML::Simple; > use LWP::Simple qw( get ); > > use C4::Context; > >-use Modern::Perl; >- > use vars qw(%EXPORT_TAGS $VERSION); >-our ( @ISA, @EXPORT_OK ); >- > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); > $VERSION = 3.07.00.049; >- @EXPORT_OK = qw(availability content_cafe_url image_url link_url http_jacket_link); > } > > # These variables are plack safe: they are initialized each time >diff --git a/C4/Heading.pm b/C4/Heading.pm >index dcfd0a83f6b..47a7f9bd7ff 100644 >--- a/C4/Heading.pm >+++ b/C4/Heading.pm >@@ -18,6 +18,12 @@ package C4::Heading; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ new_from_field >+ ) >+} > > use MARC::Field; > use C4::Context; >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 79373937dc5..9f9814db44e 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -19,8 +19,20 @@ package C4::HoldsQueue; > > # FIXME: expand perldoc, explain intended logic > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ CreateQueue >+ GetHoldsQueueItems >+ >+ TransportCostMatrix >+ UpdateTransportCostMatrix >+ GetPendingHoldRequestsForBib >+ load_branches_to_pull_from >+ update_queue_for_biblio >+ ); >+} > > use C4::Context; > use C4::Circulation qw( GetBranchItemRule ); >@@ -35,23 +47,6 @@ use List::Util qw( shuffle ); > use List::MoreUtils qw( any ); > use Algorithm::Munkres qw(); > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- CreateQueue >- GetHoldsQueueItems >- >- TransportCostMatrix >- UpdateTransportCostMatrix >- GetPendingHoldRequestsForBib >- load_branches_to_pull_from >- update_queue_for_biblio >- ); >-} >- > =head1 FUNCTIONS > > =head2 TransportCostMatrix >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index b7b9635af90..55fb0a5a8e9 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -17,37 +17,10 @@ package C4::ImportBatch; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >- >-use C4::Context; >-use C4::Koha qw( GetNormalizedISBN ); >-use C4::Biblio qw( >- AddBiblio >- DelBiblio >- GetMarcFromKohaField >- GetXmlBiblio >- ModBiblio >- TransformMarcToKoha >-); >-use C4::Items qw( AddItemFromMarc ModItemFromMarc ); >-use C4::Charset qw( MarcToUTF8Record SetUTF8Flag StripNonXmlChars ); >-use C4::AuthoritiesMarc >- qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority GetAuthorizedHeading ); >-use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); >-use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue; >-use Koha::Items; >-use Koha::SearchEngine; >-use Koha::SearchEngine::Indexer; >-use Koha::Plugins::Handler; >-use Koha::Logger; >- >-our ( @ISA, @EXPORT_OK ); >- >+use Modern::Perl; >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetZ3950BatchId > GetWebserviceBatchId > GetImportRecordMarc >@@ -97,6 +70,29 @@ BEGIN { > ); > } > >+use C4::Context; >+use C4::Koha qw( GetNormalizedISBN ); >+use C4::Biblio qw( >+ AddBiblio >+ DelBiblio >+ GetMarcFromKohaField >+ GetXmlBiblio >+ ModBiblio >+ TransformMarcToKoha >+); >+use C4::Items qw( AddItemFromMarc ModItemFromMarc ); >+use C4::Charset qw( MarcToUTF8Record SetUTF8Flag StripNonXmlChars ); >+use C4::AuthoritiesMarc >+ qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority GetAuthorizedHeading ); >+use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); >+use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue; >+use Koha::Items; >+use Koha::SearchEngine; >+use Koha::SearchEngine::Indexer; >+use Koha::Plugins::Handler; >+use Koha::Logger; >+ >+ > =head1 NAME > > C4::ImportBatch - manage batches of imported MARC records >diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm >index 72685a69a92..59384ea3b8c 100644 >--- a/C4/ImportExportFramework.pm >+++ b/C4/ImportExportFramework.pm >@@ -17,8 +17,16 @@ package C4::ImportExportFramework; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ ExportFramework >+ ImportFramework >+ createODS >+ ); >+} >+ > use XML::LibXML; > use XML::LibXML::XPathContext; > use Digest::MD5; >@@ -29,18 +37,6 @@ use List::MoreUtils qw( indexes ); > use C4::Context; > use Koha::Logger; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- ExportFramework >- ImportFramework >- createODS >- ); >-} >- > use constant XMLSTR => '<?xml version="1.0" encoding="UTF-8"?> > <?mso-application progid="Excel.Sheet"?> > <Workbook >diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm >index 18d97fb86d0..59a4a90148b 100644 >--- a/C4/InstallAuth.pm >+++ b/C4/InstallAuth.pm >@@ -18,27 +18,23 @@ package C4::InstallAuth; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ checkauth >+ get_template_and_user >+ ); >+} >+ > use CGI::Session; > use File::Spec; > >-require Exporter; >- > use C4::Context; > use C4::Output qw( output_html_with_http_headers ); > use C4::Templates; > > use Koha::Session; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- checkauth >- get_template_and_user >- ); >-} >- > =head1 NAME > > InstallAuth - Authenticates Koha users for Install process >diff --git a/C4/Items.pm b/C4/Items.pm >index 2c22518dc5b..210dbc7ad99 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -19,14 +19,9 @@ package C4::Items; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > AddItemFromMarc > AddItemBatchFromMarc > ModItemFromMarc >diff --git a/C4/Koha.pm b/C4/Koha.pm >index bee096db9fc..4ce802774d0 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -20,21 +20,10 @@ package C4::Koha; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use C4::Context; >-use Koha::Caches; >-use Koha::AuthorisedValues; >-use Koha::Libraries; >-use Koha::MarcSubfieldStructures; >-use Business::ISBN; >-use Business::ISSN; >- >-our ( @ISA, @EXPORT_OK ); >+use base 'Exporter'; > > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetItemTypesCategorized > getallthemes > getFacets >@@ -60,6 +49,14 @@ BEGIN { > ); > } > >+use C4::Context; >+use Koha::Caches; >+use Koha::AuthorisedValues; >+use Koha::Libraries; >+use Koha::MarcSubfieldStructures; >+use Business::ISBN; >+use Business::ISSN; >+ > =head1 NAME > > C4::Koha - Perl Module containing convenience functions for Koha scripts >diff --git a/C4/Languages.pm b/C4/Languages.pm >index 2f669c96c5c..15bfb746410 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -18,23 +18,10 @@ package C4::Languages; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >- >-use Carp qw( carp ); >-use CGI; >-use List::MoreUtils qw( any ); >-use C4::Context; >-use Koha::Caches; >-use Koha::Cache::Memory::Lite; >-use Koha::Language; >- >-our ( @ISA, @EXPORT_OK ); >- >+use Modern::Perl; >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > getFrameworkLanguages > getTranslatedLanguages > getLanguages >@@ -44,6 +31,14 @@ BEGIN { > qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage get_rfc4646_from_iso639); > } > >+use Carp qw( carp ); >+use CGI; >+use List::MoreUtils qw( any ); >+use C4::Context; >+use Koha::Caches; >+use Koha::Cache::Memory::Lite; >+use Koha::Language; >+ > =head1 NAME > > C4::Languages - Perl Module containing language list functions for Koha >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 89ad7d7ce25..0998e01509a 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -18,6 +18,26 @@ package C4::Letters; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ GetLetters >+ GetLettersAvailableForALibrary >+ GetLetterTemplates >+ DelLetter >+ GetPreparedLetter >+ GetWrappedLetter >+ SendAlerts >+ GetPrintMessages >+ GetQueuedMessages >+ GetMessage >+ GetMessageTransportTypes >+ >+ EnqueueLetter >+ SendQueuedMessages >+ ResendMessage >+ ); >+} > > use Carp qw( carp croak ); > use Template; >@@ -44,30 +64,6 @@ use Koha::Template::Plugin::KohaDates; > > use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822'; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- GetLetters >- GetLettersAvailableForALibrary >- GetLetterTemplates >- DelLetter >- GetPreparedLetter >- GetWrappedLetter >- SendAlerts >- GetPrintMessages >- GetQueuedMessages >- GetMessage >- GetMessageTransportTypes >- >- EnqueueLetter >- SendQueuedMessages >- ResendMessage >- ); >-} >- > our $domain_limits = {}; > > =head1 NAME >diff --git a/C4/Members.pm b/C4/Members.pm >index dab47be3219..5bde8bd9ac9 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -20,6 +20,15 @@ package C4::Members; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ GetBorrowersToExpunge >+ >+ IssueSlip >+ ); >+} >+ > use C4::Context; > use Scalar::Util qw( looks_like_number ); > use Date::Calc qw( check_date Date_to_Days ); >@@ -36,18 +45,6 @@ use Koha::AdditionalContents; > use Koha::Patrons; > use Koha::Patron::Categories; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- GetBorrowersToExpunge >- >- IssueSlip >- ); >-} >- > =head1 NAME > > C4::Members - Perl Module containing convenience functions for member handling >diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm >index 81e1e2c6c3f..95fb52e4a3c 100644 >--- a/C4/Members/Messaging.pm >+++ b/C4/Members/Messaging.pm >@@ -17,8 +17,16 @@ package C4::Members::Messaging; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ GetMessagingPreferences >+ SetMessagingPreference >+ GetMessagingOptions >+ SetMessagingPreferencesFromDefaults >+ ) >+} >+ > use C4::Context; > > =head1 NAME >diff --git a/C4/Members/Statistics.pm b/C4/Members/Statistics.pm >index 3f6d9b43078..7d3d40696af 100644 >--- a/C4/Members/Statistics.pm >+++ b/C4/Members/Statistics.pm >@@ -23,16 +23,9 @@ C4::Members::Statistics - Get statistics for patron checkouts > =cut > > use Modern::Perl; >- >-use C4::Context; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > get_fields > GetTotalIssuesTodayByBorrower > GetTotalIssuesReturnedTodayByBorrower >@@ -40,6 +33,8 @@ BEGIN { > ); > } > >+use C4::Context; >+ > =head2 get_fields > Get fields form syspref 'StatisticsFields' > Returns list of valid fields, defaults to 'location|itype|ccode' >diff --git a/C4/Output.pm b/C4/Output.pm >index a98170a3607..cc741cf24a9 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -25,22 +25,9 @@ package C4::Output; > # templates. > > use Modern::Perl; >- >-use HTML::Entities; >-use Scalar::Util qw( looks_like_number ); >-use URI::Escape; >- >-use C4::Auth qw( get_template_and_user ); >-use C4::Context; >-use C4::Templates; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > is_ajax > ajax_fail > setlanguagecookie getlanguagecookie pagination_bar parametrized_url >@@ -49,6 +36,14 @@ BEGIN { > ); > } > >+use HTML::Entities; >+use Scalar::Util qw( looks_like_number ); >+use URI::Escape; >+ >+use C4::Auth qw( get_template_and_user ); >+use C4::Context; >+use C4::Templates; >+ > =head1 NAME > > C4::Output - Functions for managing output, is slowly being deprecated >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 98223902391..21bbb2ddece 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -19,6 +19,24 @@ package C4::Overdues; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ # subs to rename (and maybe merge some...) >+ our @EXPORT_OK = qw( >+ CalcFine >+ Getoverdues >+ checkoverdues >+ UpdateFine >+ GetFine >+ GetBranchcodesWithOverdueRules >+ get_chargeable_units >+ GetOverduesForBranch >+ GetOverdueMessageTransportTypes >+ parse_overdues_letter >+ GetIssuesIteminfo >+ ); >+} >+ > use Date::Calc qw( Today ); > use Date::Manip qw( UnixDate ); > use List::MoreUtils qw( uniq ); >@@ -36,28 +54,6 @@ use Koha::Recalls; > use Koha::Logger; > use Koha::Patrons; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- >- # subs to rename (and maybe merge some...) >- @EXPORT_OK = qw( >- CalcFine >- Getoverdues >- checkoverdues >- UpdateFine >- GetFine >- GetBranchcodesWithOverdueRules >- get_chargeable_units >- GetOverduesForBranch >- GetOverdueMessageTransportTypes >- parse_overdues_letter >- GetIssuesIteminfo >- ); >-} >- > =head1 NAME > > C4::Circulation::Fines - Koha module dealing with fines >diff --git a/C4/Reports.pm b/C4/Reports.pm >index fc48fdd6c13..7a5cdbd1877 100644 >--- a/C4/Reports.pm >+++ b/C4/Reports.pm >@@ -18,20 +18,17 @@ package C4::Reports; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use CGI qw ( -utf8 ); >- >-use C4::Context; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetDelimiterChoices > ); > } > >+use CGI qw ( -utf8 ); >+ >+use C4::Context; >+ > =head1 NAME > > C4::Reports - Module for generating reports >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 94e271cef7b..6844367e1e8 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -18,6 +18,24 @@ package C4::Reports::Guided; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ get_report_types get_report_areas get_report_groups get_columns build_query get_criteria >+ save_report get_saved_reports execute_query >+ get_column_type get_distinct_values save_dictionary get_from_dictionary >+ delete_definition delete_report store_results format_results get_sql get_results >+ nb_rows update_sql >+ strip_limit >+ convert_sql >+ GetReservedAuthorisedValues >+ GetParametersFromSQL >+ IsAuthorisedValueValid >+ ValidateSQLParameters >+ nb_rows update_sql >+ EmailReport >+ ); >+} > > use CGI qw ( -utf8 ); > use Carp qw( carp croak ); >@@ -39,28 +57,6 @@ use Koha::Reports; > use Koha::SharedContent; > use Koha::TemplateUtils qw( process_tt ); > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- get_report_types get_report_areas get_report_groups get_columns build_query get_criteria >- save_report get_saved_reports execute_query >- get_column_type get_distinct_values save_dictionary get_from_dictionary >- delete_definition delete_report store_results format_results get_sql get_results >- nb_rows update_sql >- strip_limit >- convert_sql >- GetReservedAuthorisedValues >- GetParametersFromSQL >- IsAuthorisedValueValid >- ValidateSQLParameters >- nb_rows update_sql >- EmailReport >- ); >-} >- > =head1 NAME > > C4::Reports::Guided - Module for generating guided reports >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 84957f11790..f30edeab4fe 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -21,6 +21,47 @@ package C4::Reserves; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+ >+BEGIN { >+ our @EXPORT_OK = qw( >+ AddReserve >+ >+ GetReserveStatus >+ >+ ChargeReserveFee >+ GetReserveFee >+ >+ ModReserveAffect >+ ModReserve >+ ModReserveStatus >+ ModReserveCancelAll >+ ModReserveMinusPriority >+ MoveReserve >+ >+ CheckReserves >+ CanBookBeReserved >+ CanItemBeReserved >+ CancelExpiredReserves >+ >+ AutoUnsuspendReserves >+ >+ IsAvailableForItemLevelRequest >+ ItemsAnyAvailableAndNotRestricted >+ >+ AlterPriority >+ ToggleLowestPriority >+ >+ ReserveSlip >+ SuspendAll >+ >+ CalculatePriority >+ >+ GetMaxPatronHoldsForRecord >+ >+ MergeHolds >+ ); >+} > > use C4::Accounts; > use C4::Biblio qw( GetMarcFromKohaField ); >@@ -96,50 +137,6 @@ This modules provides some functions to deal with reservations. > > =cut > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- AddReserve >- >- GetReserveStatus >- >- ChargeReserveFee >- GetReserveFee >- >- ModReserveAffect >- ModReserve >- ModReserveStatus >- ModReserveCancelAll >- ModReserveMinusPriority >- MoveReserve >- >- CheckReserves >- CanBookBeReserved >- CanItemBeReserved >- CancelExpiredReserves >- >- AutoUnsuspendReserves >- >- IsAvailableForItemLevelRequest >- ItemsAnyAvailableAndNotRestricted >- >- AlterPriority >- ToggleLowestPriority >- >- ReserveSlip >- SuspendAll >- >- CalculatePriority >- >- GetMaxPatronHoldsForRecord >- >- MergeHolds >- ); >-} >- > =head2 AddReserve > > AddReserve( >diff --git a/C4/SIP/Logger.pm b/C4/SIP/Logger.pm >index 42c19f00ec8..99460d20124 100644 >--- a/C4/SIP/Logger.pm >+++ b/C4/SIP/Logger.pm >@@ -3,7 +3,7 @@ package C4::SIP::Logger; > use Modern::Perl; > > use base 'Exporter'; >-our @EXPORT_OK = qw ( get_logger set_logger ); >+BEGIN { our @EXPORT_OK = qw ( get_logger set_logger ); } > > our $activeSIPServer; > our $activeLogger; >diff --git a/C4/SIP/Sip/Checksum.pm b/C4/SIP/Sip/Checksum.pm >index 4571c42d9b0..f69f5a8bee2 100644 >--- a/C4/SIP/Sip/Checksum.pm >+++ b/C4/SIP/Sip/Checksum.pm >@@ -1,11 +1,10 @@ > package C4::SIP::Sip::Checksum; > >-use Exporter; >-use strict; >-use warnings; >- >-our @ISA = qw(Exporter); >-our @EXPORT_OK = qw(checksum verify_cksum); >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(checksum verify_cksum); >+} > > sub checksum { > my $pkt = shift; >diff --git a/C4/Scheduler.pm b/C4/Scheduler.pm >index dfae1b8a465..89d5577031d 100644 >--- a/C4/Scheduler.pm >+++ b/C4/Scheduler.pm >@@ -18,18 +18,14 @@ package C4::Scheduler; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); >+} > > use C4::Context; > use Schedule::At; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); >-} >- > =head1 NAME > > C4::Scheduler - Module for running jobs with the unix at command >diff --git a/C4/Search.pm b/C4/Search.pm >index a8c89b4998a..a7305fbab5a 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -16,6 +16,22 @@ package C4::Search; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ FindDuplicate >+ SimpleSearch >+ searchResults >+ getRecords >+ buildQuery >+ GetDistinctValues >+ enabled_staff_search_views >+ new_record_from_zebra >+ z3950_search_args >+ getIndexes >+ ); >+} >+ > use C4::Context; > use C4::Biblio qw( TransformMarcToKoha GetMarcFromKohaField GetFrameworkCode GetAuthorisedValueDesc GetBiblioData ); > use C4::Koha >@@ -43,25 +59,6 @@ use MARC::Field; > use POSIX qw(setlocale LC_COLLATE); > use Unicode::Collate::Locale; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- FindDuplicate >- SimpleSearch >- searchResults >- getRecords >- buildQuery >- GetDistinctValues >- enabled_staff_search_views >- new_record_from_zebra >- z3950_search_args >- getIndexes >- ); >-} >- > =head1 NAME > > C4::Search - Functions for searching the Koha catalog. >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 18f7318e506..01c763a5a57 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -19,6 +19,40 @@ package C4::Serials; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ NewSubscription ModSubscription DelSubscription >+ GetSubscription CountSubscriptionFromBiblionumber GetSubscriptionsFromBiblionumber >+ SearchSubscriptions >+ GetFullSubscriptionsFromBiblionumber GetFullSubscription ModSubscriptionHistory >+ HasSubscriptionStrictlyExpired HasSubscriptionExpired GetExpirationDate abouttoexpire >+ GetFictiveIssueNumber >+ GetSubscriptionHistoryFromSubscriptionId >+ >+ GetNextSeq GetSeq NewIssue GetSerials >+ GetLatestSerials ModSerialStatus GetNextDate >+ CloseSubscription ReopenSubscription >+ subscriptionCurrentlyOnOrder >+ can_claim_subscription can_edit_subscription can_show_subscription >+ GetSerials2 >+ GetSubscriptionLength ReNewSubscription GetLateOrMissingIssues >+ GetSerialInformation AddItem2Serial >+ PrepareSerialsData GetNextExpected ModNextExpected >+ GetSubscriptionIrregularities >+ GetPreviousSerialid >+ >+ GetSuppliersWithLateIssues >+ getroutinglist delroutingmember addroutingmember >+ reorder_members >+ check_routing updateClaim >+ CountIssues >+ HasItems >+ >+ findSerialsByStatus >+ >+ ); >+} > > use Carp qw( croak ); > use Date::Calc qw( >@@ -73,44 +107,6 @@ use constant MISSING_STATUSES => ( > MISSING_LOST > ); > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- NewSubscription ModSubscription DelSubscription >- GetSubscription CountSubscriptionFromBiblionumber GetSubscriptionsFromBiblionumber >- SearchSubscriptions >- GetFullSubscriptionsFromBiblionumber GetFullSubscription ModSubscriptionHistory >- HasSubscriptionStrictlyExpired HasSubscriptionExpired GetExpirationDate abouttoexpire >- GetFictiveIssueNumber >- GetSubscriptionHistoryFromSubscriptionId >- >- GetNextSeq GetSeq NewIssue GetSerials >- GetLatestSerials ModSerialStatus GetNextDate >- CloseSubscription ReopenSubscription >- subscriptionCurrentlyOnOrder >- can_claim_subscription can_edit_subscription can_show_subscription >- GetSerials2 >- GetSubscriptionLength ReNewSubscription GetLateOrMissingIssues >- GetSerialInformation AddItem2Serial >- PrepareSerialsData GetNextExpected ModNextExpected >- GetSubscriptionIrregularities >- GetPreviousSerialid >- >- GetSuppliersWithLateIssues >- getroutinglist delroutingmember addroutingmember >- reorder_members >- check_routing updateClaim >- CountIssues >- HasItems >- >- findSerialsByStatus >- >- ); >-} >- > =head1 NAME > > C4::Serials - Serials Module Functions >diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm >index 4bbe1cc5b37..0f38ad82d51 100644 >--- a/C4/ShelfBrowser.pm >+++ b/C4/ShelfBrowser.pm >@@ -17,8 +17,13 @@ package C4::ShelfBrowser; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ GetNearbyItems >+ ); >+} > > use C4::Biblio qw( GetAuthorisedValueDesc ); > use C4::Context; >@@ -26,16 +31,6 @@ use C4::Koha qw( GetNormalizedUPC GetNormalizedOCLCNumber GetNormalizedISBN GetN > use Koha::Biblios; > use Koha::Libraries; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- GetNearbyItems >- ); >-} >- > =head1 NAME > > C4::ShelfBrowser - functions that deal with the shelf browser feature found in >diff --git a/C4/Stats.pm b/C4/Stats.pm >index fcf8eb66f04..f04474d4927 100644 >--- a/C4/Stats.pm >+++ b/C4/Stats.pm >@@ -18,19 +18,16 @@ package C4::Stats; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use Koha::Statistics; >- >-our ( @ISA, @EXPORT_OK ); >+use base 'Exporter'; > > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > UpdateStats > ); > } > >+use Koha::Statistics; >+ > =head1 NAME > > C4::Stats - Update Koha statistics (log) >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index a07c30131a2..a1585b47e22 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -19,6 +19,24 @@ package C4::Suggestions; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT = qw( >+ ConnectSuggestionAndBiblio >+ DelSuggestion >+ GetSuggestion >+ GetSuggestionByStatus >+ GetSuggestionFromBiblionumber >+ GetSuggestionInfoFromBiblionumber >+ GetSuggestionInfo >+ ModStatus >+ ModSuggestion >+ DelSuggestionsOlderThan >+ GetUnprocessedSuggestions >+ MarcRecordFromNewSuggestion >+ ); >+} >+ > use CGI qw ( -utf8 ); > > use C4::Context; >@@ -29,23 +47,6 @@ use Koha::DateUtils qw( dt_from_string ); > use Koha::Suggestions; > use C4::Log qw(logaction); > >-use base qw(Exporter); >- >-our @EXPORT = qw( >- ConnectSuggestionAndBiblio >- DelSuggestion >- GetSuggestion >- GetSuggestionByStatus >- GetSuggestionFromBiblionumber >- GetSuggestionInfoFromBiblionumber >- GetSuggestionInfo >- ModStatus >- ModSuggestion >- DelSuggestionsOlderThan >- GetUnprocessedSuggestions >- MarcRecordFromNewSuggestion >-); >- > =head1 NAME > > C4::Suggestions - Some useful functions for dealings with aqorders. >diff --git a/C4/Tags.pm b/C4/Tags.pm >index ec8c8d840fd..689f149180b 100644 >--- a/C4/Tags.pm >+++ b/C4/Tags.pm >@@ -18,24 +18,11 @@ package C4::Tags; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >-use Carp qw( carp ); >-use Exporter; >- >+use Modern::Perl; >+use base 'Exporter'; > use C4::Context; >-use Module::Load::Conditional qw( check_install ); >-use Koha::Tags; >-use Koha::Tags::Approvals; >-use Koha::Tags::Indexes; >-use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created); >-use constant TAG_SELECT => "SELECT " . join( ',', TAG_FIELDS ) . "\n FROM tags_all\n"; >- >-our ( @ISA, @EXPORT_OK ); >- > BEGIN { >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > get_tags get_tag_rows > add_tags > add_tag >@@ -64,6 +51,15 @@ BEGIN { > } > } > >+use Carp qw( carp ); >+ >+use Module::Load::Conditional qw( check_install ); >+use Koha::Tags; >+use Koha::Tags::Approvals; >+use Koha::Tags::Indexes; >+use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created); >+use constant TAG_SELECT => "SELECT " . join( ',', TAG_FIELDS ) . "\n FROM tags_all\n"; >+ > =head1 C4::Tags.pm - Support for user tagging of biblios. > > =cut >diff --git a/C4/TmplTokenType.pm b/C4/TmplTokenType.pm >index 18fa6c4ef3a..a62778a54b9 100644 >--- a/C4/TmplTokenType.pm >+++ b/C4/TmplTokenType.pm >@@ -18,7 +18,7 @@ package C4::TmplTokenType; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-require Exporter; >+use base 'Exporter'; > > ############################################################################### > >@@ -40,13 +40,8 @@ The predefined constants are > use vars qw( $_text $_text_parametrized $_cdata > $_tag $_decl $_pi $_directive $_comment $_null $_unknown ); > >-our ( @ISA, @EXPORT_OK ); >- > BEGIN { >- >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > TEXT > TEXT_PARAMETRIZED > CDATA >diff --git a/C4/XISBN.pm b/C4/XISBN.pm >index 73e8ef1c44e..620d6c59267 100644 >--- a/C4/XISBN.pm >+++ b/C4/XISBN.pm >@@ -19,6 +19,13 @@ package C4::XISBN; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ get_xisbns >+ ); >+} >+ > use XML::Simple; > > use C4::Biblio qw(TransformMarcToKoha); >@@ -31,16 +38,6 @@ use Koha::Biblios; > use Koha::SearchEngine; > use Koha::SearchEngine::Search; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- get_xisbns >- ); >-} >- > =head1 NAME > > C4::XISBN - Functions for retrieving XISBN content in Koha >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 422a02b1ea7..51e28ddfde6 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -22,31 +22,28 @@ package C4::XSLT; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use C4::Context; >-use C4::Koha qw( xml_escape ); >-use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); >-use Koha::AuthorisedValues; >-use Koha::ItemTypes; >-use Koha::RecordProcessor; >+use base 'Exporter'; > use Koha::XSLT::Base; >-use Koha::Libraries; >-use Koha::Recalls; >- > my $engine; #XSLT Handler object > >-our ( @ISA, @EXPORT_OK ); >- > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > buildKohaItemsNamespace > XSLTParse4Display > ); > $engine = Koha::XSLT::Base->new( { do_not_return_source => 1 } ); > } > >+ >+use C4::Context; >+use C4::Koha qw( xml_escape ); >+use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); >+use Koha::AuthorisedValues; >+use Koha::ItemTypes; >+use Koha::RecordProcessor; >+use Koha::Libraries; >+use Koha::Recalls; >+ > =head1 NAME > > C4::XSLT - Functions for displaying XSLT-generated content >diff --git a/Koha/AuthUtils.pm b/Koha/AuthUtils.pm >index 66968e04d16..3e9e5ba78e0 100644 >--- a/Koha/AuthUtils.pm >+++ b/Koha/AuthUtils.pm >@@ -18,6 +18,11 @@ package Koha::AuthUtils; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(hash_password get_script_name is_password_valid); >+} >+ > use Crypt::Eksblowfish::Bcrypt qw( bcrypt en_base64 ); > use Encode; > use Fcntl qw( O_RDONLY ); # O_RDONLY is used in generate_salt >@@ -27,14 +32,6 @@ use Koha::Exceptions::Password; > > use C4::Context; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw(hash_password get_script_name is_password_valid); >-} >- > =head1 NAME > > Koha::AuthUtils - utility routines for authentication >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 0c4098c1333..8d8a2e153a2 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -17,18 +17,9 @@ package Koha::DateUtils; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use DateTime; >-use C4::Context; >-use Koha::Exceptions; >-use Koha::DateTime::Format::RFC3339; >- >-use vars qw(@ISA @EXPORT_OK); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > dt_from_string > output_pref > format_sqldatetime >@@ -36,6 +27,11 @@ BEGIN { > ); > } > >+use DateTime; >+use C4::Context; >+use Koha::Exceptions; >+use Koha::DateTime::Format::RFC3339; >+ > =head1 DateUtils > > Koha::DateUtils - Transitional wrappers to ease use of DateTime >diff --git a/Koha/Devel/Files.pm b/Koha/Devel/Files.pm >index f6446414042..066b0f8820b 100644 >--- a/Koha/Devel/Files.pm >+++ b/Koha/Devel/Files.pm >@@ -1,7 +1,6 @@ > package Koha::Devel::Files; > > use Modern::Perl; >-our ( @ISA, @EXPORT_OK ); > > =head1 NAME > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index 58b3209fd14..38cf1eb0217 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -17,9 +17,18 @@ package Koha::EDI; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > use base qw(Exporter); >+BEGIN { >+ our @EXPORT_OK = qw( >+ process_quote >+ process_invoice >+ process_ordrsp >+ create_edi_order >+ get_edifact_ean >+ ); >+} >+ > use utf8; > use English qw{ -no_match_vars }; > use Business::ISBN; >@@ -48,20 +57,6 @@ use Koha::Util::FrameworkPlugin qw( biblio_008 ); > > our $VERSION = 1.1; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- process_quote >- process_invoice >- process_ordrsp >- create_edi_order >- get_edifact_ean >- ); >-} >- > sub create_edi_order { > my $parameters = shift; > my $basketno = $parameters->{basketno}; >diff --git a/Koha/I18N.pm b/Koha/I18N.pm >index 3fbbabe685f..9226fbb5d4f 100644 >--- a/Koha/I18N.pm >+++ b/Koha/I18N.pm >@@ -18,25 +18,7 @@ package Koha::I18N; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use C4::Languages; >-use C4::Context; >- >-use Encode; >-use List::Util qw( first ); >-use Locale::Messages qw( >- bindtextdomain >- gettext >- LC_MESSAGES >- ngettext >- npgettext >- pgettext >- textdomain >-); >-use POSIX qw(); >-use Koha::Cache::Memory::Lite; >- >-use parent 'Exporter'; >+use base 'Exporter'; > our @EXPORT = qw( > __ > __x >@@ -57,6 +39,23 @@ our @EXPORT_OK = qw( > available_locales > ); > >+use C4::Languages; >+use C4::Context; >+ >+use Encode; >+use List::Util qw( first ); >+use Locale::Messages qw( >+ bindtextdomain >+ gettext >+ LC_MESSAGES >+ ngettext >+ npgettext >+ pgettext >+ textdomain >+); >+use POSIX qw(); >+use Koha::Cache::Memory::Lite; >+ > our $textdomain = 'Koha'; > > =head1 NAME >diff --git a/Koha/Item/Search/Field.pm b/Koha/Item/Search/Field.pm >index e30f9e59532..e48198ed7a3 100644 >--- a/Koha/Item/Search/Field.pm >+++ b/Koha/Item/Search/Field.pm >@@ -1,13 +1,9 @@ > package Koha::Item::Search::Field; > > use Modern::Perl; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > AddItemSearchField > ModItemSearchField > DelItemSearchField >diff --git a/Koha/List/Patron.pm b/Koha/List/Patron.pm >index e9a7cb7b9a4..b4329081259 100644 >--- a/Koha/List/Patron.pm >+++ b/Koha/List/Patron.pm >@@ -26,17 +26,9 @@ Koha::List::Patron - Management of lists of patrons > =cut > > use Modern::Perl; >- >-use Carp qw( carp croak ); >- >-use Koha::Database; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > GetPatronLists > > DelPatronList >@@ -48,6 +40,10 @@ BEGIN { > ); > } > >+use Carp qw( carp croak ); >+ >+use Koha::Database; >+ > =head2 GetPatronLists > > my @lists = GetPatronLists( $params ); >diff --git a/Koha/Patron/Debarments.pm b/Koha/Patron/Debarments.pm >index b46cc968443..3235767b8d5 100644 >--- a/Koha/Patron/Debarments.pm >+++ b/Koha/Patron/Debarments.pm >@@ -18,21 +18,9 @@ package Koha::Patron::Debarments; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use C4::Context; >-use C4::Log qw( logaction ); >- >-use Koha::Database; >-use Koha::Patrons; >-use Koha::Patron::Restriction::Types; >-use Koha::Patron::Restrictions; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > AddDebarment > DelDebarment > ModDebarment >@@ -43,6 +31,14 @@ BEGIN { > ); > } > >+use C4::Context; >+use C4::Log qw( logaction ); >+ >+use Koha::Database; >+use Koha::Patrons; >+use Koha::Patron::Restriction::Types; >+use Koha::Patron::Restrictions; >+ > =head1 Koha::Patron::Debarments > > Koha::Patron::Debarments - Module for managing patron debarments >diff --git a/Koha/Patron/Password/Recovery.pm b/Koha/Patron/Password/Recovery.pm >index 36f577ce398..1b51544ebfc 100644 >--- a/Koha/Patron/Password/Recovery.pm >+++ b/Koha/Patron/Password/Recovery.pm >@@ -18,6 +18,17 @@ package Koha::Patron::Password::Recovery; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ ValidateBorrowernumber >+ SendPasswordRecoveryEmail >+ GetValidLinkInfo >+ CompletePasswordRecovery >+ DeleteExpiredPasswordRecovery >+ ); >+} >+ > use C4::Context; > use C4::Letters; > use Crypt::Eksblowfish::Bcrypt qw( en_base64 ); >@@ -26,20 +37,6 @@ use Koha::DateUtils qw( dt_from_string ); > use constant PATRON => 2; > use constant STAFF => 5; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- &ValidateBorrowernumber >- &SendPasswordRecoveryEmail >- &GetValidLinkInfo >- &CompletePasswordRecovery >- &DeleteExpiredPasswordRecovery >- ); >-} >- > =head1 NAME > > Koha::Patron::Password::Recovery - Koha password recovery module >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index d8e7f9b6ccd..e0c61b83461 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -16,16 +16,10 @@ package Koha::SimpleMARC; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use constant LAST_TRANSACTION_FIELD => q/005/; # MARC21/UNIMARC >- >-our ( @ISA, @EXPORT_OK ); >+use base 'Exporter'; > > BEGIN { >- require Exporter; >- our @ISA = qw(Exporter); >- >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > read_field > add_field > update_field >@@ -39,6 +33,8 @@ BEGIN { > ); > } > >+use constant LAST_TRANSACTION_FIELD => q/005/; # MARC21/UNIMARC >+ > =head1 NAME > > SimpleMARC - Perl module for making simple MARC record alterations. >diff --git a/Koha/TemplateUtils.pm b/Koha/TemplateUtils.pm >index 3d2b198f31a..d4113558b6d 100644 >--- a/Koha/TemplateUtils.pm >+++ b/Koha/TemplateUtils.pm >@@ -18,6 +18,10 @@ package Koha::TemplateUtils; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( process_tt ); >+} > > use Carp qw( croak ); > use Try::Tiny; >@@ -25,14 +29,6 @@ use Template; > > use C4::Context; > >-use vars qw(@ISA @EXPORT_OK); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( process_tt ); >-} >- > =head1 NAME > > Koha::TemplateUtils >diff --git a/Koha/Util/FrameworkPlugin.pm b/Koha/Util/FrameworkPlugin.pm >index 14d6193e528..02b36ef834a 100644 >--- a/Koha/Util/FrameworkPlugin.pm >+++ b/Koha/Util/FrameworkPlugin.pm >@@ -21,17 +21,13 @@ package Koha::Util::FrameworkPlugin; > # > > use Modern::Perl; >- >-use constant DEFAULT_008_POS_6_39 => 'b |||||||| |||| 00| 0 eng d'; >- >-our ( @ISA, @EXPORT_OK ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw( Exporter ); >- @EXPORT_OK = qw( wrapper date_entered biblio_008 ); >+ our @EXPORT_OK = qw( wrapper date_entered biblio_008 ); > } > >+use constant DEFAULT_008_POS_6_39 => 'b |||||||| |||| 00| 0 eng d'; >+ > =head1 NAME > > Koha::Util::FrameworkPlugin - utility class with routines for framework plugins >diff --git a/Koha/Util/StockRotation.pm b/Koha/Util/StockRotation.pm >index 9d56f4505d8..e7bfb65d4ff 100644 >--- a/Koha/Util/StockRotation.pm >+++ b/Koha/Util/StockRotation.pm >@@ -20,18 +20,9 @@ package Koha::Util::StockRotation; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >- >-use Koha::Items; >-use Koha::StockRotationItems; >-use Koha::Database; >- >-our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); >- >+use base 'Exporter'; > BEGIN { >- require Exporter; >- @ISA = qw( Exporter ); >- @EXPORT = qw( ); >- @EXPORT_OK = qw( >+ our @EXPORT_OK = qw( > get_branches > get_stages > toggle_indemand >@@ -40,9 +31,13 @@ BEGIN { > add_items_to_rota > move_to_next_stage > ); >- %EXPORT_TAGS = ( ALL => [ @EXPORT_OK, @EXPORT ] ); >+ our %EXPORT_TAGS = ( ALL => [ @EXPORT_OK ] ); > } > >+use Koha::Items; >+use Koha::StockRotationItems; >+use Koha::Database; >+ > =head1 NAME > > Koha::Util::StockRotation - utility class with routines for Stock Rotation >diff --git a/Koha/pdfformat/layout1page.pm b/Koha/pdfformat/layout1page.pm >index b7e42ec6ef9..6314f5bb402 100644 >--- a/Koha/pdfformat/layout1page.pm >+++ b/Koha/pdfformat/layout1page.pm >@@ -18,21 +18,18 @@ package Koha::pdfformat::layout1page; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. >-use vars qw(@ISA @EXPORT); > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT = qw(printpdf); >+} >+ > use utf8; > > use Koha::Number::Price; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > >-BEGIN { >- use Exporter (); >- our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); >- @ISA = qw(Exporter); >- @EXPORT = qw(printpdf); >-} >- > #be careful, all the sizes (height, width, etc...) are in mm, not PostScript points (the default measurement of PDF::API2). > #The constants exported transform that into PostScript points (/mm for millimeter, /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/Koha/pdfformat/layout2pages.pm b/Koha/pdfformat/layout2pages.pm >index ef790ecfc4f..e77788e2753 100644 >--- a/Koha/pdfformat/layout2pages.pm >+++ b/Koha/pdfformat/layout2pages.pm >@@ -21,21 +21,18 @@ package Koha::pdfformat::layout2pages; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. >-use vars qw(@ISA @EXPORT); > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT = qw(printpdf); >+} >+ > use utf8; > > use Koha::Number::Price; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > >-BEGIN { >- use Exporter (); >- our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); >- @ISA = qw(Exporter); >- @EXPORT = qw(printpdf); >-} >- > #be careful, all the sizes (height, width, etc...) are in mm, not PostScript points (the default measurement of PDF::API2). > #The constants exported transform that into PostScript points (/mm for millimeter, /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/Koha/pdfformat/layout2pagesde.pm b/Koha/pdfformat/layout2pagesde.pm >index 3368446dd11..87ff96449bd 100644 >--- a/Koha/pdfformat/layout2pagesde.pm >+++ b/Koha/pdfformat/layout2pagesde.pm >@@ -22,20 +22,17 @@ package Koha::pdfformat::layout2pagesde; > > #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw(printpdf); >+} >+ > use utf8; > > use Koha::Number::Price; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- 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 measurement of PDF::API2). > #The constants exported transform that into PostScript points (/mm for millimeter, /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/Koha/pdfformat/layout3pages.pm b/Koha/pdfformat/layout3pages.pm >index 4721d1a4df2..ce641f1bae6 100644 >--- a/Koha/pdfformat/layout3pages.pm >+++ b/Koha/pdfformat/layout3pages.pm >@@ -21,9 +21,13 @@ package Koha::pdfformat::layout3pages; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. >-use vars qw(@ISA @EXPORT); >-use List::MoreUtils qw( uniq ); >+ > use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT = qw(printpdf); >+} >+ > use utf8; > > use C4::Acquisition qw( get_rounded_price ); >@@ -31,12 +35,7 @@ use Koha::Number::Price; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > >-BEGIN { >- use Exporter (); >- our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); >- @ISA = qw(Exporter); >- @EXPORT = qw(printpdf); >-} >+use List::MoreUtils qw( uniq ); > > #be careful, all the sizes (height, width, etc...) are in mm, not PostScript points (the default measurement of PDF::API2). > #The constants exported transform that into PostScript points (/mm for millimeter, /in for inch, pt is postscript point, and as so is there only to show what is happening. >diff --git a/Koha/pdfformat/layout3pagesfr.pm b/Koha/pdfformat/layout3pagesfr.pm >index cd6652ce159..7487a998356 100644 >--- a/Koha/pdfformat/layout3pagesfr.pm >+++ b/Koha/pdfformat/layout3pagesfr.pm >@@ -21,10 +21,14 @@ package Koha::pdfformat::layout3pagesfr; > > #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. > >-use vars qw(@ISA @EXPORT); >+use Modern::Perl; >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT = qw(printpdf); >+} >+ > use MIME::Base64; > use List::MoreUtils qw( uniq ); >-use Modern::Perl; > use utf8; > > use C4::Acquisition; >@@ -32,13 +36,6 @@ use Koha::Number::Price; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > >-BEGIN { >- use Exporter (); >- our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS ); >- @ISA = qw(Exporter); >- @EXPORT = qw(printpdf); >-} >- > #be careful, all the sizes (height, width, etc...) are in mm, not PostScript points (the default measurement of PDF::API2). > #The constants exported transform that into PostScript points (/mm for millimeter, /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/misc/translator/VerboseWarnings.pm b/misc/translator/VerboseWarnings.pm >index 2b3d9f91814..77de12c30a0 100644 >--- a/misc/translator/VerboseWarnings.pm >+++ b/misc/translator/VerboseWarnings.pm >@@ -1,8 +1,17 @@ > package VerboseWarnings; > > use Modern::Perl; >- >-############################################################################### >+use base 'Exporter'; >+BEGIN { >+ our @EXPORT_OK = qw( >+ pedantic_p >+ warn_additional >+ warn_normal >+ warn_pedantic >+ error_additional >+ error_normal >+ ); >+} > > =head1 NAME > >@@ -15,25 +24,6 @@ verbose warnings. > > =cut > >-############################################################################### >- >-our ( @ISA, @EXPORT_OK ); >- >-BEGIN { >- require Exporter; >- @ISA = qw(Exporter); >- @EXPORT_OK = qw( >- pedantic_p >- warn_additional >- warn_normal >- warn_pedantic >- error_additional >- error_normal >- ); >-} >- >-############################################################################### >- > use vars qw( $appName $input $input_abbr $pedantic_p $pedantic_tag $quiet); > use vars qw( $warned $erred ); > >@@ -123,5 +113,3 @@ sub warned { > } > > 1; >- >-############################################################################### >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40680
:
186031
|
186032
|
186033
|
186034
|
186035
|
186036
|
186037
|
186038
|
186039
|
186040
|
186041
|
186654
|
186655
|
186656
|
186657
|
186658
|
186659
|
186660
|
186661
|
186662
|
186663
|
186664
|
187122
|
187123
|
187124
|
187125
|
187126
|
187127
|
187128
|
187129
|
187130
|
187131
|
187132
|
187385
|
187609
|
187610
|
187611
|
187612
|
187613
|
187614
|
187615
|
187616
|
187617
|
187618
|
187619