From 755b76e2cfa3088928d161cdf7f0fa33700209a6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 22 Apr 2024 16:00:09 +0000 Subject: [PATCH] Bug 36668: Excessive whitespace/newlines in circulation rules editor may cause slow loads with large rules sets Simply put we have a lot of SET lines and such in our circ rules editor template. For large rule sets all the newlines add up and can balloon the rendered html size to many megabytes! We should add a newline chomper to these lines. 1) Generate a large number of circ rules with the following perl script use Koha::CirculationRules; use Koha::Patron::Categories; use Koha::ItemTypes; use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new(); $builder->build( { source => 'Category' } ) for 0 .. 80; $builder->build( { source => 'Itemtype' } ) for 0 .. 80; C4::Context->dbh->do(" INSERT IGNORE INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value ) SELECT NULL, categories.categorycode, itemtypes.itemtype, 'issuelength', 5 FROM categories JOIN itemtypes;" ); 2) Open the network debugging on your web browser 3) Load smart-rules.pl 4) Notice the size of the file 5) Apply this patch 6) Restart all the things! 7) Reload smart-rules.pl 8) Note the file size has been drastically reduced! Signed-off-by: Pedro Amorim --- .../prog/en/modules/admin/smart-rules.tt | 756 +++++++++--------- 1 file changed, 378 insertions(+), 378 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 6e792e0cc0..54101e62cd 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 @@ -1,44 +1,44 @@ -[% USE raw %] -[% USE Asset %] -[% USE Koha %] -[% USE KohaDates %] -[% USE Branches %] -[% USE Categories %] -[% USE ItemTypes %] -[% USE CirculationRules %] -[% USE Price %] +[%- USE raw %] +[%- USE Asset %] +[%- USE Koha %] +[%- USE KohaDates %] +[%- USE Branches %] +[%- USE Categories %] +[%- USE ItemTypes %] +[%- USE CirculationRules %] +[%- USE Price %] [% PROCESS 'i18n.inc' %] -[% SET footerjs = 1 %] +[%- SET footerjs = 1 %] -[% SET branchcode = humanbranch || undef %] +[%- SET branchcode = humanbranch || undef %] -[% SET categorycodes = used_categorycodes %] -[% SET itemtypes = used_itemtypes %] +[%- SET categorycodes = used_categorycodes %] +[%- SET itemtypes = used_itemtypes %] [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] [% t("Circulation and fine rules") | html %] › [% t("Administration") | html %] › [% t("Koha") | html %] -[% END %] +[%- END %] [% INCLUDE 'doc-head-close.inc' %] [% WRAPPER 'header.inc' %] [% INCLUDE 'prefs-admin-search.inc' %] -[% END %] +[%- END %] [% WRAPPER 'sub-header.inc' %] [% WRAPPER breadcrumbs %] [% WRAPPER breadcrumb_item %] Administration - [% END %] + [%- END %] [% WRAPPER breadcrumb_item bc_active= 1 %] Circulation and fine rules - [% END %] - [% END #/ WRAPPER breadcrumbs %] -[% END #/ WRAPPER sub-header.inc %] + [%- END %] + [%- END #/ WRAPPER breadcrumbs %] +[%- END #/ WRAPPER sub-header.inc %]
@@ -46,11 +46,11 @@
[% INCLUDE 'messages.inc' %]

- [% IF humanbranch %] + [%- IF humanbranch %] Defining circulation and fine rules for "[% Branches.GetName( humanbranch ) | html %]" - [% ELSE %] + [%- ELSE %] Defining circulation and fine rules for all libraries - [% END %] + [%- END %]

@@ -82,7 +82,7 @@ [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %] - [% IF ( definedbranch ) %] + [%- IF ( definedbranch ) %]
[% INCLUDE 'csrf-token.inc' %] @@ -93,8 +93,8 @@
- [% END %] - [% END %] + [%- END %] + [%- END %]
@@ -128,9 +128,9 @@ Max. suspension duration (day) Suspension charging interval Renewals allowed (count) - [% IF Koha.Preference('UnseenRenewals') %] + [%- IF Koha.Preference('UnseenRenewals') %] Unseen renewals allowed (count) - [% END %] + [%- END %] Renewal period No renewal before No automatic renewal before @@ -143,118 +143,118 @@ On shelf holds allowed OPAC item level holds Holds pickup period (day) - [% IF Koha.Preference('ArticleRequests') %] + [%- IF Koha.Preference('ArticleRequests') %] Article requests - [% END %] + [%- END %] Rental discount (%) - [% IF Koha.Preference('UseRecalls') %] + [%- IF Koha.Preference('UseRecalls') %] Recalls allowed (total) Recalls per record (count) On shelf recalls allowed Recall due date interval (day) Recall overdue fine amount Recall pickup period (day) - [% END %] + [%- END %] Actions - [% SET row_count = 0 %] + [%- SET row_count = 0 %] [% FOREACH c IN categorycodes %] - [% SET c = '' UNLESS c.defined %] + [%- SET c = '' UNLESS c.defined %] [% FOREACH i IN itemtypes %] - [% SET i = '' UNLESS i.defined %] - [% SET note = all_rules.$c.$i.note %] - [% SET maxissueqty = all_rules.$c.$i.maxissueqty %] - [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %] - [% SET issuelength = all_rules.$c.$i.issuelength %] - [% SET daysmode = all_rules.$c.$i.daysmode %] - [% SET lengthunit = all_rules.$c.$i.lengthunit %] - [% SET hardduedate = all_rules.$c.$i.hardduedate %] - [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %] - [% SET fine = all_rules.$c.$i.fine %] - [% SET chargeperiod = all_rules.$c.$i.chargeperiod %] - [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %] - [% SET firstremind = all_rules.$c.$i.firstremind %] - [% SET overduefinescap = all_rules.$c.$i.overduefinescap %] - [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %] - [% SET finedays = all_rules.$c.$i.finedays %] - [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %] - [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %] - [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %] - [% SET unseenrenewalsallowed = all_rules.$c.$i.unseen_renewals_allowed %] - [% SET renewalperiod = all_rules.$c.$i.renewalperiod %] - [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %] - [% SET noautorenewalbefore = all_rules.$c.$i.noautorenewalbefore %] - [% SET auto_renew = all_rules.$c.$i.auto_renew %] - [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %] - [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %] - [% SET reservesallowed = all_rules.$c.$i.reservesallowed %] - [% SET holds_per_day = all_rules.$c.$i.holds_per_day %] - [% SET holds_per_record = all_rules.$c.$i.holds_per_record %] - [% SET onshelfholds = all_rules.$c.$i.onshelfholds %] - [% SET opacitemholds = all_rules.$c.$i.opacitemholds %] - [% SET article_requests = all_rules.$c.$i.article_requests %] - [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] - [% SET decreaseloanholds = all_rules.$c.$i.decreaseloanholds %] - [% SET recalls_allowed = all_rules.$c.$i.recalls_allowed %] - [% SET recalls_per_record = all_rules.$c.$i.recalls_per_record %] - [% SET on_shelf_recalls = all_rules.$c.$i.on_shelf_recalls %] - [% SET recall_due_date_interval = all_rules.$c.$i.recall_due_date_interval %] - [% SET recall_overdue_fine = all_rules.$c.$i.recall_overdue_fine %] - [% SET recall_shelf_time = all_rules.$c.$i.recall_shelf_time %] - [% SET holds_pickup_period = all_rules.$c.$i.holds_pickup_period %] - - [% SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || unseenrenewalsallowed || renewalperiod || norenewalbefore || noautorenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount || decreaseloanholds || recalls_allowed || recalls_per_record || on_shelf_recalls || recall_due_date_interval || recall_overdue_fine || recall_shelf_time || holds_pickup_period %] - [% IF show_rule %] - [% SET row_count = row_count + 1 %] + [%- SET i = '' UNLESS i.defined %] + [%- SET note = all_rules.$c.$i.note %] + [%- SET maxissueqty = all_rules.$c.$i.maxissueqty %] + [%- SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %] + [%- SET issuelength = all_rules.$c.$i.issuelength %] + [%- SET daysmode = all_rules.$c.$i.daysmode %] + [%- SET lengthunit = all_rules.$c.$i.lengthunit %] + [%- SET hardduedate = all_rules.$c.$i.hardduedate %] + [%- SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %] + [%- SET fine = all_rules.$c.$i.fine %] + [%- SET chargeperiod = all_rules.$c.$i.chargeperiod %] + [%- SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %] + [%- SET firstremind = all_rules.$c.$i.firstremind %] + [%- SET overduefinescap = all_rules.$c.$i.overduefinescap %] + [%- SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %] + [%- SET finedays = all_rules.$c.$i.finedays %] + [%- SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %] + [%- SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %] + [%- SET renewalsallowed = all_rules.$c.$i.renewalsallowed %] + [%- SET unseenrenewalsallowed = all_rules.$c.$i.unseen_renewals_allowed %] + [%- SET renewalperiod = all_rules.$c.$i.renewalperiod %] + [%- SET norenewalbefore = all_rules.$c.$i.norenewalbefore %] + [%- SET noautorenewalbefore = all_rules.$c.$i.noautorenewalbefore %] + [%- SET auto_renew = all_rules.$c.$i.auto_renew %] + [%- SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %] + [%- SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %] + [%- SET reservesallowed = all_rules.$c.$i.reservesallowed %] + [%- SET holds_per_day = all_rules.$c.$i.holds_per_day %] + [%- SET holds_per_record = all_rules.$c.$i.holds_per_record %] + [%- SET onshelfholds = all_rules.$c.$i.onshelfholds %] + [%- SET opacitemholds = all_rules.$c.$i.opacitemholds %] + [%- SET article_requests = all_rules.$c.$i.article_requests %] + [%- SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] + [%- SET decreaseloanholds = all_rules.$c.$i.decreaseloanholds %] + [%- SET recalls_allowed = all_rules.$c.$i.recalls_allowed %] + [%- SET recalls_per_record = all_rules.$c.$i.recalls_per_record %] + [%- SET on_shelf_recalls = all_rules.$c.$i.on_shelf_recalls %] + [%- SET recall_due_date_interval = all_rules.$c.$i.recall_due_date_interval %] + [%- SET recall_overdue_fine = all_rules.$c.$i.recall_overdue_fine %] + [%- SET recall_shelf_time = all_rules.$c.$i.recall_shelf_time %] + [%- SET holds_pickup_period = all_rules.$c.$i.holds_pickup_period %] + + [%- SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || unseenrenewalsallowed || renewalperiod || norenewalbefore || noautorenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount || decreaseloanholds || recalls_allowed || recalls_per_record || on_shelf_recalls || recall_due_date_interval || recall_overdue_fine || recall_shelf_time || holds_pickup_period %] + [%- IF show_rule %] + [%- SET row_count = row_count + 1 %] - [% IF ( c == undef ) %] + [%- IF ( c == undef ) %] 1 - [% ELSE %] + [%- ELSE %] 0 - [% END %] + [%- END %] - [% IF c == undef %] + [%- IF c == undef %] All - [% ELSE %] + [%- ELSE %] [% Categories.GetName(c) | html %] - [% END %] + [%- END %] - [% IF ( i == undef ) %] + [%- IF ( i == undef ) %] 1 - [% ELSE %] + [%- ELSE %] 0 - [% END %] + [%- END %] - [% IF i == undef %] + [%- IF i == undef %] All - [% ELSE %] + [%- ELSE %] [% ItemTypes.GetDescription(i,1) | html %] - [% END %] + [%- END %] Edit Delete - [% IF note.defined && note != '' %] + [%- IF note.defined && note != '' %] View note - [% ELSE %] [% END %] + [%- ELSE %] [%- END %] - [% IF maxissueqty.defined && maxissueqty != '' %] + [%- IF maxissueqty.defined && maxissueqty != '' %] [% maxissueqty | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %] + [%- IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %] [% maxonsiteissueqty | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] [% issuelength | html %] @@ -264,150 +264,150 @@ [% CASE 'Days' %]Ignore the calendar [% CASE 'Dayweek' %]Same week day [% CASE %]Default - [% END %] + [%- END %] - [% IF ( lengthunit == 'days' ) %] + [%- IF ( lengthunit == 'days' ) %] Days - [% ELSIF ( lengthunit == 'hours') %] + [%- ELSIF ( lengthunit == 'hours') %] Hours - [% ELSE %] + [%- ELSE %] Undefined - [% END %] + [%- END %] - [% IF ( hardduedate ) %] - [% IF ( hardduedatecompare == '-1' ) %] + [%- IF ( hardduedate ) %] + [%- IF ( hardduedatecompare == '-1' ) %] before [% hardduedate | $KohaDates %] - [% ELSIF ( hardduedatecompare == '0' ) %] + [%- ELSIF ( hardduedatecompare == '0' ) %] on [% hardduedate | $KohaDates %] - [% ELSIF ( hardduedatecompare == '1' ) %] + [%- ELSIF ( hardduedatecompare == '1' ) %] after [% hardduedate | $KohaDates %] - [% END %] - [% ELSE %] + [%- END %] + [%- ELSE %] None defined - [% END %] + [%- END %] [% decreaseloanholds | html %] [% fine | $Price %] [% chargeperiod | html %] - [% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %] + [%- IF chargeperiod_charge_at %]Start of interval[%- ELSE %]End of interval[%- END %] [% firstremind | html %] - [% IF overduefinescap %][% overduefinescap | $Price %][% ELSE %][% END %] + [%- IF overduefinescap %][% overduefinescap | $Price %][%- ELSE %][%- END %] - [% IF cap_fine_to_replacement_price %] + [%- IF cap_fine_to_replacement_price %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] [% finedays | html %] [% maxsuspensiondays | html %] [% suspension_chargeperiod | html %] [% renewalsallowed | html %] - [% IF Koha.Preference('UnseenRenewals') %] + [%- IF Koha.Preference('UnseenRenewals') %] - [% IF unseenrenewalsallowed.defined && unseenrenewalsallowed != '' %] + [%- IF unseenrenewalsallowed.defined && unseenrenewalsallowed != '' %] [% unseenrenewalsallowed | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% END %] + [%- END %] [% renewalperiod | html %] [% norenewalbefore | html %] [% noautorenewalbefore | html %] - [% IF auto_renew %] + [%- IF auto_renew %] Yes - [% ELSE %] + [%- ELSE %] No - [% END %] + [%- END %] [% no_auto_renewal_after | html %] [% no_auto_renewal_after_hard_limit | $KohaDates %] - [% IF reservesallowed.defined && reservesallowed != '' %] + [%- IF reservesallowed.defined && reservesallowed != '' %] [% reservesallowed | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF holds_per_day.defined && holds_per_day != '' %] + [%- IF holds_per_day.defined && holds_per_day != '' %] [% holds_per_day | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF holds_per_record.defined && holds_per_record != '' %] + [%- IF holds_per_record.defined && holds_per_record != '' %] [% holds_per_record | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF onshelfholds == 1 %] + [%- IF onshelfholds == 1 %] Yes - [% ELSIF onshelfholds == 2 %] + [%- ELSIF onshelfholds == 2 %] If all unavailable - [% ELSE %] + [%- ELSE %] If any unavailable - [% END %] + [%- END %] - [% IF opacitemholds == 'F'%] + [%- IF opacitemholds == 'F'%] Force - [% ELSIF opacitemholds == 'Y'%] + [%- ELSIF opacitemholds == 'Y'%] Allow - [% ELSE %] + [%- ELSE %] Don't allow - [% END %] + [%- END %] - [% IF holds_pickup_period == '' %] + [%- IF holds_pickup_period == '' %] Default - [% ELSE %] + [%- ELSE %] [% holds_pickup_period | html %] - [% END %] + [%- END %] - [% IF Koha.Preference('ArticleRequests') %] + [%- IF Koha.Preference('ArticleRequests') %] - [% IF article_requests == 'no' %] + [%- IF article_requests == 'no' %] No - [% ELSIF article_requests == 'yes' %] + [%- ELSIF article_requests == 'yes' %] Yes - [% ELSIF article_requests == 'bib_only' %] + [%- ELSIF article_requests == 'bib_only' %] Record only - [% ELSIF article_requests == 'item_only' %] + [%- ELSIF article_requests == 'item_only' %] Item only - [% END %] + [%- END %] - [% END %] + [%- END %] [% rentaldiscount | html %] - [% IF Koha.Preference('UseRecalls') %] + [%- IF Koha.Preference('UseRecalls') %] [% recalls_allowed | html %] [% recalls_per_record | html %] - [% IF on_shelf_recalls == 'all' %] + [%- IF on_shelf_recalls == 'all' %] If all unavailable - [% ELSE %] + [%- ELSE %] If any unavailable - [% END %] + [%- END %] [% recall_due_date_interval | html %] [% recall_overdue_fine | $Price %] [% recall_shelf_time | html %] - [% END %] + [%- END %] Edit Delete - [% END %] - [% END %] - [% END %] + [%- END %] + [%- END %] + [%- END %] 2 @@ -415,7 +415,7 @@ [% FOREACH patron_category IN patron_categories%] - [% END %] + [%- END %] 0 @@ -424,18 +424,18 @@ [% FOREACH itemtypeloo IN itemtypeloop %] [% NEXT IF itemtypeloo.parent_type %] - [% SET children = itemtypeloo.children_with_localization %] - [% IF children.count %] + [%- SET children = itemtypeloo.children_with_localization %] + [%- IF children.count %] [% FOREACH child IN children %] - [% END %] + [%- END %] - [% ELSE %] + [%- ELSE %] - [% END %] - [% END %] + [%- END %] + [%- END %] @@ -487,9 +487,9 @@ - [% IF Koha.Preference('UnseenRenewals') %] + [%- IF Koha.Preference('UnseenRenewals') %] - [% END %] + [%- END %] @@ -522,7 +522,7 @@ - [% IF Koha.Preference('ArticleRequests') %] + [%- IF Koha.Preference('ArticleRequests') %] - [% END %] + [%- END %] - [% IF Koha.Preference('UseRecalls') %] + [%- IF Koha.Preference('UseRecalls') %] @@ -545,7 +545,7 @@ - [% END %] + [%- END %] @@ -578,9 +578,9 @@ Max. suspension duration (day) Suspension charging interval Renewals allowed (count) - [% IF Koha.Preference('UnseenRenewals') %] + [%- IF Koha.Preference('UnseenRenewals') %] Unseen renewals allowed (count) - [% END %] + [%- END %] Renewal period No renewal before No automatic renewal before @@ -593,18 +593,18 @@ On shelf holds allowed OPAC item level holds Holds pickup period (day) - [% IF Koha.Preference('ArticleRequests') %] + [%- IF Koha.Preference('ArticleRequests') %] Article requests - [% END %] + [%- END %] Rental discount (%) - [% IF Koha.Preference('UseRecalls') %] + [%- IF Koha.Preference('UseRecalls') %] Recalls allowed (total) Recalls per record (count) On shelf recalls allowed Recall due date interval (day) Recall overdue fine amount Recall pickup period (day) - [% END %] + [%- END %]   @@ -613,7 +613,7 @@
-

Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) | html %][% END %]

+

Default checkout, hold and return policy[%- IF humanbranch %] for [% Branches.GetName( humanbranch ) | html %][%- END %]

You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.

[% INCLUDE 'csrf-token.inc' %] @@ -630,22 +630,22 @@ Return policy Actions - [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty', { want_rule => 1 } ) %] - [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty', { want_rule => 1 } ) %] - [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', { want_rule => 1 } ) %] - [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', { want_rule => 1 } ) %] - [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %] - [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %] - [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %] + [%- SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty', { want_rule => 1 } ) %] + [%- SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty', { want_rule => 1 } ) %] + [%- SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', { want_rule => 1 } ) %] + [%- SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', { want_rule => 1 } ) %] + [%- SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %] + [%- SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %] + [%- SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %] - [% IF ( default_checkout_hold_and_return_policy ) %] + [%- IF ( default_checkout_hold_and_return_policy ) %] Defaults - [% ELSE %] + [%- ELSE %] Not set - [% END %] + [%- END %] @@ -662,35 +662,35 @@ Not set - [% IF holdallowed.rule_value == 'from_any_library' %] + [%- IF holdallowed.rule_value == 'from_any_library' %] - [% IF holdallowed.rule_value == 'from_local_hold_group' %] + [%- IF holdallowed.rule_value == 'from_local_hold_group' %] - [% IF holdallowed.rule_value == 'from_home_library' %] + [%- IF holdallowed.rule_value == 'from_home_library' %] - [% IF holdallowed.rule_value == 'not_allowed' %] + [%- IF holdallowed.rule_value == 'not_allowed' %] @@ -702,55 +702,55 @@ Not set - [% IF hold_fulfillment_policy.rule_value == 'any' %] + [%- IF hold_fulfillment_policy.rule_value == 'any' %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] - [% IF hold_fulfillment_policy.rule_value == 'holdgroup' %] + [%- IF hold_fulfillment_policy.rule_value == 'holdgroup' %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] - [% IF hold_fulfillment_policy.rule_value == 'patrongroup' %] + [%- IF hold_fulfillment_policy.rule_value == 'patrongroup' %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] - [% IF hold_fulfillment_policy.rule_value == 'homebranch' %] + [%- IF hold_fulfillment_policy.rule_value == 'homebranch' %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] - [% IF hold_fulfillment_policy.rule_value == 'holdingbranch' %] + [%- IF hold_fulfillment_policy.rule_value == 'holdingbranch' %] - [% ELSE %] + [%- ELSE %] - [% END %] + [%- END %] @@ -760,50 +760,50 @@ Not set - [% IF returnbranch.rule_value == 'homebranch' %] + [%- IF returnbranch.rule_value == 'homebranch' %] - [% IF returnbranch.rule_value == 'holdingbranch' %] + [%- IF returnbranch.rule_value == 'holdingbranch' %] - [% IF returnbranch.rule_value == 'noreturn' %] + [%- IF returnbranch.rule_value == 'noreturn' %] - [% IF returnbranch.rule_value == 'returnbylibrarygroup' %] + [%- IF returnbranch.rule_value == 'returnbylibrarygroup' %] - [% IF ( default_checkout_hold_and_return_policy ) %] + [%- IF ( default_checkout_hold_and_return_policy ) %] Unset - [% END %] + [%- END %]
- [% IF ( show_branch_cat_rule_form ) %] + [%- IF ( show_branch_cat_rule_form ) %]
-

[% IF humanbranch %]Checkout, hold policy by patron category for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default checkout, hold policy by patron category[% END %]

+

[%- IF humanbranch %]Checkout, hold policy by patron category for [% Branches.GetName( humanbranch ) | html %][%- ELSE %]Default checkout, hold policy by patron category[%- END %]

For this library, you can specify the maximum number of loans that a patron of a given category can make, regardless of the item type.

@@ -824,53 +824,53 @@ [% FOREACH c IN categorycodes %] [% NEXT UNLESS c %] - [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %] - [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] - [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %] + [%- SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %] + [%- SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] + [%- SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %] - [% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] + [%- IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] - [% IF c == undef %] + [%- IF c == undef %] Default - [% ELSE %] + [%- ELSE %] [% Categories.GetName(c) | html %] - [% END %] + [%- END %] - [% IF patron_maxissueqty.defined && patron_maxissueqty != '' %] + [%- IF patron_maxissueqty.defined && patron_maxissueqty != '' %] [% patron_maxissueqty | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %] + [%- IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %] [% patron_maxonsiteissueqty | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] - [% IF max_holds.defined && max_holds != '' %] + [%- IF max_holds.defined && max_holds != '' %] [% max_holds | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] Delete - [% END %] - [% END %] + [%- END %] + [%- END %] @@ -881,14 +881,14 @@
- [% END %] + [%- END %]
- [% IF humanbranch %] + [%- IF humanbranch %]

Waiting hold cancellation policy for [% Branches.GetName( humanbranch ) | html %]

- [% ELSE %] + [%- ELSE %]

Default waiting hold cancellation policy

- [% END %] + [%- END %]

Specify if waiting holds can be cancelled for a given patron category.

[% INCLUDE 'csrf-token.inc' %] @@ -902,49 +902,49 @@   [% FOREACH c IN categorycodes %] - [% SET c = '*' UNLESS c.defined AND c != '' %] + [%- SET c = '*' UNLESS c.defined AND c != '' %] [% FOREACH i IN itemtypes %] - [% SET i = '*' UNLESS i.defined AND i != '' %] + [%- SET i = '*' UNLESS i.defined AND i != '' %] - [% SET waiting_hold_cancellation = CirculationRules.Search( current_branch, c, i, 'waiting_hold_cancellation' ) %] + [%- SET waiting_hold_cancellation = CirculationRules.Search( current_branch, c, i, 'waiting_hold_cancellation' ) %] - [% IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %] + [%- IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %] - [% IF c == '*' %] + [%- IF c == '*' %] All - [% ELSE %] + [%- ELSE %] [% Categories.GetName(c) | html %] - [% END %] + [%- END %] - [% IF i == '*' %] + [%- IF i == '*' %] All - [% ELSE %] + [%- ELSE %] [% ItemTypes.GetDescription(i,1) | html %] - [% END %] + [%- END %] - [% IF waiting_hold_cancellation %] + [%- IF waiting_hold_cancellation %] Yes - [% ELSE %] + [%- ELSE %] No - [% END %] + [%- END %] Delete - [% END %] - [% END %] - [% END %] + [%- END %] + [%- END %] + [%- END %] @@ -952,7 +952,7 @@ [% FOREACH itemtype IN itemtypeloop %] - [% END %] + [%- END %] @@ -967,13 +967,13 @@
- [% IF Koha.Preference('ArticleRequests') %] + [%- IF Koha.Preference('ArticleRequests') %]
- [% IF humanbranch %] + [%- IF humanbranch %]

Daily open article requests limit for [% Branches.GetName( humanbranch ) | html %]

- [% ELSE %] + [%- ELSE %]

Default open article requests limit

- [% END %] + [%- END %]

Specify the maximum number simultaneous current article requests a patron of a given category can have.

[% INCLUDE 'csrf-token.inc' %] @@ -987,33 +987,33 @@ [% FOREACH c IN categorycodes %] [% NEXT UNLESS c %] - [% SET open_article_requests_limit = CirculationRules.Search( branchcode, c, undef, 'open_article_requests_limit' ) %] + [%- SET open_article_requests_limit = CirculationRules.Search( branchcode, c, undef, 'open_article_requests_limit' ) %] - [% IF ( open_article_requests_limit.defined && open_article_requests_limit != '' ) %] + [%- IF ( open_article_requests_limit.defined && open_article_requests_limit != '' ) %] [% Categories.GetName(c) | html %] - [% IF open_article_requests_limit.defined && open_article_requests_limit != '' %] + [%- IF open_article_requests_limit.defined && open_article_requests_limit != '' %] [% open_article_requests_limit | html %] - [% ELSE %] + [%- ELSE %] Unlimited - [% END %] + [%- END %] Delete - [% END %] - [% END %] + [%- END %] + [%- END %] @@ -1024,11 +1024,11 @@
- [% IF humanbranch %] + [%- IF humanbranch %]

Article request fees for [% Branches.GetName( humanbranch ) | html %]

- [% ELSE %] + [%- ELSE %]

Default article request fees

- [% END %] + [%- END %]

Specify the article request fee for a given patron category.

[% INCLUDE 'csrf-token.inc' %] @@ -1041,39 +1041,39 @@   [% FOREACH c IN categorycodes %] - [% SET c = '*' UNLESS c.defined AND c != '' %] + [%- SET c = '*' UNLESS c.defined AND c != '' %] - [% SET article_request_fee = CirculationRules.Search( current_branch, c, undef, 'article_request_fee' ) %] + [%- SET article_request_fee = CirculationRules.Search( current_branch, c, undef, 'article_request_fee' ) %] - [% IF ( article_request_fee.defined && article_request_fee != '' ) %] + [%- IF ( article_request_fee.defined && article_request_fee != '' ) %] - [% IF c == '*' %] + [%- IF c == '*' %] All - [% ELSE %] + [%- ELSE %] [% Categories.GetName(c) | html %] - [% END %] + [%- END %] - [% IF article_request_fee.defined && article_request_fee != '' %] + [%- IF article_request_fee.defined && article_request_fee != '' %] [% article_request_fee | $Price %] - [% ELSE %] + [%- ELSE %] 0 - [% END %] + [%- END %] Delete - [% END %] - [% END %] + [%- END %] + [%- END %] @@ -1082,14 +1082,14 @@
- [% END %] + [%- END %]
- [% IF current_branch == '*' %] + [%- IF current_branch == '*' %]

Default lost item fee refund on return policy

- [% ELSE %] + [%- ELSE %]

Lost item fee refund on return policy for [% Branches.GetName(current_branch) | html %]

- [% END %] + [%- END %]

Specify the default policy for lost item fees on return.

[% INCLUDE 'csrf-token.inc' %] @@ -1105,161 +1105,161 @@ @@ -1271,7 +1271,7 @@
-

[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default holds policy by item type[% END %]

+

[%- IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) | html %][%- ELSE %]Default holds policy by item type[%- END %]

For this library, you can edit rules for given itemtypes, regardless of the patron's category.

@@ -1307,62 +1307,62 @@   [% FOREACH i IN itemtypeloop %] - [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %] - [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %] - [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %] + [%- SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %] + [%- SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %] + [%- SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %] - [% IF holdallowed || hold_fulfillment_policy || returnbranch %] + [%- IF holdallowed || hold_fulfillment_policy || returnbranch %] [% i.translated_description | html %] - [% IF holdallowed == 'from_any_library' %] + [%- IF holdallowed == 'from_any_library' %] From any library - [% ELSIF holdallowed == 'from_local_hold_group' %] + [%- ELSIF holdallowed == 'from_local_hold_group' %] From local hold group - [% ELSIF holdallowed == 'from_home_library' %] + [%- ELSIF holdallowed == 'from_home_library' %] From home library - [% ELSE %] + [%- ELSE %] No holds allowed - [% END %] + [%- END %] - [% IF hold_fulfillment_policy == 'any' %] + [%- IF hold_fulfillment_policy == 'any' %] any library - [% ELSIF hold_fulfillment_policy == 'homebranch' %] + [%- ELSIF hold_fulfillment_policy == 'homebranch' %] item's home library - [% ELSIF hold_fulfillment_policy == 'holdgroup' %] + [%- ELSIF hold_fulfillment_policy == 'holdgroup' %] item's hold group - [% ELSIF hold_fulfillment_policy == 'patrongroup' %] + [%- ELSIF hold_fulfillment_policy == 'patrongroup' %] patron's hold group - [% ELSIF hold_fulfillment_policy == 'holdingbranch' %] + [%- ELSIF hold_fulfillment_policy == 'holdingbranch' %] item's holding library - [% END %] + [%- END %] - [% IF returnbranch == 'homebranch' %] + [%- IF returnbranch == 'homebranch' %] Item returns home - [% ELSIF returnbranch == 'holdingbranch' %] + [%- ELSIF returnbranch == 'holdingbranch' %] Item returns to issuing branch - [% ELSIF returnbranch == 'noreturn' %] + [%- ELSIF returnbranch == 'noreturn' %] Item floats - [% ELSIF returnbranch == 'returnbylibrarygroup'%] + [%- ELSIF returnbranch == 'returnbylibrarygroup'%] Item floats by library group - [% END %] + [%- END %] Delete - [% END %] - [% END %] + [%- END %] + [%- END %] @@ -1671,5 +1671,5 @@ }); -[% END %] +[%- END %] [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.2