@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_31157.pl | 15 +++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/circulation.pref | 8 ++++++++ misc/cronjobs/overdue_notices.pl | 1 + 4 files changed, 25 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_31157.pl --- a/installer/data/mysql/atomicupdate/bug_31157.pl +++ a/installer/data/mysql/atomicupdate/bug_31157.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "31157", + description => "Add OverdueNoticeFrom preference", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('OverdueNoticeFrom', 'cron', 'cron|item-issuebranch|item-homebranch', 'Use the choice as the from address when generating overdue notices', 'Choice') + }); + }, +}; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -519,6 +519,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OverDrivePasswordRequired','0',NULL,'Does the library require passwords for OverDrive SIP authentication','YesNo'), ('OverDriveUsername','cardnumber','cardnumber|userid','Which patron information should be passed as OverDrive username','Choice'), ('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'), +('OverdueNoticeFrom', 'cron', 'cron|item-issuebranch|item-homebranch', 'Use the choice as the from address when generating overdue notices', 'Choice'), ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), ('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'), ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -407,6 +407,14 @@ Circulation: 1: "Use calendar" 0: "Ignore calendar" - "when working out the period for overdue notices." + - + - "Use the" + - pref: OverdueNoticeFrom + choices: + cron: "system default" + item-issuebranch: "checkout library" + item-homebranch: "item home library" + - "as the from address when generating overdue notices." - - Include up to - pref: PrintNoticesMaxLines --- a/misc/cronjobs/overdue_notices.pl +++ a/misc/cronjobs/overdue_notices.pl @@ -338,6 +338,7 @@ if ( defined $csvfilename && $csvfilename =~ /^-/ ) { die "--frombranch takes item-homebranch or item-issuebranch only" unless ( $frombranch eq 'item-issuebranch' || $frombranch eq 'item-homebranch' ); +$frombranch = C4::Context->preference('OverdueNoticeFrom') ne 'cron' ? C4::Context->preference('OverdueNoticeFrom') : $frombranch; my $owning_library = ( $frombranch eq 'item-homebranch' ) ? 1 : 0; my @overduebranches = C4::Overdues::GetBranchcodesWithOverdueRules(); # Branches with overdue rules --