Bugzilla – Attachment 160844 Details for
Bug 35341
Circulation rule dates are being overwritten
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35341: Improve processing hard due date and auto renewal date
Bug-35341-Improve-processing-hard-due-date-and-aut.patch (text/plain), 4.63 KB, created by
Marcel de Rooy
on 2024-01-11 13:07:47 UTC
(
hide
)
Description:
Bug 35341: Improve processing hard due date and auto renewal date
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-01-11 13:07:47 UTC
Size:
4.63 KB
patch
obsolete
>From cc27c907d81c447db39ebd0bb5330f2c731b71ae Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 17 Nov 2023 10:18:01 +0000 >Subject: [PATCH] Bug 35341: Improve processing hard due date and auto renewal > date >Content-Type: text/plain; charset=utf-8 > >After quite a struggle, came up with this approach using >flatpickr's parseDate and setDate. Seems to be the best. >The dateformat variable is set in calendar.inc. > >Test plan: >Test edit, save, clear rules, focus on both dates. >Toggle all I18N preference date formats. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/admin/smart-rules.tt | 27 +++++++++++-------- > 1 file changed, 16 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 00de0896bc..0ad2b55cff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -475,7 +475,7 @@ > <option value="0">Exactly on</option> > <option value="1">After</option> > </select> >- <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate | html %]" class="flatpickr" /> >+ <input type="text" size="10" id="hardduedate" name="hardduedate" class="flatpickr" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </td> > <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td> >@@ -508,7 +508,7 @@ > </td> > <td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td> > <td> >- <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit | html %]" class="flatpickr"/> >+ <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" class="flatpickr"/> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </td> > <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td> >@@ -1503,16 +1503,21 @@ > var note = $(this).find("a[name='viewnote']").data("content"); > $(current_column).find("input[type='text']").val(note); > } else if ( i == 9 ) { >- // specific processing for the Hard due date column >- var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); >- var input_value = ''; >- if (typeof select_value === 'undefined'){ >- select_value = '-1'; >- }else { >- input_value = itm_text.split(' ')[1]; >+ // specific processing for Hard due date >+ $(current_column).find("select").val(itm_code); >+ if (itm_text) { >+ input_values = itm_text.split(' '); >+ var fp = $('#hardduedate').flatpickr(); >+ var hardduedate = fp.parseDate( input_values[1], flatpickr_dateformat_string ); >+ if( hardduedate) fp.setDate( hardduedate, 1 ); >+ } >+ } else if ( i == 26 ) { >+ // specific processing for No automatic renewal after (hard limit) >+ if (itm_text) { >+ var fp = $('#no_auto_renewal_after_hard_limit').flatpickr(); >+ var renewdate = fp.parseDate( itm_text, flatpickr_dateformat_string ); >+ if( renewdate) fp.setDate( renewdate, 1 ); > } >- $(current_column).find("input[type='text']").val(input_value); >- $(current_column).find("select").val(select_value); > } else if ( i == 16 ) { > // specific processing for cap_fine_to_replacement_price > var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); >-- >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 35341
:
158980
|
159005
|
159077
|
159591
|
159592
|
159669
|
160830
|
160844
|
160845
|
160850
|
160896
|
160928