@@ -, +, @@ --- ...92_add_AutomaticConfirmTransfer_preference.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../modules/admin/preferences/circulation.pref | 6 ++++++ .../prog/en/modules/circ/returns.tt | 10 ++++++++++ 4 files changed, 33 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_29792_add_AutomaticConfirmTransfer_preference.pl --- a/installer/data/mysql/atomicupdate/bug_29792_add_AutomaticConfirmTransfer_preference.pl +++ a/installer/data/mysql/atomicupdate/bug_29792_add_AutomaticConfirmTransfer_preference.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "29792", + description => "Add AutomaticConfirmTransfer system 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 + ('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo') + }); + # Print useful stuff here + say $out "AutomaticConfirmTransfer system preference added"; + }, +}; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -81,6 +81,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'), ('AutoLocation','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses','YesNo'), ('AutomaticItemReturn','1',NULL,'If ON, Koha will automatically set up a transfer of this item to its homebranch','YesNo'), +('AutomaticWrongTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'), ('autoMemberNum','0','','If ON, patron number is auto-calculated','YesNo'), ('AutoRemoveOverduesRestrictions','0',NULL,'Defines whether an OVERDUES debarment should be lifted automatically if all overdue items are returned by the patron.','YesNo'), ('AutoRenewalNotices','cron','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -657,6 +657,12 @@ Circulation: 1: "Block" 0: "Don't block" - staff from continuing to checkin items when a transfer is triggered. + - + - pref: AutomaticConfirmTransfer + choices: + 1: "Do" + 0: "Don't" + - automatically confirm a transfer when the modal is dismissed without clicking 'Yes'. - - pref: StoreLastBorrower default: 0 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1368,6 +1368,16 @@ window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&print=checkinslip", "printwindow"); }); + [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %] + $("#wrong-transfer-modal").on('hidden.bs.modal',function(){ + $("#wrongtransferform").submit(); + }); + [% IF (transfer) %] + $("#item-transfer-modal").on('hidden.bs.modal',function(){ + $("#mainform").submit(); + }); + [% END %] + [% END %] }); [% END %] --