diff --git a/circ/circulation.pl b/circ/circulation.pl index d61c4851f2..a6b7416f54 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -629,6 +629,17 @@ if ( $patron ) { ); $template->param( patron_messages => $patron_messages ); + if ( C4::Context->preference("WaitingNotifyAtCheckout") ) { + + #Check for waiting holds + my $waiting_holds = $patron->holds->search( { found => 'W', branchcode => $branch } ); + my @waiting_holds_barcodes = (); + while ( my $hold = $waiting_holds->next ) { + push( @waiting_holds_barcodes, $hold->item->barcode ); + } + + $template->param( waiting_holds_barcodes => \@waiting_holds_barcodes ); + } } my $fast_cataloging = 0; diff --git a/installer/data/mysql/atomicupdate/bug_34668-add_WaitingNotifyAtCheckout_syspref.pl b/installer/data/mysql/atomicupdate/bug_34668-add_WaitingNotifyAtCheckout_syspref.pl new file mode 100644 index 0000000000..d7a8848ed3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_34668-add_WaitingNotifyAtCheckout_syspref.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "34668", + description => "Add syspref WaitingNotifyAtCheckout", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do(q{INSERT IGNORE INTO `systempreferences` (variable,value,options,explanation,type) VALUES('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo') }); + + say $out "Added new system preference 'WaitingNotifyAtCheckout'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 902cf7db2e..4057841a34 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -828,6 +828,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('viewMARC','1','','Allow display of MARC view of bibiographic records','YesNo'), ('virtualshelves','1','','If ON, enables Lists management','YesNo'), ('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'), +('WaitingNotifyAtCheckout','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking out.','YesNo'), ('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'), ('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'), ('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index bae185a1f5..b9169b203f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -97,6 +97,12 @@ Circulation: 1: Notify 0: "Don't notify" - librarians of waiting holds for the patron whose items they are checking in. + - + - pref: WaitingNotifyAtCheckout + choices: + 1: Notify + 0: "Don't notify" + - librarians of waiting holds for the patron whose items they are checking out. - - pref: FilterBeforeOverdueReport choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 54c4da8d89..4cab65fc5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -762,7 +762,11 @@ - + [% IF waiting_holds_barcodes %] + + [% ELSE %] + + [% END %]