Bugzilla – Attachment 155649 Details for
Bug 16223
Automatically remove any borrower debarments after a payment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16223: Require fee limit only if "Lift after payment" is set as "Yes"
Bug-16223-Require-fee-limit-only-if-Lift-after-pay.patch (text/plain), 5.33 KB, created by
Marcel de Rooy
on 2023-09-15 09:19:17 UTC
(
hide
)
Description:
Bug 16223: Require fee limit only if "Lift after payment" is set as "Yes"
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-09-15 09:19:17 UTC
Size:
5.33 KB
patch
obsolete
>From 08401b41728cfad2c4e18fbd7073e707f7ff93fd Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Fri, 17 Mar 2023 09:55:39 +0200 >Subject: [PATCH] Bug 16223: Require fee limit only if "Lift after payment" is > set as "Yes" >Content-Type: text/plain; charset=utf-8 > >Fee limit should only be required if restriction is >meant to be lifted after payment. This patch makes >"Fee limit" input field required based on value of >"Lift after payment" select field. > >To test: >1. Create a new restriction. >2. "Lift after payment" should be set as "No". >3. Change value as "Yes". >=> "Fee limit" should now have "Required" text >after input field. >4. Try to save restriction. >=> Text "This field is required" should be >displayed after "Fee limit". >5. Change "Lift after payment" back to "No". >=> Both texts should now be lifted. > >Also test with existing restriction and make sure >restrictions are still saved without problems. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/admin/restrictions.tt | 38 ++++++++++++------- > 1 file changed, 24 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >index 0acd70ca68..93cf49f5e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >@@ -115,16 +115,19 @@ > </li> > <li> > <label for="lift_after_payment" class="required">Lift after payment: </label> >- <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" /> >- <option value="1" selected="selected">Yes</option> >+ <select type="text" name="lift_after_payment" id="lift_after_payment"/> >+ [% IF restriction.lift_after_payment %] > <option value="0">No</option> >+ <option value="1" selected="selected">Yes</option> >+ [% ELSE %] >+ <option value="0" selected="selected">No</option> >+ <option value="1">Yes</option> >+ [% END %] > </select> >- <span class="required">Required</span> > </li> > <li> >- <label for="fee_limit" class="required">Fee limit: </label> >- <input type="text" value="[% restriction.fee_limit | html %]" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" class="required" required="required" /> >- <span class="required">Required</span> >+ <label for="fee_limit">Fee limit: </label> >+ <input type="text" value="[% restriction.fee_limit | html %]" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" /> > </li> > [% ELSE %] > <li> >@@ -138,17 +141,15 @@ > <span class="required">Required</span> > </li> > <li> >- <label for="lift_after_payment" class="required">Lift after payment: </label> >- <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" /> >- <option value="1" selected="selected">Yes</option> >- <option value="0">No</option> >+ <label for="lift_after_payment">Lift after payment: </label> >+ <select type="text" name="lift_after_payment" id="lift_after_payment" /> >+ <option value="0" selected="selected">No</option> >+ <option value="1">Yes</option> > </select> >- <span class="required">Required</span> > </li> > <li> >- <label for="fee_limit" class="required">Fee limit: </label> >- <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" class="required" required="required" /> >- <span class="required">Required</span> >+ <label for="fee_limit">Fee limit: </label> >+ <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" /> > </li> > [% END %] > </ol> >@@ -257,6 +258,15 @@ > [% ex.code | $raw %]: '[% ex.display_text | $raw %]', > [% END %] > }; >+ >+ //Require fee limit if "Lift after payment" is set true >+ $("#lift_after_payment").on("change", function(){ >+ if($(this).val() == 1){ >+ $("#fee_limit").prop("required",true).after('<span class="required">Required</span>'); >+ } else { >+ $("#fee_limit").prop("required",false).nextAll().remove(); >+ } >+ }); > </script> > [% Asset.js("js/restrictiontypes.js") | $raw %] > [% 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 16223
:
50078
|
50084
|
99697
|
99698
|
104399
|
104400
|
114272
|
114273
|
118526
|
118572
|
118574
|
118575
|
122768
|
122769
|
127252
|
128005
|
132284
|
132285
|
132286
|
132287
|
143388
|
143389
|
143390
|
143462
|
143670
|
143671
|
143672
|
143688
|
143689
|
143690
|
143765
|
143766
|
143767
|
143768
|
143769
|
143770
|
143936
|
146051
|
146052
|
146053
|
146054
|
146055
|
146056
|
146057
|
148307
|
148308
|
148309
|
148310
|
148311
|
148312
|
148313
|
150024
|
150025
|
150026
|
150027
|
150028
|
150029
|
153024
|
153025
|
153026
|
153027
|
153028
|
153029
|
155644
|
155645
|
155646
|
155647
|
155648
|
155649
|
155650
|
156841
|
156842
|
156843
|
156844
|
156845
|
156846
|
156847
|
156848
|
156849
|
156850