From ccfd5559e2141a177de5dd760196729b51b9bb82 Mon Sep 17 00:00:00 2001 From: Jonathan Druart 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); } ``` Rebased-by: Victor Grousset/tuxayo Bug38936 exported redirect_if_opac_suppressed --- 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 | 14 +++- 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, 686 insertions(+), 888 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 6d5db418b15..52784701371 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -18,6 +18,15 @@ package C4::Accounts; # along with Koha; if not, see . 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 ddac26985b7..3106a90bbae 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -18,39 +18,10 @@ package C4::Acquisition; # along with Koha; if not, see . 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 c655480d8ab..dd0d6fc9176 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 . -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 edfc1556014..c21db81d1fd 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 . -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 86cb3bc65c5..e6972f7eb74 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 . 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 45c397a8ba6..dd58ec747eb 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 . 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 581ab42eca7..f0fe2c1325a 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 . -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 c56d721003c..8723cb68e39 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -20,14 +20,10 @@ package C4::Biblio; # along with Koha; if not, see . 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 @@ -1566,7 +1562,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 cbe561166e3..7b47a2e7330 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 . -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 066a36f5ba6..e36d1c74597 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -18,20 +18,9 @@ package C4::Budgets; # along with Koha; if not, see . 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 79be3f2359f..c8e86719080 100644 --- a/C4/Charset.pm +++ b/C4/Charset.pm @@ -18,20 +18,9 @@ package C4::Charset; # along with Koha; if not, see . 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 f3b5f276373..3a339d96146 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -19,66 +19,12 @@ package C4::Circulation; # along with Koha; if not, see . 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 80c004cfe3e..f32a8476f91 100644 --- a/C4/ClassSortRoutine.pm +++ b/C4/ClassSortRoutine.pm @@ -18,20 +18,16 @@ package C4::ClassSortRoutine; # along with Koha; if not, see . 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 e91e0e5b2f3..a2f6b5cfc62 100644 --- a/C4/ClassSource.pm +++ b/C4/ClassSource.pm @@ -17,18 +17,9 @@ package C4::ClassSource; # along with Koha; if not, see . 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 78353b06b4a..7a667052023 100644 --- a/C4/ClassSplitRoutine.pm +++ b/C4/ClassSplitRoutine.pm @@ -18,19 +18,15 @@ package C4::ClassSplitRoutine; # along with Koha; if not, see . 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 47b7f5826ef..f25d0ffbff0 100644 --- a/C4/CourseReserves.pm +++ b/C4/CourseReserves.pm @@ -16,24 +16,10 @@ package C4::CourseReserves; # along with Koha; if not, see . 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 b06fc5bfb1e..c0401480abd 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 . +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 434a02a8f2f..91533192fef 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -18,6 +18,12 @@ package C4::Heading; # along with Koha; if not, see . 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 e0602e595eb..6008f938d56 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 1c5d2b1ad7d..71e333379b8 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 . -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 bdd990dc68a..c2097988e85 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 . -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 => ' . 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 9d426169a26..f60000c3307 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -19,14 +19,9 @@ package C4::Items; # along with Koha; if not, see . 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 ac43e3c03ef..0776ebcbc46 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -20,21 +20,10 @@ package C4::Koha; # along with Koha; if not, see . 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 ff0dcf534f6..8c8824d69bf 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 . -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 b5c1c4cadee..b98e0286b0c 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -18,6 +18,26 @@ package C4::Letters; # along with Koha; if not, see . 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 82fc38bbfa6..c62f5a0cab4 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -20,6 +20,15 @@ package C4::Members; # along with Koha; if not, see . 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 da805b86230..880143cefb3 100644 --- a/C4/Members/Messaging.pm +++ b/C4/Members/Messaging.pm @@ -17,8 +17,18 @@ package C4::Members::Messaging; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; + +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 27c6b7c1749..ffff6a65607 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 3aaf1c05838..2dc1de46cbf 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 @@ -50,6 +37,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 99df5aeb761..b6d12c812b2 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -19,6 +19,24 @@ package C4::Overdues; # along with Koha; if not, see . 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 718fac14458..d2373163e01 100644 --- a/C4/Reports.pm +++ b/C4/Reports.pm @@ -18,20 +18,17 @@ package C4::Reports; # along with Koha; if not, see . 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 0bf05db5895..53649b171ef 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 . 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 7d6c106ceae..ff80e8310ce 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -21,6 +21,47 @@ package C4::Reserves; # along with Koha; if not, see . 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 57bdd4fedbc..6012b9f3a46 100644 --- a/C4/Scheduler.pm +++ b/C4/Scheduler.pm @@ -18,18 +18,14 @@ package C4::Scheduler; # along with Koha; if not, see . 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 12ba64f60fe..42f835ef3b7 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -16,6 +16,22 @@ package C4::Search; # along with Koha; if not, see . 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 4ab2583a317..bfdf403f5d7 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -19,6 +19,40 @@ package C4::Serials; # along with Koha; if not, see . 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 207c28e1f8d..3d67336a8d0 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 . -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 3f3c79d37ed..d4e877fcffd 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -18,19 +18,16 @@ package C4::Stats; # along with Koha; if not, see . 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 07040b9d596..525c59f417f 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -19,6 +19,24 @@ package C4::Suggestions; # along with Koha; if not, see . 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 c2c05a05153..87d0091b588 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 . -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 5965092d01d..36c1f8ddcb1 100644 --- a/C4/TmplTokenType.pm +++ b/C4/TmplTokenType.pm @@ -18,7 +18,7 @@ package C4::TmplTokenType; # along with Koha; if not, see . 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 7ff4c463053..122877c40e0 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -19,6 +19,13 @@ package C4::XISBN; # along with Koha; if not, see . 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 68108c500d2..78720001c10 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -22,31 +22,28 @@ package C4::XSLT; # along with Koha; if not, see . 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 28b0ce39938..8a83626b758 100644 --- a/Koha/AuthUtils.pm +++ b/Koha/AuthUtils.pm @@ -18,6 +18,11 @@ package Koha::AuthUtils; # along with Koha; if not, see . 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 fed83d5b6ed..0eb13f00503 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -17,18 +17,9 @@ package Koha::DateUtils; # along with Koha; if not, see . 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 7e75621c782..69f7ce583e1 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 42d08a3d3f1..06e85114b8c 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 . -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 77a24555413..eb748340153 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -18,25 +18,7 @@ package Koha::I18N; # along with Koha; if not, see . 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 ca06e9a7123..fc2b60bc397 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 89e46a5fd66..c8f31b40629 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 . 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 fe2f974e8da..cfe0b6f49a1 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 . 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 1b188e7b983..e7406c8f5ef 100644 --- a/Koha/SimpleMARC.pm +++ b/Koha/SimpleMARC.pm @@ -16,16 +16,10 @@ package Koha::SimpleMARC; # along with Koha; if not, see . 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 81e4bc78b13..612117e2d2c 100644 --- a/Koha/TemplateUtils.pm +++ b/Koha/TemplateUtils.pm @@ -18,6 +18,10 @@ package Koha::TemplateUtils; # along with Koha; if not, see . 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 b04950ad1a9..a5cc94fb5f3 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 538c739b9ff..817dba9da7d 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 . 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 1d845bf5ee8..8142b496cc9 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 . #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 cb7ac566bab..a8e1c124aca 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 . #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 fd1a7d35b49..54b55f8e144 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 4edff813c8b..fb9e4b70f8d 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 . #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 045c6e13495..e94fb9e0764 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