diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 7d7ac76018..ad0d34f184 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -22,14 +22,11 @@ use Modern::Perl; use C4::Context; use C4::Stats; use C4::Members; -use C4::Log qw(logaction); use Koha::Account; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Items; -use Mojo::Util qw(deprecated); -use Data::Dumper qw(Dumper); use vars qw(@ISA @EXPORT); @@ -37,8 +34,8 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &chargelostitem - &purge_zero_balance_fees + chargelostitem + purge_zero_balance_fees ); } diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 1d6f350487..3d74f847a6 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -19,13 +19,13 @@ package C4::Acquisition; use Modern::Perl; -use Carp; +use Carp qw( carp croak ); use Text::CSV_XS; use C4::Context; -use C4::Suggestions; -use C4::Biblio; -use C4::Contract; -use C4::Log qw(logaction); +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 output_pref ); use Koha::Acquisition::Baskets; @@ -42,60 +42,58 @@ use Koha::Patrons; use C4::Koha; use MARC::Field; -use MARC::Record; -use JSON qw(to_json); +use JSON qw( to_json ); -use Time::localtime; - -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetBasket &NewBasket &ReopenBasket &ModBasket - &GetBasketAsCSV &GetBasketGroupAsCSV - &GetBasketsByBookseller &GetBasketsByBasketgroup - &GetBasketsInfosByBookseller - - &GetBasketUsers &ModBasketUsers - &CanUserManageBasket - - &ModBasketHeader - - &ModBasketgroup &NewBasketgroup &DelBasketgroup &GetBasketgroup &CloseBasketgroup - &GetBasketgroups &ReOpenBasketgroup - - &ModOrder &GetOrder &GetOrders &GetOrdersByBiblionumber - &GetOrderFromItemnumber - &SearchOrders &GetHistory &GetRecentAcqui - &ModReceiveOrder &CancelReceipt - &TransferOrder - &ModItemOrder - - &GetParcels - - &GetInvoices - &GetInvoice - &GetInvoiceDetails - &AddInvoice - &ModInvoice - &CloseInvoice - &ReopenInvoice - &DelInvoice - &MergeInvoices - - &AddClaim - &GetBiblioCountByBasketno - - &GetOrderUsers - &ModOrderUsers - &NotifyOrderUsers - - &FillWithDefaultValues - - &get_rounded_price - &get_rounding_sql + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetBasket NewBasket ReopenBasket ModBasket + GetBasketAsCSV GetBasketGroupAsCSV + GetBasketsByBookseller GetBasketsByBasketgroup + GetBasketsInfosByBookseller + + GetBasketUsers ModBasketUsers + CanUserManageBasket + + ModBasketHeader + + ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroup CloseBasketgroup + GetBasketgroups ReOpenBasketgroup + + ModOrder GetOrder GetOrders GetOrdersByBiblionumber + GetOrderFromItemnumber + SearchOrders GetHistory GetRecentAcqui + ModReceiveOrder CancelReceipt + populate_order_with_prices + TransferOrder + ModItemOrder + + GetParcels + + GetInvoices + GetInvoice + GetInvoiceDetails + AddInvoice + ModInvoice + CloseInvoice + ReopenInvoice + DelInvoice + MergeInvoices + + AddClaim + GetBiblioCountByBasketno + + GetOrderUsers + ModOrderUsers + NotifyOrderUsers + + FillWithDefaultValues + + get_rounded_price + get_rounding_sql ); } diff --git a/C4/Auth.pm b/C4/Auth.pm index 4ca4935ea1..133cb03260 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -19,14 +19,11 @@ package C4::Auth; use strict; use warnings; -use Carp qw/croak/; +use Carp qw( croak ); -use Digest::MD5 qw(md5_base64); -use JSON qw/encode_json/; -use URI::Escape; +use Digest::MD5 qw( md5_base64 ); use CGI::Session; -require Exporter; use C4::Context; use C4::Templates; # to get the template use C4::Languages; @@ -34,25 +31,25 @@ use C4::Search::History; use Koha; use Koha::Logger; use Koha::Caches; -use Koha::AuthUtils qw(get_script_name hash_password); +use Koha::AuthUtils qw( get_script_name hash_password ); use Koha::Checkouts; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Library::Groups; use Koha::Libraries; use Koha::Cash::Registers; use Koha::Desks; use Koha::Patrons; use Koha::Patron::Consents; -use POSIX qw/strftime/; -use List::MoreUtils qw/ any /; -use Encode qw( encode is_utf8); -use C4::Auth_with_shibboleth; +use List::MoreUtils qw( any ); +use Encode; +use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); use Net::CIDR; -use C4::Log qw/logaction/; +use C4::Log qw( logaction ); # use utf8; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $ldap $cas $caslogout); +use vars qw($ldap $cas $caslogout); +our (@ISA, @EXPORT_OK); BEGIN { sub psgi_env { any { /^psgi\./ } keys %ENV } @@ -63,12 +60,15 @@ BEGIN { C4::Context->set_remote_address; - @ISA = qw(Exporter); - @EXPORT = qw(&checkauth &get_template_and_user &haspermission &get_user_subpermissions); - @EXPORT_OK = qw(&check_api_auth &get_session &check_cookie_auth &checkpw &checkpw_internal &checkpw_hash - &get_all_subpermissions &get_user_subpermissions track_login_daily &in_iprange + 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_user_subpermissions track_login_daily in_iprange + get_template_and_user haspermission ); - %EXPORT_TAGS = ( EditPermissions => [qw(get_all_subpermissions get_user_subpermissions)] ); + $ldap = C4::Context->config('useldapserver') || 0; $cas = C4::Context->preference('casAuthentication'); $caslogout = C4::Context->preference('casLogout'); diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index 855766bd0f..8c922ece6a 100644 --- a/C4/Auth_with_cas.pm +++ b/C4/Auth_with_cas.pm @@ -21,20 +21,19 @@ use strict; use warnings; use C4::Context; -use Koha::AuthUtils qw(get_script_name); +use Koha::AuthUtils qw( get_script_name ); use Authen::CAS::Client; use CGI qw ( -utf8 ); -use FindBin; use YAML::XS; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required); + @EXPORT_OK = qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required); } my $defaultcasserver; my $casservers; diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index 296f4099eb..7f6c99a9a4 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -18,23 +18,21 @@ package C4::Auth_with_ldap; # along with Koha; if not, see . use Modern::Perl; -use Carp; +use Carp qw( croak ); use C4::Context; use C4::Members::Messaging; -use C4::Auth qw(checkpw_internal); +use C4::Auth qw( checkpw_internal ); use Koha::Patrons; -use Koha::AuthUtils qw(hash_password); -use List::MoreUtils qw( any ); +use Koha::AuthUtils qw( hash_password ); use Net::LDAP; use Net::LDAP::Filter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( checkpw_ldap ); + @EXPORT_OK = qw( checkpw_ldap ); } # Redefine checkpw_ldap: diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm index e3af9eb9d8..e214a5307c 100644 --- a/C4/Auth_with_shibboleth.pm +++ b/C4/Auth_with_shibboleth.pm @@ -20,22 +20,20 @@ package C4::Auth_with_shibboleth; use Modern::Perl; use C4::Context; -use Koha::AuthUtils qw(get_script_name); +use Koha::AuthUtils qw( get_script_name ); use Koha::Database; use Koha::Patrons; use C4::Members::Messaging; -use Carp; -use CGI; -use List::MoreUtils qw(any); +use Carp qw( carp ); +use List::MoreUtils qw( any ); use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = + @EXPORT_OK = qw(shib_ok logout_shib login_shib_url checkpw_shib get_login_shib); } diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 1bb808bb9c..2b31146199 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -21,13 +21,12 @@ package C4::AuthoritiesMarc; use strict; use warnings; use C4::Context; -use MARC::Record; -use C4::Biblio; -use C4::Search; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblio ); +use C4::Search qw( FindDuplicate new_record_from_zebra ); use C4::AuthoritiesMarc::MARC21; use C4::AuthoritiesMarc::UNIMARC; -use C4::Charset; -use C4::Log; +use C4::Charset qw( SetUTF8Flag ); +use C4::Log qw( logaction ); use Koha::MetadataRecord::Authority; use Koha::Authorities; use Koha::Authority::MergeRequests; @@ -38,35 +37,38 @@ use Koha::SearchEngine; use Koha::SearchEngine::Indexer; use Koha::SearchEngine::Search; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetTagsLabels - &GetAuthMARCFromKohaField - - &AddAuthority - &ModAuthority - &DelAuthority - &GetAuthority - &GetAuthorityXML - - &SearchAuthorities - - &BuildSummary - &BuildAuthHierarchies - &BuildAuthHierarchy - &GenerateHierarchy - - &merge - &FindDuplicateAuthority - - &GuessAuthTypeCode - &GuessAuthId - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetTagsLabels + GetAuthMARCFromKohaField + + AddAuthority + ModAuthority + DelAuthority + GetAuthority + GetAuthorityXML + + SearchAuthorities + + BuildSummary + BuildAuthHierarchies + BuildAuthHierarchy + GenerateHierarchy + GetHeaderAuthority + AddAuthorityTrees + CompareFieldWithAuthority + + merge + FindDuplicateAuthority + + GuessAuthTypeCode + GuessAuthId + compare_fields + ); } diff --git a/C4/AuthoritiesMarc/MARC21.pm b/C4/AuthoritiesMarc/MARC21.pm index c704a68232..c3c6f84730 100644 --- a/C4/AuthoritiesMarc/MARC21.pm +++ b/C4/AuthoritiesMarc/MARC21.pm @@ -18,7 +18,6 @@ package C4::AuthoritiesMarc::MARC21; # along with Koha; if not, see . use Modern::Perl; -use MARC::Record; =head1 NAME diff --git a/C4/BackgroundJob.pm b/C4/BackgroundJob.pm index 48683f9765..733f72e11b 100644 --- a/C4/BackgroundJob.pm +++ b/C4/BackgroundJob.pm @@ -20,7 +20,7 @@ package C4::BackgroundJob; use Modern::Perl; use C4::Context; -use C4::Auth qw/get_session/; +use C4::Auth qw( get_session ); use Digest::MD5; diff --git a/C4/Barcodes.pm b/C4/Barcodes.pm index bd50054949..957d60f283 100644 --- a/C4/Barcodes.pm +++ b/C4/Barcodes.pm @@ -20,7 +20,7 @@ package C4::Barcodes; use strict; use warnings; -use Carp; +use Carp qw( carp ); use C4::Context; use C4::Barcodes::hbyymmincr; @@ -28,15 +28,8 @@ use C4::Barcodes::annual; use C4::Barcodes::incremental; use C4::Barcodes::EAN13; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use vars qw($max $prefformat); -BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(); -} - sub _prefformat { unless (defined $prefformat) { unless ($prefformat = C4::Context->preference('autoBarcode')) { diff --git a/C4/Barcodes/EAN13.pm b/C4/Barcodes/EAN13.pm index c691b0ec08..7927d19536 100644 --- a/C4/Barcodes/EAN13.pm +++ b/C4/Barcodes/EAN13.pm @@ -22,8 +22,8 @@ use warnings; use C4::Context; -use Algorithm::CheckDigits; -use Carp; +use Algorithm::CheckDigits qw( CheckDigits ); +use Carp qw( carp ); use vars qw(@ISA); diff --git a/C4/Barcodes/annual.pm b/C4/Barcodes/annual.pm index b0d46c1359..0d7e05ae00 100644 --- a/C4/Barcodes/annual.pm +++ b/C4/Barcodes/annual.pm @@ -20,11 +20,11 @@ package C4::Barcodes::annual; use strict; use warnings; -use Carp; +use Carp qw( carp ); use C4::Context; -use Koha::DateUtils qw( output_pref dt_from_string ); +use Koha::DateUtils qw( dt_from_string output_pref ); use vars qw(@ISA); use vars qw($width); diff --git a/C4/Barcodes/hbyymmincr.pm b/C4/Barcodes/hbyymmincr.pm index 28cb3f8186..bd345a6d62 100644 --- a/C4/Barcodes/hbyymmincr.pm +++ b/C4/Barcodes/hbyymmincr.pm @@ -19,7 +19,7 @@ package C4::Barcodes::hbyymmincr; use Modern::Perl; -use Carp; +use Carp qw( carp ); use C4::Context; diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8aeef65c96..ebebe415c8 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -21,12 +21,12 @@ package C4::Biblio; use Modern::Perl; -use vars qw(@ISA @EXPORT); +use vars qw(@ISA @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( AddBiblio GetBiblioData GetMarcBiblio @@ -45,6 +45,7 @@ BEGIN { GetMarcQuantity GetAuthorisedValueDesc GetMarcStructure + GetMarcSubfieldStructure IsMarcStructureInternal GetMarcFromKohaField GetMarcSubfieldStructureFromKohaField @@ -54,6 +55,7 @@ BEGIN { CountItemsIssued ModBiblio ModZebra + EmbedItemsInMarcBiblio UpdateTotalIssues RemoveAllNsb DelBiblio @@ -63,35 +65,42 @@ BEGIN { TransformHtmlToMarc TransformHtmlToXml prepare_host_field + TransformMarcToKohaOneField ); # Internal functions # those functions are exported but should not be used # they are useful in a few circumstances, so they are exported, # but don't use them unless you are a core developer ;-) - push @EXPORT, qw( + push @EXPORT_OK, qw( ModBiblioMarc ); } -use Carp; -use Try::Tiny; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); -use Encode qw( decode is_utf8 ); +use Encode; use List::MoreUtils qw( uniq ); use MARC::Record; use MARC::File::USMARC; use MARC::File::XML; -use POSIX qw(strftime); -use Module::Load::Conditional qw(can_load); +use POSIX qw( strftime ); +use Module::Load::Conditional qw( can_load ); use C4::Koha; -use C4::Log; # logaction +use C4::Log qw( logaction ); # logaction use C4::Budgets; -use C4::ClassSource; -use C4::Charset; +use C4::ClassSource qw( GetClassSort ); +use C4::Charset qw( + nsb_clean + SetMarcUnicodeFlag + SetUTF8Flag + StripNonXmlChars +); use C4::Linker; use C4::OAI::Sets; +use C4::Items qw( GetHiddenItemnumbers GetMarcItem ); use Koha::Logger; use Koha::Caches; @@ -2572,7 +2581,6 @@ sub EmbedItemsInMarcBiblio { my $opachiddenitems = $opac && ( C4::Context->preference('OpacHiddenItems') !~ /^\s*$/ ); - require C4::Items; while ( my ($itemnumber) = $sth->fetchrow_array ) { next if @$itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers; my $item; diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 6b103b3cdb..ce99efeac8 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -22,22 +22,21 @@ use strict; use warnings; use C4::Biblio; -use C4::Koha; -use C4::Charset; +use C4::Koha qw( GetNormalizedISBN ); +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); use MARC::File::USMARC; use MARC::Field; -use C4::ImportBatch; +use C4::ImportBatch qw( GetZ3950BatchId AddBiblioToBatch AddAuthToBatch ); use C4::AuthoritiesMarc; #GuessAuthTypeCode, FindDuplicateAuthority use C4::Languages; use Koha::Database; use Koha::XSLT::Base; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw(&BreedingSearch &Z3950Search &Z3950SearchAuth); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(BreedingSearch Z3950Search Z3950SearchAuth); } =head1 NAME diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 15d7e0e05f..888bd7bee4 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -23,54 +23,61 @@ use Koha::Database; use Koha::Patrons; use Koha::Acquisition::Invoice::Adjustments; use C4::Acquisition; -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - - &GetBudget - &GetBudgetByOrderNumber - &GetBudgetByCode - &GetBudgets - &BudgetsByActivity - &GetBudgetsReport - &GetBudgetReport - &GetBudgetHierarchy - &AddBudget - &ModBudget - &DelBudget - &GetBudgetSpent - &GetBudgetOrdered - &GetBudgetName - &GetPeriodsCount - GetBudgetHierarchySpent - GetBudgetHierarchyOrdered - - &GetBudgetUsers - &ModBudgetUsers - &CanUserUseBudget - &CanUserModifyBudget - - &GetBudgetPeriod - &GetBudgetPeriods - &ModBudgetPeriod - &AddBudgetPeriod - &DelBudgetPeriod - - &ModBudgetPlan - - &GetBudgetsPlanCell - &AddBudgetPlanValue - &GetBudgetAuthCats - &BudgetHasChildren - &CheckBudgetParent - &CheckBudgetParentPerm - - &HideCols - &GetCols - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + + GetBudget + GetBudgetByOrderNumber + GetBudgetByCode + GetBudgets + BudgetsByActivity + GetBudgetsReport + GetBudgetReport + GetBudgetsByActivity + GetBudgetHierarchy + AddBudget + ModBudget + DelBudget + GetBudgetSpent + GetBudgetOrdered + GetBudgetName + GetPeriodsCount + GetBudgetHierarchySpent + GetBudgetHierarchyOrdered + + GetBudgetUsers + ModBudgetUsers + CanUserUseBudget + CanUserModifyBudget + + GetBudgetPeriod + GetBudgetPeriods + ModBudgetPeriod + AddBudgetPeriod + DelBudgetPeriod + + ModBudgetPlan + + GetBudgetsPlanCell + AddBudgetPlanValue + GetBudgetAuthCats + BudgetHasChildren + GetBudgetChildren + SetOwnerToFundHierarchy + CheckBudgetParent + CheckBudgetParentPerm + + HideCols + GetCols + + CloneBudgetPeriod + CloneBudgetHierarchy + MoveOrders + ); } # ----------------------------BUDGETS.PM-----------------------------"; diff --git a/C4/Calendar.pm b/C4/Calendar.pm index 6a5d8a79a4..257119c8e3 100644 --- a/C4/Calendar.pm +++ b/C4/Calendar.pm @@ -19,8 +19,8 @@ use strict; use warnings; use vars qw(@EXPORT); -use Carp; -use Date::Calc qw( Date_to_Days Today); +use Carp qw( croak ); +use Date::Calc qw( Today ); use C4::Context; use Koha::Caches; diff --git a/C4/Charset.pm b/C4/Charset.pm index c215a56667..e780cef4f0 100644 --- a/C4/Charset.pm +++ b/C4/Charset.pm @@ -19,19 +19,18 @@ package C4::Charset; use Modern::Perl; -use MARC::Charset qw/marc8_to_utf8/; +use MARC::Charset; use Text::Iconv; -use Unicode::Normalize; -use Encode qw( decode encode is_utf8 ); +use Unicode::Normalize qw( NFC NFD ); +use Encode; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( NormalizeString IsStringUTF8ish MarcToUTF8Record diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 330b1bbaeb..0549230964 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -24,32 +24,31 @@ use POSIX qw( floor ); use YAML::XS; use Encode; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Context; -use C4::Stats; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Members; +use C4::Stats qw( UpdateStats ); +use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound 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; # logaction -use C4::Overdues qw(CalcFine UpdateFine get_chargeable_units); +use C4::Log qw( logaction ); # logaction +use C4::Overdues; use C4::RotatingCollections qw(GetCollectionItemBranches); -use Algorithm::CheckDigits; +use Algorithm::CheckDigits qw( CheckDigits ); -use Data::Dumper; +use Data::Dumper qw( Dumper ); use Koha::Account; use Koha::AuthorisedValues; use Koha::Biblioitems; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Calendar; use Koha::Checkouts; use Koha::Illrequests; use Koha::Items; use Koha::Patrons; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( DelUniqueDebarment GetDebarments ); use Koha::Database; use Koha::Libraries; use Koha::Account::Lines; @@ -62,77 +61,68 @@ use Koha::Config::SysPref; use Koha::Checkouts::ReturnClaims; use Koha::SearchEngine::Indexer; use Koha::Exceptions::Checkout; -use Carp; -use List::MoreUtils qw( uniq any ); +use Carp qw( carp ); +use List::MoreUtils qw( any ); use Scalar::Util qw( looks_like_number ); -use Try::Tiny; -use Date::Calc qw( - Today - Today_and_Now - Add_Delta_YM - Add_Delta_DHMS - Date_to_Days - Day_of_Week - Add_Delta_Days -); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +use Date::Calc qw( Date_to_Days ); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - - # FIXME subs that should probably be elsewhere - push @EXPORT, qw( - &barcodedecode - &LostItem - &ReturnLostItem - &GetPendingOnSiteCheckouts - ); - - # subs to deal with issuing a book - push @EXPORT, qw( - &CanBookBeIssued - &CanBookBeRenewed - &AddIssue - &AddRenewal - &GetRenewCount - &GetSoonestRenewDate - &GetLatestAutoRenewDate - &GetIssuingCharges - &GetBranchBorrowerCircRule - &GetBranchItemRule - &GetOpenIssue - &CheckIfIssuedToPatron - &IsItemIssued - GetTopIssues - ); - - # subs to deal with returns - push @EXPORT, qw( - &AddReturn - &MarkIssueReturned - ); - - # subs to deal with transfers - push @EXPORT, qw( - &transferbook - &GetTransfers - &GetTransfersFromTo - &updateWrongTransfer - &IsBranchTransferAllowed - &CreateBranchTransferLimit - &DeleteBranchTransferLimits - &TransferSlip - ); - - # subs to deal with offline circulation - push @EXPORT, qw( - &GetOfflineOperations - &GetOfflineOperation - &AddOfflineOperation - &DeleteOfflineOperation - &ProcessOfflineOperation + + require Exporter; + @ISA = qw(Exporter); + + # FIXME subs that should probably be elsewhere + push @EXPORT_OK, qw( + barcodedecode + LostItem + ReturnLostItem + GetPendingOnSiteCheckouts + + CanBookBeIssued + checkHighHolds + CanBookBeRenewed + AddIssue + GetLoanLength + GetHardDueDate + AddRenewal + GetRenewCount + GetSoonestRenewDate + GetLatestAutoRenewDate + GetIssuingCharges + AddIssuingCharge + GetBranchBorrowerCircRule + GetBranchItemRule + GetBiblioIssues + GetOpenIssue + GetUpcomingDueIssues + CheckIfIssuedToPatron + IsItemIssued + GetAgeRestriction + GetTopIssues + + AddReturn + MarkIssueReturned + + transferbook + TooMany + GetTransfers + GetTransfersFromTo + updateWrongTransfer + CalcDateDue + CheckValidBarcode + IsBranchTransferAllowed + CreateBranchTransferLimit + DeleteBranchTransferLimits + TransferSlip + + GetOfflineOperations + GetOfflineOperation + AddOfflineOperation + DeleteOfflineOperation + ProcessOfflineOperation + ProcessOfflinePayment ); + push @EXPORT_OK, '_GetCircControlBranch'; # This is wrong! } =head1 NAME diff --git a/C4/ClassSortRoutine.pm b/C4/ClassSortRoutine.pm index 77826cff1b..248baa74a8 100644 --- a/C4/ClassSortRoutine.pm +++ b/C4/ClassSortRoutine.pm @@ -20,12 +20,18 @@ package C4::ClassSortRoutine; use strict; use warnings; -require Exporter; use Class::Factory::Util; use C4::Context; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetSortRoutineNames + GetClassSortKey + ); +} =head1 NAME @@ -40,12 +46,6 @@ use C4::ClassSortRoutine; =cut -@ISA = qw(Exporter); -@EXPORT = qw( - &GetSortRoutineNames - &GetClassSortKey -); - # initialization code my %loaded_routines = (); my @sort_routines = GetSortRoutineNames(); diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm index 111bafb537..eedf4ed768 100644 --- a/C4/ClassSortRoutine/Dewey.pm +++ b/C4/ClassSortRoutine/Dewey.pm @@ -28,7 +28,7 @@ C4::ClassSortRoutine::Dewey - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('Dewey', $cn_class, $cn_item); diff --git a/C4/ClassSortRoutine/Generic.pm b/C4/ClassSortRoutine/Generic.pm index 8b7d890394..665dd53ca6 100644 --- a/C4/ClassSortRoutine/Generic.pm +++ b/C4/ClassSortRoutine/Generic.pm @@ -28,7 +28,7 @@ C4::ClassSortRoutine::Generic - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('Generic', $cn_class, $cn_item); diff --git a/C4/ClassSortRoutine/LCC.pm b/C4/ClassSortRoutine/LCC.pm index 5f9c8f9c6f..b943fb683e 100644 --- a/C4/ClassSortRoutine/LCC.pm +++ b/C4/ClassSortRoutine/LCC.pm @@ -30,7 +30,7 @@ C4::ClassSortRoutine::LCC - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('LCC', $cn_class, $cn_item); diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm index 8c133bce70..e9487912e9 100644 --- a/C4/ClassSource.pm +++ b/C4/ClassSource.pm @@ -20,12 +20,20 @@ package C4::ClassSource; use strict; use warnings; -require Exporter; use C4::Context; -use C4::ClassSortRoutine; - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +use C4::ClassSortRoutine qw( GetClassSortKey ); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetClassSources + GetClassSource + GetClassSortRule + GetClassSort + ); +} =head1 NAME @@ -44,17 +52,6 @@ sources and sorting rules. =cut - -@ISA = qw(Exporter); -@EXPORT = qw( - &GetClassSources - &GetClassSource - &GetClassSortRule - - &GetClassSort - -); - =head2 GetClassSources my $sources = GetClassSources(); diff --git a/C4/ClassSplitRoutine.pm b/C4/ClassSplitRoutine.pm index cfa8403389..ed6f665170 100644 --- a/C4/ClassSplitRoutine.pm +++ b/C4/ClassSplitRoutine.pm @@ -20,7 +20,6 @@ package C4::ClassSplitRoutine; use Modern::Perl; require Exporter; -use Class::Factory::Util; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -39,7 +38,7 @@ use C4::ClassSplitRoutine; @ISA = qw(Exporter); @EXPORT = qw( - &GetSplitRoutineNames + GetSplitRoutineNames ); =head2 GetSplitRoutineNames diff --git a/C4/Context.pm b/C4/Context.pm index db896ad473..63187bf4b7 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -35,12 +35,11 @@ BEGIN { } }; -use Carp; +use Carp qw( carp ); use DateTime::TimeZone; use Encode; use File::Spec; -use Module::Load::Conditional qw(can_load); -use POSIX (); +use POSIX; use YAML::XS; use ZOOM; diff --git a/C4/Contract.pm b/C4/Contract.pm index 13b9538e27..2630af403e 100644 --- a/C4/Contract.pm +++ b/C4/Contract.pm @@ -25,14 +25,14 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetContracts - &GetContract - &AddContract - &ModContract - &DelContract - ); + @ISA = qw(Exporter); + @EXPORT = qw( + GetContracts + GetContract + AddContract + ModContract + DelContract + ); } =head1 NAME diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm index 77945341a8..7f9a4aa7f6 100644 --- a/C4/CourseReserves.pm +++ b/C4/CourseReserves.pm @@ -17,43 +17,42 @@ package C4::CourseReserves; use Modern::Perl; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use C4::Context; -use C4::Circulation qw(GetOpenIssue); +use C4::Circulation qw( GetOpenIssue ); use Koha::Courses; use Koha::Course::Instructors; use Koha::Course::Items; use Koha::Course::Reserves; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @FIELDS); - +use vars qw(@FIELDS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( - &GetCourse - &ModCourse - &GetCourses - &DelCourse + GetCourse + ModCourse + GetCourses + DelCourse - &GetCourseInstructors - &ModCourseInstructors + GetCourseInstructors + ModCourseInstructors - &GetCourseItem - &ModCourseItem + GetCourseItem + ModCourseItem - &GetCourseReserve - &ModCourseReserve - &GetCourseReserves - &DelCourseReserve + GetCourseReserve + ModCourseReserve + GetCourseReserves + DelCourseReserve - &SearchCourses + SearchCourses - &GetItemCourseReservesInfo + GetItemCourseReservesInfo ); - %EXPORT_TAGS = ( 'all' => \@EXPORT_OK ); @FIELDS = ( 'itype', 'ccode', 'homebranch', 'holdingbranch', 'location' ); } diff --git a/C4/Creators.pm b/C4/Creators.pm index 27043227f2..de81a8bc39 100644 --- a/C4/Creators.pm +++ b/C4/Creators.pm @@ -38,7 +38,23 @@ BEGIN { get_unit_values html_table ); - use C4::Creators::Lib; + use C4::Creators::Lib qw( + get_all_image_names + get_all_layouts + get_all_profiles + get_all_templates + get_barcode_types + get_batch_summary + get_card_summary + get_font_types + get_label_summary + get_label_types + get_output_formats + get_table_names + get_text_justification_types + get_unit_values + html_table +); use C4::Creators::PDF; } diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index f64d871be0..d4831ab479 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -18,7 +18,7 @@ package C4::Creators::Lib; # along with Koha; if not, see . use Modern::Perl; -use Storable qw(dclone); +use Storable qw( dclone ); use autouse 'Data::Dumper' => qw(Dumper); diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm index 9796feb832..e90b0bd3d7 100644 --- a/C4/Creators/PDF.pm +++ b/C4/Creators/PDF.pm @@ -19,10 +19,41 @@ package C4::Creators::PDF; use strict; use warnings; -use PDF::Reuse; +use PDF::Reuse qw( + prAdd + prAltJpeg + prBookmark + prCompress + prDoc + prDocDir + prDocForm + prEnd + prExtract + prField + prFile + prFont + prFontSize + prForm + prGetLogBuffer + prGraphState + prImage + prInit + prInitVars + prJpeg + prJs + prLink + prLog + prLogDir + prMbox + prPage + prSinglePage + prStrWidth + prText + prTTFont +); use PDF::Reuse::Barcode; use File::Temp; -use List::Util qw/first/; +use List::Util qw( first ); sub _InitVars { diff --git a/C4/Creators/Profile.pm b/C4/Creators/Profile.pm index 2b2ab924b5..cd1de4038b 100644 --- a/C4/Creators/Profile.pm +++ b/C4/Creators/Profile.pm @@ -6,7 +6,7 @@ use warnings; use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; -use C4::Creators::Lib qw(get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); sub _check_params { diff --git a/C4/Creators/Template.pm b/C4/Creators/Template.pm index 30d27dd3e7..1636c16cfb 100644 --- a/C4/Creators/Template.pm +++ b/C4/Creators/Template.pm @@ -2,12 +2,12 @@ package C4::Creators::Template; use strict; use warnings; -use POSIX qw(ceil); +use POSIX qw( ceil ); use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; use C4::Creators::Profile; -use C4::Creators::Lib qw(get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); sub _check_params { diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm index d6957d8e10..13b2b5302e 100644 --- a/C4/External/BakerTaylor.pm +++ b/C4/External/BakerTaylor.pm @@ -19,21 +19,20 @@ package C4::External::BakerTaylor; # along with Koha; if not, see . use XML::Simple; -use LWP::Simple; -use HTTP::Request::Common; +use LWP::Simple qw( get ); use C4::Context; use Modern::Perl; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); +use vars qw(%EXPORT_TAGS $VERSION); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); + require Exporter; + @ISA = qw(Exporter); $VERSION = 3.07.00.049; - @EXPORT_OK = qw(&availability &content_cafe &image_url &link_url &http_jacket_link); - %EXPORT_TAGS = (all=>\@EXPORT_OK); + @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/External/OverDrive.pm b/C4/External/OverDrive.pm index 897e2b3c48..efc663f893 100644 --- a/C4/External/OverDrive.pm +++ b/C4/External/OverDrive.pm @@ -21,7 +21,7 @@ use strict; use warnings; use Koha; -use JSON; +use JSON qw( from_json ); use Koha::Caches; use HTTP::Request; use HTTP::Request::Common; diff --git a/C4/External/Syndetics.pm b/C4/External/Syndetics.pm index 0570d0f7d6..7788ee5f51 100644 --- a/C4/External/Syndetics.pm +++ b/C4/External/Syndetics.pm @@ -17,11 +17,10 @@ package C4::External::Syndetics; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use XML::Simple; +use XML::Simple qw( XMLout ); use XML::LibXML; -use LWP::Simple; +use LWP::Simple qw( $ua ); use LWP::UserAgent; -use HTTP::Request::Common; use strict; use warnings; @@ -32,13 +31,13 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &get_syndetics_index - &get_syndetics_summary - &get_syndetics_toc - &get_syndetics_editions - &get_syndetics_excerpt - &get_syndetics_reviews - &get_syndetics_anotes + get_syndetics_index + get_syndetics_summary + get_syndetics_toc + get_syndetics_editions + get_syndetics_excerpt + get_syndetics_reviews + get_syndetics_anotes ); } diff --git a/C4/Heading.pm b/C4/Heading.pm index c65c127736..bd4eed27de 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -19,11 +19,9 @@ package C4::Heading; use Modern::Perl; -use MARC::Record; use MARC::Field; use C4::Context; -use Module::Load; -use Carp; +use Module::Load qw( load ); =head1 NAME diff --git a/C4/Heading/MARC21.pm b/C4/Heading/MARC21.pm index 6a1a3346b2..b021447c88 100644 --- a/C4/Heading/MARC21.pm +++ b/C4/Heading/MARC21.pm @@ -19,7 +19,6 @@ package C4::Heading::MARC21; use strict; use warnings; -use MARC::Record; use MARC::Field; diff --git a/C4/Heading/UNIMARC.pm b/C4/Heading/UNIMARC.pm index b998433a43..9767f751a7 100644 --- a/C4/Heading/UNIMARC.pm +++ b/C4/Heading/UNIMARC.pm @@ -20,7 +20,6 @@ package C4::Heading::UNIMARC; use 5.010; use strict; use warnings; -use MARC::Record; use MARC::Field; use C4::Context; diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 3774214527..06b0b2a2ef 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -24,29 +24,26 @@ use warnings; use C4::Context; use C4::Search; -use C4::Items; -use C4::Circulation; -use C4::Members; -use C4::Biblio; -use Koha::DateUtils; +use C4::Circulation qw( GetTransfers GetBranchItemRule ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Patrons; use Koha::Libraries; -use List::Util qw(shuffle); -use List::MoreUtils qw(any); -use Data::Dumper; +use List::Util qw( shuffle ); +use List::MoreUtils qw( any ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( - &CreateQueue - &GetHoldsQueueItems + CreateQueue + GetHoldsQueueItems - &TransportCostMatrix - &UpdateTransportCostMatrix + TransportCostMatrix + UpdateTransportCostMatrix + GetPendingHoldRequestsForBib ); } diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index a28c382d68..54ef783711 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -21,19 +21,17 @@ use strict; use warnings; use C4::Members; -use C4::Items; -use C4::Circulation; +use C4::Items qw( get_hostitemnumbers_of ); +use C4::Circulation qw( CanBookBeRenewed barcodedecode CanBookBeIssued AddRenewal ); use C4::Accounts; -use C4::Biblio; -use C4::Reserves qw(AddReserve CanBookBeReserved CanItemBeReserved IsAvailableForItemLevelRequest); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Reserves qw( CanBookBeReserved IsAvailableForItemLevelRequest CalculatePriority AddReserve CanItemBeReserved ); use C4::Context; -use C4::AuthoritiesMarc; -use XML::Simple; -use HTML::Entities; +use C4::Auth; use CGI qw ( -utf8 ); use DateTime; use C4::Auth; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Biblios; use Koha::Checkouts; diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 2a5696d513..9a4978f8fc 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -21,67 +21,78 @@ use strict; use warnings; use C4::Context; -use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Charset; +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; -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); use Koha::Items; use Koha::Plugins::Handler; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - GetZ3950BatchId - GetWebserviceBatchId - GetImportRecordMarc - GetImportRecordMarcXML - AddImportBatch - GetImportBatch - AddAuthToBatch - AddBiblioToBatch - AddItemsToImportBiblio - ModAuthorityInBatch - ModBiblioInBatch - - BatchStageMarcRecords - BatchFindDuplicates - BatchCommitRecords - BatchRevertRecords - CleanBatch - DeleteBatch - - GetAllImportBatches - GetStagedWebserviceBatches - GetImportBatchRangeDesc - GetNumberOfNonZ3950ImportBatches - GetImportBiblios - GetImportRecordsRange - GetItemNumbersFromImportBatch - - GetImportBatchStatus - SetImportBatchStatus - GetImportBatchOverlayAction - SetImportBatchOverlayAction - GetImportBatchNoMatchAction - SetImportBatchNoMatchAction - GetImportBatchItemAction - SetImportBatchItemAction - GetImportBatchMatcher - SetImportBatchMatcher - GetImportRecordOverlayStatus - SetImportRecordOverlayStatus - GetImportRecordStatus - SetImportRecordStatus - SetMatchedBiblionumber - GetImportRecordMatches - SetImportRecordMatches - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetZ3950BatchId + GetWebserviceBatchId + GetImportRecordMarc + GetImportRecordMarcXML + GetRecordFromImportBiblio + AddImportBatch + GetImportBatch + AddAuthToBatch + AddBiblioToBatch + AddItemsToImportBiblio + ModAuthorityInBatch + ModBiblioInBatch + + BatchStageMarcRecords + BatchFindDuplicates + BatchCommitRecords + BatchRevertRecords + CleanBatch + DeleteBatch + + GetAllImportBatches + GetStagedWebserviceBatches + GetImportBatchRangeDesc + GetNumberOfNonZ3950ImportBatches + GetImportBiblios + GetImportRecordsRange + GetItemNumbersFromImportBatch + + GetImportBatchStatus + SetImportBatchStatus + GetImportBatchOverlayAction + SetImportBatchOverlayAction + GetImportBatchNoMatchAction + SetImportBatchNoMatchAction + GetImportBatchItemAction + SetImportBatchItemAction + GetImportBatchMatcher + SetImportBatchMatcher + GetImportRecordOverlayStatus + SetImportRecordOverlayStatus + GetImportRecordStatus + SetImportRecordStatus + SetMatchedBiblionumber + GetImportRecordMatches + SetImportRecordMatches + + RecordsFromMARCXMLFile + RecordsFromISO2709File + RecordsFromMarcPlugin + ); } =head1 NAME diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm index 51c0aae742..2ad5ac9b1c 100644 --- a/C4/ImportExportFramework.pm +++ b/C4/ImportExportFramework.pm @@ -21,23 +21,22 @@ use strict; use warnings; use XML::LibXML; use XML::LibXML::XPathContext; -use Digest::MD5 qw(); -use POSIX qw(strftime); +use Digest::MD5; +use POSIX qw( strftime ); use Text::CSV_XS; -use List::MoreUtils qw(indexes); +use List::MoreUtils qw( indexes ); use C4::Context; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &ExportFramework - &ImportFramework - &createODS + @EXPORT_OK = qw( + ExportFramework + ImportFramework + createODS ); } diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm index c3f5adcaa1..bb868aa33e 100644 --- a/C4/InstallAuth.pm +++ b/C4/InstallAuth.pm @@ -18,24 +18,23 @@ package C4::InstallAuth; # along with Koha; if not, see . use Modern::Perl; -use Digest::MD5 qw(md5_base64); use CGI::Session; use File::Spec; require Exporter; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Templates; -use C4::Koha; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - -@ISA = qw(Exporter); -@EXPORT = qw( - &checkauth - &get_template_and_user -); +our (@ISA, @EXPORT_OK); +BEGIN { + @ISA = qw(Exporter); + @EXPORT_OK = qw( + checkauth + get_template_and_user + ); +} =head1 NAME diff --git a/C4/Installer.pm b/C4/Installer.pm index 2d6b523eed..7aa85def4a 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -19,7 +19,7 @@ package C4::Installer; use Modern::Perl; -use Encode qw( encode is_utf8 ); +use Encode; use DBIx::RunSQL; use YAML::XS; use C4::Context; @@ -30,7 +30,7 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; @ISA = qw( Exporter ); - push @EXPORT, qw( primary_key_exists foreign_key_exists index_exists column_exists TableExists); + push @EXPORT, qw( primary_key_exists foreign_key_exists index_exists column_exists TableExists marc_framework_sql_list); }; =head1 NAME diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm index 01ccc53fea..f143bc6cc1 100644 --- a/C4/Installer/PerlModules.pm +++ b/C4/Installer/PerlModules.pm @@ -3,8 +3,7 @@ package C4::Installer::PerlModules; use warnings; use strict; -use File::Spec; -use File::Basename; +use File::Basename qw( dirname ); use Module::CPANfile; sub new { diff --git a/C4/Installer/UpgradeBackup.pm b/C4/Installer/UpgradeBackup.pm index 2ca97b6693..61aa6fb2d9 100644 --- a/C4/Installer/UpgradeBackup.pm +++ b/C4/Installer/UpgradeBackup.pm @@ -18,10 +18,10 @@ package C4::Installer::UpgradeBackup; # along with Koha; if not, see . use Modern::Perl; -use File::Compare qw(compare); -use Cwd qw(cwd); +use File::Compare qw( compare ); +use Cwd qw( cwd ); use File::Copy; -use File::Find; +use File::Find qw( find ); use File::Spec; use Exporter; diff --git a/C4/ItemCirculationAlertPreference.pm b/C4/ItemCirculationAlertPreference.pm index c7935163f2..45d30d95b7 100644 --- a/C4/ItemCirculationAlertPreference.pm +++ b/C4/ItemCirculationAlertPreference.pm @@ -20,7 +20,7 @@ package C4::ItemCirculationAlertPreference; use strict; use warnings; use C4::Context; -use Carp qw(carp croak); +use Carp qw( carp croak ); use Koha::ItemTypes; use Koha::Patron::Categories; diff --git a/C4/Items.pm b/C4/Items.pm index 1f0d560e86..14774e48e1 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -20,12 +20,12 @@ package C4::Items; use Modern::Perl; -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( AddItemFromMarc AddItemBatchFromMarc ModItemFromMarc @@ -39,30 +39,30 @@ BEGIN { GetHostItemsInfo get_hostitemnumbers_of GetHiddenItemnumbers + GetMarcItem MoveItemFromBiblio CartToShelf GetAnalyticsCount SearchItems PrepareItemrecordDisplay + ToggleNewStatus ); } -use Carp; -use Try::Tiny; +use Carp qw( croak ); use C4::Context; use C4::Koha; -use C4::Biblio; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcStructure TransformMarcToKoha ); +use Koha::DateUtils qw( dt_from_string output_pref ); use MARC::Record; -use C4::ClassSource; -use C4::Log; -use List::MoreUtils qw(any); +use C4::ClassSource qw( GetClassSort GetClassSources GetClassSource ); +use C4::Log qw( logaction ); +use List::MoreUtils qw( any ); use DateTime::Format::MySQL; -use Data::Dumper; # used as part of logging item record changes, not just for # debugging; so please don't remove this use Koha::AuthorisedValues; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Biblioitems; diff --git a/C4/Koha.pm b/C4/Koha.pm index 8388005a17..681d6ff38f 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -30,34 +30,35 @@ use Koha::MarcSubfieldStructures; use Business::ISBN; use Business::ISSN; use autouse 'Data::cselectall_arrayref' => qw(Dumper); -use vars qw(@ISA @EXPORT @EXPORT_OK); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetItemTypesCategorized - &getallthemes - &getFacets - &getnbpages - &getitemtypeimagedir - &getitemtypeimagesrc - &getitemtypeimagelocation - &GetAuthorisedValues - &GetNormalizedUPC - &GetNormalizedISBN - &GetNormalizedEAN - &GetNormalizedOCLCNumber - &xml_escape - - &GetVariationsOfISBN - &GetVariationsOfISBNs - &NormalizeISBN - &GetVariationsOfISSN - &GetVariationsOfISSNs - &NormalizeISSN - - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetItemTypesCategorized + getallthemes + getFacets + getImageSets + getnbpages + getitemtypeimagedir + getitemtypeimagesrc + getitemtypeimagelocation + GetAuthorisedValues + GetNormalizedUPC + GetNormalizedISBN + GetNormalizedEAN + GetNormalizedOCLCNumber + xml_escape + + GetVariationsOfISBN + GetVariationsOfISBNs + NormalizeISBN + GetVariationsOfISSN + GetVariationsOfISSNs + NormalizeISSN + + ); } =head1 NAME diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm index deb7429bc6..5f3a610079 100644 --- a/C4/Labels/Label.pm +++ b/C4/Labels/Label.pm @@ -3,14 +3,13 @@ package C4::Labels::Label; use strict; use warnings; -use Text::Wrap; -use Algorithm::CheckDigits; +use Text::Wrap qw( wrap ); +use Algorithm::CheckDigits qw( CheckDigits ); use Text::CSV_XS; -use Data::Dumper; use Text::Bidi qw( log2vis ); use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ); use Koha::ClassSources; use Koha::ClassSortRules; use Koha::ClassSplitRules; diff --git a/C4/Languages.pm b/C4/Languages.pm index 58cf16c185..b9c7e6dce9 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -22,24 +22,24 @@ package C4::Languages; use strict; use warnings; -use Carp; +use Carp qw( carp ); use CGI; use List::MoreUtils qw( any ); use C4::Context; use Koha::Caches; use Koha::Cache::Memory::Lite; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &getFrameworkLanguages - &getTranslatedLanguages - &getLanguages - &getAllLanguages + @EXPORT_OK = qw( + getFrameworkLanguages + getTranslatedLanguages + getLanguages + getAllLanguages ); - @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); + push @EXPORT_OK, qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage get_rfc4646_from_iso639); } =head1 NAME diff --git a/C4/Letters.pm b/C4/Letters.pm index 6b86105cbc..177a4f51f6 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -20,36 +20,47 @@ package C4::Letters; use Modern::Perl; use MIME::Lite; -use Date::Calc qw( Add_Delta_Days ); -use Encode; -use Carp; +use Carp qw( carp croak ); use Template; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Members; -use C4::Log; +use C4::Log qw( logaction ); use C4::SMS; use C4::Templates; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::SMS::Providers; use Koha::Email; use Koha::Notice::Messages; use Koha::Notice::Templates; -use Koha::DateUtils qw( format_sqldatetime dt_from_string ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::SMTP::Servers; use Koha::Subscriptions; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &EnqueueLetter &GetLetters &GetLettersAvailableForALibrary &GetLetterTemplates &DelLetter &GetPreparedLetter &GetWrappedLetter &SendAlerts &GetPrintMessages &GetMessageTransportTypes + @EXPORT_OK = qw( + GetLetters + GetLettersAvailableForALibrary + GetLetterTemplates + DelLetter + GetPreparedLetter + GetWrappedLetter + SendAlerts + GetPrintMessages + GetQueuedMessages + GetMessage + GetMessageTransportTypes + + EnqueueLetter + SendQueuedMessages + ResendMessage ); } diff --git a/C4/Linker.pm b/C4/Linker.pm index 969d2eac99..0648ee3e03 100644 --- a/C4/Linker.pm +++ b/C4/Linker.pm @@ -47,7 +47,6 @@ to the preferred form. use strict; use warnings; -use Carp; use C4::Context; use base qw(Class::Accessor); diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm index 934e87536a..c5cbee0e70 100644 --- a/C4/Linker/Default.pm +++ b/C4/Linker/Default.pm @@ -19,7 +19,6 @@ package C4::Linker::Default; use strict; use warnings; -use Carp; use MARC::Field; use C4::Heading; diff --git a/C4/Linker/FirstMatch.pm b/C4/Linker/FirstMatch.pm index 13c852532a..873395a362 100644 --- a/C4/Linker/FirstMatch.pm +++ b/C4/Linker/FirstMatch.pm @@ -19,7 +19,6 @@ package C4::Linker::FirstMatch; use strict; use warnings; -use Carp; use C4::Heading; use C4::Linker::Default; # Use Default for flipping diff --git a/C4/Linker/LastMatch.pm b/C4/Linker/LastMatch.pm index 1109f7aaef..1f873d8c5b 100644 --- a/C4/Linker/LastMatch.pm +++ b/C4/Linker/LastMatch.pm @@ -19,7 +19,6 @@ package C4::Linker::LastMatch; use strict; use warnings; -use Carp; use C4::Heading; use C4::Linker::Default; # Use Default for flipping diff --git a/C4/Log.pm b/C4/Log.pm index dc3c63fa80..5a9077de0d 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -27,7 +27,6 @@ use warnings; use JSON qw( to_json ); use C4::Context; -use Koha::DateUtils; use Koha::Logger; use vars qw(@ISA @EXPORT); @@ -35,7 +34,7 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw(&logaction &cronlogaction); + @EXPORT = qw(logaction cronlogaction); } =head1 NAME diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index a82dcbaed5..13b81ca0b4 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -22,29 +22,38 @@ use Modern::Perl; use DateTime; use C4::Context; -use Koha::SimpleMARC; +use Koha::SimpleMARC qw( + add_field + copy_and_replace_field + copy_field + delete_field + field_equals + field_exists + move_field + update_field +); use Koha::MoreUtils; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use vars qw(@ISA @EXPORT); BEGIN { - @ISA = qw(Exporter); + @ISA = qw(Exporter); @EXPORT = qw( - &GetModificationTemplates - &AddModificationTemplate - &DelModificationTemplate + GetModificationTemplates + AddModificationTemplate + DelModificationTemplate - &GetModificationTemplateAction - &GetModificationTemplateActions + GetModificationTemplateAction + GetModificationTemplateActions - &AddModificationTemplateAction - &ModModificationTemplateAction - &DelModificationTemplateAction - &MoveModificationTemplateAction + AddModificationTemplateAction + ModModificationTemplateAction + DelModificationTemplateAction + MoveModificationTemplateAction - &ModifyRecordsWithTemplate - &ModifyRecordWithTemplate + ModifyRecordsWithTemplate + ModifyRecordWithTemplate ); } diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 923b4accf1..e8a8ec3f74 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -19,12 +19,17 @@ package C4::Matcher; use Modern::Perl; -use MARC::Record; use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; -use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case ISBN/; +use Koha::Util::Normalize qw( + ISBN + legacy_default + lower_case + remove_spaces + upper_case +); =head1 NAME diff --git a/C4/Members.pm b/C4/Members.pm index 301e6f7e10..73b254cb5e 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -22,47 +22,41 @@ package C4::Members; use Modern::Perl; use C4::Context; -use String::Random qw( random_string ); use Scalar::Util qw( looks_like_number ); -use Date::Calc qw/Today check_date Date_to_Days/; -use List::MoreUtils qw( uniq ); -use JSON qw(to_json); -use C4::Log; # logaction -use C4::Overdues; +use Date::Calc qw( check_date Date_to_Days ); +use C4::Overdues qw( checkoverdues ); use C4::Reserves; use C4::Accounts; -use C4::Biblio; -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); use DateTime; use Koha::Database; -use Koha::DateUtils; -use Koha::AuthUtils qw(hash_password); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Holds; -use Koha::List::Patron; use Koha::News; use Koha::Patrons; use Koha::Patron::Categories; -our (@ISA,@EXPORT,@EXPORT_OK); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - #Get data - push @EXPORT, qw( + @EXPORT_OK = qw( + GetMemberDetails + GetMember - &GetAllIssues + GetAllIssues - &GetBorrowersToExpunge + GetBorrowersToExpunge - &IssueSlip - ); + IssueSlip + + checkuserpassword + get_cardnumber_length + checkcardnumber - #Check data - push @EXPORT, qw( - &checkuserpassword - &checkcardnumber + DeleteUnverifiedOpacRegistrations + DeleteExpiredOpacRegistrations ); } diff --git a/C4/Members/Statistics.pm b/C4/Members/Statistics.pm index e8c5d1fcdc..8259dda319 100644 --- a/C4/Members/Statistics.pm +++ b/C4/Members/Statistics.pm @@ -26,16 +26,17 @@ use Modern::Perl; use C4::Context; -our ( @ISA, @EXPORT, @EXPORT_OK ); +our ( @ISA, @EXPORT_OK ); BEGIN { require Exporter; @ISA = qw(Exporter); - push @EXPORT, qw( - &GetTotalIssuesTodayByBorrower - &GetTotalIssuesReturnedTodayByBorrower - &GetPrecedentStateByBorrower + @EXPORT_OK = qw( + get_fields + GetTotalIssuesTodayByBorrower + GetTotalIssuesReturnedTodayByBorrower + GetPrecedentStateByBorrower ); } diff --git a/C4/Message.pm b/C4/Message.pm index e10e3c594b..3a3216657b 100644 --- a/C4/Message.pm +++ b/C4/Message.pm @@ -22,10 +22,10 @@ package C4::Message; use strict; use warnings; use C4::Context; -use C4::Letters; -use YAML::XS; +use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use YAML::XS qw( Dump ); use Encode; -use Carp; +use Carp qw( carp ); =head1 NAME diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm index 0ecdc77b7d..ac9eb22dce 100644 --- a/C4/OAI/Sets.pm +++ b/C4/OAI/Sets.pm @@ -38,10 +38,10 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetOAISets &GetOAISet &GetOAISetBySpec &ModOAISet &DelOAISet &AddOAISet - &GetOAISetsMappings &GetOAISetMappings &ModOAISetMappings - &GetOAISetsBiblio &ModOAISetsBiblios &AddOAISetsBiblios - &CalcOAISetsBiblio &UpdateOAISetsBiblio &DelOAISetsBiblio + GetOAISets GetOAISet GetOAISetBySpec ModOAISet DelOAISet AddOAISet + GetOAISetsMappings GetOAISetMappings ModOAISetMappings + GetOAISetsBiblio ModOAISetsBiblios AddOAISetsBiblios + CalcOAISetsBiblio UpdateOAISetsBiblio DelOAISetsBiblio ); } diff --git a/C4/Output.pm b/C4/Output.pm index d57a80d32c..09dc73d41d 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -30,30 +30,23 @@ use Modern::Perl; use URI::Escape; use Scalar::Util qw( looks_like_number ); -use C4::Auth qw(get_template_and_user); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Templates; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(&is_ajax ajax_fail); # More stuff should go here instead - %EXPORT_TAGS = ( all =>[qw(setlanguagecookie pagination_bar parametrized_url - &output_with_http_headers &output_ajax_with_http_headers &output_html_with_http_headers)], - ajax =>[qw(&output_with_http_headers &output_ajax_with_http_headers is_ajax)], - html =>[qw(&output_with_http_headers &output_html_with_http_headers)] - ); - push @EXPORT, qw( + @ISA = qw(Exporter); + @EXPORT_OK = qw( + is_ajax + ajax_fail setlanguagecookie getlanguagecookie pagination_bar parametrized_url + output_html_with_http_headers output_ajax_with_http_headers output_with_http_headers + output_and_exit_if_error output_and_exit output_error ); - push @EXPORT, qw( - &output_html_with_http_headers &output_ajax_with_http_headers &output_with_http_headers - &output_and_exit_if_error &output_and_exit &output_error - ); - } =head1 NAME diff --git a/C4/Output/JSONStream.pm b/C4/Output/JSONStream.pm index 816ede8031..a16143c534 100644 --- a/C4/Output/JSONStream.pm +++ b/C4/Output/JSONStream.pm @@ -39,7 +39,7 @@ This module allows you to build JSON incrementally. use strict; use warnings; -use JSON; +use JSON qw( to_json ); sub new { my $class = shift; diff --git a/C4/Overdues.pm b/C4/Overdues.pm index e76cf79fce..54a42649f7 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -20,45 +20,38 @@ package C4::Overdues; # along with Koha; if not, see . use Modern::Perl; -use Date::Calc qw/Today Date_to_Days/; -use Date::Manip qw/UnixDate/; +use Date::Calc qw( Today ); +use Date::Manip qw( UnixDate ); use List::MoreUtils qw( uniq ); -use POSIX qw( floor ceil ); -use Locale::Currency::Format 1.28; -use Carp; +use POSIX qw( ceil floor ); +use Locale::Currency::Format 1.28 qw( currency_format FMT_SYMBOL ); +use Carp qw( carp ); -use C4::Circulation; use C4::Context; use C4::Accounts; -use C4::Log; # logaction use Koha::Logger; -use Koha::DateUtils; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Libraries; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); # subs to rename (and maybe merge some...) - push @EXPORT, qw( - &CalcFine - &Getoverdues - &checkoverdues - &UpdateFine - &GetFine - &get_chargeable_units - &GetOverduesForBranch - &GetOverdueMessageTransportTypes - &parse_overdues_letter - ); - - # subs to move to Circulation.pm - push @EXPORT, qw( - &GetIssuesIteminfo + @EXPORT_OK = qw( + CalcFine + Getoverdues + checkoverdues + UpdateFine + GetFine + GetBranchcodesWithOverdueRules + get_chargeable_units + GetOverduesForBranch + GetOverdueMessageTransportTypes + parse_overdues_letter + GetIssuesIteminfo ); } diff --git a/C4/Patroncards.pm b/C4/Patroncards.pm index 98fb59c28b..7358b29075 100644 --- a/C4/Patroncards.pm +++ b/C4/Patroncards.pm @@ -16,7 +16,16 @@ BEGIN { ); use C4::Patroncards::Batch; use C4::Patroncards::Layout; - use C4::Patroncards::Lib; + use C4::Patroncards::Lib qw( + box + get_borrower_attributes + get_image + leading + put_image + rm_image + text_alignment + unpack_UTF8 +); use C4::Patroncards::Patroncard; use C4::Patroncards::Profile; use C4::Patroncards::Template; diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 6482198d32..9251147420 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/C4/Patroncards/Patroncard.pm @@ -21,12 +21,16 @@ use strict; use warnings; use autouse 'Data::Dumper' => qw(Dumper); -use Text::Wrap qw(wrap); #use Font::TTFMetrics; -use C4::Creators::Lib qw(get_font_types get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); use C4::Creators::PDF qw(StrWidth); -use C4::Patroncards::Lib qw(unpack_UTF8 text_alignment leading box get_borrower_attributes); +use C4::Patroncards::Lib qw( + box + get_borrower_attributes + leading + text_alignment +); =head1 NAME diff --git a/C4/Record.pm b/C4/Record.pm index 0c3c670ef3..d2377edd03 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -25,20 +25,20 @@ use Modern::Perl; use MARC::Record; # marc2marcxml, marcxml2marc, changeEncoding use MARC::File::XML; # marc2marcxml, marcxml2marc, changeEncoding use Biblio::EndnoteStyle; -use Unicode::Normalize; # _entity_encode -use C4::Biblio; #marc2bibtex +use Unicode::Normalize qw( NFC ); # _entity_encode +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ); use C4::Koha; #marc2csv -use C4::XSLT (); +use C4::XSLT; use YAML::XS; #marcrecords2csv use Encode; use Template; use Text::CSV::Encoded; #marc2csv use Koha::Items; -use Koha::SimpleMARC qw(read_field); +use Koha::SimpleMARC qw( read_field ); use Koha::XSLT::Base; use Koha::CsvProfiles; use Koha::AuthorisedValues; -use Carp; +use Carp qw( carp croak ); use vars qw(@ISA @EXPORT); @@ -48,16 +48,17 @@ use vars qw(@ISA @EXPORT); # only export API methods @EXPORT = qw( - &marc2endnote - &marc2marc - &marc2marcxml - &marcxml2marc - &marc2dcxml - &marc2modsxml - &marc2madsxml - &marc2bibtex - &marc2csv - &changeEncoding + marc2endnote + marc2marc + marc2marcxml + marcxml2marc + marc2dcxml + marc2modsxml + marc2madsxml + marc2bibtex + marc2csv + marcrecord2csv + changeEncoding ); =head1 NAME diff --git a/C4/Reports.pm b/C4/Reports.pm index 4d566b0141..ef1f00417e 100644 --- a/C4/Reports.pm +++ b/C4/Reports.pm @@ -20,13 +20,13 @@ package C4::Reports; use Modern::Perl; use CGI qw ( -utf8 ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( GetDelimiterChoices ); } diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 113d1b5447..6611393ca0 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -19,40 +19,42 @@ package C4::Reports::Guided; use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; +use Carp qw( carp croak ); use JSON qw( from_json ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; use C4::Templates qw/themelanguage/; -use C4::Koha; -use Koha::DateUtils; +use C4::Koha qw( GetAuthorisedValues ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::Reports; use C4::Output; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Notice::Templates; -use C4::Letters; use Koha::Logger; use Koha::AuthorisedValues; use Koha::Patron::Categories; use Koha::SharedContent; +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @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 format_results get_sql + 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 ); } diff --git a/C4/Reserves.pm b/C4/Reserves.pm index dfd0c70568..54d2b00cb0 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -24,12 +24,11 @@ package C4::Reserves; use Modern::Perl; use C4::Accounts; -use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( CheckIfIssuedToPatron GetAgeRestriction GetBranchItemRule ); use C4::Context; -use C4::Items; +use C4::Items qw( CartToShelf get_hostitemnumbers_of ); use C4::Letters; -use C4::Log; +use C4::Log qw( logaction ); use C4::Members::Messaging; use C4::Members; use Koha::Account::Lines; @@ -37,7 +36,7 @@ use Koha::Biblios; use Koha::Calendar; use Koha::CirculationRules; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Hold; use Koha::Holds; use Koha::ItemTypes; @@ -47,11 +46,8 @@ use Koha::Old::Hold; use Koha::Patrons; use Koha::Plugins; -use Carp; -use Data::Dumper; -use List::MoreUtils qw( firstidx any ); - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +use Data::Dumper qw( Dumper ); +use List::MoreUtils qw( any ); =head1 NAME @@ -99,49 +95,57 @@ This modules provides somes functions to deal with reservations. =cut +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &AddReserve + @EXPORT_OK = qw( + AddReserve + + GetReserveStatus + + GetOtherReserves + ChargeReserveFee + GetReserveFee + + ModReserveFill + ModReserveAffect + ModReserve + ModReserveStatus + ModReserveCancelAll + ModReserveMinusPriority + MoveReserve - &GetReserveStatus + CheckReserves + CanBookBeReserved + CanItemBeReserved + CanReserveBeCanceledFromOpac + CancelExpiredReserves - &GetOtherReserves + AutoUnsuspendReserves - &ModReserveFill - &ModReserveAffect - &ModReserve - &ModReserveStatus - &ModReserveCancelAll - &ModReserveMinusPriority - &MoveReserve + IsAvailableForItemLevelRequest + ItemsAnyAvailableAndNotRestricted - &CheckReserves - &CanBookBeReserved - &CanItemBeReserved - &CanReserveBeCanceledFromOpac - &CancelExpiredReserves + AlterPriority + ToggleLowestPriority - &AutoUnsuspendReserves + ReserveSlip + ToggleSuspend + SuspendAll - &IsAvailableForItemLevelRequest - ItemsAnyAvailableAndNotRestricted + GetReservesControlBranch - &AlterPriority - &ToggleLowestPriority + CalculatePriority - &ReserveSlip - &ToggleSuspend - &SuspendAll + IsItemOnHoldAndFound - &GetReservesControlBranch + GetMaxPatronHoldsForRecord - IsItemOnHoldAndFound + MergeHolds - GetMaxPatronHoldsForRecord + RevertWaitingStatus ); - @EXPORT_OK = qw( MergeHolds ); } =head2 AddReserve diff --git a/C4/Ris.pm b/C4/Ris.pm index 867030c73c..9ab50d924b 100644 --- a/C4/Ris.pm +++ b/C4/Ris.pm @@ -62,12 +62,12 @@ package C4::Ris; use Modern::Perl; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use YAML::XS; use Encode; use vars qw(@ISA @EXPORT); -use Koha::SimpleMARC qw(read_field); +use Koha::SimpleMARC qw( read_field ); @ISA = qw(Exporter); @@ -75,7 +75,7 @@ use Koha::SimpleMARC qw(read_field); # only export API methods @EXPORT = qw( - &marc2ris + marc2ris ); our $marcprint = 0; # Debug flag; diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 2732a69b80..a1f8df740d 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -25,12 +25,10 @@ package C4::RotatingCollections; use Modern::Perl; use C4::Context; -use C4::Circulation; use C4::Reserves qw(CheckReserves); use Koha::Database; -use DBI; -use Try::Tiny; +use Try::Tiny qw( catch try ); use vars qw(@ISA @EXPORT); @@ -61,6 +59,8 @@ BEGIN { TransferCollection GetCollectionItemBranches + isItemInAnyCollection + isItemInThisCollection ); } diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index 13509cc6bd..3cacc3aa44 100644 --- a/C4/SIP/ILS.pm +++ b/C4/SIP/ILS.pm @@ -6,7 +6,7 @@ package C4::SIP::ILS; use warnings; use strict; -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use Data::Dumper; use C4::SIP::ILS::Item; diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index b2063a48bc..48df606cad 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -17,11 +17,11 @@ use C4::SIP::ILS::Transaction; use C4::SIP::Sip qw(add_field); use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( barcodedecode ); use C4::Context; use C4::Items; use C4::Members; -use C4::Reserves; +use C4::Reserves qw( ModReserveFill ); use Koha::Biblios; use Koha::Checkouts::ReturnClaims; use Koha::Checkouts; diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 83b66d778b..a4e09304ac 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -11,9 +11,9 @@ use strict; use C4::SIP::ILS::Transaction; -use C4::Circulation; +use C4::Circulation qw( AddReturn LostItem ); use C4::Items qw( ModItemTransfer ); -use C4::Reserves qw( ModReserveAffect ); +use C4::Reserves qw( ModReserve ModReserveAffect ); use Koha::DateUtils qw( dt_from_string ); use Koha::Items; diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index b321a24876..f5c88766ca 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -8,14 +8,14 @@ use warnings; use strict; use POSIX qw(strftime); -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use Data::Dumper; use CGI qw ( -utf8 ); use C4::SIP::ILS::Transaction; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); use C4::Members; use C4::Reserves qw(ModReserveFill); use Koha::DateUtils; diff --git a/C4/SIP/ILS/Transaction/Hold.pm b/C4/SIP/ILS/Transaction/Hold.pm index 2bc1133e8d..82fddf1e97 100644 --- a/C4/SIP/ILS/Transaction/Hold.pm +++ b/C4/SIP/ILS/Transaction/Hold.pm @@ -7,13 +7,13 @@ use Modern::Perl; use C4::SIP::ILS::Transaction; -use C4::Reserves; # AddReserve +use C4::Reserves qw( CalculatePriority AddReserve ModReserve ); use Koha::Holds; use Koha::Patrons; -use parent qw(C4::SIP::ILS::Transaction); - use Koha::Items; +use parent qw(C4::SIP::ILS::Transaction); + my %fields = ( expiration_date => 0, pickup_location => undef, diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm index e950424d74..9e5579ee87 100644 --- a/C4/SIP/ILS/Transaction/Renew.pm +++ b/C4/SIP/ILS/Transaction/Renew.pm @@ -7,7 +7,7 @@ package C4::SIP::ILS::Transaction::Renew; use warnings; use strict; -use C4::Circulation; +use C4::Circulation qw( CanBookBeRenewed GetIssuingCharges AddIssue ); use Koha::Patrons; use Koha::DateUtils; diff --git a/C4/SIP/ILS/Transaction/RenewAll.pm b/C4/SIP/ILS/Transaction/RenewAll.pm index 23d552b22e..5acd53efb7 100644 --- a/C4/SIP/ILS/Transaction/RenewAll.pm +++ b/C4/SIP/ILS/Transaction/RenewAll.pm @@ -6,7 +6,7 @@ package C4::SIP::ILS::Transaction::RenewAll; use strict; use warnings; -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use C4::SIP::ILS::Item; diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm index f1c1ae448b..4f0a0a627f 100644 --- a/C4/SIP/SIPServer.pm +++ b/C4/SIP/SIPServer.pm @@ -21,8 +21,8 @@ use C4::SIP::Sip::MsgType qw( handle login_core ); use C4::SIP::Logger qw(set_logger); use Koha::Caches; - use Koha::Logger; + use C4::SIP::Trapper; tie *STDERR, "C4::SIP::Trapper"; diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm index 3d68f9765c..2842a611b6 100644 --- a/C4/SIP/Sip.pm +++ b/C4/SIP/Sip.pm @@ -15,7 +15,7 @@ use List::Util qw(first); use C4::SIP::Sip::Constants qw(SIP_DATETIME FID_SCREEN_MSG); use C4::SIP::Sip::Checksum qw(checksum); -use C4::SIP::Logger qw(get_logger); +use C4::SIP::Logger qw( get_logger ); use base qw(Exporter); diff --git a/C4/Scheduler.pm b/C4/Scheduler.pm index a1c1ae557f..e2f6d85f65 100644 --- a/C4/Scheduler.pm +++ b/C4/Scheduler.pm @@ -19,15 +19,14 @@ package C4::Scheduler; use Modern::Perl; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; use Schedule::At; +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = - qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); } =head1 NAME diff --git a/C4/Scrubber.pm b/C4/Scrubber.pm index 494b079496..0fcd3580bc 100644 --- a/C4/Scrubber.pm +++ b/C4/Scrubber.pm @@ -21,7 +21,7 @@ package C4::Scrubber; use strict; use warnings; -use Carp; +use Carp qw( croak ); use HTML::Scrubber; use C4::Context; diff --git a/C4/Search.pm b/C4/Search.pm index 03f7ecf591..1ca987add2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -16,28 +16,44 @@ package C4::Search; # along with Koha; if not, see . use Modern::Perl; -require Exporter; use C4::Context; -use C4::Biblio; # GetMarcFromKohaField, GetBiblioData -use C4::Koha; # getFacets +use C4::Biblio qw( TransformMarcToKoha GetMarcFromKohaField GetFrameworkCode GetAuthorisedValueDesc GetBiblioData ); +use C4::Koha qw( getFacets GetVariationsOfISBN GetNormalizedUPC GetNormalizedEAN GetNormalizedOCLCNumber GetNormalizedISBN getitemtypeimagelocation ); use Koha::DateUtils; use Koha::Libraries; use Lingua::Stem; use XML::Simple; -use C4::XSLT; -use C4::Reserves; # GetReserveStatus -use C4::Charset; -use Koha::Logger; +use C4::XSLT qw( XSLTParse4Display ); +use C4::Reserves qw( GetReserveStatus ); +use C4::Charset qw( SetUTF8Flag ); use Koha::AuthorisedValues; use Koha::ItemTypes; use Koha::Libraries; +use Koha::Logger; use Koha::Patrons; use Koha::RecordProcessor; use URI::Escape; use Business::ISBN; use MARC::Record; use MARC::Field; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); + +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 @@ -55,17 +71,6 @@ This module provides searching functions for Koha's bibliographic databases =cut -@ISA = qw(Exporter); -@EXPORT = qw( - &FindDuplicate - &SimpleSearch - &searchResults - &getRecords - &buildQuery - &GetDistinctValues - &enabled_staff_search_views -); - # make all your functions, whether exported or not; =head2 FindDuplicate diff --git a/C4/Search/History.pm b/C4/Search/History.pm index 8406f3086b..df36cb0fbc 100644 --- a/C4/Search/History.pm +++ b/C4/Search/History.pm @@ -4,11 +4,10 @@ use Modern::Perl; use C4::Auth qw( get_session ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use JSON qw( encode_json decode_json ); -use URI::Escape; -use Encode; +use JSON qw( decode_json encode_json ); +use URI::Escape qw( uri_escape uri_unescape ); sub add { my ($params) = @_; diff --git a/C4/Search/PazPar2.pm b/C4/Search/PazPar2.pm index a1682930d0..886cc868ca 100644 --- a/C4/Search/PazPar2.pm +++ b/C4/Search/PazPar2.pm @@ -22,7 +22,7 @@ use Modern::Perl; use LWP::UserAgent; use URI; use URI::QueryParam; -use XML::Simple; +use XML::Simple qw( XMLin ); =head1 NAME diff --git a/C4/Serials.pm b/C4/Serials.pm index a2c1e24acb..d840bf24b7 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -20,25 +20,30 @@ package C4::Serials; use Modern::Perl; -use C4::Auth qw(haspermission); +use C4::Auth qw( haspermission ); use C4::Context; use DateTime; -use Date::Calc qw(:all); -use POSIX qw(strftime); -use C4::Biblio; -use C4::Log; # logaction -use C4::Serials::Frequency; +use Date::Calc qw( + Add_Delta_Days + Add_Delta_YM + check_date + Delta_Days + N_Delta_YMD + Today +); +use POSIX qw( strftime ); +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblio ); +use C4::Log qw( logaction ); # logaction +use C4::Serials::Frequency qw( GetSubscriptionFrequency ); use C4::Serials::Numberpattern; use Koha::AdditionalFieldValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Serial; use Koha::Subscriptions; use Koha::Subscription::Histories; use Koha::SharedContent; use Scalar::Util qw( looks_like_number ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - # Define statuses use constant { EXPECTED => 1, @@ -61,31 +66,39 @@ use constant MISSING_STATUSES => ( MISSING_LOST ); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &NewSubscription &ModSubscription &DelSubscription - &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber - &SearchSubscriptions - &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory - &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire - &GetSubscriptionHistoryFromSubscriptionId - - &GetNextSeq &GetSeq &NewIssue &GetSerials - &GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2 - &GetSubscriptionLength &ReNewSubscription &GetLateOrMissingIssues - &GetSerialInformation &AddItem2Serial - &PrepareSerialsData &GetNextExpected &ModNextExpected - &GetPreviousSerialid - - &GetSuppliersWithLateIssues - &getroutinglist &delroutingmember &addroutingmember - &reorder_members - &check_routing &updateClaim - &CountIssues + @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 - &subscriptionCurrentlyOnOrder + + findSerialsByStatus ); } diff --git a/C4/Serials/Frequency.pm b/C4/Serials/Frequency.pm index 509f6801f5..9db52c8839 100644 --- a/C4/Serials/Frequency.pm +++ b/C4/Serials/Frequency.pm @@ -28,13 +28,13 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetSubscriptionFrequencies - &GetSubscriptionFrequency - &AddSubscriptionFrequency - &ModSubscriptionFrequency - &DelSubscriptionFrequency + GetSubscriptionFrequencies + GetSubscriptionFrequency + AddSubscriptionFrequency + ModSubscriptionFrequency + DelSubscriptionFrequency - &GetSubscriptionsWithFrequency + GetSubscriptionsWithFrequency ); } diff --git a/C4/Serials/Numberpattern.pm b/C4/Serials/Numberpattern.pm index 3c35b628dc..5c31bc6cf5 100644 --- a/C4/Serials/Numberpattern.pm +++ b/C4/Serials/Numberpattern.pm @@ -29,14 +29,14 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetSubscriptionNumberpatterns - &GetSubscriptionNumberpattern - &GetSubscriptionNumberpatternByName - &AddSubscriptionNumberpattern - &ModSubscriptionNumberpattern - &DelSubscriptionNumberpattern - - &GetSubscriptionsWithNumberpattern + GetSubscriptionNumberpatterns + GetSubscriptionNumberpattern + GetSubscriptionNumberpatternByName + AddSubscriptionNumberpattern + ModSubscriptionNumberpattern + DelSubscriptionNumberpattern + + GetSubscriptionsWithNumberpattern ); } diff --git a/C4/Service.pm b/C4/Service.pm index 790f147f07..c50051d6aa 100644 --- a/C4/Service.pm +++ b/C4/Service.pm @@ -43,7 +43,7 @@ use warnings; use CGI qw ( -utf8 ); use C4::Auth qw( check_api_auth ); -use C4::Output qw( :ajax ); +use C4::Output qw( output_with_http_headers ); use C4::Output::JSONStream; use JSON; diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm index b115c93541..0b1bec414d 100644 --- a/C4/ShelfBrowser.pm +++ b/C4/ShelfBrowser.pm @@ -20,21 +20,18 @@ package C4::ShelfBrowser; use strict; use warnings; -use C4::Biblio; +use C4::Biblio qw( GetAuthorisedValueDesc GetMarcBiblio ); use C4::Context; -use C4::Koha; +use C4::Koha qw( GetNormalizedUPC GetNormalizedOCLCNumber GetNormalizedISBN GetNormalizedEAN ); use Koha::Biblios; use Koha::Libraries; -use vars qw(@ISA @EXPORT @EXPORT_OK); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetNearbyItems - ); + require Exporter; + @ISA = qw(Exporter); @EXPORT_OK = qw( + GetNearbyItems ); } diff --git a/C4/SocialData.pm b/C4/SocialData.pm index 218cf4e9f7..8217ccb49e 100644 --- a/C4/SocialData.pm +++ b/C4/SocialData.pm @@ -19,7 +19,7 @@ use Modern::Perl; use C4::Context; use Business::ISBN; -use C4::Koha; +use C4::Koha qw( GetNormalizedISBN ); =head1 NAME diff --git a/C4/Stats.pm b/C4/Stats.pm index ff2eae9d7d..7d63f18aa9 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -20,7 +20,7 @@ package C4::Stats; use Modern::Perl; require Exporter; -use Carp; +use Carp qw( croak ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); @@ -30,10 +30,10 @@ use Koha::PseudonymizedTransactions; use vars qw(@ISA @EXPORT); BEGIN { - @ISA = qw(Exporter); - @EXPORT = qw( - &UpdateStats - ); + @ISA = qw(Exporter); + @EXPORT = qw( + UpdateStats + ); } diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 37a482e2d3..ba72a1888a 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -25,10 +25,9 @@ use C4::Context; use C4::Output; use C4::Letters; use C4::Biblio qw( GetMarcFromKohaField ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Suggestions; -use List::MoreUtils qw(any); use base qw(Exporter); our @EXPORT = qw( diff --git a/C4/Tags.pm b/C4/Tags.pm index 7e1a22154f..e01244f927 100644 --- a/C4/Tags.pm +++ b/C4/Tags.pm @@ -20,35 +20,36 @@ package C4::Tags; use strict; use warnings; -use Carp; +use Carp qw( carp ); use Exporter; use C4::Context; -use Module::Load::Conditional qw/check_install/; +use Module::Load::Conditional qw( check_install ); #use Data::Dumper; 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"; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - @ISA = qw(Exporter); + @ISA = qw(Exporter); @EXPORT_OK = qw( - &get_tag &get_tags &get_tag_rows - &add_tags &add_tag - &delete_tag_row_by_id - &remove_tag - &delete_tag_rows_by_ids - &get_approval_rows - &blacklist - &whitelist - &is_approved - &approval_counts - &get_count_by_tag_status - &get_filters + get_tag get_tags get_tag_rows + add_tags + add_tag + add_tag_approval + add_tag_index + delete_tag_row_by_id + remove_tag + delete_tag_rows_by_ids + get_approval_rows + blacklist + whitelist + is_approved + approval_counts + get_count_by_tag_status + get_filters stratify_tags ); - # %EXPORT_TAGS = (); my $ext_dict = C4::Context->preference('TagsExternalDictionary'); if ( $ext_dict && ! check_install( module => 'Lingua::Ispell' ) ) { warn "Ignoring TagsExternalDictionary, because Lingua::Ispell is not installed."; diff --git a/C4/Templates.pm b/C4/Templates.pm index 644e235b91..f6fefaa6fa 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -2,9 +2,9 @@ package C4::Templates; use strict; use warnings; -use Carp; +use Carp qw( carp ); use CGI qw ( -utf8 ); -use List::MoreUtils qw/ any uniq /; +use List::MoreUtils qw( uniq ); # Copyright 2009 Chris Cormack and The Koha Dev Team # @@ -31,8 +31,7 @@ C4::Templates - Object for manipulating templates for use with Koha use base qw(Class::Accessor); use Template; -use Template::Constants qw( :debug ); -use C4::Languages qw(getTranslatedLanguages get_bidi regex_lang_subtags language_get_description accept_language ); +use C4::Languages qw( get_bidi getTranslatedLanguages regex_lang_subtags ); use C4::Context; diff --git a/C4/TmplTokenType.pm b/C4/TmplTokenType.pm index c8a5c96e89..91bc40c23c 100644 --- a/C4/TmplTokenType.pm +++ b/C4/TmplTokenType.pm @@ -20,8 +20,6 @@ package C4::TmplTokenType; use Modern::Perl; require Exporter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - ############################################################################### =head1 NAME @@ -38,25 +36,28 @@ The predefined constants are ############################################################################### -@ISA = qw(Exporter); -@EXPORT_OK = qw( - &TEXT - &TEXT_PARAMETRIZED - &CDATA - &TAG - &DECL - &PI - &DIRECTIVE - &COMMENT - &UNKNOWN -); - ############################################################################### 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( + TEXT + TEXT_PARAMETRIZED + CDATA + TAG + DECL + PI + DIRECTIVE + COMMENT + UNKNOWN + ); + my $new = sub { my $this = 'C4::TmplTokenType';#shift; my $class = ref($this) || $this; diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 3c4ec3dafc..be49a53b08 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -19,9 +19,9 @@ package C4::UsageStats; use Modern::Perl; use C4::Context; -use POSIX qw(strftime); +use POSIX qw( strftime ); use LWP::UserAgent; -use JSON; +use JSON qw( decode_json encode_json ); use Koha::Libraries; diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index a718a9633e..3d677b8e01 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -2,8 +2,8 @@ package C4::Utils::DataTables::Members; use Modern::Perl; use C4::Context; -use C4::Utils::DataTables; -use Koha::DateUtils; +use C4::Utils::DataTables qw( dt_build_orderby ); +use Koha::DateUtils qw( dt_from_string output_pref ); sub search { my ( $params ) = @_; diff --git a/C4/Utils/DataTables/VirtualShelves.pm b/C4/Utils/DataTables/VirtualShelves.pm index 5a349326b1..cc52165a2f 100644 --- a/C4/Utils/DataTables/VirtualShelves.pm +++ b/C4/Utils/DataTables/VirtualShelves.pm @@ -2,7 +2,7 @@ package C4::Utils::DataTables::VirtualShelves; use Modern::Perl; use C4::Context; -use C4::Utils::DataTables; +use C4::Utils::DataTables qw( dt_build_orderby ); use Koha::Virtualshelves; sub search { diff --git a/C4/XISBN.pm b/C4/XISBN.pm index 65ef2878db..c6e03d3071 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -21,24 +21,22 @@ use Modern::Perl; use XML::Simple; #use LWP::Simple; use C4::Biblio; -use C4::Koha; -use C4::Search; -use C4::External::Syndetics qw(get_syndetics_editions); +use C4::Koha qw( GetNormalizedISBN ); +use C4::Search qw( new_record_from_zebra ); +use C4::External::Syndetics qw( get_syndetics_editions ); use LWP::UserAgent; -use HTTP::Request::Common; use Koha::Biblios; use Koha::SearchEngine; use Koha::SearchEngine::Search; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw( - &get_xisbns - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + get_xisbns + ); } =head1 NAME diff --git a/C4/XSLT.pm b/C4/XSLT.pm index b8ae90e978..245d76b74f 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -24,30 +24,29 @@ package C4::XSLT; use Modern::Perl; use C4::Context; -use C4::Items; -use C4::Koha; -use C4::Biblio; -use C4::Circulation; -use C4::Reserves; +use C4::Koha qw( xml_escape ); +use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); use Koha::AuthorisedValues; use Koha::ItemTypes; use Koha::XSLT::Base; use Koha::Libraries; -use Encode; -use vars qw(@ISA @EXPORT); my $engine; #XSLT Handler object my %authval_per_framework; # Cache for tagfield-tagsubfield to decode per framework. # Should be preferably be placed in Koha-core... +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &XSLTParse4Display + @EXPORT_OK = qw( + transformMARCXML4XSLT + getAuthorisedValues4MARCSubfields + buildKohaItemsNamespace + XSLTParse4Display ); $engine=Koha::XSLT::Base->new( { do_not_return_source => 1 } ); } diff --git a/Koha/Account.pm b/Koha/Account.pm index bd4af13a2d..23252c7332 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -20,9 +20,8 @@ package Koha::Account; use Modern::Perl; use Carp; -use Data::Dumper; -use List::MoreUtils qw( uniq ); -use Try::Tiny; +use Data::Dumper qw( Dumper ); +use Try::Tiny qw( catch try ); use C4::Circulation qw( ReturnLostItem CanBookBeRenewed AddRenewal ); use C4::Letters; @@ -34,7 +33,6 @@ use Koha::Patrons; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Account::DebitTypes; -use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; use Koha::Exceptions::Account; diff --git a/Koha/Account/CreditType.pm b/Koha/Account/CreditType.pm index 359618922f..faf65cfce4 100644 --- a/Koha/Account/CreditType.pm +++ b/Koha/Account/CreditType.pm @@ -18,7 +18,6 @@ package Koha::Account::CreditType; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/Account/CreditTypes.pm b/Koha/Account/CreditTypes.pm index 2b058ded37..27b43e6d92 100644 --- a/Koha/Account/CreditTypes.pm +++ b/Koha/Account/CreditTypes.pm @@ -18,7 +18,6 @@ package Koha::Account::CreditTypes; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Account::CreditType; diff --git a/Koha/Account/DebitType.pm b/Koha/Account/DebitType.pm index 57cf2cc1f6..1d5f7f1418 100644 --- a/Koha/Account/DebitType.pm +++ b/Koha/Account/DebitType.pm @@ -18,7 +18,6 @@ package Koha::Account::DebitType; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/Account/DebitTypes.pm b/Koha/Account/DebitTypes.pm index 8b3558be6f..3860264d50 100644 --- a/Koha/Account/DebitTypes.pm +++ b/Koha/Account/DebitTypes.pm @@ -18,7 +18,6 @@ package Koha::Account::DebitTypes; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Account::DebitType; diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index bd233e3b36..36a420b10c 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -17,17 +17,16 @@ package Koha::Account::Line; use Modern::Perl; -use Carp; -use Data::Dumper; +use Data::Dumper qw( Dumper ); -use C4::Log qw(logaction); -use C4::Overdues qw(GetFine); +use C4::Log qw( logaction ); +use C4::Overdues qw( UpdateFine ); use Koha::Account::CreditType; use Koha::Account::DebitType; use Koha::Account::Offsets; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Account; use Koha::Items; diff --git a/Koha/Account/Lines.pm b/Koha/Account/Lines.pm index d593893924..ab8986db2d 100644 --- a/Koha/Account/Lines.pm +++ b/Koha/Account/Lines.pm @@ -17,7 +17,6 @@ package Koha::Account::Lines; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Line; diff --git a/Koha/Account/Offset.pm b/Koha/Account/Offset.pm index 0751ce8036..1ff8c11da2 100644 --- a/Koha/Account/Offset.pm +++ b/Koha/Account/Offset.pm @@ -17,7 +17,6 @@ package Koha::Account::Offset; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Lines; diff --git a/Koha/Account/Offsets.pm b/Koha/Account/Offsets.pm index 0083f0d3ab..6a401968f2 100644 --- a/Koha/Account/Offsets.pm +++ b/Koha/Account/Offsets.pm @@ -17,7 +17,6 @@ package Koha::Account::Offsets; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm index 4f10557901..6717f5f9d4 100644 --- a/Koha/Acquisition/Basket.pm +++ b/Koha/Acquisition/Basket.pm @@ -25,7 +25,7 @@ use Koha::Acquisition::BasketGroups; use Koha::Acquisition::Orders; use Koha::Exceptions::Acquisition::Basket; use Koha::Patrons; -use C4::Log qw(logaction); +use C4::Log qw( logaction ); use base qw( Koha::Object Koha::Object::Mixin::AdditionalFields ); diff --git a/Koha/Acquisition/Bookseller/Contact.pm b/Koha/Acquisition/Bookseller/Contact.pm index 61da32eac0..1b184fb3dd 100644 --- a/Koha/Acquisition/Bookseller/Contact.pm +++ b/Koha/Acquisition/Bookseller/Contact.pm @@ -4,7 +4,6 @@ use Modern::Perl; use base qw( Koha::Object ); -use Carp qw( croak ); sub _type { return 'Aqcontact'; diff --git a/Koha/Acquisition/Bookseller/Contacts.pm b/Koha/Acquisition/Bookseller/Contacts.pm index 053e7a6d97..fa066f45af 100644 --- a/Koha/Acquisition/Bookseller/Contacts.pm +++ b/Koha/Acquisition/Bookseller/Contacts.pm @@ -2,7 +2,6 @@ package Koha::Acquisition::Bookseller::Contacts; use Modern::Perl; -use Carp; use base qw( Koha::Objects ); diff --git a/Koha/Acquisition/Currencies.pm b/Koha/Acquisition/Currencies.pm index 5e730e568c..42f1d2ff20 100644 --- a/Koha/Acquisition/Currencies.pm +++ b/Koha/Acquisition/Currencies.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currencies; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm index 050cf6c4a1..8404d4bb42 100644 --- a/Koha/Acquisition/Currency.pm +++ b/Koha/Acquisition/Currency.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currency; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Invoice/Adjustment.pm b/Koha/Acquisition/Invoice/Adjustment.pm index 0d0bac7353..e0f1db3d0f 100644 --- a/Koha/Acquisition/Invoice/Adjustment.pm +++ b/Koha/Acquisition/Invoice/Adjustment.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Invoice::Adjustment; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Acquisition::Invoices; diff --git a/Koha/Acquisition/Invoice/Adjustments.pm b/Koha/Acquisition/Invoice/Adjustments.pm index 3a43904b06..f45f12b79e 100644 --- a/Koha/Acquisition/Invoice/Adjustments.pm +++ b/Koha/Acquisition/Invoice/Adjustments.pm @@ -18,7 +18,6 @@ package Koha::Acquisition::Invoice::Adjustments; use Modern::Perl; use Koha::Acquisition::Invoice::Adjustment; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index 07dea68939..090920d92c 100644 --- a/Koha/Acquisition/Order.pm +++ b/Koha/Acquisition/Order.pm @@ -18,16 +18,15 @@ package Koha::Acquisition::Order; use Modern::Perl; use Carp qw( croak ); -use Try::Tiny; -use C4::Biblio qw(DelBiblio); +use C4::Biblio qw( DelBiblio ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Funds; use Koha::Acquisition::Invoices; use Koha::Acquisition::Order::Claims; use Koha::Database; -use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Object; use Koha::Biblios; use Koha::Holds; diff --git a/Koha/Acquisition/Order/Claim.pm b/Koha/Acquisition/Order/Claim.pm index e377e4b679..902283080d 100644 --- a/Koha/Acquisition/Order/Claim.pm +++ b/Koha/Acquisition/Order/Claim.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claim; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Order/Claims.pm b/Koha/Acquisition/Order/Claims.pm index 9e96045711..3190733652 100644 --- a/Koha/Acquisition/Order/Claims.pm +++ b/Koha/Acquisition/Order/Claims.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claims; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm index 2b06b81d1e..b2496260a9 100644 --- a/Koha/Acquisition/Orders.pm +++ b/Koha/Acquisition/Orders.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Orders; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AdvancedEditorMacro.pm b/Koha/AdvancedEditorMacro.pm index 975f850fa9..6627b325de 100644 --- a/Koha/AdvancedEditorMacro.pm +++ b/Koha/AdvancedEditorMacro.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacro; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AdvancedEditorMacros.pm b/Koha/AdvancedEditorMacros.pm index 4fdf25ba9f..d890185e4d 100644 --- a/Koha/AdvancedEditorMacros.pm +++ b/Koha/AdvancedEditorMacros.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacros; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ApiKey.pm b/Koha/ApiKey.pm index 80d630c323..d966bc5849 100644 --- a/Koha/ApiKey.pm +++ b/Koha/ApiKey.pm @@ -19,7 +19,6 @@ package Koha::ApiKey; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/ApiKeys.pm b/Koha/ApiKeys.pm index 8eb84d1b61..07cabd3204 100644 --- a/Koha/ApiKeys.pm +++ b/Koha/ApiKeys.pm @@ -19,7 +19,6 @@ package Koha::ApiKeys; use Modern::Perl; -use Carp; use Koha::Database; use Koha::ApiKey; diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index 6b8809bc33..05b0e32542 100644 --- a/Koha/ArticleRequest.pm +++ b/Koha/ArticleRequest.pm @@ -19,14 +19,13 @@ package Koha::ArticleRequest; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Patrons; use Koha::Biblios; use Koha::Items; use Koha::Libraries; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Object); diff --git a/Koha/ArticleRequests.pm b/Koha/ArticleRequests.pm index 9b27615573..2d3dce5627 100644 --- a/Koha/ArticleRequests.pm +++ b/Koha/ArticleRequests.pm @@ -19,7 +19,6 @@ package Koha::ArticleRequests; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AudioAlert.pm b/Koha/AudioAlert.pm index 6cddd28b94..6d5cf639e0 100644 --- a/Koha/AudioAlert.pm +++ b/Koha/AudioAlert.pm @@ -19,7 +19,6 @@ package Koha::AudioAlert; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AudioAlerts.pm b/Koha/AudioAlerts.pm index daca3c6aed..11aede083c 100644 --- a/Koha/AudioAlerts.pm +++ b/Koha/AudioAlerts.pm @@ -19,7 +19,6 @@ package Koha::AudioAlerts; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AuthUtils.pm b/Koha/AuthUtils.pm index 3bf28ef73a..49d2723c54 100644 --- a/Koha/AuthUtils.pm +++ b/Koha/AuthUtils.pm @@ -18,19 +18,22 @@ package Koha::AuthUtils; # along with Koha; if not, see . use Modern::Perl; -use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); -use Encode qw( encode is_utf8 ); -use Fcntl qw/O_RDONLY/; # O_RDONLY is used in generate_salt -use List::MoreUtils qw/ any /; +use Crypt::Eksblowfish::Bcrypt qw( bcrypt en_base64 ); +use Encode; +use Fcntl qw( O_RDONLY ); # O_RDONLY is used in generate_salt +use List::MoreUtils qw( any ); use String::Random qw( random_string ); use Koha::Exceptions::Password; use C4::Context; -use base 'Exporter'; - -our @EXPORT_OK = qw(hash_password get_script_name); +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/AuthorisedValue.pm b/Koha/AuthorisedValue.pm index 636ce95b3c..8f97bb1ede 100644 --- a/Koha/AuthorisedValue.pm +++ b/Koha/AuthorisedValue.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValue; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AuthorisedValueCategories.pm b/Koha/AuthorisedValueCategories.pm index 915e7d0fb0..21e4eee49f 100644 --- a/Koha/AuthorisedValueCategories.pm +++ b/Koha/AuthorisedValueCategories.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategories; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/AuthorisedValueCategory.pm b/Koha/AuthorisedValueCategory.pm index 73f578ac4c..e14129f80d 100644 --- a/Koha/AuthorisedValueCategory.pm +++ b/Koha/AuthorisedValueCategory.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategory; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/AuthorisedValues.pm b/Koha/AuthorisedValues.pm index b23190da72..b89ed9be4a 100644 --- a/Koha/AuthorisedValues.pm +++ b/Koha/AuthorisedValues.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValues; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authorities.pm b/Koha/Authorities.pm index 0145eb368e..a509b75fa2 100644 --- a/Koha/Authorities.pm +++ b/Koha/Authorities.pm @@ -19,7 +19,6 @@ package Koha::Authorities; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authority/MergeRequests.pm b/Koha/Authority/MergeRequests.pm index 315fe4ba67..481118e0f5 100644 --- a/Koha/Authority/MergeRequests.pm +++ b/Koha/Authority/MergeRequests.pm @@ -19,12 +19,11 @@ package Koha::Authority::MergeRequests; use Modern::Perl; use MARC::File::XML; -use MARC::Record; use C4::Context; use Koha::Authority::MergeRequest; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use parent qw(Koha::Objects); diff --git a/Koha/Authority/Type.pm b/Koha/Authority/Type.pm index 8d9caba1fd..7c6327e86b 100644 --- a/Koha/Authority/Type.pm +++ b/Koha/Authority/Type.pm @@ -17,7 +17,6 @@ package Koha::Authority::Type; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authority/Types.pm b/Koha/Authority/Types.pm index 85991d85c0..aa399b4dcc 100644 --- a/Koha/Authority/Types.pm +++ b/Koha/Authority/Types.pm @@ -17,7 +17,6 @@ package Koha::Authority::Types; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 09139bdbdd..c303fa175e 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -16,10 +16,10 @@ package Koha::BackgroundJob; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Carp qw( croak ); use Net::Stomp; -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm index 24f1e9a400..5969a1311d 100644 --- a/Koha/BackgroundJob/BatchUpdateAuthority.pm +++ b/Koha/BackgroundJob/BatchUpdateAuthority.pm @@ -16,9 +16,9 @@ package Koha::BackgroundJob::BatchUpdateAuthority; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); use C4::AuthoritiesMarc; use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm index 7cb7969474..9371e2212f 100644 --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm @@ -16,7 +16,7 @@ package Koha::BackgroundJob::BatchUpdateBiblio; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index be9561f583..26ee7abd96 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -19,13 +19,11 @@ package Koha::Biblio; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use URI; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); -use C4::Koha; -use C4::Biblio qw(); +use C4::Koha qw( GetNormalizedISBN ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/Biblio/Metadatas.pm b/Koha/Biblio/Metadatas.pm index 65a17bed32..d31b86501e 100644 --- a/Koha/Biblio/Metadatas.pm +++ b/Koha/Biblio/Metadatas.pm @@ -17,7 +17,6 @@ package Koha::Biblio::Metadatas; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioFramework.pm b/Koha/BiblioFramework.pm index ca69f37e84..30367570ba 100644 --- a/Koha/BiblioFramework.pm +++ b/Koha/BiblioFramework.pm @@ -17,7 +17,6 @@ package Koha::BiblioFramework; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioFrameworks.pm b/Koha/BiblioFrameworks.pm index 16db02b586..7202d2fec5 100644 --- a/Koha/BiblioFrameworks.pm +++ b/Koha/BiblioFrameworks.pm @@ -17,7 +17,6 @@ package Koha::BiblioFrameworks; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioUtils.pm b/Koha/BiblioUtils.pm index 9be2e6168a..1ece4a8317 100644 --- a/Koha/BiblioUtils.pm +++ b/Koha/BiblioUtils.pm @@ -32,12 +32,11 @@ the new thing that should be used. =cut -use C4::Biblio; # EmbedItemsInMarcBiblio +use C4::Biblio; use Koha::MetadataIterator; use Koha::Database; use Modern::Perl; -use Data::Dumper; # TODO remove use base qw(Koha::MetadataRecord); diff --git a/Koha/BiblioUtils/Iterator.pm b/Koha/BiblioUtils/Iterator.pm index f8a4e41019..c75a3733e5 100644 --- a/Koha/BiblioUtils/Iterator.pm +++ b/Koha/BiblioUtils/Iterator.pm @@ -43,9 +43,9 @@ Returns biblionumber and marc in list context. =cut -use C4::Biblio; # :( - for EmbedItemsInMarcBiblio +use C4::Biblio; -use Carp; +use Carp qw( confess ); use MARC::Record; use MARC::File::XML; use Modern::Perl; diff --git a/Koha/Biblioitem.pm b/Koha/Biblioitem.pm index 8f63a7cc98..eec0cdc637 100644 --- a/Koha/Biblioitem.pm +++ b/Koha/Biblioitem.pm @@ -17,7 +17,6 @@ package Koha::Biblioitem; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Biblioitems.pm b/Koha/Biblioitems.pm index d35a0d4fc4..b8d2ba8d56 100644 --- a/Koha/Biblioitems.pm +++ b/Koha/Biblioitems.pm @@ -17,7 +17,6 @@ package Koha::Biblioitems; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm index 9491fb3112..416aa2bbe5 100644 --- a/Koha/Biblios.pm +++ b/Koha/Biblios.pm @@ -19,7 +19,6 @@ package Koha::Biblios; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cache.pm b/Koha/Cache.pm index ec153baff9..2186d82743 100644 --- a/Koha/Cache.pm +++ b/Koha/Cache.pm @@ -40,8 +40,8 @@ The first, traditional OO interface provides the following functions: use strict; use warnings; -use Carp; -use Module::Load::Conditional qw(can_load); +use Carp qw( croak ); +use Module::Load::Conditional qw( can_load ); use Sereal::Encoder; use Sereal::Decoder; diff --git a/Koha/Cache/Object.pm b/Koha/Cache/Object.pm index f232541b37..4bdd9106b3 100644 --- a/Koha/Cache/Object.pm +++ b/Koha/Cache/Object.pm @@ -52,7 +52,6 @@ scalars and hashes, with arrays a potential future addition. use strict; use warnings; -use Carp; use base qw(Class::Accessor); diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index 05f9176716..5ffebb47ab 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -2,7 +2,7 @@ package Koha::Calendar; use Modern::Perl; -use Carp; +use Carp qw( croak ); use DateTime; use DateTime::Duration; use C4::Context; diff --git a/Koha/Cash/Register.pm b/Koha/Cash/Register.pm index 2daa52ed41..72288bdadb 100644 --- a/Koha/Cash/Register.pm +++ b/Koha/Cash/Register.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register; use Modern::Perl; -use Carp; use Koha::Account::Lines; use Koha::Account::Offsets; diff --git a/Koha/Cash/Register/Action.pm b/Koha/Cash/Register/Action.pm index ede413c21d..34118695c4 100644 --- a/Koha/Cash/Register/Action.pm +++ b/Koha/Cash/Register/Action.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Action; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Actions.pm b/Koha/Cash/Register/Actions.pm index bdff33ed73..d470b4d437 100644 --- a/Koha/Cash/Register/Actions.pm +++ b/Koha/Cash/Register/Actions.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Actions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Cashup.pm b/Koha/Cash/Register/Cashup.pm index d3047036a4..480bbf0e48 100644 --- a/Koha/Cash/Register/Cashup.pm +++ b/Koha/Cash/Register/Cashup.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Cashup; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Cashups.pm b/Koha/Cash/Register/Cashups.pm index 8e82a01717..58a562c0cb 100644 --- a/Koha/Cash/Register/Cashups.pm +++ b/Koha/Cash/Register/Cashups.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Cashups; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Cash::Register::Cashup; diff --git a/Koha/Cash/Registers.pm b/Koha/Cash/Registers.pm index e022279cb7..9576492caa 100644 --- a/Koha/Cash/Registers.pm +++ b/Koha/Cash/Registers.pm @@ -17,7 +17,6 @@ package Koha::Cash::Registers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Charges/Fees.pm b/Koha/Charges/Fees.pm index 7eff76ba79..a9bbf0fe60 100644 --- a/Koha/Charges/Fees.pm +++ b/Koha/Charges/Fees.pm @@ -19,7 +19,7 @@ package Koha::Charges::Fees; use Modern::Perl; -use Carp qw( carp confess ); +use Carp; use Koha::Calendar; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm index 3693beeb90..cc00194248 100644 --- a/Koha/Checkout.pm +++ b/Koha/Checkout.pm @@ -20,14 +20,13 @@ package Koha::Checkout; use Modern::Perl; -use Carp; use DateTime; -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation qw( LostItem MarkIssueReturned ); use Koha::Checkouts::ReturnClaims; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Libraries; diff --git a/Koha/Checkouts.pm b/Koha/Checkouts.pm index 0f2da95c65..76a3b9e686 100644 --- a/Koha/Checkouts.pm +++ b/Koha/Checkouts.pm @@ -19,13 +19,12 @@ package Koha::Checkouts; use Modern::Perl; -use Carp; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddReturn ); use Koha::Checkout; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Objects); diff --git a/Koha/Checkouts/ReturnClaims.pm b/Koha/Checkouts/ReturnClaims.pm index fa601bdd66..c1c2b3bd44 100644 --- a/Koha/Checkouts/ReturnClaims.pm +++ b/Koha/Checkouts/ReturnClaims.pm @@ -19,7 +19,6 @@ package Koha::Checkouts::ReturnClaims; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm index df1314613e..d1c5648ff3 100644 --- a/Koha/CirculationRules.pm +++ b/Koha/CirculationRules.pm @@ -18,7 +18,7 @@ package Koha::CirculationRules; # along with Koha; if not, see . use Modern::Perl; -use Carp qw(croak); +use Carp qw( croak ); use Koha::Exceptions; use Koha::CirculationRule; diff --git a/Koha/Cities.pm b/Koha/Cities.pm index c66c4929ac..eabe4909f3 100644 --- a/Koha/Cities.pm +++ b/Koha/Cities.pm @@ -17,7 +17,6 @@ package Koha::Cities; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/City.pm b/Koha/City.pm index d6466315b5..e95f081644 100644 --- a/Koha/City.pm +++ b/Koha/City.pm @@ -17,7 +17,6 @@ package Koha::City; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSortRule.pm b/Koha/ClassSortRule.pm index f1e7788cc5..73f181e573 100644 --- a/Koha/ClassSortRule.pm +++ b/Koha/ClassSortRule.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRule; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSortRules.pm b/Koha/ClassSortRules.pm index 07dc543df5..1a59b0b6a8 100644 --- a/Koha/ClassSortRules.pm +++ b/Koha/ClassSortRules.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRules; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSource.pm b/Koha/ClassSource.pm index 734757768b..3b192ee124 100644 --- a/Koha/ClassSource.pm +++ b/Koha/ClassSource.pm @@ -17,7 +17,6 @@ package Koha::ClassSource; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSources.pm b/Koha/ClassSources.pm index 3b6f891d9b..7a56ab8b3c 100644 --- a/Koha/ClassSources.pm +++ b/Koha/ClassSources.pm @@ -17,7 +17,6 @@ package Koha::ClassSources; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSplitRule.pm b/Koha/ClassSplitRule.pm index a8b6401e3c..28937fc59d 100644 --- a/Koha/ClassSplitRule.pm +++ b/Koha/ClassSplitRule.pm @@ -17,7 +17,7 @@ package Koha::ClassSplitRule; use Modern::Perl; -use JSON qw(to_json from_json); +use JSON qw( from_json to_json ); use Koha::Database; diff --git a/Koha/Club.pm b/Koha/Club.pm index 7e488399eb..d4e00dae5b 100644 --- a/Koha/Club.pm +++ b/Koha/Club.pm @@ -19,7 +19,6 @@ package Koha::Club; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollment.pm b/Koha/Club/Enrollment.pm index 143a1e95ec..e9e434bc17 100644 --- a/Koha/Club/Enrollment.pm +++ b/Koha/Club/Enrollment.pm @@ -19,12 +19,11 @@ package Koha::Club::Enrollment; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Clubs; use Koha::Patrons; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use DateTime; use base qw(Koha::Object); diff --git a/Koha/Club/Enrollment/Field.pm b/Koha/Club/Enrollment/Field.pm index 0a616bbfc4..54ffaff031 100644 --- a/Koha/Club/Enrollment/Field.pm +++ b/Koha/Club/Enrollment/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollment/Fields.pm b/Koha/Club/Enrollment/Fields.pm index 29f6fa2238..590c265161 100644 --- a/Koha/Club/Enrollment/Fields.pm +++ b/Koha/Club/Enrollment/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollments.pm b/Koha/Club/Enrollments.pm index 3e63f559bd..8e7327b323 100644 --- a/Koha/Club/Enrollments.pm +++ b/Koha/Club/Enrollments.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollments; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Field.pm b/Koha/Club/Field.pm index 764cf2a353..956ee7ae45 100644 --- a/Koha/Club/Field.pm +++ b/Koha/Club/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Fields.pm b/Koha/Club/Fields.pm index 8e72ee8f61..7a2837b1a0 100644 --- a/Koha/Club/Fields.pm +++ b/Koha/Club/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Hold.pm b/Koha/Club/Hold.pm index 46f9f31933..fbf35f4314 100644 --- a/Koha/Club/Hold.pm +++ b/Koha/Club/Hold.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold; use Modern::Perl; -use Carp; use Koha::Database; @@ -32,7 +31,7 @@ use Koha::Club::Hold::PatronHold; use Koha::Clubs; use Koha::Patrons; -use List::Util 'shuffle'; +use List::Util qw( shuffle ); =head1 NAME diff --git a/Koha/Club/Hold/PatronHold.pm b/Koha/Club/Hold/PatronHold.pm index 4368a39c95..b24b33fc2e 100644 --- a/Koha/Club/Hold/PatronHold.pm +++ b/Koha/Club/Hold/PatronHold.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHold; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Hold/PatronHolds.pm b/Koha/Club/Hold/PatronHolds.pm index f7d4ad70ca..76fffcbdcc 100644 --- a/Koha/Club/Hold/PatronHolds.pm +++ b/Koha/Club/Hold/PatronHolds.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHolds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Holds.pm b/Koha/Club/Holds.pm index 6ec9f413d1..8a8a20334c 100644 --- a/Koha/Club/Holds.pm +++ b/Koha/Club/Holds.pm @@ -19,7 +19,6 @@ package Koha::Club::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template.pm b/Koha/Club/Template.pm index bdf8019cff..57d87f9536 100644 --- a/Koha/Club/Template.pm +++ b/Koha/Club/Template.pm @@ -19,7 +19,6 @@ package Koha::Club::Template; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/EnrollmentField.pm b/Koha/Club/Template/EnrollmentField.pm index bca9123809..ba1fdb0b1d 100644 --- a/Koha/Club/Template/EnrollmentField.pm +++ b/Koha/Club/Template/EnrollmentField.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentField; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/EnrollmentFields.pm b/Koha/Club/Template/EnrollmentFields.pm index 27996bf529..4b383f5a97 100644 --- a/Koha/Club/Template/EnrollmentFields.pm +++ b/Koha/Club/Template/EnrollmentFields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentFields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/Field.pm b/Koha/Club/Template/Field.pm index 9255fda188..ab5cb809b1 100644 --- a/Koha/Club/Template/Field.pm +++ b/Koha/Club/Template/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/Fields.pm b/Koha/Club/Template/Fields.pm index 1fee0a1745..bf9fd9bd54 100644 --- a/Koha/Club/Template/Fields.pm +++ b/Koha/Club/Template/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Templates.pm b/Koha/Club/Templates.pm index 00940a760c..b365ade79b 100644 --- a/Koha/Club/Templates.pm +++ b/Koha/Club/Templates.pm @@ -19,7 +19,6 @@ package Koha::Club::Templates; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Clubs.pm b/Koha/Clubs.pm index 28fa41e81a..d206b9023a 100644 --- a/Koha/Clubs.pm +++ b/Koha/Clubs.pm @@ -19,7 +19,6 @@ package Koha::Clubs; use Modern::Perl; -use Carp; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/Koha/Config.pm b/Koha/Config.pm index face2fc11f..512d4fab14 100644 --- a/Koha/Config.pm +++ b/Koha/Config.pm @@ -17,7 +17,7 @@ package Koha::Config; use Modern::Perl; -use XML::LibXML ':libxml'; +use XML::LibXML qw( XML_ELEMENT_NODE XML_TEXT_NODE ); # Default config file, if none is specified use constant CONFIG_FNAME => "/etc/koha/koha-conf.xml"; diff --git a/Koha/Config/SysPref.pm b/Koha/Config/SysPref.pm index 1775160cb5..dd743f8ef2 100644 --- a/Koha/Config/SysPref.pm +++ b/Koha/Config/SysPref.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPref; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Config/SysPrefs.pm b/Koha/Config/SysPrefs.pm index 6a5ad952f5..8b08d71a32 100644 --- a/Koha/Config/SysPrefs.pm +++ b/Koha/Config/SysPrefs.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPrefs; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Course.pm b/Koha/Course.pm index 0ce658b0b4..9ede81bd3c 100644 --- a/Koha/Course.pm +++ b/Koha/Course.pm @@ -17,7 +17,6 @@ package Koha::Course; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Instructor.pm b/Koha/Course/Instructor.pm index 62385d0b75..e6c4db9739 100644 --- a/Koha/Course/Instructor.pm +++ b/Koha/Course/Instructor.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructor; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Instructors.pm b/Koha/Course/Instructors.pm index 68211eb793..f69dd48ca0 100644 --- a/Koha/Course/Instructors.pm +++ b/Koha/Course/Instructors.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructors; use Modern::Perl; -use Carp; use Koha::Course::Instructor; diff --git a/Koha/Course/Item.pm b/Koha/Course/Item.pm index 948a90c84b..d55382c7a2 100644 --- a/Koha/Course/Item.pm +++ b/Koha/Course/Item.pm @@ -17,7 +17,6 @@ package Koha::Course::Item; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Items.pm b/Koha/Course/Items.pm index 7fc713dee1..9076540c7a 100644 --- a/Koha/Course/Items.pm +++ b/Koha/Course/Items.pm @@ -17,7 +17,6 @@ package Koha::Course::Items; use Modern::Perl; -use Carp; use Koha::Course::Item; diff --git a/Koha/Course/Reserve.pm b/Koha/Course/Reserve.pm index ff2e0711c5..963a2ee272 100644 --- a/Koha/Course/Reserve.pm +++ b/Koha/Course/Reserve.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserve; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Reserves.pm b/Koha/Course/Reserves.pm index 631ba49a93..e96cee6316 100644 --- a/Koha/Course/Reserves.pm +++ b/Koha/Course/Reserves.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserves; use Modern::Perl; -use Carp; use Koha::Course::Reserve; diff --git a/Koha/Courses.pm b/Koha/Courses.pm index f0fb3ec29d..df2a74163e 100644 --- a/Koha/Courses.pm +++ b/Koha/Courses.pm @@ -17,7 +17,6 @@ package Koha::Courses; use Modern::Perl; -use Carp; use Koha::Course; diff --git a/Koha/CoverImage.pm b/Koha/CoverImage.pm index 7edb35b582..e5467bedeb 100644 --- a/Koha/CoverImage.pm +++ b/Koha/CoverImage.pm @@ -17,7 +17,6 @@ package Koha::CoverImage; use Modern::Perl; -use Carp; use GD; use Koha::Database; diff --git a/Koha/CoverImages.pm b/Koha/CoverImages.pm index 4dff96d9e5..bf807b0813 100644 --- a/Koha/CoverImages.pm +++ b/Koha/CoverImages.pm @@ -17,7 +17,6 @@ package Koha::CoverImages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CsvProfile.pm b/Koha/CsvProfile.pm index 68fd8cfec2..c0d4d6a57c 100644 --- a/Koha/CsvProfile.pm +++ b/Koha/CsvProfile.pm @@ -17,7 +17,6 @@ package Koha::CsvProfile; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CsvProfiles.pm b/Koha/CsvProfiles.pm index 05dc6a3f7d..1ea493a447 100644 --- a/Koha/CsvProfiles.pm +++ b/Koha/CsvProfiles.pm @@ -17,7 +17,6 @@ package Koha::CsvProfiles; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Database.pm b/Koha/Database.pm index df4d45ce7b..fec7424eb3 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -33,7 +33,6 @@ Koha::Database =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); diff --git a/Koha/Desk.pm b/Koha/Desk.pm index cd4379d958..b92ec93e40 100644 --- a/Koha/Desk.pm +++ b/Koha/Desk.pm @@ -18,7 +18,6 @@ package Koha::Desk; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Desks.pm b/Koha/Desks.pm index a8b452cc7e..20fb541c66 100644 --- a/Koha/Desks.pm +++ b/Koha/Desks.pm @@ -19,7 +19,6 @@ package Koha::Desks; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 5857f4eff7..7a09ee367b 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -21,28 +21,44 @@ use strict; use warnings; use base qw(Exporter); use utf8; -use Carp; +use Carp qw( carp ); use English qw{ -no_match_vars }; use Business::ISBN; use DateTime; use C4::Context; use Koha::Database; -use Koha::DateUtils; -use C4::Acquisition qw( NewBasket ModOrder); +use Koha::DateUtils qw( dt_from_string ); +use C4::Acquisition qw( ModOrder NewBasket ); use C4::Suggestions qw( ModSuggestion ); -use C4::Biblio qw( AddBiblio TransformKohaToMarc GetMarcBiblio GetFrameworkCode GetMarcFromKohaField ); +use C4::Biblio qw( + AddBiblio + GetFrameworkCode + GetMarcFromKohaField + TransformKohaToMarc +); use Koha::Edifact::Order; use Koha::Edifact; -use C4::Log qw(logaction); +use C4::Log qw( logaction ); use Log::Log4perl; -use Text::Unidecode; +use Text::Unidecode qw( unidecode ); use Koha::Plugins::Handler; use Koha::Acquisition::Baskets; use Koha::Acquisition::Booksellers; our $VERSION = 1.1; -our @EXPORT_OK = - qw( process_quote process_invoice process_ordrsp create_edi_order get_edifact_ean ); + +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; diff --git a/Koha/Edifact.pm b/Koha/Edifact.pm index 38756270b2..b3b3bf473e 100644 --- a/Koha/Edifact.pm +++ b/Koha/Edifact.pm @@ -19,9 +19,8 @@ package Koha::Edifact; use strict; use warnings; -use File::Slurp; -use Carp; -use Encode qw( from_to ); +use File::Slurp qw( read_file ); +use Carp qw( carp croak ); use Koha::Edifact::Segment; use Koha::Edifact::Message; diff --git a/Koha/Edifact/Line.pm b/Koha/Edifact/Line.pm index 8d14ba5e5f..172e4fbe18 100644 --- a/Koha/Edifact/Line.pm +++ b/Koha/Edifact/Line.pm @@ -23,7 +23,7 @@ use utf8; use MARC::Record; use MARC::Field; -use Carp; +use Carp qw( carp ); sub new { my ( $class, $data_array_ref ) = @_; diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm index f1648c6ab4..772eb03861 100644 --- a/Koha/Edifact/Order.pm +++ b/Koha/Edifact/Order.pm @@ -21,12 +21,11 @@ use utf8; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use Carp; +use Carp qw( carp ); use DateTime; -use Readonly; -use Business::ISBN; +use Readonly qw( Readonly ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use C4::Budgets qw( GetBudget ); use Koha::Acquisition::Orders; diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm index e52b6ef468..833c44e896 100644 --- a/Koha/Edifact/Transport.pm +++ b/Koha/Edifact/Transport.pm @@ -21,15 +21,14 @@ use strict; use warnings; use utf8; use DateTime; -use Carp; +use Carp qw( carp ); use English qw{ -no_match_vars }; use Net::FTP; use Net::SFTP::Foreign; -use File::Slurp; -use File::Copy; -use File::Basename qw( fileparse ); +use File::Slurp qw( read_file ); +use File::Copy qw( copy move ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Encode qw( from_to ); sub new { diff --git a/Koha/Email.pm b/Koha/Email.pm index 9c077a6b84..5083af8bbd 100644 --- a/Koha/Email.pm +++ b/Koha/Email.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Email::Valid; use Email::MessageID; -use List::Util qw(pairs); +use List::Util qw( pairs ); use Koha::Exceptions; diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm index eaebe57639..05cfe3e2a7 100644 --- a/Koha/Exporter/Record.pm +++ b/Koha/Exporter/Record.pm @@ -5,11 +5,11 @@ use MARC::File::XML; use MARC::File::USMARC; use C4::AuthoritiesMarc; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); use C4::Record; use Koha::CsvProfiles; use Koha::Logger; -use List::Util qw(all any); +use List::Util qw( all any ); sub _get_record_for_export { my ($params) = @_; diff --git a/Koha/ExternalContent.pm b/Koha/ExternalContent.pm index 578e035cf5..be5174d32e 100644 --- a/Koha/ExternalContent.pm +++ b/Koha/ExternalContent.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Class::Accessor); use Koha; diff --git a/Koha/ExternalContent/OverDrive.pm b/Koha/ExternalContent/OverDrive.pm index ad36c18ce8..6247dfee6e 100644 --- a/Koha/ExternalContent/OverDrive.pm +++ b/Koha/ExternalContent/OverDrive.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent::OverDrive; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Koha::ExternalContent); use WebService::ILS::OverDrive::Patron; diff --git a/Koha/ExternalContent/RecordedBooks.pm b/Koha/ExternalContent/RecordedBooks.pm index 2e8c33bffd..10e5b6bd65 100644 --- a/Koha/ExternalContent/RecordedBooks.pm +++ b/Koha/ExternalContent/RecordedBooks.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent::RecordedBooks; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Koha::ExternalContent); use WebService::ILS::RecordedBooks::PartnerPatron; diff --git a/Koha/Filter/MARC/EmbedItemsAvailability.pm b/Koha/Filter/MARC/EmbedItemsAvailability.pm index ac4eaee1d4..2e8a6c0e84 100644 --- a/Koha/Filter/MARC/EmbedItemsAvailability.pm +++ b/Koha/Filter/MARC/EmbedItemsAvailability.pm @@ -32,7 +32,7 @@ Filter to embed items not on loan count information into MARC records. use Modern::Perl; -use C4::Biblio qw/GetMarcFromKohaField/; +use C4::Biblio qw( GetMarcFromKohaField ); use Koha::Items; use base qw(Koha::RecordProcessor::Base); diff --git a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm b/Koha/Filter/MARC/EmbedSeeFromHeadings.pm index 9ed7b45bea..b00a9a2d6e 100644 --- a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm +++ b/Koha/Filter/MARC/EmbedSeeFromHeadings.pm @@ -32,9 +32,8 @@ Filter to embed see from headings into MARC records. use strict; use warnings; -use Carp; use Koha::MetadataRecord::Authority; -use C4::Biblio qw/GetMarcFromKohaField/; +use C4::Biblio qw( GetMarcFromKohaField ); use base qw(Koha::RecordProcessor::Base); our $NAME = 'EmbedSeeFromHeadings'; diff --git a/Koha/Filter/MARC/Null.pm b/Koha/Filter/MARC/Null.pm index dc5a016934..d504fe41da 100644 --- a/Koha/Filter/MARC/Null.pm +++ b/Koha/Filter/MARC/Null.pm @@ -33,7 +33,6 @@ RecordProcessor. use strict; use warnings; -use Carp; use base qw(Koha::RecordProcessor::Base); our $NAME = 'Null'; diff --git a/Koha/Filter/MARC/ViewPolicy.pm b/Koha/Filter/MARC/ViewPolicy.pm index 1b7ef7468c..0523b1bc51 100644 --- a/Koha/Filter/MARC/ViewPolicy.pm +++ b/Koha/Filter/MARC/ViewPolicy.pm @@ -39,8 +39,7 @@ menu. =cut use Modern::Perl; -use Carp; -use C4::Biblio; +use C4::Biblio qw( GetMarcStructure ); use base qw(Koha::RecordProcessor::Base); our $NAME = 'MARC_ViewPolicy'; @@ -86,7 +85,7 @@ sub filter { my $result = $current_record; my $hide = _should_hide_on_interface(); - my $marcsubfieldstructure = GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); + my $marcsubfieldstructure = C4::Biblio::GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); #if ($marcsubfieldstructure->{'000'}->{'@'}->{hidden}>0) { # LDR field is excluded from $current_record->fields(). diff --git a/Koha/Hold.pm b/Koha/Hold.pm index bd5458f494..0aa9eab133 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -20,16 +20,15 @@ package Koha::Hold; use Modern::Perl; -use Carp; -use Data::Dumper qw(Dumper); -use List::MoreUtils qw(any); +use Data::Dumper qw( Dumper ); +use List::MoreUtils qw( any ); use C4::Context qw(preference); -use C4::Letters; -use C4::Log; +use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use C4::Log qw( logaction ); use Koha::AuthorisedValues; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Biblios; use Koha::Items; diff --git a/Koha/Holds.pm b/Koha/Holds.pm index 296f99cb0a..fdc492b0ce 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -19,7 +19,6 @@ package Koha::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/I18N.pm b/Koha/I18N.pm index ca0ceae0c9..64fab1db25 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -19,14 +19,21 @@ package Koha::I18N; use Modern::Perl; -use CGI; use C4::Languages; use C4::Context; use Encode; use List::Util qw( first ); -use Locale::Messages qw(:locale_h LC_MESSAGES); -use POSIX qw( setlocale ); +use Locale::Messages qw( + bindtextdomain + gettext + LC_MESSAGES + ngettext + npgettext + pgettext + textdomain +); +use POSIX; use Koha::Cache::Memory::Lite; use parent 'Exporter'; diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 01d421f63d..2eaa5accda 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -19,16 +19,13 @@ package Koha::Illrequest; use Modern::Perl; -use Clone 'clone'; -use File::Basename qw( basename ); -use Encode qw( encode ); -use Try::Tiny; +use Clone qw( clone ); +use Try::Tiny qw( catch try ); use DateTime; use C4::Letters; -use C4::Members; use Koha::Database; -use Koha::DateUtils qw/ dt_from_string /; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Ill; use Koha::Illcomments; use Koha::Illrequestattributes; @@ -41,7 +38,7 @@ use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; -use C4::Circulation qw( CanBookBeIssued AddIssue ); +use C4::Circulation qw( CanBookBeIssued AddIssue ); use base qw(Koha::Object); diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm index 9eaf623305..82b77685ac 100644 --- a/Koha/Illrequest/Config.pm +++ b/Koha/Illrequest/Config.pm @@ -19,7 +19,7 @@ package Koha::Illrequest::Config; use Modern::Perl; -use File::Basename qw/basename/; +use File::Basename qw( basename ); use C4::Context; diff --git a/Koha/Illrequest/Logger.pm b/Koha/Illrequest/Logger.pm index 971b3a8b76..2e7b1f09d7 100644 --- a/Koha/Illrequest/Logger.pm +++ b/Koha/Illrequest/Logger.pm @@ -18,10 +18,9 @@ package Koha::Illrequest::Logger; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( to_json from_json ); -use Time::Local; +use JSON qw( from_json to_json ); -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use C4::Context; use C4::Templates; use C4::Log qw( logaction ); diff --git a/Koha/Item.pm b/Koha/Item.pm index 47a86eb0bb..c653dc2583 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -19,18 +19,16 @@ package Koha::Item; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); -use Data::Dumper; -use Try::Tiny; +use List::MoreUtils qw( any ); +use Data::Dumper qw( Dumper ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( GetBranchItemRule ); use C4::Reserves; -use C4::ClassSource; # FIXME We would like to avoid that +use C4::ClassSource qw( GetClassSort ); use C4::Log qw( logaction ); use Koha::Checkouts; diff --git a/Koha/Item/Search/Field.pm b/Koha/Item/Search/Field.pm index 77e5309b30..6c343b66f0 100644 --- a/Koha/Item/Search/Field.pm +++ b/Koha/Item/Search/Field.pm @@ -1,15 +1,19 @@ package Koha::Item::Search::Field; use Modern::Perl; -use base qw( Exporter ); - -our @EXPORT_OK = qw( - AddItemSearchField - ModItemSearchField - DelItemSearchField - GetItemSearchField - GetItemSearchFields -); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + AddItemSearchField + ModItemSearchField + DelItemSearchField + GetItemSearchField + GetItemSearchFields + ); +}; use C4::Context; diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm index 06588e01b1..286e0fd276 100644 --- a/Koha/Item/Transfer.pm +++ b/Koha/Item/Transfer.pm @@ -17,12 +17,11 @@ package Koha::Item::Transfer; use Modern::Perl; -use Carp; -use C4::Items; +use C4::Items qw( CartToShelf ModDateLastSeen ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Item::Transfer; use base qw(Koha::Object); diff --git a/Koha/Item/Transfer/Limit.pm b/Koha/Item/Transfer/Limit.pm index db9db5037c..195e54e171 100644 --- a/Koha/Item/Transfer/Limit.pm +++ b/Koha/Item/Transfer/Limit.pm @@ -18,7 +18,6 @@ package Koha::Item::Transfer::Limit; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Item/Transfers.pm b/Koha/Item/Transfers.pm index 738cc2aea8..be5c0e098c 100644 --- a/Koha/Item/Transfers.pm +++ b/Koha/Item/Transfers.pm @@ -17,7 +17,6 @@ package Koha::Item::Transfers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm index 939c97704e..258ce91c1c 100644 --- a/Koha/ItemType.pm +++ b/Koha/ItemType.pm @@ -17,9 +17,8 @@ package Koha::ItemType; use Modern::Perl; -use Carp; -use C4::Koha; +use C4::Koha qw( getitemtypeimagelocation ); use C4::Languages; use Koha::Database; use Koha::CirculationRules; diff --git a/Koha/ItemTypes.pm b/Koha/ItemTypes.pm index 746bbb23ea..13caa648a8 100644 --- a/Koha/ItemTypes.pm +++ b/Koha/ItemTypes.pm @@ -17,7 +17,6 @@ package Koha::ItemTypes; use Modern::Perl; -use Carp; use C4::Languages; diff --git a/Koha/Items.pm b/Koha/Items.pm index 1647983553..2643223d3b 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -19,7 +19,6 @@ package Koha::Items; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/KeyboardShortcut.pm b/Koha/KeyboardShortcut.pm index 332d047dc1..da13ce147b 100644 --- a/Koha/KeyboardShortcut.pm +++ b/Koha/KeyboardShortcut.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcut; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/KeyboardShortcuts.pm b/Koha/KeyboardShortcuts.pm index de5c4a1d67..d75f4ce880 100644 --- a/Koha/KeyboardShortcuts.pm +++ b/Koha/KeyboardShortcuts.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcuts; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Libraries.pm b/Koha/Libraries.pm index 8a45cc26ad..20ceb8aa34 100644 --- a/Koha/Libraries.pm +++ b/Koha/Libraries.pm @@ -19,7 +19,6 @@ package Koha::Libraries; use Modern::Perl; -use Carp; use C4::Context; diff --git a/Koha/Library.pm b/Koha/Library.pm index af2319a3f6..7ee84baca4 100644 --- a/Koha/Library.pm +++ b/Koha/Library.pm @@ -19,7 +19,6 @@ package Koha::Library; use Modern::Perl; -use Carp; use C4::Context; diff --git a/Koha/Library/Group.pm b/Koha/Library/Group.pm index 4a4ea03274..aaf68530d5 100644 --- a/Koha/Library/Group.pm +++ b/Koha/Library/Group.pm @@ -19,10 +19,9 @@ package Koha::Library::Group; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use base qw(Koha::Object); diff --git a/Koha/Library/Groups.pm b/Koha/Library/Groups.pm index dc17c21c51..f72e544262 100644 --- a/Koha/Library/Groups.pm +++ b/Koha/Library/Groups.pm @@ -19,7 +19,6 @@ package Koha::Library::Groups; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Library/OverDriveInfo.pm b/Koha/Library/OverDriveInfo.pm index e234b71bfa..0554c0b0d8 100644 --- a/Koha/Library/OverDriveInfo.pm +++ b/Koha/Library/OverDriveInfo.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfo; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Library/OverDriveInfos.pm b/Koha/Library/OverDriveInfos.pm index d8a028eb6b..3a3509d6a0 100644 --- a/Koha/Library/OverDriveInfos.pm +++ b/Koha/Library/OverDriveInfos.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfos; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Linktracker.pm b/Koha/Linktracker.pm index 4adea13d51..d4519e396d 100644 --- a/Koha/Linktracker.pm +++ b/Koha/Linktracker.pm @@ -32,7 +32,6 @@ Koha::Linktracker =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); diff --git a/Koha/List/Patron.pm b/Koha/List/Patron.pm index c6f43848a3..28b1cd93ba 100644 --- a/Koha/List/Patron.pm +++ b/Koha/List/Patron.pm @@ -27,7 +27,7 @@ Koha::List::Patron - Management of lists of patrons use Modern::Perl; -use Carp; +use Carp qw( carp croak ); use Koha::Database; diff --git a/Koha/Logger.pm b/Koha/Logger.pm index 2751bf189b..c91a3bb3b4 100644 --- a/Koha/Logger.pm +++ b/Koha/Logger.pm @@ -37,7 +37,6 @@ Koha::Logger use Modern::Perl; use Log::Log4perl; -use Carp; use C4::Context; diff --git a/Koha/MarcSubfieldStructure.pm b/Koha/MarcSubfieldStructure.pm index fb80dd086f..e88d0da2cf 100644 --- a/Koha/MarcSubfieldStructure.pm +++ b/Koha/MarcSubfieldStructure.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructure; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/MarcSubfieldStructures.pm b/Koha/MarcSubfieldStructures.pm index e1e6bc8814..03d3eba17c 100644 --- a/Koha/MarcSubfieldStructures.pm +++ b/Koha/MarcSubfieldStructures.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructures; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/MessageAttribute.pm b/Koha/MessageAttribute.pm index acc7ccc969..c728b3415f 100644 --- a/Koha/MessageAttribute.pm +++ b/Koha/MessageAttribute.pm @@ -19,7 +19,6 @@ package Koha::MessageAttribute; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/MessageAttributes.pm b/Koha/MessageAttributes.pm index 2c314d7301..5bc7057508 100644 --- a/Koha/MessageAttributes.pm +++ b/Koha/MessageAttributes.pm @@ -19,7 +19,6 @@ package Koha::MessageAttributes; use Modern::Perl; -use Carp; use base qw(Koha::Objects); use Koha::MessageAttribute; diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm index 47dffe801e..5a385e82e4 100644 --- a/Koha/MetaSearcher.pm +++ b/Koha/MetaSearcher.pm @@ -22,14 +22,14 @@ use Modern::Perl; use base 'Class::Accessor'; use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); -use C4::Search qw(); # Purely for new_record_from_zebra +use C4::Search qw( new_record_from_zebra ); use DBIx::Class::ResultClass::HashRefInflator; use IO::Select; use Koha::Caches; use Koha::Database; use Koha::MetadataRecord; use MARC::File::XML; -use Storable qw( store_fd fd_retrieve ); +use Storable qw( fd_retrieve store_fd ); use Time::HiRes qw( clock_gettime CLOCK_MONOTONIC ); use UUID; use ZOOM; diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm index ce792f7ead..3426ea5d2e 100644 --- a/Koha/MetadataRecord.pm +++ b/Koha/MetadataRecord.pm @@ -34,7 +34,7 @@ and authority) records in Koha. use Modern::Perl; -use Carp; +use Carp qw( carp ); use C4::Biblio; use Koha::Util::MARC; diff --git a/Koha/MetadataRecord/Authority.pm b/Koha/MetadataRecord/Authority.pm index 31e5b53039..d16970a828 100644 --- a/Koha/MetadataRecord/Authority.pm +++ b/Koha/MetadataRecord/Authority.pm @@ -33,11 +33,10 @@ Authority data. use strict; use warnings; -use Carp; use C4::Context; use MARC::Record; use MARC::File::XML; -use C4::Charset; +use C4::Charset qw( StripNonXmlChars ); use Koha::Util::MARC; use base qw(Koha::MetadataRecord); diff --git a/Koha/News.pm b/Koha/News.pm index 82f9918de2..5bb78a6a30 100644 --- a/Koha/News.pm +++ b/Koha/News.pm @@ -19,7 +19,6 @@ package Koha::News; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/NewsItem.pm b/Koha/NewsItem.pm index cd33b5109a..152e777023 100644 --- a/Koha/NewsItem.pm +++ b/Koha/NewsItem.pm @@ -19,10 +19,9 @@ package Koha::NewsItem; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use Koha::Patrons; diff --git a/Koha/Notice/Message.pm b/Koha/Notice/Message.pm index 3cdb09d12a..fcf7eca2a6 100644 --- a/Koha/Notice/Message.pm +++ b/Koha/Notice/Message.pm @@ -17,7 +17,6 @@ package Koha::Notice::Message; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Messages.pm b/Koha/Notice/Messages.pm index 3ef9d94731..3fedd5d142 100644 --- a/Koha/Notice/Messages.pm +++ b/Koha/Notice/Messages.pm @@ -17,7 +17,6 @@ package Koha::Notice::Messages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Template.pm b/Koha/Notice/Template.pm index 95003a7a1c..7669481690 100644 --- a/Koha/Notice/Template.pm +++ b/Koha/Notice/Template.pm @@ -17,7 +17,6 @@ package Koha::Notice::Template; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Templates.pm b/Koha/Notice/Templates.pm index 8105f97568..27922e6aa0 100644 --- a/Koha/Notice/Templates.pm +++ b/Koha/Notice/Templates.pm @@ -17,7 +17,6 @@ package Koha::Notice::Templates; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/OAI/Server/Description.pm b/Koha/OAI/Server/Description.pm index a0e92213ce..83469b8daa 100644 --- a/Koha/OAI/Server/Description.pm +++ b/Koha/OAI/Server/Description.pm @@ -20,7 +20,7 @@ package Koha::OAI::Server::Description; use Modern::Perl; use HTTP::OAI; -use HTTP::OAI::SAXHandler qw/ :SAX /; +use HTTP::OAI::SAXHandler qw( g_data_element ); sub new { diff --git a/Koha/OAI/Server/GetRecord.pm b/Koha/OAI/Server/GetRecord.pm index db94c517c5..4e4985ea8e 100644 --- a/Koha/OAI/Server/GetRecord.pm +++ b/Koha/OAI/Server/GetRecord.pm @@ -20,8 +20,7 @@ package Koha::OAI::Server::GetRecord; use Modern::Perl; use HTTP::OAI; -use C4::Biblio; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISetsBiblio ); use MARC::File::XML; use base ("HTTP::OAI::GetRecord"); diff --git a/Koha/OAI/Server/ListBase.pm b/Koha/OAI/Server/ListBase.pm index 03d13f7a0a..877f7c137d 100644 --- a/Koha/OAI/Server/ListBase.pm +++ b/Koha/OAI/Server/ListBase.pm @@ -28,12 +28,11 @@ Koha::OAI::Server::ListBase contains OAI-PMH functions shared by ListIdentifiers =cut use Modern::Perl; -use C4::Biblio; use HTTP::OAI; use Koha::OAI::Server::ResumptionToken; use Koha::OAI::Server::Record; use Koha::OAI::Server::DeletedRecord; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISetBySpec GetOAISetsBiblio ); use MARC::File::XML; sub GetRecords { diff --git a/Koha/OAI/Server/ListSets.pm b/Koha/OAI/Server/ListSets.pm index 68264787f1..8a4be18ae4 100644 --- a/Koha/OAI/Server/ListSets.pm +++ b/Koha/OAI/Server/ListSets.pm @@ -22,7 +22,7 @@ use Modern::Perl; use HTTP::OAI; use Koha::OAI::Server::ResumptionToken; use Koha::OAI::Server::Description; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISets ); use base ("HTTP::OAI::ListSets"); diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm index ad18c2dc13..0c4c30bb09 100644 --- a/Koha/OAI/Server/Repository.pm +++ b/Koha/OAI/Server/Repository.pm @@ -21,7 +21,7 @@ package Koha::OAI::Server::Repository; use Modern::Perl; use HTTP::OAI; -use HTTP::OAI::Repository qw/:validate/; +use HTTP::OAI::Repository qw( validate_request ); use base ("HTTP::OAI::Repository"); @@ -35,7 +35,7 @@ use XML::SAX::Writer; use YAML::XS; use CGI qw/:standard -oldstyle_urls/; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use Koha::XSLT::Base; =head1 NAME diff --git a/Koha/Object.pm b/Koha/Object.pm index 806d42d1aa..08602da67f 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -20,14 +20,14 @@ package Koha::Object; use Modern::Perl; -use Carp; +use Carp qw( croak ); use Mojo::JSON; use Scalar::Util qw( blessed looks_like_number ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Database; use Koha::Exceptions::Object; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Object::Message; =head1 NAME diff --git a/Koha/Object/Limit/Library.pm b/Koha/Object/Limit/Library.pm index 1b7606f608..557baf9038 100644 --- a/Koha/Object/Limit/Library.pm +++ b/Koha/Object/Limit/Library.pm @@ -21,7 +21,7 @@ use Koha::Database; use Koha::Exceptions; use Koha::Libraries; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/Objects.pm b/Koha/Objects.pm index fab6f9046d..3ee0a55742 100644 --- a/Koha/Objects.pm +++ b/Koha/Objects.pm @@ -19,7 +19,7 @@ package Koha::Objects; use Modern::Perl; -use Carp; +use Carp qw( carp ); use List::MoreUtils qw( none ); use Class::Inspector; diff --git a/Koha/Old/Holds.pm b/Koha/Old/Holds.pm index e12e1446b2..415c4c9b7e 100644 --- a/Koha/Old/Holds.pm +++ b/Koha/Old/Holds.pm @@ -19,7 +19,6 @@ package Koha::Old::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron.pm b/Koha/Patron.pm index e202fecdb7..941dace0df 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -20,21 +20,20 @@ package Koha::Patron; use Modern::Perl; -use Carp; use List::MoreUtils qw( any uniq ); use JSON qw( to_json ); -use Unicode::Normalize; +use Unicode::Normalize qw( NFKD ); use C4::Context; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Account; use Koha::ArticleRequests; -use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use C4::Letters; use Koha::AuthUtils; use Koha::Checkouts; use Koha::Club::Enrollments; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Password; use Koha::Holds; use Koha::Old::Checkouts; diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm index 713dcf9249..892d00c2ae 100644 --- a/Koha/Patron/Category.pm +++ b/Koha/Patron/Category.pm @@ -17,13 +17,12 @@ package Koha::Patron::Category; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use C4::Members::Messaging; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Object Koha::Object::Limit::Library); diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm index f35f434109..8ad1696bc5 100644 --- a/Koha/Patron/Discharge.pm +++ b/Koha/Patron/Discharge.pm @@ -2,11 +2,11 @@ package Koha::Patron::Discharge; use Modern::Perl; use CGI; -use File::Temp qw( :POSIX ); -use Carp; +use File::Temp qw( tmpnam ); +use Carp qw( carp ); use C4::Templates qw ( gettemplate ); -use C4::Letters qw ( GetPreparedLetter ); +use C4::Letters qw( GetPreparedLetter ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); diff --git a/Koha/Patron/Image.pm b/Koha/Patron/Image.pm index 06caa3022a..643ad2c1f0 100644 --- a/Koha/Patron/Image.pm +++ b/Koha/Patron/Image.pm @@ -17,7 +17,6 @@ package Koha::Patron::Image; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Images.pm b/Koha/Patron/Images.pm index aec39197c2..02a907f09f 100644 --- a/Koha/Patron/Images.pm +++ b/Koha/Patron/Images.pm @@ -17,7 +17,6 @@ package Koha::Patron::Images; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Message.pm b/Koha/Patron/Message.pm index d56c07a712..fa4473d220 100644 --- a/Koha/Patron/Message.pm +++ b/Koha/Patron/Message.pm @@ -17,10 +17,9 @@ package Koha::Patron::Message; use Modern::Perl; -use Carp; use C4::Context; -use C4::Log qw( logaction ); +use C4::Log; use Koha::Database; diff --git a/Koha/Patron/Messages.pm b/Koha/Patron/Messages.pm index 3bd98e3352..7cc729ac86 100644 --- a/Koha/Patron/Messages.pm +++ b/Koha/Patron/Messages.pm @@ -17,7 +17,6 @@ package Koha::Patron::Messages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Modification.pm b/Koha/Patron/Modification.pm index 51f182a80b..3c92a6286a 100644 --- a/Koha/Patron/Modification.pm +++ b/Koha/Patron/Modification.pm @@ -19,7 +19,6 @@ package Koha::Patron::Modification; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions::Patron::Modification; @@ -27,9 +26,9 @@ use Koha::Patron::Attribute; use Koha::Patron::Attributes; use Koha::Patron::Modifications; -use JSON; -use List::MoreUtils qw( uniq any ); -use Try::Tiny; +use JSON qw( from_json ); +use List::MoreUtils qw( any uniq ); +use Try::Tiny qw( catch try ); use base qw(Koha::Object); diff --git a/Koha/Patron/Modifications.pm b/Koha/Patron/Modifications.pm index 1ca0ab1163..f6665e8ddb 100644 --- a/Koha/Patron/Modifications.pm +++ b/Koha/Patron/Modifications.pm @@ -29,8 +29,8 @@ use C4::Context; use Koha::Patron::Attribute; use Koha::Patron::Modification; -use JSON; -use List::Util qw /any none/; +use JSON qw( from_json ); +use List::Util qw( none ); use base qw(Koha::Objects); diff --git a/Koha/Patron/Password/Recovery.pm b/Koha/Patron/Password/Recovery.pm index 0dafdae4f3..5fb1402dee 100644 --- a/Koha/Patron/Password/Recovery.pm +++ b/Koha/Patron/Password/Recovery.pm @@ -20,15 +20,14 @@ package Koha::Patron::Password::Recovery; use Modern::Perl; use C4::Context; use C4::Letters; -use Crypt::Eksblowfish::Bcrypt qw(en_base64); -use Koha::DateUtils; - -use vars qw(@ISA @EXPORT); +use Crypt::Eksblowfish::Bcrypt qw( en_base64 ); +use Koha::DateUtils qw( dt_from_string ); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - push @EXPORT, qw( + @EXPORT_OK = qw( &ValidateBorrowernumber &SendPasswordRecoveryEmail &GetValidLinkInfo diff --git a/Koha/Patron/Relationship.pm b/Koha/Patron/Relationship.pm index d8cbb1c18e..88ede2cc51 100644 --- a/Koha/Patron/Relationship.pm +++ b/Koha/Patron/Relationship.pm @@ -17,9 +17,8 @@ package Koha::Patron::Relationship; use Modern::Perl; -use Carp; use List::MoreUtils qw( any ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Database; use Koha::Exceptions::Patron::Relationship; diff --git a/Koha/Patron/Relationships.pm b/Koha/Patron/Relationships.pm index 7c2a9bc51f..56f0fd9dd5 100644 --- a/Koha/Patron/Relationships.pm +++ b/Koha/Patron/Relationships.pm @@ -17,7 +17,6 @@ package Koha::Patron::Relationships; use Modern::Perl; -use Carp; use List::MoreUtils qw( uniq ); use Koha::Database; diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index 616fefacba..4f2b55956a 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -20,17 +20,15 @@ package Koha::Patrons; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ArticleRequests; use Koha::ArticleRequest::Status; use Koha::Patron; use Koha::Exceptions::Patron; use Koha::Patron::Categories; -use Date::Calc qw( Today Add_Delta_YMD ); use base qw(Koha::Objects); diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index cd6f4aa303..fe3fd80c11 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -17,20 +17,19 @@ package Koha::Patrons::Import; use Modern::Perl; use Moo; -use namespace::clean; -use Carp; +use Carp qw( carp ); use Text::CSV; use Encode qw( decode_utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Members; +use C4::Members qw( checkcardnumber ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Categories; -use Koha::Patron::Debarments; -use Koha::DateUtils; +use Koha::Patron::Debarments qw( AddDebarment GetDebarments ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm index 36e6090415..b8f9f86a33 100644 --- a/Koha/Plugins.pm +++ b/Koha/Plugins.pm @@ -19,13 +19,14 @@ package Koha::Plugins; use Modern::Perl; -use Array::Utils qw(array_minus); +use Array::Utils qw( array_minus ); use Class::Inspector; -use List::MoreUtils qw(any); -use Module::Load::Conditional qw(can_load); -use Module::Load qw(load); +use List::MoreUtils qw( any ); +use Module::Load::Conditional qw( can_load ); +use Module::Load; use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/; + use C4::Context; use C4::Output; use Koha::Plugins::Methods; diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index a5cb15e3c1..e935e74a18 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -19,14 +19,13 @@ package Koha::Plugins::Base; use Modern::Perl; -use Module::Pluggable require => 1; -use Cwd qw(abs_path); -use List::Util qw(max); +use Cwd qw( abs_path ); +use List::Util qw( max ); use base qw{Module::Bundled::Files}; use C4::Context; -use C4::Output qw(output_with_http_headers output_html_with_http_headers); +use C4::Output qw( output_with_http_headers ); =head1 NAME diff --git a/Koha/Plugins/Handler.pm b/Koha/Plugins/Handler.pm index 6c6ae73023..a32487d4ad 100644 --- a/Koha/Plugins/Handler.pm +++ b/Koha/Plugins/Handler.pm @@ -19,10 +19,10 @@ package Koha::Plugins::Handler; use Modern::Perl; -use Array::Utils qw(array_minus); -use File::Path qw(remove_tree); +use Array::Utils qw( array_minus ); +use File::Path qw( remove_tree ); -use Module::Load qw(load); +use Module::Load qw( load ); use C4::Context; use Koha::Plugins::Methods; diff --git a/Koha/Plugins/Method.pm b/Koha/Plugins/Method.pm index ce313b5ff0..b6e2e750b8 100644 --- a/Koha/Plugins/Method.pm +++ b/Koha/Plugins/Method.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Method; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Plugins/Methods.pm b/Koha/Plugins/Methods.pm index 1e3e00d5c4..e99b8b5b38 100644 --- a/Koha/Plugins/Methods.pm +++ b/Koha/Plugins/Methods.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Methods; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm index 78a1190f7c..70049a48c9 100644 --- a/Koha/PseudonymizedTransaction.pm +++ b/Koha/PseudonymizedTransaction.pm @@ -16,8 +16,7 @@ package Koha::PseudonymizedTransaction; use Modern::Perl; -use Carp; -use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); +use Crypt::Eksblowfish::Bcrypt qw( bcrypt ); use Koha::Database; use Koha::Exceptions::Config; diff --git a/Koha/PseudonymizedTransactions.pm b/Koha/PseudonymizedTransactions.pm index 06ea08a010..8b2e60ba68 100644 --- a/Koha/PseudonymizedTransactions.pm +++ b/Koha/PseudonymizedTransactions.pm @@ -16,7 +16,6 @@ package Koha::PseudonymizedTransactions; use Modern::Perl; -use Carp; use Koha::Database; use Koha::PseudonymizedTransaction; diff --git a/Koha/Quote.pm b/Koha/Quote.pm index 49868aa2a3..3ce1985462 100644 --- a/Koha/Quote.pm +++ b/Koha/Quote.pm @@ -16,7 +16,6 @@ package Koha::Quote; # along with Koha; if not, see . use Modern::Perl; -use Carp; use Koha::Database; use Koha::Quotes; diff --git a/Koha/Quotes.pm b/Koha/Quotes.pm index 746fff0bc1..d9fc43f9bf 100644 --- a/Koha/Quotes.pm +++ b/Koha/Quotes.pm @@ -16,10 +16,9 @@ package Koha::Quotes; # along with Koha; if not, see . use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Quote; use base qw(Koha::Objects); diff --git a/Koha/REST/Plugin/PluginRoutes.pm b/Koha/REST/Plugin/PluginRoutes.pm index d434ee537d..cf7eea882b 100644 --- a/Koha/REST/Plugin/PluginRoutes.pm +++ b/Koha/REST/Plugin/PluginRoutes.pm @@ -23,8 +23,8 @@ use Koha::Exceptions::Plugin; use Koha::Plugins; use Koha::Logger; -use Clone qw(clone); -use Try::Tiny; +use Clone qw( clone ); +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm index e6bb370d06..5603e60294 100644 --- a/Koha/REST/Plugin/Query.pm +++ b/Koha/REST/Plugin/Query.pm @@ -18,9 +18,9 @@ package Koha::REST::Plugin::Query; use Modern::Perl; use Mojo::Base 'Mojolicious::Plugin'; -use List::MoreUtils qw(any); -use Scalar::Util qw(reftype); -use JSON qw(decode_json); +use List::MoreUtils qw( any ); +use Scalar::Util qw( reftype ); +use JSON qw( decode_json ); use Koha::Exceptions; diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 1c6c03582f..1c22a769d7 100644 --- a/Koha/REST/V1.pm +++ b/Koha/REST/V1.pm @@ -23,7 +23,7 @@ use C4::Context; use Koha::Logger; use JSON::Validator::OpenAPI::Mojolicious; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Acquisitions/Funds.pm b/Koha/REST/V1/Acquisitions/Funds.pm index ee0704674a..c4209289fe 100644 --- a/Koha/REST/V1/Acquisitions/Funds.pm +++ b/Koha/REST/V1/Acquisitions/Funds.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Funds; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm index e104ce5dea..cc12ecd2ff 100644 --- a/Koha/REST/V1/Acquisitions/Orders.pm +++ b/Koha/REST/V1/Acquisitions/Orders.pm @@ -20,12 +20,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Orders; -use Koha::DateUtils; -use Clone 'clone'; -use JSON qw(decode_json); +use Clone qw( clone ); use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm index 8720a42629..eb0d4112e2 100644 --- a/Koha/REST/V1/Acquisitions/Vendors.pm +++ b/Koha/REST/V1/Acquisitions/Vendors.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Booksellers; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/AdvancedEditorMacro.pm b/Koha/REST/V1/AdvancedEditorMacro.pm index 86a2f46648..472d4ce87c 100644 --- a/Koha/REST/V1/AdvancedEditorMacro.pm +++ b/Koha/REST/V1/AdvancedEditorMacro.pm @@ -19,7 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::AdvancedEditorMacros; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 Name diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm index ea29bd6929..2361aae361 100644 --- a/Koha/REST/V1/Auth.pm +++ b/Koha/REST/V1/Auth.pm @@ -38,10 +38,10 @@ use Koha::Exceptions; use Koha::Exceptions::Authentication; use Koha::Exceptions::Authorization; -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); use Module::Load::Conditional; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm index 92d31348d4..3ddb896e73 100644 --- a/Koha/REST/V1/Biblios.pm +++ b/Koha/REST/V1/Biblios.pm @@ -21,12 +21,12 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Biblios; use Koha::RecordProcessor; -use C4::Biblio qw(DelBiblio); +use C4::Biblio qw( DelBiblio ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use MARC::Record::MiJ; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/CashRegisters/Cashups.pm b/Koha/REST/V1/CashRegisters/Cashups.pm index 8bb483bdde..12b6f30214 100644 --- a/Koha/REST/V1/CashRegisters/Cashups.pm +++ b/Koha/REST/V1/CashRegisters/Cashups.pm @@ -19,8 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Cash::Registers; diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm index 8fc07181b1..e670987bff 100644 --- a/Koha/REST/V1/Checkouts.pm +++ b/Koha/REST/V1/Checkouts.pm @@ -22,11 +22,11 @@ use Mojo::JSON; use C4::Auth qw( haspermission ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddRenewal ); use Koha::Checkouts; use Koha::Old::Checkouts; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/CirculationRules.pm b/Koha/REST/V1/CirculationRules.pm index baa04b5211..636985fba6 100644 --- a/Koha/REST/V1/CirculationRules.pm +++ b/Koha/REST/V1/CirculationRules.pm @@ -21,7 +21,6 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::CirculationRules; -use Try::Tiny; =head1 API diff --git a/Koha/REST/V1/Cities.pm b/Koha/REST/V1/Cities.pm index cfa8d53422..3dfc91d56f 100644 --- a/Koha/REST/V1/Cities.pm +++ b/Koha/REST/V1/Cities.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Cities; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm index 726f6f20de..3333d75e7d 100644 --- a/Koha/REST/V1/Clubs/Holds.pm +++ b/Koha/REST/V1/Clubs/Holds.pm @@ -19,7 +19,6 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use C4::Biblio; use C4::Reserves; use Koha::Items; @@ -27,11 +26,10 @@ use Koha::Patrons; use Koha::Holds; use Koha::Clubs; use Koha::Club::Hold; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use Scalar::Util qw(blessed); -use Try::Tiny; -use List::Util 'shuffle'; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/Config/SMTP/Servers.pm b/Koha/REST/V1/Config/SMTP/Servers.pm index 205f074fca..5949c535f4 100644 --- a/Koha/REST/V1/Config/SMTP/Servers.pm +++ b/Koha/REST/V1/Config/SMTP/Servers.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::SMTP::Servers; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 08bf1a1fe3..7541a5c653 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -19,18 +19,17 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Mojo::JSON qw(decode_json); +use Mojo::JSON; -use C4::Biblio; use C4::Reserves; use Koha::Items; use Koha::Patrons; use Koha::Holds; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use List::MoreUtils qw(any); -use Try::Tiny; +use List::MoreUtils qw( any ); +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/ImportBatchProfiles.pm b/Koha/REST/V1/ImportBatchProfiles.pm index 9988d0f002..ddac0eee4f 100644 --- a/Koha/REST/V1/ImportBatchProfiles.pm +++ b/Koha/REST/V1/ImportBatchProfiles.pm @@ -22,7 +22,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::ImportBatchProfiles; use Koha::ImportBatchProfile; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm index 21e7aa9feb..1887bce514 100644 --- a/Koha/REST/V1/Items.pm +++ b/Koha/REST/V1/Items.pm @@ -21,8 +21,8 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Items; -use List::MoreUtils qw(any); -use Try::Tiny; +use List::MoreUtils qw( any ); +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Libraries.pm b/Koha/REST/V1/Libraries.pm index 9025adbe7c..b6ec20e69d 100644 --- a/Koha/REST/V1/Libraries.pm +++ b/Koha/REST/V1/Libraries.pm @@ -22,7 +22,7 @@ use Koha::Libraries; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/OAuth.pm b/Koha/REST/V1/OAuth.pm index 090c789924..922134ddc7 100644 --- a/Koha/REST/V1/OAuth.pm +++ b/Koha/REST/V1/OAuth.pm @@ -21,7 +21,7 @@ use Module::Load::Conditional; use C4::Context; use Koha::OAuth; -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); use Mojo::Base 'Mojolicious::Controller'; diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index a88610bfda..80b64ee963 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/Koha/REST/V1/Patrons.pm @@ -20,11 +20,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::Database; -use Koha::DateUtils; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Patrons/Account.pm b/Koha/REST/V1/Patrons/Account.pm index 1bf64aa58c..1c932c07f7 100644 --- a/Koha/REST/V1/Patrons/Account.pm +++ b/Koha/REST/V1/Patrons/Account.pm @@ -21,8 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Patrons/Attributes.pm b/Koha/REST/V1/Patrons/Attributes.pm index f769765a73..4095a9220a 100644 --- a/Koha/REST/V1/Patrons/Attributes.pm +++ b/Koha/REST/V1/Patrons/Attributes.pm @@ -22,8 +22,8 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Patron::Attributes; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Patrons/Password.pm b/Koha/REST/V1/Patrons/Password.pm index 82531d9d49..bb53ad5d4c 100644 --- a/Koha/REST/V1/Patrons/Password.pm +++ b/Koha/REST/V1/Patrons/Password.pm @@ -23,8 +23,8 @@ use C4::Auth qw(checkpw_internal); use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/REST/V1/Quotes.pm b/Koha/REST/V1/Quotes.pm index 49c6e4cab6..53475ec9c2 100644 --- a/Koha/REST/V1/Quotes.pm +++ b/Koha/REST/V1/Quotes.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Quotes; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm index c9fa833387..850b0f76c2 100644 --- a/Koha/REST/V1/ReturnClaims.pm +++ b/Koha/REST/V1/ReturnClaims.pm @@ -19,11 +19,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Checkouts::ReturnClaims; use Koha::Checkouts; -use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME diff --git a/Koha/REST/V1/Static.pm b/Koha/REST/V1/Static.pm index 233fa4e751..2b7f20e123 100644 --- a/Koha/REST/V1/Static.pm +++ b/Koha/REST/V1/Static.pm @@ -19,7 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API diff --git a/Koha/REST/V1/TransferLimits.pm b/Koha/REST/V1/TransferLimits.pm index 8ce8291192..c7d056d18d 100644 --- a/Koha/REST/V1/TransferLimits.pm +++ b/Koha/REST/V1/TransferLimits.pm @@ -25,7 +25,7 @@ use Koha::Exceptions::TransferLimit; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME diff --git a/Koha/Rating.pm b/Koha/Rating.pm index 9306181260..35ecf0e7ec 100644 --- a/Koha/Rating.pm +++ b/Koha/Rating.pm @@ -17,7 +17,6 @@ package Koha::Rating; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Ratings.pm b/Koha/Ratings.pm index 8d3b50acaa..41e1197842 100644 --- a/Koha/Ratings.pm +++ b/Koha/Ratings.pm @@ -17,7 +17,6 @@ package Koha::Ratings; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm index a501c5010a..ec7cbea0ca 100644 --- a/Koha/RecordProcessor.pm +++ b/Koha/RecordProcessor.pm @@ -59,7 +59,7 @@ clone it I to passing it off to the RecordProcessor. use Modern::Perl; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); use Module::Pluggable::Object; use base qw(Class::Accessor); diff --git a/Koha/Report.pm b/Koha/Report.pm index 1e6510219d..176fb6e253 100644 --- a/Koha/Report.pm +++ b/Koha/Report.pm @@ -17,10 +17,8 @@ package Koha::Report; use Modern::Perl; -use Carp; use Koha::Database; -use JSON; use Koha::Reports; use Koha::DateUtils qw( dt_from_string output_pref ); diff --git a/Koha/Reports.pm b/Koha/Reports.pm index 873f295abd..d0f952ce09 100644 --- a/Koha/Reports.pm +++ b/Koha/Reports.pm @@ -17,7 +17,6 @@ package Koha::Reports; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Review.pm b/Koha/Review.pm index 68f6008131..eae983e860 100644 --- a/Koha/Review.pm +++ b/Koha/Review.pm @@ -17,7 +17,6 @@ package Koha::Review; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Reviews.pm b/Koha/Reviews.pm index 517d93626f..5e9be0bbbf 100644 --- a/Koha/Reviews.pm +++ b/Koha/Reviews.pm @@ -17,7 +17,6 @@ package Koha::Reviews; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SMS/Provider.pm b/Koha/SMS/Provider.pm index c651265294..3771acfb98 100644 --- a/Koha/SMS/Provider.pm +++ b/Koha/SMS/Provider.pm @@ -19,7 +19,6 @@ package Koha::SMS::Provider; use Modern::Perl; -use Carp; use Koha::Patrons; diff --git a/Koha/SMS/Providers.pm b/Koha/SMS/Providers.pm index 35a1aacc30..3cb2f90756 100644 --- a/Koha/SMS/Providers.pm +++ b/Koha/SMS/Providers.pm @@ -19,7 +19,6 @@ package Koha::SMS::Providers; use Modern::Perl; -use Carp; use Koha::SMS::Provider; diff --git a/Koha/Schema/Loader/mysql.pm b/Koha/Schema/Loader/mysql.pm index f272e6534f..4f321b8ba5 100644 --- a/Koha/Schema/Loader/mysql.pm +++ b/Koha/Schema/Loader/mysql.pm @@ -24,7 +24,7 @@ use Modern::Perl; use base 'DBIx::Class::Schema::Loader::DBI::mysql'; use mro 'c3'; -use Scalar::Util 'blessed'; +use Scalar::Util qw( blessed ); # This is being upstreamed, but for now lets make sure whatever version of DBIx::Class::Schema::Loader you are using, # we will catch MariaDB current_timestamp() and convert it to \"current_timestamp" correctly. diff --git a/Koha/Script.pm b/Koha/Script.pm index aaa2e8b560..d9e11ea7d8 100644 --- a/Koha/Script.pm +++ b/Koha/Script.pm @@ -35,8 +35,8 @@ This class should be used in all scripts. It sets the interface and userenv appr =cut -use File::Basename; -use Fcntl qw(:flock); +use File::Basename qw( fileparse ); +use Fcntl qw( LOCK_EX LOCK_NB ); use C4::Context; use Koha::Exceptions; diff --git a/Koha/SearchEngine.pm b/Koha/SearchEngine.pm index 7aa1f85a6d..7c08af9f6a 100644 --- a/Koha/SearchEngine.pm +++ b/Koha/SearchEngine.pm @@ -19,7 +19,7 @@ package Koha::SearchEngine; # along with Koha; if not, see . use Modern::Perl; -use Readonly; +use Readonly qw( Readonly ); =head1 NAME diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 74250f3e48..8950f8fb9e 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -28,23 +28,22 @@ use Koha::SearchFields; use Koha::SearchMarcMaps; use Koha::Caches; use C4::Heading; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( GuessAuthTypeCode ); -use Carp; -use Clone qw(clone); -use JSON; +use Carp qw( carp croak ); +use Clone qw( clone ); use Modern::Perl; -use Readonly; +use Readonly qw( Readonly ); use Search::Elasticsearch; -use Try::Tiny; +use Try::Tiny qw( catch try ); use YAML::XS; -use List::Util qw( sum0 reduce all ); +use List::Util qw( sum0 ); use MARC::File::XML; -use MIME::Base64; -use Encode qw(encode); +use MIME::Base64 qw( encode_base64 ); +use Encode qw( encode ); use Business::ISBN; -use Scalar::Util qw(looks_like_number); +use Scalar::Util qw( looks_like_number ); __PACKAGE__->mk_ro_accessors(qw( index index_name )); __PACKAGE__->mk_accessors(qw( sort_fields )); diff --git a/Koha/SearchEngine/Elasticsearch/Indexer.pm b/Koha/SearchEngine/Elasticsearch/Indexer.pm index 0c9b3ff380..0a10832d2e 100644 --- a/Koha/SearchEngine/Elasticsearch/Indexer.pm +++ b/Koha/SearchEngine/Elasticsearch/Indexer.pm @@ -17,12 +17,11 @@ package Koha::SearchEngine::Elasticsearch::Indexer; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use Carp; +use Carp qw( carp croak ); use Modern::Perl; -use Try::Tiny; -use List::Util qw(any); +use Try::Tiny qw( catch try ); +use List::Util qw( any ); use base qw(Koha::SearchEngine::Elasticsearch); -use Data::Dumper; use Koha::Exceptions; use Koha::Exceptions::Elasticsearch; diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index a39931ab0b..45e8c1f2c2 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -40,11 +40,10 @@ provides something that can be given to elasticsearch to get answers. =cut use base qw(Koha::SearchEngine::Elasticsearch); -use Carp; use JSON; -use List::MoreUtils qw/ each_array /; +use List::MoreUtils qw( each_array ); use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use C4::Context; use Koha::Exceptions; diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index ff56ad1174..3afcf75c37 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -50,9 +50,7 @@ use Koha::SearchEngine::Search; use Koha::Exceptions::Elasticsearch; use MARC::Record; use MARC::File::XML; -use Data::Dumper; #TODO remove -use Carp qw(cluck); -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); Koha::SearchEngine::Elasticsearch::Search->mk_accessors(qw( store )); diff --git a/Koha/SearchEngine/Indexer.pm b/Koha/SearchEngine/Indexer.pm index 64262ff587..e64fa35c46 100644 --- a/Koha/SearchEngine/Indexer.pm +++ b/Koha/SearchEngine/Indexer.pm @@ -45,7 +45,6 @@ Creates a new C of whatever the relevant type is. use Modern::Perl; use C4::Context; -use C4::Biblio qw//; sub new { my $engine = C4::Context->preference("SearchEngine") // 'Zebra'; diff --git a/Koha/SearchEngine/QueryBuilder.pm b/Koha/SearchEngine/QueryBuilder.pm index 62a6b2c49e..11e6c94842 100644 --- a/Koha/SearchEngine/QueryBuilder.pm +++ b/Koha/SearchEngine/QueryBuilder.pm @@ -45,7 +45,7 @@ Creates a new C of whatever the relevant type is. use C4::Context; use Modern::Perl; -use Carp; +use Carp qw( croak ); sub new { my $engine = C4::Context->preference("SearchEngine"); diff --git a/Koha/SearchEngine/Search.pm b/Koha/SearchEngine/Search.pm index 0b7222741a..578ae8979c 100644 --- a/Koha/SearchEngine/Search.pm +++ b/Koha/SearchEngine/Search.pm @@ -45,8 +45,8 @@ Creates a new C of whatever the relevant type is. use Modern::Perl; use C4::Context; -use C4::Biblio qw//; -use POSIX qw(ceil floor); +use C4::Biblio; +use POSIX qw( ceil ); sub new { my $engine = C4::Context->preference("SearchEngine") // 'Zebra'; diff --git a/Koha/SearchEngine/Zebra/Indexer.pm b/Koha/SearchEngine/Zebra/Indexer.pm index 8ead358d9e..01326d510b 100644 --- a/Koha/SearchEngine/Zebra/Indexer.pm +++ b/Koha/SearchEngine/Zebra/Indexer.pm @@ -18,7 +18,7 @@ package Koha::SearchEngine::Zebra::Indexer; # along with Koha; if not, see . use Modern::Perl; -use C4::Biblio qw(ModZebra); # FIXME This is terrible, we should move the indexation code outside of C4::Biblio +use C4::Biblio qw( ModZebra ); # FIXME This is terrible, we should move the indexation code outside of C4::Biblio use base qw(Class::Accessor); =head1 NAME diff --git a/Koha/SearchEngine/Zebra/Search.pm b/Koha/SearchEngine/Zebra/Search.pm index 850469ec5d..1d504d384f 100644 --- a/Koha/SearchEngine/Zebra/Search.pm +++ b/Koha/SearchEngine/Zebra/Search.pm @@ -21,7 +21,7 @@ use Modern::Perl; use base qw(Class::Accessor); -use C4::Search; # :( +use C4::Search qw( getRecords ); # :( use C4::AuthoritiesMarc; use Koha::SearchEngine::Search; @@ -62,7 +62,7 @@ This passes straight through to C4::Search::getRecords. sub search_compat { shift; # get rid of $self - return getRecords(@_); + return C4::Search::getRecords(@_); } =head2 simple_search_compat diff --git a/Koha/SearchField.pm b/Koha/SearchField.pm index e6c80c79cf..32fa405430 100644 --- a/Koha/SearchField.pm +++ b/Koha/SearchField.pm @@ -17,7 +17,6 @@ package Koha::SearchField; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchFields.pm b/Koha/SearchFields.pm index 29a8033e70..deef07a79c 100644 --- a/Koha/SearchFields.pm +++ b/Koha/SearchFields.pm @@ -17,7 +17,6 @@ package Koha::SearchFields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchMarcMap.pm b/Koha/SearchMarcMap.pm index bf86b781e5..6f28511c8d 100644 --- a/Koha/SearchMarcMap.pm +++ b/Koha/SearchMarcMap.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMap; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchMarcMaps.pm b/Koha/SearchMarcMaps.pm index 338a51ddb9..d4fb9ce0be 100644 --- a/Koha/SearchMarcMaps.pm +++ b/Koha/SearchMarcMaps.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMaps; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial.pm b/Koha/Serial.pm index 182edc75f4..052290ed46 100644 --- a/Koha/Serial.pm +++ b/Koha/Serial.pm @@ -19,7 +19,6 @@ package Koha::Serial; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial/Item.pm b/Koha/Serial/Item.pm index 3d0b124707..a68a729994 100644 --- a/Koha/Serial/Item.pm +++ b/Koha/Serial/Item.pm @@ -19,7 +19,6 @@ package Koha::Serial::Item; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial/Items.pm b/Koha/Serial/Items.pm index 7ddaed012b..5cc563e975 100644 --- a/Koha/Serial/Items.pm +++ b/Koha/Serial/Items.pm @@ -19,7 +19,6 @@ package Koha::Serial::Items; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serials.pm b/Koha/Serials.pm index 8cd8c015a9..ad58509d24 100644 --- a/Koha/Serials.pm +++ b/Koha/Serials.pm @@ -19,7 +19,6 @@ package Koha::Serials; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm index 7082fe03a3..0c5e406caf 100644 --- a/Koha/SharedContent.pm +++ b/Koha/SharedContent.pm @@ -18,7 +18,7 @@ package Koha::SharedContent; # along with Koha; if not, see . use Modern::Perl; -use JSON; +use JSON qw( from_json to_json ); use HTTP::Request; use LWP::UserAgent; diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm index 995e392123..a501a9441f 100644 --- a/Koha/SimpleMARC.pm +++ b/Koha/SimpleMARC.pm @@ -18,29 +18,23 @@ package Koha::SimpleMARC; use Modern::Perl; -#use MARC::Record; - -require Exporter; - -our @ISA = qw(Exporter); -our %EXPORT_TAGS = ( 'all' => [ qw( - -) ] ); - -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); - -our @EXPORT = qw( - read_field - add_field - update_field - copy_field - copy_and_replace_field - move_field - delete_field - field_exists - field_equals -); - +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + our @ISA = qw(Exporter); + + @EXPORT_OK = qw( + read_field + add_field + update_field + copy_field + copy_and_replace_field + move_field + delete_field + field_exists + field_equals + ); +} =head1 NAME diff --git a/Koha/Sitemapper/Writer.pm b/Koha/Sitemapper/Writer.pm index 63f147aff8..a397d62ee0 100644 --- a/Koha/Sitemapper/Writer.pm +++ b/Koha/Sitemapper/Writer.pm @@ -23,7 +23,7 @@ use Moo; use Modern::Perl; use XML::Writer; use IO::File; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $MAX = 50000; diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm index d6fd61ff93..397e440cdb 100644 --- a/Koha/Statistic.pm +++ b/Koha/Statistic.pm @@ -17,7 +17,6 @@ package Koha::Statistic; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Items; diff --git a/Koha/Statistics.pm b/Koha/Statistics.pm index ecbceebf32..4b3a4ebf39 100644 --- a/Koha/Statistics.pm +++ b/Koha/Statistics.pm @@ -17,7 +17,6 @@ package Koha::Statistics; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/StockRotationItem.pm b/Koha/StockRotationItem.pm index 9ee92c10e6..58f0a6c25b 100644 --- a/Koha/StockRotationItem.pm +++ b/Koha/StockRotationItem.pm @@ -22,11 +22,11 @@ use Modern::Perl; use DateTime; use DateTime::Duration; use Koha::Database; -use Koha::DateUtils qw/dt_from_string/; +use Koha::DateUtils qw( dt_from_string ); use Koha::Item::Transfer; use Koha::Item; use Koha::StockRotationStage; -use Try::Tiny; +use Try::Tiny qw( catch try ); use base qw(Koha::Object); diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm index 07ab168177..45d1c09fa0 100644 --- a/Koha/Subscription.pm +++ b/Koha/Subscription.pm @@ -19,7 +19,6 @@ package Koha::Subscription; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Biblios; @@ -28,7 +27,6 @@ use Koha::Biblioitems; use Koha::Subscriptions; use Koha::Subscription::Frequencies; use Koha::Subscription::Numberpatterns; -use JSON; use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); diff --git a/Koha/Subscription/Frequencies.pm b/Koha/Subscription/Frequencies.pm index 4952625613..9b60f21087 100644 --- a/Koha/Subscription/Frequencies.pm +++ b/Koha/Subscription/Frequencies.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequencies; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Frequency.pm b/Koha/Subscription/Frequency.pm index 475e744f17..abb47c38e9 100644 --- a/Koha/Subscription/Frequency.pm +++ b/Koha/Subscription/Frequency.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequency; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Histories.pm b/Koha/Subscription/Histories.pm index 460aedaaf5..3815cd2d87 100644 --- a/Koha/Subscription/Histories.pm +++ b/Koha/Subscription/Histories.pm @@ -19,7 +19,6 @@ package Koha::Subscription::Histories; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/History.pm b/Koha/Subscription/History.pm index 4d309e2cb5..e65e93595e 100644 --- a/Koha/Subscription/History.pm +++ b/Koha/Subscription/History.pm @@ -19,7 +19,6 @@ package Koha::Subscription::History; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Routinglist.pm b/Koha/Subscription/Routinglist.pm index ede95b976a..10cf094da5 100644 --- a/Koha/Subscription/Routinglist.pm +++ b/Koha/Subscription/Routinglist.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglist; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscriptions; diff --git a/Koha/Subscription/Routinglists.pm b/Koha/Subscription/Routinglists.pm index 950d608144..7678a9eafc 100644 --- a/Koha/Subscription/Routinglists.pm +++ b/Koha/Subscription/Routinglists.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglists; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscription::Routinglist; diff --git a/Koha/Subscriptions.pm b/Koha/Subscriptions.pm index 86ee330844..9636e9f30b 100644 --- a/Koha/Subscriptions.pm +++ b/Koha/Subscriptions.pm @@ -19,7 +19,6 @@ package Koha::Subscriptions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index f9f8c2a490..5542963d45 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -19,10 +19,9 @@ package Koha::Suggestion; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use base qw(Koha::Object); diff --git a/Koha/SuggestionEngine.pm b/Koha/SuggestionEngine.pm index ee1b2cc869..f10f914399 100644 --- a/Koha/SuggestionEngine.pm +++ b/Koha/SuggestionEngine.pm @@ -53,7 +53,7 @@ B - create a new plugin object use strict; use warnings; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); use Module::Pluggable::Object; use base qw(Class::Accessor); diff --git a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm b/Koha/SuggestionEngine/Plugin/AuthorityFile.pm index cfb34da7aa..cb53872851 100644 --- a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm +++ b/Koha/SuggestionEngine/Plugin/AuthorityFile.pm @@ -31,7 +31,6 @@ Plugin to get suggestions from Koha's authority file =cut use Modern::Perl; -use Carp; use base qw(Koha::SuggestionEngine::Base); diff --git a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm b/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm index cb05267720..0c4656e77e 100644 --- a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm +++ b/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm @@ -32,7 +32,6 @@ subjects to subject searches. =cut use Modern::Perl; -use Carp; use C4::Templates qw(gettemplate); # This is necessary for translatability use base qw(Koha::SuggestionEngine::Base); diff --git a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm b/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm index 5356276922..38d9df2b79 100644 --- a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm +++ b/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm @@ -18,7 +18,7 @@ package Koha::SuggestionEngine::Plugin::LibrisSpellcheck; use Modern::Perl; use LWP::UserAgent; -use XML::Simple qw(XMLin); +use XML::Simple qw( XMLin ); use C4::Context; use base qw(Koha::SuggestionEngine::Base); diff --git a/Koha/SuggestionEngine/Plugin/Null.pm b/Koha/SuggestionEngine/Plugin/Null.pm index e0603504d3..fc7463ef38 100644 --- a/Koha/SuggestionEngine/Plugin/Null.pm +++ b/Koha/SuggestionEngine/Plugin/Null.pm @@ -33,7 +33,6 @@ SuggestionEngine. use strict; use warnings; -use Carp; use base qw(Koha::SuggestionEngine::Base); diff --git a/Koha/Suggestions.pm b/Koha/Suggestions.pm index 39f4a525fa..03262bb5f1 100644 --- a/Koha/Suggestions.pm +++ b/Koha/Suggestions.pm @@ -19,7 +19,6 @@ package Koha::Suggestions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Tag.pm b/Koha/Tag.pm index 1597d7bea2..089aa4f61d 100644 --- a/Koha/Tag.pm +++ b/Koha/Tag.pm @@ -17,7 +17,6 @@ package Koha::Tag; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags.pm b/Koha/Tags.pm index 08568e1f86..a9a2bba8cd 100644 --- a/Koha/Tags.pm +++ b/Koha/Tags.pm @@ -17,7 +17,6 @@ package Koha::Tags; use Modern::Perl; -use Carp; use Koha::Tag; diff --git a/Koha/Tags/Approval.pm b/Koha/Tags/Approval.pm index bb0c4df8f2..ee7153c2ca 100644 --- a/Koha/Tags/Approval.pm +++ b/Koha/Tags/Approval.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approval; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags/Approvals.pm b/Koha/Tags/Approvals.pm index 43400f2f0c..f7e72ae352 100644 --- a/Koha/Tags/Approvals.pm +++ b/Koha/Tags/Approvals.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approvals; use Modern::Perl; -use Carp; use Koha::Tags::Approval; diff --git a/Koha/Tags/Index.pm b/Koha/Tags/Index.pm index 66f6074446..0b388acfb6 100644 --- a/Koha/Tags/Index.pm +++ b/Koha/Tags/Index.pm @@ -17,7 +17,6 @@ package Koha::Tags::Index; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags/Indexes.pm b/Koha/Tags/Indexes.pm index 56506a24de..2ec40bcd44 100644 --- a/Koha/Tags/Indexes.pm +++ b/Koha/Tags/Indexes.pm @@ -17,7 +17,6 @@ package Koha::Tags::Indexes; use Modern::Perl; -use Carp; use Koha::Tags::Index; diff --git a/Koha/Template/Plugin/Asset.pm b/Koha/Template/Plugin/Asset.pm index 08748b46e3..0afe209805 100644 --- a/Koha/Template/Plugin/Asset.pm +++ b/Koha/Template/Plugin/Asset.pm @@ -45,7 +45,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use File::Basename; +use File::Basename qw( fileparse ); use File::Spec; use C4::Context; use Koha; diff --git a/Koha/Template/Plugin/AudioAlerts.pm b/Koha/Template/Plugin/AudioAlerts.pm index a8877b63ad..a666f20766 100644 --- a/Koha/Template/Plugin/AudioAlerts.pm +++ b/Koha/Template/Plugin/AudioAlerts.pm @@ -19,8 +19,7 @@ package Koha::Template::Plugin::AudioAlerts; use Modern::Perl; -use Encode qw( encode ); -use JSON; +use JSON qw( encode_json ); use base qw( Template::Plugin ); diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm index 31d3748f51..5cb91b83a3 100644 --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ b/Koha/Template/Plugin/AuthorisedValues.pm @@ -21,7 +21,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use Koha::AuthorisedValues; sub GetByCode { diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm index 59d358802e..db7b2fd0e2 100644 --- a/Koha/Template/Plugin/Categories.pm +++ b/Koha/Template/Plugin/Categories.pm @@ -20,7 +20,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use List::Util qw(any); +use List::Util qw( any ); use Koha::Patron::Categories; sub all { diff --git a/Koha/Template/Plugin/I18N.pm b/Koha/Template/Plugin/I18N.pm index 919d3bc467..43e2ef3c07 100644 --- a/Koha/Template/Plugin/I18N.pm +++ b/Koha/Template/Plugin/I18N.pm @@ -22,7 +22,7 @@ use Modern::Perl; use base qw( Template::Plugin ); use C4::Context; -use Koha::I18N; +use Koha::I18N qw( __ __n __np __npx __nx __p __px __x __xn ); =head1 NAME diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm index 042268fc97..783833f7df 100644 --- a/Koha/Template/Plugin/KohaDates.pm +++ b/Koha/Template/Plugin/KohaDates.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Context; our $DYNAMIC = 1; diff --git a/Koha/Template/Plugin/KohaPlugins.pm b/Koha/Template/Plugin/KohaPlugins.pm index b75d36c437..d313f73126 100644 --- a/Koha/Template/Plugin/KohaPlugins.pm +++ b/Koha/Template/Plugin/KohaPlugins.pm @@ -21,7 +21,7 @@ use Modern::Perl; use base qw( Template::Plugin ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Plugins; diff --git a/Koha/Template/Plugin/To.pm b/Koha/Template/Plugin/To.pm index 67902e6ac0..dccd8e6cfe 100644 --- a/Koha/Template/Plugin/To.pm +++ b/Koha/Template/Plugin/To.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); -use JSON qw( to_json ); +use JSON; our $DYNAMIC = 1; sub json { diff --git a/Koha/Token.pm b/Koha/Token.pm index a3f226d74c..3f016be86d 100644 --- a/Koha/Token.pm +++ b/Koha/Token.pm @@ -49,11 +49,11 @@ Koha::Token - Tokenizer =cut use Modern::Perl; -use Bytes::Random::Secure (); -use String::Random (); -use WWW::CSRF (); -use Digest::MD5 qw(md5_base64); -use Encode qw( encode ); +use Bytes::Random::Secure; +use String::Random; +use WWW::CSRF; +use Digest::MD5 qw( md5_base64 ); +use Encode; use Koha::Exceptions::Token; use base qw(Class::Accessor); use constant HMAC_SHA1_LENGTH => 20; diff --git a/Koha/UploadedFiles.pm b/Koha/UploadedFiles.pm index 2f44e974c8..c453c6f977 100644 --- a/Koha/UploadedFiles.pm +++ b/Koha/UploadedFiles.pm @@ -19,9 +19,9 @@ package Koha::UploadedFiles; use Modern::Perl; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::UploadedFile; use parent qw(Koha::Objects); diff --git a/Koha/Uploader.pm b/Koha/Uploader.pm index 4cd6aafb6f..081bc3f078 100644 --- a/Koha/Uploader.pm +++ b/Koha/Uploader.pm @@ -69,7 +69,6 @@ use Modern::Perl; use CGI; # no utf8 flag, since it may interfere with binary uploads use Digest::MD5; use Encode; -use File::Spec; use IO::File; use Time::HiRes; diff --git a/Koha/Util/FrameworkPlugin.pm b/Koha/Util/FrameworkPlugin.pm index 9b29287c76..d3fcbb9ac8 100644 --- a/Koha/Util/FrameworkPlugin.pm +++ b/Koha/Util/FrameworkPlugin.pm @@ -22,11 +22,10 @@ package Koha::Util::FrameworkPlugin; use Modern::Perl; -our ( @ISA, @EXPORT, @EXPORT_OK ); +our ( @ISA, @EXPORT_OK ); BEGIN { require Exporter; @ISA = qw( Exporter ); - @EXPORT = qw( ); @EXPORT_OK = qw( wrapper date_entered ); } diff --git a/Koha/Util/MARC.pm b/Koha/Util/MARC.pm index 56f0a98451..3648888b30 100644 --- a/Koha/Util/MARC.pm +++ b/Koha/Util/MARC.pm @@ -18,7 +18,6 @@ package Koha::Util::MARC; # along with Koha; if not, see . use Modern::Perl; -use MARC::Record; =head1 NAME diff --git a/Koha/Util/OpenDocument.pm b/Koha/Util/OpenDocument.pm index 937c9bc60e..f86c44452d 100644 --- a/Koha/Util/OpenDocument.pm +++ b/Koha/Util/OpenDocument.pm @@ -19,10 +19,8 @@ package Koha::Util::OpenDocument; use Modern::Perl; -use Encode qw( decode ); -use File::Temp; use File::Basename qw( dirname ); -use OpenOffice::OODoc; +use OpenOffice::OODoc qw( odfDocument odfWorkingDirectory ); use parent qw( Exporter ); diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index c27c695ada..afecb2b052 100644 --- a/Koha/Virtualshelf.pm +++ b/Koha/Virtualshelf.pm @@ -17,9 +17,8 @@ package Koha::Virtualshelf; use Modern::Perl; -use Carp; -use C4::Auth; +use C4::Auth qw( haspermission ); use Koha::Patrons; use Koha::Database; diff --git a/Koha/Virtualshelfcontent.pm b/Koha/Virtualshelfcontent.pm index f1fd87f39d..0a7eb5b5ff 100644 --- a/Koha/Virtualshelfcontent.pm +++ b/Koha/Virtualshelfcontent.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontent; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/Virtualshelfcontents.pm b/Koha/Virtualshelfcontents.pm index 8da9bce454..23776f395e 100644 --- a/Koha/Virtualshelfcontents.pm +++ b/Koha/Virtualshelfcontents.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontents; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Virtualshelfshare.pm b/Koha/Virtualshelfshare.pm index a2e919b7b6..5f61e27a84 100644 --- a/Koha/Virtualshelfshare.pm +++ b/Koha/Virtualshelfshare.pm @@ -17,12 +17,11 @@ package Koha::Virtualshelfshare; use Modern::Perl; -use Carp; use DateTime; use DateTime::Duration; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; use base qw(Koha::Object); diff --git a/Koha/Virtualshelfshares.pm b/Koha/Virtualshelfshares.pm index 4c5eda9dcd..de709ff49c 100644 --- a/Koha/Virtualshelfshares.pm +++ b/Koha/Virtualshelfshares.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfshares; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm index 3dde3c35da..25a3b01c50 100644 --- a/Koha/Virtualshelves.pm +++ b/Koha/Virtualshelves.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelves; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/XSLT/Security.pm b/Koha/XSLT/Security.pm index eb56273ac1..09b5b58e08 100644 --- a/Koha/XSLT/Security.pm +++ b/Koha/XSLT/Security.pm @@ -36,7 +36,6 @@ Koha::XSLT::Security - Add security features to Koha::XSLT::Base =cut use Modern::Perl; -use Data::Dumper qw/Dumper/; use XML::LibXSLT; use C4::Context; diff --git a/Koha/Z3950Responder/Session.pm b/Koha/Z3950Responder/Session.pm index 006bfaf2ac..6f663b5f95 100644 --- a/Koha/Z3950Responder/Session.pm +++ b/Koha/Z3950Responder/Session.pm @@ -22,7 +22,7 @@ use Modern::Perl; use C4::Circulation qw( GetTransfers ); use C4::Context; use C4::Reserves qw( GetReserveStatus ); -use C4::Search qw(); +use C4::Search qw( new_record_from_zebra ); use Koha::Items; use Koha::Logger; diff --git a/Koha/Z3950Server.pm b/Koha/Z3950Server.pm index a4228caa50..21dc0224fa 100644 --- a/Koha/Z3950Server.pm +++ b/Koha/Z3950Server.pm @@ -17,7 +17,6 @@ package Koha::Z3950Server; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Z3950Servers.pm b/Koha/Z3950Servers.pm index 1aea08e988..96bf35245f 100644 --- a/Koha/Z3950Servers.pm +++ b/Koha/Z3950Servers.pm @@ -17,7 +17,6 @@ package Koha::Z3950Servers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/pdfformat/layout2pages.pm b/Koha/pdfformat/layout2pages.pm index 28f35a0e14..b0d4affbdc 100644 --- a/Koha/pdfformat/layout2pages.pm +++ b/Koha/pdfformat/layout2pages.pm @@ -22,12 +22,11 @@ package Koha::pdfformat::layout2pages; #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 MIME::Base64; use Modern::Perl; use utf8; use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; BEGIN { diff --git a/Koha/pdfformat/layout2pagesde.pm b/Koha/pdfformat/layout2pagesde.pm index d7d69126de..8d51905898 100644 --- a/Koha/pdfformat/layout2pagesde.pm +++ b/Koha/pdfformat/layout2pagesde.pm @@ -21,20 +21,18 @@ package Koha::pdfformat::layout2pagesde; # 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 MIME::Base64; use Modern::Perl; use utf8; use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; +our (@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(printpdf); } diff --git a/Koha/pdfformat/layout3pages.pm b/Koha/pdfformat/layout3pages.pm index 9c2456be55..fb0d557b18 100644 --- a/Koha/pdfformat/layout3pages.pm +++ b/Koha/pdfformat/layout3pages.pm @@ -22,14 +22,13 @@ package Koha::pdfformat::layout3pages; #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 MIME::Base64; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Modern::Perl; use utf8; -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; BEGIN { diff --git a/Koha/pdfformat/layout3pagesfr.pm b/Koha/pdfformat/layout3pagesfr.pm index eb3d88e84a..1003583b6d 100644 --- a/Koha/pdfformat/layout3pagesfr.pm +++ b/Koha/pdfformat/layout3pagesfr.pm @@ -23,7 +23,7 @@ package Koha::pdfformat::layout3pagesfr; use vars qw(@ISA @EXPORT); use MIME::Base64; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Modern::Perl; use utf8; diff --git a/about.pl b/about.pl index 3320b36b81..be253d2396 100755 --- a/about.pl +++ b/about.pl @@ -24,25 +24,22 @@ use CGI qw ( -utf8 ); use DateTime::TimeZone; -use File::Spec; -use File::Slurp; -use List::MoreUtils qw/ any /; -use LWP::Simple; -use Module::Load::Conditional qw(can_load); -use XML::Simple; -use Config; +use File::Slurp qw( read_file ); +use List::MoreUtils qw( any ); +use Module::Load::Conditional qw( can_load ); +use Config qw( %Config ); use Search::Elasticsearch; -use Try::Tiny; +use Try::Tiny qw( catch try ); use YAML::XS; use Encode; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_user_subpermissions ); use C4::Context; use C4::Installer::PerlModules; use Koha; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Currencies; use Koha::BackgroundJob; use Koha::BiblioFrameworks; diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 6e46a86f0f..3010c6a3a3 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -29,10 +29,9 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use C4::Members; use Koha::Acquisition::Currencies; use Koha::Patrons; diff --git a/acqui/add_user_search.pl b/acqui/add_user_search.pl index ea7b2ae9d7..1246b0149d 100755 --- a/acqui/add_user_search.pl +++ b/acqui/add_user_search.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; -use Koha::Patron::Categories; +use Koha::Patron::Categories ; my $input = CGI->new; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 7a77cfbcdf..c0e68dade3 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -119,16 +119,21 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw ( to_json ); -use C4::Auth; # get_template_and_user -use C4::Acquisition; # ModOrder -use C4::Suggestions; # ModStatus -use C4::Biblio; # AddBiblio TransformKohaToMarc -use C4::Budgets; -use C4::Items; -use C4::Output; -use C4::Log qw(logaction); -use Koha::Acquisition::Currencies; +use JSON qw( to_json ); +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( FillWithDefaultValues populate_order_with_prices ModOrder ModOrderUsers ); +use C4::Suggestions qw( ModSuggestion ); +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + TransformHtmlToXml + TransformKohaToMarc +); +use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered ); +use C4::Items qw( AddItemFromMarc ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Log qw( logaction ); +use Koha::Acquisition::Currencies qw( get_active ); use Koha::Acquisition::Orders; use Koha::Acquisition::Baskets; use C4::Barcodes; diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index c445fb8064..43abac8207 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -23,23 +23,27 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; use YAML::XS; -use List::MoreUtils qw/uniq/; +use List::MoreUtils; use Encode; use C4::Context; -use C4::Auth; -use C4::Output; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( GetImportRecordsRange GetImportRecordMarc GetImportRecordMatches sub SetImportRecordStatus SetMatchedBiblionumber SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); use C4::Matcher; -use C4::Search qw/FindDuplicate/; -use C4::Acquisition; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Budgets; -use C4::Acquisition; +use C4::Search qw( FindDuplicate ); +use C4::Acquisition qw( populate_order_with_prices ); +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + GetMarcPrice + GetMarcQuantity + TransformHtmlToXml +); +use C4::Items qw( PrepareItemrecordDisplay sub AddItemFromMarc ); +use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget GetBudgetByCode ); +use C4::Acquisition qw( populate_order_with_prices ); use C4::Suggestions; # GetSuggestion use C4::Members; diff --git a/acqui/ajax-getauthvaluedropbox.pl b/acqui/ajax-getauthvaluedropbox.pl index 41c0a8db41..6d7034b823 100755 --- a/acqui/ajax-getauthvaluedropbox.pl +++ b/acqui/ajax-getauthvaluedropbox.pl @@ -48,8 +48,8 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Charset; -use C4::Auth qw/check_api_auth/; +use C4::Charset qw( NormalizeString ); +use C4::Auth qw( check_api_auth ); use Koha::AuthorisedValues; my $query = CGI->new(); diff --git a/acqui/basket.pl b/acqui/basket.pl index 09545ee3cc..fbf730c3dd 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -21,25 +21,22 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Output qw( output_html_with_http_headers output_and_exit ); use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Budgets; -use C4::Contract; -use C4::Biblio; -use C4::Items; -use C4::Suggestions; +use C4::Acquisition qw( GetBasket CanUserManageBasket GetBasketAsCSV NewBasket NewBasketgroup ModBasket ReopenBasket ModBasketUsers GetBasketgroup GetBasketgroups GetBasketUsers GetOrders GetOrder get_rounded_price ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); +use C4::Contract qw( GetContract ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Biblios; use Koha::Acquisition::Baskets; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; use Koha::Libraries; -use C4::Letters qw/SendAlerts/; -use Date::Calc qw/Add_Delta_Days/; +use C4::Letters qw( SendAlerts ); +use Date::Calc qw( Add_Delta_Days ); use Koha::Database; -use Koha::EDI qw( create_edi_order get_edifact_ean ); +use Koha::EDI qw( create_edi_order ); use Koha::CsvProfiles; use Koha::Patrons; diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 24a7fc8b51..2d4241e025 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -44,15 +44,15 @@ =head1 CGI PARAMETERS =cut use Modern::Perl; -use Carp; +use Carp qw( croak ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use File::Spec; -use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV get_rounded_price/; -use Koha::EDI qw/create_edi_order get_edifact_ean/; +use C4::Acquisition qw( GetOrders GetOrder get_rounded_price GetBasket GetBasketgroup GetBasketsByBasketgroup GetBasketgroups GetBasketsByBookseller ModBasket CloseBasketgroup GetBasketGroupAsCSV DelBasketgroup ReOpenBasketgroup ModBasketgroup NewBasket NewBasketgroup ); +use Koha::EDI qw( get_edifact_ean create_edi_order ); use Koha::Biblioitems; use Koha::Acquisition::Booksellers; diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 6e76177cdb..a7cd098b64 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -48,10 +48,10 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/; -use C4::Contract qw/GetContracts/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetBasket ModBasket ModBasketHeader NewBasket ); +use C4::Contract qw( GetContracts GetContract ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Baskets; diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 8528a00a34..d3d09dd56d 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -52,13 +52,12 @@ =head1 CGI PARAMETERS =cut use Modern::Perl; -use C4::Auth; -use C4::Biblio; -use C4::Budgets; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Acquisition qw/ GetBasketsInfosByBookseller CanUserManageBasket /; +use C4::Acquisition qw( GetBasket GetBasketsInfosByBookseller CanUserManageBasket GetBasketgroup ); use C4::Context; use Koha::Acquisition::Booksellers; diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl index cfa9ec960c..48e5b41423 100755 --- a/acqui/cancelorder.pl +++ b/acqui/cancelorder.pl @@ -32,9 +32,8 @@ =head1 DESCRIPTION use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Baskets; my $input = CGI->new; diff --git a/acqui/check_budget_total.pl b/acqui/check_budget_total.pl index be4e55350c..46379fa005 100755 --- a/acqui/check_budget_total.pl +++ b/acqui/check_budget_total.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget ); =head1 DESCRIPTION diff --git a/acqui/check_uniqueness.pl b/acqui/check_uniqueness.pl index 37c4a22204..b665b34c3a 100755 --- a/acqui/check_uniqueness.pl +++ b/acqui/check_uniqueness.pl @@ -32,9 +32,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; -use C4::Output; -use C4::Items; +use JSON qw( to_json ); +use C4::Output qw( output_with_http_headers ); +use C4::Items qw( SearchItems ); my $input = CGI->new; my @field = $input->multi_param('field[]'); diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl index 7bbefea2ea..1964b41418 100755 --- a/acqui/duplicate_orders.pl +++ b/acqui/duplicate_orders.pl @@ -21,14 +21,14 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition qw(GetHistory); -use C4::Budgets qw(GetBudgetPeriods GetBudgetHierarchy CanUserUseBudget); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Acquisition qw( GetHistory ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget GetBudgetPeriods GetBudgetPeriod ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Currencies; use Koha::Acquisition::Orders; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $basketno = $input->param('basketno'); diff --git a/acqui/edi_ean.pl b/acqui/edi_ean.pl index 1e056557c9..e95dbdfe8a 100755 --- a/acqui/edi_ean.pl +++ b/acqui/edi_ean.pl @@ -23,9 +23,8 @@ # use Modern::Perl; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use CGI; my $schema = Koha::Database->new()->schema(); diff --git a/acqui/edifactmsgs.pl b/acqui/edifactmsgs.pl index 8e603bb9fd..179b23423f 100755 --- a/acqui/edifactmsgs.pl +++ b/acqui/edifactmsgs.pl @@ -20,11 +20,10 @@ use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; -use Koha::EDI qw(process_invoice); +use Koha::EDI qw( process_invoice ); my $q = CGI->new; my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( diff --git a/acqui/edimsg.pl b/acqui/edimsg.pl index 46206ea5f3..8ac9b8039e 100755 --- a/acqui/edimsg.pl +++ b/acqui/edimsg.pl @@ -19,10 +19,10 @@ use Modern::Perl; use CGI; -use Koha::Database; +use Koha::Databas; use C4::Koha; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $q = CGI->new; my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 961e3d566f..95759c7917 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -22,19 +22,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use C4::Context; -use C4::Acquisition; -use C4::Biblio; -use C4::Items; +use C4::Acquisition qw( GetInvoice GetOrder populate_order_with_prices ModReceiveOrder ); +use C4::Biblio qw( GetFrameworkCode GetMarcFromKohaField TransformHtmlToXml ); +use C4::Items qw( GetMarcItem ModItemFromMarc AddItemFromMarc ); use C4::Search; use Koha::Number::Price; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; -use List::MoreUtils qw/any/; my $input=CGI->new; my $flagsrequired = {acquisition => 'order_receive'}; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e652fb9225..cbb371d4df 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -51,12 +51,11 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Acquisition; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetHistory ); use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $do_search = $input->param('do_search') || 0; diff --git a/acqui/invoice-files.pl b/acqui/invoice-files.pl index a470c9f53a..d4e43cfc83 100755 --- a/acqui/invoice-files.pl +++ b/acqui/invoice-files.pl @@ -30,9 +30,9 @@ =head1 DESCRIPTION use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetInvoice GetInvoiceDetails ); use Koha::Misc::Files; my $input = CGI->new; diff --git a/acqui/invoice.pl b/acqui/invoice.pl index dfc4ab4d53..eaf804d51e 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -29,14 +29,14 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Acquisition qw( CloseInvoice ReopenInvoice ModInvoice MergeInvoices DelInvoice GetInvoice GetInvoiceDetails get_rounded_price ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; -use Koha::DateUtils; +use Koha::Acquisition::Currencies qw( get_active ); +use Koha::DateUtils qw( output_pref ); use Koha::Misc::Files; use Koha::Acquisition::Invoice::Adjustments; diff --git a/acqui/invoices.pl b/acqui/invoices.pl index 42e6328cca..b0e1db2bef 100755 --- a/acqui/invoices.pl +++ b/acqui/invoices.pl @@ -29,12 +29,12 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Acquisition qw/GetInvoices/; -use C4::Budgets; -use Koha::DateUtils; +use C4::Acquisition qw( GetInvoices GetInvoice ); +use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Booksellers; my $input = CGI->new; diff --git a/acqui/lateorders-export.pl b/acqui/lateorders-export.pl index 57a080dbd3..a871777435 100755 --- a/acqui/lateorders-export.pl +++ b/acqui/lateorders-export.pl @@ -19,8 +19,8 @@ use CGI qw ( -utf8 ); use Encode; -use C4::Auth; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( GetOrder ); use C4::Output; use C4::Context; diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 67354b2a14..5999ab0a26 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -45,14 +45,12 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Acquisition; -use C4::Letters; -use Koha::DateUtils; -use Koha::Acquisition::Orders; +use C4::Letters qw( SendAlerts GetLetters ); +use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::Acquisition::Orders qw( filter_by_lates ); use Koha::CsvProfiles; my $input = CGI->new; diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl index f529d4b782..258fb63c6a 100755 --- a/acqui/modordernotes.pl +++ b/acqui/modordernotes.pl @@ -29,9 +29,9 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetOrder GetBasket ModOrder ); use Koha::Acquisition::Booksellers; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 0949fe0a34..22c7c3c04f 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -68,24 +68,30 @@ =head1 CGI PARAMETERS use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Budgets; - -use C4::Acquisition; -use C4::Contract; -use C4::Suggestions; # GetSuggestion -use C4::Biblio; # GetBiblioData GetMarcPrice -use C4::Items; #PrepareItemRecord -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget GetBudgetHierarchy CanUserUseBudget ); + +use C4::Acquisition qw( GetOrder GetBasket FillWithDefaultValues GetOrderUsers ); +use C4::Contract qw( GetContract ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfo ); +use C4::Biblio qw( + AddBiblio + GetBiblioData + GetMarcBiblio + GetMarcFromKohaField + GetMarcPrice + GetMarcStructure + IsMarcStructureInternal +); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Members; -use C4::Search qw/FindDuplicate/; +use C4::Search qw( FindDuplicate ); #needed for z3950 import: -use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus SetMatchedBiblionumber/; +use C4::ImportBatch qw( SetImportRecordStatus SetMatchedBiblionumber GetImportRecordMarc ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; +use Koha::Acquisition::Currencies qw( get_active ); use Koha::BiblioFrameworks; use Koha::DateUtils qw( dt_from_string ); use Koha::MarcSubfieldStructures; diff --git a/acqui/newordersubscription.pl b/acqui/newordersubscription.pl index 7d3e8ba40d..e8d776598b 100755 --- a/acqui/newordersubscription.pl +++ b/acqui/newordersubscription.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Auth; +use C4::Acquisition qw( GetBasket ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( SearchSubscriptions subscriptionCurrentlyOnOrder check_routing ); use Koha::Acquisition::Booksellers; diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl index f43e201c06..0ee10365cb 100755 --- a/acqui/newordersuggestion.pl +++ b/acqui/newordersuggestion.pl @@ -91,10 +91,9 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Suggestions; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( ConnectSuggestionAndBiblio SearchSuggestion ); use C4::Budgets; use Koha::Acquisition::Booksellers; diff --git a/acqui/ordered.pl b/acqui/ordered.pl index 0f4e8c6519..84b49550c1 100755 --- a/acqui/ordered.pl +++ b/acqui/ordered.pl @@ -30,10 +30,10 @@ =head1 DESCRIPTION use C4::Context; use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Invoice::Adjustments; -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); my $dbh = C4::Context->dbh; my $input = CGI->new; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 177b17023d..f684a8ed7a 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -62,18 +62,16 @@ =head1 CGI PARAMETERS use CGI qw ( -utf8 ); use C4::Context; -use C4::Acquisition; -use C4::Auth; -use C4::Output; -use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /; +use C4::Acquisition qw( GetInvoice ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudget GetBudgetPeriods GetBudgetPeriod GetBudgetHierarchy CanUserUseBudget ); use C4::Members; -use C4::Items; -use C4::Biblio; -use C4::Suggestions; -use C4::Koha; +use C4::Biblio qw( GetMarcStructure ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; +use Koha::Acquisition::Currencies qw( get_active ); use Koha::Acquisition::Orders; use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 90ccbe0006..d00d9bdb1e 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -56,23 +56,18 @@ =head1 CGI PARAMETERS use Modern::Perl; -use C4::Auth; -use C4::Acquisition; -use C4::Budgets; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( CancelReceipt GetInvoice GetInvoiceDetails get_rounded_price ); +use C4::Budgets qw( _round GetBudget GetBudgetByOrderNumber GetBudgetName ); use CGI qw ( -utf8 ); -use C4::Output; -use C4::Suggestions; +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Bookseller; use Koha::Acquisition::Orders; use Koha::Biblios; -use Koha::DateUtils; -use Koha::Biblios; -use JSON; my $input = CGI->new; diff --git a/acqui/parcels.pl b/acqui/parcels.pl index e5d4330a31..cd6e2562b1 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -68,11 +68,11 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Acquisition; -use C4::Budgets; +use C4::Acquisition qw( GetInvoices GetInvoice AddInvoice ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use Koha::Acquisition::Booksellers; use Koha::DateUtils qw( output_pref dt_from_string ); diff --git a/acqui/showorder.pl b/acqui/showorder.pl index 89255c94e7..da7cce55b1 100755 --- a/acqui/showorder.pl +++ b/acqui/showorder.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Orders; use Koha::Patrons; diff --git a/acqui/spent.pl b/acqui/spent.pl index b865648c55..b8269d08df 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -30,11 +30,11 @@ =head1 DESCRIPTION =cut use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); use Koha::Acquisition::Invoice::Adjustments; my $dbh = C4::Context->dbh; diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 63d0b33af9..6766a1adef 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -41,10 +41,9 @@ =head1 CGI PARAMETERS =cut use Modern::Perl; -use C4::Auth; -use C4::Contract; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Contract qw( GetContracts GetContract ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Budgets; diff --git a/acqui/transferorder.pl b/acqui/transferorder.pl index 433821b587..72f9087f82 100755 --- a/acqui/transferorder.pl +++ b/acqui/transferorder.pl @@ -22,10 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Acquisition; +use C4::Acquisition qw( GetOrder GetBasket TransferOrder GetBasketsByBookseller SearchOrders ); use Koha::Acquisition::Booksellers; my $input = CGI->new; diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index 2ee68afdc5..770f8fc22f 100755 --- a/acqui/uncertainprice.pl +++ b/acqui/uncertainprice.pl @@ -45,12 +45,11 @@ =head1 CGI PARAMETERS use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Acquisition qw/SearchOrders GetOrder ModOrder/; -use C4::Biblio qw/GetBiblioData/; +use C4::Acquisition qw( SearchOrders GetOrder ModOrder ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Baskets; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 60c65e4967..b195c88fb6 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -47,11 +47,9 @@ =head1 CGI PARAMETERS =cut use Modern::Perl; -use List::Util; use C4::Context; -use C4::Auth; +use C4::Auth qw( checkauth ); -use C4::Biblio; use C4::Output; use Koha::Acquisition::Bookseller::Contacts; diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index 10399d5755..d596cbf227 100755 --- a/acqui/z3950_search.pl +++ b/acqui/z3950_search.pl @@ -22,11 +22,10 @@ use Modern::Perl; use CGI qw/-utf8/; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search ); use Koha::Acquisition::Booksellers; use Koha::BiblioFrameworks; diff --git a/admin/add_user_search.pl b/admin/add_user_search.pl index 027eb15e68..032301a6d7 100755 --- a/admin/add_user_search.pl +++ b/admin/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; diff --git a/admin/additional-fields.pl b/admin/additional-fields.pl index 082854a3d4..78dd1a8fc4 100755 --- a/admin/additional-fields.pl +++ b/admin/additional-fields.pl @@ -18,9 +18,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AdditionalFields; my $input = CGI->new; diff --git a/admin/admin-home.pl b/admin/admin-home.pl index 9a076b0512..73f2cc8edf 100755 --- a/admin/admin-home.pl +++ b/admin/admin-home.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Plugins; my $query = CGI->new; diff --git a/admin/adveditorshortcuts.pl b/admin/adveditorshortcuts.pl index 4b78a8676f..0fbe51c160 100755 --- a/admin/adveditorshortcuts.pl +++ b/admin/adveditorshortcuts.pl @@ -34,13 +34,11 @@ =head1 FUNCTIONS =cut use Modern::Perl; -use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; use Koha::KeyboardShortcuts; my $input = CGI->new; diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 2d4e7c43a9..b5932725b5 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -47,15 +47,14 @@ =head1 admin/aqbudgetperiods.pl use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Database; use C4::Koha; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( GetBudgetPeriod GetBudgetPeriods ModBudgetPeriod AddBudgetPeriod GetBudgets DelBudgetPeriod CloneBudgetPeriod MoveOrders ); use Koha::Acquisition::Currencies; my $dbh = C4::Context->dbh; @@ -176,7 +175,7 @@ =head1 admin/aqbudgetperiods.pl my $mark_original_budget_as_inactive = $input->param('mark_original_budget_as_inactive'); my $reset_all_budgets = $input->param('reset_all_budgets'); - my $new_budget_period_id = C4::Budgets::CloneBudgetPeriod( + my $new_budget_period_id = CloneBudgetPeriod( { budget_period_id => $budget_period_id, budget_period_startdate => $budget_period_startdate, @@ -198,7 +197,7 @@ =head1 admin/aqbudgetperiods.pl my $budget_period = GetBudgetPeriod($budget_period_id); my $active_budget_periods = - C4::Budgets::GetBudgetPeriods( { budget_period_active => 1 } ); + GetBudgetPeriods( { budget_period_active => 1 } ); # Remove the budget period from the list $active_budget_periods = @@ -235,7 +234,7 @@ =head1 admin/aqbudgetperiods.pl elsif ( $op eq 'close_confirmed' ) { my $to_budget_period_id = $input->param('to_budget_period_id'); my $move_remaining_unspent = $input->param('move_remaining_unspent'); - my $report = C4::Budgets::MoveOrders( + my $report = MoveOrders( { from_budget_period_id => $budget_period_id, to_budget_period_id => $to_budget_period_id, diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 0cf6527110..4ed48d47d1 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -22,16 +22,26 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; use Koha::Database; -use C4::Auth qw/get_user_subpermissions/; -use C4::Auth; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( + AddBudget + BudgetHasChildren + CanUserModifyBudget + CanUserUseBudget + DelBudget + GetBudget + GetBudgetAuthCats + GetBudgetHierarchy + GetBudgetPeriod + GetBudgetPeriods + GetBudgetUsers + ModBudget + ModBudgetUsers +); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers output_and_exit ); use Koha::Acquisition::Currencies; use Koha::Patrons; diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 891608732e..83e99d7d0c 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -23,10 +23,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Contract; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Contract qw( + AddContract + DelContract + GetContract + GetContracts + ModContract +); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Booksellers; diff --git a/admin/aqplan.pl b/admin/aqplan.pl index a539b20e72..64b6cd05ab 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -22,17 +22,24 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; -use Date::Calc qw/Delta_YMD Easter_Sunday Today Decode_Date_EU/; -use Date::Manip qw/ ParseDate UnixDate DateCalc/; +use Date::Calc qw( Delta_YMD ); +use Date::Manip qw( DateCalc UnixDate ); use Text::CSV_XS; -use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( + CanUserUseBudget + GetBudgetAuthCats + GetBudgetHierarchy + GetBudgetPeriod + GetBudgetsPlanCell + GetCols + GetPeriodsCount + HideCols + ModBudgetPlan +); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Acquisition::Currencies; our $input = CGI->new; diff --git a/admin/audio_alerts.pl b/admin/audio_alerts.pl index 4f8de64ced..ed3a9a5e09 100755 --- a/admin/audio_alerts.pl +++ b/admin/audio_alerts.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AudioAlert; use Koha::AudioAlerts; diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index fcb419eed5..2fbe31e22b 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -18,11 +18,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Koha; use Koha::Authority::Types; use Koha::AuthorisedValues; diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index 8a9ab47a2a..1c952d58a5 100755 --- a/admin/auth_tag_structure.pl +++ b/admin/auth_tag_structure.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Authority::Types; diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index cb5988021d..f772a84be7 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -20,12 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; +use C4::Koha qw( getitemtypeimagelocation ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::AuthorisedValueCategories; diff --git a/admin/authtypes.pl b/admin/authtypes.pl index 3b2f86453f..3fea873e0d 100755 --- a/admin/authtypes.pl +++ b/admin/authtypes.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Authorities; use Koha::Authority::Types; diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl index 413bb2e225..9a474857b6 100755 --- a/admin/background_jobs.pl +++ b/admin/background_jobs.pl @@ -17,12 +17,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw( decode_json ); -use Try::Tiny; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::BackgroundJobs; use Koha::Virtualshelves; diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index 0d8a6a4b0b..32f2ac11eb 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::BiblioFramework; use Koha::BiblioFrameworks; diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index 455c04ad27..5a2a688c70 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( DeleteBranchTransferLimits CreateBranchTransferLimit IsBranchTransferAllowed ); my $input = CGI->new; diff --git a/admin/branches.pl b/admin/branches.pl index 282c547afe..b821f2008a 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -21,11 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; use Koha::Database; diff --git a/admin/cash_registers.pl b/admin/cash_registers.pl index ae39c11986..db55b2aadc 100755 --- a/admin/cash_registers.pl +++ b/admin/cash_registers.pl @@ -21,13 +21,13 @@ use warnings; use CGI; -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Koha::Libraries; use C4::Koha; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Cash::Registers; my $cgi = CGI->new(); diff --git a/admin/categories.pl b/admin/categories.pl index d8d8513b91..368960f9cd 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -22,12 +22,12 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Form::MessagingPreferences; use Koha::Patrons; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; use Koha::Libraries; diff --git a/admin/check_budget_parent.pl b/admin/check_budget_parent.pl index 1c98bd2095..2274679f3b 100755 --- a/admin/check_budget_parent.pl +++ b/admin/check_budget_parent.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( CheckBudgetParent GetBudget ); =head1 DESCRIPTION diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index fbd79b2299..649f0d6000 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget GetBudgetPeriod ); =head1 DESCRIPTION diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 126e90fdff..3dcda21432 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -19,11 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Biblio; my $input = CGI->new; diff --git a/admin/cities.pl b/admin/cities.pl index c7b03b0271..f16c9d7a50 100755 --- a/admin/cities.pl +++ b/admin/cities.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Cities; diff --git a/admin/classsources.pl b/admin/classsources.pl index cbaf449926..d8b9733f26 100755 --- a/admin/classsources.pl +++ b/admin/classsources.pl @@ -21,12 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::ClassSortRoutine; -use C4::ClassSplitRoutine; +use C4::Output qw( output_html_with_http_headers ); +use C4::ClassSortRoutine qw( GetSortRoutineNames ); +use C4::ClassSplitRoutine qw( GetSplitRoutineNames ); use Koha::ClassSources; use Koha::ClassSortRules; use Koha::ClassSplitRules; diff --git a/admin/clone-rules.pl b/admin/clone-rules.pl index d6acf898b2..9dc78d8094 100755 --- a/admin/clone-rules.pl +++ b/admin/clone-rules.pl @@ -28,9 +28,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::CirculationRules; my $input = CGI->new; diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index 3d9d68e140..55d312d4f9 100755 --- a/admin/columns_settings.pl +++ b/admin/columns_settings.pl @@ -2,9 +2,9 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Utils::DataTables::TablesSettings qw( get_modules ); my $input = CGI->new; diff --git a/admin/credit_types.pl b/admin/credit_types.pl index afbe72a82e..27f6edf2ad 100755 --- a/admin/credit_types.pl +++ b/admin/credit_types.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::CreditType; use Koha::Account::CreditTypes; diff --git a/admin/currency.pl b/admin/currency.pl index d3dfab5e45..28dc2d2673 100755 --- a/admin/currency.pl +++ b/admin/currency.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Currencies; diff --git a/admin/debit_types.pl b/admin/debit_types.pl index 887e1e8728..40210479a1 100755 --- a/admin/debit_types.pl +++ b/admin/debit_types.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::DebitType; use Koha::Account::DebitTypes; diff --git a/admin/desks.pl b/admin/desks.pl index e401902084..bc087a3c9d 100755 --- a/admin/desks.pl +++ b/admin/desks.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Desks; diff --git a/admin/didyoumean.pl b/admin/didyoumean.pl index 9cafc13f77..b584c5b299 100755 --- a/admin/didyoumean.pl +++ b/admin/didyoumean.pl @@ -3,11 +3,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SuggestionEngine; -use Module::Load::Conditional qw(can_load); -use JSON; +use Module::Load::Conditional qw( can_load ); +use JSON qw( from_json ); my $input = CGI->new; diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl index 288fec519c..293f7ef666 100755 --- a/admin/edi_accounts.pl +++ b/admin/edi_accounts.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::Plugins; diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl index a7edcf25f2..87ebe458c7 100755 --- a/admin/edi_ean_accounts.pl +++ b/admin/edi_ean_accounts.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; my $input = CGI->new(); diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index bd5ee8331b..735915d49f 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -22,8 +22,8 @@ use CGI qw ( -utf8 ); use CGI::Cookie; use C4::Context; -use C4::Auth qw/check_cookie_auth/; -use C4::ImportExportFramework; +use C4::Auth qw( check_cookie_auth ); +use C4::ImportExportFramework qw( createODS ExportFramework ImportFramework ); my %cookies = CGI::Cookie->fetch(); my $authenticated = 0; diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl index ae6692d058..67b71a32e2 100755 --- a/admin/item_circulation_alerts.pl +++ b/admin/item_circulation_alerts.pl @@ -18,15 +18,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use File::Basename; -use Encode; -use JSON; +use JSON qw( encode_json ); #use Data::Dump 'pp'; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::ItemCirculationAlertPreference; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::ItemTypes; use Koha::Patron::Categories; diff --git a/admin/items_search_field.pl b/admin/items_search_field.pl index ab48babd86..569dce65bb 100755 --- a/admin/items_search_field.pl +++ b/admin/items_search_field.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField); diff --git a/admin/items_search_fields.pl b/admin/items_search_fields.pl index ac2548642b..0e62eb67c6 100755 --- a/admin/items_search_fields.pl +++ b/admin/items_search_fields.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField); diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 2370de93e1..8652c3de9f 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -25,12 +25,11 @@ =head1 admin/itemtypes.pl use Modern::Perl; use CGI qw ( -utf8 ); -use File::Spec; -use C4::Koha; +use C4::Koha qw( getImageSets GetAuthorisedValues ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ItemTypes; use Koha::ItemType; use Koha::Localizations; diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl index 842364dadb..e731cbebe2 100755 --- a/admin/koha2marclinks.pl +++ b/admin/koha2marclinks.pl @@ -22,9 +22,8 @@ use CGI qw ( -utf8 ); use Koha::Database; -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::BiblioFrameworks; use Koha::Caches; use Koha::MarcSubfieldStructures; diff --git a/admin/library_groups.pl b/admin/library_groups.pl index cf561c863b..5284a881f4 100755 --- a/admin/library_groups.pl +++ b/admin/library_groups.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::Library::Group; diff --git a/admin/localization.pl b/admin/localization.pl index 3c296c6fc7..58205d8df7 100755 --- a/admin/localization.pl +++ b/admin/localization.pl @@ -18,8 +18,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Localization; use Koha::Localizations; diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 7ee7e269b2..636c3add4e 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 573abbca7c..7ce19f99ac 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Caches; diff --git a/admin/matching-rules.pl b/admin/matching-rules.pl index 5241b2bab5..3cdbbb7b6f 100755 --- a/admin/matching-rules.pl +++ b/admin/matching-rules.pl @@ -21,10 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use C4::Matcher qw/valid_normalization_routines/; my $script_name = "/cgi-bin/koha/admin/matching-rules.pl"; diff --git a/admin/oai_set_mappings.pl b/admin/oai_set_mappings.pl index e8b8b7eafa..02103960f8 100755 --- a/admin/oai_set_mappings.pl +++ b/admin/oai_set_mappings.pl @@ -33,11 +33,10 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::OAI::Sets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::OAI::Sets qw( GetOAISet GetOAISetMappings ModOAISetMappings ); -use Data::Dumper; my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/admin/oai_sets.pl b/admin/oai_sets.pl index 2d5aa50883..015d713604 100755 --- a/admin/oai_sets.pl +++ b/admin/oai_sets.pl @@ -29,11 +29,10 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::OAI::Sets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::OAI::Sets qw( AddOAISet DelOAISet GetOAISet GetOAISets ModOAISet ); -use Data::Dumper; my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/admin/overdrive.pl b/admin/overdrive.pl index ef12d60ed8..3bff6dae74 100755 --- a/admin/overdrive.pl +++ b/admin/overdrive.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::Library::OverDriveInfos; diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index f0c1654cc3..2cf2bf6f3b 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -22,12 +22,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patron::Attribute::Types; use Koha::AuthorisedValues; diff --git a/admin/preferences.pl b/admin/preferences.pl index f3879d7cb9..49d06ad996 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -20,20 +20,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Languages qw(getTranslatedLanguages); -use C4::ClassSource; -use C4::Log; -use C4::Output; +use C4::Koha qw( getallthemes ); +use C4::Languages qw( getTranslatedLanguages ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use C4::Output qw( output_html_with_http_headers ); use C4::Templates; use Koha::Acquisition::Currencies; -use File::Spec; use IO::File; use YAML::XS; use Encode; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); # use Smart::Comments; # diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl index 4f71920823..1058e941e5 100755 --- a/admin/searchengine/elasticsearch/mappings.pl +++ b/admin/searchengine/elasticsearch/mappings.pl @@ -17,9 +17,8 @@ use Modern::Perl; use CGI; -use Scalar::Util qw(looks_like_number); +use Scalar::Util qw( looks_like_number ); use List::Util qw( first ); -use C4::Koha; use C4::Output; use C4::Auth; use C4::Log; @@ -30,8 +29,8 @@ use Koha::SearchFields; use Koha::Caches; -use Try::Tiny; -use Module::Load::Conditional qw(can_load); +use Try::Tiny qw( catch try ); +use Module::Load::Conditional qw( can_load ); my $input = CGI->new; diff --git a/admin/share_content.pl b/admin/share_content.pl index b4c7e0bc6d..89dd4e0cdb 100755 --- a/admin/share_content.pl +++ b/admin/share_content.pl @@ -18,11 +18,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; +use JSON qw( to_json ); use HTTP::Request; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SharedContent; diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 5c7cc22b35..7da7497d3a 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Logger; use Koha::Libraries; diff --git a/admin/sms_providers.pl b/admin/sms_providers.pl index ea02f152bb..a259b8627c 100755 --- a/admin/sms_providers.pl +++ b/admin/sms_providers.pl @@ -22,8 +22,8 @@ use CGI; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SMS::Provider; use Koha::SMS::Providers; diff --git a/admin/smtp_servers.pl b/admin/smtp_servers.pl index 19458a23a4..8c53bfc4be 100755 --- a/admin/smtp_servers.pl +++ b/admin/smtp_servers.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::SMTP::Servers; diff --git a/admin/sru_modmapping.pl b/admin/sru_modmapping.pl index 298a4f5789..67023772e3 100755 --- a/admin/sru_modmapping.pl +++ b/admin/sru_modmapping.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); # Initialize CGI, template diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index e2e690c6f0..1eb54552b1 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -43,13 +43,13 @@ =head1 systempreferences.pl use Modern::Perl; use CGI qw ( -utf8 ); -use MIME::Base64; -use C4::Auth; +use MIME::Base64 qw( encode_base64 ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Languages qw(getTranslatedLanguages); -use C4::ClassSource; -use C4::Output; +use C4::Koha qw( getallthemes ); +use C4::Languages qw( getTranslatedLanguages ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use C4::Output qw( output_html_with_http_headers ); use YAML::XS; my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml) diff --git a/admin/transfer_limits.pl b/admin/transfer_limits.pl index 8c67bdaab2..dfa7f6309c 100755 --- a/admin/transfer_limits.pl +++ b/admin/transfer_limits.pl @@ -20,12 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation - qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $input = CGI->new; diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl index 935be87ea8..29452ca581 100755 --- a/admin/transport-cost-matrix.pl +++ b/admin/transport-cost-matrix.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; -use C4::HoldsQueue qw(TransportCostMatrix UpdateTransportCostMatrix); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::HoldsQueue qw( TransportCostMatrix UpdateTransportCostMatrix ); use Koha::Libraries; -use Data::Dumper; my $input = CGI->new; diff --git a/admin/usage_statistics.pl b/admin/usage_statistics.pl index 635704fab3..582e92aa1e 100755 --- a/admin/usage_statistics.pl +++ b/admin/usage_statistics.pl @@ -18,9 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::DateUtils qw( dt_from_string output_pref ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( output_pref ); use Koha::Libraries; my $query = CGI->new; diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 54b85d9715..d7dd4161c5 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -27,8 +27,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::Z3950Servers; diff --git a/api/v1/app.pl b/api/v1/app.pl index 93f57f207f..f841c6088b 100755 --- a/api/v1/app.pl +++ b/api/v1/app.pl @@ -17,5 +17,5 @@ use Modern::Perl; -require Mojolicious::Commands; +use Mojolicious::Commands; Mojolicious::Commands->start_app('Koha::REST::V1'); diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index ed6774f599..6927765642 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -21,11 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Acquisition; -use C4::Koha; use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index 691528215d..d46f68d79a 100755 --- a/authorities/authorities-home.pl +++ b/authorities/authorities-home.pl @@ -20,16 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use POSIX qw( ceil ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::Acquisition; -use C4::Koha; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit pagination_bar output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( DelAuthority ); use C4::Search::History; use Koha::Authority::Types; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index 4e0ecb555f..33c37aaf4f 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -21,16 +21,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::ImportBatch; #GetImportRecordMarc +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( GetAuthority ); +use C4::ImportBatch qw( GetImportRecordMarc ); use C4::Context; -use C4::Koha; -use Date::Calc qw(Today); +use Date::Calc qw( Today ); use MARC::File::USMARC; use MARC::File::XML; -use C4::Biblio; +use C4::Biblio qw( TransformHtmlToMarc ); use Koha::Authority::Types; use Koha::ItemTypes; use vars qw( $tagslib); diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 478a1bf1fc..1dae908f35 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/authorities/blinddetail-biblio-search.pl @@ -38,13 +38,11 @@ =head1 FUNCTIONS use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Koha; use Koha::Authorities; use Koha::Authority::Types; diff --git a/authorities/detail-biblio-search.pl b/authorities/detail-biblio-search.pl index 66bf8ce2fe..0eb510ad9c 100755 --- a/authorities/detail-biblio-search.pl +++ b/authorities/detail-biblio-search.pl @@ -38,13 +38,11 @@ =head1 FUNCTIONS use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Koha; # use C4::Biblio; # use C4::Catalogue; diff --git a/authorities/detail.pl b/authorities/detail.pl index be86a811d4..1fefaa9547 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -38,12 +38,11 @@ =head1 FUNCTIONS use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority GenerateHierarchy ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; use C4::Koha; use Koha::Authorities; diff --git a/authorities/export.pl b/authorities/export.pl index b55ee7ddab..0703da840b 100755 --- a/authorities/export.pl +++ b/authorities/export.pl @@ -2,9 +2,9 @@ use Modern::Perl; use C4::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( GetAuthority ); use CGI qw ( -utf8 ); my $query = CGI->new; diff --git a/authorities/merge.pl b/authorities/merge.pl index 3b5f6c0fce..9b29f06ee6 100755 --- a/authorities/merge.pl +++ b/authorities/merge.pl @@ -19,11 +19,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::AuthoritiesMarc; -use C4::Koha; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ModAuthority DelAuthority ); +use C4::Biblio qw( TransformHtmlToMarc ); use Koha::Authority::MergeRequests; use Koha::Authority::Types; diff --git a/authorities/merge_ajax.pl b/authorities/merge_ajax.pl index 6ed427891c..2bd17d0064 100755 --- a/authorities/merge_ajax.pl +++ b/authorities/merge_ajax.pl @@ -4,11 +4,11 @@ use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before CGI parses the POST request -use JSON; +use JSON qw( encode_json ); use C4::Context; -use C4::Auth qw/check_cookie_auth/; -use C4::AuthoritiesMarc; +use C4::Auth qw( check_cookie_auth ); +use C4::AuthoritiesMarc qw( GetTagsLabels ); my %cookies = CGI::Cookie->fetch; my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' }); diff --git a/authorities/ysearch.pl b/authorities/ysearch.pl index 92de7b1807..fc3d51fa85 100755 --- a/authorities/ysearch.pl +++ b/authorities/ysearch.pl @@ -29,12 +29,12 @@ =head1 ysearch.pl use CGI qw ( -utf8 ); use Modern::Perl; -use JSON; +use JSON qw( to_json ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use C4::Output; +use C4::Charset qw( nsb_clean ); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( output_with_http_headers ); use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; diff --git a/basket/basket.pl b/basket/basket.pl index 44727d2364..30f73b8783 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -19,10 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::Biblios; diff --git a/basket/downloadcart.pl b/basket/downloadcart.pl index f8478770c2..c1e80bf40d 100755 --- a/basket/downloadcart.pl +++ b/basket/downloadcart.pl @@ -20,14 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); +use Encode qw( encode ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 9e273b1f45..1ea56fce6a 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -18,15 +18,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use Carp; -use Try::Tiny; - -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; -use C4::Templates (); +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Templates; use Koha::Email; use Koha::Token; diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index d26780a8e2..969aca17a0 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -36,15 +36,13 @@ =head1 FUNCTIONS use Modern::Perl; use HTML::Entities; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Serials; # CountSubscriptionFromBiblionumber -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Serials qw( CountSubscriptionFromBiblionumber GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); use Koha::Biblios; use Koha::Patrons; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index e275077ac2..7ddbbd40dd 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -47,21 +47,25 @@ =head1 FUNCTIONS use CGI qw ( -utf8 ); use HTML::Entities; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; -use MARC::Record; -use C4::Biblio; -use C4::Items; -use C4::Acquisition; -use C4::Serials; #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( + GetAuthorisedValueDesc + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure +); +use C4::Serials qw( CountSubscriptionFromBiblionumber GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); use Koha::Biblios; use Koha::BiblioFrameworks; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Virtualshelves; use List::MoreUtils qw( uniq ); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index d4ab19edba..b06c90a866 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -20,26 +20,31 @@ use CGI qw ( -utf8 ); use HTML::Entities; -use Try::Tiny; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Serials; #uses getsubscriptionfrom biblionumber -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; +use C4::Koha qw( + GetAuthorisedValues + getitemtypeimagelocation + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetAnalyticsCount GetHostItemsInfo GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); use C4::Reserves; -use C4::Serials; -use C4::XISBN qw(get_xisbns); -use C4::External::Amazon; -use C4::Search; # enabled_staff_search_views -use C4::Tags qw(get_tags); -use C4::XSLT; -use Koha::DateUtils; +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::XISBN qw( get_xisbns ); +use C4::External::Amazon qw( get_amazon_tld ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); +use C4::Tags qw( get_tags ); +use C4::XSLT qw( XSLTParse4Display ); +use Koha::DateUtils qw( format_sqldatetime ); use C4::HTML5Media; -use C4::CourseReserves qw(GetItemCourseReservesInfo); -use C4::Acquisition qw(GetOrdersByBiblionumber); +use C4::CourseReserves qw( GetItemCourseReservesInfo ); use Koha::AuthorisedValues; use Koha::Biblios; use Koha::CoverImages; diff --git a/catalogue/export.pl b/catalogue/export.pl index cb6f2d8129..3785116581 100755 --- a/catalogue/export.pl +++ b/catalogue/export.pl @@ -2,11 +2,11 @@ use Modern::Perl; use C4::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcControlnumber ); use CGI qw ( -utf8 ); -use C4::Ris; +use C4::Ris qw( marc2ris ); diff --git a/catalogue/getitem-ajax.pl b/catalogue/getitem-ajax.pl index 6180874555..9dad680e0c 100755 --- a/catalogue/getitem-ajax.pl +++ b/catalogue/getitem-ajax.pl @@ -19,13 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; +use JSON qw( to_json ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Output; +use C4::Auth qw( check_api_auth ); +use C4::Biblio qw( GetMarcStructure ); +use C4::Output qw( output_with_http_headers ); use Koha::Libraries; use Koha::AuthorisedValues; diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 9cc96c11d6..e9c43a3935 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Search; +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( enabled_staff_search_views ); use Koha::Biblios; use Koha::Items; diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index e81ec56de5..8d17dc933a 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -19,12 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; # GetBiblio -use C4::Search; # enabled_staff_search_views -use C4::Serials; +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Checkouts; use Koha::Old::Checkouts; diff --git a/catalogue/item-export.pl b/catalogue/item-export.pl index fbc69bf71a..0867376d30 100755 --- a/catalogue/item-export.pl +++ b/catalogue/item-export.pl @@ -21,7 +21,7 @@ use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; my $cgi = CGI->new; diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index 0329f4b1d8..9de6fc601f 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -19,13 +19,12 @@ use Modern::Perl; use CGI; -use JSON; +use JSON qw( to_json ); -use C4::Auth; -use C4::Output; -use C4::Items; -use C4::Biblio; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers output_html_with_http_headers ); +use C4::Items qw( SearchItems ); +use C4::Koha qw( GetAuthorisedValues ); use Koha::AuthorisedValues; use Koha::Biblios; diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 643d091dd0..a8f33a674f 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -20,14 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use HTML::Entities; -use MARC::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Search; # enabled_staff_search_views -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcStructure +); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblios; use Koha::BiblioFrameworks; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 94a7eab12f..38eab6aafa 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -20,21 +20,20 @@ use Modern::Perl; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use CGI qw ( -utf8 ); use HTML::Entities; -use C4::Biblio; -use C4::Items; -use C4::Acquisition; -use C4::Output; -use C4::Auth; -use C4::Serials; -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetHostItemsInfo GetItemsInfo ); +use C4::Acquisition qw( GetOrderFromItemnumber GetBasket GetInvoice ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Search qw( enabled_staff_search_views z3950_search_args ); use Koha::Acquisition::Booksellers; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; use Koha::Items; use Koha::Patrons; diff --git a/catalogue/search-history.pl b/catalogue/search-history.pl index 092be2e89f..42bef7cfd4 100755 --- a/catalogue/search-history.pl +++ b/catalogue/search-history.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Search::History; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; diff --git a/catalogue/search.pl b/catalogue/search.pl index 8bd70fc893..632d9d2e99 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -140,14 +140,14 @@ =head3 Additional Notes ## load Koha modules use C4::Context; -use C4::Output; -use C4::Auth qw(:DEFAULT get_session); -use C4::Search; -use C4::Languages qw(getLanguages); -use C4::Koha; +use C4::Output qw( output_html_with_http_headers pagination_bar ); +use C4::Auth qw( get_template_and_user ); +use C4::Search qw( searchResults enabled_staff_search_views z3950_search_args new_record_from_zebra ); +use C4::Languages qw( getlanguage getLanguages ); +use C4::Koha qw( getitemtypeimagelocation GetAuthorisedValues ); use URI::Escape; use POSIX qw(ceil floor); -use C4::Search::History; +use C4::Search qw( searchResults enabled_staff_search_views z3950_search_args new_record_from_zebra ); use Koha::ItemTypes; use Koha::Library::Groups; diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 7633b5f6bd..8292bfe746 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -24,16 +24,15 @@ # standard or CPAN modules used use CGI qw(:standard -utf8); -use DBI; use Encode; # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::ImportBatch; -use C4::XSLT (); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio GetXmlBiblio ); +use C4::ImportBatch qw( GetRecordFromImportBiblio ); +use C4::XSLT; my $input= CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index 015b1235dc..27813c02e8 100755 --- a/catalogue/stockrotation.pl +++ b/catalogue/stockrotation.pl @@ -27,16 +27,16 @@ =head1 stockrotation.pl use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Search; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblio; use Koha::Item; use Koha::StockRotationRotas; use Koha::StockRotationStages; -use Koha::Util::StockRotation qw(:ALL); +use Koha::Util::StockRotation qw( get_stages get_branches toggle_indemand remove_from_stage move_to_next_stage ); my $input = CGI->new; diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index 9ff9f9b2d5..6d9022ff87 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -19,12 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Context; -use C4::Biblio; -use C4::Items; use C4::Output; -use C4::Circulation; +use C4::Circulation qw( LostItem ); use C4::Reserves; my $cgi= CGI->new; diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 7eba09f55d..138fceab44 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -21,31 +21,40 @@ use Modern::Perl; -use CGI q(-utf8); -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::Search; -use C4::AuthoritiesMarc; +use CGI; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Biblio qw( + AddBiblio + DelBiblio + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + GetUsedMarcStructure + ModBiblio + prepare_host_field + PrepHostMarcField + TransformHtmlToMarc +); +use C4::Search qw( FindDuplicate enabled_staff_search_views ); +use C4::Auth qw( get_template_and_user haspermission ); use C4::Context; use MARC::Record; -use C4::Log; -use C4::Koha; -use C4::ClassSource; -use C4::ImportBatch; -use C4::Charset; +use C4::ClassSource qw( GetClassSources ); +use C4::ImportBatch qw( GetImportRecordMarc ); +use C4::Charset qw( SetMarcUnicodeFlag ); use Koha::BiblioFrameworks; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; use Koha::Libraries; use Koha::BiblioFrameworks; -use Date::Calc qw(Today); use MARC::File::USMARC; use MARC::File::XML; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { MARC::File::XML->default_record_format('UNIMARC'); diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 53313bb5f7..b9f3d6e719 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -27,14 +27,12 @@ =head1 cataloguing:addbooks.pl use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; -use C4::Auth; -use C4::Biblio; -use C4::Breeding; -use C4::Output; -use C4::Koha; -use C4::Languages qw(getlanguage); -use C4::Search; +use C4::Auth qw( get_template_and_user ); +use C4::Breeding qw( BreedingSearch ); +use C4::Output qw( output_html_with_http_headers pagination_bar ); +use C4::Koha qw( getnbpages ); +use C4::Languages; +use C4::Search qw( searchResults z3950_search_args ); use Koha::BiblioFrameworks; use Koha::SearchEngine::Search; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index b1e0357398..faa5ab75bc 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -22,29 +22,39 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Biblio qw( + GetAuthorisedValueDesc + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + IsMarcStructureInternal + ModBiblio + TransformHtmlToXml + TransformMarcToKoha +); +use C4::Items qw( AddItemFromMarc ModItemFromMarc ); use C4::Context; -use C4::Circulation; -use C4::Koha; -use C4::ClassSource; -use Koha::DateUtils; +use C4::Circulation qw( LostItem ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; use Koha::Patrons; use Koha::SearchEngine::Indexer; -use List::MoreUtils qw/any/; -use C4::Search; -use Storable qw(thaw freeze); -use URI::Escape; +use List::MoreUtils qw( any ); +use C4::Search qw( enabled_staff_search_views ); +use Storable qw( freeze thaw ); +use URI::Escape qw( uri_escape_utf8 ); use C4::Members; use MARC::File::XML; -use URI::Escape; -use MIME::Base64 qw(decode_base64url encode_base64url); +use URI::Escape qw( uri_escape_utf8 ); +use MIME::Base64 qw( decode_base64url encode_base64url ); our $dbh = C4::Context->dbh; diff --git a/cataloguing/editor.pl b/cataloguing/editor.pl index cfef40490a..c2864a31fd 100755 --- a/cataloguing/editor.pl +++ b/cataloguing/editor.pl @@ -21,12 +21,10 @@ use Modern::Perl; use CGI; -use MARC::Record; -use C4::Auth; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use DBIx::Class::ResultClass::HashRefInflator; use Koha::Database; use Koha::MarcSubfieldStructures; diff --git a/cataloguing/linkitem.pl b/cataloguing/linkitem.pl index aaa4f1d14a..e6f89762c7 100755 --- a/cataloguing/linkitem.pl +++ b/cataloguing/linkitem.pl @@ -22,12 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ModBiblio PrepHostMarcField ); use C4::Context; -use C4::Koha; my $query = CGI->new; diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 7b1f81635c..7ed6ca125e 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -21,14 +21,22 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Items; -use C4::Biblio; -use C4::Serials; -use C4::Koha; -use C4::Reserves qw/MergeHolds/; -use C4::Acquisition qw/ModOrder GetOrdersByBiblionumber/; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( MoveItemFromBiblio ); +use C4::Biblio qw( + DelBiblio + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + ModBiblio + TransformHtmlToMarc +); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Reserves qw( MergeHolds ); +use C4::Acquisition qw( ModOrder GetOrdersByBiblionumber ); use Koha::BiblioFrameworks; use Koha::Items; diff --git a/cataloguing/merge_ajax.pl b/cataloguing/merge_ajax.pl index aef7dcbfb9..6a76a45fb9 100755 --- a/cataloguing/merge_ajax.pl +++ b/cataloguing/merge_ajax.pl @@ -4,11 +4,11 @@ use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before CGI parses the POST request -use JSON; +use JSON qw( encode_json ); use C4::Context; -use C4::Biblio; -use C4::Auth qw/check_cookie_auth/; +use C4::Biblio qw( GetMarcStructure ); +use C4::Auth qw( check_cookie_auth ); my %cookies = CGI::Cookie->fetch; my ( $auth_status, $sessionID ) = check_cookie_auth( diff --git a/cataloguing/moveitem.pl b/cataloguing/moveitem.pl index c0d46413a3..39e1dada8f 100755 --- a/cataloguing/moveitem.pl +++ b/cataloguing/moveitem.pl @@ -22,18 +22,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( MoveItemFromBiblio ); use C4::Context; -use C4::Koha; use C4::ClassSource; use C4::Acquisition qw/GetOrderFromItemnumber ModOrder GetOrder/; use Koha::Biblios; -use Date::Calc qw(Today); use MARC::File::XML; diff --git a/cataloguing/value_builder/EXAMPLE.pl b/cataloguing/value_builder/EXAMPLE.pl index 2e13d6ad86..691e69f8e2 100755 --- a/cataloguing/value_builder/EXAMPLE.pl +++ b/cataloguing/value_builder/EXAMPLE.pl @@ -19,8 +19,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); # Example of framework plugin new style. # It should define and return at least one and normally two anynomous diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index 6a7b6222be..da1ec86ac9 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/cataloguing/value_builder/barcode.pl @@ -24,10 +24,10 @@ use C4::Context; use C4::Barcodes::ValueBuilder; -use C4::Biblio qw/GetMarcFromKohaField/; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcFromKohaField ); +use Koha::DateUtils qw( dt_from_string output_pref ); -use Algorithm::CheckDigits; +use Algorithm::CheckDigits qw( CheckDigits ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/barcode_manual.pl b/cataloguing/value_builder/barcode_manual.pl index 907ce3d482..a3840bd436 100755 --- a/cataloguing/value_builder/barcode_manual.pl +++ b/cataloguing/value_builder/barcode_manual.pl @@ -24,8 +24,8 @@ use C4::Context; use C4::Barcodes::ValueBuilder; -use C4::Biblio qw/GetMarcFromKohaField/; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcFromKohaField ); +use Koha::DateUtils qw( dt_from_string output_pref ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/callnumber-KU.pl b/cataloguing/value_builder/callnumber-KU.pl index 09f733fc6f..37b7e16d00 100755 --- a/cataloguing/value_builder/callnumber-KU.pl +++ b/cataloguing/value_builder/callnumber-KU.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION diff --git a/cataloguing/value_builder/callnumber.pl b/cataloguing/value_builder/callnumber.pl index fd3b068e28..629f1c41c7 100755 --- a/cataloguing/value_builder/callnumber.pl +++ b/cataloguing/value_builder/callnumber.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl index 2acdcc782a..b4e54edd0e 100755 --- a/cataloguing/value_builder/cn_browser.pl +++ b/cataloguing/value_builder/cn_browser.pl @@ -20,11 +20,10 @@ # along with Koha; if not, see . use Modern::Perl; -use CGI; -use C4::Auth; -use C4::ClassSource; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::ClassSource qw( GetClassSort ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ClassSources; diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl index c88f65cc84..1ce91e55f6 100755 --- a/cataloguing/value_builder/dateaccessioned.pl +++ b/cataloguing/value_builder/dateaccessioned.pl @@ -21,7 +21,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/macles.pl b/cataloguing/value_builder/macles.pl index ea769fa8e3..8579dc04d5 100755 --- a/cataloguing/value_builder/macles.pl +++ b/cataloguing/value_builder/macles.pl @@ -23,8 +23,8 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 4ff1c9a538..b4f28521f9 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use XML::LibXML; diff --git a/cataloguing/value_builder/marc21_field_007.pl b/cataloguing/value_builder/marc21_field_007.pl index ee7a91a699..093653d1bf 100755 --- a/cataloguing/value_builder/marc21_field_007.pl +++ b/cataloguing/value_builder/marc21_field_007.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 78961f4ced..9f87ae393b 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use XML::LibXML; use Koha::Util::FrameworkPlugin qw|date_entered|; diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl index 414d9ff688..e7a7f168d8 100755 --- a/cataloguing/value_builder/marc21_field_008_authorities.pl +++ b/cataloguing/value_builder/marc21_field_008_authorities.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Util::FrameworkPlugin qw|date_entered|; use constant FIXLEN_DATA_ELTS => '|| aca||aabn | a|a d'; diff --git a/cataloguing/value_builder/marc21_field_008_classifications.pl b/cataloguing/value_builder/marc21_field_008_classifications.pl index 9a19584542..c5979f8f7e 100755 --- a/cataloguing/value_builder/marc21_field_008_classifications.pl +++ b/cataloguing/value_builder/marc21_field_008_classifications.pl @@ -16,12 +16,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Util::FrameworkPlugin qw|date_entered|; use constant FIXLEN_DATA_ELTS => 'baaaaaaa'; diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl index 659bb9aeee..85f7346329 100755 --- a/cataloguing/value_builder/marc21_leader.pl +++ b/cataloguing/value_builder/marc21_leader.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/marc21_leader_authorities.pl b/cataloguing/value_builder/marc21_leader_authorities.pl index 5bd0348e4d..04a55ea28b 100755 --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ b/cataloguing/value_builder/marc21_leader_authorities.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index adc520ee2b..5bff56495d 100755 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -22,15 +22,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search; -use C4::Auth; -use C4::Output; +use C4::Search qw( new_record_from_zebra ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Koha; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio TransformMarcToKoha ); use Koha::ItemTypes; diff --git a/cataloguing/value_builder/normarc_field_007.pl b/cataloguing/value_builder/normarc_field_007.pl index e2e5bc60de..f01b45f9fd 100755 --- a/cataloguing/value_builder/normarc_field_007.pl +++ b/cataloguing/value_builder/normarc_field_007.pl @@ -18,12 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/normarc_field_008.pl b/cataloguing/value_builder/normarc_field_008.pl index de487bd743..fc1a9417fa 100755 --- a/cataloguing/value_builder/normarc_field_008.pl +++ b/cataloguing/value_builder/normarc_field_008.pl @@ -18,12 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); # find today's date my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); diff --git a/cataloguing/value_builder/normarc_leader.pl b/cataloguing/value_builder/normarc_leader.pl index 8314d637ea..15ae94a62d 100755 --- a/cataloguing/value_builder/normarc_leader.pl +++ b/cataloguing/value_builder/normarc_leader.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/stocknumberAV.pl b/cataloguing/value_builder/stocknumberAV.pl index 850fbe849d..793cf1066a 100755 --- a/cataloguing/value_builder/stocknumberAV.pl +++ b/cataloguing/value_builder/stocknumberAV.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; =head1 DESCRIPTION diff --git a/cataloguing/value_builder/stocknumberam123.pl b/cataloguing/value_builder/stocknumberam123.pl index be36fe2072..e1f54ad660 100755 --- a/cataloguing/value_builder/stocknumberam123.pl +++ b/cataloguing/value_builder/stocknumberam123.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION diff --git a/cataloguing/value_builder/unimarc_field_010.pl b/cataloguing/value_builder/unimarc_field_010.pl index 73b7ff7fe9..56a5c5c3ce 100755 --- a/cataloguing/value_builder/unimarc_field_010.pl +++ b/cataloguing/value_builder/unimarc_field_010.pl @@ -19,10 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { diff --git a/cataloguing/value_builder/unimarc_field_100.pl b/cataloguing/value_builder/unimarc_field_100.pl index e5d746a6ca..ef2e08bb9b 100755 --- a/cataloguing/value_builder/unimarc_field_100.pl +++ b/cataloguing/value_builder/unimarc_field_100.pl @@ -20,13 +20,13 @@ use Modern::Perl; -use Date::Calc qw( Today ); +use Date::Calc; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { diff --git a/cataloguing/value_builder/unimarc_field_100_authorities.pl b/cataloguing/value_builder/unimarc_field_100_authorities.pl index 4a0e588e52..ff7aa576f3 100755 --- a/cataloguing/value_builder/unimarc_field_100_authorities.pl +++ b/cataloguing/value_builder/unimarc_field_100_authorities.pl @@ -20,10 +20,10 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { diff --git a/cataloguing/value_builder/unimarc_field_105.pl b/cataloguing/value_builder/unimarc_field_105.pl index 9e80cd06d5..e239de664e 100755 --- a/cataloguing/value_builder/unimarc_field_105.pl +++ b/cataloguing/value_builder/unimarc_field_105.pl @@ -22,12 +22,12 @@ #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_106.pl b/cataloguing/value_builder/unimarc_field_106.pl index de4fb67b44..488b6ba889 100755 --- a/cataloguing/value_builder/unimarc_field_106.pl +++ b/cataloguing/value_builder/unimarc_field_106.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_110.pl b/cataloguing/value_builder/unimarc_field_110.pl index 4e7287c250..79b173aca7 100755 --- a/cataloguing/value_builder/unimarc_field_110.pl +++ b/cataloguing/value_builder/unimarc_field_110.pl @@ -22,12 +22,12 @@ #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_115a.pl b/cataloguing/value_builder/unimarc_field_115a.pl index e052a1b820..c741a8fa44 100755 --- a/cataloguing/value_builder/unimarc_field_115a.pl +++ b/cataloguing/value_builder/unimarc_field_115a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_115b.pl b/cataloguing/value_builder/unimarc_field_115b.pl index de5e68449a..55adaf2ca1 100755 --- a/cataloguing/value_builder/unimarc_field_115b.pl +++ b/cataloguing/value_builder/unimarc_field_115b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_116.pl b/cataloguing/value_builder/unimarc_field_116.pl index ef6e5034ee..858ab48d8a 100755 --- a/cataloguing/value_builder/unimarc_field_116.pl +++ b/cataloguing/value_builder/unimarc_field_116.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_117.pl b/cataloguing/value_builder/unimarc_field_117.pl index 3e5c01f10e..4d4223c5c2 100755 --- a/cataloguing/value_builder/unimarc_field_117.pl +++ b/cataloguing/value_builder/unimarc_field_117.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_120.pl b/cataloguing/value_builder/unimarc_field_120.pl index 0c8157adbf..1450a5e35b 100755 --- a/cataloguing/value_builder/unimarc_field_120.pl +++ b/cataloguing/value_builder/unimarc_field_120.pl @@ -22,12 +22,12 @@ #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_121a.pl b/cataloguing/value_builder/unimarc_field_121a.pl index 39a6b84611..0da0894d42 100755 --- a/cataloguing/value_builder/unimarc_field_121a.pl +++ b/cataloguing/value_builder/unimarc_field_121a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_121b.pl b/cataloguing/value_builder/unimarc_field_121b.pl index 7c3b6845ba..bc5bf1ec95 100755 --- a/cataloguing/value_builder/unimarc_field_121b.pl +++ b/cataloguing/value_builder/unimarc_field_121b.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_122.pl b/cataloguing/value_builder/unimarc_field_122.pl index d98b48824a..0b326c443c 100755 --- a/cataloguing/value_builder/unimarc_field_122.pl +++ b/cataloguing/value_builder/unimarc_field_122.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123a.pl b/cataloguing/value_builder/unimarc_field_123a.pl index f55b44e8b9..cf74e41029 100755 --- a/cataloguing/value_builder/unimarc_field_123a.pl +++ b/cataloguing/value_builder/unimarc_field_123a.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123d.pl b/cataloguing/value_builder/unimarc_field_123d.pl index c73698f1a6..9fb25ffb2e 100755 --- a/cataloguing/value_builder/unimarc_field_123d.pl +++ b/cataloguing/value_builder/unimarc_field_123d.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123e.pl b/cataloguing/value_builder/unimarc_field_123e.pl index c73698f1a6..9fb25ffb2e 100755 --- a/cataloguing/value_builder/unimarc_field_123e.pl +++ b/cataloguing/value_builder/unimarc_field_123e.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123f.pl b/cataloguing/value_builder/unimarc_field_123f.pl index 5e95c6be91..660d601df6 100755 --- a/cataloguing/value_builder/unimarc_field_123f.pl +++ b/cataloguing/value_builder/unimarc_field_123f.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123g.pl b/cataloguing/value_builder/unimarc_field_123g.pl index c73698f1a6..9fb25ffb2e 100755 --- a/cataloguing/value_builder/unimarc_field_123g.pl +++ b/cataloguing/value_builder/unimarc_field_123g.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123i.pl b/cataloguing/value_builder/unimarc_field_123i.pl index 3ad3e93fd5..51d6477673 100755 --- a/cataloguing/value_builder/unimarc_field_123i.pl +++ b/cataloguing/value_builder/unimarc_field_123i.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123j.pl b/cataloguing/value_builder/unimarc_field_123j.pl index e8379e81a8..7ca7f07d3a 100755 --- a/cataloguing/value_builder/unimarc_field_123j.pl +++ b/cataloguing/value_builder/unimarc_field_123j.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124.pl b/cataloguing/value_builder/unimarc_field_124.pl index 7ec1b474bf..cfcb8d7c7f 100755 --- a/cataloguing/value_builder/unimarc_field_124.pl +++ b/cataloguing/value_builder/unimarc_field_124.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124a.pl b/cataloguing/value_builder/unimarc_field_124a.pl index 1b4ac5abd6..9d14d7a9fd 100755 --- a/cataloguing/value_builder/unimarc_field_124a.pl +++ b/cataloguing/value_builder/unimarc_field_124a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124b.pl b/cataloguing/value_builder/unimarc_field_124b.pl index 51424f111c..e004bddfd8 100755 --- a/cataloguing/value_builder/unimarc_field_124b.pl +++ b/cataloguing/value_builder/unimarc_field_124b.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124c.pl b/cataloguing/value_builder/unimarc_field_124c.pl index b9df679e92..19f8a130ab 100755 --- a/cataloguing/value_builder/unimarc_field_124c.pl +++ b/cataloguing/value_builder/unimarc_field_124c.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124d.pl b/cataloguing/value_builder/unimarc_field_124d.pl index 35cbcbef80..a100375532 100755 --- a/cataloguing/value_builder/unimarc_field_124d.pl +++ b/cataloguing/value_builder/unimarc_field_124d.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124e.pl b/cataloguing/value_builder/unimarc_field_124e.pl index 76e0e8314b..73226113ae 100755 --- a/cataloguing/value_builder/unimarc_field_124e.pl +++ b/cataloguing/value_builder/unimarc_field_124e.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124f.pl b/cataloguing/value_builder/unimarc_field_124f.pl index 732b825bda..8a0836a7a5 100755 --- a/cataloguing/value_builder/unimarc_field_124f.pl +++ b/cataloguing/value_builder/unimarc_field_124f.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124g.pl b/cataloguing/value_builder/unimarc_field_124g.pl index 1262cdf033..3f40b1e9e9 100755 --- a/cataloguing/value_builder/unimarc_field_124g.pl +++ b/cataloguing/value_builder/unimarc_field_124g.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_125.pl b/cataloguing/value_builder/unimarc_field_125.pl index 958c6600a6..4eb86d9cbf 100755 --- a/cataloguing/value_builder/unimarc_field_125.pl +++ b/cataloguing/value_builder/unimarc_field_125.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION diff --git a/cataloguing/value_builder/unimarc_field_125a.pl b/cataloguing/value_builder/unimarc_field_125a.pl index 9c6473534a..947050f38d 100755 --- a/cataloguing/value_builder/unimarc_field_125a.pl +++ b/cataloguing/value_builder/unimarc_field_125a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_125b.pl b/cataloguing/value_builder/unimarc_field_125b.pl index 8c19929bcc..d556949835 100755 --- a/cataloguing/value_builder/unimarc_field_125b.pl +++ b/cataloguing/value_builder/unimarc_field_125b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126.pl b/cataloguing/value_builder/unimarc_field_126.pl index 7ec1b474bf..cfcb8d7c7f 100755 --- a/cataloguing/value_builder/unimarc_field_126.pl +++ b/cataloguing/value_builder/unimarc_field_126.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126a.pl b/cataloguing/value_builder/unimarc_field_126a.pl index 38c8827e67..f5ed0f7f03 100755 --- a/cataloguing/value_builder/unimarc_field_126a.pl +++ b/cataloguing/value_builder/unimarc_field_126a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126b.pl b/cataloguing/value_builder/unimarc_field_126b.pl index b9c8709a5a..1c261bcc80 100755 --- a/cataloguing/value_builder/unimarc_field_126b.pl +++ b/cataloguing/value_builder/unimarc_field_126b.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_127.pl b/cataloguing/value_builder/unimarc_field_127.pl index 329db611d0..9845a547ed 100755 --- a/cataloguing/value_builder/unimarc_field_127.pl +++ b/cataloguing/value_builder/unimarc_field_127.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128a.pl b/cataloguing/value_builder/unimarc_field_128a.pl index f1d30988cb..4b6ad8e90a 100755 --- a/cataloguing/value_builder/unimarc_field_128a.pl +++ b/cataloguing/value_builder/unimarc_field_128a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128b.pl b/cataloguing/value_builder/unimarc_field_128b.pl index c237733060..1c860bf3b9 100755 --- a/cataloguing/value_builder/unimarc_field_128b.pl +++ b/cataloguing/value_builder/unimarc_field_128b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128c.pl b/cataloguing/value_builder/unimarc_field_128c.pl index 5a876ce7ae..56ce4a1d68 100755 --- a/cataloguing/value_builder/unimarc_field_128c.pl +++ b/cataloguing/value_builder/unimarc_field_128c.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_130.pl b/cataloguing/value_builder/unimarc_field_130.pl index a0cb7ec930..19db6d6321 100755 --- a/cataloguing/value_builder/unimarc_field_130.pl +++ b/cataloguing/value_builder/unimarc_field_130.pl @@ -22,12 +22,12 @@ #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_135a.pl b/cataloguing/value_builder/unimarc_field_135a.pl index 3a95a5f367..050f8ec820 100755 --- a/cataloguing/value_builder/unimarc_field_135a.pl +++ b/cataloguing/value_builder/unimarc_field_135a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_140.pl b/cataloguing/value_builder/unimarc_field_140.pl index 492ce14a1c..467ecb412a 100755 --- a/cataloguing/value_builder/unimarc_field_140.pl +++ b/cataloguing/value_builder/unimarc_field_140.pl @@ -22,12 +22,12 @@ #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_141.pl b/cataloguing/value_builder/unimarc_field_141.pl index 45643926be..907f3e39af 100755 --- a/cataloguing/value_builder/unimarc_field_141.pl +++ b/cataloguing/value_builder/unimarc_field_141.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_210c.pl b/cataloguing/value_builder/unimarc_field_210c.pl index 7bda1f3e2c..4ffc85f603 100755 --- a/cataloguing/value_builder/unimarc_field_210c.pl +++ b/cataloguing/value_builder/unimarc_field_210c.pl @@ -19,14 +19,13 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Search; -use MARC::Record; -use C4::Koha; +use C4::Koha qw( getnbpages ); ###TODO To rewrite in order to use SearchAuthorities diff --git a/cataloguing/value_builder/unimarc_field_210c_bis.pl b/cataloguing/value_builder/unimarc_field_210c_bis.pl index dcfefc4cf3..5204ddd662 100755 --- a/cataloguing/value_builder/unimarc_field_210c_bis.pl +++ b/cataloguing/value_builder/unimarc_field_210c_bis.pl @@ -40,12 +40,12 @@ =head1 SYNOPSIS use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::AuthoritiesMarc; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_225a.pl b/cataloguing/value_builder/unimarc_field_225a.pl index 8a3a989709..761302cd23 100755 --- a/cataloguing/value_builder/unimarc_field_225a.pl +++ b/cataloguing/value_builder/unimarc_field_225a.pl @@ -41,12 +41,13 @@ =head1 SYNOPSIS use strict; #use warnings; FIXME - Bug 2505 -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::AuthoritiesMarc; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( SearchAuthorities GetAuthority ); =head1 DESCRIPTION diff --git a/cataloguing/value_builder/unimarc_field_225a_bis.pl b/cataloguing/value_builder/unimarc_field_225a_bis.pl index 15990d031c..5bfedad414 100755 --- a/cataloguing/value_builder/unimarc_field_225a_bis.pl +++ b/cataloguing/value_builder/unimarc_field_225a_bis.pl @@ -24,11 +24,11 @@ =head1 SYNOPSIS use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 9c2f024600..832305929a 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -22,15 +22,13 @@ #use warnings; FIXME - Bug 2505 use CGI qw ( -utf8 ); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search; -use C4::Auth; -use C4::Output; +use C4::Search qw( new_record_from_zebra ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Koha; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio TransformMarcToKoha ); use Koha::ItemTypes; diff --git a/cataloguing/value_builder/unimarc_field_686a.pl b/cataloguing/value_builder/unimarc_field_686a.pl index 778d0a91d7..38a1e48513 100755 --- a/cataloguing/value_builder/unimarc_field_686a.pl +++ b/cataloguing/value_builder/unimarc_field_686a.pl @@ -19,12 +19,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_field_700-4.pl b/cataloguing/value_builder/unimarc_field_700-4.pl index c6388ec9b5..895db7a1d2 100755 --- a/cataloguing/value_builder/unimarc_field_700-4.pl +++ b/cataloguing/value_builder/unimarc_field_700-4.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; diff --git a/cataloguing/value_builder/unimarc_leader.pl b/cataloguing/value_builder/unimarc_leader.pl index cae62d01f4..44d8c9319c 100755 --- a/cataloguing/value_builder/unimarc_leader.pl +++ b/cataloguing/value_builder/unimarc_leader.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; diff --git a/cataloguing/ysearch.pl b/cataloguing/ysearch.pl index 1683da4835..87a9aaa039 100755 --- a/cataloguing/ysearch.pl +++ b/cataloguing/ysearch.pl @@ -27,9 +27,9 @@ =head1 ysearch.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use JSON qw/ to_json /; +use C4::Charset qw( nsb_clean ); +use C4::Auth qw( check_cookie_auth ); +use JSON qw( to_json ); my $input = CGI->new; my $query = $input->param('term'); diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index e97c47d91f..da93dac37f 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -20,11 +20,10 @@ use CGI qw / -utf8 /; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search Z3950SearchAuth ); my $input = CGI->new; my $dbh = C4::Context->dbh; diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index f5f04246d6..8acc92c25d 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search ); my $input = CGI->new; my $error = $input->param('error'); diff --git a/circ/add_message.pl b/circ/add_message.pl index 1c9630a1db..ee90af3522 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -21,7 +21,7 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use Koha::Patron::Message; diff --git a/circ/article-request-slip.pl b/circ/article-request-slip.pl index 2175561edb..18d03bb5f0 100755 --- a/circ/article-request-slip.pl +++ b/circ/article-request-slip.pl @@ -22,8 +22,8 @@ use CGI qw( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use Koha::ArticleRequests; use Koha::Patrons; diff --git a/circ/article-requests.pl b/circ/article-requests.pl index 3e856bcafa..3e918dd4c6 100755 --- a/circ/article-requests.pl +++ b/circ/article-requests.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ArticleRequests; my $query = CGI->new; diff --git a/circ/bookcount.pl b/circ/bookcount.pl index 9a6af8110e..eaca8c4d04 100755 --- a/circ/bookcount.pl +++ b/circ/bookcount.pl @@ -23,12 +23,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Circulation; -use C4::Output; -use C4::Koha; -use C4::Auth; +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; -use Koha::DateUtils; use Koha::Libraries; my $input = CGI->new; diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index 422b32cda6..0bea167690 100755 --- a/circ/branchoverdues.pl +++ b/circ/branchoverdues.pl @@ -19,14 +19,13 @@ use Modern::Perl; use C4::Context; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Overdues; -use C4::Biblio; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Overdues qw( GetOverduesForBranch ); +use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure ); +use C4::Koha qw( GetAuthorisedValues ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; -use Data::Dumper; =head1 branchoverdues.pl diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 9a652750de..4e23ae6d7d 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -22,13 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Circulation; -use C4::Output; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Koha; +use C4::Circulation qw( transferbook ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( ModReserve ModReserveAffect ); +use C4::Auth qw( get_session get_template_and_user ); use C4::Members; use Koha::BiblioFrameworks; use Koha::AuthorisedValues; diff --git a/circ/checkout-notes.pl b/circ/checkout-notes.pl index 61ce7cc353..e94bea06c9 100755 --- a/circ/checkout-notes.pl +++ b/circ/checkout-notes.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Checkouts; my $query = CGI->new; diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl index f68535d1f1..239051d850 100755 --- a/circ/circulation-home.pl +++ b/circ/circulation-home.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::BiblioFrameworks; use Koha::Checkouts; diff --git a/circ/circulation.pl b/circ/circulation.pl index 4fd72616c4..7988782577 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -29,15 +29,14 @@ use DateTime; use DateTime::Duration; use Scalar::Util qw( looks_like_number ); -use C4::Output; -use C4::Auth qw/:DEFAULT get_session haspermission/; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_session get_template_and_user ); use C4::Koha; -use C4::Circulation; +use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue ); use C4::Utils::DataTables::Members; use C4::Members; -use C4::Biblio; -use C4::Search; -use MARC::Record; +use C4::Biblio qw( TransformMarcToKoha ); +use C4::Search qw( new_record_from_zebra ); use C4::Reserves; use Koha::Holds; use C4::Context; @@ -45,8 +44,8 @@ use Koha::AuthorisedValues; use Koha::CsvProfiles; use Koha::Patrons; -use Koha::Patron::Debarments qw(GetDebarments); -use Koha::DateUtils; +use Koha::Patron::Debarments qw( GetDebarments ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::BiblioFrameworks; use Koha::Items; @@ -55,12 +54,7 @@ use Koha::SearchEngine::Search; use Koha::Patron::Modifications; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); # # PARAMETERS READING diff --git a/circ/del_message.pl b/circ/del_message.pl index 2ce34642cd..778c458226 100755 --- a/circ/del_message.pl +++ b/circ/del_message.pl @@ -21,7 +21,7 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use Koha::Patron::Messages; diff --git a/circ/hold-transfer-slip.pl b/circ/hold-transfer-slip.pl index 5d21f3d23a..61aef56c4c 100755 --- a/circ/hold-transfer-slip.pl +++ b/circ/hold-transfer-slip.pl @@ -20,10 +20,10 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Reserves; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Reserves qw( ReserveSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); diff --git a/circ/offline-mf.pl b/circ/offline-mf.pl index 01b1d7c186..19eb644f9e 100755 --- a/circ/offline-mf.pl +++ b/circ/offline-mf.pl @@ -18,7 +18,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( diff --git a/circ/offline.pl b/circ/offline.pl index d1500d6200..3843cb7243 100755 --- a/circ/offline.pl +++ b/circ/offline.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $query = CGI->new; diff --git a/circ/on-site_checkouts.pl b/circ/on-site_checkouts.pl index c581e8ef9a..41e9a877bd 100755 --- a/circ/on-site_checkouts.pl +++ b/circ/on-site_checkouts.pl @@ -18,10 +18,9 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Circulation qw( GetPendingOnSiteCheckouts ); -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use Koha::BiblioFrameworks; my $cgi = CGI->new; diff --git a/circ/overdue.pl b/circ/overdue.pl index c402588d19..b8ed200b52 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -21,11 +21,11 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw(-oldstyle_urls -utf8); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Text::CSV_XS; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use DateTime; use DateTime::Format::MySQL; diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 9310f26bbf..0b2fea2195 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -25,13 +25,13 @@ use Encode; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Items qw( ModItemTransfer ); +use C4::Auth qw( get_template_and_user ); +use C4::Items; use C4::Reserves qw( ModReserveCancelAll ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; use DateTime::Duration; diff --git a/circ/renew.pl b/circ/renew.pl index acce7770af..383155416c 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -21,11 +21,10 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Circulation; -use C4::Koha; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( barcodedecode CanBookBeRenewed GetSoonestRenewDate GetLatestAutoRenewDate AddRenewal ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::BiblioFrameworks; diff --git a/circ/request-article.pl b/circ/request-article.pl index fdbd74a525..678c4c9694 100755 --- a/circ/request-article.pl +++ b/circ/request-article.pl @@ -19,11 +19,11 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Utils::DataTables::Members; -use C4::Search; -use C4::Serials; +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblios; use Koha::Patrons; use Koha::ArticleRequests; diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 812f9e4e34..7311d1e8c9 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -21,14 +21,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw/Today Add_Delta_YM/; use POSIX qw( ceil ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Acquisition qw/GetOrdersByBiblionumber/; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Baskets; my $input = CGI->new; diff --git a/circ/returns.pl b/circ/returns.pl index e456e531f2..914d5de35c 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -34,25 +34,23 @@ =head1 returns.pl use CGI qw ( -utf8 ); use DateTime; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Circulation; -use C4::Reserves; -use C4::Biblio; -use C4::Circulation; +use C4::Auth qw( get_template_and_user get_session haspermission ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( barcodedecode GetBranchItemRule AddReturn updateWrongTransfer LostItem ); +use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); +use C4::Circulation qw( barcodedecode GetBranchItemRule AddReturn updateWrongTransfer LostItem ); use C4::Context; -use C4::Items; -use C4::Koha; # FIXME : is it still useful ? +use C4::Items qw( ModItemTransfer ); use C4::Members::Messaging; use C4::Members; -use C4::Output; -use C4::Reserves; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); use C4::RotatingCollections; use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::Calendar; use Koha::Checkouts; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Holds; use Koha::Items; use Koha::Item::Transfers; diff --git a/circ/set-library.pl b/circ/set-library.pl index b10ccc0a0e..b03759be62 100755 --- a/circ/set-library.pl +++ b/circ/set-library.pl @@ -21,9 +21,8 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_session ); use Koha::BiblioFrameworks; use Koha::Cash::Registers; use Koha::Libraries; diff --git a/circ/transfer-slip.pl b/circ/transfer-slip.pl index b0b6ba437e..1bd013d854 100755 --- a/circ/transfer-slip.pl +++ b/circ/transfer-slip.pl @@ -21,10 +21,10 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Circulation; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Circulation qw( TransferSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); diff --git a/circ/transfers_to_send.pl b/circ/transfers_to_send.pl index 07679ddce9..fad59fd3bc 100755 --- a/circ/transfers_to_send.pl +++ b/circ/transfers_to_send.pl @@ -20,10 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $input = CGI->new; my $itemnumber = $input->param('itemnumber'); diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl index ffa89b2de9..d0545b20e9 100755 --- a/circ/transferstoreceive.pl +++ b/circ/transferstoreceive.pl @@ -21,23 +21,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::Circulation; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( GetTransfers GetTransfersFromTo ); use C4::Members; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); +use Date::Calc qw( Add_Delta_Days Date_to_Days Today ); -use C4::Koha; use C4::Reserves; use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; use Koha::Patrons; diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl index be63875353..81b900ba2a 100755 --- a/circ/view_holdsqueue.pl +++ b/circ/view_holdsqueue.pl @@ -24,11 +24,9 @@ =head1 view_holdsqueue use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::HoldsQueue qw(GetHoldsQueueItems); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::HoldsQueue qw( GetHoldsQueueItems ); use Koha::BiblioFrameworks; use Koha::ItemTypes; diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 4f654a12ed..c9d4e84e82 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -21,20 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Circulation; -use C4::Members; -use C4::Biblio; -use C4::Items; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); -use C4::Reserves; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( ModItemTransfer ); +use Date::Calc qw( Date_to_Days Today ); +use C4::Reserves qw( ModReserve ModReserveCancelAll ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; use Koha::Items; use Koha::ItemTypes; diff --git a/circ/ysearch.pl b/circ/ysearch.pl index a52568640e..75f6f1dc61 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -27,9 +27,9 @@ =head1 ysearch.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/check_cookie_auth/; +use C4::Auth qw( check_cookie_auth ); use Koha::Patrons; -use Koha::DateUtils qw/format_sqldatetime/; +use Koha::DateUtils qw( format_sqldatetime ); use JSON qw( to_json ); diff --git a/clubs/club-enrollments.pl b/clubs/club-enrollments.pl index 6163c70894..3eac228bb7 100755 --- a/clubs/club-enrollments.pl +++ b/clubs/club-enrollments.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; diff --git a/clubs/clubs-add-modify.pl b/clubs/clubs-add-modify.pl index 058d8222ba..4a41f5c77a 100755 --- a/clubs/clubs-add-modify.pl +++ b/clubs/clubs-add-modify.pl @@ -21,10 +21,10 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Clubs; use Koha::Club::Fields; diff --git a/clubs/clubs.pl b/clubs/clubs.pl index d2d5a96372..bb4dee6dcc 100755 --- a/clubs/clubs.pl +++ b/clubs/clubs.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; use Koha::Club::Templates; diff --git a/clubs/patron-clubs-tab.pl b/clubs/patron-clubs-tab.pl index 1fc47b4dcb..1a12083e65 100755 --- a/clubs/patron-clubs-tab.pl +++ b/clubs/patron-clubs-tab.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Club::Enrollments; diff --git a/clubs/patron-enroll.pl b/clubs/patron-enroll.pl index 3642996b5c..367b3c0f4b 100755 --- a/clubs/patron-enroll.pl +++ b/clubs/patron-enroll.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; diff --git a/clubs/templates-add-modify.pl b/clubs/templates-add-modify.pl index 7e22af14ce..f32a6d107d 100755 --- a/clubs/templates-add-modify.pl +++ b/clubs/templates-add-modify.pl @@ -21,10 +21,10 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Club::Templates; use Koha::Club::Template::Fields; use Koha::Club::Template::EnrollmentFields; diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 02999c2e0b..10b74a40cc 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -22,13 +22,12 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); use Koha::Items; -use C4::CourseReserves qw(GetCourse GetCourseItem GetCourseReserve ModCourseItem ModCourseReserve); +use C4::CourseReserves qw( GetCourse GetCourseReserve ModCourse ModCourseItem ModCourseReserve ); use Koha::Items; use Koha::ItemTypes; diff --git a/course_reserves/batch_add_items.pl b/course_reserves/batch_add_items.pl index 8343da2b7d..1f66ee82e5 100755 --- a/course_reserves/batch_add_items.pl +++ b/course_reserves/batch_add_items.pl @@ -23,9 +23,9 @@ use CGI qw( -utf8 ); use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::CourseReserves qw(ModCourseItem ModCourseReserve GetCourse); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::CourseReserves qw( GetCourse ModCourse ModCourseItem ModCourseReserve ); use Koha::Items; diff --git a/course_reserves/batch_rm_items.pl b/course_reserves/batch_rm_items.pl index bd78bc41c9..de0a49d3b0 100755 --- a/course_reserves/batch_rm_items.pl +++ b/course_reserves/batch_rm_items.pl @@ -22,9 +22,9 @@ use CGI qw( -utf8 ); use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::CourseReserves qw(GetItemCourseReservesInfo DelCourseReserve GetCourseItem); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::CourseReserves qw( GetCourse GetCourseItem GetItemCourseReservesInfo DelCourse DelCourseReserve ); use Koha::Items; diff --git a/course_reserves/course-details.pl b/course_reserves/course-details.pl index 35b2bc7695..e5c7efe5b2 100755 --- a/course_reserves/course-details.pl +++ b/course_reserves/course-details.pl @@ -22,11 +22,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(DelCourseReserve GetCourse GetCourseReserves); +use C4::CourseReserves qw( DelCourse DelCourseReserve GetCourse GetCourseReserve GetCourseReserves ); my $cgi = CGI->new; diff --git a/course_reserves/course-reserves.pl b/course_reserves/course-reserves.pl index 1ecda7ad9e..6dafac9e99 100755 --- a/course_reserves/course-reserves.pl +++ b/course_reserves/course-reserves.pl @@ -22,10 +22,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(GetCourses); +use C4::CourseReserves qw( GetCourse GetCourses ); my $cgi = CGI->new; diff --git a/course_reserves/course.pl b/course_reserves/course.pl index c5fb37baa3..8d66bdcbd5 100755 --- a/course_reserves/course.pl +++ b/course_reserves/course.pl @@ -22,11 +22,11 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); -use C4::CourseReserves qw(GetCourse); +use C4::CourseReserves qw( GetCourse ); my $cgi = CGI->new; diff --git a/course_reserves/mod_course.pl b/course_reserves/mod_course.pl index 060b2a129f..3abcb9731f 100755 --- a/course_reserves/mod_course.pl +++ b/course_reserves/mod_course.pl @@ -23,9 +23,9 @@ use C4::Output; use C4::Reserves; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); -use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors); +use C4::CourseReserves qw( DelCourse ModCourse ModCourseInstructors ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl b/docs/CAS/CASProxy/examples/proxy_cas_callback.pl index 9c6214795b..75df85ffd6 100755 --- a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl +++ b/docs/CAS/CASProxy/examples/proxy_cas_callback.pl @@ -28,7 +28,7 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); use Authen::CAS::Client; -use Storable qw(nstore_fd); +use Storable qw( nstore_fd ); my $casServerUrl = 'https://localhost:8443/cas/'; my $cas = Authen::CAS::Client->new($casServerUrl); diff --git a/docs/CAS/CASProxy/examples/proxy_cas_data.pl b/docs/CAS/CASProxy/examples/proxy_cas_data.pl index 6346b5ec54..ed2e357acf 100755 --- a/docs/CAS/CASProxy/examples/proxy_cas_data.pl +++ b/docs/CAS/CASProxy/examples/proxy_cas_data.pl @@ -33,9 +33,8 @@ =head2 PGTIOU use Modern::Perl; use CGI qw ( -utf8 ); use Authen::CAS::Client; -use Storable qw(fd_retrieve); -use LWP::Simple; -use URI::Escape; +use Storable qw( fd_retrieve ); +use LWP::Simple qw( get ); my $casServerUrl = 'https://localhost:8443/cas/'; my $cas = Authen::CAS::Client->new($casServerUrl); diff --git a/errors/400.pl b/errors/400.pl index f2bf9d5ee0..e3cfc5e0bb 100755 --- a/errors/400.pl +++ b/errors/400.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/errors/401.pl b/errors/401.pl index e16ca38159..5cc3ac432d 100755 --- a/errors/401.pl +++ b/errors/401.pl @@ -17,10 +17,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/errors/402.pl b/errors/402.pl index a6d40ff05c..0ffe905ef6 100755 --- a/errors/402.pl +++ b/errors/402.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/errors/403.pl b/errors/403.pl index d3187a6f3a..1a45904f9d 100755 --- a/errors/403.pl +++ b/errors/403.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/errors/404.pl b/errors/404.pl index e2f0079f18..a784979154 100755 --- a/errors/404.pl +++ b/errors/404.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/errors/500.pl b/errors/500.pl index 4f80a5089c..df8940abc9 100755 --- a/errors/500.pl +++ b/errors/500.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/help.pl b/help.pl index 4dd3ac3c12..9216253955 100755 --- a/help.pl +++ b/help.pl @@ -20,7 +20,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use Koha::Manual; diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index dfc27efcba..fef5e550c7 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Notice::Templates; use Koha::AuthorisedValues; use Koha::Illcomment; @@ -31,9 +31,9 @@ use Koha::Libraries; use Koha::Token; -use Try::Tiny; -use URI::Escape; -use JSON; +use Try::Tiny qw( catch try ); +use URI::Escape qw( uri_escape_utf8 ); +use JSON qw( encode_json ); our $cgi = CGI->new; my $illRequests = Koha::Illrequests->new; diff --git a/installer/data/mysql/backfill_statistics.pl b/installer/data/mysql/backfill_statistics.pl index e289e571e1..8c573cbc54 100755 --- a/installer/data/mysql/backfill_statistics.pl +++ b/installer/data/mysql/backfill_statistics.pl @@ -6,13 +6,9 @@ use Modern::Perl; # CPAN modules -use DBI; -use Getopt::Long; # Koha modules use C4::Context; -use C4::Items; -use Data::Dumper; my $dbh = C4::Context->dbh; diff --git a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl b/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl index b3e4b06f37..b1fbdf6128 100755 --- a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl +++ b/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl @@ -22,11 +22,11 @@ use C4::Context; use C4::Overdues qw/CalcFine/; -use C4::Log qw/logaction/; +use C4::Log qw( logaction ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($help, $verbose, $confirm, $log, $stdout_log); diff --git a/installer/data/mysql/update22to30.pl b/installer/data/mysql/update22to30.pl index 6a8a1ecd11..c5a183dae9 100755 --- a/installer/data/mysql/update22to30.pl +++ b/installer/data/mysql/update22to30.pl @@ -14,12 +14,10 @@ use strict; # CPAN modules -use DBI; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); # Koha modules use C4::Context; -use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); # FIXME - The user might be installing a new database, so can't rely diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index 2b9084b4b2..c1ad8a4917 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/installer/html-template-to-template-toolkit.pl @@ -1,12 +1,10 @@ #!/usr/bin/perl use Modern::Perl; -use Carp; -use Data::Dumper; +use Carp qw( croak ); -use Getopt::Long; -use File::Basename; -use File::Copy; +use Getopt::Long qw( GetOptions ); +use File::Copy qw( copy ); my $help_msg = <new; diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index b76a013cdf..f1cd47183c 100755 --- a/labels/label-create-pdf.pl +++ b/labels/label-create-pdf.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Creators; use C4::Labels; diff --git a/labels/label-create-xml.pl b/labels/label-create-xml.pl index 0df58752a0..3962cfb502 100755 --- a/labels/label-create-xml.pl +++ b/labels/label-create-xml.pl @@ -22,9 +22,7 @@ use CGI qw ( -utf8 ); use XML::Simple; -use Data::Dumper; -use C4::Creators; use C4::Labels; my $cgi = CGI->new; diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl index c263bc4bab..ac2da6392f 100755 --- a/labels/label-edit-batch.pl +++ b/labels/label-edit-batch.pl @@ -22,9 +22,9 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_label_summary html_table ); use C4::Labels; use Koha::Items; diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 8c4e57130f..c9ca26c162 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -21,11 +21,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use POSIX; +use POSIX qw( exit sprintf ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_barcode_types + get_font_types + get_label_types + get_text_justification_types +); use C4::Labels; my $cgi = CGI->new; diff --git a/labels/label-edit-profile.pl b/labels/label-edit-profile.pl index 9e3fbe09e5..257bf4382d 100755 --- a/labels/label-edit-profile.pl +++ b/labels/label-edit-profile.pl @@ -22,9 +22,9 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_templates get_unit_values ); use C4::Labels; my $cgi = CGI->new; diff --git a/labels/label-edit-range.pl b/labels/label-edit-range.pl index 509250f175..09adba3ffe 100755 --- a/labels/label-edit-range.pl +++ b/labels/label-edit-range.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl index 17186c74bf..9e6a019d09 100755 --- a/labels/label-edit-template.pl +++ b/labels/label-edit-template.pl @@ -22,9 +22,9 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_profiles get_unit_values ); use C4::Labels; my $cgi = CGI->new; diff --git a/labels/label-home.pl b/labels/label-home.pl index 4b3381c33c..3690c506fb 100755 --- a/labels/label-home.pl +++ b/labels/label-home.pl @@ -22,8 +22,8 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 0dc0ea55ff..161fca443b 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -20,18 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw( max min ); -use POSIX qw(ceil); +use POSIX qw( ceil ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search qw(SimpleSearch); -use C4::Biblio qw(TransformMarcToKoha); -use C4::Creators::Lib qw(html_table); +use C4::Search qw( new_record_from_zebra ); +use C4::Biblio qw( TransformMarcToKoha ); +use C4::Creators::Lib qw( html_table ); use Koha::Logger; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Items; use Koha::ItemTypes; use Koha::SearchEngine::Search; diff --git a/labels/label-manage.pl b/labels/label-manage.pl index 05d57c973c..01a7d5babe 100755 --- a/labels/label-manage.pl +++ b/labels/label-manage.pl @@ -21,11 +21,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Data::Dumper; -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_layouts + get_all_profiles + get_all_templates + get_batch_summary + html_table +); use C4::Labels; my $cgi = CGI->new; diff --git a/labels/label-print.pl b/labels/label-print.pl index 0d1e0bba19..f3dd120f18 100755 --- a/labels/label-print.pl +++ b/labels/label-print.pl @@ -20,12 +20,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Data::Dumper; use C4::Context; -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators::Lib qw( + get_all_layouts + get_all_templates + get_output_formats +); use C4::Labels::Batch; my $cgi = CGI->new; diff --git a/labels/spinelabel-home.pl b/labels/spinelabel-home.pl index 3648670af2..b149f31899 100755 --- a/labels/spinelabel-home.pl +++ b/labels/spinelabel-home.pl @@ -17,8 +17,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; # use Smart::Comments; diff --git a/labels/spinelabel-print.pl b/labels/spinelabel-print.pl index ee9a820519..76a6fc5e36 100755 --- a/labels/spinelabel-print.pl +++ b/labels/spinelabel-print.pl @@ -17,8 +17,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $scheme = C4::Context->preference('SpineLabelFormat'); my $query = CGI->new; diff --git a/lib/CGI/Session/Serialize/yamlxs.pm b/lib/CGI/Session/Serialize/yamlxs.pm index 77d2a8d51a..88d25e704d 100644 --- a/lib/CGI/Session/Serialize/yamlxs.pm +++ b/lib/CGI/Session/Serialize/yamlxs.pm @@ -4,7 +4,7 @@ use strict; use warnings; use CGI::Session::ErrorHandler; -use YAML::XS (); +use YAML::XS; $CGI::Session::Serialize::yamlxs::VERSION = '0.1'; @CGI::Session::Serialize::yamlxs::ISA = ( "CGI::Session::ErrorHandler" ); diff --git a/mainpage.pl b/mainpage.pl index 4000324173..0999f58199 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -21,10 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Koha; -use C4::Tags qw/get_count_by_tag_status/; +use C4::Tags qw( get_count_by_tag_status ); use Koha::News; use Koha::Patron::Modifications; use Koha::Patron::Discharge; diff --git a/members/accountline-details.pl b/members/accountline-details.pl index a5c37079aa..699993db76 100755 --- a/members/accountline-details.pl +++ b/members/accountline-details.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Patrons; use Koha::Account::Lines; diff --git a/members/apikeys.pl b/members/apikeys.pl index fb9051d1c4..f6fde368e4 100755 --- a/members/apikeys.pl +++ b/members/apikeys.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use Koha::ApiKeys; use Koha::Patrons; diff --git a/members/boraccount.pl b/members/boraccount.pl index 0cafc5f1ec..b28e665904 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -23,10 +23,10 @@ # along with Koha; if not, see . use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_unescape ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; diff --git a/members/cancel-charge.pl b/members/cancel-charge.pl index 4c655fa174..2f5ff42514 100755 --- a/members/cancel-charge.pl +++ b/members/cancel-charge.pl @@ -19,7 +19,7 @@ use CGI; -use C4::Auth; +use C4::Auth qw( checkauth ); use Koha::Token; my $cgi = CGI->new; diff --git a/members/deletemem.pl b/members/deletemem.pl index 78fd7f1dca..02e3714c75 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -25,13 +25,12 @@ use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Members; -use C4::Suggestions qw( SearchSuggestion ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Suggestions; use Koha::Patrons; use Koha::Token; use Koha::Patron::Categories; diff --git a/members/discharge.pl b/members/discharge.pl index 7e055c6fd8..e0f4b2d8cc 100755 --- a/members/discharge.pl +++ b/members/discharge.pl @@ -28,18 +28,17 @@ =head1 DESCRIPTION =cut use Modern::Perl; -use Carp; +use Carp qw( carp ); use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; use C4::Reserves; use C4::Letters; use Koha::Patron::Discharge; use Koha::Patrons; -use Koha::DateUtils; my $input = CGI->new; diff --git a/members/discharges.pl b/members/discharges.pl index de19751ee0..574f3d9d5e 100755 --- a/members/discharges.pl +++ b/members/discharges.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Context; use Koha::Patron::Discharge; diff --git a/members/files.pl b/members/files.pl index 1cb9d61d29..2abfbc71de 100755 --- a/members/files.pl +++ b/members/files.pl @@ -21,11 +21,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; -use Koha::DateUtils; use Koha::Patrons; use Koha::Patron::Files; use Koha::Patron::Categories; diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl index b5d31ed069..40142eb913 100755 --- a/members/guarantor_search.pl +++ b/members/guarantor_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; diff --git a/members/holdshistory.pl b/members/holdshistory.pl index c05bf43dd3..8564c09a69 100755 --- a/members/holdshistory.pl +++ b/members/holdshistory.pl @@ -19,8 +19,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; diff --git a/members/housebound.pl b/members/housebound.pl index e3c06225b2..c86fad8b33 100755 --- a/members/housebound.pl +++ b/members/housebound.pl @@ -26,11 +26,11 @@ =head1 housebound.pl use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Categories; diff --git a/members/ill-requests.pl b/members/ill-requests.pl index 771d1e7c70..f2b23844c0 100755 --- a/members/ill-requests.pl +++ b/members/ill-requests.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Patrons; my $input = CGI->new; diff --git a/members/mancredit.pl b/members/mancredit.pl index c691bc05a3..943230b15a 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -23,13 +23,12 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; -use C4::Items; use Koha::Items; use Koha::Patrons; diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 3cf02ca7c4..ce1826ad41 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -23,15 +23,14 @@ # along with Koha; if not, see . use Modern::Perl; -use Try::Tiny; -use URI::Escape; +use Try::Tiny qw( catch try ); +use URI::Escape qw( uri_escape_utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; -use C4::Items; use Koha::Token; use Koha::Patrons; diff --git a/members/member-flags.pl b/members/member-flags.pl index e34384044c..900a176ad5 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -7,16 +7,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth qw(:DEFAULT :EditPermissions); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_all_subpermissions get_user_subpermissions ); use C4::Context; -use C4::Members; -#use C4::Acquisitions; use Koha::Patron::Categories; use Koha::Patrons; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Token; my $input = CGI->new; diff --git a/members/member-password.pl b/members/member-password.pl index 879909a491..d44f29d0f7 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -6,20 +6,16 @@ use Modern::Perl; -use C4::Auth; -use Koha::AuthUtils; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Members; -use C4::Circulation; use CGI qw ( -utf8 ); -use Koha::AuthUtils; use Koha::Token; use Koha::Patrons; use Koha::Patron::Categories; -use Try::Tiny; +use Try::Tiny qw( catch try ); my $input = CGI->new; diff --git a/members/member.pl b/members/member.pl index 970015b22e..4b4578cf47 100755 --- a/members/member.pl +++ b/members/member.pl @@ -24,11 +24,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw( -utf8 ); -use Koha::DateUtils; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patrons; my $input = CGI->new; diff --git a/members/memberentry.pl b/members/memberentry.pl index cb5bbf9a3f..5844b9c3f9 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -23,22 +23,20 @@ # external modules use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; # internal modules -use C4::Auth; +use C4::Auth qw( get_template_and_user haspermission ); use C4::Context; -use C4::Output; -use C4::Members; -use C4::Koha; -use C4::Log; -use C4::Letters; +use C4::Output qw( output_and_exit output_and_exit_if_error output_html_with_http_headers ); +use C4::Members qw( checkcardnumber get_cardnumber_length ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Letters qw( SendAlerts ); use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::AuthorisedValues; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments ); use Koha::Cities; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Attribute::Types; diff --git a/members/members-home.pl b/members/members-home.pl index 470f0b5d4e..55b3f3e590 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -19,13 +19,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use Koha::Patron::Modifications; use Koha::Libraries; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patron::Categories; my $query = CGI->new; diff --git a/members/members-update-do.pl b/members/members-update-do.pl index f89f0e2d44..88d021a394 100755 --- a/members/members-update-do.pl +++ b/members/members-update-do.pl @@ -19,7 +19,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Context; use Koha::Patrons; diff --git a/members/members-update.pl b/members/members-update.pl index 6be1924945..9965d495f1 100755 --- a/members/members-update.pl +++ b/members/members-update.pl @@ -20,8 +20,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use Koha::Patron::Attribute::Types; diff --git a/members/merge-patrons.pl b/members/merge-patrons.pl index ca03168b00..5318ff6ff5 100755 --- a/members/merge-patrons.pl +++ b/members/merge-patrons.pl @@ -19,10 +19,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Patrons; diff --git a/members/mod_debarment.pl b/members/mod_debarment.pl index 1b7d4a4e91..977cb2fddd 100755 --- a/members/mod_debarment.pl +++ b/members/mod_debarment.pl @@ -21,9 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use Koha::DateUtils; -use Koha::Patron::Debarments; +use C4::Auth qw( checkauth ); +use Koha::DateUtils qw( dt_from_string ); +use Koha::Patron::Debarments qw( AddDebarment DelDebarment ); my $cgi = CGI->new; diff --git a/members/moremember.pl b/members/moremember.pl index 8586dc9947..af3d324111 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -30,15 +30,14 @@ =head1 moremember.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Form::MessagingPreferences; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Scalar::Util qw( looks_like_number ); use Koha::Patron::Attribute::Types; -use Koha::Patron::Debarments qw(GetDebarments); +use Koha::Patron::Debarments qw( GetDebarments ); use Koha::Patron::Messages; -use Koha::DateUtils; use Koha::CsvProfiles; use Koha::Holds; use Koha::Patrons; diff --git a/members/notices.pl b/members/notices.pl index a43a39e80d..c729d3fb1e 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -20,8 +20,8 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Letters; diff --git a/members/pay.pl b/members/pay.pl index fa7c74a319..27181164ad 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -28,10 +28,10 @@ =head1 pay.pl use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 uri_unescape ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; @@ -42,7 +42,7 @@ =head1 pay.pl use Koha::Items; use Koha::Patron::Categories; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 uri_unescape ); our $input = CGI->new; diff --git a/members/paycollect.pl b/members/paycollect.pl index c30d8969a2..d5cbd60bfc 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -18,13 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape uri_unescape ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Members; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Accounts; use C4::Koha; @@ -34,7 +33,7 @@ use Koha::AuthorisedValues; use Koha::Account; use Koha::Token; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $input = CGI->new(); diff --git a/members/print_overdues.pl b/members/print_overdues.pl index dda9017eec..ead651b630 100755 --- a/members/print_overdues.pl +++ b/members/print_overdues.pl @@ -22,9 +22,9 @@ use CGI; use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Overdues qw(parse_overdues_letter); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Overdues qw( parse_overdues_letter ); use Koha::Patrons; diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl index 2e3dff7b51..d366cc8780 100755 --- a/members/printfeercpt.pl +++ b/members/printfeercpt.pl @@ -20,8 +20,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Letters; use Koha::Account::Lines; diff --git a/members/printinvoice.pl b/members/printinvoice.pl index 97b7f58f17..1f8480ee34 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -20,8 +20,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Letters; use Koha::Account::Lines; diff --git a/members/printslip.pl b/members/printslip.pl index 3fcaf21813..1bb11f68be 100755 --- a/members/printslip.pl +++ b/members/printslip.pl @@ -35,11 +35,9 @@ =head1 moremember.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Members; -use C4::Koha; -use Koha::DateUtils; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Members qw( IssueSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); diff --git a/members/purchase-suggestions.pl b/members/purchase-suggestions.pl index ea42f3c472..6a9725115e 100755 --- a/members/purchase-suggestions.pl +++ b/members/purchase-suggestions.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; -use C4::Suggestions; +use C4::Suggestions qw( SearchSuggestion ); use Koha::Patrons; my $input = CGI->new; diff --git a/members/readingrec.pl b/members/readingrec.pl index e87a6a05e0..b0e2a5b9a1 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -24,11 +24,11 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Members; -use List::MoreUtils qw/any uniq/; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Members qw( GetAllIssues ); +use List::MoreUtils qw( uniq ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Patron::Categories; diff --git a/members/routing-lists.pl b/members/routing-lists.pl index dee5845a0d..81ad7980ab 100755 --- a/members/routing-lists.pl +++ b/members/routing-lists.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth qw/:DEFAULT/; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Members; use C4::Context; use C4::Serials; diff --git a/members/setstatus.pl b/members/setstatus.pl index 66ae8b586c..83ef1590be 100755 --- a/members/setstatus.pl +++ b/members/setstatus.pl @@ -26,9 +26,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); +use C4::Auth qw( checkauth ); use C4::Context; use C4::Members; -use C4::Auth; use Koha::Patrons; diff --git a/members/statistics.pl b/members/statistics.pl index ee3f7874a2..e407eaf025 100755 --- a/members/statistics.pl +++ b/members/statistics.pl @@ -25,11 +25,15 @@ =head1 members/statistics.pl use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Members; -use C4::Members::Statistics; -use C4::Output; +use C4::Members::Statistics qw( + GetPrecedentStateByBorrower + GetTotalIssuesReturnedTodayByBorrower + GetTotalIssuesTodayByBorrower +); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Patrons; use Koha::Patron::Categories; diff --git a/members/summary-print.pl b/members/summary-print.pl index ab052ca2b3..6c6ed923ec 100755 --- a/members/summary-print.pl +++ b/members/summary-print.pl @@ -19,13 +19,12 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; use C4::Circulation qw( GetIssuingCharges ); use C4::Reserves; -use C4::Items; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; use Koha::ItemTypes; use Koha::Patrons; diff --git a/members/update-child.pl b/members/update-child.pl index d2f9c49e3a..f6f3e0ce74 100755 --- a/members/update-child.pl +++ b/members/update-child.pl @@ -29,8 +29,8 @@ =head1 updatechild.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers output_and_exit_if_error output_and_exit ); use Koha::Patrons; use Koha::Patron::Categories; use Koha::Patrons; diff --git a/misc/add_date_fields_to_marc_records.pl b/misc/add_date_fields_to_marc_records.pl index b7ab77c2cb..f619f521c4 100755 --- a/misc/add_date_fields_to_marc_records.pl +++ b/misc/add_date_fields_to_marc_records.pl @@ -18,14 +18,14 @@ use Modern::Perl; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use MARC::Field; use C4::Biblio; diff --git a/misc/admin/set_password.pl b/misc/admin/set_password.pl index 0915143503..2c91c96905 100755 --- a/misc/admin/set_password.pl +++ b/misc/admin/set_password.pl @@ -20,8 +20,8 @@ use Modern::Perl; use Bytes::Random::Secure; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use String::Random; use Koha::Patrons; diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index 5d409cdf1b..7987289895 100755 --- a/misc/background_jobs_worker.pl +++ b/misc/background_jobs_worker.pl @@ -16,8 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); -use Try::Tiny; +use JSON qw( decode_json ); +use Try::Tiny qw( catch try ); use Koha::BackgroundJobs; diff --git a/misc/batchCompareMARCvsFrameworks.pl b/misc/batchCompareMARCvsFrameworks.pl index af8a66796e..ca5c8617ac 100755 --- a/misc/batchCompareMARCvsFrameworks.pl +++ b/misc/batchCompareMARCvsFrameworks.pl @@ -7,7 +7,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -15,10 +15,9 @@ BEGIN use Koha::Script; use C4::Context; use MARC::File::USMARC; -use MARC::Record; use MARC::Batch; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use IO::File; my ( $input_marc_file,$number,$nowarning,$frameworkcode) = ('',0); diff --git a/misc/batchDeleteUnusedSubfields.pl b/misc/batchDeleteUnusedSubfields.pl index a80d4fdd6f..1cfaf3c473 100755 --- a/misc/batchDeleteUnusedSubfields.pl +++ b/misc/batchDeleteUnusedSubfields.pl @@ -6,18 +6,17 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used use Koha::Script; -use MARC::Record; use C4::Context; -use C4::Biblio; -use Time::HiRes qw(gettimeofday); +use C4::Biblio qw( GetMarcStructure ); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $input_marc_file, $number) = ('',0); my ($version, $confirm,$test_parameter); GetOptions( diff --git a/misc/batchImportMARCWithBiblionumbers.pl b/misc/batchImportMARCWithBiblionumbers.pl index f8a12b5c5c..b96e0122aa 100755 --- a/misc/batchImportMARCWithBiblionumbers.pl +++ b/misc/batchImportMARCWithBiblionumbers.pl @@ -6,7 +6,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -14,13 +14,12 @@ BEGIN use Koha::Script; use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcFromKohaField ); use MARC::File::USMARC; use MARC::File::XML; use MARC::Batch; -use Time::HiRes qw(gettimeofday); -use Getopt::Long; +use Time::HiRes qw( gettimeofday ); +use Getopt::Long qw( GetOptions ); use IO::File; my $input_marc_file = ''; diff --git a/misc/batchRebuildBiblioTables.pl b/misc/batchRebuildBiblioTables.pl index edc7c16d33..ce4782f844 100755 --- a/misc/batchRebuildBiblioTables.pl +++ b/misc/batchRebuildBiblioTables.pl @@ -8,7 +8,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -17,10 +17,13 @@ BEGIN use MARC::Record; use C4::Charset; use C4::Context; -use C4::Biblio; -use Time::HiRes qw(gettimeofday); +use C4::Biblio qw( + GetXmlBiblio + TransformMarcToKoha +); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($version, $confirm); GetOptions( diff --git a/misc/batchRebuildItemsTables.pl b/misc/batchRebuildItemsTables.pl index 58630cbded..13f0c4117e 100755 --- a/misc/batchRebuildItemsTables.pl +++ b/misc/batchRebuildItemsTables.pl @@ -2,16 +2,16 @@ use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use MARC::Field; use MARC::Record; -use Pod::Usage; -use Time::HiRes qw(gettimeofday); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( gettimeofday ); use Koha::Script; use C4::Context; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ); +use C4::Items qw( ModItemFromMarc ); =head1 NAME diff --git a/misc/batchRepairMissingBiblionumbers.pl b/misc/batchRepairMissingBiblionumbers.pl index 69e15a6c15..32e9913fd6 100755 --- a/misc/batchRepairMissingBiblionumbers.pl +++ b/misc/batchRepairMissingBiblionumbers.pl @@ -7,14 +7,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ModBiblioMarc ); my $dbh = C4::Context->dbh; diff --git a/misc/batchdeletebiblios.pl b/misc/batchdeletebiblios.pl index 3ae5cd9683..0abe2b4106 100755 --- a/misc/batchdeletebiblios.pl +++ b/misc/batchdeletebiblios.pl @@ -1,12 +1,11 @@ #!/usr/bin/perl use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use IO::File; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( DelBiblio ); my $help; GetOptions( diff --git a/misc/bin/connexion_import_daemon.pl b/misc/bin/connexion_import_daemon.pl index 9d430ffc96..722e2bfa13 100755 --- a/misc/bin/connexion_import_daemon.pl +++ b/misc/bin/connexion_import_daemon.pl @@ -20,7 +20,7 @@ use strict; use warnings; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($help, $config, $daemon); @@ -86,17 +86,17 @@ { package ImportProxyServer; -use Carp; -use IO::Socket::INET; +use Carp qw( croak ); +use IO::Socket::INET qw( SOCK_STREAM ); # use IO::Socket::IP; use IO::Select; -use POSIX; -use HTTP::Status qw(:constants); +use POSIX qw( close exit fork localtime open printf sprintf ); +use HTTP::Status qw( HTTP_FORBIDDEN HTTP_UNAUTHORIZED ); use strict; use warnings; use LWP::UserAgent; -use XML::Simple; +use XML::Simple qw( XMLin ); use MARC::Record; use MARC::File::XML; diff --git a/misc/check_sysprefs.pl b/misc/check_sysprefs.pl index 942d8f27c4..aed792c9ad 100755 --- a/misc/check_sysprefs.pl +++ b/misc/check_sysprefs.pl @@ -8,7 +8,7 @@ use strict; use warnings; -use File::Find; +use File::Find qw( find ); use Koha::Script; use C4::Context; diff --git a/misc/commit_file.pl b/misc/commit_file.pl index 639f7dfb42..2a243439d0 100755 --- a/misc/commit_file.pl +++ b/misc/commit_file.pl @@ -5,14 +5,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::ImportBatch; -use Getopt::Long; +use C4::ImportBatch qw( GetImportBatch BatchCommitRecords BatchRevertRecords ); +use Getopt::Long qw( GetOptions ); $| = 1; diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index f1df975c26..c1d6ac6672 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -38,24 +38,20 @@ =head1 DESCRIPTION use strict; use warnings; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Biblio; use C4::Context; use C4::Letters; use C4::Members; use C4::Members::Messaging; -use C4::Overdues; -use Koha::DateUtils; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Items; use Koha::Libraries; use Koha::Patrons; diff --git a/misc/cronjobs/archive_purchase_suggestions.pl b/misc/cronjobs/archive_purchase_suggestions.pl index bd16600d03..a7c3e8879c 100755 --- a/misc/cronjobs/archive_purchase_suggestions.pl +++ b/misc/cronjobs/archive_purchase_suggestions.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Suggestions; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); my ( $help, $verbose, $confirm, $age, $age_date_field, @statuses ); GetOptions( diff --git a/misc/cronjobs/automatic_checkin.pl b/misc/cronjobs/automatic_checkin.pl index 4eff2d5083..2960b4a83d 100755 --- a/misc/cronjobs/automatic_checkin.pl +++ b/misc/cronjobs/automatic_checkin.pl @@ -20,7 +20,7 @@ use Modern::Perl; use Koha::Checkouts; use Koha::Script -cron; -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); diff --git a/misc/cronjobs/automatic_item_modification_by_age.pl b/misc/cronjobs/automatic_item_modification_by_age.pl index e944ac8c11..a4e5538430 100755 --- a/misc/cronjobs/automatic_item_modification_by_age.pl +++ b/misc/cronjobs/automatic_item_modification_by_age.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use JSON; use Koha::Script -cron; use C4::Context; use C4::Items; -use C4::Log; +use C4::Log qw( cronlogaction ); # Getting options my ( $verbose, $help, $confirm ); diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl index 7b4158b969..cb45e68cbd 100755 --- a/misc/cronjobs/automatic_renewals.pl +++ b/misc/cronjobs/automatic_renewals.pl @@ -75,13 +75,13 @@ =head1 OPTIONS =cut use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Circulation; +use C4::Circulation qw( CanBookBeRenewed AddRenewal ); use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use C4::Letters; use Koha::Checkouts; use Koha::Libraries; diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl index ea63dfa01d..6e05d36ce9 100755 --- a/misc/cronjobs/batch_anonymise.pl +++ b/misc/cronjobs/batch_anonymise.pl @@ -19,25 +19,21 @@ use strict; use warnings; -use Carp; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; use Koha::Patrons; -use Date::Calc qw( - Today - Add_Delta_Days -); -use Getopt::Long; -use C4::Log; +use Date::Calc qw( Add_Delta_Days Today ); +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); sub usage { print STDERR <. use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use AnyEvent; -use AnyEvent::HTTP; -use Encode; +use AnyEvent::HTTP qw( http_request ); +use Encode qw( encode_utf8 ); my ( $verbose, $help, $html ) = ( 0, 0, 0 ); my ( $host, $host_intranet ) = ( '', '' ); diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 1897111496..94a6301620 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -31,7 +31,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } @@ -39,9 +39,9 @@ BEGIN use C4::Context; use C4::Search; use C4::Search::History; -use Getopt::Long; -use C4::Log; -use C4::Accounts; +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); +use C4::Accounts qw( purge_zero_balance_fees ); use Koha::UploadedFiles; use Koha::Old::Biblios; use Koha::Old::Items; diff --git a/misc/cronjobs/cloud-kw.pl b/misc/cronjobs/cloud-kw.pl index 3dadf998a7..d6e64be902 100755 --- a/misc/cronjobs/cloud-kw.pl +++ b/misc/cronjobs/cloud-kw.pl @@ -21,14 +21,14 @@ use strict; use warnings; use diagnostics; -use Carp; +use Carp qw( carp croak ); use YAML::XS; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); my $verbose = 0; my $help = 0; @@ -97,7 +97,7 @@ package ZebraIndex; use strict; use warnings; use diagnostics; -use Carp; +use Carp qw( carp croak ); sub new { my $self = {}; diff --git a/misc/cronjobs/create_koc_db.pl b/misc/cronjobs/create_koc_db.pl index 3d92fe5aa3..a9704d7a15 100755 --- a/misc/cronjobs/create_koc_db.pl +++ b/misc/cronjobs/create_koc_db.pl @@ -92,8 +92,8 @@ =head1 SEE ALSO $|++; use DBI; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl index df5d23aa66..93a00c6c1f 100755 --- a/misc/cronjobs/delete_items.pl +++ b/misc/cronjobs/delete_items.pl @@ -1,13 +1,11 @@ #! /usr/bin/perl -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Items; -use C4::Circulation; use Modern::Perl; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); my $dbh = C4::Context->dbh(); diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl index d0847c8b62..37a1529975 100755 --- a/misc/cronjobs/delete_patrons.pl +++ b/misc/cronjobs/delete_patrons.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Members; -use Koha::DateUtils; +use C4::Members qw( GetBorrowersToExpunge ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; -use C4::Log; +use C4::Log qw( cronlogaction ); my ( $help, $verbose, $not_borrowed_since, $expired_before, $last_seen, @category_code, $branchcode, $file, $confirm ); diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index 0287e43f57..8456f42c04 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/misc/cronjobs/delete_records_via_leader.pl @@ -27,15 +27,14 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( DelBiblio ); use Koha::Database; use Koha::Biblios; use Koha::Biblio::Metadatas; diff --git a/misc/cronjobs/edi_cron.pl b/misc/cronjobs/edi_cron.pl index ff6ef95bcc..90f9fed681 100755 --- a/misc/cronjobs/edi_cron.pl +++ b/misc/cronjobs/edi_cron.pl @@ -33,10 +33,10 @@ use C4::Context; use Log::Log4perl qw(:easy); use Koha::Database; -use Koha::EDI qw( process_quote process_invoice process_ordrsp); +use Koha::EDI qw( process_quote process_invoice process_ordrsp ); use Koha::Edifact::Transport; use Koha::Plugins::Handler; -use Fcntl qw( :DEFAULT :flock :seek ); +use Fcntl qw( LOCK_EX O_CREAT O_RDWR SEEK_SET ); my $logdir = C4::Context->config('logdir'); diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index afc6b4d556..3edf6ed736 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -32,16 +32,16 @@ use Koha::Script -cron; use C4::Context; -use C4::Overdues; -use Getopt::Long; -use Carp; +use C4::Overdues qw( Getoverdues CalcFine UpdateFine ); +use Getopt::Long qw( GetOptions ); +use Carp qw( carp croak ); use File::Spec; -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; -use C4::Log; +use C4::Log qw( cronlogaction ); my $help; my $verbose; diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 8c369e8c31..a777acbbcf 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -5,22 +5,22 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy +use CGI; # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy use Koha::Script -cron; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetPrintMessages ); use C4::Templates; use File::Spec; -use Pod::Usage; -use Getopt::Long; -use C4::Log; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); -use Koha::DateUtils; -use Koha::Util::OpenDocument; +use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::Util::OpenDocument qw( generate_ods ); use MIME::Lite; my ( diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl index eb4fd874a7..fdaa350159 100755 --- a/misc/cronjobs/holds/auto_unsuspend_holds.pl +++ b/misc/cronjobs/holds/auto_unsuspend_holds.pl @@ -23,7 +23,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } @@ -31,7 +31,7 @@ BEGIN use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index ab138f9183..6e1437dcd3 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/misc/cronjobs/holds/build_holds_queue.pl @@ -11,13 +11,13 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::HoldsQueue qw(CreateQueue); -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl index 4932bbf346..0af02558e3 100755 --- a/misc/cronjobs/holds/cancel_expired_holds.pl +++ b/misc/cronjobs/holds/cancel_expired_holds.pl @@ -39,19 +39,19 @@ =head1 DESCRIPTION =cut use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); =head1 OPTIONS diff --git a/misc/cronjobs/holds/cancel_unfilled_holds.pl b/misc/cronjobs/holds/cancel_unfilled_holds.pl index ba6a40098a..10952695b5 100755 --- a/misc/cronjobs/holds/cancel_unfilled_holds.pl +++ b/misc/cronjobs/holds/cancel_unfilled_holds.pl @@ -21,19 +21,18 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Holds; use Koha::Calendar; -use Koha::DateUtils; use Koha::Libraries; cronlogaction(); diff --git a/misc/cronjobs/holds/holds_reminder.pl b/misc/cronjobs/holds/holds_reminder.pl index 356e3ba08f..a255d8de6e 100755 --- a/misc/cronjobs/holds/holds_reminder.pl +++ b/misc/cronjobs/holds/holds_reminder.pl @@ -21,20 +21,19 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; -use Text::CSV_XS; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use DateTime; use DateTime::Duration; use C4::Context; use C4::Letters; -use C4::Log; -use Koha::DateUtils; +use C4::Log qw( cronlogaction ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Calendar; use Koha::Libraries; use Koha::Notice::Templates; diff --git a/misc/cronjobs/import_webservice_batch.pl b/misc/cronjobs/import_webservice_batch.pl index aa18edce51..5925be2ea6 100755 --- a/misc/cronjobs/import_webservice_batch.pl +++ b/misc/cronjobs/import_webservice_batch.pl @@ -25,14 +25,13 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::ImportBatch; +use C4::ImportBatch qw( BatchCommitRecords ); my ($help, $framework); diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index c12a95d6f2..dd12b6c104 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -30,17 +30,16 @@ =head1 NAME BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); -use C4::Circulation qw/LostItem MarkIssueReturned/; +use C4::Circulation qw( LostItem MarkIssueReturned ); use C4::Context; -use C4::Items; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::ItemTypes; use Koha::Patron::Categories; use Koha::Patrons; diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index c140820ea5..7a043f8e36 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -116,20 +116,19 @@ =head1 CONFIGURATION =cut use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; use C4::Letters; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Patrons; diff --git a/misc/cronjobs/merge_authorities.pl b/misc/cronjobs/merge_authorities.pl index 727d7d5f8c..1645cfdda4 100755 --- a/misc/cronjobs/merge_authorities.pl +++ b/misc/cronjobs/merge_authorities.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Time::HiRes qw(gettimeofday); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( gettimeofday ); use Koha::Script -cron; use C4::AuthoritiesMarc; diff --git a/misc/cronjobs/notice_unprocessed_suggestions.pl b/misc/cronjobs/notice_unprocessed_suggestions.pl index d2870b2372..6567c35d75 100755 --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ b/misc/cronjobs/notice_unprocessed_suggestions.pl @@ -2,12 +2,12 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Budgets qw( GetBudget ); -use C4::Suggestions qw( GetUnprocessedSuggestions ); +use C4::Budgets; +use C4::Suggestions; use Koha::Libraries; use Koha::Patrons; diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index c18997db35..a1c2211628 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -24,12 +24,12 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Text::CSV_XS; use DateTime; use DateTime::Duration; @@ -37,10 +37,10 @@ BEGIN use Koha::Script -cron; use C4::Context; use C4::Letters; -use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); -use C4::Log; -use Koha::Patron::Debarments qw(AddUniqueDebarment); -use Koha::DateUtils; +use C4::Overdues qw( GetOverdueMessageTransportTypes parse_overdues_letter ); +use C4::Log qw( cronlogaction ); +use Koha::Patron::Debarments qw( AddUniqueDebarment ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Calendar; use Koha::Libraries; use Koha::Acquisition::Currencies; diff --git a/misc/cronjobs/patron_emailer.pl b/misc/cronjobs/patron_emailer.pl index 67a33dedfb..a265b762a9 100755 --- a/misc/cronjobs/patron_emailer.pl +++ b/misc/cronjobs/patron_emailer.pl @@ -21,16 +21,16 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); -use C4::Log; -use C4::Reports::Guided; +use C4::Log qw( cronlogaction ); +use C4::Reports::Guided qw( EmailReport ); cronlogaction(); diff --git a/misc/cronjobs/plugins_nightly.pl b/misc/cronjobs/plugins_nightly.pl index f748637e1e..a90423e749 100755 --- a/misc/cronjobs/plugins_nightly.pl +++ b/misc/cronjobs/plugins_nightly.pl @@ -2,10 +2,10 @@ use Modern::Perl; -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Logger; use Koha::Plugins; use Koha::Script -cron; diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index a903f1e06d..5ad1b2f79b 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -22,15 +22,15 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Letters; -use C4::Log; -use Getopt::Long; -use Try::Tiny; +use C4::Letters qw( SendQueuedMessages ); +use C4::Log qw( cronlogaction ); +use Getopt::Long qw( GetOptions ); +use Try::Tiny qw( catch try ); my $username = undef; my $password = undef; diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl index 9fdc26d566..881ad7d4ea 100755 --- a/misc/cronjobs/purge_suggestions.pl +++ b/misc/cronjobs/purge_suggestions.pl @@ -22,16 +22,15 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Suggestions; -use C4::Log; +use C4::Log qw( cronlogaction ); use C4::Context; my ( $help, $days, $confirm ); diff --git a/misc/cronjobs/reconcile_balances.pl b/misc/cronjobs/reconcile_balances.pl index 0202de9450..4c55836091 100755 --- a/misc/cronjobs/reconcile_balances.pl +++ b/misc/cronjobs/reconcile_balances.pl @@ -51,19 +51,19 @@ =head1 OPTIONS use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Try::Tiny; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Account::Lines; use Koha::Patrons; diff --git a/misc/cronjobs/rss/rss.pl b/misc/cronjobs/rss/rss.pl index e703d07a79..d107411044 100755 --- a/misc/cronjobs/rss/rss.pl +++ b/misc/cronjobs/rss/rss.pl @@ -31,8 +31,7 @@ use Koha::Script -cron; use C4::Context; -use Time::Local; -use POSIX; +use POSIX qw( close localtime open strftime ); my $dbh = C4::Context->dbh; my $file = $ARGV[0]; diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index 3e81e08a97..710de44f3d 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -21,27 +21,27 @@ use Modern::Perl; use Koha::Script -cron; -use C4::Reports::Guided; # 0.12 +use C4::Reports::Guided qw( store_results execute_query ); use Koha::Reports; use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Email; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::SMTP::Servers; -use Getopt::Long qw(:config auto_help auto_version); -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Text::CSV::Encoded; use CGI qw ( -utf8 ); -use Carp; -use Encode; +use Carp qw( carp ); +use Encode qw( decode ); use JSON qw( to_json ); -use Try::Tiny; +use Try::Tiny qw( catch try ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl index 03843b9d2f..53d60071b4 100755 --- a/misc/cronjobs/serialsUpdate.pl +++ b/misc/cronjobs/serialsUpdate.pl @@ -24,20 +24,20 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; -use C4::Serials; -use C4::Log; -use Koha::DateUtils; +use C4::Serials qw( GetSubscription GetNextDate ModSerialStatus ); use C4::Serials::Frequency; +use C4::Log qw( cronlogaction ); +use Koha::DateUtils qw( dt_from_string output_pref ); -use Date::Calc qw/Date_to_Days check_date/; -use Getopt::Long; -use Pod::Usage; +use Date::Calc qw( check_date Date_to_Days ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); =head1 NAME diff --git a/misc/cronjobs/share_usage_with_koha_community.pl b/misc/cronjobs/share_usage_with_koha_community.pl index a427ca037b..fa6d59850f 100755 --- a/misc/cronjobs/share_usage_with_koha_community.pl +++ b/misc/cronjobs/share_usage_with_koha_community.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; use C4::UsageStats; -use C4::Log; -use POSIX qw(strftime); +use C4::Log qw( cronlogaction ); +use POSIX qw( strftime ); my ( $help, $verbose, $force, $quiet ); GetOptions( diff --git a/misc/cronjobs/sitemap.pl b/misc/cronjobs/sitemap.pl index fb738e0823..93abb02ed0 100755 --- a/misc/cronjobs/sitemap.pl +++ b/misc/cronjobs/sitemap.pl @@ -21,11 +21,10 @@ package Main; use Modern::Perl; use utf8; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Biblio; use Koha::Sitemapper; diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl index 0966cb6134..6d7cf733c4 100755 --- a/misc/cronjobs/staticfines.pl +++ b/misc/cronjobs/staticfines.pl @@ -31,22 +31,20 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } -use Date::Calc qw/Date_to_Days/; +use Date::Calc qw( Date_to_Days ); use Koha::Script -cron; use C4::Context; -use C4::Circulation; -use C4::Overdues; +use C4::Overdues qw( CalcFine checkoverdues GetFine Getoverdues ); use C4::Calendar qw(); # don't need any exports from Calendar -use C4::Biblio; -use C4::Log; -use Getopt::Long; -use List::MoreUtils qw/none/; -use Koha::DateUtils; +use C4::Log qw( cronlogaction ); +use Getopt::Long qw( GetOptions ); +use List::MoreUtils qw( none ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; my $help = 0; diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl index 3a30d58226..1298921f9b 100755 --- a/misc/cronjobs/stockrotation.pl +++ b/misc/cronjobs/stockrotation.pl @@ -108,7 +108,7 @@ =head2 What does the --execute flag do? =cut use Modern::Perl; -use Getopt::Long qw/HelpMessage :config gnu_getopt/; +use Getopt::Long qw( GetOptions HelpMessage ); use Koha::Script -cron; use C4::Context; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl index f00d9d6a34..6be0226433 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl @@ -24,12 +24,12 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index 83b8a1a442..fedc3cf888 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -24,20 +24,19 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; -use C4::Items; use C4::Letters; use C4::Overdues; use Koha::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::Libraries; diff --git a/misc/cronjobs/update_patrons_category.pl b/misc/cronjobs/update_patrons_category.pl index fd4bc4a7ea..542cc307c4 100755 --- a/misc/cronjobs/update_patrons_category.pl +++ b/misc/cronjobs/update_patrons_category.pl @@ -20,17 +20,17 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use C4::Context; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Logger; use Koha::Patrons; use Koha::Patron::Categories; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Script -cron; =head1 NAME diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl index f1b621b344..b3a6c2f503 100755 --- a/misc/cronjobs/update_totalissues.pl +++ b/misc/cronjobs/update_totalissues.pl @@ -24,22 +24,22 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; -use Koha::DateUtils qw/ dt_from_string /; +use Koha::DateUtils qw( dt_from_string ); use C4::Context; -use C4::Biblio; -use C4::Log; +use C4::Biblio qw( UpdateTotalIssues ); +use C4::Log qw( cronlogaction ); use DateTime; use DateTime::Format::MySQL; -use Time::HiRes qw/time/; -use POSIX qw/strftime ceil/; +use Time::HiRes qw( time ); +use POSIX qw( ceil strftime ); sub usage { pod2usage( -verbose => 2 ); diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index ae2ee9c0de..9b207a59e5 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/misc/cronjobs/writeoff_debts.pl @@ -3,11 +3,11 @@ use Modern::Perl; use feature 'say'; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Account::Lines; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Script -cron; diff --git a/misc/devel/add_missing_filters.pl b/misc/devel/add_missing_filters.pl index cc1b877e1e..51e7c1da5a 100755 --- a/misc/devel/add_missing_filters.pl +++ b/misc/devel/add_missing_filters.pl @@ -2,9 +2,9 @@ use Modern::Perl; -use File::Slurp; -use Pod::Usage; -use Getopt::Long; +use File::Slurp qw( read_file write_file ); +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use t::lib::QA::TemplateFilters; diff --git a/misc/devel/coverage.pl b/misc/devel/coverage.pl index 3dabae72bc..a4d09344cc 100755 --- a/misc/devel/coverage.pl +++ b/misc/devel/coverage.pl @@ -48,9 +48,9 @@ =head1 OPTIONS use Modern::Perl; use C4::Context; -use Cwd; -use Getopt::Long; -use Pod::Usage; +use Cwd qw( getcwd ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my $help; diff --git a/misc/devel/create_superlibrarian.pl b/misc/devel/create_superlibrarian.pl index 28c67b66d8..c0ab6fe6c6 100755 --- a/misc/devel/create_superlibrarian.pl +++ b/misc/devel/create_superlibrarian.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Patrons; diff --git a/misc/devel/get_prepared_letter.pl b/misc/devel/get_prepared_letter.pl index 45f5544d82..5ef852cb25 100755 --- a/misc/devel/get_prepared_letter.pl +++ b/misc/devel/get_prepared_letter.pl @@ -69,11 +69,11 @@ =head1 OPTIONS use Modern::Perl; -use Getopt::Long; -use JSON; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use JSON qw( decode_json ); +use Pod::Usage qw( pod2usage ); -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); my $help; my ( $module, $letter_code, $branchcode, $message_transport_type, $lang, diff --git a/misc/devel/install_plugins.pl b/misc/devel/install_plugins.pl index 0177d733b4..8e2cee9ad9 100755 --- a/misc/devel/install_plugins.pl +++ b/misc/devel/install_plugins.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; diff --git a/misc/devel/update_dbix_class_files.pl b/misc/devel/update_dbix_class_files.pl index 7e00b8f447..747c000708 100755 --- a/misc/devel/update_dbix_class_files.pl +++ b/misc/devel/update_dbix_class_files.pl @@ -21,8 +21,8 @@ use Modern::Perl; use DBIx::Class::Schema::Loader qw/ make_schema_at /; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my %db_defaults = ( driver => 'mysql', diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl index 27292189e9..1a2dd7fab6 100755 --- a/misc/export_borrowers.pl +++ b/misc/export_borrowers.pl @@ -21,7 +21,7 @@ use Modern::Perl; use Text::CSV; -use Getopt::Long qw(:config no_ignore_case); +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; diff --git a/misc/export_records.pl b/misc/export_records.pl index 2a05e794df..32658cb8c8 100755 --- a/misc/export_records.pl +++ b/misc/export_records.pl @@ -18,9 +18,9 @@ use Modern::Perl; use MARC::File::XML; -use List::MoreUtils qw(uniq); -use Getopt::Long; -use Pod::Usage; +use List::MoreUtils qw( uniq ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::Auth; diff --git a/misc/exportauth.pl b/misc/exportauth.pl index c036b17063..d2ccebf614 100755 --- a/misc/exportauth.pl +++ b/misc/exportauth.pl @@ -8,13 +8,12 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; use C4::Auth; my $outfile = $ARGV[0]; open(my $fh, '>', $outfile) or die $!; diff --git a/misc/import_patrons.pl b/misc/import_patrons.pl index ee0d8a92c9..85f7983cab 100755 --- a/misc/import_patrons.pl +++ b/misc/import_patrons.pl @@ -19,8 +19,8 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Patrons::Import; diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl index e7df4d57f6..21e4cc31bb 100755 --- a/misc/link_bibs_to_authorities.pl +++ b/misc/link_bibs_to_authorities.pl @@ -7,19 +7,23 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; -use Time::HiRes qw/time/; -use POSIX qw/strftime ceil/; -use Module::Load::Conditional qw(can_load); +use C4::Biblio qw( + GetFrameworkCode + GetMarcBiblio + LinkBibHeadingsToAuthorities + ModBiblio +); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( time ); +use POSIX qw( ceil strftime ); +use Module::Load::Conditional qw( can_load ); sub usage { pod2usage( -verbose => 2 ); diff --git a/misc/load_testing/benchmark_circulation.pl b/misc/load_testing/benchmark_circulation.pl index 36ab41881f..83ddea5461 100755 --- a/misc/load_testing/benchmark_circulation.pl +++ b/misc/load_testing/benchmark_circulation.pl @@ -7,13 +7,12 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use HTTPD::Bench::ApacheBench; use LWP::UserAgent; -use Data::Dumper; use HTTP::Cookies; use C4::Context; diff --git a/misc/load_testing/benchmark_staff.pl b/misc/load_testing/benchmark_staff.pl index b2596885d2..f42c4d5eaf 100755 --- a/misc/load_testing/benchmark_staff.pl +++ b/misc/load_testing/benchmark_staff.pl @@ -7,17 +7,16 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use HTTPD::Bench::ApacheBench; use LWP::UserAgent; -use Data::Dumper; use HTTP::Cookies; use C4::Context; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use Koha::Patrons; my ($help, $steps, $baseurl, $max_tries, $user, $password,$short_print); diff --git a/misc/load_testing/benchmark_webservices.pl b/misc/load_testing/benchmark_webservices.pl index e79067d0ea..2ccd15bf73 100755 --- a/misc/load_testing/benchmark_webservices.pl +++ b/misc/load_testing/benchmark_webservices.pl @@ -16,8 +16,7 @@ # # Requires LWP::UserAgent, File::Slurp. use LWP::UserAgent; -use File::Slurp qw(slurp); -use Carp; +use File::Slurp qw( slurp ); my $ua = LWP::UserAgent->new(); $ua->cookie_jar({ file =>"cookies.txt" }); my $baseurl = shift; diff --git a/misc/load_yaml.pl b/misc/load_yaml.pl index 362a251250..873e69ed2c 100755 --- a/misc/load_yaml.pl +++ b/misc/load_yaml.pl @@ -20,7 +20,7 @@ use Modern::Perl; use Koha::Script; -use Getopt::Long qw(:config no_ignore_case); +use Getopt::Long qw( GetOptions ); use C4::Context; use C4::Installer; diff --git a/misc/maintenance/UNIMARC_fix_collectiontitle.pl b/misc/maintenance/UNIMARC_fix_collectiontitle.pl index 4a97c18e56..d28163a9b9 100755 --- a/misc/maintenance/UNIMARC_fix_collectiontitle.pl +++ b/misc/maintenance/UNIMARC_fix_collectiontitle.pl @@ -8,12 +8,11 @@ use warnings; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; sub process { diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl index 23ac37ec28..1a4b864822 100755 --- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl +++ b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl @@ -8,13 +8,13 @@ use warnings; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; -use Getopt::Long; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); +use Getopt::Long qw( GetOptions ); sub _read_marc_code { my $input = shift; diff --git a/misc/maintenance/auth_show_hidden_data.pl b/misc/maintenance/auth_show_hidden_data.pl index 91006d1761..fdab635768 100755 --- a/misc/maintenance/auth_show_hidden_data.pl +++ b/misc/maintenance/auth_show_hidden_data.pl @@ -22,8 +22,8 @@ # which hidden fields in the framework still contain data. use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Authorities; diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index 0e30596879..9a0b1c0f08 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -22,15 +22,15 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; use C4::Members::Messaging; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); sub usage { diff --git a/misc/maintenance/check_syspref_cache.pl b/misc/maintenance/check_syspref_cache.pl index a25b977bda..9328988baf 100755 --- a/misc/maintenance/check_syspref_cache.pl +++ b/misc/maintenance/check_syspref_cache.pl @@ -16,8 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Encode qw( encode_utf8 ); use Koha::Script; diff --git a/misc/maintenance/cmp_sysprefs.pl b/misc/maintenance/cmp_sysprefs.pl index 90b21a7c02..1a7afdf63a 100755 --- a/misc/maintenance/cmp_sysprefs.pl +++ b/misc/maintenance/cmp_sysprefs.pl @@ -27,8 +27,8 @@ use Modern::Perl; use open OUT => ':encoding(UTF-8)', ':std'; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::Context; diff --git a/misc/maintenance/fix_accountlines_date.pl b/misc/maintenance/fix_accountlines_date.pl index 0c7a92e178..fb9ceacf3d 100755 --- a/misc/maintenance/fix_accountlines_date.pl +++ b/misc/maintenance/fix_accountlines_date.pl @@ -22,15 +22,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use Getopt::Long; -use Pod::Usage; -use Koha::DateUtils; +use Getopt::Long qw( GetOptions ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME diff --git a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl index 4a72e1a0f2..fd9d04751d 100755 --- a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl +++ b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl @@ -23,15 +23,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Installer; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Data::Dumper; sub print_usage { diff --git a/misc/maintenance/fix_mysql_constraints.pl b/misc/maintenance/fix_mysql_constraints.pl index e2920e8fd4..b1784a01ef 100755 --- a/misc/maintenance/fix_mysql_constraints.pl +++ b/misc/maintenance/fix_mysql_constraints.pl @@ -21,14 +21,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); my $lib = "$FindBin::Bin/../kohalib.pl"; eval { require $lib }; } -use Getopt::Long; -use Pod::Usage; -use Try::Tiny; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); use Koha::Script; use C4::Context; diff --git a/misc/maintenance/fix_tags_weight.pl b/misc/maintenance/fix_tags_weight.pl index a1f8085edd..ff7e3d7835 100755 --- a/misc/maintenance/fix_tags_weight.pl +++ b/misc/maintenance/fix_tags_weight.pl @@ -28,8 +28,8 @@ use Koha::Tags::Approvals; use Koha::Tags::Indexes; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); =head1 NAME diff --git a/misc/maintenance/generate_MARC21Languages.pl b/misc/maintenance/generate_MARC21Languages.pl index be27b6e635..8a70a4f448 100755 --- a/misc/maintenance/generate_MARC21Languages.pl +++ b/misc/maintenance/generate_MARC21Languages.pl @@ -19,10 +19,10 @@ # use Modern::Perl; -use XML::Simple; -use Pod::Usage; -use Getopt::Long; -use Carp; +use XML::Simple qw( XMLin ); +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); +use Carp qw( croak ); use open ':std', ':encoding(UTF-8)'; diff --git a/misc/maintenance/process_record_through_filter.pl b/misc/maintenance/process_record_through_filter.pl index a9d92d33ad..8259e31566 100755 --- a/misc/maintenance/process_record_through_filter.pl +++ b/misc/maintenance/process_record_through_filter.pl @@ -9,8 +9,7 @@ use Koha::Script; use Koha::RecordProcessor; -use Data::Dumper; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); my $record = GetMarcBiblio({ biblionumber => $ARGV[0] }); diff --git a/misc/maintenance/remove_items_from_biblioitems.pl b/misc/maintenance/remove_items_from_biblioitems.pl index d78ad696ad..029e1e9ef0 100755 --- a/misc/maintenance/remove_items_from_biblioitems.pl +++ b/misc/maintenance/remove_items_from_biblioitems.pl @@ -24,8 +24,8 @@ use Koha::Script; use C4::Context; -use C4::Biblio; -use Getopt::Long; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblio ); +use Getopt::Long qw( GetOptions ); my ($wherestring, $run, $silent, $want_help); my $result = GetOptions( diff --git a/misc/maintenance/sanitize_records.pl b/misc/maintenance/sanitize_records.pl index f9084e8e3b..2aa9f02a3f 100755 --- a/misc/maintenance/sanitize_records.pl +++ b/misc/maintenance/sanitize_records.pl @@ -20,12 +20,11 @@ use Modern::Perl; use Koha::Script; -use C4::Charset qw( SanitizeRecord ); +use C4::Charset; use C4::Context; -use DBI; use C4::Biblio; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my ( $help, $verbose, $confirm, $biblionumbers, $reindex, $filename, $auto_search, $fix_ampersand ); diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl index 433f668040..a23e7abdc7 100755 --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ b/misc/maintenance/search_for_data_inconsistencies.pl @@ -25,7 +25,7 @@ use Koha::Biblioitems; use Koha::Items; use Koha::ItemTypes; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); { my $items = Koha::Items->search({ -or => { homebranch => undef, holdingbranch => undef }}); diff --git a/misc/maintenance/touch_all_biblios.pl b/misc/maintenance/touch_all_biblios.pl index 8d65f21eed..be349cfb19 100755 --- a/misc/maintenance/touch_all_biblios.pl +++ b/misc/maintenance/touch_all_biblios.pl @@ -22,17 +22,17 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # possible modules to use -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; -use C4::Biblio; -use Pod::Usage; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); +use Pod::Usage qw( pod2usage ); sub usage { diff --git a/misc/maintenance/touch_all_items.pl b/misc/maintenance/touch_all_items.pl index dbf1609221..087914498e 100755 --- a/misc/maintenance/touch_all_items.pl +++ b/misc/maintenance/touch_all_items.pl @@ -22,18 +22,17 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # possible modules to use -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; -use C4::Items; use Koha::Items; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); sub usage { diff --git a/misc/maintenance/update_authorities.pl b/misc/maintenance/update_authorities.pl index 6750ab1e4f..e4bf74df06 100755 --- a/misc/maintenance/update_authorities.pl +++ b/misc/maintenance/update_authorities.pl @@ -19,9 +19,9 @@ use Modern::Perl; -use Getopt::Long; -use List::MoreUtils qw/uniq/; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use List::MoreUtils qw( uniq ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/; diff --git a/misc/migration_tools/22_to_30/convert_to_utf8.pl b/misc/migration_tools/22_to_30/convert_to_utf8.pl index fbbff89c60..d854b0c6d3 100755 --- a/misc/migration_tools/22_to_30/convert_to_utf8.pl +++ b/misc/migration_tools/22_to_30/convert_to_utf8.pl @@ -9,7 +9,7 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl index 479981c94e..d4531a3ffc 100755 --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ b/misc/migration_tools/22_to_30/export_Authorities.pl @@ -3,15 +3,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; #use MARC::File::XML(BinaryEncoding=>"utf8"); #use MARC::File::USMARC; -use MARC::Record; use C4::AuthoritiesMarc; -use POSIX; +use POSIX qw( close localtime sprintf time ); #MARC::File::XML::default_record_format("UNIMARCAUTH"); my $dbh = C4::Context->dbh; my $rq= $dbh->prepare(qq| diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index 6c917088a7..4145fc33b0 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -3,14 +3,13 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; use MARC::File::XML(BinaryEncoding=>"utf8"); -use MARC::Record; use C4::AuthoritiesMarc; -use POSIX; +use POSIX qw( close localtime open sprintf time ); MARC::File::XML::default_record_format("UNIMARCAUTH"); my $dbh = C4::Context->dbh; my $rq= $dbh->prepare(qq| diff --git a/misc/migration_tools/22_to_30/missing090field.pl b/misc/migration_tools/22_to_30/missing090field.pl index b54bf9285d..80861b1865 100755 --- a/misc/migration_tools/22_to_30/missing090field.pl +++ b/misc/migration_tools/22_to_30/missing090field.pl @@ -7,15 +7,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblioMarc ); use MARC::File::USMARC; $|=1; diff --git a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl b/misc/migration_tools/22_to_30/move_marc_to_authheader.pl index f5e4b43288..8a5ffa9354 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_authheader.pl @@ -7,7 +7,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl index 386831e8b9..e4429a7d9e 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl @@ -5,11 +5,10 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; -use C4::Biblio; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); diff --git a/misc/migration_tools/22_to_30/rebuild_leader.pl b/misc/migration_tools/22_to_30/rebuild_leader.pl index 2d402c5bb5..885ba459b2 100755 --- a/misc/migration_tools/22_to_30/rebuild_leader.pl +++ b/misc/migration_tools/22_to_30/rebuild_leader.pl @@ -7,15 +7,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( ModBiblioMarc ); use MARC::File::USMARC; diff --git a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl b/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl index 0988e5631d..c9eddb5fc6 100755 --- a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl +++ b/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl @@ -7,15 +7,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio ModBiblioMarc ); use MARC::File::USMARC; diff --git a/misc/migration_tools/buildCOUNTRY.pl b/misc/migration_tools/buildCOUNTRY.pl index af0bf216f2..9329ac0e59 100755 --- a/misc/migration_tools/buildCOUNTRY.pl +++ b/misc/migration_tools/buildCOUNTRY.pl @@ -8,11 +8,10 @@ # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $fields, $number,$language) = ('',0); my ($version, $verbose, $test_parameter, $delete); GetOptions( diff --git a/misc/migration_tools/buildEDITORS.pl b/misc/migration_tools/buildEDITORS.pl index bb11d45881..a6f1d8baa2 100755 --- a/misc/migration_tools/buildEDITORS.pl +++ b/misc/migration_tools/buildEDITORS.pl @@ -10,11 +10,11 @@ use MARC::Batch; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $input_marc_file, $number) = ('',0); my ($version, $verbose, $test_parameter, $confirm,$delete); GetOptions( diff --git a/misc/migration_tools/buildLANG.pl b/misc/migration_tools/buildLANG.pl index b1174ab8d3..bdef6dd9d3 100755 --- a/misc/migration_tools/buildLANG.pl +++ b/misc/migration_tools/buildLANG.pl @@ -8,11 +8,10 @@ # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $fields, $number,$language) = ('',0); my ($version, $verbose, $test_parameter, $delete); GetOptions( diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl index c7b73a2d7d..00f92c8fe7 100755 --- a/misc/migration_tools/build_oai_sets.pl +++ b/misc/migration_tools/build_oai_sets.pl @@ -39,14 +39,22 @@ =head1 USAGE use Modern::Perl; use MARC::Record; use MARC::File::XML; -use List::MoreUtils qw/uniq/; -use Getopt::Std; +use List::MoreUtils qw( uniq ); +use Getopt::Std qw( getopts ); use Koha::Script; use C4::Context; -use C4::Charset qw/StripNonXmlChars/; +use C4::Charset qw( StripNonXmlChars ); use C4::Biblio; -use C4::OAI::Sets; +use C4::OAI::Sets qw( + AddOAISetsBiblios + CalcOAISetsBiblio + GetOAISet + GetOAISetBySpec + GetOAISets + GetOAISetsMappings + ModOAISetsBiblios +); my %opts; $Getopt::Std::STANDARD_HELP_VERSION = 1; diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 48e2e9d997..b5ed5f0bed 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -6,32 +6,37 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # Koha modules used use MARC::File::USMARC; use MARC::File::XML; -use MARC::Record; use MARC::Batch; -use MARC::Charset; use Encode; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + ModBiblio + ModBiblioMarc +); use C4::Koha; -use C4::Charset; -use C4::Items; -use C4::MarcModificationTemplates; +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); +use C4::Items qw( AddItemBatchFromMarc ); +use C4::MarcModificationTemplates qw( + GetModificationTemplates + ModifyRecordWithTemplate +); use YAML::XS; -use Unicode::Normalize; -use Time::HiRes qw(gettimeofday); -use Getopt::Long; +use Time::HiRes qw( gettimeofday ); +use Getopt::Long qw( GetOptions ); use IO::File; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); use Koha::Logger; use Koha::Biblios; diff --git a/misc/migration_tools/checkNonIndexedBiblios.pl b/misc/migration_tools/checkNonIndexedBiblios.pl index d03acbfc7a..25b58ea7e3 100755 --- a/misc/migration_tools/checkNonIndexedBiblios.pl +++ b/misc/migration_tools/checkNonIndexedBiblios.pl @@ -27,15 +27,14 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used -use MARC::Record; use Koha::Script; use C4::Context; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::SearchEngine::Search; diff --git a/misc/migration_tools/create_analytical_rel.pl b/misc/migration_tools/create_analytical_rel.pl index 2de9c23d45..dfdd10e26a 100755 --- a/misc/migration_tools/create_analytical_rel.pl +++ b/misc/migration_tools/create_analytical_rel.pl @@ -5,16 +5,15 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); use Koha::Items; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); $| = 1; diff --git a/misc/migration_tools/ifla/update.pl b/misc/migration_tools/ifla/update.pl index a4e2d8d0fa..25e5ec097a 100755 --- a/misc/migration_tools/ifla/update.pl +++ b/misc/migration_tools/ifla/update.pl @@ -19,10 +19,10 @@ use Modern::Perl; -use Date::Format; -use File::Basename; -use FindBin qw($Bin); -use Getopt::Long; +use Date::Format qw( time2str ); +use File::Basename qw( basename ); +use FindBin qw( $Bin ); +use Getopt::Long qw( GetOptions ); use Locale::PO; use YAML::XS; use utf8; diff --git a/misc/migration_tools/import_lexile.pl b/misc/migration_tools/import_lexile.pl index 72347870a1..265b07a8eb 100755 --- a/misc/migration_tools/import_lexile.pl +++ b/misc/migration_tools/import_lexile.pl @@ -28,12 +28,12 @@ =head1 NAME use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Text::CSV; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); use C4::Koha qw( GetVariationsOfISBN ); use Koha::Biblios; @@ -45,7 +45,7 @@ BEGIN # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } diff --git a/misc/migration_tools/koha-svc.pl b/misc/migration_tools/koha-svc.pl index 24326c19c8..36e275d112 100755 --- a/misc/migration_tools/koha-svc.pl +++ b/misc/migration_tools/koha-svc.pl @@ -21,7 +21,7 @@ use strict; use LWP::UserAgent; -use File::Slurp; +use File::Slurp qw( read_file write_file ); if ( $#ARGV >= 3 && ! caller ) { # process command-line params only if not called as module! my ( $url, $user, $password, $biblionumber, $file ) = @ARGV; diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 18da8026ad..dd7d94d9fb 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -19,13 +19,13 @@ use Koha::Script; use C4::Context; -use Getopt::Long; -use Fcntl qw(:flock); -use File::Temp qw/ tempdir /; -use File::Path; -use C4::Biblio; +use Getopt::Long qw( GetOptions ); +use Fcntl qw( LOCK_EX LOCK_NB LOCK_UN ); +use File::Temp qw( tempdir ); +use File::Path qw( mkpath rmtree ); +use C4::Biblio qw( GetXmlBiblio ); use C4::AuthoritiesMarc; -use C4::Items; +use C4::Items qw( GetItemsInfo Item2Marc ); use Koha::RecordProcessor; use Koha::Caches; use XML::LibXML; diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl index 63670b6a0b..da57f88f42 100755 --- a/misc/migration_tools/remove_unused_authorities.pl +++ b/misc/migration_tools/remove_unused_authorities.pl @@ -25,7 +25,7 @@ use Koha::Script; use C4::Context; use C4::AuthoritiesMarc; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::SearchEngine::Search; diff --git a/misc/migration_tools/switch_marc21_series_info.pl b/misc/migration_tools/switch_marc21_series_info.pl index 9d43d47cbd..f3962e5649 100755 --- a/misc/migration_tools/switch_marc21_series_info.pl +++ b/misc/migration_tools/switch_marc21_series_info.pl @@ -25,14 +25,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblioMarc ); use C4::Context; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my $commit; my $add_links; diff --git a/misc/migration_tools/upgradeitems.pl b/misc/migration_tools/upgradeitems.pl index cc63cd499f..7ba79ae377 100755 --- a/misc/migration_tools/upgradeitems.pl +++ b/misc/migration_tools/upgradeitems.pl @@ -5,8 +5,8 @@ use Koha::Script; use C4::Context; -use C4::Items; -use C4::Biblio; +use C4::Items qw( ModItemFromMarc ); +use C4::Biblio qw( GetMarcBiblio ); my $dbh=C4::Context->dbh; diff --git a/misc/mod_zebraqueue.pl b/misc/mod_zebraqueue.pl index 240aad44fa..ab1aa7b2b3 100755 --- a/misc/mod_zebraqueue.pl +++ b/misc/mod_zebraqueue.pl @@ -20,11 +20,11 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( ModZebra ); my @biblios; my @authorities; diff --git a/misc/recreateIssueStatistics.pl b/misc/recreateIssueStatistics.pl index 8ff314e225..859cf02a5e 100755 --- a/misc/recreateIssueStatistics.pl +++ b/misc/recreateIssueStatistics.pl @@ -25,9 +25,7 @@ use Koha::Script; use C4::Context; -use C4::Items; -use Data::Dumper; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Items; my $dbh = C4::Context->dbh; diff --git a/misc/sax_parser_test.pl b/misc/sax_parser_test.pl index fb56de1174..e18cacdbb0 100755 --- a/misc/sax_parser_test.pl +++ b/misc/sax_parser_test.pl @@ -4,7 +4,7 @@ use warnings; use XML::SAX; -use Encode; +use Encode qw( encode_utf8 ); my $parser = XML::SAX::ParserFactory->parser( Handler => MySAXHandler->new diff --git a/misc/search_tools/export_elasticsearch_mappings.pl b/misc/search_tools/export_elasticsearch_mappings.pl index 6e2b158a79..b8ad1de206 100755 --- a/misc/search_tools/export_elasticsearch_mappings.pl +++ b/misc/search_tools/export_elasticsearch_mappings.pl @@ -61,8 +61,8 @@ =head1 IMPLEMENTATION use Koha::SearchEngine::Elasticsearch; use YAML::XS; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my $type = ''; my $man; diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index 3b25709a76..337ac19dd2 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -112,7 +112,7 @@ =head1 IMPLEMENTATION =cut use autodie; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; use Koha::MetadataRecord::Authority; @@ -120,10 +120,9 @@ =head1 IMPLEMENTATION use Koha::SearchEngine::Elasticsearch; use Koha::SearchEngine::Elasticsearch::Indexer; use MARC::Field; -use MARC::Record; use Modern::Perl; -use Pod::Usage; -use Try::Tiny; +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); my $verbose = 0; my $commit = 5000; diff --git a/misc/stage_file.pl b/misc/stage_file.pl index 16a74d0576..f05be7a01d 100755 --- a/misc/stage_file.pl +++ b/misc/stage_file.pl @@ -23,16 +23,16 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::ImportBatch; +use C4::ImportBatch qw( RecordsFromISO2709File RecordsFromMARCXMLFile BatchStageMarcRecords SetImportBatchMatcher SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction BatchFindDuplicates ); use C4::Matcher; -use C4::MarcModificationTemplates; -use Getopt::Long; +use C4::MarcModificationTemplates qw( GetModificationTemplates ); +use Getopt::Long qw( GetOptions ); $| = 1; diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index 9636758ad8..772c876fb3 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -19,14 +19,13 @@ package LangInstaller; use Modern::Perl; -use C4::Context; +use C4::Context qw( config preference new interface ); # WARNING: Any other tested YAML library fails to work properly in this # script content # FIXME Really? use YAML::XS; use Locale::PO; use FindBin qw( $Bin ); -use File::Basename; use File::Path qw( make_path ); use File::Copy; diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index 0598bc209d..05cc54ea6b 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -7,8 +7,6 @@ use C4::TTParser; use VerboseWarnings qw( pedantic_p error_normal warn_normal warn_pedantic ); require Exporter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - ############################################################################### =head1 NAME @@ -24,9 +22,6 @@ A wrapper for the functionality found in TTParser to allow an easier transition ############################################################################### -@ISA = qw(Exporter); -@EXPORT_OK = qw(); - use vars qw( $pedantic_attribute_error_in_nonpedantic_mode_p ); use vars qw( $pedantic_tmpl_var_use_in_nonpedantic_mode_p ); use vars qw( $pedantic_error_markup_in_pcdata_p ); diff --git a/misc/translator/VerboseWarnings.pm b/misc/translator/VerboseWarnings.pm index 65281ffcb1..5225f74cc9 100644 --- a/misc/translator/VerboseWarnings.pm +++ b/misc/translator/VerboseWarnings.pm @@ -1,9 +1,6 @@ package VerboseWarnings; use Modern::Perl; -require Exporter; - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); ############################################################################### @@ -20,20 +17,19 @@ verbose warnings. ############################################################################### - -@ISA = qw(Exporter); -@EXPORT_OK = qw( - &pedantic_p - &warn_additional - &warn_normal - &warn_pedantic - &error_additional - &error_normal -); -%EXPORT_TAGS = ( - 'warn' => [ 'warn_additional', 'warn_normal', 'warn_pedantic' ], - 'die' => [ 'error_additional', 'error_normal' ], -); +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 + ); +} ############################################################################### diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 3c04618915..2a9643d282 100755 --- a/misc/translator/tmpl_process3.pl +++ b/misc/translator/tmpl_process3.pl @@ -16,10 +16,9 @@ =head1 NAME use strict; #use warnings; FIXME - Bug 2505 -use File::Basename; -use Getopt::Long; +use File::Basename qw( fileparse ); +use Getopt::Long qw( GetOptions ); use Locale::PO; -use File::Temp qw( :POSIX ); use TmplTokenizer; use VerboseWarnings qw( :warn :die ); diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index e04c529863..fcfe1bdd76 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -26,8 +26,8 @@ =head1 NAME use strict; use warnings; -use Getopt::Long; -use POSIX; +use Getopt::Long qw( GetOptions ); +use POSIX qw( close exit localtime open printf time ); use Locale::PO; use TmplTokenizer; use VerboseWarnings; diff --git a/misc/z3950_responder.pl b/misc/z3950_responder.pl index 48609ddce8..de61cd19e6 100755 --- a/misc/z3950_responder.pl +++ b/misc/z3950_responder.pl @@ -19,10 +19,9 @@ use Modern::Perl; -use Carp; -use File::Basename; -use Getopt::Long qw(:config no_ignore_case); -use Pod::Usage; +use File::Basename qw( fileparse ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Config; use Koha::Z3950Responder; diff --git a/offline_circ/download.pl b/offline_circ/download.pl index 838e63ee08..87388bf46f 100755 --- a/offline_circ/download.pl +++ b/offline_circ/download.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; -use C4::Auth; +use JSON qw( to_json ); +use C4::Auth qw( checkauth ); use C4::Output; use C4::Context; use C4::Koha; diff --git a/offline_circ/enqueue_koc.pl b/offline_circ/enqueue_koc.pl index a6e3b0871d..1162d70645 100755 --- a/offline_circ/enqueue_koc.pl +++ b/offline_circ/enqueue_koc.pl @@ -21,21 +21,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Biblio; use C4::Accounts; -use C4::Circulation; -use C4::Items; +use C4::Circulation qw( AddOfflineOperation ); use C4::Members; use C4::Stats; use Koha::Checkouts; use Koha::UploadedFiles; use Koha::Items; -use Date::Calc qw( Add_Delta_Days Date_to_Days ); # this is the file version number that we're coded against. my $FILE_VERSION = '1.0'; diff --git a/offline_circ/list.pl b/offline_circ/list.pl index f5146444c4..252dc8594b 100755 --- a/offline_circ/list.pl +++ b/offline_circ/list.pl @@ -21,13 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( GetOfflineOperations GetOfflineOperation ); use C4::Members; -use C4::Biblio; use Koha::Patrons; use Koha::Items; diff --git a/offline_circ/process.pl b/offline_circ/process.pl index 39963e67ee..09520a1cae 100755 --- a/offline_circ/process.pl +++ b/offline_circ/process.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( GetOfflineOperation ProcessOfflineOperation DeleteOfflineOperation ); my $query = CGI->new; diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index ba61c77534..7eaa73b905 100755 --- a/offline_circ/process_koc.pl +++ b/offline_circ/process_koc.pl @@ -21,16 +21,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Biblio; use C4::Accounts; -use C4::Circulation; -use C4::Items; +use C4::Circulation qw( barcodedecode GetOpenIssue AddRenewal AddIssue MarkIssueReturned ); +use C4::Items qw( ModDateLastSeen ); use C4::Members; use C4::Stats; use C4::BackgroundJob; @@ -39,7 +36,7 @@ use Koha::Checkouts; use Koha::Patrons; -use Date::Calc qw( Add_Delta_Days Date_to_Days ); +use Date::Calc qw( Date_to_Days ); use constant DEBUG => 0; diff --git a/offline_circ/service.pl b/offline_circ/service.pl index bbae44bb74..00ae314c0f 100755 --- a/offline_circ/service.pl +++ b/offline_circ/service.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Circulation; -use Koha::DateUtils; +use C4::Auth qw( check_api_auth check_cookie_auth ); +use C4::Circulation qw( AddOfflineOperation ProcessOfflineOperation ); +use Koha::DateUtils qw( dt_from_string ); use DateTime::TimeZone; my $cgi = CGI->new; diff --git a/opac/clubs/clubs-tab.pl b/opac/clubs/clubs-tab.pl index 312f9b10f4..a3243d4d52 100755 --- a/opac/clubs/clubs-tab.pl +++ b/opac/clubs/clubs-tab.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $cgi = CGI->new; diff --git a/opac/clubs/enroll.pl b/opac/clubs/enroll.pl index f486c7dfd2..a71990196f 100755 --- a/opac/clubs/enroll.pl +++ b/opac/clubs/enroll.pl @@ -21,8 +21,8 @@ use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; diff --git a/opac/errors/400.pl b/opac/errors/400.pl index 83954c7052..eb6609a8ae 100755 --- a/opac/errors/400.pl +++ b/opac/errors/400.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/errors/401.pl b/opac/errors/401.pl index 4d3b5f81bb..91fbc2dccc 100755 --- a/opac/errors/401.pl +++ b/opac/errors/401.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/errors/402.pl b/opac/errors/402.pl index 50989b4253..682f39c7a5 100755 --- a/opac/errors/402.pl +++ b/opac/errors/402.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/errors/403.pl b/opac/errors/403.pl index 735c1c9d08..0e38cdf836 100755 --- a/opac/errors/403.pl +++ b/opac/errors/403.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/errors/404.pl b/opac/errors/404.pl index ca5524d6e2..1814e9da90 100755 --- a/opac/errors/404.pl +++ b/opac/errors/404.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/errors/500.pl b/opac/errors/500.pl index 2d6c30d76f..6918c1e62a 100755 --- a/opac/errors/500.pl +++ b/opac/errors/500.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); diff --git a/opac/external/overdrive/auth.pl b/opac/external/overdrive/auth.pl index f534c24885..d70f574681 100755 --- a/opac/external/overdrive/auth.pl +++ b/opac/external/overdrive/auth.pl @@ -21,8 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use URI; -use URI::Escape; -use C4::Auth qw(checkauth); +use URI::Escape qw( uri_escape ); use Koha::Logger; use Koha::ExternalContent::OverDrive; diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 86cd92f432..8613ac1267 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -20,12 +20,12 @@ use Modern::Perl; use C4::ILSDI::Services; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); -use XML::Simple; +use List::MoreUtils qw( any ); +use XML::Simple qw( XMLout ); use CGI qw ( -utf8 ); use Net::Netmask; diff --git a/opac/maintenance.pl b/opac/maintenance.pl index 7ec3ec8093..c7924921c3 100755 --- a/opac/maintenance.pl +++ b/opac/maintenance.pl @@ -19,7 +19,7 @@ use CGI qw ( -utf8 ); use C4::Auth; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Templates qw/gettemplate/; use Koha; diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 9f3bb869e2..567caf4118 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -41,16 +41,25 @@ =head1 FUNCTIONS use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( parametrized_url output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( + CountItemsIssued + GetISBDView + GetMarcControlnumber + GetMarcISSN + TransformMarcToKoha +); use C4::Reserves; -use C4::Acquisition; -use C4::Serials; # uses getsubscriptionfrom biblionumber -use C4::Koha; +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); use Koha::CirculationRules; use Koha::ItemTypes; use Koha::Patrons; diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 0dac97d4b4..69578be6aa 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -45,25 +45,31 @@ =head1 DESCRIPTION use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( parametrized_url output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( + CountItemsIssued + GetAuthorisedValueDesc + GetMarcBiblio + GetMarcControlnumber + GetMarcFromKohaField + GetMarcISSN + GetMarcStructure + TransformMarcToKoha +); use C4::Reserves; use C4::Members; -use C4::Acquisition; -use C4::Koha; -use List::MoreUtils qw( any uniq ); +use C4::Koha qw( GetNormalizedISBN ); +use List::MoreUtils qw( uniq ); use Koha::Biblios; use Koha::CirculationRules; use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; use Koha::RecordProcessor; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $query = CGI->new(); diff --git a/opac/opac-account-pay-return.pl b/opac/opac-account-pay-return.pl index 841f84fbde..bdfbcfcb1a 100755 --- a/opac/opac-account-pay-return.pl +++ b/opac/opac-account-pay-return.pl @@ -21,7 +21,7 @@ use CGI; -use C4::Auth; +use C4::Auth qw( checkauth ); use Koha::Plugins::Handler; my $cgi = CGI->new; diff --git a/opac/opac-account-pay.pl b/opac/opac-account-pay.pl index c12eae0220..30be841dfc 100755 --- a/opac/opac-account-pay.pl +++ b/opac/opac-account-pay.pl @@ -22,11 +22,8 @@ use Modern::Perl; use CGI; -use HTTP::Request::Common; -use LWP::UserAgent; -use URI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Context; use Koha::Acquisition::Currencies; diff --git a/opac/opac-account.pl b/opac/opac-account.pl index c675c2fc92..1de5617fd6 100755 --- a/opac/opac-account.pl +++ b/opac/opac-account.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Members; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::Lines; use Koha::Patrons; use Koha::Plugins; diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index 3563dfc300..176a1c4fd2 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -21,9 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; use Koha::Virtualshelves; diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl index e9fb79697e..c35b341e37 100755 --- a/opac/opac-alert-subscribe.pl +++ b/opac/opac-alert-subscribe.pl @@ -20,12 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Koha; -use C4::Letters; -use C4::Serials; +use C4::Serials qw( GetSubscription ); my $query = CGI->new; diff --git a/opac/opac-article-request-cancel.pl b/opac/opac-article-request-cancel.pl index 1372b4e818..e926a5f506 100755 --- a/opac/opac-article-request-cancel.pl +++ b/opac/opac-article-request-cancel.pl @@ -22,7 +22,7 @@ use CGI qw ( -utf8 ); use C4::Output; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Koha::ArticleRequests; my $query = CGI->new; diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index 030820772a..eb795f4ed3 100755 --- a/opac/opac-authorities-home.pl +++ b/opac/opac-authorities-home.pl @@ -21,13 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; -use C4::Auth; +use URI::Escape qw( uri_escape_utf8 ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Koha; use C4::Search::History; diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index 432e2982d4..1accfa9c7f 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/opac/opac-authoritiesdetail.pl @@ -38,13 +38,12 @@ =head1 FUNCTIONS use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; -use C4::Biblio qw(GetMarcUrls); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcUrls ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( GetAuthority BuildSummary ); use CGI qw ( -utf8 ); -use MARC::Record; use C4::Koha; use Koha::Authorities; diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 2de55f4be6..ef4a25700f 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -20,11 +20,19 @@ use CGI qw ( -utf8 ); use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Circulation; -use C4::Auth; -use C4::Output; +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcAuthors + GetMarcBiblio + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::RecordProcessor; use Koha::CsvProfiles; use Koha::AuthorisedValues; diff --git a/opac/opac-blocked.pl b/opac/opac-blocked.pl index 2876823c46..6fc1a04aa1 100755 --- a/opac/opac-blocked.pl +++ b/opac/opac-blocked.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; my $query = CGI->new; diff --git a/opac/opac-browse.pl b/opac/opac-browse.pl index 84df8c83ed..bde1e716aa 100755 --- a/opac/opac-browse.pl +++ b/opac/opac-browse.pl @@ -22,16 +22,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::SearchEngine::Elasticsearch; use Koha::SearchEngine::Elasticsearch::Browse; use Koha::SearchEngine::Elasticsearch::QueryBuilder; use Koha::SearchEngine::Elasticsearch::Search; -use JSON; +use JSON qw( to_json ); use Unicode::Collate; my $query = CGI->new; diff --git a/opac/opac-browser.pl b/opac/opac-browser.pl index 3524d039f9..aad5940f5c 100755 --- a/opac/opac-browser.pl +++ b/opac/opac-browser.pl @@ -26,11 +26,10 @@ =head1 opac-browser.pl use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; my $query = CGI->new; diff --git a/opac/opac-course-details.pl b/opac/opac-course-details.pl index 40c9d43bcd..415cade52f 100755 --- a/opac/opac-course-details.pl +++ b/opac/opac-course-details.pl @@ -22,11 +22,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(GetCourse GetCourseReserves); +use C4::CourseReserves qw( GetCourse GetCourseReserve GetCourseReserves ); my $cgi = CGI->new; diff --git a/opac/opac-course-reserves.pl b/opac/opac-course-reserves.pl index 7e8e759134..e5d474b5ee 100755 --- a/opac/opac-course-reserves.pl +++ b/opac/opac-course-reserves.pl @@ -22,10 +22,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(SearchCourses); +use C4::CourseReserves qw( SearchCourses ); my $cgi = CGI->new; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 249de81618..cbb216e291 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -24,30 +24,51 @@ use CGI qw ( -utf8 ); use C4::Acquisition qw( SearchOrders ); -use C4::Auth qw(:DEFAULT get_session); -use C4::Koha; -use C4::Serials; #uses getsubscriptionfrom biblionumber -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; -use C4::Tags qw(get_tags); -use C4::XISBN qw(get_xisbns); -use C4::External::Amazon; +use C4::Auth qw( get_template_and_user get_session ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Output qw( parametrized_url output_html_with_http_headers ); +use C4::Biblio qw( + CountItemsIssued + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcControlnumber + GetMarcISBN + GetMarcISSN + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); +use C4::Tags qw( get_tags ); +use C4::XISBN qw( get_xisbns ); +use C4::External::Amazon qw( get_amazon_tld ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes ); +use C4::External::Syndetics qw( + get_syndetics_anotes + get_syndetics_excerpt + get_syndetics_index + get_syndetics_reviews + get_syndetics_summary + get_syndetics_toc +); use C4::Members; -use C4::XSLT; -use C4::ShelfBrowser; -use C4::Reserves; -use C4::Charset; -use C4::Letters; -use MARC::Record; +use C4::XSLT qw( XSLTParse4Display ); +use C4::ShelfBrowser qw( GetNearbyItems ); +use C4::Reserves qw( GetReserveStatus ); +use C4::Charset qw( SetUTF8Flag ); use MARC::Field; -use List::MoreUtils qw/any none/; -use Koha::DateUtils; +use List::MoreUtils qw( any ); use C4::HTML5Media; -use C4::CourseReserves qw(GetItemCourseReservesInfo); +use C4::CourseReserves qw( GetItemCourseReservesInfo ); use Koha::Biblios; use Koha::RecordProcessor; @@ -63,7 +84,6 @@ use Koha::Reviews; use Koha::SearchEngine::Search; -use Try::Tiny; my $query = CGI->new(); @@ -228,7 +248,7 @@ my %paging = (previous => {}, next => {}); if ($session->param('busc')) { use C4::Search; - use URI::Escape; + use URI::Escape qw( uri_escape_utf8 uri_unescape ); # Rebuild the string to store on session # param value is URI encoded and params separator is HTML encode (&) diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl index 95a4ac3e9f..991ebae5e0 100755 --- a/opac/opac-discharge.pl +++ b/opac/opac-discharge.pl @@ -18,16 +18,14 @@ # along with Koha; if not, see . use Modern::Perl; -use Carp; +use Carp qw( carp ); -use C4::Auth qw(:DEFAULT get_session); +use C4::Auth qw( get_template_and_user ); use CGI qw( -utf8 ); use C4::Context; -use C4::Output; -use C4::Log; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Patron::Discharge; -use Koha::DateUtils; my $input = CGI->new; diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 0fb7a02f3c..ade1a53770 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -20,14 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); +use Encode qw( encode ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::RecordProcessor; diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 99d14a73da..31da711328 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::RecordProcessor; use Koha::Virtualshelves; diff --git a/opac/opac-export.pl b/opac/opac-export.pl index 82954d660f..d816ded995 100755 --- a/opac/opac-export.pl +++ b/opac/opac-export.pl @@ -22,10 +22,15 @@ use C4::Record; use C4::Auth; use C4::Output; -use C4::Biblio; +use C4::Biblio qw( + GetFrameworkCode + GetISBDView + GetMarcBiblio + GetMarcControlnumber +); use CGI qw ( -utf8 ); use C4::Auth; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::RecordProcessor; my $query = CGI->new; diff --git a/opac/opac-holdshistory.pl b/opac/opac-holdshistory.pl index 67ecae864e..e869128a37 100755 --- a/opac/opac-holdshistory.pl +++ b/opac/opac-holdshistory.pl @@ -20,8 +20,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Holds; diff --git a/opac/opac-ics.pl b/opac/opac-ics.pl index c8116b4efc..62603f3a2f 100755 --- a/opac/opac-ics.pl +++ b/opac/opac-ics.pl @@ -29,11 +29,8 @@ use DateTime::Event::ICal; use URI; -use C4::Auth; -use C4::Koha; -use C4::Circulation; -use C4::Members; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use Koha::DateUtils qw( dt_from_string ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( diff --git a/opac/opac-idref.pl b/opac/opac-idref.pl index 8b95311f7e..795842215f 100755 --- a/opac/opac-idref.pl +++ b/opac/opac-idref.pl @@ -21,14 +21,13 @@ use CGI; use LWP::UserAgent; -use HTTP::Request::Common; -use JSON; +use JSON qw( from_json ); use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index 5881dedcc5..e619707451 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -22,9 +22,9 @@ use JSON qw( encode_json ); use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Koha; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Illrequest::Config; use Koha::Illrequests; diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl index 6daa63d8e0..bacbf848a7 100755 --- a/opac/opac-imageviewer.pl +++ b/opac/opac-imageviewer.pl @@ -20,9 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::CoverImages; diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index 5153b15358..d109ccc79a 100755 --- a/opac/opac-issue-note.pl +++ b/opac/opac-issue-note.pl @@ -23,12 +23,11 @@ use C4::Koha; use C4::Context; use C4::Scrubber; -use C4::Output; -use C4::Auth; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use Koha::Checkouts; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; my $query = CGI->new; diff --git a/opac/opac-library.pl b/opac/opac-library.pl index 52168615f3..951d0b43ab 100755 --- a/opac/opac-library.pl +++ b/opac/opac-library.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; my $query = CGI->new(); diff --git a/opac/opac-main.pl b/opac/opac-main.pl index d030fd0751..5b98333b85 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -20,12 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Languages qw(getTranslatedLanguages accept_language); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Quotes; use C4::Members; -use C4::Overdues; +use C4::Overdues qw( checkoverdues ); use Koha::Checkouts; use Koha::Holds; use Koha::News; diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index c9a4790efd..8945cc339b 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -19,14 +19,14 @@ use CGI qw ( -utf8 ); use Digest::MD5 qw( md5_base64 md5_hex ); -use JSON; +use JSON qw( to_json ); use List::MoreUtils qw( any each_array uniq ); use String::Random qw( random_string ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Members; +use C4::Members qw( checkcardnumber ); use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::Patrons; @@ -35,7 +35,7 @@ use Koha::Patron::Modifications; use C4::Scrubber; use Email::Valid; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patron::Attribute::Types; use Koha::Patron::Attributes; diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 1748c31361..40643830c6 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -21,12 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Circulation; -use C4::Output; -use C4::Members; +use C4::Output qw( output_html_with_http_headers ); use C4::Members::Messaging; use C4::Form::MessagingPreferences; use Koha::Patrons; diff --git a/opac/opac-modrequest-suspend.pl b/opac/opac-modrequest-suspend.pl index ec9b9a8291..4022bb92df 100755 --- a/opac/opac-modrequest-suspend.pl +++ b/opac/opac-modrequest-suspend.pl @@ -19,8 +19,8 @@ use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( CanReserveBeCanceledFromOpac ToggleSuspend SuspendAll ); +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { diff --git a/opac/opac-modrequest.pl b/opac/opac-modrequest.pl index 64b064c92b..05b01a836a 100755 --- a/opac/opac-modrequest.pl +++ b/opac/opac-modrequest.pl @@ -26,8 +26,8 @@ use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( CanReserveBeCanceledFromOpac ); +use C4::Auth qw( get_template_and_user ); use Koha::Holds; my $query = CGI->new; diff --git a/opac/opac-mymessages.pl b/opac/opac-mymessages.pl index 5de888a4f0..6acebadc4d 100755 --- a/opac/opac-mymessages.pl +++ b/opac/opac-mymessages.pl @@ -21,11 +21,10 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; use C4::Letters; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new(); diff --git a/opac/opac-news-rss.pl b/opac/opac-news-rss.pl index 58ec362f2f..a969424fff 100755 --- a/opac/opac-news-rss.pl +++ b/opac/opac-news-rss.pl @@ -20,9 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Languages qw(getTranslatedLanguages accept_language); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::News; my $input = CGI->new; diff --git a/opac/opac-overdrive-search.pl b/opac/opac-overdrive-search.pl index 9b7618942c..575596d8a0 100755 --- a/opac/opac-overdrive-search.pl +++ b/opac/opac-overdrive-search.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(:DEFAULT get_session); -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index 6b9081a965..6ae82f0a8e 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -22,14 +22,12 @@ use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user checkpw checkpw_hash ); use C4::Context; -use C4::Circulation; -use C4::Members; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; -use Try::Tiny; +use Try::Tiny qw( catch try ); my $query = CGI->new; diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index b6c5592e7e..9ee1278c0a 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -3,17 +3,21 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use Koha::Patron::Password::Recovery - qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery DeleteExpiredPasswordRecovery); +use Koha::Patron::Password::Recovery qw( + CompletePasswordRecovery + DeleteExpiredPasswordRecovery + GetValidLinkInfo + SendPasswordRecoveryEmail + ValidateBorrowernumber +); use Koha::Patrons; my $query = CGI->new; use HTML::Entities; -use Try::Tiny; -use List::Util qw/any/; +use Try::Tiny qw( catch try ); +use List::Util qw( any ); my ( $template, $dummy, $cookie ) = get_template_and_user( { diff --git a/opac/opac-patron-consent.pl b/opac/opac-patron-consent.pl index 2de16abbe5..017e04e9be 100755 --- a/opac/opac-patron-consent.pl +++ b/opac/opac-patron-consent.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw/-utf8/; -use C4::Auth qw/get_template_and_user/; -use C4::Output qw/output_html_with_http_headers/; -use Koha::DateUtils qw/dt_from_string/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patron::Consents; use Koha::Patrons; diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl index b40788db7e..3f1efb8a47 100755 --- a/opac/opac-patron-image.pl +++ b/opac/opac-patron-image.pl @@ -22,7 +22,7 @@ use C4::Members; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( check_cookie_auth ); use Koha::Patron::Images; my $query = CGI->new; diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index fa3083c2af..8ea6b12066 100755 --- a/opac/opac-privacy.pl +++ b/opac/opac-privacy.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $query = CGI->new; diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl index 43293576e5..2f43762c05 100755 --- a/opac/opac-ratings-ajax.pl +++ b/opac/opac-ratings-ajax.pl @@ -28,9 +28,9 @@ =head1 DESCRIPTION use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( get_template_and_user check_cookie_auth ); use C4::Context; -use C4::Output qw(:html :ajax pagination_bar); +use C4::Output qw( is_ajax output_ajax_with_http_headers ); use Koha::Ratings; diff --git a/opac/opac-ratings.pl b/opac/opac-ratings.pl index 53a9b4d67e..7e1bca61cb 100755 --- a/opac/opac-ratings.pl +++ b/opac/opac-ratings.pl @@ -28,7 +28,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Context; use Koha::Ratings; diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 9c6200f9f0..3652d000c7 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -20,17 +20,19 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedISBN + GetNormalizedUPC +); use C4::Biblio; -use C4::Circulation; -use C4::Members; +use C4::Members qw( GetAllIssues ); use C4::External::BakerTaylor qw( image_url link_url ); -use Koha::DateUtils; use MARC::Record; -use C4::Output; -use C4::Charset qw(StripNonXmlChars); +use C4::Output qw( output_html_with_http_headers ); +use C4::Charset qw( StripNonXmlChars ); use Koha::Patrons; use Koha::ItemTypes; diff --git a/opac/opac-recordedbooks-search.pl b/opac/opac-recordedbooks-search.pl index c23ef028c0..1d2f4964ee 100755 --- a/opac/opac-recordedbooks-search.pl +++ b/opac/opac-recordedbooks-search.pl @@ -21,8 +21,8 @@ use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index 71ea329251..c4e4f22963 100755 --- a/opac/opac-registration-verify.pl +++ b/opac/opac-registration-verify.pl @@ -19,8 +19,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use C4::Form::MessagingPreferences; use Koha::AuthUtils; diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 8a946d0f17..46a205029e 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -24,14 +24,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Circulation; -use C4::Auth; +use C4::Circulation qw( CanBookBeRenewed AddRenewal ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Items; use C4::Members; use Koha::Items; use Koha::Patrons; -use Date::Calc qw( Today Date_to_Days ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 293f2826c0..2cb1ff340b 100755 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -19,16 +19,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; # get_template_and_user -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Letters; use Koha::ProblemReport; use Koha::Libraries; use Koha::Patrons; use Koha::Util::Navigation; -use URI::Escape; +use URI::Escape qw( uri_unescape ); use Encode; my $input = CGI->new; diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index 2303ea0c25..dd02b4d7b9 100755 --- a/opac/opac-request-article.pl +++ b/opac/opac-request-article.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::Patrons; diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index b70cff854a..721981bb2a 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -21,28 +21,27 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. -use C4::Koha; -use C4::Circulation; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( getitemtypeimagelocation getitemtypeimagesrc ); +use C4::Circulation qw( GetBranchItemRule GetTransfers ); +use C4::Reserves qw( CanItemBeReserved CanBookBeReserved AddReserve GetReservesControlBranch IsAvailableForItemLevelRequest ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetHostItemsInfo GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use C4::Overdues; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::CirculationRules; use Koha::Items; use Koha::ItemTypes; use Koha::Checkouts; use Koha::Libraries; use Koha::Patrons; -use Date::Calc qw/Today Date_to_Days/; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $maxreserves = C4::Context->preference("maxreserves"); diff --git a/opac/opac-restrictedpage.pl b/opac/opac-restrictedpage.pl index ca90b41ebc..b438b7f010 100755 --- a/opac/opac-restrictedpage.pl +++ b/opac/opac-restrictedpage.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $localNetwork = C4::Context->preference('RestrictedPageLocalIPs'); my $userIP = $ENV{'REMOTE_ADDR'}; diff --git a/opac/opac-retrieve-file.pl b/opac/opac-retrieve-file.pl index d19f9dd738..3f6e6c8d3b 100755 --- a/opac/opac-retrieve-file.pl +++ b/opac/opac-retrieve-file.pl @@ -21,9 +21,9 @@ use CGI; use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::UploadedFiles; my $input = CGI::->new; diff --git a/opac/opac-review.pl b/opac/opac-review.pl index f00b79f274..12152d228e 100755 --- a/opac/opac-review.pl +++ b/opac/opac-review.pl @@ -19,14 +19,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Scrubber; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Review; use Koha::Reviews; diff --git a/opac/opac-routing-lists.pl b/opac/opac-routing-lists.pl index 2be52197e0..299bb29e78 100755 --- a/opac/opac-routing-lists.pl +++ b/opac/opac-routing-lists.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Members; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $query = CGI->new; diff --git a/opac/opac-search-history.pl b/opac/opac-search-history.pl index 64c696dde7..019fdc6b69 100755 --- a/opac/opac-search-history.pl +++ b/opac/opac-search-history.pl @@ -19,16 +19,12 @@ use Modern::Perl; -use C4::Auth qw(:DEFAULT get_session); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Log; -use C4::Items; +use C4::Output qw( output_html_with_http_headers ); use C4::Search::History; -use URI::Escape; -use POSIX qw(strftime); my $cgi = CGI->new; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index cde8b6e555..67c11c182f 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -43,14 +43,14 @@ $builder = Koha::SearchEngine::QueryBuilder->new({index => 'biblios'}); $searcher = Koha::SearchEngine::Search->new({index => 'biblios'}); -use C4::Output; -use C4::Auth qw(:DEFAULT get_session); -use C4::Languages qw(getLanguages); -use C4::Search; +use C4::Output qw( output_html_with_http_headers pagination_bar output_with_http_headers ); +use C4::Auth qw( get_template_and_user get_session ); +use C4::Languages qw( getlanguage getLanguages ); +use C4::Search qw( searchResults ); use C4::Search::History; -use C4::Biblio; # Unused here? -use C4::Koha; -use C4::Tags qw(get_tags); +use C4::Biblio qw( GetXmlBiblio CountItemsIssued ); +use C4::Koha qw( GetItemTypesCategorized getitemtypeimagelocation GetAuthorisedValues ); +use C4::Tags qw( get_tags get_tag ); use C4::SocialData; use C4::External::OverDrive; use C4::External::BakerTaylor qw( image_url link_url ); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index eee5e2c29b..fdf8671ecb 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -20,16 +20,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use Carp; -use Try::Tiny; - -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Templates (); +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Templates; use Koha::Email; use Koha::Patrons; use Koha::Token; diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index c97aa450dc..825de8175e 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -20,15 +20,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( encode ); -use Carp; -use Try::Tiny; - -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Members; +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcAuthors + GetMarcBiblio + GetMarcISBN + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Email; use Koha::Patrons; use Koha::Virtualshelves; diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl index c842880345..b84b176498 100755 --- a/opac/opac-serial-issues.pl +++ b/opac/opac-serial-issues.pl @@ -21,11 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Serials; -use C4::Letters; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( GetFullSubscription GetFullSubscriptionsFromBiblionumber PrepareSerialsData GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $query = CGI->new; diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 7eecf6c45f..701871bafc 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -27,11 +27,10 @@ use CGI qw ( -utf8 ); use Email::Valid; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Letters; -use C4::Members (); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Virtualshelves; diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 8fa4fb7274..b9eee82d7f 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -20,13 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::Koha; -use C4::Items; +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); use C4::Members; -use C4::Output; +use C4::Output qw( pagination_bar output_with_http_headers ); use C4::Tags qw( get_tags ); use C4::XSLT; diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 5ba6a23404..57c63fede1 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -25,11 +25,10 @@ # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::ImportBatch; -use C4::XSLT (); +use C4::XSLT; use C4::Templates; use Koha::RecordProcessor; diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index cfb359c6b7..e6aab17d60 100755 --- a/opac/opac-showreviews.pl +++ b/opac/opac-showreviews.pl @@ -21,15 +21,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Biblio; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Reviews; -use POSIX qw(ceil floor strftime); +use POSIX qw( ceil floor ); my $template_name; my $query = CGI->new; diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index b1f1701ddc..1fb5ffb136 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -19,13 +19,18 @@ use CGI qw ( -utf8 ); -use Encode qw( encode ); -use C4::Auth; # get_template_and_user +use Encode; +use C4::Auth qw( get_template_and_user ); use C4::Members; -use C4::Koha; -use C4::Output; -use C4::Suggestions; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( + DelSuggestion + MarcRecordFromNewSuggestion + NewSuggestion + SearchSuggestion +); +use C4::Koha qw( GetAuthorisedValues ); use C4::Scrubber; use C4::Search qw( FindDuplicate ); @@ -33,7 +38,7 @@ use Koha::Libraries; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $op = $input->param('op') || 'else'; diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 200e8dfc47..df323ce003 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -35,16 +35,21 @@ =head1 DESCRIPTION use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Context; -use C4::Output qw(:html :ajax ); +use C4::Output qw( output_with_http_headers is_ajax output_html_with_http_headers ); use C4::Scrubber; -use C4::Biblio; -use C4::Items qw(GetItemsInfo GetHiddenItemnumbers); -use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Tags qw( + add_tag + get_approval_rows + get_tag_rows + remove_tag + stratify_tags +); use C4::XSLT; -use Data::Dumper; use Koha::Logger; use Koha::Biblios; diff --git a/opac/opac-tags_subject.pl b/opac/opac-tags_subject.pl index 25afac4b86..8af9c29ad4 100755 --- a/opac/opac-tags_subject.pl +++ b/opac/opac-tags_subject.pl @@ -26,11 +26,10 @@ =head1 opac-tags_subject.pl use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; my $query = CGI->new; diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index d2d76da8f6..f185702e32 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -22,14 +22,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Languages; use C4::Search; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use Date::Manip; +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( GetTopIssues ); =head1 NAME diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 0d9bdd708c..8deb054e72 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -21,20 +21,22 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedISBN + GetNormalizedUPC +); +use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges GetSoonestRenewDate ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::Reserves; +use C4::Reserves qw( GetReserveStatus ); use C4::Members; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Letters; +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ); use Koha::Account::Lines; use Koha::Biblios; use Koha::Libraries; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Holds; use Koha::Database; use Koha::ItemTypes; @@ -48,12 +50,8 @@ use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; -use Scalar::Util qw(looks_like_number); -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); +use Scalar::Util qw( looks_like_number ); +use Date::Calc qw( Date_to_Days Today ); my $query = CGI->new; diff --git a/opac/sci/sci-main.pl b/opac/sci/sci-main.pl index 88a3cf8ce1..2171fa42c5 100755 --- a/opac/sci/sci-main.pl +++ b/opac/sci/sci-main.pl @@ -19,13 +19,13 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user checkpw); -use C4::Circulation; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( AddReturn ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Items; use List::MoreUtils qw( uniq ); -use Try::Tiny; +use Try::Tiny qw( catch try ); my $cgi = CGI->new; diff --git a/opac/sco/help.pl b/opac/sco/help.pl index 25e4356283..57d02ec983 100755 --- a/opac/sco/help.pl +++ b/opac/sco/help.pl @@ -24,8 +24,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user in_iprange); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( in_iprange get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new; unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) { diff --git a/opac/sco/printslip.pl b/opac/sco/printslip.pl index 3b7074194e..a2564f1307 100755 --- a/opac/sco/printslip.pl +++ b/opac/sco/printslip.pl @@ -29,10 +29,9 @@ =head1 printslip.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session in_iprange/; -use C4::Output; -use C4::Members; -use C4::Koha; +use C4::Auth qw( in_iprange get_session get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Members qw( IssueSlip ); my $input = CGI->new; unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) { diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index d4f91638ce..40d591519b 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -35,14 +35,11 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user checkpw in_iprange); -use C4::Koha; -use C4::Circulation; +use C4::Auth qw( in_iprange get_template_and_user checkpw ); +use C4::Circulation qw( AddReturn CanBookBeIssued AddIssue CanBookBeRenewed AddRenewal ); use C4::Reserves; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Members; -use C4::Biblio; -use C4::Items; use Koha::DateUtils qw( dt_from_string ); use Koha::Acquisition::Currencies; use Koha::Items; diff --git a/opac/sco/sco-patron-image.pl b/opac/sco/sco-patron-image.pl index e997ab984b..36e86b7d13 100755 --- a/opac/sco/sco-patron-image.pl +++ b/opac/sco/sco-patron-image.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth qw(in_iprange); +use C4::Auth qw( in_iprange ); use C4::Service; use C4::Members; use Koha::Patron::Images; diff --git a/opac/svc/checkout_notes b/opac/svc/checkout_notes index 8913ab70d7..fea4a9e67a 100755 --- a/opac/svc/checkout_notes +++ b/opac/svc/checkout_notes @@ -21,10 +21,10 @@ use Modern::Perl; use JSON qw( encode_json ); use C4::Service; -use C4::Auth qw /check_cookie_auth/; +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Letters; use CGI; -use C4::Output qw(:DEFAULT :ajax); +use C4::Output qw( is_ajax output_with_http_headers ); use C4::Scrubber; use C4::Circulation; use C4::Biblio; diff --git a/opac/svc/shelfbrowser.pl b/opac/svc/shelfbrowser.pl index 82e583ca81..d9797c2e4e 100755 --- a/opac/svc/shelfbrowser.pl +++ b/opac/svc/shelfbrowser.pl @@ -3,10 +3,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::ShelfBrowser; +use C4::Output qw( output_html_with_http_headers ); +use C4::ShelfBrowser qw( GetNearbyItems ); my $cgi = CGI->new; diff --git a/opac/tracklinks.pl b/opac/tracklinks.pl index e357f0a1df..5849d3a0c9 100755 --- a/opac/tracklinks.pl +++ b/opac/tracklinks.pl @@ -20,13 +20,13 @@ use Modern::Perl; use C4::Context; -use C4::Auth qw(checkauth); +use C4::Auth qw( checkauth ); use C4::Biblio; -use C4::Output; +use C4::Output qw( output_error ); use Koha::Items; use Koha::Linktracker; use CGI qw ( -utf8 ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $cgi = CGI->new; my $uri = $cgi->param('uri') || ''; diff --git a/patron_lists/add-modify.pl b/patron_lists/add-modify.pl index c10c208447..95ff728707 100755 --- a/patron_lists/add-modify.pl +++ b/patron_lists/add-modify.pl @@ -21,9 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( AddPatronList GetPatronLists ModPatronList ); my $cgi = CGI->new; diff --git a/patron_lists/delete.pl b/patron_lists/delete.pl index 87c199b426..773ec3d168 100755 --- a/patron_lists/delete.pl +++ b/patron_lists/delete.pl @@ -21,9 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use Koha::List::Patron; +use Koha::List::Patron qw( DelPatronList ); my $cgi = CGI->new; diff --git a/patron_lists/list.pl b/patron_lists/list.pl index 75f30e2989..7076b20c9f 100755 --- a/patron_lists/list.pl +++ b/patron_lists/list.pl @@ -21,10 +21,14 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; -use List::MoreUtils qw/uniq/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( + AddPatronsToList + DelPatronsFromList + GetPatronLists +); +use List::MoreUtils qw( uniq ); my $cgi = CGI->new; diff --git a/patron_lists/lists.pl b/patron_lists/lists.pl index df84727426..f599cd164b 100755 --- a/patron_lists/lists.pl +++ b/patron_lists/lists.pl @@ -21,9 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; diff --git a/patron_lists/patrons.pl b/patron_lists/patrons.pl index 98ac9593c2..f97fcf4662 100755 --- a/patron_lists/patrons.pl +++ b/patron_lists/patrons.pl @@ -21,9 +21,9 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( AddPatronList GetPatronLists ModPatronList ); my $cgi = CGI->new; diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl index 8eb2a731e9..04bc0eb5b3 100755 --- a/patroncards/add_user_search.pl +++ b/patroncards/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl index 6ea391fe3e..e994ddbbb2 100755 --- a/patroncards/create-pdf.pl +++ b/patroncards/create-pdf.pl @@ -19,17 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Graphics::Magick; -use XML::Simple; -use POSIX qw(ceil); -use Storable qw(dclone); +use XML::Simple qw( XMLin ); +use POSIX qw( ceil ); +use Storable qw( dclone ); use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; use C4::Creators; use C4::Patroncards; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patrons; use Koha::Patron::Images; diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 7cab1a7cd3..d90d37cf26 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -24,9 +24,9 @@ use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_card_summary html_table ); use C4::Patroncards; use Koha::Patrons; diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl index 6ecbde47bb..22ef6b9371 100755 --- a/patroncards/edit-layout.pl +++ b/patroncards/edit-layout.pl @@ -21,13 +21,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Text::CSV_XS; -use XML::Simple; +use XML::Simple qw( XMLin XMLout ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_image_names + get_barcode_types + get_font_types + get_text_justification_types + get_unit_values +); use C4::Patroncards; my $cgi = CGI->new; diff --git a/patroncards/edit-profile.pl b/patroncards/edit-profile.pl index c192702459..e5517dad97 100755 --- a/patroncards/edit-profile.pl +++ b/patroncards/edit-profile.pl @@ -22,9 +22,9 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators::Lib qw(get_all_templates get_unit_values); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators::Lib qw( get_all_templates get_unit_values ); use C4::Patroncards::Profile; my $cgi = CGI->new; diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl index fab470a13e..0238701162 100755 --- a/patroncards/edit-template.pl +++ b/patroncards/edit-template.pl @@ -23,9 +23,9 @@ use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_profiles get_unit_values ); use C4::Patroncards; my $cgi = CGI->new; diff --git a/patroncards/home.pl b/patroncards/home.pl index 6e69187add..93df48f3d3 100755 --- a/patroncards/home.pl +++ b/patroncards/home.pl @@ -22,8 +22,8 @@ use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/patroncards/image-manage.pl b/patroncards/image-manage.pl index 587d4ee8a2..3f3c288136 100755 --- a/patroncards/image-manage.pl +++ b/patroncards/image-manage.pl @@ -4,13 +4,12 @@ use CGI qw ( -utf8 ); use Graphics::Magick; -use POSIX qw(ceil); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( html_table ); +use C4::Patroncards qw( get_image put_image rm_image ); my $cgi = CGI->new; diff --git a/patroncards/manage.pl b/patroncards/manage.pl index a2e9546428..f4d21c644d 100755 --- a/patroncards/manage.pl +++ b/patroncards/manage.pl @@ -23,12 +23,17 @@ use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_layouts + get_all_profiles + get_all_templates + get_batch_summary + html_table +); use C4::Labels; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/patroncards/print.pl b/patroncards/print.pl index ec7024aa57..ea154ea8e4 100755 --- a/patroncards/print.pl +++ b/patroncards/print.pl @@ -22,10 +22,9 @@ use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_layouts get_all_templates get_output_formats ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/plugins/plugins-enable.pl b/plugins/plugins-enable.pl index 181550781a..6966be9d23 100755 --- a/plugins/plugins-enable.pl +++ b/plugins/plugins-enable.pl @@ -20,7 +20,7 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw(check_cookie_auth); +use C4::Auth qw( check_cookie_auth ); use Koha::Plugins::Handler; die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins"); diff --git a/plugins/plugins-home.pl b/plugins/plugins-home.pl index efdd503eac..da892ba1f2 100755 --- a/plugins/plugins-home.pl +++ b/plugins/plugins-home.pl @@ -21,12 +21,12 @@ use CGI qw ( -utf8 ); -use JSON qw(from_json); -use LWP::Simple qw(get); +use JSON qw( from_json ); +use LWP::Simple qw( get ); use Koha::Plugins; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $plugins_enabled = C4::Context->config("enable_plugins"); diff --git a/plugins/plugins-uninstall.pl b/plugins/plugins-uninstall.pl index 7d350fe82d..d6a85d39d3 100755 --- a/plugins/plugins-uninstall.pl +++ b/plugins/plugins-uninstall.pl @@ -18,12 +18,10 @@ use Modern::Perl; use Archive::Extract; -use File::Temp; -use File::Copy; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Members; use Koha::Plugins::Handler; diff --git a/plugins/plugins-upload.pl b/plugins/plugins-upload.pl index a681aabfd1..3e44f00b7e 100755 --- a/plugins/plugins-upload.pl +++ b/plugins/plugins-upload.pl @@ -21,12 +21,11 @@ use Archive::Extract; use CGI qw ( -utf8 ); use Mojo::UserAgent; -use File::Copy; use File::Temp; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Logger; use Koha::Plugins; diff --git a/plugins/run.pl b/plugins/run.pl index a0bd16ae4b..4570844291 100755 --- a/plugins/run.pl +++ b/plugins/run.pl @@ -22,8 +22,8 @@ use CGI qw ( -utf8 ); use Koha::Plugins::Handler; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $plugins_enabled = C4::Context->config("enable_plugins"); diff --git a/pos/pay.pl b/pos/pay.pl index c83405321e..b401f12495 100755 --- a/pos/pay.pl +++ b/pos/pay.pl @@ -22,8 +22,8 @@ use CGI; use JSON qw( from_json ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Account::DebitTypes; diff --git a/pos/printreceipt.pl b/pos/printreceipt.pl index a387b8ea4c..02505595c4 100755 --- a/pos/printreceipt.pl +++ b/pos/printreceipt.pl @@ -19,12 +19,10 @@ use Modern::Perl; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Letters; use Koha::Account::Lines; -use Koha::DateUtils; use Koha::Notice::Templates; my $input = CGI->new; diff --git a/pos/register.pl b/pos/register.pl index e398bda396..490fe11127 100755 --- a/pos/register.pl +++ b/pos/register.pl @@ -19,14 +19,14 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Account::Lines; use Koha::Cash::Registers; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new(); diff --git a/pos/registers.pl b/pos/registers.pl index 44c81363fb..7a9c3a1699 100755 --- a/pos/registers.pl +++ b/pos/registers.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Cash::Registers; diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl index 8fe531358e..1d27870c52 100755 --- a/reports/acquisitions_stats.pl +++ b/reports/acquisitions_stats.pl @@ -19,16 +19,15 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Reports; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Biblio; +use C4::Reports qw( GetDelimiterChoices ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField ); use Koha::ItemTypes; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; =head1 NAME diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index 6737c03970..912798ea7b 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -20,15 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Koha; -use C4::Circulation; -use C4::Members; -use C4::Reports; +use C4::Reports qw( GetDelimiterChoices ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Categories; @@ -286,8 +283,7 @@ sub calculate { $patrons{$id}->{oldcols}->{$col} = $rank; } - use Data::Dumper; - + $strcalc =~ s/old_issues/issues/g; $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index 22f71c9924..9d7fba6cac 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -20,15 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Reports; -use C4::Members; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; =head1 NAME diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index dc8b7b4b71..f636f6b566 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -19,26 +19,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Acquisition; -use C4::Output; -use C4::Reports; -use C4::Circulation; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patron::Attribute::Types; use Koha::Patron::Categories; -use Date::Calc qw( - Today - Add_Delta_YM - ); +use Date::Calc qw( Add_Delta_YM Today ); =head1 NAME diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl index 3b790ff8ca..0dcc38f08c 100755 --- a/reports/cash_register_stats.pl +++ b/reports/cash_register_stats.pl @@ -16,17 +16,15 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI; use C4::Context; -use C4::Reports; -use C4::Output; -use C4::Koha; -use C4::Circulation; +use C4::Reports qw( GetDelimiterChoices ); +use C4::Output qw( output_html_with_http_headers ); use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Text::CSV::Encoded; -use List::Util qw/any/; +use List::Util qw( any ); use Koha::Account::CreditTypes; use Koha::Account::DebitTypes; diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl index 040280dbee..886fecfa6f 100755 --- a/reports/cat_issues_top.pl +++ b/reports/cat_issues_top.pl @@ -19,15 +19,13 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Reports; -use C4::Members; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Reports qw( GetDelimiterChoices ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; =head1 NAME diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index 3835f13484..51961790a8 100755 --- a/reports/catalogue_out.pl +++ b/reports/catalogue_out.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); # use Date::Manip; # TODO: add not borrowed since date X criteria -use Data::Dumper; =head1 catalogue_out diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl index b7b01e23d8..c3795df6d2 100755 --- a/reports/catalogue_stats.pl +++ b/reports/catalogue_stats.pl @@ -19,17 +19,16 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Reports; -use C4::Circulation; -use C4::Biblio qw/GetMarcSubfieldStructureFromKohaField/; +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Reports qw( GetDelimiterChoices ); +use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; =head1 NAME diff --git a/reports/dictionary.pl b/reports/dictionary.pl index 26976c0215..ef95e7108d 100755 --- a/reports/dictionary.pl +++ b/reports/dictionary.pl @@ -16,13 +16,12 @@ # # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); -use C4::Output; -use C4::Reports::Guided; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports::Guided qw( get_from_dictionary get_columns get_column_type get_distinct_values save_dictionary delete_definition get_report_areas ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 854098ead1..77c19b3cb4 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -23,21 +23,21 @@ use Encode qw( decode ); use URI::Escape; use File::Temp; -use C4::Reports::Guided; +use C4::Reports::Guided qw( delete_report get_report_areas convert_sql update_sql get_saved_reports get_results ValidateSQLParameters format_results get_report_types get_columns get_from_dictionary get_criteria build_query save_report execute_query nb_rows get_report_groups ); use Koha::Reports; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_template_and_user get_session ); +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Context; use Koha::Caches; -use C4::Log; -use Koha::DateUtils qw/dt_from_string output_pref/; +use C4::Log qw( logaction ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::AuthorisedValue; use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::Libraries; use Koha::Patron::Categories; use Koha::SharedContent; -use Koha::Util::OpenDocument; +use Koha::Util::OpenDocument qw( generate_ods ); =head1 NAME diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl index d5bbf2da74..7be36a54c2 100755 --- a/reports/issues_avg_stats.pl +++ b/reports/issues_avg_stats.pl @@ -19,17 +19,15 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Reports; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Categories; -use Date::Calc qw(Delta_Days); +use Date::Calc qw( Delta_Days ); =head1 NAME diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index cb5cda0d0b..3eb27fb3e2 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -20,18 +20,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Manip; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Reports; -use C4::Members; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Attribute::Types; diff --git a/reports/itemslost.pl b/reports/itemslost.pl index 9c77e6e172..901ff5a8d9 100755 --- a/reports/itemslost.pl +++ b/reports/itemslost.pl @@ -29,14 +29,11 @@ =head1 itemslost use CGI qw ( -utf8 ); use Text::CSV_XS; -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::CsvProfiles; -use Koha::DateUtils; my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/reports/manager.pl b/reports/manager.pl index 0d6e1bca88..ff174f00d3 100755 --- a/reports/manager.pl +++ b/reports/manager.pl @@ -19,10 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Circulation; +use C4::Output qw( output_html_with_http_headers ); my $input = CGI->new; diff --git a/reports/orders_by_fund.pl b/reports/orders_by_fund.pl index 92bbb5f187..a44ca3f864 100755 --- a/reports/orders_by_fund.pl +++ b/reports/orders_by_fund.pl @@ -28,14 +28,12 @@ =head1 orders_by_budget use Modern::Perl; use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Budgets; -use C4::Biblio; -use C4::Reports; -use C4::Acquisition; #GetBasket() +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudgetsReport GetBudgetHierarchy ); +use C4::Acquisition qw( GetBasket get_rounded_price ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/reports/reports-home.pl b/reports/reports-home.pl index bffe6b6a19..71aaa87e83 100755 --- a/reports/reports-home.pl +++ b/reports/reports-home.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl index 3c91778ca8..cb63a6ef87 100755 --- a/reports/reserves_stats.pl +++ b/reports/reserves_stats.pl @@ -21,18 +21,18 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Reports; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use C4::Members; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Libraries; use Koha::Patron::Categories; -use List::MoreUtils qw/any/; +use List::MoreUtils qw( any ); =head1 NAME diff --git a/reports/serials_stats.pl b/reports/serials_stats.pl index 277b7671f4..a3b12b55b3 100755 --- a/reports/serials_stats.pl +++ b/reports/serials_stats.pl @@ -18,13 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Reports; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); +use C4::Serials qw( GetExpirationDate HasSubscriptionExpired ); =head1 serials_out diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index f1ab945f2e..3a7c3deb6b 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -26,8 +26,8 @@ use CGI qw ( -utf8 ); use List::MoreUtils qw( uniq ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( ModReserve ModReserveCancelAll ); +use C4::Auth qw( get_template_and_user ); use Koha::DateUtils qw( dt_from_string ); my $query = CGI->new; diff --git a/reserve/modrequest_suspendall.pl b/reserve/modrequest_suspendall.pl index e0098e08db..3217dbffb4 100755 --- a/reserve/modrequest_suspendall.pl +++ b/reserve/modrequest_suspendall.pl @@ -25,8 +25,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( SuspendAll ); +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 63555944a5..5ee8dce2f6 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -24,13 +24,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Reserves; -use C4::Circulation; -use C4::Members; -use C4::Auth qw/checkauth/; +use C4::Reserves qw( CanItemBeReserved AddReserve CanBookBeReserved ); +use C4::Auth qw( checkauth ); use Koha::Items; use Koha::Patrons; diff --git a/reserve/request.pl b/reserve/request.pl index bf13c3dfb2..a4563f34bb 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -29,23 +29,21 @@ =head1 request.pl use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; -use Date::Calc qw/Date_to_Days/; -use C4::Output; -use C4::Auth; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Serials; -use C4::Circulation; -use Koha::DateUtils; +use List::MoreUtils qw( uniq ); +use Date::Calc qw( Date_to_Days ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Reserves qw( RevertWaitingStatus AlterPriority ToggleLowestPriority ToggleSuspend CanBookBeReserved GetMaxPatronHoldsForRecord ItemsAnyAvailableAndNotRestricted CanItemBeReserved IsAvailableForItemLevelRequest ); +use C4::Items qw( get_hostitemnumbers_of ); +use C4::Koha qw( getitemtypeimagelocation ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule ); +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Utils::DataTables::Members; -use C4::Members; -use C4::Search; # enabled_staff_search_views +use C4::Search qw( enabled_staff_search_views ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Checkouts; use Koha::Holds; use Koha::CirculationRules; diff --git a/reviews/reviewswaiting.pl b/reviews/reviewswaiting.pl index 99a0d3f587..6d50443618 100755 --- a/reviews/reviewswaiting.pl +++ b/reviews/reviewswaiting.pl @@ -18,10 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Context; -use C4::Biblio; use Koha::Biblios; use Koha::Patrons; use Koha::Reviews; diff --git a/rotating_collections/addItems.pl b/rotating_collections/addItems.pl index f77c4ed81f..6cde9aebce 100755 --- a/rotating_collections/addItems.pl +++ b/rotating_collections/addItems.pl @@ -18,11 +18,10 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; -use C4::Items; use Koha::Items; diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl index 6955291b61..28a23e5867 100755 --- a/rotating_collections/editCollections.pl +++ b/rotating_collections/editCollections.pl @@ -20,8 +20,8 @@ use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; diff --git a/rotating_collections/rotatingCollections.pl b/rotating_collections/rotatingCollections.pl index 5a22bf43e0..b350861d1e 100755 --- a/rotating_collections/rotatingCollections.pl +++ b/rotating_collections/rotatingCollections.pl @@ -20,8 +20,8 @@ use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; diff --git a/rotating_collections/transferCollection.pl b/rotating_collections/transferCollection.pl index 4380c1e8ab..1d5dcf8d58 100755 --- a/rotating_collections/transferCollection.pl +++ b/rotating_collections/transferCollection.pl @@ -18,8 +18,8 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; diff --git a/serials/acqui-search-result.pl b/serials/acqui-search-result.pl index 95a838c2e4..1a820756d8 100755 --- a/serials/acqui-search-result.pl +++ b/serials/acqui-search-result.pl @@ -41,12 +41,11 @@ =head1 PARAMETERS use Modern::Perl; -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Acquisition qw( SearchOrders ); -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Acquisition::Booksellers; diff --git a/serials/acqui-search.pl b/serials/acqui-search.pl index 2b1041cad5..682b5bbe7d 100755 --- a/serials/acqui-search.pl +++ b/serials/acqui-search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new; diff --git a/serials/add_user_search.pl b/serials/add_user_search.pl index b42b5faf38..1240670dde 100755 --- a/serials/add_user_search.pl +++ b/serials/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index 97dbec1946..6ce76af267 100755 --- a/serials/checkexpiration.pl +++ b/serials/checkexpiration.pl @@ -44,11 +44,11 @@ =head1 PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Serials; # GetExpirationDate -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( SearchSubscriptions GetExpirationDate ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use DateTime; diff --git a/serials/claims.pl b/serials/claims.pl index 4a8a6b70b2..f988a6cc4f 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -19,13 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Serials; -use C4::Acquisition; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( GetSuppliersWithLateIssues GetLateOrMissingIssues updateClaim can_claim_subscription ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Letters; -use C4::Koha qw( GetAuthorisedValues ); +use C4::Letters qw( GetLetters SendAlerts ); use Koha::AdditionalFields; use Koha::CsvProfiles; diff --git a/serials/create-numberpattern.pl b/serials/create-numberpattern.pl index 506a539d39..de6f04d997 100755 --- a/serials/create-numberpattern.pl +++ b/serials/create-numberpattern.pl @@ -20,9 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Serials::Numberpattern; -use C4::Auth qw/check_cookie_auth/; -use URI::Escape; +use C4::Serials::Numberpattern qw( + AddSubscriptionNumberpattern + ModSubscriptionNumberpattern +); +use C4::Auth qw( check_cookie_auth ); my $input = CGI->new; diff --git a/serials/lateissues-export.pl b/serials/lateissues-export.pl index 7af3395d1b..f20cdbe02c 100755 --- a/serials/lateissues-export.pl +++ b/serials/lateissues-export.pl @@ -18,8 +18,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; -use C4::Serials; -use C4::Acquisition; +use C4::Serials qw( GetLateOrMissingIssues updateClaim ); use C4::Output; use C4::Context; diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 093bfb2230..b33cb8dbcd 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -21,16 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Reserves; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( AddReserve ModReserve ); use C4::Context; -use C4::Members; -use C4::Biblio; -use C4::Items; -use C4::Serials; +use C4::Items qw( GetItemsInfo ); +use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); use URI::Escape; use Koha::Biblios; diff --git a/serials/routing.pl b/serials/routing.pl index 6a237f6f6e..2e3122d3b5 100755 --- a/serials/routing.pl +++ b/serials/routing.pl @@ -28,14 +28,11 @@ =head1 Routing.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Members; -use C4::Serials; +use C4::Serials qw( GetSubscription delroutingmember addroutingmember getroutinglist GetSerials GetLatestSerials check_routing ); use Koha::Patrons; use URI::Escape; diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index f725d7f426..963eeeb577 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -21,17 +21,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Serials; -use C4::Letters; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( ModSerialStatus GetSubscription GetNextExpected GetNextSeq GetNextDate NewIssue HasSubscriptionExpired abouttoexpire check_routing GetFullSubscription PrepareSerialsData CountSubscriptionFromBiblionumber GetSubscriptionsFromBiblionumber GetFullSubscriptionsFromBiblionumber ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; use Koha::Serial::Items; use Koha::DateUtils qw( dt_from_string ); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $query = CGI->new; diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index ea9bee8fa5..76a6bf0b25 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -63,21 +63,20 @@ =head1 Parameters use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( decode is_utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Output; +use Encode; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Biblio qw( GetMarcFromKohaField TransformHtmlToXml ); +use C4::Items qw( AddItemFromMarc ModItemFromMarc PrepareItemrecordDisplay ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Serials; -use C4::Search qw/enabled_staff_search_views/; +use C4::Serials qw( GetSerials GetSerials2 GetSerialInformation HasSubscriptionExpired GetSubscription abouttoexpire NewIssue ModSerialStatus GetPreviousSerialid AddItem2Serial ); +use C4::Search qw( enabled_staff_search_views ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Items; use Koha::Serial::Items; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $query = CGI->new(); my $dbh = C4::Context->dbh; diff --git a/serials/serials-home.pl b/serials/serials-home.pl index 6f2c40c082..a0e4bc0185 100755 --- a/serials/serials-home.pl +++ b/serials/serials-home.pl @@ -30,9 +30,9 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Serials; my $query = CGI->new; diff --git a/serials/serials-search.pl b/serials/serials-search.pl index 5b6608a5cd..56a16e6543 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -30,14 +30,13 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha qw( GetAuthorisedValues ); -use C4::Output; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( CloseSubscription ReopenSubscription SearchSubscriptions check_routing ); use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::SharedContent; my $query = CGI->new; diff --git a/serials/showpredictionpattern.pl b/serials/showpredictionpattern.pl index d6bcfc7918..6420e50ce1 100755 --- a/serials/showpredictionpattern.pl +++ b/serials/showpredictionpattern.pl @@ -31,12 +31,12 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw(Today Day_of_Year Week_of_Year Day_of_Week Days_in_Year Delta_Days Add_Delta_Days Add_Delta_YM); -use C4::Auth; -use C4::Output; -use C4::Serials; +use Date::Calc qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq ); use C4::Serials::Frequency; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 96891487bc..b61012ee02 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -18,22 +18,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM); -use C4::Koha; -use C4::Biblio; -use C4::Auth; -use C4::Acquisition; -use C4::Output; +use Date::Calc qw( Add_Delta_Days Add_Delta_YM ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Serials; +use C4::Serials qw( GetSubscription GetNextExpected GetSerials GetSubscriptionLength NewSubscription ModNextExpected ModSubscription ); use C4::Serials::Frequency; use C4::Serials::Numberpattern; -use C4::Letters; +use C4::Letters qw( GetLetters ); use Koha::AdditionalFields; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::ItemTypes; -use Carp; +use Carp qw( carp ); use Koha::Subscription::Numberpattern; use Koha::Subscription::Frequency; diff --git a/serials/subscription-batchedit.pl b/serials/subscription-batchedit.pl index b06f68d6c3..4e069b9ab6 100755 --- a/serials/subscription-batchedit.pl +++ b/serials/subscription-batchedit.pl @@ -21,13 +21,13 @@ use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( can_edit_subscription ); use Koha::Subscriptions; use Koha::Acquisition::Booksellers; use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $cgi = CGI->new; diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 88788590bc..d38147d8c1 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -49,12 +49,12 @@ =head1 PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Koha; -use C4::Auth; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Search; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( new_record_from_zebra ); +use C4::Biblio qw( TransformMarcToKoha ); use Koha::ItemTypes; use Koha::SearchEngine; diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 118b3a1354..6e8204810f 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -17,23 +17,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Auth; -use C4::Budgets; -use C4::Koha; -use C4::Serials; -use C4::Output; +use C4::Auth qw( get_template_and_user checkauth ); +use C4::Serials qw( CloseSubscription ReopenSubscription GetSubscription GetExpirationDate GetSerials HasSubscriptionStrictlyExpired CountIssues HasItems DelSubscription check_routing abouttoexpire can_edit_subscription ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Search qw/enabled_staff_search_views/; +use C4::Search qw( enabled_staff_search_views ); use Koha::AdditionalFields; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Acquisition::Bookseller; use Koha::Subscriptions; -use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days/; -use Carp; +use Carp qw( carp ); use Koha::SharedContent; diff --git a/serials/subscription-frequencies.pl b/serials/subscription-frequencies.pl index 30af9f5ee2..86d14fccd2 100755 --- a/serials/subscription-frequencies.pl +++ b/serials/subscription-frequencies.pl @@ -31,9 +31,9 @@ =head1 DESCRIPTION use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( GetSubscription ModSubscription DelSubscription ); use C4::Serials::Frequency; my $input = CGI->new; diff --git a/serials/subscription-frequency.pl b/serials/subscription-frequency.pl index 2532f8f186..4d46a83d79 100755 --- a/serials/subscription-frequency.pl +++ b/serials/subscription-frequency.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Serials::Frequency; -use C4::Auth qw/check_cookie_auth/; +use C4::Serials::Frequency qw( GetSubscriptionFrequency ); +use C4::Auth qw( check_cookie_auth ); use JSON qw( to_json ); my $input=CGI->new; diff --git a/serials/subscription-history.pl b/serials/subscription-history.pl index 75474ed963..acaf307016 100755 --- a/serials/subscription-history.pl +++ b/serials/subscription-history.pl @@ -30,13 +30,12 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Serials; +use C4::Serials qw( ModSubscriptionHistory ModSubscription GetSubscriptionHistoryFromSubscriptionId GetSubscription ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/serials/subscription-numberpattern.pl b/serials/subscription-numberpattern.pl index db17860721..cc6b2926f7 100755 --- a/serials/subscription-numberpattern.pl +++ b/serials/subscription-numberpattern.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Serials::Numberpattern; -use C4::Auth qw/check_cookie_auth/; +use C4::Serials::Numberpattern qw( GetSubscriptionNumberpattern ); +use C4::Auth qw( check_cookie_auth ); use JSON qw( to_json ); my $input=CGI->new; diff --git a/serials/subscription-numberpatterns.pl b/serials/subscription-numberpatterns.pl index a84c304ac8..19b917bb05 100755 --- a/serials/subscription-numberpatterns.pl +++ b/serials/subscription-numberpatterns.pl @@ -30,10 +30,18 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials::Numberpattern; -use C4::Serials::Frequency; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials::Numberpattern qw( + AddSubscriptionNumberpattern + DelSubscriptionNumberpattern + GetSubscriptionNumberpattern + GetSubscriptionNumberpatternByName + GetSubscriptionNumberpatterns + GetSubscriptionsWithNumberpattern + ModSubscriptionNumberpattern +); +use C4::Serials::Frequency qw( GetSubscriptionFrequencies ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index a30b24940b..5da15363c1 100755 --- a/serials/subscription-renew.pl +++ b/serials/subscription-renew.pl @@ -46,14 +46,14 @@ =head1 Parameters use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; +use Carp qw( carp ); use C4::Koha; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Serials; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription ); +use Koha::DateUtils qw( dt_from_string output_pref ); my $query = CGI->new; my $dbh = C4::Context->dbh; diff --git a/serials/viewalerts.pl b/serials/viewalerts.pl index 106b8679da..bb356c6331 100755 --- a/serials/viewalerts.pl +++ b/serials/viewalerts.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Subscriptions; diff --git a/services/itemrecorddisplay.pl b/services/itemrecorddisplay.pl index 79ee88eb04..f22faca846 100755 --- a/services/itemrecorddisplay.pl +++ b/services/itemrecorddisplay.pl @@ -30,9 +30,9 @@ =head1 DESCRIPTION use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( PrepareItemrecordDisplay ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { diff --git a/suggestion/add_user_search.pl b/suggestion/add_user_search.pl index f6758aa2cf..d4b5ff0243 100755 --- a/suggestion/add_user_search.pl +++ b/suggestion/add_user_search.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 370bac1e0c..27a263cd2c 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -20,12 +20,12 @@ use Modern::Perl; require Exporter; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Suggestions; -use C4::Koha; -use C4::Budgets; -use C4::Search; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget ); +use C4::Search qw( FindDuplicate GetDistinctValues ); use C4::Members; use Koha::DateUtils qw( dt_from_string ); use Koha::AuthorisedValues; @@ -33,7 +33,7 @@ use Koha::Libraries; use Koha::Patrons; -use URI::Escape; +use URI::Escape qw( uri_escape ); sub Init{ my $suggestion= shift @_; diff --git a/svc/authorised_values b/svc/authorised_values index 692b82d6d7..ae082d32e7 100755 --- a/svc/authorised_values +++ b/svc/authorised_values @@ -23,7 +23,6 @@ use JSON qw( to_json ); use CGI; use C4::Service; use C4::Auth qw( check_cookie_auth ); -use C4::Output qw(:DEFAULT :ajax); use Koha::AuthorisedValues; =head1 NAME diff --git a/svc/cataloguing/automatic_linker.pl b/svc/cataloguing/automatic_linker.pl index a04ccfb8c9..a1d6b13b8b 100755 --- a/svc/cataloguing/automatic_linker.pl +++ b/svc/cataloguing/automatic_linker.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI; -use JSON; -use C4::Auth qw(check_cookie_auth); -use C4::Biblio; +use JSON qw( to_json ); +use C4::Auth qw( check_cookie_auth ); +use C4::Biblio qw( BiblioAutoLink TransformHtmlToMarc ); use C4::Context; my $input = CGI->new; diff --git a/svc/checkout_notes b/svc/checkout_notes index 3abd3a8c57..5d13527bfc 100755 --- a/svc/checkout_notes +++ b/svc/checkout_notes @@ -22,8 +22,8 @@ use Modern::Perl; use JSON qw( to_json ); use CGI; use C4::Service; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw ( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use Koha::Checkouts; =head1 NAME diff --git a/svc/creator_batches b/svc/creator_batches index 743cf11ffd..51e13dcdce 100755 --- a/svc/creator_batches +++ b/svc/creator_batches @@ -23,8 +23,8 @@ use JSON qw( encode_json ); use CGI; use C4::Service; use C4::Context; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use C4::Patroncards::Batch; use C4::Labels::Batch; diff --git a/svc/problem_reports b/svc/problem_reports index 9df283efb5..eafa206c55 100755 --- a/svc/problem_reports +++ b/svc/problem_reports @@ -22,8 +22,8 @@ use Modern::Perl; use JSON qw( to_json ); use CGI; use C4::Service; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use Koha::ProblemReports; =head1 NAME diff --git a/t/Acquisition/CanUserManageBasket.t b/t/Acquisition/CanUserManageBasket.t index a862983f70..462189ecde 100755 --- a/t/Acquisition/CanUserManageBasket.t +++ b/t/Acquisition/CanUserManageBasket.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 43; -use C4::Acquisition; +use C4::Acquisition qw( GetBasket GetBasketUsers CanUserManageBasket ); # Avoid "redefined subroutine" warnings local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; diff --git a/t/Auth.t b/t/Auth.t index a02f45b008..d5b2f1e7fa 100755 --- a/t/Auth.t +++ b/t/Auth.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 12; use Test::Warn; -use C4::Auth qw / in_iprange /; +use C4::Auth qw( in_iprange ); $ENV{REMOTE_ADDR} = '192.168.1.30'; diff --git a/t/Auth_with_shibboleth.t b/t/Auth_with_shibboleth.t index 17cbdc8856..5ea1f0d5d2 100755 --- a/t/Auth_with_shibboleth.t +++ b/t/Auth_with_shibboleth.t @@ -94,7 +94,7 @@ $database->mock( 'schema', \&mockedSchema ); my $logger = t::lib::Mocks::Logger->new(); # Can module load -use C4::Auth_with_shibboleth; +use C4::Auth_with_shibboleth qw( shib_ok login_shib_url get_login_shib checkpw_shib ); require_ok('C4::Auth_with_shibboleth'); # Subroutine tests diff --git a/t/AuthoritiesMarc_MARC21.t b/t/AuthoritiesMarc_MARC21.t index fbf713ac66..5c5c837124 100755 --- a/t/AuthoritiesMarc_MARC21.t +++ b/t/AuthoritiesMarc_MARC21.t @@ -10,7 +10,7 @@ use Test::More tests => 4; use MARC::Record; BEGIN { - use_ok('C4::AuthoritiesMarc::MARC21'); + use_ok('C4::AuthoritiesMarc::MARC21', qw( default_auth_type_location fix_marc21_auth_type_location )); } my @result = C4::AuthoritiesMarc::MARC21::default_auth_type_location(); diff --git a/t/AuthoritiesMarc_UNIMARC.t b/t/AuthoritiesMarc_UNIMARC.t index 4d26f3948b..84febb8bbf 100755 --- a/t/AuthoritiesMarc_UNIMARC.t +++ b/t/AuthoritiesMarc_UNIMARC.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 2; BEGIN { - use_ok('C4::AuthoritiesMarc::UNIMARC'); + use_ok('C4::AuthoritiesMarc::UNIMARC', qw( default_auth_type_location )); } my @test = C4::AuthoritiesMarc::UNIMARC::default_auth_type_location(); diff --git a/t/Biblio.t b/t/Biblio.t index f6259e905f..91080bdf96 100755 --- a/t/Biblio.t +++ b/t/Biblio.t @@ -23,7 +23,8 @@ use Test::Warn; plan tests => 39; -use_ok('C4::Biblio'); + +use_ok('C4::Biblio', qw( AddBiblio ModBiblio BiblioAutoLink LinkBibHeadingsToAuthorities GetMarcPrice GetMarcQuantity GetMarcControlnumber GetMarcISBN GetMarcISSN GetMarcSubjects GetMarcAuthors GetMarcUrls GetMarcSeries TransformMarcToKoha ModBiblioMarc RemoveAllNsb GetMarcBiblio UpdateTotalIssues )); my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); diff --git a/t/Biblio/TransformHtmlToXml.t b/t/Biblio/TransformHtmlToXml.t index bbbadd249f..90a7c070da 100755 --- a/t/Biblio/TransformHtmlToXml.t +++ b/t/Biblio/TransformHtmlToXml.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use XML::Simple; -use C4::Biblio qw/TransformHtmlToXml/; +use C4::Biblio qw( TransformHtmlToXml ); sub run_tests { diff --git a/t/Biblio2.t b/t/Biblio2.t index 3cb0cb051c..858bac89bf 100755 --- a/t/Biblio2.t +++ b/t/Biblio2.t @@ -6,7 +6,7 @@ use Test::MockModule; use MARC::Record; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); subtest "_koha_marc_update_bib_ids basic Field", \&_koha_marc_update_bib_ids_simple; sub _koha_marc_update_bib_ids_simple { diff --git a/t/Budgets/CanUserModifyBudget.t b/t/Budgets/CanUserModifyBudget.t index 91f4c77791..b2c8454d71 100755 --- a/t/Budgets/CanUserModifyBudget.t +++ b/t/Budgets/CanUserModifyBudget.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 134; -use C4::Budgets; +use C4::Budgets qw( GetBudget GetBudgetUsers CanUserModifyBudget ); use t::lib::Mocks; # Avoid "redefined subroutine" warnings diff --git a/t/Budgets/CanUserUseBudget.t b/t/Budgets/CanUserUseBudget.t index 9be23a376a..5c528b4f88 100755 --- a/t/Budgets/CanUserUseBudget.t +++ b/t/Budgets/CanUserUseBudget.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 70; -use C4::Budgets; +use C4::Budgets qw( GetBudget GetBudgetUsers CanUserUseBudget ); use t::lib::Mocks; # Avoid "redefined subroutine" warnings diff --git a/t/Charset.t b/t/Charset.t index a3da56f5b0..3e92883e0b 100755 --- a/t/Charset.t +++ b/t/Charset.t @@ -26,7 +26,7 @@ use utf8; use open ':std', ':encoding(utf8)'; BEGIN { - use_ok('C4::Charset'); + use_ok('C4::Charset', qw( NormalizeString SetUTF8Flag IsStringUTF8ish nsb_clean )); } my $string; diff --git a/t/Circulation/AgeRestrictionMarkers.t b/t/Circulation/AgeRestrictionMarkers.t index a67f53db3c..a658d35977 100755 --- a/t/Circulation/AgeRestrictionMarkers.t +++ b/t/Circulation/AgeRestrictionMarkers.t @@ -27,7 +27,7 @@ use Test::Warn; use t::lib::Mocks; -use C4::Circulation; +use C4::Circulation qw( GetAgeRestriction ); t::lib::Mocks::mock_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' ); diff --git a/t/Circulation_barcodedecode.t b/t/Circulation_barcodedecode.t index dc6fe96625..8a57dcd984 100755 --- a/t/Circulation_barcodedecode.t +++ b/t/Circulation_barcodedecode.t @@ -22,7 +22,7 @@ use Test::More tests => 26; use C4::Context; use t::lib::Mocks; -use_ok( 'C4::Circulation' ); +use_ok('C4::Circulation', qw( barcodedecode )); t::lib::Mocks::mock_userenv({ branchcode => 'IMS' }); diff --git a/t/ClassSortRoutine_Dewey.t b/t/ClassSortRoutine_Dewey.t index 404a967231..f4dc8e72e1 100755 --- a/t/ClassSortRoutine_Dewey.t +++ b/t/ClassSortRoutine_Dewey.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 10; BEGIN { - use_ok('C4::ClassSortRoutine::Dewey'); + use_ok('C4::ClassSortRoutine::Dewey', qw( get_class_sort_key )); } my $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key(undef, undef ); diff --git a/t/ClassSortRoutine_Generic.t b/t/ClassSortRoutine_Generic.t index 128006bff2..09c3dd7292 100755 --- a/t/ClassSortRoutine_Generic.t +++ b/t/ClassSortRoutine_Generic.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 3; BEGIN { - use_ok('C4::ClassSortRoutine::Generic'); + use_ok('C4::ClassSortRoutine::Generic', qw( get_class_sort_key )); } my $cn_class = "My class "; diff --git a/t/ClassSortRoutine_LCC.t b/t/ClassSortRoutine_LCC.t index 9ec37cfc69..bfabee440d 100755 --- a/t/ClassSortRoutine_LCC.t +++ b/t/ClassSortRoutine_LCC.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 10; BEGIN { - use_ok('C4::ClassSortRoutine::LCC'); + use_ok('C4::ClassSortRoutine::LCC', qw( get_class_sort_key )); } #Obvious cases diff --git a/t/Creators.t b/t/Creators.t index 6e825d63bb..b1206af16a 100755 --- a/t/Creators.t +++ b/t/Creators.t @@ -18,7 +18,7 @@ use Test::More tests => 41; BEGIN { use_ok('C4::Creators'); - use_ok('C4::Creators::PDF'); + use_ok('C4::Creators::PDF', qw( Init Add Bookmark Compress Font FontSize Page StrWidth Text End )); } my $pdf_creator = C4::Creators::PDF->new(InitVars => 0); diff --git a/t/External/BakerTaylor.t b/t/External/BakerTaylor.t index f6ceb2aa50..e4809359c6 100755 --- a/t/External/BakerTaylor.t +++ b/t/External/BakerTaylor.t @@ -8,7 +8,7 @@ use Test::More tests => 9; use t::lib::Mocks; BEGIN { - use_ok('C4::External::BakerTaylor'); + use_ok('C4::External::BakerTaylor', qw( link_url image_url content_cafe_url http_jacket_link availability )); } # test with mocked prefs diff --git a/t/ImportBatch.t b/t/ImportBatch.t index 9db2c279d9..7274879a3a 100755 --- a/t/ImportBatch.t +++ b/t/ImportBatch.t @@ -25,7 +25,7 @@ use Test::More tests => 3; use t::lib::Mocks; BEGIN { - use_ok('C4::ImportBatch'); + use_ok('C4::ImportBatch', qw( RecordsFromISO2709File RecordsFromMARCXMLFile )); } t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); diff --git a/t/Koha.t b/t/Koha.t index 44c56f0e48..6c12ec8061 100755 --- a/t/Koha.t +++ b/t/Koha.t @@ -31,7 +31,7 @@ BEGIN { } } -use_ok('C4::Koha'); +use_ok('C4::Koha', qw( xml_escape GetVariationsOfISBN GetVariationsOfISBNs GetVariationsOfISSN GetVariationsOfISSNs)); use Test::DBIx::Class; diff --git a/t/Koha/Util/MARC.t b/t/Koha/Util/MARC.t index aff28cbf7d..f278386c18 100755 --- a/t/Koha/Util/MARC.t +++ b/t/Koha/Util/MARC.t @@ -18,6 +18,7 @@ use Modern::Perl; use Test::More tests => 2; +use MARC::Record; BEGIN { use_ok('Koha::Util::MARC'); } diff --git a/t/Koha/sleep.pl b/t/Koha/sleep.pl index 009b4034dc..072ec5b377 100755 --- a/t/Koha/sleep.pl +++ b/t/Koha/sleep.pl @@ -3,8 +3,6 @@ use Modern::Perl; use Koha::Script; -use Fcntl qw(:flock); -use Try::Tiny; # # Lock execution my $script = Koha::Script->new({ script => 'sleep.pl' }); diff --git a/t/Koha/wait.pl b/t/Koha/wait.pl index f909cb1f06..ebe873b0af 100755 --- a/t/Koha/wait.pl +++ b/t/Koha/wait.pl @@ -3,8 +3,6 @@ use Modern::Perl; use Koha::Script; -use Fcntl qw(:flock); -use Try::Tiny; # # Lock execution my $script = Koha::Script->new({ script => 'sleep.pl' }); diff --git a/t/Koha_Util_MARC.t b/t/Koha_Util_MARC.t index 3e205c9cae..e33867003c 100755 --- a/t/Koha_Util_MARC.t +++ b/t/Koha_Util_MARC.t @@ -24,6 +24,7 @@ use strict; use warnings; use Test::More tests => 4; +use MARC::Record; BEGIN { use_ok('Koha::Util::MARC'); diff --git a/t/Labels.t b/t/Labels.t index bd0d9ec85b..69793618a7 100755 --- a/t/Labels.t +++ b/t/Labels.t @@ -20,11 +20,11 @@ use strict; use warnings; -use C4::ClassSplitRoutine::LCC; +use C4::ClassSplitRoutine::LCC qw( split_callnumber ); use Test::More tests => 11; BEGIN { - use_ok('C4::Labels::Label'); + use_ok('C4::Labels::Label', qw( _get_text_fields _check_params _guide_box )); } my $format_string = "title, callnumber"; diff --git a/t/Labels_split_Regex.t b/t/Labels_split_Regex.t index e94eaec170..b69e03b725 100755 --- a/t/Labels_split_Regex.t +++ b/t/Labels_split_Regex.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 5; -use C4::ClassSplitRoutine::RegEx; +use C4::ClassSplitRoutine::RegEx qw( split_callnumber ); my $callnumbers = { '830 Han' => [qw{830 Han}], diff --git a/t/Labels_split_ddcn.t b/t/Labels_split_ddcn.t index 33edba19ca..3044a37d2e 100755 --- a/t/Labels_split_ddcn.t +++ b/t/Labels_split_ddcn.t @@ -42,7 +42,7 @@ BEGIN { $test_num += 4; } plan tests => $test_num; - use_ok('C4::ClassSplitRoutine::Dewey'); + use_ok('C4::ClassSplitRoutine::Dewey', qw( split_callnumber )); use vars qw($ddcns); } diff --git a/t/Labels_split_lccn.t b/t/Labels_split_lccn.t index f9462ba23c..76a6a41c66 100755 --- a/t/Labels_split_lccn.t +++ b/t/Labels_split_lccn.t @@ -20,7 +20,7 @@ use strict; use warnings; -use C4::ClassSplitRoutine::LCC; +use C4::ClassSplitRoutine::LCC qw( split_callnumber ); use Test::More; BEGIN { diff --git a/t/Languages.t b/t/Languages.t index 6492ba4d0c..14c5d2866d 100755 --- a/t/Languages.t +++ b/t/Languages.t @@ -24,7 +24,7 @@ use CGI qw ( -utf8 ); use Koha::Cache::Memory::Lite; BEGIN { - use_ok('C4::Languages'); + use_ok('C4::Languages', qw( getlanguage )); } my @languages = (); # stores the list of active languages diff --git a/t/Letters.t b/t/Letters.t index 35a4b74a2a..ceec8d776b 100755 --- a/t/Letters.t +++ b/t/Letters.t @@ -44,7 +44,7 @@ fixtures_ok [ my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); -use_ok('C4::Letters'); +use_ok('C4::Letters', qw( GetLetters )); t::lib::Mocks::mock_preference('dateformat', 'metric'); diff --git a/t/Matcher.t b/t/Matcher.t index 42dc809044..3345e14251 100755 --- a/t/Matcher.t +++ b/t/Matcher.t @@ -38,7 +38,7 @@ use Test::DBIx::Class; my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); -use_ok('C4::Matcher'); +use_ok('C4::Matcher', qw( GetMatcherList GetMatcherId )); fixtures_ok [ MarcMatcher => [ diff --git a/t/Members/cardnumber.t b/t/Members/cardnumber.t index 7f4e2b0535..7fddc7e676 100755 --- a/t/Members/cardnumber.t +++ b/t/Members/cardnumber.t @@ -7,7 +7,7 @@ use Test::MockModule; use t::lib::Mocks; -use_ok('C4::Members'); +use_ok('C4::Members', qw( get_cardnumber_length checkcardnumber )); BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { diff --git a/t/Output.t b/t/Output.t index 31ca103a75..02218deadd 100755 --- a/t/Output.t +++ b/t/Output.t @@ -24,7 +24,7 @@ use CGI qw ( -utf8 ); use t::lib::Mocks; BEGIN { - use_ok('C4::Output'); + use_ok('C4::Output', qw( output_html_with_http_headers parametrized_url )); } my $query = CGI->new(); diff --git a/t/Prices.t b/t/Prices.t index 5c2c861306..b0832c5977 100755 --- a/t/Prices.t +++ b/t/Prices.t @@ -14,7 +14,7 @@ BEGIN { } } -use_ok('C4::Acquisition'); +use_ok('C4::Acquisition', qw( populate_order_with_prices )); use_ok('C4::Context'); use_ok('Koha::Number::Price'); diff --git a/t/SIP/Sip.t b/t/SIP/Sip.t index e7e06709d2..1dc7ed1684 100755 --- a/t/SIP/Sip.t +++ b/t/SIP/Sip.t @@ -21,7 +21,7 @@ use Test::More tests => 9; use Test::Warn; BEGIN { - use_ok('C4::SIP::Sip'); + use_ok('C4::SIP::Sip', qw( timestamp )); } my $date_time = C4::SIP::Sip::timestamp(); diff --git a/t/SMS.t b/t/SMS.t index 21dc75bbb8..bf8de65152 100755 --- a/t/SMS.t +++ b/t/SMS.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use Test::More tests => 7; BEGIN { - use_ok('C4::SMS'); + use_ok('C4::SMS', qw( driver send_sms )); } diff --git a/t/Scheduler.t b/t/Scheduler.t index f0f02e11f9..520b6b326f 100755 --- a/t/Scheduler.t +++ b/t/Scheduler.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 6; BEGIN { - use_ok('C4::Scheduler'); + use_ok('C4::Scheduler', qw( get_jobs get_at_jobs get_at_job add_at_job remove_at_job )); } ok(C4::Scheduler::get_jobs(), "testing get_jobs with no arguments"); diff --git a/t/Scrubber.t b/t/Scrubber.t index 9bcd003636..1b4a9e13d1 100755 --- a/t/Scrubber.t +++ b/t/Scrubber.t @@ -8,9 +8,9 @@ use Test::More tests => 29; use Test::Warn; BEGIN { - use FindBin; - use lib $FindBin::Bin; - use_ok('C4::Scrubber'); + use FindBin; + use lib $FindBin::Bin; + use_ok('C4::Scrubber'); } sub pretty_line { diff --git a/t/Search/History.t b/t/Search/History.t index 030bca2ab6..0b3715c13c 100755 --- a/t/Search/History.t +++ b/t/Search/History.t @@ -7,7 +7,7 @@ use URI::Escape; use JSON qw( decode_json ); use_ok('Koha::DateUtils'); -use_ok('C4::Search::History'); +use_ok('C4::Search::History', qw( get get_from_session set_to_session delete )); use_ok('C4::Auth', qw/get_session/ ); # Test session diff --git a/t/Search/buildQuery.t b/t/Search/buildQuery.t index 910bf4fd3c..cab9d5aeef 100755 --- a/t/Search/buildQuery.t +++ b/t/Search/buildQuery.t @@ -33,7 +33,7 @@ BEGIN { # Mock the DB connection and C4::Context use Test::DBIx::Class; -use_ok('C4::Search'); +use_ok('C4::Search', qw( buildQuery )); can_ok('C4::Search', qw/buildQuery/); use_ok("Net::Z3950::ZOOM"); diff --git a/t/Serials/GetNextSeq.t b/t/Serials/GetNextSeq.t index 8fc201a9e7..c1cf423f3d 100755 --- a/t/Serials/GetNextSeq.t +++ b/t/Serials/GetNextSeq.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 43; -use C4::Serials; +use C4::Serials qw( GetNextSeq ); # TEST CASE 1 - 1 variable, from 1 to 4 my $subscription = { diff --git a/t/Serials/ModSerialStatus.t b/t/Serials/ModSerialStatus.t index afd7effcfb..480b84f4c1 100755 --- a/t/Serials/ModSerialStatus.t +++ b/t/Serials/ModSerialStatus.t @@ -24,7 +24,7 @@ use Data::Dumper qw/Dumper/; use Test::More tests => 8; -use C4::Serials qw//; +use C4::Serials; # Testing C4::Serials::_handle_seqno my $list = '2017 (No. 8); 2017 (No. 9); 2017 (No. 10)'; diff --git a/t/SimpleMARC.t b/t/SimpleMARC.t index 6455820fbb..91b77432e5 100755 --- a/t/SimpleMARC.t +++ b/t/SimpleMARC.t @@ -4,7 +4,7 @@ use Test::More tests => 11; use_ok("MARC::Field"); use_ok("MARC::Record"); -use_ok("Koha::SimpleMARC"); +use_ok("Koha::SimpleMARC", qw( field_exists read_field update_field copy_field copy_and_replace_field move_field delete_field field_equals )); sub new_record { my $record = MARC::Record->new; diff --git a/t/SocialData.t b/t/SocialData.t index df14a50132..97d657529f 100755 --- a/t/SocialData.t +++ b/t/SocialData.t @@ -31,7 +31,7 @@ BEGIN { } BEGIN { - use_ok('C4::SocialData'); + use_ok('C4::SocialData', qw( get_data get_report )); } use Test::DBIx::Class; diff --git a/t/TmplToken.t b/t/TmplToken.t index 579ee9d591..a52f3c5e6f 100755 --- a/t/TmplToken.t +++ b/t/TmplToken.t @@ -5,7 +5,6 @@ use strict; use warnings; -use C4::TmplTokenType; use Test::More tests => 19; BEGIN { diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index caa9268888..3bcd14bb8b 100755 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -37,7 +37,7 @@ use Koha::DateUtils qw( dt_from_string ); use C4::Circulation qw( MarkIssueReturned ); BEGIN { - use_ok('C4::Accounts'); + use_ok('C4::Accounts', qw( chargelostitem purge_zero_balance_fees )); use_ok('Koha::Object'); use_ok('Koha::Patron'); use_ok('Data::Dumper'); diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 6fe9ede74c..57ef90dc4e 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -28,9 +28,9 @@ use Koha::Acquisition::Basket; use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'MARC21' ); BEGIN { - use_ok('C4::Acquisition'); - use_ok('C4::Biblio'); - use_ok('C4::Budgets'); + use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder SearchOrders GetOrder GetHistory ModOrder get_rounding_sql get_rounded_price ReopenBasket ModBasket ModBasketHeader ModBasketUsers )); + use_ok('C4::Biblio', qw( AddBiblio GetMarcSubfieldStructure )); + use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget GetBudget GetBudgetByOrderNumber GetBudgetsReport GetBudgets GetBudgetReport )); use_ok('Koha::Acquisition::Orders'); use_ok('Koha::Acquisition::Booksellers'); use_ok('t::lib::TestBuilder'); diff --git a/t/db_dependent/Acquisition/CancelReceipt.t b/t/db_dependent/Acquisition/CancelReceipt.t index d3317bcd54..5b5b9c03d4 100755 --- a/t/db_dependent/Acquisition/CancelReceipt.t +++ b/t/db_dependent/Acquisition/CancelReceipt.t @@ -21,10 +21,10 @@ use Test::More tests => 12; use t::lib::TestBuilder; use C4::Context; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket ModReceiveOrder CancelReceipt ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Budgets; +use C4::Budgets qw( AddBudget GetBudget ); use t::lib::Mocks; use Koha::Database; diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index 5b9b648c0e..ae79a8d8aa 100755 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -6,8 +6,8 @@ use CGI; use Test::More tests => 4; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket GetBasket GetBasketAsCSV ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::CsvProfiles; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t b/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t index fce3cf6033..458a2c7590 100755 --- a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t +++ b/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t @@ -4,9 +4,9 @@ use Modern::Perl; use Test::More tests => 43; use Data::Dumper; -use C4::Acquisition qw( NewBasket GetBasketsInfosByBookseller ); +use C4::Acquisition qw( NewBasket GetBasket GetBasketsInfosByBookseller ReopenBasket AddInvoice GetInvoice ModReceiveOrder ); use C4::Biblio qw( AddBiblio ); -use C4::Budgets qw( AddBudget ); +use C4::Budgets qw( AddBudget GetBudget ); use C4::Context; use Koha::Database; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t index 913573432f..9b52802108 100755 --- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t +++ b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; +use C4::Acquisition qw( NewBasket GetOrders GetOrdersByBiblionumber GetOrder ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use Koha::Database; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Acquisition/Invoices.t b/t/db_dependent/Acquisition/Invoices.t index 399e9b7156..0327a8490b 100755 --- a/t/db_dependent/Acquisition/Invoices.t +++ b/t/db_dependent/Acquisition/Invoices.t @@ -11,7 +11,7 @@ use Koha::Database; use Test::More tests => 24; BEGIN { - use_ok('C4::Acquisition'); + use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder GetInvoiceDetails GetInvoices ModInvoice CloseInvoice ReopenInvoice MergeInvoices DelInvoice )); } my $schema = Koha::Database->new()->schema(); diff --git a/t/db_dependent/Acquisition/NewOrder.t b/t/db_dependent/Acquisition/NewOrder.t index df455c2e67..6c7e6820fe 100755 --- a/t/db_dependent/Acquisition/NewOrder.t +++ b/t/db_dependent/Acquisition/NewOrder.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More tests => 8; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; +use C4::Acquisition qw( NewBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use MARC::Record; use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t index fb85b52ed1..d9db71c180 100755 --- a/t/db_dependent/Acquisition/OrderFromSubscription.t +++ b/t/db_dependent/Acquisition/OrderFromSubscription.t @@ -4,10 +4,10 @@ use Test::More tests => 12; use t::lib::TestBuilder; -use_ok('C4::Acquisition'); -use_ok('C4::Biblio'); -use_ok('C4::Budgets'); -use_ok('C4::Serials'); +use_ok('C4::Acquisition', qw( NewBasket AddInvoice GetInvoice ModReceiveOrder GetInvoices )); +use_ok('C4::Biblio', qw( AddBiblio )); +use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget )); +use_ok('C4::Serials', qw( NewSubscription GetSubscription subscriptionCurrentlyOnOrder )); use Koha::Acquisition::Orders; use Koha::Database; diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t index f4ffcb2652..3ad3bcd041 100755 --- a/t/db_dependent/Acquisition/OrderUsers.t +++ b/t/db_dependent/Acquisition/OrderUsers.t @@ -1,9 +1,9 @@ use Modern::Perl; use Test::More tests => 3; -use C4::Acquisition; -use C4::Biblio; -use C4::Letters; +use C4::Acquisition qw( NewBasket AddInvoice ModOrder ModOrderUsers GetOrder GetOrderUsers ModReceiveOrder ); +use C4::Biblio qw( AddBiblio ); +use C4::Letters qw( GetQueuedMessages ); use Koha::Database; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Acquisition/StandingOrders.t b/t/db_dependent/Acquisition/StandingOrders.t index d53d13d93d..ecf7cd1e5c 100755 --- a/t/db_dependent/Acquisition/StandingOrders.t +++ b/t/db_dependent/Acquisition/StandingOrders.t @@ -4,8 +4,8 @@ use Modern::Perl; use Test::More tests => 14; use C4::Context; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket GetBasket SearchOrders AddInvoice ModReceiveOrder CancelReceipt ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use C4::Budgets; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Acquisition/TransferOrder.t b/t/db_dependent/Acquisition/TransferOrder.t index 8fa55d2eb5..a9e59a5637 100755 --- a/t/db_dependent/Acquisition/TransferOrder.t +++ b/t/db_dependent/Acquisition/TransferOrder.t @@ -4,10 +4,10 @@ use Modern::Perl; use Test::More tests => 13; use C4::Context; -use C4::Acquisition; +use C4::Acquisition qw( NewBasket GetOrders GetOrder TransferOrder SearchOrders ModReceiveOrder CancelReceipt ); use C4::Biblio; use C4::Items; -use C4::Budgets; +use C4::Budgets qw( AddBudget GetBudget ); use Koha::Database; use Koha::DateUtils; use Koha::Acquisition::Booksellers; diff --git a/t/db_dependent/Acquisition/close_reopen_basket.t b/t/db_dependent/Acquisition/close_reopen_basket.t index 7faaac1611..16ca5979f0 100755 --- a/t/db_dependent/Acquisition/close_reopen_basket.t +++ b/t/db_dependent/Acquisition/close_reopen_basket.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More tests => 14; -use C4::Acquisition; -use C4::Biblio qw( AddBiblio DelBiblio ); -use C4::Budgets; +use C4::Acquisition qw( NewBasket GetBiblioCountByBasketno GetOrders GetOrder ReopenBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use C4::Context; use Koha::Database; use Koha::Acquisition::Booksellers; diff --git a/t/db_dependent/Acquisition/populate_order_with_prices.t b/t/db_dependent/Acquisition/populate_order_with_prices.t index 50af03bf6d..0aa3a1af91 100755 --- a/t/db_dependent/Acquisition/populate_order_with_prices.t +++ b/t/db_dependent/Acquisition/populate_order_with_prices.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 44; -use C4::Acquisition; +use C4::Acquisition qw( populate_order_with_prices ); use C4::Context; use Koha::Database; use t::lib::TestBuilder; diff --git a/t/db_dependent/Amazon.t b/t/db_dependent/Amazon.t index 2304073931..871808415d 100755 --- a/t/db_dependent/Amazon.t +++ b/t/db_dependent/Amazon.t @@ -11,7 +11,7 @@ use t::lib::Mocks; use C4::Context; BEGIN { - use_ok('C4::External::Amazon'); + use_ok('C4::External::Amazon', qw( get_amazon_tld )); } my $context = C4::Context->new(); diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index a612b1a599..5fdf29a913 100755 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -15,14 +15,13 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Auth qw(checkpw); use C4::Members; use Koha::AuthUtils qw/hash_password/; use Koha::Database; use Koha::Patrons; BEGIN { - use_ok('C4::Auth'); + use_ok('C4::Auth', qw( checkauth haspermission track_login_daily checkpw get_template_and_user checkpw_hash )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Auth/haspermission.t b/t/db_dependent/Auth/haspermission.t index 064422b013..c332faf0c8 100755 --- a/t/db_dependent/Auth/haspermission.t +++ b/t/db_dependent/Auth/haspermission.t @@ -25,7 +25,7 @@ use Test::Exception; use Koha::Database; use t::lib::TestBuilder; -use C4::Auth qw(haspermission); +use C4::Auth qw( haspermission ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t index 3038228e6a..be33224325 100755 --- a/t/db_dependent/Auth_with_cas.t +++ b/t/db_dependent/Auth_with_cas.t @@ -28,7 +28,7 @@ use C4::Context; use Koha::Database; BEGIN { - use_ok('C4::Auth_with_cas'); + use_ok('C4::Auth_with_cas', qw( check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url )); can_ok('C4::Auth_with_cas', qw/ check_api_auth_cas checkpw_cas diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t index 565ddbdae6..39f6e8ef02 100755 --- a/t/db_dependent/Auth_with_ldap.t +++ b/t/db_dependent/Auth_with_ldap.t @@ -120,7 +120,7 @@ $builder->build( my $patron = Koha::Patrons->find($borrower->{borrowernumber}); # C4::Auth_with_ldap needs several stuff set first ^^^ -use_ok('C4::Auth_with_ldap'); +use_ok('C4::Auth_with_ldap', qw( checkpw_ldap )); can_ok( 'C4::Auth_with_ldap', qw/ checkpw_ldap diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t index 8e626f3f5c..f72b0c3705 100755 --- a/t/db_dependent/AuthoritiesMarc.t +++ b/t/db_dependent/AuthoritiesMarc.t @@ -17,7 +17,7 @@ use Koha::Database; use Koha::Authority::Types; BEGIN { - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( GetHeaderAuthority AddAuthority AddAuthorityTrees GetAuthority BuildAuthHierarchies GenerateHierarchy BuildSummary DelAuthority CompareFieldWithAuthority ModAuthority merge )); } # We are now going to be testing the authorities hierarchy code, and diff --git a/t/db_dependent/Authority/Merge.t b/t/db_dependent/Authority/Merge.t index bf25a913fc..efa9a30fc7 100755 --- a/t/db_dependent/Authority/Merge.t +++ b/t/db_dependent/Authority/Merge.t @@ -13,14 +13,14 @@ use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( AddBiblio GetMarcBiblio ModBiblio ); use Koha::Authorities; use Koha::Authority::ControlledIndicators; use Koha::Authority::MergeRequests; use Koha::Database; BEGIN { - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( merge AddAuthority compare_fields DelAuthority )); } # Optionally change marc flavour diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t index 011c775119..459f3b2856 100755 --- a/t/db_dependent/BackgroundJob.t +++ b/t/db_dependent/BackgroundJob.t @@ -1,14 +1,14 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_session ); use CGI qw ( -utf8 ); use Test::More tests => 18; use Koha::Database; BEGIN { - use_ok('C4::BackgroundJob'); + use_ok('C4::BackgroundJob', qw( get id fetch name invoker progress status size set finish results clear )); } my $query = CGI->new; diff --git a/t/db_dependent/Barcodes.t b/t/db_dependent/Barcodes.t index 4253a615eb..2846f4fe89 100755 --- a/t/db_dependent/Barcodes.t +++ b/t/db_dependent/Barcodes.t @@ -29,7 +29,7 @@ $| = 1; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Barcodes'); + use_ok('C4::Barcodes', qw( value initial max db_max next_value next previous serial autoBarcode is_max )); } my $builder = t::lib::TestBuilder->new; diff --git a/t/db_dependent/Barcodes_ValueBuilder.t b/t/db_dependent/Barcodes_ValueBuilder.t index ef0fa3a39b..f21f140c38 100755 --- a/t/db_dependent/Barcodes_ValueBuilder.t +++ b/t/db_dependent/Barcodes_ValueBuilder.t @@ -23,7 +23,7 @@ use t::lib::TestBuilder; use Koha::Database; BEGIN { - use_ok('C4::Barcodes::ValueBuilder'); + use_ok('C4::Barcodes::ValueBuilder', qw( get_barcode )); }; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index feac71d8eb..4515303044 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -30,10 +30,10 @@ use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Linker::Default; +use C4::Linker::Default qw( get_link ); BEGIN { - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData GetMarcBiblio ModBiblio GetMarcISSN GetMarcControlnumber GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio )); } my $schema = Koha::Database->new->schema; @@ -472,7 +472,7 @@ sub run_tests { my $authid = $field->subfield('9'); ok($authid, 'ModBiblio adds authority id'); - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( GetAuthority )); my $auth_record = C4::AuthoritiesMarc::GetAuthority($authid); ok($auth_record, 'Authority record successfully retrieved'); diff --git a/t/db_dependent/Biblio/Isbd.t b/t/db_dependent/Biblio/Isbd.t index 4943afebab..dc992b284a 100755 --- a/t/db_dependent/Biblio/Isbd.t +++ b/t/db_dependent/Biblio/Isbd.t @@ -25,7 +25,7 @@ use t::lib::Mocks qw( mock_preference ); use Koha::Database; BEGIN { - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( GetISBDView )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Biblio/ModBiblioMarc.t b/t/db_dependent/Biblio/ModBiblioMarc.t index e710ffee3c..8f7e28b49c 100755 --- a/t/db_dependent/Biblio/ModBiblioMarc.t +++ b/t/db_dependent/Biblio/ModBiblioMarc.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use MARC::Record; -use C4::Biblio; +use C4::Biblio qw( ModBiblio ModBiblioMarc GetMarcBiblio ); use Koha::Database; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Biblio/TransformHtmlToMarc.t b/t/db_dependent/Biblio/TransformHtmlToMarc.t index f4ac6a8637..708a764ff4 100755 --- a/t/db_dependent/Biblio/TransformHtmlToMarc.t +++ b/t/db_dependent/Biblio/TransformHtmlToMarc.t @@ -8,7 +8,7 @@ use Test::More tests => 2; use Koha::Caches; use Koha::Database; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField TransformHtmlToMarc ); our ( $biblionumbertagfield, $biblionumbertagsubfield ); my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Biblio/TransformKohaToMarc.t b/t/db_dependent/Biblio/TransformKohaToMarc.t index 377dbab6a5..d2efaa6aa9 100755 --- a/t/db_dependent/Biblio/TransformKohaToMarc.t +++ b/t/db_dependent/Biblio/TransformKohaToMarc.t @@ -8,7 +8,7 @@ use t::lib::TestBuilder; use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( TransformKohaToMarc ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Biblio/TransformMarcToKoha.t b/t/db_dependent/Biblio/TransformMarcToKoha.t index 1a08ded4f0..5062ed7c48 100755 --- a/t/db_dependent/Biblio/TransformMarcToKoha.t +++ b/t/db_dependent/Biblio/TransformMarcToKoha.t @@ -28,7 +28,7 @@ use t::lib::TestBuilder; use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( TransformMarcToKoha TransformMarcToKohaOneField ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index c7eec725f9..617673dcd5 100755 --- a/t/db_dependent/Budgets.t +++ b/t/db_dependent/Budgets.t @@ -3,11 +3,11 @@ use Modern::Perl; use Test::More tests => 144; BEGIN { - use_ok('C4::Budgets') + use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget GetBudgetPeriods GetBudgetPeriod GetBudget ModBudgetPeriod ModBudget DelBudgetPeriod DelBudget GetBudgets GetBudgetName GetBudgetByCode GetBudgetHierarchy GetBudgetHierarchySpent GetBudgetSpent GetBudgetOrdered CloneBudgetPeriod GetBudgetsByActivity MoveOrders GetBudgetByOrderNumber SetOwnerToFundHierarchy GetBudgetAuthCats GetBudgetsPlanCell )); } use C4::Context; -use C4::Biblio; -use C4::Acquisition; +use C4::Biblio qw( AddBiblio ); +use C4::Acquisition qw( NewBasket AddInvoice GetInvoice ModReceiveOrder populate_order_with_prices ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Charset.t b/t/db_dependent/Charset.t index b1542a3b82..420b38641e 100755 --- a/t/db_dependent/Charset.t +++ b/t/db_dependent/Charset.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 4; use MARC::Record; -use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use C4::Context; use C4::Charset qw( SanitizeRecord ); diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 4ab64dd552..8aa5d4c970 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -32,13 +32,13 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Accounts; -use C4::Calendar; -use C4::Circulation; +use C4::Calendar qw( new insert_single_holiday insert_week_day_holiday delete_holiday ); +use C4::Circulation qw( AddIssue AddReturn CanBookBeRenewed GetIssuingCharges AddRenewal GetSoonestRenewDate GetLatestAutoRenewDate LostItem GetUpcomingDueIssues CanBookBeIssued AddIssuingCharge ProcessOfflinePayment transferbook updateWrongTransfer ); use C4::Biblio; -use C4::Items; +use C4::Items qw( ModItemTransfer ); use C4::Log; -use C4::Reserves; -use C4::Overdues qw(UpdateFine CalcFine); +use C4::Reserves qw( AddReserve ModReserve ModReserveCancelAll ModReserveAffect CheckReserves GetOtherReserves ); +use C4::Overdues qw( CalcFine UpdateFine get_chargeable_units ); use Koha::DateUtils; use Koha::Database; use Koha::Items; diff --git a/t/db_dependent/Circulation/Branch.t b/t/db_dependent/Circulation/Branch.t index 041c000449..00352acbc3 100755 --- a/t/db_dependent/Circulation/Branch.t +++ b/t/db_dependent/Circulation/Branch.t @@ -17,9 +17,9 @@ use Modern::Perl; -use C4::Circulation; -use C4::Items; -use C4::Biblio; +use C4::Circulation qw( AddIssue AddReturn GetBranchBorrowerCircRule GetBranchItemRule ); +use C4::Items qw( ModItemTransfer ); +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::CirculationRules; @@ -30,7 +30,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( AddIssue AddReturn GetBranchBorrowerCircRule GetBranchItemRule )); } can_ok( 'C4::Circulation', qw( diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t index 8085dbd486..af23654b2b 100755 --- a/t/db_dependent/Circulation/CalcDateDue.t +++ b/t/db_dependent/Circulation/CalcDateDue.t @@ -8,11 +8,11 @@ use DBI; use DateTime; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday delete_holiday insert_week_day_holiday ); use Koha::CirculationRules; -use_ok('C4::Circulation'); +use_ok('C4::Circulation', qw( CalcDateDue )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Circulation/CalcFine.t b/t/db_dependent/Circulation/CalcFine.t index 85f38ea42e..840679f78a 100755 --- a/t/db_dependent/Circulation/CalcFine.t +++ b/t/db_dependent/Circulation/CalcFine.t @@ -5,7 +5,7 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Overdues; +use C4::Overdues qw( CalcFine ); use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t b/t/db_dependent/Circulation/CheckIfIssuedToPatron.t index 2d67ffc022..447d9545ad 100755 --- a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t +++ b/t/db_dependent/Circulation/CheckIfIssuedToPatron.t @@ -21,9 +21,9 @@ use Test::More tests => 21; use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( CheckIfIssuedToPatron AddIssue ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Library; use Koha::Patrons; use MARC::Record; diff --git a/t/db_dependent/Circulation/CheckValidBarcode.t b/t/db_dependent/Circulation/CheckValidBarcode.t index 41305a84d3..0e159b60ac 100755 --- a/t/db_dependent/Circulation/CheckValidBarcode.t +++ b/t/db_dependent/Circulation/CheckValidBarcode.t @@ -19,15 +19,15 @@ use Modern::Perl; use Test::More tests => 10; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( CheckValidBarcode ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use Koha::Database; use Koha::Library; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( CheckValidBarcode )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t index 275ecc426e..f68b98c20d 100755 --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ b/t/db_dependent/Circulation/GetHardDueDate.t @@ -13,7 +13,7 @@ use t::lib::TestBuilder; use Test::More tests => 9; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( GetHardDueDate GetLoanLength )); } can_ok( 'C4::Circulation', diff --git a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t b/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t index 2698578260..15d59521d9 100755 --- a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t +++ b/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t @@ -21,8 +21,8 @@ use Test::More tests => 2; use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue GetPendingOnSiteCheckouts ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use C4::Members; diff --git a/t/db_dependent/Circulation/GetTopIssues.t b/t/db_dependent/Circulation/GetTopIssues.t index 80e044356e..a5dc375e74 100755 --- a/t/db_dependent/Circulation/GetTopIssues.t +++ b/t/db_dependent/Circulation/GetTopIssues.t @@ -23,8 +23,8 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Context; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue GetTopIssues ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use C4::Items; use Koha::Database; diff --git a/t/db_dependent/Circulation/IsItemIssued.t b/t/db_dependent/Circulation/IsItemIssued.t index 5b51eb9985..e214882783 100755 --- a/t/db_dependent/Circulation/IsItemIssued.t +++ b/t/db_dependent/Circulation/IsItemIssued.t @@ -20,9 +20,9 @@ use Modern::Perl; use Test::More tests => 5; use Test::MockModule; -use C4::Circulation; +use C4::Circulation qw( IsItemIssued AddIssue AddReturn ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::DateUtils; use Koha::Items; diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t index e9152d3f9f..e7b1d44421 100755 --- a/t/db_dependent/Circulation/MarkIssueReturned.t +++ b/t/db_dependent/Circulation/MarkIssueReturned.t @@ -23,7 +23,7 @@ use Test::Exception; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( MarkIssueReturned AddIssue ); use C4::Context; use Koha::Checkouts; use Koha::Database; diff --git a/t/db_dependent/Circulation/OfflineOperation.t b/t/db_dependent/Circulation/OfflineOperation.t index 6a92da4b1c..98cc530f90 100755 --- a/t/db_dependent/Circulation/OfflineOperation.t +++ b/t/db_dependent/Circulation/OfflineOperation.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Circulation; +use C4::Circulation qw( AddOfflineOperation GetOfflineOperation GetOfflineOperations DeleteOfflineOperation ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); @@ -10,7 +10,7 @@ use Koha::Library; use Test::More tests => 7; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( AddOfflineOperation GetOfflineOperation GetOfflineOperations DeleteOfflineOperation )); } can_ok( 'C4::Circulation', diff --git a/t/db_dependent/Circulation/ReturnClaims.t b/t/db_dependent/Circulation/ReturnClaims.t index 87206aeb63..ee7b8c54e6 100755 --- a/t/db_dependent/Circulation/ReturnClaims.t +++ b/t/db_dependent/Circulation/ReturnClaims.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( LostItem AddIssue ); # Mock userenv, used by AddIssue my $branch; diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index 79ae8555bf..c361d3c165 100755 --- a/t/db_dependent/Circulation/Returns.t +++ b/t/db_dependent/Circulation/Returns.t @@ -25,9 +25,9 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddReturn AddIssue LostItem ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Account::Lines; use Koha::DateUtils; diff --git a/t/db_dependent/Circulation/StoreLastBorrower.t b/t/db_dependent/Circulation/StoreLastBorrower.t index 7d9440db39..b6770d8e06 100755 --- a/t/db_dependent/Circulation/StoreLastBorrower.t +++ b/t/db_dependent/Circulation/StoreLastBorrower.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 1; -use C4::Circulation; +use C4::Circulation qw( AddReturn ); use C4::Context; use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t index 9abe3bdc8e..1c8ea0f7d0 100755 --- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t +++ b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 10; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( TooMany AddIssue CanBookBeIssued ); use C4::Biblio; use C4::Items; use C4::Members; diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t index d1663d98a3..c8dbd09a7a 100755 --- a/t/db_dependent/Circulation/TooMany.t +++ b/t/db_dependent/Circulation/TooMany.t @@ -21,7 +21,7 @@ use C4::Context; use C4::Members; use C4::Items; use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( TooMany AddIssue ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 0ded4142fb..d4fb82b55b 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -23,11 +23,11 @@ use DateTime::Duration; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Biblio; -use C4::Circulation; +use C4::Biblio qw( AddBiblio ); +use C4::Circulation qw( AddIssue AddIssuingCharge AddRenewal AddReturn GetIssuingCharges GetOpenIssue GetRenewCount GetUpcomingDueIssues ); use C4::Context; use C4::Items; -use C4::Reserves; +use C4::Reserves qw( AddReserve ); use Koha::Checkouts; use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t index 2e2ac0fe74..84756a82b8 100755 --- a/t/db_dependent/Circulation/transferbook.t +++ b/t/db_dependent/Circulation/transferbook.t @@ -21,8 +21,8 @@ use Test::More tests => 6; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Reserves; +use C4::Circulation qw( transferbook AddIssue GetTransfers ); +use C4::Reserves qw( AddReserve ); use Koha::DateUtils qw( dt_from_string ); use Koha::Item::Transfers; diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t index 5e639ae90c..99767c8798 100755 --- a/t/db_dependent/Circulation/transfers.t +++ b/t/db_dependent/Circulation/transfers.t @@ -17,9 +17,9 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; -use C4::Biblio; -use C4::Items; +use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip ); +use C4::Biblio qw( AddBiblio ); +use C4::Items qw( ModItemTransfer ); use Koha::Database; use Koha::DateUtils; use DateTime::Duration; @@ -31,7 +31,7 @@ use Test::More tests => 22; use Test::Deep; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip )); } can_ok( 'C4::Circulation', diff --git a/t/db_dependent/Contract.t b/t/db_dependent/Contract.t index 1a6bafdf07..7ce9d34ac7 100755 --- a/t/db_dependent/Contract.t +++ b/t/db_dependent/Contract.t @@ -29,7 +29,7 @@ use DateTime::Duration; use Test::More tests => 43; BEGIN { - use_ok('C4::Contract'); + use_ok('C4::Contract', qw( GetContracts GetContract AddContract ModContract DelContract )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/CourseReserves.t b/t/db_dependent/CourseReserves.t index c4a888a407..f8715c209d 100755 --- a/t/db_dependent/CourseReserves.t +++ b/t/db_dependent/CourseReserves.t @@ -23,8 +23,8 @@ use Koha::Database; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Biblio'); - use_ok('C4::CourseReserves', qw/:all/); + use_ok('C4::Biblio', qw( AddBiblio )); + use_ok('C4::CourseReserves', qw( GetCourse ModCourse GetCourses DelCourse GetCourseInstructors ModCourseInstructors GetCourseItem ModCourseItem GetCourseReserve ModCourseReserve GetCourseReserves DelCourseReserve SearchCourses GetItemCourseReservesInfo )); use_ok('C4::Context'); use_ok('MARC::Field'); use_ok('MARC::Record'); diff --git a/t/db_dependent/CourseReserves/CourseItems.t b/t/db_dependent/CourseReserves/CourseItems.t index 2e6f9eedbb..9cb287cd32 100755 --- a/t/db_dependent/CourseReserves/CourseItems.t +++ b/t/db_dependent/CourseReserves/CourseItems.t @@ -19,7 +19,7 @@ use Modern::Perl; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::CourseReserves qw/ModCourseItem ModCourseReserve DelCourseReserve GetCourseItem/; +use C4::CourseReserves qw( ModCourse ModCourseItem ModCourseReserve GetCourse GetCourseItem DelCourse DelCourseReserve ); use C4::Context; use Koha::Items; diff --git a/t/db_dependent/Creators/Lib.t b/t/db_dependent/Creators/Lib.t index 7d10b353b1..c18a659c1f 100755 --- a/t/db_dependent/Creators/Lib.t +++ b/t/db_dependent/Creators/Lib.t @@ -26,7 +26,7 @@ use Koha::Database; use Test::Warn; BEGIN { - use_ok('C4::Creators::Lib'); + use_ok('C4::Creators::Lib', qw( get_all_templates get_all_layouts get_all_profiles get_all_image_names get_batch_summary get_label_summary get_card_summary get_barcode_types get_label_types get_font_types get_text_justification_types get_output_formats get_table_names get_unit_values html_table )); use_ok('C4::Biblio'); use_ok('C4::Context'); use_ok('Koha::Patron'); diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t index 9e25fafba9..8bb0fdce6e 100755 --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ b/t/db_dependent/DecreaseLoanHighHolds.t @@ -18,7 +18,7 @@ use Modern::Perl; use DateTime; -use C4::Circulation; +use C4::Circulation qw( CalcDateDue checkHighHolds CanBookBeIssued ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; diff --git a/t/db_dependent/Exporter/Record.t b/t/db_dependent/Exporter/Record.t index 9993d7874b..5f843d08ac 100755 --- a/t/db_dependent/Exporter/Record.t +++ b/t/db_dependent/Exporter/Record.t @@ -28,7 +28,7 @@ use MARC::Batch; use File::Slurp; use Encode; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::Database; use Koha::Biblio; diff --git a/t/db_dependent/Filter_MARC_ViewPolicy.t b/t/db_dependent/Filter_MARC_ViewPolicy.t index 552245a01b..8f3c744358 100755 --- a/t/db_dependent/Filter_MARC_ViewPolicy.t +++ b/t/db_dependent/Filter_MARC_ViewPolicy.t @@ -29,7 +29,7 @@ use List::MoreUtils qw/any/; use MARC::Record; use MARC::Field; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); use Koha::Caches; use Koha::Database; diff --git a/t/db_dependent/Fines.t b/t/db_dependent/Fines.t index 76cc0638a9..fef8a939af 100755 --- a/t/db_dependent/Fines.t +++ b/t/db_dependent/Fines.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Context; -use C4::Overdues; +use C4::Overdues qw( CalcFine ); use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/FrameworkPlugin.t b/t/db_dependent/FrameworkPlugin.t index 3a28df4055..f05c8105fa 100755 --- a/t/db_dependent/FrameworkPlugin.t +++ b/t/db_dependent/FrameworkPlugin.t @@ -8,8 +8,8 @@ use Test::More tests => 5; use t::lib::TestBuilder; -use C4::Auth; -use C4::Output; +use C4::Auth qw( checkauth ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::FrameworkPlugin; diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t index 1615ea0eaa..30a9e0ae88 100755 --- a/t/db_dependent/Heading.t +++ b/t/db_dependent/Heading.t @@ -23,7 +23,7 @@ use Test::More tests => 3; use t::lib::Mocks; BEGIN { - use_ok('C4::Heading'); + use_ok('C4::Heading', qw( field valid_heading_subfield )); } subtest "MARC21 tests" => sub { diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t index a2ea2df0d5..357d3126d4 100755 --- a/t/db_dependent/Heading_MARC21.t +++ b/t/db_dependent/Heading_MARC21.t @@ -10,7 +10,7 @@ use Test::More tests => 5; use C4::Context; BEGIN { - use_ok('C4::Heading'); + use_ok('C4::Heading', qw( field new_from_field display_form search_form )); } SKIP: { diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index 365557e2b8..fb983caca5 100755 --- a/t/db_dependent/Hold.t +++ b/t/db_dependent/Hold.t @@ -22,7 +22,7 @@ use C4::Context; use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Libraries; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday ); use Koha::Patrons; use Koha::Holds; use Koha::Item; diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 64419b5fee..0710eda149 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -13,8 +13,8 @@ use MARC::Record; use C4::Biblio; use C4::Calendar; use C4::Items; -use C4::Reserves; -use C4::Circulation; +use C4::Reserves qw( AddReserve CalculatePriority ModReserve ToggleSuspend AutoUnsuspendReserves SuspendAll ModReserveMinusPriority AlterPriority CanItemBeReserved CheckReserves ); +use C4::Circulation qw( CanBookBeRenewed ); use Koha::Biblios; use Koha::CirculationRules; diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t index bc2633a208..18031c15d0 100755 --- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t +++ b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use C4::Items; use Koha::Items; use Koha::CirculationRules; @@ -14,7 +14,7 @@ use t::lib::TestBuilder; use t::lib::Mocks; BEGIN { - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( ItemsAnyAvailableAndNotRestricted IsAvailableForItemLevelRequest )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Holds/HoldFulfillmentPolicy.t b/t/db_dependent/Holds/HoldFulfillmentPolicy.t index daf527d622..7e21336c10 100755 --- a/t/db_dependent/Holds/HoldFulfillmentPolicy.t +++ b/t/db_dependent/Holds/HoldFulfillmentPolicy.t @@ -12,7 +12,7 @@ use t::lib::Mocks; use Koha::Holds; BEGIN { - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Holds/HoldItemtypeLimit.t b/t/db_dependent/Holds/HoldItemtypeLimit.t index 13958e6241..9157320694 100755 --- a/t/db_dependent/Holds/HoldItemtypeLimit.t +++ b/t/db_dependent/Holds/HoldItemtypeLimit.t @@ -14,7 +14,7 @@ use Koha::Holds; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Holds/LocalHoldsPriority.t b/t/db_dependent/Holds/LocalHoldsPriority.t index 26c052b6cd..a125d3eab1 100755 --- a/t/db_dependent/Holds/LocalHoldsPriority.t +++ b/t/db_dependent/Holds/LocalHoldsPriority.t @@ -19,7 +19,7 @@ use t::lib::TestBuilder; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; @@ -208,4 +208,4 @@ subtest "exclude from local holds" => sub { is($reserve->{borrowernumber}, $patron_nex_l2->borrowernumber, "Patron from other library is next checkout because item is excluded"); $schema->storage->txn_rollback; -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Holds/RevertWaitingStatus.t b/t/db_dependent/Holds/RevertWaitingStatus.t index 252d277a0f..4dab0f3b70 100755 --- a/t/db_dependent/Holds/RevertWaitingStatus.t +++ b/t/db_dependent/Holds/RevertWaitingStatus.t @@ -24,7 +24,7 @@ use Koha::Patrons; use C4::Context; use C4::Items; use C4::Biblio; -use C4::Reserves; +use C4::Reserves qw( AddReserve ModReserve ModReserveAffect ); use t::lib::TestBuilder; use t::lib::Mocks; diff --git a/t/db_dependent/Holds/WaitingReserves.t b/t/db_dependent/Holds/WaitingReserves.t index 50b6ed8573..7536b30b48 100755 --- a/t/db_dependent/Holds/WaitingReserves.t +++ b/t/db_dependent/Holds/WaitingReserves.t @@ -2,7 +2,7 @@ use Modern::Perl; -use C4::Reserves; +use C4::Reserves qw( ModReserve ModReserveAffect ); use Koha::DateUtils; use t::lib::Mocks; @@ -10,7 +10,7 @@ use t::lib::TestBuilder; use Test::More tests => 11; -use_ok('C4::Reserves'); +use_ok('C4::Reserves', qw( ModReserve ModReserveAffect )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index eb5e9028b6..30f4ec3eae 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -11,10 +11,10 @@ use Modern::Perl; use Test::More tests => 57; use Data::Dumper; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday ); use C4::Context; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::DateUtils; use Koha::Items; @@ -27,8 +27,8 @@ use t::lib::Mocks; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); - use_ok('C4::HoldsQueue'); + use_ok('C4::Reserves', qw( AddReserve ModReserve ModReserveAffect )); + use_ok('C4::HoldsQueue', qw( TransportCostMatrix GetHoldsQueueItems CreateQueue UpdateTransportCostMatrix GetPendingHoldRequestsForBib )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t index ced8bd538b..677c4cc1f3 100755 --- a/t/db_dependent/Holidays.t +++ b/t/db_dependent/Holidays.t @@ -30,7 +30,7 @@ use Koha::DateUtils; BEGIN { use_ok('Koha::Calendar'); - use_ok('C4::Calendar'); + use_ok('C4::Calendar', qw( insert_exception_holiday insert_week_day_holiday insert_day_month_holiday insert_single_holiday copy_to_branch get_exception_holidays isHoliday )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index c3be5cea94..97a2062ce1 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -25,12 +25,12 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Items qw( ModItemTransfer ); -use C4::Circulation; +use C4::Circulation qw( AddIssue ); use Koha::AuthUtils; BEGIN { - use_ok('C4::ILSDI::Services'); + use_ok('C4::ILSDI::Services', qw( AuthenticatePatron GetPatronInfo LookupPatron HoldTitle HoldItem GetRecords RenewLoan )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index 0ed98219e1..24ef726f96 100755 --- a/t/db_dependent/Illrequests.t +++ b/t/db_dependent/Illrequests.t @@ -19,7 +19,7 @@ use Modern::Perl; use File::Basename qw/basename/; -use C4::Circulation qw(AddIssue AddReturn); +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::Illrequestattributes; diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t index da0c1899b2..c96222de5e 100755 --- a/t/db_dependent/ImportBatch.t +++ b/t/db_dependent/ImportBatch.t @@ -16,7 +16,7 @@ BEGIN { # Mock pluginsdir before loading Plugins module my $path = dirname(__FILE__) . '/../lib'; t::lib::Mocks::mock_config( 'pluginsdir', $path ); - use_ok('C4::ImportBatch'); + use_ok('C4::ImportBatch', qw( AddImportBatch GetImportBatch AddBiblioToBatch AddItemsToImportBiblio GetRecordFromImportBiblio SetMatchedBiblionumber GetImportBiblios GetItemNumbersFromImportBatch CleanBatch DeleteBatch RecordsFromMarcPlugin )); } # Start transaction diff --git a/t/db_dependent/ImportExportFramework.t b/t/db_dependent/ImportExportFramework.t index bd3a6d1580..f52200d670 100755 --- a/t/db_dependent/ImportExportFramework.t +++ b/t/db_dependent/ImportExportFramework.t @@ -26,7 +26,7 @@ use File::Basename qw( dirname ); use Koha::Database; use Koha::BiblioFrameworks; use Koha::MarcSubfieldStructures; -use C4::ImportExportFramework; +use C4::ImportExportFramework qw( ImportFramework ExportFramework ); my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; diff --git a/t/db_dependent/Installer.t b/t/db_dependent/Installer.t index c8cbe6ceb7..8dfd916755 100755 --- a/t/db_dependent/Installer.t +++ b/t/db_dependent/Installer.t @@ -29,7 +29,7 @@ use utf8; use Koha::Database; BEGIN { - use_ok('C4::Installer'); + use_ok('C4::Installer', qw( column_exists index_exists foreign_key_exists primary_key_exists marc_framework_sql_list )); } ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' ); diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index b28d930ebe..120d9b9307 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -19,8 +19,8 @@ use Modern::Perl; use Data::Dumper; use MARC::Record; -use C4::Items; -use C4::Biblio; +use C4::Items qw( ModItemTransfer GetHiddenItemnumbers GetItemsInfo SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ); +use C4::Biblio qw( GetMarcFromKohaField EmbedItemsInMarcBiblio GetMarcBiblio AddBiblio ); use Koha::Items; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t index f0472526a1..0c1b044b38 100755 --- a/t/db_dependent/Items/AutomaticItemModificationByAge.t +++ b/t/db_dependent/Items/AutomaticItemModificationByAge.t @@ -7,8 +7,8 @@ use MARC::Field; use DateTime; use DateTime::Duration; -use C4::Items; -use C4::Biblio; +use C4::Items qw( GetMarcItem ToggleNewStatus ); +use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); use C4::Context; use Koha::DateUtils; use Koha::Items; diff --git a/t/db_dependent/Items/GetHostItemsInfo.t b/t/db_dependent/Items/GetHostItemsInfo.t index 63e8ea423c..d5c34c3b70 100755 --- a/t/db_dependent/Items/GetHostItemsInfo.t +++ b/t/db_dependent/Items/GetHostItemsInfo.t @@ -4,7 +4,7 @@ use Test::More tests => 1; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetHostItemsInfo ); use Koha::Database; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t index 5e3ea7834c..b5c2b97bd2 100755 --- a/t/db_dependent/Items/GetItemsForInventory.t +++ b/t/db_dependent/Items/GetItemsForInventory.t @@ -25,8 +25,8 @@ use t::lib::TestBuilder; use List::MoreUtils qw( any none ); use C4::Biblio qw(AddBiblio); -use C4::Reserves; -use C4::ClassSource; +use C4::Reserves qw( AddReserve ); +use C4::ClassSource qw( GetClassSort ); use Koha::AuthorisedValues; use Koha::Biblios; use Koha::Database; @@ -34,7 +34,7 @@ use MARC::Record; BEGIN { use_ok('C4::Context'); - use_ok('C4::Items'); + use_ok('C4::Items', qw( GetItemsForInventory )); use_ok('C4::Biblio'); use_ok('C4::Koha'); } diff --git a/t/db_dependent/Items/MoveItemFromBiblio.t b/t/db_dependent/Items/MoveItemFromBiblio.t index 75ae92afe0..7a3cf2b639 100755 --- a/t/db_dependent/Items/MoveItemFromBiblio.t +++ b/t/db_dependent/Items/MoveItemFromBiblio.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 8; -use C4::Items; +use C4::Items qw( MoveItemFromBiblio ); use C4::Reserves; use Koha::Database; use Koha::Holds; diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 9e0b8d3af9..ca807234a3 100755 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -14,7 +14,7 @@ use Koha::AuthorisedValue; use Koha::AuthorisedValueCategories; BEGIN { - use_ok('C4::Koha', qw( :DEFAULT GetItemTypesCategorized)); + use_ok('C4::Koha', qw( GetAuthorisedValues GetItemTypesCategorized xml_escape )); use_ok('C4::Members'); } diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t index 232a56720e..936fc5f9c3 100755 --- a/t/db_dependent/Koha/Account/Line.t +++ b/t/db_dependent/Koha/Account/Line.t @@ -25,7 +25,7 @@ use Test::MockModule; use DateTime; -use C4::Circulation qw/AddIssue AddReturn/; +use C4::Circulation qw( AddRenewal CanBookBeRenewed LostItem AddIssue AddReturn ); use Koha::Account; use Koha::Account::Lines; use Koha::Account::Offsets; diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t index 7b6c17d552..971752ae53 100755 --- a/t/db_dependent/Koha/Acquisition/Basket.t +++ b/t/db_dependent/Koha/Acquisition/Basket.t @@ -25,7 +25,7 @@ use Test::Exception; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Acquisition; +use C4::Acquisition qw( NewBasket ModBasket ModBasketHeader ); use Koha::Database; use Koha::DateUtils qw(dt_from_string); diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t index 5b5f58c100..9025f1cc81 100755 --- a/t/db_dependent/Koha/Acquisition/Booksellers.t +++ b/t/db_dependent/Koha/Acquisition/Booksellers.t @@ -21,10 +21,10 @@ use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; -use C4::Serials; +use C4::Acquisition qw( NewBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudgetPeriod AddBudget ); +use C4::Serials qw( NewSubscription SearchSubscriptions ); use Koha::Acquisition::Booksellers; use Koha::Database; diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t index 8919fe29af..dd2138405f 100755 --- a/t/db_dependent/Koha/Acquisition/Order.t +++ b/t/db_dependent/Koha/Acquisition/Order.t @@ -25,7 +25,7 @@ use Test::Exception; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Biblios; use Koha::Database; diff --git a/t/db_dependent/Koha/ActionLogs.t b/t/db_dependent/Koha/ActionLogs.t index 24bce1b7ea..ede7e0cc5e 100755 --- a/t/db_dependent/Koha/ActionLogs.t +++ b/t/db_dependent/Koha/ActionLogs.t @@ -20,7 +20,7 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Koha/Authorities.t b/t/db_dependent/Koha/Authorities.t index a618bfabb8..04ad663e28 100755 --- a/t/db_dependent/Koha/Authorities.t +++ b/t/db_dependent/Koha/Authorities.t @@ -29,7 +29,7 @@ use Test::MockObject; use Test::Warn; use C4::Context; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( merge AddAuthority ); use Koha::Authority; use Koha::Authority::ControlledIndicators; use Koha::Authorities; diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index e7ecb4f3f5..83de0634c6 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/t/db_dependent/Koha/Biblio.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 14; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ModBiblio ); use Koha::Database; use Koha::Acquisition::Orders; diff --git a/t/db_dependent/Koha/Biblio/Metadata.t b/t/db_dependent/Koha/Biblio/Metadata.t index 2afd5c3ce7..7bd22e269a 100755 --- a/t/db_dependent/Koha/Biblio/Metadata.t +++ b/t/db_dependent/Koha/Biblio/Metadata.t @@ -22,7 +22,7 @@ use Test::Exception; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; BEGIN { diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t index 5758ea03e2..d19e8f3c0d 100755 --- a/t/db_dependent/Koha/Biblios.t +++ b/t/db_dependent/Koha/Biblios.t @@ -27,8 +27,8 @@ use Test::MockModule; use MARC::Field; use C4::Items; -use C4::Biblio; -use C4::Reserves; +use C4::Biblio qw( AddBiblio ModBiblio ); +use C4::Reserves qw( AddReserve ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Biblios; diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t index 637aaa278f..2f2af9d876 100755 --- a/t/db_dependent/Koha/Charges/Fees.t +++ b/t/db_dependent/Koha/Charges/Fees.t @@ -28,7 +28,7 @@ use t::lib::TestBuilder; use t::lib::Dates; use Time::Fake; -use C4::Calendar; +use C4::Calendar qw( new insert_week_day_holiday delete_holiday ); use Koha::DateUtils qw(dt_from_string); BEGIN { diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t index 7163bd208b..9c4b0dbfea 100755 --- a/t/db_dependent/Koha/Checkouts.t +++ b/t/db_dependent/Koha/Checkouts.t @@ -21,7 +21,7 @@ use Modern::Perl; use Test::More tests => 10; -use C4::Circulation; +use C4::Circulation qw( MarkIssueReturned AddReturn ); use Koha::Checkouts; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Koha/Club/Enrollment.t b/t/db_dependent/Koha/Club/Enrollment.t index 8ea7d0742f..528be79151 100755 --- a/t/db_dependent/Koha/Club/Enrollment.t +++ b/t/db_dependent/Koha/Club/Enrollment.t @@ -45,4 +45,4 @@ subtest 'is_canceled' => sub { ok($enrollment->is_canceled, 'Enrollment should be canceled'); $schema->storage->txn_rollback; -} \ No newline at end of file +} diff --git a/t/db_dependent/Koha/Filter/EmbedItems.t b/t/db_dependent/Koha/Filter/EmbedItems.t index cfbad44d08..524bfb5f34 100755 --- a/t/db_dependent/Koha/Filter/EmbedItems.t +++ b/t/db_dependent/Koha/Filter/EmbedItems.t @@ -21,7 +21,7 @@ use Test::More tests => 1; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( GetMarcSubfieldStructure ); use Koha::Database; use Koha::RecordProcessor; diff --git a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t index d4a7b2d677..ca81af1188 100755 --- a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t +++ b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t @@ -25,7 +25,7 @@ use t::lib::TestBuilder; use MARC::Record; -use C4::Biblio qw/AddBiblio GetMarcBiblio/; +use C4::Biblio qw( GetMarcFromKohaField AddBiblio GetMarcBiblio ); use Koha::Database; use Koha::RecordProcessor; diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t index 7d19a132f1..51c3383277 100755 --- a/t/db_dependent/Koha/Holds.t +++ b/t/db_dependent/Koha/Holds.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 6; use Test::Warn; -use C4::Circulation; -use C4::Reserves; +use C4::Circulation qw( AddIssue ); +use C4::Reserves qw( AddReserve ModReserve ModReserveCancelAll ); use Koha::AuthorisedValueCategory; use Koha::Database; use Koha::Holds; diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 161a13b575..1ac523c1a0 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 9; use Test::Exception; -use C4::Biblio; -use C4::Circulation; +use C4::Biblio qw( GetMarcSubfieldStructure ); +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Items; use Koha::Database; diff --git a/t/db_dependent/Koha/ItemTypes.t b/t/db_dependent/Koha/ItemTypes.t index 157477c4f3..aecd8d971b 100755 --- a/t/db_dependent/Koha/ItemTypes.t +++ b/t/db_dependent/Koha/ItemTypes.t @@ -25,7 +25,7 @@ use Test::More tests => 14; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar; +use C4::Calendar qw( new ); use Koha::Biblioitems; use Koha::Libraries; use Koha::Database; diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 900004d912..e3e7205e21 100755 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -25,7 +25,7 @@ use Test::MockModule; use Test::Exception; use Time::Fake; -use C4::Circulation; +use C4::Circulation qw( AddIssue LostItem AddReturn ); use C4::Context; use Koha::Item; use Koha::Item::Transfer::Limits; diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index b78283ce25..64d3f1d9ea 100755 --- a/t/db_dependent/Koha/Object.t +++ b/t/db_dependent/Koha/Object.t @@ -23,8 +23,8 @@ use Test::Warn; use DateTime; use C4::Context; -use C4::Circulation; # AddIssue -use C4::Biblio; # AddBiblio +use C4::Circulation qw( AddIssue ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; diff --git a/t/db_dependent/Koha/Patron/Category.t b/t/db_dependent/Koha/Patron/Category.t index 93711d7c95..5accf5679e 100755 --- a/t/db_dependent/Koha/Patron/Category.t +++ b/t/db_dependent/Koha/Patron/Category.t @@ -201,4 +201,4 @@ subtest 'effective_require_strong_password' => sub { is($category->effective_require_strong_password, 1, 'Patron should be required strong password from category'); $schema->storage->txn_rollback; -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 120e981324..59c6a8a075 100755 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -29,9 +29,9 @@ use JSON; use Data::Dumper; use utf8; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use C4::Biblio; -use C4::Auth qw(checkpw_hash); +use C4::Auth qw( checkpw checkpw_hash ); use Koha::ActionLogs; use Koha::Holds; diff --git a/t/db_dependent/Koha/Plugins/Circulation_hooks.t b/t/db_dependent/Koha/Plugins/Circulation_hooks.t index 5f8569d9ed..5ef25f793e 100755 --- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t +++ b/t/db_dependent/Koha/Plugins/Circulation_hooks.t @@ -22,7 +22,7 @@ use Test::Warn; use File::Basename; -use C4::Circulation qw(AddIssue AddRenewal AddReturn); +use C4::Circulation qw( AddIssue AddRenewal AddReturn ); use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/Plugins/Holds_hooks.t b/t/db_dependent/Koha/Plugins/Holds_hooks.t index 02086fa8de..07aa4f7344 100755 --- a/t/db_dependent/Koha/Plugins/Holds_hooks.t +++ b/t/db_dependent/Koha/Plugins/Holds_hooks.t @@ -22,7 +22,7 @@ use Test::Warn; use File::Basename; -use C4::Reserves qw(AddReserve); +use C4::Reserves qw( AddReserve ); use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/Pseudonymization.t b/t/db_dependent/Koha/Pseudonymization.t index cfefc82292..674ad36bf1 100755 --- a/t/db_dependent/Koha/Pseudonymization.t +++ b/t/db_dependent/Koha/Pseudonymization.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 3; use Try::Tiny; -use C4::Circulation; -use C4::Stats; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Stats qw( UpdateStats ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/db_dependent/Koha/SearchEngine/Indexer.t b/t/db_dependent/Koha/SearchEngine/Indexer.t index a1740c7f71..69f5ec3836 100755 --- a/t/db_dependent/Koha/SearchEngine/Indexer.t +++ b/t/db_dependent/Koha/SearchEngine/Indexer.t @@ -15,10 +15,10 @@ use Test::MockObject; use t::lib::Mocks; #use C4::Biblio qw//; -use C4::AuthoritiesMarc; -use C4::Biblio; -use C4::Circulation; -use C4::Items; +use C4::AuthoritiesMarc qw( AddAuthority DelAuthority merge ); +use C4::Biblio qw( ModZebra ModBiblio ModBiblioMarc DelBiblio ); +use C4::Circulation qw( MarkIssueReturned AddReturn LostItem ); +use C4::Items qw( ModDateLastSeen ModItemTransfer ); use Koha::Database; use Koha::DateUtils; use Koha::SearchEngine::Elasticsearch; diff --git a/t/db_dependent/Koha/Statistics.t b/t/db_dependent/Koha/Statistics.t index 12ebc9e75a..01600fa348 100755 --- a/t/db_dependent/Koha/Statistics.t +++ b/t/db_dependent/Koha/Statistics.t @@ -23,7 +23,7 @@ use Test::More tests => 4; use Koha::Database; use Koha::Statistics; -use C4::Stats; +use C4::Stats qw( UpdateStats ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/Z3950Responder/Session.t b/t/db_dependent/Koha/Z3950Responder/Session.t index 279aafe197..b48ac0cc76 100755 --- a/t/db_dependent/Koha/Z3950Responder/Session.t +++ b/t/db_dependent/Koha/Z3950Responder/Session.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetMarcItem ); BEGIN { use_ok('Koha::Z3950Responder'); diff --git a/t/db_dependent/Koha/Z3950Responder/Session2.t b/t/db_dependent/Koha/Z3950Responder/Session2.t index e6e8e23862..71ba26ec3e 100755 --- a/t/db_dependent/Koha/Z3950Responder/Session2.t +++ b/t/db_dependent/Koha/Z3950Responder/Session2.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetMarcItem ); use Koha::Caches; diff --git a/t/db_dependent/Koha_Authority.t b/t/db_dependent/Koha_Authority.t index 300b6a8bcf..e5764579f4 100755 --- a/t/db_dependent/Koha_Authority.t +++ b/t/db_dependent/Koha_Authority.t @@ -20,8 +20,8 @@ use Modern::Perl; use C4::Context; -use C4::Charset; -use C4::AuthoritiesMarc; +use C4::Charset qw( MarcToUTF8Record ); +use C4::AuthoritiesMarc qw( AddAuthority ); use Koha::Database; use Test::More; use File::Basename; diff --git a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t b/t/db_dependent/Koha_ExternalContent_RecordedBooks.t index 7f21be9721..fd9a1c1d83 100755 --- a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t +++ b/t/db_dependent/Koha_ExternalContent_RecordedBooks.t @@ -3,7 +3,7 @@ use Modern::Perl; use t::lib::Mocks; use t::lib::TestBuilder; use Test::More tests => 3; # last test to print -use C4::Auth; +use C4::Auth qw( get_session ); use Koha::Database; use Module::Load::Conditional qw( can_load ); diff --git a/t/db_dependent/Labels/t_Batch.t b/t/db_dependent/Labels/t_Batch.t index b74917b514..61a3710129 100755 --- a/t/db_dependent/Labels/t_Batch.t +++ b/t/db_dependent/Labels/t_Batch.t @@ -27,13 +27,13 @@ use MARC::Field; use t::lib::TestBuilder; use C4::Context; -use C4::Items; -use C4::Biblio; +use C4::Items qw( AddItemBatchFromMarc ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use Koha::Database; use Koha::Libraries; BEGIN { - use_ok('C4::Labels::Batch'); + use_ok('C4::Labels::Batch', qw( save retrieve delete )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Languages.t b/t/db_dependent/Languages.t index 120f1d5a02..f9e50aade8 100755 --- a/t/db_dependent/Languages.t +++ b/t/db_dependent/Languages.t @@ -13,7 +13,7 @@ use t::lib::Mocks; use Koha::Database; BEGIN { - use_ok('C4::Languages'); + use_ok('C4::Languages', qw( accept_language getAllLanguages getLanguages getTranslatedLanguages get_rfc4646_from_iso639 )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index f916f0865d..7e5273fb02 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -44,9 +44,9 @@ $email_sender_module->mock( use_ok('C4::Context'); use_ok('C4::Members'); -use_ok('C4::Acquisition'); -use_ok('C4::Biblio'); -use_ok('C4::Letters'); +use_ok('C4::Acquisition', qw( NewBasket )); +use_ok('C4::Biblio', qw( AddBiblio GetBiblioData )); +use_ok('C4::Letters', qw( GetMessageTransportTypes GetMessage EnqueueLetter GetQueuedMessages SendQueuedMessages ResendMessage GetLetters GetPreparedLetter SendAlerts )); use t::lib::Mocks; use t::lib::TestBuilder; use Koha::Database; @@ -472,7 +472,7 @@ is($err->{error}, 'something went wrong', "Send exception, error message returne } { -use C4::Serials; +use C4::Serials qw( NewSubscription GetSerials findSerialsByStatus ModSerialStatus ); my $notes = 'notes'; my $internalnotes = 'intnotes'; diff --git a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t b/t/db_dependent/Letters/GetLettersAvailableForALibrary.t index ded8985913..3a49e7d68e 100755 --- a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t +++ b/t/db_dependent/Letters/GetLettersAvailableForALibrary.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 19; use C4::Context; -use C4::Letters qw( GetLettersAvailableForALibrary DelLetter ); +use C4::Letters qw( GetLetters GetLettersAvailableForALibrary DelLetter ); use Koha::Database; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t index 8d049423c6..7e72517eb6 100755 --- a/t/db_dependent/Letters/TemplateToolkit.t +++ b/t/db_dependent/Letters/TemplateToolkit.t @@ -28,9 +28,9 @@ use MARC::Record; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Letters; -use C4::Members; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Letters qw( GetPreparedLetter ); +use C4::Members qw( IssueSlip ); use C4::Biblio; use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/LibraryGroups.t b/t/db_dependent/LibraryGroups.t index 26824210e8..f9ecabf6a2 100755 --- a/t/db_dependent/LibraryGroups.t +++ b/t/db_dependent/LibraryGroups.t @@ -162,4 +162,4 @@ subtest 'Koha::Library::Groups->get_root_ancestor' => sub { is($ancestor1->id, $groupY->id, "Get root ancestor should return group's root ancestor"); ok($ancestor1->id ne $ancestor2->id, "Both root groups should have different ids"); -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Linker_Default.t b/t/db_dependent/Linker_Default.t index 19f421373f..e16d790298 100755 --- a/t/db_dependent/Linker_Default.t +++ b/t/db_dependent/Linker_Default.t @@ -21,8 +21,8 @@ use Test::More tests => 2; use MARC::Record; use MARC::Field; use MARC::File::XML; -use C4::Heading; -use C4::Linker::FirstMatch; +use C4::Heading qw( authorities field new_from_field auth_type search_form ); +use C4::Linker::Default; use Test::MockModule; use t::lib::Mocks qw( mock_preference ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Linker_FirstMatch.t b/t/db_dependent/Linker_FirstMatch.t index cfcd752437..d4d211a9dc 100755 --- a/t/db_dependent/Linker_FirstMatch.t +++ b/t/db_dependent/Linker_FirstMatch.t @@ -24,7 +24,7 @@ use Test::More tests => 3; use MARC::Record; use MARC::Field; use MARC::File::XML; -use C4::Heading; +use C4::Heading qw( authorities field new_from_field ); use C4::Linker::FirstMatch; use Test::MockModule; use t::lib::Mocks qw( mock_preference ); diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t index 3ce974bc69..b3084ce924 100755 --- a/t/db_dependent/Log.t +++ b/t/db_dependent/Log.t @@ -18,8 +18,8 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Log; -use C4::Auth qw/checkpw/; +use C4::Log qw( logaction cronlogaction ); +use C4::Auth qw( checkpw ); use Koha::Database; use Koha::DateUtils; use Koha::ActionLogs; diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t index fa148f9771..82d8a29463 100755 --- a/t/db_dependent/MarcModificationTemplates.t +++ b/t/db_dependent/MarcModificationTemplates.t @@ -9,7 +9,7 @@ use t::lib::Mocks; use_ok("MARC::Field"); use_ok("MARC::Record"); -use_ok("C4::MarcModificationTemplates"); +use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 367d0d2aff..dd0ed5d26f 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -33,7 +33,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Members'); + use_ok('C4::Members', qw( checkcardnumber GetBorrowersToExpunge DeleteUnverifiedOpacRegistrations DeleteExpiredOpacRegistrations )); } my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Members/GetAllIssues.t b/t/db_dependent/Members/GetAllIssues.t index 45c3682d4e..b327c8fdc5 100755 --- a/t/db_dependent/Members/GetAllIssues.t +++ b/t/db_dependent/Members/GetAllIssues.t @@ -22,10 +22,10 @@ use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Members; +use C4::Members qw( GetAllIssues ); use Koha::Libraries; use Koha::Patrons; use MARC::Record; diff --git a/t/db_dependent/Members/IssueSlip.t b/t/db_dependent/Members/IssueSlip.t index 95867690a1..dced42384d 100755 --- a/t/db_dependent/Members/IssueSlip.t +++ b/t/db_dependent/Members/IssueSlip.t @@ -24,10 +24,10 @@ use Test::MockModule; use Test::MockTime qw( set_fixed_time ); use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Members; +use C4::Members qw( IssueSlip ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Library; diff --git a/t/db_dependent/Members/Statistics.t b/t/db_dependent/Members/Statistics.t index fe0ca9b193..fc1a62049c 100755 --- a/t/db_dependent/Members/Statistics.t +++ b/t/db_dependent/Members/Statistics.t @@ -5,7 +5,7 @@ use Test::More tests => 2; use t::lib::Mocks; -use C4::Members::Statistics; +use C4::Members::Statistics qw( get_fields ); use Koha::Database; # we need the db here; get_fields looks for the item columns my $schema = Koha::Database->schema; diff --git a/t/db_dependent/Message.t b/t/db_dependent/Message.t index cdb30322c6..ab65e0ba1b 100755 --- a/t/db_dependent/Message.t +++ b/t/db_dependent/Message.t @@ -22,7 +22,7 @@ use utf8; use t::lib::TestBuilder; -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); use Koha::Database; my $schema = Koha::Database->schema; diff --git a/t/db_dependent/MungeMarcPrice.t b/t/db_dependent/MungeMarcPrice.t index 12a3d6af45..1a514232af 100755 --- a/t/db_dependent/MungeMarcPrice.t +++ b/t/db_dependent/MungeMarcPrice.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Biblio; +use C4::Biblio qw( MungeMarcPrice ); use Koha::Database; use Koha::Acquisition::Currencies; use Test::More; diff --git a/t/db_dependent/OAI/AndSets.t b/t/db_dependent/OAI/AndSets.t index d58959520b..0d6bd9049f 100755 --- a/t/db_dependent/OAI/AndSets.t +++ b/t/db_dependent/OAI/AndSets.t @@ -25,8 +25,8 @@ use MARC::Record; use Data::Dumper; use Koha::Database; -use C4::Biblio; -use C4::OAI::Sets; +use C4::Biblio qw( GetMarcBiblio ); +use C4::OAI::Sets qw( AddOAISet ModOAISet ModOAISetMappings CalcOAISetsBiblio ); use t::lib::TestBuilder; diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t index 09a09de890..48fea418eb 100755 --- a/t/db_dependent/OAI/Server.t +++ b/t/db_dependent/OAI/Server.t @@ -32,7 +32,7 @@ use YAML::XS; use t::lib::Mocks; -use C4::Biblio; +use C4::Biblio qw( AddBiblio GetMarcBiblio ModBiblio ); use C4::Context; use Koha::Biblio::Metadatas; diff --git a/t/db_dependent/OAI/Sets.t b/t/db_dependent/OAI/Sets.t index 1fd577387f..4dfd80bf03 100755 --- a/t/db_dependent/OAI/Sets.t +++ b/t/db_dependent/OAI/Sets.t @@ -24,8 +24,8 @@ use Test::Warn; use MARC::Record; use Koha::Database; -use C4::Biblio; -use C4::OAI::Sets; +use C4::Biblio qw( GetMarcBiblio ); +use C4::OAI::Sets qw( AddOAISet GetOAISets GetOAISet GetOAISetBySpec ModOAISet ModOAISetMappings GetOAISetsMappings GetOAISetMappings AddOAISetsBiblios GetOAISetsBiblio ModOAISetsBiblios DelOAISet DelOAISetsBiblio UpdateOAISetsBiblio CalcOAISetsBiblio ); use t::lib::TestBuilder; use t::lib::Mocks; diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t index ed031b2932..55a5db60b1 100755 --- a/t/db_dependent/Overdues.t +++ b/t/db_dependent/Overdues.t @@ -11,7 +11,7 @@ use Koha::Libraries; use t::lib::Mocks; use t::lib::TestBuilder; -use_ok('C4::Overdues'); +use_ok('C4::Overdues', qw( GetOverdueMessageTransportTypes GetBranchcodesWithOverdueRules UpdateFine )); can_ok('C4::Overdues', 'GetOverdueMessageTransportTypes'); can_ok('C4::Overdues', 'GetBranchcodesWithOverdueRules'); diff --git a/t/db_dependent/Passwordrecovery.t b/t/db_dependent/Passwordrecovery.t index f4a7209704..0f33acb0ea 100755 --- a/t/db_dependent/Passwordrecovery.t +++ b/t/db_dependent/Passwordrecovery.t @@ -18,7 +18,7 @@ use Modern::Perl; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetQueuedMessages ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; diff --git a/t/db_dependent/Patron/Borrower_PrevCheckout.t b/t/db_dependent/Patron/Borrower_PrevCheckout.t index 8a240cec4b..3b12f70878 100755 --- a/t/db_dependent/Patron/Borrower_PrevCheckout.t +++ b/t/db_dependent/Patron/Borrower_PrevCheckout.t @@ -2,7 +2,7 @@ use Modern::Perl; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn CanBookBeIssued ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; diff --git a/t/db_dependent/Patron/Messages.t b/t/db_dependent/Patron/Messages.t index 0f09959982..8da4915d10 100755 --- a/t/db_dependent/Patron/Messages.t +++ b/t/db_dependent/Patron/Messages.t @@ -47,4 +47,4 @@ subtest 'Delete a patron having messages' => sub { is(Koha::Patron::Messages->find($message->{message_id}), undef, 'Message is deleted'); }; -$schema->storage->txn_rollback; \ No newline at end of file +$schema->storage->txn_rollback; diff --git a/t/db_dependent/Patroncards.t b/t/db_dependent/Patroncards.t index 3f9b742e31..5ae61af1dc 100755 --- a/t/db_dependent/Patroncards.t +++ b/t/db_dependent/Patroncards.t @@ -20,7 +20,7 @@ use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Patroncards::Layout; +use C4::Patroncards::Layout qw( save new ); subtest '->save' => sub { plan tests => 1; diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t index 22fcdb3de0..53a4ae621f 100755 --- a/t/db_dependent/Record.t +++ b/t/db_dependent/Record.t @@ -10,7 +10,7 @@ use C4::Context; use Koha::Database; BEGIN { - use_ok('C4::Record'); + use_ok('C4::Record', qw( marc2marc marc2marcxml marcxml2marc marc2dcxml marc2modsxml marc2bibtex )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Record/Record.t b/t/db_dependent/Record/Record.t index 384588d66e..495f8e05b1 100755 --- a/t/db_dependent/Record/Record.t +++ b/t/db_dependent/Record/Record.t @@ -27,7 +27,7 @@ use constant WHEREAMI => 't/db_dependent/Record/testrecords'; # specify the number of tests use Test::More tests => 21; #FIXME Commented out two failing tests #use C4::Context; -use C4::Record; +use C4::Record qw( marc2marc marc2marcxml marc2dcxml changeEncoding ); =head1 NAME diff --git a/t/db_dependent/Record/marcrecord2csv.t b/t/db_dependent/Record/marcrecord2csv.t index 37b6e30583..53fa0bdb9f 100755 --- a/t/db_dependent/Record/marcrecord2csv.t +++ b/t/db_dependent/Record/marcrecord2csv.t @@ -7,12 +7,12 @@ use MARC::Record; use MARC::Field; use Text::CSV::Encoded; -use C4::Biblio qw( AddBiblio ); +use C4::Biblio qw( AddBiblio GetMarcBiblio ); use C4::Context; -use C4::Record; +use C4::Record qw( marcrecord2csv ); use Koha::Database; -use C4::Items; +use C4::Items qw( AddItemFromMarc ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Reports.t b/t/db_dependent/Reports.t index e28efd682e..9cf56abef3 100755 --- a/t/db_dependent/Reports.t +++ b/t/db_dependent/Reports.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 2; BEGIN { - use_ok('C4::Reports'); + use_ok('C4::Reports', qw( GetDelimiterChoices )); } diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t index 5419bddb4a..6373c0e647 100755 --- a/t/db_dependent/Reports/Guided.t +++ b/t/db_dependent/Reports/Guided.t @@ -28,7 +28,7 @@ use Koha::Items; use Koha::Reports; use Koha::Notice::Messages; -use_ok('C4::Reports::Guided'); +use_ok('C4::Reports::Guided', qw( execute_query save_report delete_report strip_limit GetReservedAuthorisedValues IsAuthorisedValueValid GetParametersFromSQL ValidateSQLParameters get_saved_reports update_sql get_report_areas convert_sql EmailReport nb_rows )); can_ok( 'C4::Reports::Guided', qw(save_report delete_report execute_query) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 93e1799191..e748f115f4 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -27,11 +27,11 @@ use t::lib::TestBuilder; use MARC::Record; use DateTime::Duration; -use C4::Circulation; +use C4::Circulation qw( AddReturn AddIssue ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblio ); use C4::Members; -use C4::Reserves; +use C4::Reserves qw( AddReserve CheckReserves GetReservesControlBranch ModReserve ModReserveAffect ReserveSlip CalculatePriority CanReserveBeCanceledFromOpac CanBookBeReserved IsAvailableForItemLevelRequest MoveReserve ChargeReserveFee RevertWaitingStatus CanItemBeReserved MergeHolds ); use Koha::ActionLogs; use Koha::Caches; use Koha::DateUtils; diff --git a/t/db_dependent/Reserves/AutoUnsuspendReserves.t b/t/db_dependent/Reserves/AutoUnsuspendReserves.t index d5703cc4e9..4d24794825 100755 --- a/t/db_dependent/Reserves/AutoUnsuspendReserves.t +++ b/t/db_dependent/Reserves/AutoUnsuspendReserves.t @@ -22,7 +22,7 @@ use Test::More tests => 1; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Reserves; +use C4::Reserves qw( AutoUnsuspendReserves ); use Koha::Database; use Koha::DateUtils; use Koha::Holds; diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t index 6822a04358..27a583b6f1 100755 --- a/t/db_dependent/Reserves/CancelExpiredReserves.t +++ b/t/db_dependent/Reserves/CancelExpiredReserves.t @@ -7,7 +7,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Members; -use C4::Reserves; +use C4::Reserves qw( CancelExpiredReserves ); use Koha::Database; use Koha::DateUtils; use Koha::Holds; diff --git a/t/db_dependent/Reserves/GetReserveFee.t b/t/db_dependent/Reserves/GetReserveFee.t index bb9b4dacba..f53f7c154f 100755 --- a/t/db_dependent/Reserves/GetReserveFee.t +++ b/t/db_dependent/Reserves/GetReserveFee.t @@ -26,8 +26,8 @@ use Test::MockModule; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Reserves qw|AddReserve|; +use C4::Circulation qw( AddIssue ); +use C4::Reserves qw( GetReserveFee ChargeReserveFee AddReserve ); use Koha::Database; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Reserves/MultiplePerRecord.t b/t/db_dependent/Reserves/MultiplePerRecord.t index 6e88740702..07f7ea9aba 100755 --- a/t/db_dependent/Reserves/MultiplePerRecord.t +++ b/t/db_dependent/Reserves/MultiplePerRecord.t @@ -23,7 +23,7 @@ use Test::More tests => 16; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Reserves qw( GetMaxPatronHoldsForRecord AddReserve CanBookBeReserved ); +use C4::Reserves qw( GetMaxPatronHoldsForRecord CanBookBeReserved AddReserve ); use Koha::Database; use Koha::Holds; diff --git a/t/db_dependent/RotatingCollections.t b/t/db_dependent/RotatingCollections.t index 1db4e45a37..f278ad47ac 100755 --- a/t/db_dependent/RotatingCollections.t +++ b/t/db_dependent/RotatingCollections.t @@ -19,8 +19,8 @@ use Modern::Perl; use Test::More tests => 53; use C4::Context; -use C4::RotatingCollections; -use C4::Biblio; +use C4::RotatingCollections qw( AddItemToCollection CreateCollection DeleteCollection GetCollection GetCollectionItemBranches GetCollections GetItemsInCollection RemoveItemFromCollection TransferCollection UpdateCollection isItemInAnyCollection isItemInThisCollection ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Library; diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t index ebfdeea9c6..79eabdd558 100755 --- a/t/db_dependent/SIP/ILS.t +++ b/t/db_dependent/SIP/ILS.t @@ -25,8 +25,8 @@ use Test::More tests => 13; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Reserves; -use C4::Circulation; +use C4::Reserves qw( AddReserve ); +use C4::Circulation qw( AddIssue ); use Koha::CirculationRules; use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t index db48fde51e..790248b748 100755 --- a/t/db_dependent/SIP/Message.t +++ b/t/db_dependent/SIP/Message.t @@ -30,7 +30,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Reserves qw(AddReserve); +use C4::Reserves qw( AddReserve ); use C4::Circulation qw( AddReturn ); use Koha::Database; use Koha::AuthUtils qw(hash_password); diff --git a/t/db_dependent/SIP/SIPServer.t b/t/db_dependent/SIP/SIPServer.t index 4adecf95f8..8d6d574776 100755 --- a/t/db_dependent/SIP/SIPServer.t +++ b/t/db_dependent/SIP/SIPServer.t @@ -37,7 +37,7 @@ BEGIN { $mockPrefork->mock( 'run', sub {} ); } -use C4::SIP::SIPServer; +use C4::SIP::SIPServer qw( get_timeout ); # Start testing ! # TODO We should include more tests here. diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index 6fa5810662..1f8cab65f2 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -18,7 +18,7 @@ use C4::SIP::ILS::Transaction::Hold; use C4::SIP::ILS::Transaction::Checkout; use C4::SIP::ILS::Transaction::Checkin; -use C4::Reserves; +use C4::Reserves qw( AddReserve ModReserve ModReserveAffect RevertWaitingStatus ); use Koha::CirculationRules; use Koha::Item::Transfer; use Koha::DateUtils qw( dt_from_string output_pref ); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 52051375c7..8efe5dff86 100755 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -262,7 +262,7 @@ sub run_marc21_search_tests { my $context = C4::Context->new("$datadir/etc/koha-conf.xml"); $context->set_context(); - use_ok('C4::Search'); + use_ok('C4::Search', qw( getIndexes FindDuplicate SimpleSearch getRecords buildQuery searchResults )); # set search syspreferences to a known starting point $QueryStemming = 0; @@ -836,7 +836,7 @@ sub run_unimarc_search_tests { my $context = C4::Context->new("$datadir/etc/koha-conf.xml"); $context->set_context(); - use_ok('C4::Search'); + use_ok('C4::Search', qw( getIndexes FindDuplicate SimpleSearch getRecords buildQuery searchResults )); # set search syspreferences to a known starting point $QueryStemming = 0; @@ -859,7 +859,7 @@ sub run_unimarc_search_tests { is($total_hits, 1, 'UNIMARC generic item index (bug 10037)'); # authority records - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( SearchAuthorities )); my ($auths, $count) = SearchAuthorities( ['mainentry'], ['and'], [''], ['contains'], diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index db3a103858..5694694534 100755 --- a/t/db_dependent/Search/History.t +++ b/t/db_dependent/Search/History.t @@ -8,7 +8,7 @@ use List::MoreUtils qw/all any none/; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Auth; +use C4::Auth qw( get_session checkauth get_template_and_user ); use Koha::Database; use Test::More tests => 27; @@ -28,7 +28,7 @@ my $dbh = C4::Context->dbh; t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); use_ok('Koha::DateUtils'); -use_ok('C4::Search::History'); +use_ok('C4::Search::History', qw( add get delete get_from_session )); my $userid = 123; my $previous_sessionid = "PREVIOUS_SESSIONID"; diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index 0dcdada16a..925a750250 100755 --- a/t/db_dependent/Serials.t +++ b/t/db_dependent/Serials.t @@ -5,12 +5,12 @@ use Modern::Perl; -use C4::Serials; +use C4::Serials qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate ); use C4::Serials::Frequency; use C4::Serials::Numberpattern; -use C4::Biblio; -use C4::Budgets; -use C4::Items; +use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); +use C4::Budgets qw( AddBudgetPeriod AddBudget ); +use C4::Items qw( AddItemFromMarc ); use Koha::Database; use Koha::DateUtils; use Koha::Acquisition::Booksellers; @@ -19,7 +19,7 @@ use t::lib::TestBuilder; use Test::More tests => 49; BEGIN { - use_ok('C4::Serials'); + use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Serials/Claims.t b/t/db_dependent/Serials/Claims.t index 6458497219..afc3a18e66 100755 --- a/t/db_dependent/Serials/Claims.t +++ b/t/db_dependent/Serials/Claims.t @@ -2,10 +2,10 @@ use Modern::Perl; use Test::More tests => 17; use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( AddBudgetPeriod AddBudget ); use Koha::Database; use Koha::Acquisition::Booksellers; -use_ok('C4::Serials'); +use_ok('C4::Serials', qw( GetSuppliersWithLateIssues NewSubscription GetLateOrMissingIssues updateClaim )); use Koha::DateUtils qw( dt_from_string output_pref ); diff --git a/t/db_dependent/Serials/Frequency.t b/t/db_dependent/Serials/Frequency.t index b185854947..02a64f7f99 100755 --- a/t/db_dependent/Serials/Frequency.t +++ b/t/db_dependent/Serials/Frequency.t @@ -8,7 +8,7 @@ use Modern::Perl; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; -use C4::Serials::Frequency; +use C4::Serials::Frequency qw( GetSubscriptionFrequencies DelSubscriptionFrequency GetSubscriptionFrequency ModSubscriptionFrequency AddSubscriptionFrequency ); # Start by deleting all frequencies. my @frequencies = GetSubscriptionFrequencies(); diff --git a/t/db_dependent/Serials/GetFictiveIssueNumber.t b/t/db_dependent/Serials/GetFictiveIssueNumber.t index 1ad66b2c93..5a5e6b0057 100755 --- a/t/db_dependent/Serials/GetFictiveIssueNumber.t +++ b/t/db_dependent/Serials/GetFictiveIssueNumber.t @@ -6,7 +6,7 @@ use Modern::Perl; use Test::More tests => 5; use Koha::Database; -use C4::Serials; +use C4::Serials qw( GetFictiveIssueNumber GetSubscription ); use C4::Serials::Frequency; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Serials/GetNextDate.t b/t/db_dependent/Serials/GetNextDate.t index bcbb76c1ad..4081dea09a 100755 --- a/t/db_dependent/Serials/GetNextDate.t +++ b/t/db_dependent/Serials/GetNextDate.t @@ -4,7 +4,7 @@ use Modern::Perl; use Test::More tests => 102; use Koha::Database; -use C4::Serials; +use C4::Serials qw( GetNextDate ); use C4::Serials::Frequency; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Serials/GetNextSeq.t b/t/db_dependent/Serials/GetNextSeq.t index d369b6ccdf..270568de60 100755 --- a/t/db_dependent/Serials/GetNextSeq.t +++ b/t/db_dependent/Serials/GetNextSeq.t @@ -9,7 +9,7 @@ my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; use C4::Serials::Frequency; -use C4::Serials; +use C4::Serials qw( GetNextDate GetNextSeq ); my $frequency = { description => "One issue per day", diff --git a/t/db_dependent/Serials/Numberpattern.t b/t/db_dependent/Serials/Numberpattern.t index 84a62ccb5a..65e1f420f1 100755 --- a/t/db_dependent/Serials/Numberpattern.t +++ b/t/db_dependent/Serials/Numberpattern.t @@ -9,7 +9,7 @@ use Koha::Database; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; -use C4::Serials::Numberpattern; +use C4::Serials::Numberpattern qw( GetSubscriptionNumberpatterns GetSubscriptionNumberpattern DelSubscriptionNumberpattern ModSubscriptionNumberpattern AddSubscriptionNumberpattern ); # Start by deleting all numberpatterns. my @numberpatterns = GetSubscriptionNumberpatterns(); diff --git a/t/db_dependent/Serials/ReNewSubscription.t b/t/db_dependent/Serials/ReNewSubscription.t index c8e4a60bb4..6abe8364c8 100755 --- a/t/db_dependent/Serials/ReNewSubscription.t +++ b/t/db_dependent/Serials/ReNewSubscription.t @@ -27,7 +27,7 @@ use Test::MockModule; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Serials; +use C4::Serials qw( NewSubscription ReNewSubscription GetSubscription GetSubscriptionLength ); use Koha::Database; use Koha::Subscription::Histories; diff --git a/t/db_dependent/Serials_2.t b/t/db_dependent/Serials_2.t index caf3d432b1..d0a1b7a615 100755 --- a/t/db_dependent/Serials_2.t +++ b/t/db_dependent/Serials_2.t @@ -10,8 +10,8 @@ use Koha::Database; use Koha::Patrons; use t::lib::Mocks; use t::lib::TestBuilder; -use_ok('C4::Serials'); -use_ok('C4::Budgets'); +use_ok('C4::Serials', qw( NewSubscription GetSubscription NewIssue GetPreviousSerialid )); +use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget )); # Mock userenv local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; diff --git a/t/db_dependent/ShelfBrowser.t b/t/db_dependent/ShelfBrowser.t index bf5906fa19..27d37419ad 100755 --- a/t/db_dependent/ShelfBrowser.t +++ b/t/db_dependent/ShelfBrowser.t @@ -8,12 +8,12 @@ use MARC::Record; use C4::Context; use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use t::lib::TestBuilder; -use_ok('C4::ShelfBrowser'); +use_ok('C4::ShelfBrowser', qw( GetNearbyItems )); my $schema = Koha::Database->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Stats.t b/t/db_dependent/Stats.t index 7e2e6f7b6c..5bf1b615be 100755 --- a/t/db_dependent/Stats.t +++ b/t/db_dependent/Stats.t @@ -1,13 +1,13 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Stats; +use C4::Stats qw( UpdateStats ); use Koha::Database; use Test::More tests => 18; BEGIN { - use_ok('C4::Stats'); + use_ok('C4::Stats', qw( UpdateStats )); } can_ok( 'C4::Stats', diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t index 762f9ad7a3..44e90a945a 100755 --- a/t/db_dependent/Suggestions.t +++ b/t/db_dependent/Suggestions.t @@ -25,7 +25,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetQueuedMessages GetMessage ); use C4::Budgets qw( AddBudgetPeriod AddBudget GetBudget ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); @@ -34,7 +34,7 @@ use Koha::Patrons; use Koha::Suggestions; BEGIN { - use_ok('C4::Suggestions'); + use_ok('C4::Suggestions', qw( NewSuggestion GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio SearchSuggestion DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Tags.t b/t/db_dependent/Tags.t index 93014bb3c1..30cbc12b48 100755 --- a/t/db_dependent/Tags.t +++ b/t/db_dependent/Tags.t @@ -30,7 +30,7 @@ use Koha::Tags; use Koha::Tags::Approvals; use Koha::Tags::Indexes; -use C4::Tags; +use C4::Tags qw( add_tag_approval add_tag add_tag_index get_tag_rows get_tag stratify_tags ); # So any output is readable :-D binmode STDOUT, ':encoding(utf8)'; diff --git a/t/db_dependent/Templates.t b/t/db_dependent/Templates.t index 2efce26c29..5d44d47fa5 100755 --- a/t/db_dependent/Templates.t +++ b/t/db_dependent/Templates.t @@ -27,10 +27,10 @@ use File::Temp qw/tempfile/; use t::lib::Mocks; -use C4::Auth qw//; +use C4::Auth qw( get_template_and_user ); BEGIN { - use_ok( 'C4::Templates' ); + use_ok('C4::Templates', qw( GetColumnDefs getlanguagecookie setlanguagecookie themelanguage gettemplate param output availablethemes badtemplatecheck )); can_ok( 'C4::Templates', qw/ GetColumnDefs getlanguagecookie diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index ddc12679c5..8b8b0f2929 100755 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -25,11 +25,11 @@ use Koha::Biblios; use Koha::Libraries; BEGIN { - use_ok('C4::UsageStats'); + use_ok('C4::UsageStats', qw( NeedUpdate BuildReport ReportToCommunity _count )); use_ok('C4::Context'); - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( UpdateTotalIssues )); use_ok( 'C4::AuthoritiesMarc', qw(AddAuthority) ); - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve )); use_ok('MARC::Record'); use_ok('Koha::Acquisition::Orders'); } diff --git a/t/db_dependent/Utils/Datatables.t b/t/db_dependent/Utils/Datatables.t index ae0c61bc4e..409dd6ecf6 100755 --- a/t/db_dependent/Utils/Datatables.t +++ b/t/db_dependent/Utils/Datatables.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 1; -use C4::Utils::DataTables; +use C4::Utils::DataTables qw( dt_build_orderby ); use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/Utils/Datatables_Virtualshelves.t b/t/db_dependent/Utils/Datatables_Virtualshelves.t index 758f93fff9..d43dbc5438 100755 --- a/t/db_dependent/Utils/Datatables_Virtualshelves.t +++ b/t/db_dependent/Utils/Datatables_Virtualshelves.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 13; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::Library; diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index ed34e5aa4d..0633d3402c 100755 --- a/t/db_dependent/XISBN.t +++ b/t/db_dependent/XISBN.t @@ -8,8 +8,8 @@ use Modern::Perl; use Test::More tests => 6; use List::MoreUtils qw(any none); use MARC::Record; -use C4::Biblio; -use C4::XISBN; +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); +use C4::XISBN qw( get_xisbns ); use C4::Context; use C4::Search; use Koha::Database; @@ -17,7 +17,7 @@ use t::lib::Mocks; use Test::MockModule; BEGIN { - use_ok('C4::XISBN'); + use_ok('C4::XISBN', qw( get_xisbns )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index f90baff197..521578947b 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -26,7 +26,7 @@ use t::lib::Mocks; use Koha::ItemTypes; BEGIN { - use_ok('C4::XSLT'); + use_ok('C4::XSLT', qw( transformMARCXML4XSLT getAuthorisedValues4MARCSubfields buildKohaItemsNamespace )); } my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/api/v1/auth.t b/t/db_dependent/api/v1/auth.t index 2003ac657c..cdb171925c 100755 --- a/t/db_dependent/api/v1/auth.t +++ b/t/db_dependent/api/v1/auth.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Auth; +use C4::Auth qw( get_session ); use Koha::Database; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t index b3868a340f..abd32a4629 100755 --- a/t/db_dependent/api/v1/checkouts.t +++ b/t/db_dependent/api/v1/checkouts.t @@ -26,7 +26,7 @@ use t::lib::TestBuilder; use DateTime; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::DateUtils; diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index e5a84bae3c..5abba54739 100755 --- a/t/db_dependent/api/v1/holds.t +++ b/t/db_dependent/api/v1/holds.t @@ -28,7 +28,7 @@ use Mojo::JSON qw(encode_json); use C4::Context; use Koha::Patrons; -use C4::Reserves; +use C4::Reserves qw( AddReserve CanItemBeReserved CanBookBeReserved ); use C4::Items; use Koha::Database; diff --git a/t/db_dependent/api/v1/return_claims.t b/t/db_dependent/api/v1/return_claims.t index 2123b5e0ae..a9877f7946 100755 --- a/t/db_dependent/api/v1/return_claims.t +++ b/t/db_dependent/api/v1/return_claims.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation qw(AddIssue); +use C4::Circulation qw( AddIssue ); use Koha::Checkouts::ReturnClaims; use Koha::Database; diff --git a/t/db_dependent/rollingloans.t b/t/db_dependent/rollingloans.t index 605bde4f38..f72fa9fcbf 100755 --- a/t/db_dependent/rollingloans.t +++ b/t/db_dependent/rollingloans.t @@ -2,7 +2,7 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( CanBookBeIssued AddIssue AddReturn ); use C4::Members; use C4::Items; use Koha::DateUtils; diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t index 4d0410450c..4bf121b022 100755 --- a/t/db_dependent/selenium/basic_workflow.t +++ b/t/db_dependent/selenium/basic_workflow.t @@ -37,7 +37,7 @@ use Modern::Perl; use Time::HiRes qw(gettimeofday); use POSIX qw(strftime); use C4::Context; -use C4::Biblio qw( AddBiblio ); # We shouldn't use it +use C4::Biblio qw( AddBiblio ); use Koha::CirculationRules; diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index a59739fa8c..220345fb82 100755 --- a/t/db_dependent/selenium/regressions.t +++ b/t/db_dependent/selenium/regressions.t @@ -25,7 +25,7 @@ use Test::MockModule; use C4::Context; use C4::Biblio qw( AddBiblio ); -use C4::Circulation; +use C4::Circulation qw( AddIssue ); use Koha::AuthUtils; use t::lib::Mocks; use t::lib::Selenium; diff --git a/t/db_dependent/www/regressions.t b/t/db_dependent/www/regressions.t index 9ea1a1d96a..8b9c77b07b 100755 --- a/t/db_dependent/www/regressions.t +++ b/t/db_dependent/www/regressions.t @@ -23,7 +23,7 @@ use t::lib::TestBuilder; use t::lib::Mocks; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( ModBiblio ); use Koha::Database; use Koha::Caches; diff --git a/t/db_dependent/zebra_config.pl b/t/db_dependent/zebra_config.pl index 8f962def23..169c51e55e 100755 --- a/t/db_dependent/zebra_config.pl +++ b/t/db_dependent/zebra_config.pl @@ -2,10 +2,10 @@ use Modern::Perl; -use File::Copy; -use File::Path qw(make_path); -use File::Find; -use File::Basename; +use File::Copy qw( copy ); +use File::Path qw( make_path ); +use File::Find qw( find ); +use File::Basename qw( dirname ); use File::Spec; use C4::Context; diff --git a/t/lib/Dates.pm b/t/lib/Dates.pm index 66299d9eb1..5340099881 100644 --- a/t/lib/Dates.pm +++ b/t/lib/Dates.pm @@ -1,7 +1,7 @@ package t::lib::Dates; use Modern::Perl; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use DateTime; =head1 NAME diff --git a/t/lib/Koha/BackgroundJob/BatchTest.pm b/t/lib/Koha/BackgroundJob/BatchTest.pm index 6e74038651..2b6490dbfc 100644 --- a/t/lib/Koha/BackgroundJob/BatchTest.pm +++ b/t/lib/Koha/BackgroundJob/BatchTest.pm @@ -16,7 +16,7 @@ package t::lib::Koha::BackgroundJob::BatchTest; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); diff --git a/t/lib/Koha/Plugin/BadAPIRoute.pm b/t/lib/Koha/Plugin/BadAPIRoute.pm index baf7e23a3f..66a1417a3d 100644 --- a/t/lib/Koha/Plugin/BadAPIRoute.pm +++ b/t/lib/Koha/Plugin/BadAPIRoute.pm @@ -2,7 +2,7 @@ package Koha::Plugin::BadAPIRoute; use Modern::Perl; -use Mojo::JSON qw(decode_json); +use Mojo::JSON qw( decode_json ); use base qw(Koha::Plugins::Base); diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm index 1c296b0595..36565397b7 100644 --- a/t/lib/Koha/Plugin/Test.pm +++ b/t/lib/Koha/Plugin/Test.pm @@ -6,7 +6,7 @@ use Modern::Perl; use Koha::Exceptions::Exception; use Koha::Plugins::Tab; -use Mojo::JSON qw(decode_json); +use Mojo::JSON qw( decode_json ); ## Required for all plugins use base qw(Koha::Plugins::Base); diff --git a/t/lib/Mocks.pm b/t/lib/Mocks.pm index a2404647c0..2b63c0ece5 100644 --- a/t/lib/Mocks.pm +++ b/t/lib/Mocks.pm @@ -16,7 +16,7 @@ package t::lib::Mocks; # along with Koha; if not, see . use Modern::Perl; -use C4::Context; +use C4::Context qw( config new preference userenv _new_userenv set_userenv ); use Test::MockModule; use Test::MockObject; diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 35d2c04fc3..8e235e94a7 100644 --- a/t/lib/Selenium.pm +++ b/t/lib/Selenium.pm @@ -18,10 +18,8 @@ package t::lib::Selenium; use Modern::Perl; use Carp qw( croak ); -use JSON qw( from_json ); -use File::Slurp qw( write_file ); -use C4::Context; +use C4::Context qw( new config preference interface ); use base qw(Class::Accessor); __PACKAGE__->mk_accessors(qw(login password base_url opac_base_url selenium_addr selenium_port driver)); diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index ee375425af..e8b0dbf126 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -2,16 +2,15 @@ package t::lib::TestBuilder; use Modern::Perl; -use Koha::Database; -use C4::Biblio; -use C4::Items; -use Koha::Biblios; -use Koha::Items; +use Koha::Database qw( schema ); +use C4::Biblio qw( AddBiblio ); +use Koha::Biblios qw( _type ); +use Koha::Items qw( _type ); use Koha::DateUtils qw( dt_from_string ); use Bytes::Random::Secure; -use Carp; -use Module::Load; +use Carp qw( carp ); +use Module::Load qw( load ); use String::Random; use constant { diff --git a/tags/list.pl b/tags/list.pl index 76d65c8dd1..ac2ccbc8b1 100755 --- a/tags/list.pl +++ b/tags/list.pl @@ -20,13 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(:DEFAULT check_cookie_auth); -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetBiblioData ); use C4::Context; -use C4::Items; -use C4::Koha; -use C4::Tags qw(get_tags remove_tag get_tag_rows); -use C4::Output; +use C4::Items qw( GetItemsInfo ); +use C4::Tags qw( get_tag_rows get_tags remove_tag ); +use C4::Output qw( output_html_with_http_headers ); my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created. diff --git a/tags/review.pl b/tags/review.pl index 866d94c3d9..0cc157aacc 100755 --- a/tags/review.pl +++ b/tags/review.pl @@ -20,17 +20,21 @@ # along with Koha; if not, see . use Modern::Perl; -use Data::Dumper; -use POSIX; +use POSIX qw( ceil exit ); use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use URI::Escape; -use C4::Auth qw(:DEFAULT check_cookie_auth); +use URI::Escape qw( uri_escape_utf8 ); +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Context; -use Koha::DateUtils; -# use C4::Koha; -use C4::Output qw(:html :ajax pagination_bar); -use C4::Tags qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved); +use Koha::DateUtils qw( dt_from_string output_pref ); +use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers ); +use C4::Tags qw( + approval_counts + blacklist + get_approval_rows + is_approved + whitelist +); my $script_name = "/cgi-bin/koha/tags/review.pl"; my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created. diff --git a/tools/access_files.pl b/tools/access_files.pl index 5ead5814aa..8a1c1adc58 100755 --- a/tools/access_files.pl +++ b/tools/access_files.pl @@ -23,14 +23,13 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI; use C4::Context; -use C4::Output; -use C4::Koha; -use File::stat qw(stat); -use Digest::MD5 qw(md5_hex); -use Encode; +use C4::Output qw( output_html_with_http_headers ); +use File::stat qw( stat ); +use Digest::MD5 qw( md5_hex ); +use Encode qw( decode ); my $input = CGI->new; my $file_id = $input->param("id"); diff --git a/tools/ajax-inventory.pl b/tools/ajax-inventory.pl index 72175cfb7a..a8c8c9d06d 100755 --- a/tools/ajax-inventory.pl +++ b/tools/ajax-inventory.pl @@ -2,7 +2,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( check_api_auth ); use C4::Items qw( ModDateLastSeen ); my $input = CGI->new; diff --git a/tools/automatic_item_modification_by_age.pl b/tools/automatic_item_modification_by_age.pl index ae9bcec192..3693f318f4 100755 --- a/tools/automatic_item_modification_by_age.pl +++ b/tools/automatic_item_modification_by_age.pl @@ -32,12 +32,11 @@ =head1 DESCRIPTION use Modern::Perl; use CGI; -use JSON qw( to_json from_json ); +use JSON qw( to_json ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Items; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; use Koha::Items; diff --git a/tools/background-job-progress.pl b/tools/background-job-progress.pl index 625389f902..e9e914d0d7 100755 --- a/tools/background-job-progress.pl +++ b/tools/background-job-progress.pl @@ -20,11 +20,10 @@ use Modern::Perl; # standard or CPAN modules used -use IO::File; use CGI qw ( -utf8 ); use CGI::Session; use C4::Context; -use C4::Auth qw/check_cookie_auth/; +use C4::Auth qw( check_cookie_auth ); use C4::BackgroundJob; use CGI::Cookie; # need to check cookies before # having CGI parse the POST request diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 6354d3bea2..63e22fc144 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -20,26 +20,32 @@ use CGI qw ( -utf8 ); use Modern::Perl; -use Try::Tiny; - -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( + DelBiblio + GetAuthorisedValueDesc + GetMarcFromKohaField + GetMarcStructure + IsMarcStructureInternal + TransformHtmlToXml +); +use C4::Items qw( GetItemsInfo Item2Marc ModItemFromMarc ); +use C4::Circulation qw( LostItem IsItemIssued ); use C4::Context; use C4::Koha; use C4::BackgroundJob; -use C4::ClassSource; -use C4::Members; +use C4::ClassSource qw( GetClassSources GetClassSource ); use MARC::File::XML; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Koha::Database; use Koha::Exceptions::Exception; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index ea87d8b6c8..2ec14ef653 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -23,10 +23,10 @@ use CGI; use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); use Koha::Virtualshelves; use Koha::Authorities; diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index d118120768..31231e77c2 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -22,14 +22,15 @@ use CGI; use List::MoreUtils qw( uniq ); -use JSON qw( encode_json ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); -use C4::AuthoritiesMarc qw( BuildSummary ModAuthority ); -use C4::Biblio qw( GetMarcBiblio ModBiblio ); -use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ); +use C4::Auth qw( get_template_and_user ); +use C4::MarcModificationTemplates qw( + GetModificationTemplateActions + GetModificationTemplates +); use Koha::Biblios; use Koha::BackgroundJob::BatchUpdateBiblio; diff --git a/tools/batch_records_ajax.pl b/tools/batch_records_ajax.pl index 4ddb0f5369..1085348da9 100755 --- a/tools/batch_records_ajax.pl +++ b/tools/batch_records_ajax.pl @@ -32,12 +32,11 @@ =head1 SYNOPSIS use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw/ to_json /; +use JSON qw( to_json ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use C4::ImportBatch; +use C4::Auth qw( check_cookie_auth ); +use C4::ImportBatch qw( GetImportBatch GetImportRecordsRange GetImportRecordMatches ); my $input = CGI->new; diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl index 1afc3f9540..add68a23bc 100755 --- a/tools/cleanborrowers.pl +++ b/tools/cleanborrowers.pl @@ -34,16 +34,13 @@ =head1 cleanborrowers.pl use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Circulation; # AnonymiseIssueHistory. +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Members qw( GetBorrowersToExpunge ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; use Koha::Patrons; -use Date::Calc qw/Today Add_Delta_YM/; -use Koha::Patrons; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; diff --git a/tools/copy-holidays.pl b/tools/copy-holidays.pl index e11353a09d..381f9e70a5 100755 --- a/tools/copy-holidays.pl +++ b/tools/copy-holidays.pl @@ -21,7 +21,7 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; diff --git a/tools/csv-profiles.pl b/tools/csv-profiles.pl index cf4012fc47..2883f71d49 100755 --- a/tools/csv-profiles.pl +++ b/tools/csv-profiles.pl @@ -37,11 +37,10 @@ =head1 FUNCTIONS use Modern::Perl; use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; use Koha::CsvProfiles; my $input = CGI->new; diff --git a/tools/exceptionHolidays.pl b/tools/exceptionHolidays.pl index 6894074459..a96b1d0ebb 100755 --- a/tools/exceptionHolidays.pl +++ b/tools/exceptionHolidays.pl @@ -4,12 +4,12 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use DateTime; use C4::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $input = CGI->new; my $dbh = C4::Context->dbh(); diff --git a/tools/export.pl b/tools/export.pl index 588f1b9c93..7b9686197e 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -19,15 +19,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); use MARC::File::XML; -use List::MoreUtils qw(uniq); -use C4::Auth; -use C4::Output; +use List::MoreUtils qw( uniq ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Authority::Types; use Koha::Biblioitems; use Koha::CsvProfiles; use Koha::Database; -use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Exporter::Record; use Koha::ItemTypes; use Koha::Libraries; diff --git a/tools/holidays.pl b/tools/holidays.pl index 3b7e93d7cd..ddf45db1dc 100755 --- a/tools/holidays.pl +++ b/tools/holidays.pl @@ -20,11 +20,11 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl index 9d9eedffee..949f40261d 100755 --- a/tools/import_borrowers.pl +++ b/tools/import_borrowers.pl @@ -36,16 +36,16 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Templates; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Token; use Koha::Libraries; use Koha::Patron::Categories; use Koha::Patron::Attribute::Types; -use Koha::List::Patron; +use Koha::List::Patron qw( AddPatronList AddPatronsToList ); use Koha::Patrons::Import; my $Import = Koha::Patrons::Import->new(); diff --git a/tools/inventory.pl b/tools/inventory.pl index 2ad5452015..5eac6e4e74 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -26,18 +26,17 @@ my $uploadbarcodes = $input->param('uploadbarcodes'); my $barcodelist = $input->param('barcodelist'); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Circulation; -use C4::Reports::Guided; #_get_column_defs -use C4::Charset; +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( GetItemsForInventory ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Circulation qw( AddReturn ); +use C4::Reports::Guided qw( ); +use C4::Charset qw( NormalizeString ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::ClassSources; @@ -371,7 +370,7 @@ # Export to csv if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ - eval {use Text::CSV}; + eval {use Text::CSV ();}; my $csv = Text::CSV->new or die Text::CSV->error_diag (); binmode STDOUT, ":encoding(UTF-8)"; diff --git a/tools/koha-news.pl b/tools/koha-news.pl index 65f560a5dd..cfc8066104 100755 --- a/tools/koha-news.pl +++ b/tools/koha-news.pl @@ -24,13 +24,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Languages qw(getTranslatedLanguages); -use Date::Calc qw/Date_to_Days Today/; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Languages qw( getTranslatedLanguages ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::News; my $cgi = CGI->new; diff --git a/tools/letter.pl b/tools/letter.pl index 3ed44c3848..b913d0ee59 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -42,11 +42,11 @@ =head1 tools/letter.pl use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Letters; -use C4::Log; +use C4::Output qw( output_html_with_http_headers ); +use C4::Letters qw( GetMessageTransportTypes ); +use C4::Log qw( logaction ); use Koha::Notice::Templates; use Koha::Patron::Attribute::Types; diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 8fcea16c03..ef0bd36d33 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -27,11 +27,9 @@ # Koha modules used use C4::Context; use C4::Koha; -use C4::Auth; -use C4::AuthoritiesMarc; -use C4::Output; -use C4::Biblio; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( CleanBatch DeleteBatch GetImportBatch GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction BatchFindDuplicates SetImportBatchMatcher GetItemNumbersFromImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches BatchCommitRecords BatchRevertRecords ); use C4::Matcher; use C4::BackgroundJob; use C4::Labels::Batch; diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl index ffe5784a95..b802d508a3 100755 --- a/tools/marc_modification_templates.pl +++ b/tools/marc_modification_templates.pl @@ -20,10 +20,18 @@ use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::MarcModificationTemplates; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::MarcModificationTemplates qw( + AddModificationTemplate + AddModificationTemplateAction + DelModificationTemplate + DelModificationTemplateAction + GetModificationTemplateActions + GetModificationTemplates + ModModificationTemplateAction + MoveModificationTemplateAction +); my $cgi = CGI->new; diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index ee896848d1..a12c81d715 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -27,16 +27,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( GetAuthorisedValues ); use C4::Members; -use C4::Output; -use List::MoreUtils qw /any uniq/; +use C4::Output qw( output_html_with_http_headers ); use Koha::DateUtils qw( dt_from_string ); -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Libraries; use Koha::Patron::Categories; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments ); use Koha::Patrons; my $input = CGI->new; diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl index c402dfdf7f..b07079d52b 100755 --- a/tools/newHolidays.pl +++ b/tools/newHolidays.pl @@ -21,12 +21,12 @@ use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use C4::Calendar; use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $dbh = C4::Context->dbh(); diff --git a/tools/overduerules.pl b/tools/overduerules.pl index b7860d8726..5cab5a802d 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -20,12 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use C4::Members; -use C4::Overdues; +use C4::Overdues qw( GetOverdueMessageTransportTypes ); use Koha::Libraries; use Koha::Patron::Categories; diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl index 868149e4a7..c708f7f244 100755 --- a/tools/picture-upload.pl +++ b/tools/picture-upload.pl @@ -22,12 +22,11 @@ use Modern::Perl; use File::Temp; -use File::Copy; use CGI qw ( -utf8 ); use GD; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Members; use Koha::Logger; diff --git a/tools/problem-reports.pl b/tools/problem-reports.pl index 0b07511cf3..31a3671b68 100755 --- a/tools/problem-reports.pl +++ b/tools/problem-reports.pl @@ -21,8 +21,8 @@ use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::ProblemReports; my $query = CGI->new; diff --git a/tools/quotes-upload.pl b/tools/quotes-upload.pl index 28ef9cef80..6efb6da313 100755 --- a/tools/quotes-upload.pl +++ b/tools/quotes-upload.pl @@ -22,10 +22,9 @@ use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; diff --git a/tools/quotes.pl b/tools/quotes.pl index f87991a88b..b45f55ea16 100755 --- a/tools/quotes.pl +++ b/tools/quotes.pl @@ -18,11 +18,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Quotes; my $input = CGI->new; diff --git a/tools/scheduler.pl b/tools/scheduler.pl index b6a39532cc..53d4b641c4 100755 --- a/tools/scheduler.pl +++ b/tools/scheduler.pl @@ -19,12 +19,12 @@ use Modern::Perl; use C4::Context; -use C4::Scheduler; -use C4::Reports::Guided; -use C4::Auth; +use C4::Scheduler qw( add_at_job get_jobs remove_at_job ); +use C4::Reports::Guided qw( get_saved_reports ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); -use C4::Output; -use Koha::DateUtils;; +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( dt_from_string output_pref );; my $input = CGI->new; my $base; diff --git a/tools/showdiffmarc.pl b/tools/showdiffmarc.pl index 57da80e719..c879433578 100755 --- a/tools/showdiffmarc.pl +++ b/tools/showdiffmarc.pl @@ -26,11 +26,11 @@ # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::AuthoritiesMarc; -use C4::ImportBatch; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Auth qw( get_template_and_user ); +use C4::ImportBatch qw( GetRecordFromImportBiblio GetImportBiblios ); use Koha::Biblios; diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index e9afdc1461..7653bc6893 100755 --- a/tools/stage-marc-import.pl +++ b/tools/stage-marc-import.pl @@ -33,14 +33,13 @@ # Koha modules used use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( RecordsFromMARCXMLFile RecordsFromISO2709File RecordsFromMarcPlugin BatchStageMarcRecords BatchFindDuplicates SetImportBatchMatcher SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction ); use C4::Matcher; use Koha::UploadedFiles; use C4::BackgroundJob; -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( GetModificationTemplates ); use Koha::Plugins; use Koha::ImportBatches; diff --git a/tools/stockrotation.pl b/tools/stockrotation.pl index 18891fa3db..b1d2548456 100755 --- a/tools/stockrotation.pl +++ b/tools/stockrotation.pl @@ -27,16 +27,16 @@ =head1 stockrotation.pl use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::StockRotationRotas; use Koha::StockRotationItems; use Koha::StockRotationStages; use Koha::Item; -use Koha::Util::StockRotation qw(:ALL); +use Koha::Util::StockRotation qw( get_branches get_stages move_to_next_stage toggle_indemand remove_from_stage add_items_to_rota get_barcodes_status ); my $input = CGI->new; diff --git a/tools/tools-home.pl b/tools/tools-home.pl index 4a4ed2ceef..842ae68874 100755 --- a/tools/tools-home.pl +++ b/tools/tools-home.pl @@ -18,9 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Tags qw/get_count_by_tag_status/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Tags qw( get_count_by_tag_status ); use Koha::Reviews; my $query = CGI->new; diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index 84fc4a416d..f55d8f128d 100755 --- a/tools/upload-cover-image.pl +++ b/tools/upload-cover-image.pl @@ -43,13 +43,13 @@ =head1 DESCRIPTION use CGI qw ( -utf8 ); use GD; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::CoverImages; use Koha::Items; use Koha::UploadedFiles; -use C4::Log; +use C4::Log qw( logaction ); my $input = CGI->new; diff --git a/tools/upload-file.pl b/tools/upload-file.pl index 86ef2c5dc2..7ec0fc7045 100755 --- a/tools/upload-file.pl +++ b/tools/upload-file.pl @@ -23,10 +23,10 @@ use CGI::Cookie; use Encode; use JSON; -use URI::Escape; +use URI::Escape qw( uri_unescape ); use C4::Context; -use C4::Auth qw/check_cookie_auth haspermission/; +use C4::Auth qw( check_cookie_auth get_session ); use Koha::Uploader; # upload-file.pl must authenticate the user diff --git a/tools/upload.pl b/tools/upload.pl index c01d57f925..509e99bb00 100755 --- a/tools/upload.pl +++ b/tools/upload.pl @@ -21,8 +21,8 @@ use CGI qw/-utf8/; use JSON; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::UploadedFiles; use constant ERR_READING => 'UPLERR_FILE_NOT_READ'; diff --git a/tools/viewlog.pl b/tools/viewlog.pl index e0b19e91b9..5909cb39ed 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -20,19 +20,17 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use Text::CSV::Encoded; use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Items; -use C4::Serials; -use C4::Search; # enabled_staff_search_views +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Search qw( enabled_staff_search_views ); use Koha::ActionLogs; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Patrons; diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index 68e7da5035..5c2b262a18 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -59,9 +59,8 @@ =head1 CGI PARAMETERS use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; use Koha::Virtualshelves; diff --git a/virtualshelves/downloadshelf.pl b/virtualshelves/downloadshelf.pl index c6cb31f496..07b2682945 100755 --- a/virtualshelves/downloadshelf.pl +++ b/virtualshelves/downloadshelf.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::Virtualshelves; diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index f15e2c9f64..bc47249744 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -20,14 +20,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( encode ); -use Carp; -use Try::Tiny; - -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcISBN + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Email; use Koha::Virtualshelves; diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index d233eb1355..85a529e492 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -19,12 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Koha; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Items qw( GetItemsLocationInfo ); use C4::Members; -use C4::Output; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::XSLT; use Koha::Biblios; diff --git a/xt/yaml_valid.pl b/xt/yaml_valid.pl index 2bbb9650cb..59e303a4f5 100755 --- a/xt/yaml_valid.pl +++ b/xt/yaml_valid.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use YAML::XS; my $usage = <