From 8c33442645ebf36f602059cdf28146ac79bb500f Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 6 Mar 2015 10:39:19 +0100 Subject: [PATCH] Bug 13647: On-site checkouts - Allow library to specify due date This will remove the restriction that forces the due date for an on-site checkout to the end of the current day. It will still suggest the end of the day, but you will be able to change the date to whatever you want using the datepicker widget. To test: Before applying the patch: - Turn on OnSiteCheckouts and OnSiteCheckoutsForce system preferences - Check the on-site use checkbox and try to set due date manually, it should not be possible - Check out the item and check the due date is set to the end of today - Put a restriction on your patron account and repeat steps, the item checked out should again have a due date at the end of the day > There should be no way to be able to check out an item with a 'custom' due date Apply the patch: - Repeat steps from above, check out - on-site use without a restriction on your account - without changing the due date - with a due date picked with the datepicker - on-site use with a restriction on your account ... see above - no on-site use but with a specified due date - no on-site use, not specifying a due date - Turn off SpecifyDueDate - on-site use with and without restriction should set the due date automatically to the end of the date now, altering the due date should not be possible. --- circ/circulation.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 982669c..22c5e24 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -160,7 +160,7 @@ else { my ($datedue,$invalidduedate); my $duedatespec_allow = C4::Context->preference('SpecifyDueDate'); -if( $onsite_checkout ) { +if( $onsite_checkout && !$duedatespec_allow ) { $datedue = output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' }); $datedue .= ' 23:59:00'; } elsif( $duedatespec_allow ) { 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 c1613ad..0576020 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -50,7 +50,9 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); function toggle_onsite_checkout(){ if ( $("#onsite_checkout").attr('checked') ) { $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]") - $("#duedatespec").datetimepicker('destroy'); + [% IF !Koha.Preference('SpecifyDueDate') %] + $("#duedatespec").datetimepicker('destroy'); + [% END %] } else { $("#duedatespec").datetimepicker({ onClose: function(dateText, inst) { $("#barcode").focus(); }, -- 1.9.1