From d247069831113b1c2d5ea5e5c8344e87ad271111 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Sep 2021 12:01:01 +0200 Subject: [PATCH] Bug 28931: Use EXPORT_OK from Koha::AuthUtils It has been missed on bug 17600. Signed-off-by: Nick Clemens --- C4/SIP/ILS/Item.pm | 2 +- C4/SIP/ILS/Transaction.pm | 2 +- Koha/DateUtils.pm | 16 +++++++++++----- Koha/pdfformat/layout3pagesfr.pm | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- opac/svc/checkout_notes | 2 +- svc/checkouts | 2 +- svc/holds | 2 +- svc/return_claims | 2 +- t/Calendar.t | 2 +- t/Circulation/AgeRestrictionMarkers.t | 2 +- t/DateUtils.t | 6 +++--- t/db_dependent/Calendar.t | 2 +- t/db_dependent/Circulation.t | 2 +- t/db_dependent/Circulation/GetHardDueDate.t | 2 +- .../Circulation/IssuingRules/maxsuspensiondays.t | 2 +- t/db_dependent/Circulation/Returns.t | 2 +- t/db_dependent/Circulation/StoreLastBorrower.t | 2 +- t/db_dependent/Circulation/dateexpiry.t | 2 +- t/db_dependent/Circulation/issue.t | 2 +- t/db_dependent/Circulation/transfers.t | 2 +- t/db_dependent/Contract.t | 2 +- t/db_dependent/DecreaseLoanHighHolds.t | 2 +- t/db_dependent/Fines.t | 2 +- t/db_dependent/Hold.t | 2 +- t/db_dependent/Holds/WaitingReserves.t | 2 +- t/db_dependent/HoldsQueue.t | 2 +- t/db_dependent/Holidays.t | 3 +-- t/db_dependent/ILSDI_Services.t | 2 +- .../Items/AutomaticItemModificationByAge.t | 2 +- t/db_dependent/Koha/Acquisition/Booksellers.t | 2 +- t/db_dependent/Koha/AdditionalContents.t | 2 +- t/db_dependent/Koha/BackgroundJobs.t | 2 +- t/db_dependent/Koha/Item.t | 2 +- t/db_dependent/Koha/Item/Transfer.t | 2 +- t/db_dependent/Koha/Item/Transfers.t | 2 +- t/db_dependent/Koha/Patron/Categories.t | 2 +- t/db_dependent/Koha/Patrons.t | 2 +- t/db_dependent/Koha/Suggestions.t | 2 +- t/db_dependent/Letters/TemplateToolkit.t | 2 +- t/db_dependent/OAI/Server.t | 2 +- t/db_dependent/Passwordrecovery.t | 2 +- t/db_dependent/Patron/Borrower_PrevCheckout.t | 2 +- t/db_dependent/Patrons.t | 2 +- t/db_dependent/Reserves.t | 2 +- t/db_dependent/Reserves/AutoUnsuspendReserves.t | 2 +- t/db_dependent/Reserves/CancelExpiredReserves.t | 2 +- t/db_dependent/SIP/Message.t | 2 +- t/db_dependent/SIP/Patron.t | 2 +- t/db_dependent/Search/History.t | 2 +- t/db_dependent/Serials.t | 2 +- t/db_dependent/Sitemapper.t | 2 +- t/db_dependent/StockRotationItems.t | 2 +- t/db_dependent/Template/Plugin/KohaDates.t | 2 +- t/db_dependent/Upload.t | 3 +-- t/db_dependent/Virtualshelves.t | 2 +- t/db_dependent/api/v1/checkouts.t | 2 +- t/db_dependent/api/v1/holds.t | 2 +- t/db_dependent/cronjobs/advance_notices_digest.t | 2 +- t/db_dependent/rollingloans.t | 2 +- tools/additional-contents.pl | 3 ++- 61 files changed, 74 insertions(+), 69 deletions(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 48df606cad..d57947a368 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -26,7 +26,7 @@ use Koha::Biblios; use Koha::Checkouts::ReturnClaims; use Koha::Checkouts; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; use Koha::Items; use Koha::Patrons; diff --git a/C4/SIP/ILS/Transaction.pm b/C4/SIP/ILS/Transaction.pm index 011aa980b3..fade710a04 100644 --- a/C4/SIP/ILS/Transaction.pm +++ b/C4/SIP/ILS/Transaction.pm @@ -8,7 +8,7 @@ use Carp; use strict; use warnings; use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Checkouts; my %fields = ( diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 9b599e3c6d..f5becf0405 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -21,11 +21,17 @@ use DateTime; use C4::Context; use Koha::Exceptions; -use base 'Exporter'; - -our @EXPORT = ( - qw( dt_from_string output_pref format_sqldatetime ) -); +use vars qw(@ISA @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + + @EXPORT_OK = qw( + dt_from_string + output_pref + format_sqldatetime + ); +} =head1 DateUtils diff --git a/Koha/pdfformat/layout3pagesfr.pm b/Koha/pdfformat/layout3pagesfr.pm index 1003583b6d..84270b9fd1 100644 --- a/Koha/pdfformat/layout3pagesfr.pm +++ b/Koha/pdfformat/layout3pagesfr.pm @@ -29,7 +29,7 @@ use utf8; use C4::Acquisition; use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; BEGIN { diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4f89a31f60..1ea8f64bb3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -40,7 +40,7 @@ use C4::Context; use C4::Installer; use Koha::Database; use Koha; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); diff --git a/opac/svc/checkout_notes b/opac/svc/checkout_notes index fea4a9e67a..dd4fb83b4e 100755 --- a/opac/svc/checkout_notes +++ b/opac/svc/checkout_notes @@ -29,7 +29,7 @@ use C4::Scrubber; use C4::Circulation; use C4::Biblio; use Koha::Checkouts; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; =head1 NAME diff --git a/svc/checkouts b/svc/checkouts index 38c0017e2c..b8b5bdf109 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -28,7 +28,7 @@ use C4::Overdues qw(GetFine); use C4::Context; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; my $input = CGI->new; diff --git a/svc/holds b/svc/holds index 5e0a9d91fb..90a2ad74b3 100755 --- a/svc/holds +++ b/svc/holds @@ -27,7 +27,7 @@ use C4::Charset; use C4::Circulation qw(GetTransfers); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Holds; use Koha::ItemTypes; use Koha::Libraries; diff --git a/svc/return_claims b/svc/return_claims index 2a616f08e2..a19f861660 100755 --- a/svc/return_claims +++ b/svc/return_claims @@ -26,7 +26,7 @@ use C4::Auth qw(check_cookie_auth haspermission get_session); use C4::Context; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; my $input = CGI->new; diff --git a/t/Calendar.t b/t/Calendar.t index 8965087301..d560b68a16 100755 --- a/t/Calendar.t +++ b/t/Calendar.t @@ -23,7 +23,7 @@ use Test::MockModule; use DateTime; use DateTime::Duration; use Koha::Caches; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::Mocks; diff --git a/t/Circulation/AgeRestrictionMarkers.t b/t/Circulation/AgeRestrictionMarkers.t index a658d35977..4688751dbe 100755 --- a/t/Circulation/AgeRestrictionMarkers.t +++ b/t/Circulation/AgeRestrictionMarkers.t @@ -21,7 +21,7 @@ use Modern::Perl; use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Test::More tests => 8; use Test::Warn; diff --git a/t/DateUtils.t b/t/DateUtils.t index 5b00c77124..128ae3b86d 100755 --- a/t/DateUtils.t +++ b/t/DateUtils.t @@ -4,16 +4,16 @@ use DateTime::TimeZone; use C4::Context; -use Test::More tests => 79; +use Test::More tests => 78; use Test::MockModule; use Test::Warn; use Time::HiRes qw/ gettimeofday /; use Try::Tiny; -use t::lib::Mocks; +use Koha::DateUtils qw( dt_from_string output_pref format_sqldatetime ); -BEGIN { use_ok('Koha::DateUtils'); } +use t::lib::Mocks; t::lib::Mocks::mock_preference('dateformat', 'us'); t::lib::Mocks::mock_preference('TimeFormat', 'This_is_not_used_but_called'); diff --git a/t/db_dependent/Calendar.t b/t/db_dependent/Calendar.t index 0900b5719d..4b8a7057c2 100755 --- a/t/db_dependent/Calendar.t +++ b/t/db_dependent/Calendar.t @@ -25,7 +25,7 @@ use t::lib::TestBuilder; use DateTime; use Koha::Caches; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use_ok('Koha::Calendar'); diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index e054c74ab5..e8a2d144a1 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -39,7 +39,7 @@ use C4::Items qw( ModItemTransfer ); use C4::Log; use C4::Reserves qw( AddReserve ModReserve ModReserveCancelAll ModReserveAffect CheckReserves GetOtherReserves ); use C4::Overdues qw( CalcFine UpdateFine get_chargeable_units ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Items; use Koha::Item::Transfers; diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t index f68b98c20d..5f11511730 100755 --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ b/t/db_dependent/Circulation/GetHardDueDate.t @@ -4,7 +4,7 @@ use Modern::Perl; use C4::Context; use DateTime; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::CirculationRules; use Koha::Library; diff --git a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t index bdb9d5aee6..0660b27415 100755 --- a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t +++ b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t @@ -8,7 +8,7 @@ use C4::Context; use C4::Circulation qw( AddIssue AddReturn ); use C4::Biblio qw( AddBiblio ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Debarments qw( GetDebarments DelDebarment ); use Koha::Patrons; diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index c361d3c165..f2dc194981 100755 --- a/t/db_dependent/Circulation/Returns.t +++ b/t/db_dependent/Circulation/Returns.t @@ -30,7 +30,7 @@ use C4::Items; use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Account::Lines; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Patrons; diff --git a/t/db_dependent/Circulation/StoreLastBorrower.t b/t/db_dependent/Circulation/StoreLastBorrower.t index b6770d8e06..b5c12b7e6b 100755 --- a/t/db_dependent/Circulation/StoreLastBorrower.t +++ b/t/db_dependent/Circulation/StoreLastBorrower.t @@ -22,7 +22,7 @@ use Test::More tests => 1; use C4::Circulation qw( AddReturn ); use C4::Context; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use t::lib::Mocks; diff --git a/t/db_dependent/Circulation/dateexpiry.t b/t/db_dependent/Circulation/dateexpiry.t index 599abfa93d..8533794141 100755 --- a/t/db_dependent/Circulation/dateexpiry.t +++ b/t/db_dependent/Circulation/dateexpiry.t @@ -21,7 +21,7 @@ use DateTime; use Time::HiRes qw/gettimeofday time/; use Test::More tests => 2; use C4::Members; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use t::lib::TestBuilder; diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index d4fb82b55b..1ef8c7ed6d 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -30,7 +30,7 @@ use C4::Items; use C4::Reserves qw( AddReserve ); use Koha::Checkouts; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Holds; use Koha::Items; use Koha::Library; diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t index 99767c8798..e03b54fc02 100755 --- a/t/db_dependent/Circulation/transfers.t +++ b/t/db_dependent/Circulation/transfers.t @@ -21,7 +21,7 @@ use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits Get use C4::Biblio qw( AddBiblio ); use C4::Items qw( ModItemTransfer ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use DateTime::Duration; use Koha::Item::Transfers; diff --git a/t/db_dependent/Contract.t b/t/db_dependent/Contract.t index 7ce9d34ac7..e1af15b19c 100755 --- a/t/db_dependent/Contract.t +++ b/t/db_dependent/Contract.t @@ -21,7 +21,7 @@ use Modern::Perl; use C4::Context; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Acquisition::Booksellers; use DateTime::Duration; diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t index 8bb0fdce6e..8722a5c907 100755 --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ b/t/db_dependent/DecreaseLoanHighHolds.t @@ -20,7 +20,7 @@ use DateTime; use C4::Circulation qw( CalcDateDue checkHighHolds CanBookBeIssued ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Biblio; use Koha::Item; diff --git a/t/db_dependent/Fines.t b/t/db_dependent/Fines.t index fef8a939af..b604a3374a 100755 --- a/t/db_dependent/Fines.t +++ b/t/db_dependent/Fines.t @@ -5,7 +5,7 @@ use Modern::Perl; use C4::Context; use C4::Overdues qw( CalcFine ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Test::More tests => 5; diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index fb983caca5..abeae5cc7a 100755 --- a/t/db_dependent/Hold.t +++ b/t/db_dependent/Hold.t @@ -26,7 +26,7 @@ use C4::Calendar qw( new insert_single_holiday ); use Koha::Patrons; use Koha::Holds; use Koha::Item; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::TestBuilder; use Test::More tests => 34; diff --git a/t/db_dependent/Holds/WaitingReserves.t b/t/db_dependent/Holds/WaitingReserves.t index 7536b30b48..feeaf40716 100755 --- a/t/db_dependent/Holds/WaitingReserves.t +++ b/t/db_dependent/Holds/WaitingReserves.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Reserves qw( ModReserve ModReserveAffect ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index 30f4ec3eae..51d57b834a 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -16,7 +16,7 @@ use C4::Context; use C4::Members; use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Holds; use Koha::CirculationRules; diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t index 677c4cc1f3..607906a169 100755 --- a/t/db_dependent/Holidays.t +++ b/t/db_dependent/Holidays.t @@ -25,8 +25,7 @@ use DateTime::TimeZone; use t::lib::TestBuilder; use C4::Context; use Koha::Database; -use Koha::DateUtils; - +use Koha::DateUtils qw( dt_from_string ); BEGIN { use_ok('Koha::Calendar'); diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index 72681afd69..0aa7be657a 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -29,7 +29,7 @@ use C4::Items qw( ModItemTransfer ); use C4::Circulation qw( AddIssue ); use Koha::AuthUtils; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); BEGIN { use_ok('C4::ILSDI::Services', qw( AuthenticatePatron GetPatronInfo LookupPatron HoldTitle HoldItem GetRecords RenewLoan )); diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t index 0c1b044b38..db162d6964 100755 --- a/t/db_dependent/Items/AutomaticItemModificationByAge.t +++ b/t/db_dependent/Items/AutomaticItemModificationByAge.t @@ -10,7 +10,7 @@ use DateTime::Duration; use C4::Items qw( GetMarcItem ToggleNewStatus ); use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t index 9025f1cc81..c3b8c1bd6b 100755 --- a/t/db_dependent/Koha/Acquisition/Booksellers.t +++ b/t/db_dependent/Koha/Acquisition/Booksellers.t @@ -28,7 +28,7 @@ use C4::Serials qw( NewSubscription SearchSubscriptions ); use Koha::Acquisition::Booksellers; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $schema = Koha::Database->schema(); my $builder = t::lib::TestBuilder->new; diff --git a/t/db_dependent/Koha/AdditionalContents.t b/t/db_dependent/Koha/AdditionalContents.t index 80fb4c60cf..ac9f998cb1 100755 --- a/t/db_dependent/Koha/AdditionalContents.t +++ b/t/db_dependent/Koha/AdditionalContents.t @@ -24,7 +24,7 @@ use Test::Exception; use Koha::AdditionalContents; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/BackgroundJobs.t b/t/db_dependent/Koha/BackgroundJobs.t index f678e20635..63c32e0845 100755 --- a/t/db_dependent/Koha/BackgroundJobs.t +++ b/t/db_dependent/Koha/BackgroundJobs.t @@ -25,7 +25,7 @@ use JSON qw( decode_json ); use Koha::Database; use Koha::BackgroundJobs; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::TestBuilder; use t::lib::Mocks; diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index e9cc993cd7..9f58f089c5 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -27,7 +27,7 @@ use C4::Circulation qw( AddIssue AddReturn ); use Koha::Items; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Old::Items; use List::MoreUtils qw(all); diff --git a/t/db_dependent/Koha/Item/Transfer.t b/t/db_dependent/Koha/Item/Transfer.t index 54b8208419..2ac3462351 100755 --- a/t/db_dependent/Koha/Item/Transfer.t +++ b/t/db_dependent/Koha/Item/Transfer.t @@ -20,7 +20,7 @@ use Modern::Perl; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Koha/Item/Transfers.t b/t/db_dependent/Koha/Item/Transfers.t index 03ed3cf3aa..324842b637 100755 --- a/t/db_dependent/Koha/Item/Transfers.t +++ b/t/db_dependent/Koha/Item/Transfers.t @@ -24,7 +24,7 @@ use Test::More tests => 3; use Koha::Item::Transfer; use Koha::Item::Transfers; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::TestBuilder; use t::lib::Dates; diff --git a/t/db_dependent/Koha/Patron/Categories.t b/t/db_dependent/Koha/Patron/Categories.t index 906d897a87..f6cdba7e24 100755 --- a/t/db_dependent/Koha/Patron/Categories.t +++ b/t/db_dependent/Koha/Patron/Categories.t @@ -23,7 +23,7 @@ use Test::More tests => 10; use C4::Context; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patron::Category; use Koha::Patron::Categories; use t::lib::Dates; diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 152b80c35b..390d9d3e66 100755 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -42,7 +42,7 @@ use Koha::Patron::Attribute::Types; use Koha::Patron::Categories; use Koha::Patron::Relationship; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Virtualshelves; use Koha::Notice::Messages; diff --git a/t/db_dependent/Koha/Suggestions.t b/t/db_dependent/Koha/Suggestions.t index ae93073e89..9cd1bff8c0 100755 --- a/t/db_dependent/Koha/Suggestions.t +++ b/t/db_dependent/Koha/Suggestions.t @@ -25,7 +25,7 @@ use Test::Exception; use Koha::Suggestion; use Koha::Suggestions; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use t::lib::TestBuilder; diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t index 04658e7899..127a98bd11 100755 --- a/t/db_dependent/Letters/TemplateToolkit.t +++ b/t/db_dependent/Letters/TemplateToolkit.t @@ -33,7 +33,7 @@ use C4::Letters qw( GetPreparedLetter ); use C4::Members qw( IssueSlip ); use C4::Biblio; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ArticleRequests; use Koha::Biblio; use Koha::Biblioitem; diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t index 4c3e641583..8f52645edb 100755 --- a/t/db_dependent/OAI/Server.t +++ b/t/db_dependent/OAI/Server.t @@ -38,7 +38,7 @@ use C4::OAI::Sets qw(AddOAISet); use Koha::Biblio::Metadatas; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); BEGIN { use_ok('Koha::OAI::Server::DeletedRecord'); diff --git a/t/db_dependent/Passwordrecovery.t b/t/db_dependent/Passwordrecovery.t index 0f33acb0ea..36bde4c780 100755 --- a/t/db_dependent/Passwordrecovery.t +++ b/t/db_dependent/Passwordrecovery.t @@ -20,7 +20,7 @@ use Modern::Perl; use C4::Context; use C4::Letters qw( GetQueuedMessages ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use t::lib::TestBuilder; diff --git a/t/db_dependent/Patron/Borrower_PrevCheckout.t b/t/db_dependent/Patron/Borrower_PrevCheckout.t index 3b12f70878..ca10733a60 100755 --- a/t/db_dependent/Patron/Borrower_PrevCheckout.t +++ b/t/db_dependent/Patron/Borrower_PrevCheckout.t @@ -4,7 +4,7 @@ use Modern::Perl; use C4::Members; use C4::Circulation qw( AddIssue AddReturn CanBookBeIssued ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Test::More tests => 61; diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t index 7a5eee1cfc..5fde05614d 100755 --- a/t/db_dependent/Patrons.t +++ b/t/db_dependent/Patrons.t @@ -22,7 +22,7 @@ use Test::Warn; use C4::Context; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use t::lib::Dates; use t::lib::TestBuilder; diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index e748f115f4..9b4122dbd4 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -34,7 +34,7 @@ use C4::Members; 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; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Holds; use Koha::Items; use Koha::Libraries; diff --git a/t/db_dependent/Reserves/AutoUnsuspendReserves.t b/t/db_dependent/Reserves/AutoUnsuspendReserves.t index 4d24794825..e1fefc9fd5 100755 --- a/t/db_dependent/Reserves/AutoUnsuspendReserves.t +++ b/t/db_dependent/Reserves/AutoUnsuspendReserves.t @@ -24,7 +24,7 @@ use t::lib::TestBuilder; use C4::Reserves qw( AutoUnsuspendReserves ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t index 27a583b6f1..3b1480c0b3 100755 --- a/t/db_dependent/Reserves/CancelExpiredReserves.t +++ b/t/db_dependent/Reserves/CancelExpiredReserves.t @@ -9,7 +9,7 @@ use t::lib::TestBuilder; use C4::Members; use C4::Reserves qw( CancelExpiredReserves ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; my $schema = Koha::Database->new->schema; diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t index 790248b748..0fbfd81a89 100755 --- a/t/db_dependent/SIP/Message.t +++ b/t/db_dependent/SIP/Message.t @@ -34,7 +34,7 @@ use C4::Reserves qw( AddReserve ); use C4::Circulation qw( AddReturn ); use Koha::Database; use Koha::AuthUtils qw(hash_password); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Items; use Koha::Checkouts; use Koha::Old::Checkouts; diff --git a/t/db_dependent/SIP/Patron.t b/t/db_dependent/SIP/Patron.t index ced751aa99..9106b1e739 100755 --- a/t/db_dependent/SIP/Patron.t +++ b/t/db_dependent/SIP/Patron.t @@ -12,7 +12,7 @@ use t::lib::TestBuilder; use C4::SIP::ILS::Patron; use Koha::Account::Lines; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Attributes; use Koha::Patrons; diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index 5694694534..4c084e121a 100755 --- a/t/db_dependent/Search/History.t +++ b/t/db_dependent/Search/History.t @@ -17,7 +17,7 @@ use URI::Escape; use List::Util qw( shuffle ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index 925a750250..816a8a9714 100755 --- a/t/db_dependent/Serials.t +++ b/t/db_dependent/Serials.t @@ -12,7 +12,7 @@ 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::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Booksellers; use t::lib::Mocks; use t::lib::TestBuilder; diff --git a/t/db_dependent/Sitemapper.t b/t/db_dependent/Sitemapper.t index fe559c1308..ae3dbeba3f 100755 --- a/t/db_dependent/Sitemapper.t +++ b/t/db_dependent/Sitemapper.t @@ -21,7 +21,7 @@ use Modern::Perl; use File::Basename; use File::Path; use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Test::MockModule; use Test::More tests => 16; use Carp qw/croak carp/; diff --git a/t/db_dependent/StockRotationItems.t b/t/db_dependent/StockRotationItems.t index bce7728566..715f78a068 100755 --- a/t/db_dependent/StockRotationItems.t +++ b/t/db_dependent/StockRotationItems.t @@ -22,7 +22,7 @@ use Modern::Perl; use DateTime; use DateTime::Duration; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Item::Transfer; use Test::Warn; diff --git a/t/db_dependent/Template/Plugin/KohaDates.t b/t/db_dependent/Template/Plugin/KohaDates.t index e40c79565e..5d7300c6f5 100755 --- a/t/db_dependent/Template/Plugin/KohaDates.t +++ b/t/db_dependent/Template/Plugin/KohaDates.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Test::MockModule; use Test::More tests => 9; diff --git a/t/db_dependent/Upload.t b/t/db_dependent/Upload.t index 9d535dd2be..8c672ea199 100755 --- a/t/db_dependent/Upload.t +++ b/t/db_dependent/Upload.t @@ -12,8 +12,7 @@ use t::lib::TestBuilder; use C4::Context; use Koha::Database; -use Koha::DateUtils; -use Koha::UploadedFile; +use Koha::DateUtils qw( dt_from_string ); use Koha::UploadedFiles; use Koha::Uploader; diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t index d349b7b39b..443f97ad1e 100755 --- a/t/db_dependent/Virtualshelves.t +++ b/t/db_dependent/Virtualshelves.t @@ -6,7 +6,7 @@ use DateTime::Duration; use C4::Context; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Virtualshelves; use Koha::Virtualshelfshares; use Koha::Virtualshelfcontents; diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t index abd32a4629..404b2a7190 100755 --- a/t/db_dependent/api/v1/checkouts.t +++ b/t/db_dependent/api/v1/checkouts.t @@ -29,7 +29,7 @@ use C4::Context; use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $schema = Koha::Database->schema; my $builder = t::lib::TestBuilder->new; diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index 5abba54739..ac18877272 100755 --- a/t/db_dependent/api/v1/holds.t +++ b/t/db_dependent/api/v1/holds.t @@ -32,7 +32,7 @@ use C4::Reserves qw( AddReserve CanItemBeReserved CanBookBeReserved ); use C4::Items; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Biblios; use Koha::Biblioitems; use Koha::Items; diff --git a/t/db_dependent/cronjobs/advance_notices_digest.t b/t/db_dependent/cronjobs/advance_notices_digest.t index 3fa10ec8df..b912f2a631 100755 --- a/t/db_dependent/cronjobs/advance_notices_digest.t +++ b/t/db_dependent/cronjobs/advance_notices_digest.t @@ -25,7 +25,7 @@ use t::lib::Mocks; use File::Spec; use File::Basename; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $scriptDir = dirname(File::Spec->rel2abs( __FILE__ )); diff --git a/t/db_dependent/rollingloans.t b/t/db_dependent/rollingloans.t index f72fa9fcbf..c997cc90fa 100755 --- a/t/db_dependent/rollingloans.t +++ b/t/db_dependent/rollingloans.t @@ -5,7 +5,7 @@ use C4::Context; use C4::Circulation qw( CanBookBeIssued AddIssue AddReturn ); use C4::Members; use C4::Items; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use Koha::Patrons; use t::lib::TestBuilder; diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl index e4a409cb68..45f6d17a2a 100755 --- a/tools/additional-contents.pl +++ b/tools/additional-contents.pl @@ -29,7 +29,8 @@ use C4::Koha; use C4::Context; use C4::Output qw(output_html_with_http_headers); use C4::Languages qw(getTranslatedLanguages); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); + use Koha::AdditionalContents; my $cgi = CGI->new; -- 2.20.1