Bugzilla – Attachment 159591 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: Fix ciruclation rule dates being overwritten
Bug-35341-Fix-ciruclation-rule-dates-being-overwri.patch (text/plain), 3.94 KB, created by
Matt Blenkinsop
on 2023-12-05 16:08:05 UTC
(
hide
)
Description:
Bug 35341: Fix ciruclation rule dates being overwritten
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-12-05 16:08:05 UTC
Size:
3.94 KB
patch
obsolete
>From c71039bb77b0f73c9fa9c7ceaedace51a41f2432 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Tue, 5 Dec 2023 16:06:04 +0000 >Subject: [PATCH] Bug 35341: Fix ciruclation rule dates being overwritten > >This patch correctly sets the values of the date fields so that they are not overwritten when only one is amended. > >It also amends the collumn indexes being used in the click event as new columns have been added without these being updated > >Test plan: >1) Navigate to Administration > Circulation and fine rules >2) Add a new circulation rule for a category of your choice >3) For the "All" rule, add the date 31/12/2023 to both the Hard due date and No automatic renewal after (hard limit) (NARAHL) columns and save >4) Now edit the rule that you created. >5) Change the two columns above to 01/12/2023 and click save >6) Edit the rule again and change the Hard due date to 15/12/2023. Click save >7) Note that the date for your rule in the NARAHL has changed to 31/12/2023 despite not being edited >8) Click edit again, and change the NARAHL date to 15/12/2023 and save. >9) This time the date in Hard due date will have changed to 31/12/2023 >10) Apply patch >11) Edit the dates individually a few times and this time your rule should update correctly >--- > .../prog/en/modules/admin/smart-rules.tt | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 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 74c962503b..c3d8446cbd 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" class="flatpickr" /> >+ <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate | html %]"class="flatpickr" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </td> > <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td> >@@ -1504,9 +1504,20 @@ > $(current_column).find("input[type='text']").val(note); > } else if ( i == 9 || i == 26 ) { > // specific processing for Hard due date and No automatic renewal after (hard limit) >+ var dateCheck = /\d{1,2}\/\d{1,2}\/\d{2,4}/ > if (itm_text) { >- input_values = itm_text.split(' '); >- $(current_column).find("input[type='text']").val( input_values[1] ); >+ if(i == 9) { >+ var input_values = itm_text.split(' '); >+ var date = input_values[1]; >+ itm_text = dateCheck.test(date) ? date : '' >+ } >+ var formatted_date = flatpickr.formatDate(new Date(itm_text), "Y-m-d") >+ $(current_column).find("input[type='hidden']").val(formatted_date); >+ $(current_column).find("input[type='text']").val(itm_text); >+ $(current_column).find("select").val(itm_code); >+ } else { >+ $(current_column).find("input[type='hidden']").val(''); >+ $(current_column).find("input[type='text']").val(''); > $(current_column).find("select").val(itm_code); > } > } else if ( i == 16 ) { >-- >2.37.1 (Apple Git-137.1)
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