From bad6752ff1d851935c44490f2fe62feaaa45830a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 25 Mar 2019 19:04:58 +0000 Subject: [PATCH] Bug 22577: Set 'cron' user for cron scripts --- Koha/Cron.pm | 16 ++++++++++++++++ misc/cronjobs/advance_notices.pl | 2 +- .../automatic_item_modification_by_age.pl | 1 + misc/cronjobs/automatic_renewals.pl | 2 +- misc/cronjobs/batch_anonymise.pl | 1 + misc/cronjobs/build_browser_and_cloud.pl | 1 + misc/cronjobs/cart_to_shelf.pl | 1 + misc/cronjobs/check-url-quick.pl | 2 ++ misc/cronjobs/check-url.pl | 2 ++ misc/cronjobs/cleanup_database.pl | 1 + misc/cronjobs/cloud-kw.pl | 4 +++- misc/cronjobs/create_koc_db.pl | 3 ++- .../delete_expired_opac_registrations.pl | 1 + misc/cronjobs/delete_items.pl | 2 ++ misc/cronjobs/delete_patrons.pl | 1 + misc/cronjobs/delete_records_via_leader.pl | 1 + misc/cronjobs/edi_cron.pl | 1 + misc/cronjobs/fines.pl | 1 + misc/cronjobs/gather_print_notices.pl | 1 + misc/cronjobs/holds/auto_unsuspend_holds.pl | 1 + misc/cronjobs/holds/build_holds_queue.pl | 1 + misc/cronjobs/holds/cancel_expired_holds.pl | 1 + misc/cronjobs/holds/cancel_unfilled_holds.pl | 1 + misc/cronjobs/import_webservice_batch.pl | 1 + misc/cronjobs/j2a.pl | 1 + misc/cronjobs/longoverdue.pl | 2 ++ misc/cronjobs/membership_expiry.pl | 1 + misc/cronjobs/merge_authorities.pl | 8 +++++--- misc/cronjobs/notice_unprocessed_suggestions.pl | 1 + misc/cronjobs/overdue_notices.pl | 2 +- misc/cronjobs/process_message_queue.pl | 2 ++ misc/cronjobs/purge_suggestions.pl | 2 ++ misc/cronjobs/reconcile_balances.pl | 2 +- misc/cronjobs/remove_temporary_edifiles.pl | 1 + misc/cronjobs/rss/rss.pl | 2 ++ misc/cronjobs/runreport.pl | 1 + misc/cronjobs/serialsUpdate.pl | 1 + misc/cronjobs/share_usage_with_koha_community.pl | 1 + misc/cronjobs/sitemap.pl | 2 ++ .../social_data/get_report_social_data.pl | 2 ++ misc/cronjobs/social_data/update_social_data.pl | 2 ++ misc/cronjobs/staticfines.pl | 1 + misc/cronjobs/stockrotation.pl | 2 ++ .../thirdparty/TalkingTech_itiva_inbound.pl | 1 + .../thirdparty/TalkingTech_itiva_outbound.pl | 1 + misc/cronjobs/update_totalissues.pl | 2 ++ 46 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 Koha/Cron.pm diff --git a/Koha/Cron.pm b/Koha/Cron.pm new file mode 100644 index 0000000000..5cafe54083 --- /dev/null +++ b/Koha/Cron.pm @@ -0,0 +1,16 @@ +package Koha::Cron; + +use strict; +use warnings; +use utf8; +use feature ':5.10'; + +use C4::Context; + +C4::Context->_new_userenv(1); +C4::Context->set_userenv( + '-1', '-1', undef, 'CRON', 'CRON', undef, + undef, undef, undef, undef, undef +); + +1; diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 91bf352b89..eeb0d7e0a8 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -49,6 +49,7 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Biblio; use C4::Context; use C4::Letters; @@ -223,7 +224,6 @@ END_WARN unless ($confirm) { pod2usage(1); } - cronlogaction(); # The fields that will be substituted into <> diff --git a/misc/cronjobs/automatic_item_modification_by_age.pl b/misc/cronjobs/automatic_item_modification_by_age.pl index 51effd32b1..6f04e5418e 100755 --- a/misc/cronjobs/automatic_item_modification_by_age.pl +++ b/misc/cronjobs/automatic_item_modification_by_age.pl @@ -6,6 +6,7 @@ use Getopt::Long; use Pod::Usage; use JSON; +use Koha::Cron; use C4::Context; use C4::Items; diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl index b50a6d565a..32017c9895 100755 --- a/misc/cronjobs/automatic_renewals.pl +++ b/misc/cronjobs/automatic_renewals.pl @@ -52,6 +52,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Circulation; use C4::Context; use C4::Log; @@ -67,7 +68,6 @@ GetOptions( ) || pod2usage(1); pod2usage(0) if $help; - cronlogaction(); my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 }); diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl index 013f7d1179..654f61cabf 100755 --- a/misc/cronjobs/batch_anonymise.pl +++ b/misc/cronjobs/batch_anonymise.pl @@ -29,6 +29,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use Koha::Patrons; use Date::Calc qw( diff --git a/misc/cronjobs/build_browser_and_cloud.pl b/misc/cronjobs/build_browser_and_cloud.pl index d5e0d1a8f5..a72c1f95e2 100755 --- a/misc/cronjobs/build_browser_and_cloud.pl +++ b/misc/cronjobs/build_browser_and_cloud.pl @@ -10,6 +10,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Koha; use C4::Context; use C4::Biblio; diff --git a/misc/cronjobs/cart_to_shelf.pl b/misc/cronjobs/cart_to_shelf.pl index 965f7dd0d4..0e35c96b44 100755 --- a/misc/cronjobs/cart_to_shelf.pl +++ b/misc/cronjobs/cart_to_shelf.pl @@ -28,6 +28,7 @@ cart_to_shelf.pl cron script to set items with location of CART to original she use strict; use warnings; +use Koha::Cron; use C4::Items qw/ CartToShelf /; use C4::Log; diff --git a/misc/cronjobs/check-url-quick.pl b/misc/cronjobs/check-url-quick.pl index 22d2dfe461..5b596f09df 100755 --- a/misc/cronjobs/check-url-quick.pl +++ b/misc/cronjobs/check-url-quick.pl @@ -20,6 +20,8 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Biblio; use AnyEvent; diff --git a/misc/cronjobs/check-url.pl b/misc/cronjobs/check-url.pl index 5c0957b060..dc916c4857 100755 --- a/misc/cronjobs/check-url.pl +++ b/misc/cronjobs/check-url.pl @@ -78,6 +78,7 @@ use strict; use warnings; use LWP::UserAgent; use HTTP::Request; +use Koha::Cron; use C4::Biblio; @@ -147,6 +148,7 @@ use Carp; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Context; diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 3e6c504532..bc2404fb90 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -34,6 +34,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Search; use C4::Search::History; diff --git a/misc/cronjobs/cloud-kw.pl b/misc/cronjobs/cloud-kw.pl index 96864156ef..443218387b 100755 --- a/misc/cronjobs/cloud-kw.pl +++ b/misc/cronjobs/cloud-kw.pl @@ -25,6 +25,8 @@ use Carp; use YAML::Syck; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Log; @@ -42,7 +44,7 @@ sub usage { exit; } -usage() if $help || !$conf; +usage() if $help || !$conf; cronlogaction(); diff --git a/misc/cronjobs/create_koc_db.pl b/misc/cronjobs/create_koc_db.pl index 2b5b33aab9..d6d158e9c8 100755 --- a/misc/cronjobs/create_koc_db.pl +++ b/misc/cronjobs/create_koc_db.pl @@ -94,6 +94,8 @@ $|++; use DBI; use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Context; use English qw(-no_match_vars); @@ -118,7 +120,6 @@ GetOptions( pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; - my %wanted_borrowers_columns = map { $_ => 1 } qw/borrowernumber cardnumber surname firstname address city phone dateofbirth/; my %wanted_issues_columns = map { $_ => 1 } qw/borrowernumber date_due itemcallnumber title itemtype/; diff --git a/misc/cronjobs/delete_expired_opac_registrations.pl b/misc/cronjobs/delete_expired_opac_registrations.pl index 66f9e165e8..47950b4335 100755 --- a/misc/cronjobs/delete_expired_opac_registrations.pl +++ b/misc/cronjobs/delete_expired_opac_registrations.pl @@ -28,6 +28,7 @@ BEGIN { eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib }; } +use Koha::Cron; use C4::Context; my $help; diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl index 78a9b35b8d..bccc0e02ef 100755 --- a/misc/cronjobs/delete_items.pl +++ b/misc/cronjobs/delete_items.pl @@ -1,6 +1,8 @@ #! /usr/bin/perl use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Items; use C4::Circulation; diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl index cb59465df4..5f672133be 100755 --- a/misc/cronjobs/delete_patrons.pl +++ b/misc/cronjobs/delete_patrons.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Members; use Koha::DateUtils; use Koha::Patrons; diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index 41b22bb7cb..11dc33d4e5 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/misc/cronjobs/delete_records_via_leader.pl @@ -33,6 +33,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::Biblio; use C4::Items; use Koha::Database; diff --git a/misc/cronjobs/edi_cron.pl b/misc/cronjobs/edi_cron.pl index c23341ad26..dfc1a2e11e 100755 --- a/misc/cronjobs/edi_cron.pl +++ b/misc/cronjobs/edi_cron.pl @@ -29,6 +29,7 @@ use utf8; # can be run as frequently as required # log messages are appended to logdir/editrace.log +use Koha::Cron; use C4::Context; use Log::Log4perl qw(:easy); use Koha::Database; diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index 89ad4a2d3c..ac74adc75b 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -30,6 +30,7 @@ use strict; use warnings; use 5.010; +use Koha::Cron; use C4::Context; use C4::Overdues; use Getopt::Long; diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index ca99635346..a0c85c894a 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -10,6 +10,7 @@ BEGIN { } use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy +use Koha::Cron; use C4::Context; use C4::Debug; use C4::Letters; diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl index d17dfb55b0..83d5d60012 100755 --- a/misc/cronjobs/holds/auto_unsuspend_holds.pl +++ b/misc/cronjobs/holds/auto_unsuspend_holds.pl @@ -29,6 +29,7 @@ BEGIN { # cancel all expired hold requests +use Koha::Cron; use C4::Reserves; use C4::Log; diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index be50de705e..370a9da49a 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/misc/cronjobs/holds/build_holds_queue.pl @@ -15,6 +15,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::HoldsQueue qw(CreateQueue); use C4::Log; diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl index f721553bb5..6de289b844 100755 --- a/misc/cronjobs/holds/cancel_expired_holds.pl +++ b/misc/cronjobs/holds/cancel_expired_holds.pl @@ -29,6 +29,7 @@ BEGIN { # cancel all expired hold requests +use Koha::Cron; use C4::Reserves; use C4::Log; diff --git a/misc/cronjobs/holds/cancel_unfilled_holds.pl b/misc/cronjobs/holds/cancel_unfilled_holds.pl index 8c7f928ae0..0cae7fb029 100755 --- a/misc/cronjobs/holds/cancel_unfilled_holds.pl +++ b/misc/cronjobs/holds/cancel_unfilled_holds.pl @@ -28,6 +28,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::Reserves; use C4::Log; use Koha::Holds; diff --git a/misc/cronjobs/import_webservice_batch.pl b/misc/cronjobs/import_webservice_batch.pl index 0e1384f827..55de9be2bb 100755 --- a/misc/cronjobs/import_webservice_batch.pl +++ b/misc/cronjobs/import_webservice_batch.pl @@ -31,6 +31,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::ImportBatch; my ($help, $framework); diff --git a/misc/cronjobs/j2a.pl b/misc/cronjobs/j2a.pl index ba90ad0ccd..4fb22fa05d 100755 --- a/misc/cronjobs/j2a.pl +++ b/misc/cronjobs/j2a.pl @@ -26,6 +26,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Members; use Getopt::Long; diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index f895f6d451..82d13b1509 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -33,6 +33,8 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } + +use Koha::Cron; use C4::Context; use C4::Items; use C4::Circulation qw/LostItem MarkIssueReturned/; diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index 1b6ea81d43..3ce0537016 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -126,6 +126,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Letters; use C4::Log; diff --git a/misc/cronjobs/merge_authorities.pl b/misc/cronjobs/merge_authorities.pl index 4682694433..105b1eff9c 100755 --- a/misc/cronjobs/merge_authorities.pl +++ b/misc/cronjobs/merge_authorities.pl @@ -5,6 +5,7 @@ use Getopt::Long; use Pod::Usage; use Time::HiRes qw(gettimeofday); +use Koha::Cron; use C4::AuthoritiesMarc; use Koha::Authority::MergeRequests; @@ -19,9 +20,10 @@ GetOptions( ); $|=1; # flushes output -if( $params->{batch} ) { - handle_batch( $params ); -} else { +if ( $params->{batch} ) { + handle_batch($params); +} +else { pod2usage(1); } diff --git a/misc/cronjobs/notice_unprocessed_suggestions.pl b/misc/cronjobs/notice_unprocessed_suggestions.pl index 598ef5a4b4..fa79e8999a 100755 --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ b/misc/cronjobs/notice_unprocessed_suggestions.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Budgets qw( GetBudget ); use C4::Suggestions qw( GetUnprocessedSuggestions ); use Koha::Libraries; diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 8c42335c2c..8c8f6a03ce 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -34,6 +34,7 @@ use Text::CSV_XS; use DateTime; use DateTime::Duration; +use Koha::Cron; use C4::Context; use C4::Letters; use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); @@ -325,7 +326,6 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; - cronlogaction() unless $test_mode; if ( defined $csvfilename && $csvfilename =~ /^-/ ) { diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index 3e0ef5173a..c78d4c0892 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -25,6 +25,8 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } + +use Koha::Cron; use C4::Letters; use C4::Log; use Getopt::Long; diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl index 58a9a1dc12..55536577da 100755 --- a/misc/cronjobs/purge_suggestions.pl +++ b/misc/cronjobs/purge_suggestions.pl @@ -28,6 +28,8 @@ BEGIN { use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Suggestions; use C4::Log; use C4::Context; diff --git a/misc/cronjobs/reconcile_balances.pl b/misc/cronjobs/reconcile_balances.pl index 1bd9dc277e..8ff7e8597a 100755 --- a/misc/cronjobs/reconcile_balances.pl +++ b/misc/cronjobs/reconcile_balances.pl @@ -62,6 +62,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Log; use Koha::Account::Lines; @@ -76,7 +77,6 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; - cronlogaction(); my @patron_ids = map { $_->borrowernumber } Koha::Account::Lines->search( diff --git a/misc/cronjobs/remove_temporary_edifiles.pl b/misc/cronjobs/remove_temporary_edifiles.pl index e799ee5b2e..a38c911285 100755 --- a/misc/cronjobs/remove_temporary_edifiles.pl +++ b/misc/cronjobs/remove_temporary_edifiles.pl @@ -2,6 +2,7 @@ use strict; use warnings; +use Koha::Cron; use C4::Context; # this script will remove those older than 5 days diff --git a/misc/cronjobs/rss/rss.pl b/misc/cronjobs/rss/rss.pl index 60e34fb04d..f9c512543b 100755 --- a/misc/cronjobs/rss/rss.pl +++ b/misc/cronjobs/rss/rss.pl @@ -28,6 +28,8 @@ use Modern::Perl; use Template; + +use Koha::Cron; use C4::Context; use Time::Local; use POSIX; diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index c89a6d4844..a673a5bcb0 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -20,6 +20,7 @@ use Modern::Perl; +use Koha::Cron; use C4::Reports::Guided; # 0.12 use Koha::Reports; use C4::Context; diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl index a478476981..6bf40c1f47 100755 --- a/misc/cronjobs/serialsUpdate.pl +++ b/misc/cronjobs/serialsUpdate.pl @@ -28,6 +28,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Debug; use C4::Serials; diff --git a/misc/cronjobs/share_usage_with_koha_community.pl b/misc/cronjobs/share_usage_with_koha_community.pl index 9039558302..3173ab40a8 100755 --- a/misc/cronjobs/share_usage_with_koha_community.pl +++ b/misc/cronjobs/share_usage_with_koha_community.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Context; use C4::UsageStats; use C4::Log; diff --git a/misc/cronjobs/sitemap.pl b/misc/cronjobs/sitemap.pl index 80c01fdd03..909ad6fed2 100755 --- a/misc/cronjobs/sitemap.pl +++ b/misc/cronjobs/sitemap.pl @@ -23,6 +23,8 @@ use Modern::Perl; use utf8; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Biblio; use Koha::Sitemapper; diff --git a/misc/cronjobs/social_data/get_report_social_data.pl b/misc/cronjobs/social_data/get_report_social_data.pl index 89d6b35061..5bb9867485 100755 --- a/misc/cronjobs/social_data/get_report_social_data.pl +++ b/misc/cronjobs/social_data/get_report_social_data.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use Modern::Perl; + +use Koha::Cron; use C4::SocialData; my $results = C4::SocialData::get_report; diff --git a/misc/cronjobs/social_data/update_social_data.pl b/misc/cronjobs/social_data/update_social_data.pl index 53058a75b2..81bc1d006d 100755 --- a/misc/cronjobs/social_data/update_social_data.pl +++ b/misc/cronjobs/social_data/update_social_data.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use Modern::Perl; + +use Koha::Cron; use C4::Context; use C4::SocialData; diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl index 5803c89a2a..e947eb105d 100755 --- a/misc/cronjobs/staticfines.pl +++ b/misc/cronjobs/staticfines.pl @@ -37,6 +37,7 @@ BEGIN { use Date::Calc qw/Date_to_Days/; +use Koha::Cron; use C4::Context; use C4::Circulation; use C4::Overdues; diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl index 083c14766a..d178ed8204 100755 --- a/misc/cronjobs/stockrotation.pl +++ b/misc/cronjobs/stockrotation.pl @@ -109,6 +109,8 @@ database updates have been performed."). use Modern::Perl; use Getopt::Long qw/HelpMessage :config gnu_getopt/; + +use Koha::Cron; use C4::Context; use C4::Letters; use Koha::StockRotationRotas; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl index 1a70c4ae90..abf81cb8c5 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl @@ -31,6 +31,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::Context; sub usage { diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index d1ff3925fd..216f39d543 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -31,6 +31,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::Context; use C4::Items; use C4::Letters; diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl index affa2a7e34..667b5ac8e0 100755 --- a/misc/cronjobs/update_totalissues.pl +++ b/misc/cronjobs/update_totalissues.pl @@ -30,6 +30,8 @@ BEGIN { use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Context; use C4::Biblio; use C4::Log; -- 2.20.1