Bugzilla – Attachment 162642 Details for
Bug 36175
Checking out items that are booked doesn't quite work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36175: Corrections to reduced due for booked items
Bug-36175-Corrections-to-reduced-due-for-booked-it.patch (text/plain), 4.74 KB, created by
Marcel de Rooy
on 2024-03-01 08:13:34 UTC
(
hide
)
Description:
Bug 36175: Corrections to reduced due for booked items
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-03-01 08:13:34 UTC
Size:
4.74 KB
patch
obsolete
>From f02f22a63578ee0b606a9ab6354d94bdc8a8d97b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 29 Feb 2024 11:28:24 +0000 >Subject: [PATCH] Bug 36175: Corrections to reduced due for booked items >Content-Type: text/plain; charset=utf-8 > >This patch fixes a mistake in the circulation controller such that the >proper reduceddue date is passed to the template when a checkout would >overlap with a booking. > >I also take the oportunity to enhance the functionality to allow >librarians to set their own reduceddue date between now and the hard >reduceddue as required for the existing booking. > >Test plan >1) Set an item to 'bookable' >2) Add a booking to that item for user A for a few days time. >3) Attempt to checkout the item to user B and note the warning that > the item is booked for another user. >4) With the patch applied, a reduced due date of 1 day prior to the > booking should be defaulted to in the displayed date picker. >5) You should be able to select any date between today and the day > before the booking starts >6) Confirm you can checkout with the reduceddue date set. >7) Bonus point, confirm the field is required, so if you try to wipe it > and then checkout, you will be blocked. > >Signed-off-by: Kelly <kelly@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > circ/circulation.pl | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 4 ++++ > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++-- > 3 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 9296d9e642..87d977d72b 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -425,7 +425,7 @@ if (@$barcodes) { > $template_params->{getBarcodeMessageIteminfo} = $item->barcode; > $template_params->{NEEDSCONFIRMATION} = 1; > $confirm_required = 1; >- if ( $needsconfirmation eq 'BOOKED_TO_ANOTHER' ) { >+ if ( $needsconfirmation_key eq 'BOOKED_TO_ANOTHER' ) { > my $reduceddue = > dt_from_string( $$needsconfirmation{$needsconfirmation_key}->start_date )->subtract( days => 1 ); > $template_params->{reduceddue} = $reduceddue; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index f027552053..e3de0dde7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -181,6 +181,10 @@ > options['dateFormat'] = "Y-m-d H:i"; > options['altFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string; > } >+ let maxDate = $(input).data("flatpickr-maxdate"); >+ if( typeof maxDate !== 'undefined' ) { >+ options['maxDate'] = new Date(maxDate); >+ } > > let fp = $(input).flatpickr(options); > >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 979f916cd8..baddf3dc45 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -345,7 +345,7 @@ > [% IF ( INVALID_DATE ) %] > <p> > <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" /> >- <label for="duedatespec">Due date</label> >+ <label for="duedatespec">Due date</label> > </p> > [% ELSE %] > <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" /> >@@ -354,7 +354,7 @@ > [% IF ( BOOKED_TO_ANOTHER ) %] > <p> > <label for="reduceddue">Reducing due date to: <label> >- <input type="text" size="20" id="reudceddue" name="reduceddue" value="[% reduceddue | $KohaDates with_hours => 1 %]" readonly="readonly"> >+ <input type="text" size="20" id="reduceddue" name="reduceddue" value="[% reduceddue | html %]" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-maxdate="[% reduceddue | html %]" required="required"> > </p> > [% END %] > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36175
:
162591
|
162598
| 162642