Bugzilla – Attachment 112628 Details for
Bug 26814
Add onsite_checkout to circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26814: (SMART-RULES GUI) Disable hold rules when on-site option selected
Bug-26814-SMART-RULES-GUI-Disable-hold-rules-when-.patch (text/plain), 3.88 KB, created by
Lari Taskula
on 2020-10-28 03:23:02 UTC
(
hide
)
Description:
Bug 26814: (SMART-RULES GUI) Disable hold rules when on-site option selected
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-10-28 03:23:02 UTC
Size:
3.88 KB
patch
obsolete
>From 11447761d20f00e7c0ad29cfa5b6bef2b668960f Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Wed, 28 Oct 2020 02:44:28 +0000 >Subject: [PATCH] Bug 26814: (SMART-RULES GUI) Disable hold rules when on-site > option selected > >SMART-RULES GUI tag means that this patch will apply before Bug 15522. > >To test: >1. Apply patch >2. Go to Circulation and fine rules in staff client >3. Observe the main circulation rules matrix, observe the following columns: > > Holds allowed (total) > Holds allowed (daily) > Holds per record (count) > On shelf holds allowed > OPAC item level holds > Article requests > >4. Set "On-site checkout" to "No" or "On-site" >5. Observe the columns in step 3, they should now be disabled >6. Set "On-site checkout" to "All" >7. Observe the columns in step 3, they should now be enabled >8. Add a new rule: > > On-site checkout: "On-site" > Current checkouts allowed: 1 > > and click Save. > >9. Find the row you just added and press Edit. >10. Observe the columns in step 3, they should now be disabled >11. Press Edit for any other row where On-site checkout is "All" >12. Observe the columns in step 3, they should now be enabled > >Sponsored-by: The National Library of Finland >--- > .../prog/en/modules/admin/smart-rules.tt | 38 +++++++++++++++++++ > 1 file changed, 38 insertions(+) > >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 b4dc45b48c..b49dad177c 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 >@@ -1013,6 +1013,36 @@ > $(edit_row).find("td:last input[name='clear']").remove(); > } > >+ function disable_onsite_checkout_hold_rules() { >+ var onsite_checkout = $("#edit_row").find("select[name='onsite_checkout']"); >+ >+ var CANNOT_SET_HOLD_RULES_FOR_ONSITE_CHECKOUT = >+ _("Cannot set this rule when on-site checkout is defined"); >+ >+ var hold_related_rule_els = [ >+ $("input#reservesallowed"), >+ $("input#holds_per_record"), >+ $("input#holds_per_day"), >+ $("select#onshelfholds"), >+ $("select#opacitemholds"), >+ $("select#article_requests") >+ ]; >+ >+ // when onsite_checkout is selected (any other value than *), >+ // disable hold related input fields, because it makes no sense >+ // to set hold rules for a specific type of checkout >+ $.each(hold_related_rule_els, function (i, field) { >+ if (onsite_checkout.val() !== "*") { >+ $(field).attr("disabled", "disabled"); >+ $(field).val(""); >+ $(field).after('<span class="hold_rule_disabled error">' + CANNOT_SET_HOLD_RULES_FOR_ONSITE_CHECKOUT + "</span>") >+ } else { >+ $(field).removeAttr("disabled"); >+ $("span.hold_rule_disabled").remove(); >+ } >+ }); >+ } >+ > var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); > > $(document).ready(function() { >@@ -1113,8 +1143,16 @@ > $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); > $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); > $("#default-circulation-rules tr:last td:eq(2) select").prop('disabled', true); >+ >+ disable_onsite_checkout_hold_rules(); >+ > return false; > }); >+ >+ $("select[id='matrixonsite_checkout']").change(function () { >+ disable_onsite_checkout_hold_rules(); >+ }); >+ > $(".clear_edit").on("click",function(e){ > e.preventDefault(); > clear_edit(); >-- >2.17.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 26814
:
112376
|
112377
|
112378
|
112379
|
112380
|
112381
|
112382
|
112383
|
112384
|
112385
|
112608
|
112609
|
112610
|
112611
|
112623
|
112624
|
112625
|
112626
|
112627
|
112628
|
112630
|
112631
|
112632
|
112651
|
112652
|
112653
|
114417
|
114418
|
114419
|
114420
|
114421
|
114422
|
114423
|
114424
|
114425
|
114426
|
114427