Bugzilla – Attachment 158980 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), 6.49 KB, created by
Matt Blenkinsop
on 2023-11-15 12:23:15 UTC
(
hide
)
Description:
Bug 35341: Fix ciruclation rule dates being overwritten
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-11-15 12:23:15 UTC
Size:
6.49 KB
patch
obsolete
>From 83302926754cdc44efdca356d886fbefd6dec968 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 15 Nov 2023 11:14:09 +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, 15 insertions(+), 2 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..55e68aee2c 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 >@@ -284,12 +284,15 @@ > [% IF ( hardduedatecompare == '-1' ) %] > before [% hardduedate | $KohaDates %] > <input type="hidden" name="hardduedatecomparebackup" value="-1" /> >+ <input type="hidden" name="hardduedatebackup" value="[% hardduedate | html %]" /> > [% ELSIF ( hardduedatecompare == '0' ) %] > on [% hardduedate | $KohaDates %] > <input type="hidden" name="hardduedatecomparebackup" value="0" /> >+ <input type="hidden" name="hardduedatebackup" value="[% hardduedate | html %]" /> > [% ELSIF ( hardduedatecompare == '1' ) %] > after [% hardduedate | $KohaDates %] > <input type="hidden" name="hardduedatecomparebackup" value="1" /> >+ <input type="hidden" name="hardduedatebackup" value="[% hardduedate | html %]" /> > [% END %] > [% ELSE %] > <span>None defined</span> >@@ -332,7 +335,10 @@ > [% END %] > </td> > <td>[% no_auto_renewal_after | html %]</td> >- <td>[% no_auto_renewal_after_hard_limit | $KohaDates %]</td> >+ <td> >+ [% no_auto_renewal_after_hard_limit | $KohaDates %] >+ <input type="hidden" name="no_auto_renewal_after_hard_limit_backup" value="[% no_auto_renewal_after_hard_limit | html %]" /> >+ </td> > <td> > [% IF reservesallowed.defined && reservesallowed != '' %] > [% reservesallowed | html %] >@@ -1505,14 +1511,21 @@ > } else if ( i == 9 ) { > // specific processing for the Hard due date column > var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); >+ var hardduedate = $(this).find("input[type='hidden'][name='hardduedatebackup']").val(); > var input_value = ''; > if (typeof select_value === 'undefined'){ > select_value = '-1'; > }else { > input_value = itm_text.split(' ')[1]; > } >+ $(current_column).find("input[type='hidden']").val(hardduedate); > $(current_column).find("input[type='text']").val(input_value); > $(current_column).find("select").val(select_value); >+ } else if ( i == 26 ) { >+ // specific processing for the No automatic renewal after (hard limit) column >+ var date = $(this).find("input[type='hidden'][name='no_auto_renewal_after_hard_limit_backup']").val(); >+ $(current_column).find("input[type='hidden']").val(date); >+ $(current_column).find("input[type='text']").val(itm_text); > } else if ( i == 16 ) { > // specific processing for cap_fine_to_replacement_price > var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); >@@ -1542,7 +1555,7 @@ > // Remove potential previous input added > $(current_column).find("input").remove(); > $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); >- } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 || current_input_id === "holds_pickup_period" ) { >+ } else if ( i == 5 || i == 6 || i == 27 || i == 28 || i == 29 || current_input_id === "holds_pickup_period" ) { > // If the value is not an integer for > // - "Current checkouts allowed" > // - "Current on-site checkouts allowed" >-- >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