Bugzilla – Attachment 112651 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) Add onsite_checkout into user interface
Bug-26814-SMART-RULES-GUI-Add-onsitecheckout-into-.patch (text/plain), 34.55 KB, created by
Lari Taskula
on 2020-10-28 23:30:56 UTC
(
hide
)
Description:
Bug 26814: (SMART-RULES GUI) Add onsite_checkout into user interface
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-10-28 23:30:56 UTC
Size:
34.55 KB
patch
obsolete
>From 7365c08778c7ded6522e09084bee26a08171fc5a Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 23 Oct 2020 23:58:00 +0000 >Subject: [PATCH] Bug 26814: (SMART-RULES GUI) Add onsite_checkout into user > interface > >SMART-RULES GUI tag means that this patch will apply before Bug 15522. > >To test: >1. Go to Circulation rules page in Koha >2. Observe checkout type column in the rule matrix >3. Test circulation rules matrix by setting, modifying and deleting > rules. >4. Test default checkout, hold and return policy settings. >5. Test default checkout, hold policy by patron category settings. > >Sponsored-by: The National Library of Finland >--- > admin/smart-rules.pl | 237 +++++++++++++++--- > .../prog/en/modules/admin/smart-rules.tt | 83 +++--- > 2 files changed, 256 insertions(+), 64 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index bdae9b5c27..1269a8a484 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -73,6 +73,8 @@ $cache->clear_from_cache( Koha::CirculationRules::GUESSED_ITEMTYPES_KEY ); > if ($op eq 'delete') { > my $itemtype = $input->param('itemtype'); > my $categorycode = $input->param('categorycode'); >+ my $onsite_checkout = $input->param('onsite_checkout') eq '' ? undef : $input->param('onsite_checkout'); >+ > $debug and warn "deleting $1 $2 $branch"; > > Koha::CirculationRules->set_rules( >@@ -80,9 +82,24 @@ if ($op eq 'delete') { > categorycode => $categorycode eq '*' ? undef : $categorycode, > branchcode => $branch eq '*' ? undef : $branch, > itemtype => $itemtype eq '*' ? undef : $itemtype, >+ rules => { >+ reservesallowed => undef, >+ holds_per_record => undef, >+ holds_per_day => undef, >+ onshelfholds => undef, >+ opacitemholds => undef, >+ article_requests => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode eq '*' ? undef : $categorycode, >+ branchcode => $branch eq '*' ? undef : $branch, >+ itemtype => $itemtype eq '*' ? undef : $itemtype, >+ onsite_checkout => $onsite_checkout eq '*' ? undef : $onsite_checkout, > rules => { > maxissueqty => undef, >- maxonsiteissueqty => undef, > rentaldiscount => undef, > fine => undef, > finedays => undef, >@@ -102,14 +119,8 @@ if ($op eq 'delete') { > auto_renew => undef, > no_auto_renewal_after => undef, > no_auto_renewal_after_hard_limit => undef, >- reservesallowed => undef, >- holds_per_record => undef, >- holds_per_day => undef, >- onshelfholds => undef, >- opacitemholds => undef, > overduefinescap => undef, > cap_fine_to_replacement_price => undef, >- article_requests => undef, > note => undef, > } > } >@@ -125,8 +136,26 @@ elsif ($op eq 'delete-branch-cat') { > categorycode => undef, > rules => { > max_holds => undef, >- patron_maxissueqty => undef, >- patron_maxonsiteissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ onsite_checkout => 0, >+ rules => { >+ patron_maxissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => undef, > } > } > ); >@@ -148,8 +177,26 @@ elsif ($op eq 'delete-branch-cat') { > branchcode => undef, > rules => { > max_holds => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => undef, >+ onsite_checkout => 0, >+ rules => { >+ patron_maxissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => undef, >+ onsite_checkout => 1, >+ rules => { > patron_maxissueqty => undef, >- patron_maxonsiteissueqty => undef, > } > } > ); >@@ -159,10 +206,20 @@ elsif ($op eq 'delete-branch-cat') { > { > branchcode => $branch, > categorycode => undef, >+ onsite_checkout => 0, >+ rules => { >+ patron_maxissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => $branch, >+ categorycode => undef, >+ onsite_checkout => 1, > rules => { > max_holds => undef, > patron_maxissueqty => undef, >- patron_maxonsiteissueqty => undef, > } > } > ); >@@ -184,8 +241,26 @@ elsif ($op eq 'delete-branch-cat') { > branchcode => $branch, > rules => { > max_holds => undef, >- patron_maxissueqty => undef, >- patron_maxonsiteissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => $branch, >+ onsite_checkout => 0, >+ rules => { >+ patron_maxissueqty => undef, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => $branch, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => undef, > } > } > ); >@@ -250,6 +325,7 @@ elsif ($op eq 'add') { > my $br = $branch; # branch > my $bor = $input->param('categorycode'); # borrower category > my $itemtype = $input->param('itemtype'); # item type >+ my $onsite_checkout = $input->param('onsite_checkout'); > my $fine = $input->param('fine'); > my $finedays = $input->param('finedays'); > my $maxsuspensiondays = $input->param('maxsuspensiondays') || ''; >@@ -258,7 +334,6 @@ elsif ($op eq 'add') { > my $chargeperiod = $input->param('chargeperiod'); > my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at'); > my $maxissueqty = strip_non_numeric( scalar $input->param('maxissueqty') ); >- my $maxonsiteissueqty = strip_non_numeric( scalar $input->param('maxonsiteissueqty') ); > my $renewalsallowed = $input->param('renewalsallowed'); > my $renewalperiod = $input->param('renewalperiod'); > my $norenewalbefore = $input->param('norenewalbefore'); >@@ -287,11 +362,10 @@ elsif ($op eq 'add') { > my $overduefinescap = $input->param('overduefinescap') || ''; > my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || '') eq 'on'; > my $note = $input->param('note'); >- $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price"; >+ $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $cap_fine_to_replacement_price"; > > my $rules = { > maxissueqty => $maxissueqty, >- maxonsiteissueqty => $maxonsiteissueqty, > rentaldiscount => $rentaldiscount, > fine => $fine, > finedays => $finedays, >@@ -311,15 +385,28 @@ elsif ($op eq 'add') { > auto_renew => $auto_renew, > no_auto_renewal_after => $no_auto_renewal_after, > no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit, >+ overduefinescap => $overduefinescap, >+ cap_fine_to_replacement_price => $cap_fine_to_replacement_price, >+ note => $note, >+ }; >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $bor eq '*' ? undef : $bor, >+ itemtype => $itemtype eq '*' ? undef : $itemtype, >+ branchcode => $br eq '*' ? undef : $br, >+ onsite_checkout => $onsite_checkout eq '*' ? undef : $onsite_checkout, >+ rules => $rules, >+ } >+ ); >+ >+ $rules = { > reservesallowed => $reservesallowed, > holds_per_record => $holds_per_record, > holds_per_day => $holds_per_day, > onshelfholds => $onshelfholds, > opacitemholds => $opacitemholds, >- overduefinescap => $overduefinescap, >- cap_fine_to_replacement_price => $cap_fine_to_replacement_price, > article_requests => $article_requests, >- note => $note, > }; > > Koha::CirculationRules->set_rules( >@@ -335,8 +422,7 @@ elsif ($op eq 'add') { > elsif ($op eq "set-branch-defaults") { > my $categorycode = $input->param('categorycode'); > my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') ); >- my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty'); >- $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty); >+ my $patron_maxonsiteissueqty = strip_non_numeric( scalar $input->param('patron_maxonsiteissueqty') ); > my $holdallowed = $input->param('holdallowed'); > my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); > my $returnbranch = $input->param('returnbranch'); >@@ -358,9 +444,19 @@ elsif ($op eq "set-branch-defaults") { > { > categorycode => undef, > branchcode => undef, >+ onsite_checkout => 0, > rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -380,9 +476,19 @@ elsif ($op eq "set-branch-defaults") { > { > categorycode => undef, > branchcode => $branch, >+ onsite_checkout => 0, > rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => $branch, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -399,8 +505,7 @@ elsif ($op eq "set-branch-defaults") { > elsif ($op eq "add-branch-cat") { > my $categorycode = $input->param('categorycode'); > my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') ); >- my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty'); >- $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty); >+ my $patron_maxonsiteissueqty = strip_non_numeric( scalar $input->param('patron_maxonsiteissueqty') ); > my $max_holds = $input->param('max_holds'); > $max_holds =~ s/\s//g; > $max_holds = undef if $max_holds !~ /^\d+/; >@@ -413,8 +518,26 @@ elsif ($op eq "add-branch-cat") { > branchcode => undef, > rules => { > max_holds => $max_holds, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ onsite_checkout => 0, >+ rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -425,8 +548,26 @@ elsif ($op eq "add-branch-cat") { > branchcode => undef, > rules => { > max_holds => $max_holds, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => undef, >+ onsite_checkout => 0, >+ rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => undef, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -438,8 +579,26 @@ elsif ($op eq "add-branch-cat") { > branchcode => $branch, > rules => { > max_holds => $max_holds, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => $branch, >+ onsite_checkout => 0, >+ rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => $branch, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -450,8 +609,26 @@ elsif ($op eq "add-branch-cat") { > branchcode => $branch, > rules => { > max_holds => $max_holds, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => $branch, >+ onsite_checkout => 0, >+ rules => { > patron_maxissueqty => $patron_maxissueqty, >- patron_maxonsiteissueqty => $patron_maxonsiteissueqty, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ branchcode => $branch, >+ onsite_checkout => 1, >+ rules => { >+ patron_maxissueqty => $patron_maxonsiteissueqty, > } > } > ); >@@ -562,7 +739,7 @@ my $definedbranch = $all_rules->count ? 1 : 0; > my $rules = {}; > while ( my $r = $all_rules->next ) { > $r = $r->unblessed; >- $rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->{ $r->{rule_name} } = $r->{rule_value}; >+ $rules->{ $r->{onsite_checkout} // '' }->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->{ $r->{rule_name} } = $r->{rule_value}; > } > > $template->param(show_branch_cat_rule_form => 1); >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 3d97fbf23b..2fb938b8cc 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 >@@ -91,13 +91,13 @@ > <thead> > <tr> > <th> </th> >+ <th class="fixed_sort">On-site checkout</th> > <th class="fixed_sort">Patron category</th> > <th> </th> > <th class="fixed_sort">Item type</th> > <th>Actions</th> > <th>Note</th> > <th>Current checkouts allowed</th> >- <th>Current on-site checkouts allowed</th> > <th>Loan period</th> > <th>Days mode</th> > <th>Unit</th> >@@ -129,13 +129,14 @@ > </thead> > <tbody> > [% SET row_count = 0 %] >+ [% FOREACH osc IN [ undef, 0, 1 ] %] > [% FOREACH c IN categorycodes %] > [% SET c = '' UNLESS c.defined %] > [% FOREACH i IN itemtypes %] > [% SET i = '' UNLESS i.defined %] >+ [% SET osc = '' UNLESS osc.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 %] >@@ -164,11 +165,22 @@ > [% SET article_requests = all_rules.$c.$i.article_requests %] > [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] > >- [% 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 || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount %] >+ [% SET show_rule = note || maxissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount %] > [% IF show_rule %] > [% SET row_count = row_count + 1 %] > <tr row_countd="row_[% row_count | html %]"> > <td>[% IF ( c == undef ) %]1[% ELSE %]0[% END %]</td> >+ <td> >+ [% IF osc == undef %] >+ <em>All</em> >+ [% ELSE %] >+ [% IF osc == 0 %] >+ <em>No</em> >+ [% ELSIF osc == 1 %] >+ <em>On-site</em> >+ [% END %] >+ [% END %] >+ </td> > <td> > [% IF c == undef %] > <em>All</em> >@@ -186,7 +198,7 @@ > </td> > <td class="actions"> > <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> >- <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> >+ <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&onsite_checkout=[% osc.defined ? osc : '*' | html %]&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> > </td> > <td> > [% IF note.defined && note != '' %] >@@ -200,13 +212,6 @@ > <span>Unlimited</span> > [% END %] > </td> >- <td> >- [% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %] >- [% maxonsiteissueqty | html %] >- [% ELSE %] >- <span>Unlimited</span> >- [% END %] >- </td> > <td>[% issuelength | html %]</td> > <td> > [% SWITCH daysmode %] >@@ -322,14 +327,22 @@ > <td>[% rentaldiscount | html %]</td> > <td class="actions"> > <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> >- <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% i || '*' | uri %]&categorycode=[% c || '*' | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash"></i> Delete</a> >+ <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&onsite_checkout=[% osc.defined ? osc : '*' | uri %]&itemtype=[% i || '*' | uri %]&categorycode=[% c || '*' | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash"></i> Delete</a> > </td> > </tr> > [% END %] >+ [% END %] > [% END %] > [% END %] > <tr id="edit_row"> > <td>2</td> >+ <td> >+ <select name="onsite_checkout" id="matrixonsite_checkout" style="width:13em;"> >+ <option value="*">All</option> >+ <option value="0">No</option> >+ <option value="1">On-site</option> >+ </select> >+ </td> > <td> > <select name="categorycode" id="categorycode"> > <option value="*">All</option> >@@ -365,7 +378,6 @@ > </td> > <td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td> > <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td> >- <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td> > <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td> > <td> > <select name="daysmode" id="daysmode"> >@@ -454,13 +466,13 @@ > <tfoot> > <tr> > <th> </th> >+ <th>On-site checkout</th> > <th>Patron category</th> > <th> </th> > <th>Item type</th> > <th> </th> > <th>Note</th> > <th>Current checkouts allowed</th> >- <th>Current on-site checkouts allowed</th> > <th>Loan period</th> > <th>Days mode</th> > <th>Unit</th> >@@ -514,20 +526,20 @@ > <tr> > <td><em>Defaults</em></td> > <td> >- [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %] >+ [% SET patron_maxissueqty = CirculationRules.Search( current_branch, 0, undef, undef, 'patron_maxissueqty' ) %] > <input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> > </td> > <td> >- [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty' ) %] >- <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty | html %]"/> >+ [% SET patron_maxissueqty = CirculationRules.Search( current_branch, 1, undef, undef, 'patron_maxissueqty' ) %] >+ <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxissueqty | html %]"/> > </td> > <td> >- [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %] >+ [% SET rule_value = CirculationRules.Search( current_branch, undef, undef, undef, 'max_holds' ) %] > <input name="max_holds" size="3" value="[% rule_value | html %]" /> > </td> > <td> > <select name="holdallowed"> >- [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %] >+ [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, undef, 'holdallowed' ) %] > <option value=""> > Not set > </option> >@@ -567,7 +579,7 @@ > </td> > <td> > <select name="hold_fulfillment_policy"> >- [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %] >+ [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, undef, 'hold_fulfillment_policy' ) %] > > <option value=""> > Not set >@@ -626,7 +638,7 @@ > </td> > <td> > <select name="returnbranch"> >- [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %] >+ [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, undef, 'returnbranch' ) %] > > <option value=""> > Not set >@@ -685,9 +697,9 @@ > </tr> > [% 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, 0, c, undef, 'patron_maxissueqty' ) %] >+ [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, 1, c, undef, 'patron_maxissueqty' ) %] >+ [% SET max_holds = CirculationRules.Search( branchcode, undef, c, undef, 'max_holds' ) %] > > [% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] > <tr> >@@ -855,9 +867,9 @@ > <th> </th> > </tr> > [% 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, undef, 'holdallowed' ) %] >+ [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'hold_fulfillment_policy' ) %] >+ [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'returnbranch' ) %] > > [% IF holdallowed || hold_fulfillment_policy || returnbranch %] > <tr> >@@ -972,10 +984,10 @@ > $(document).ready(function() { > $("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, { > "aoColumnDefs": [ >- { "bVisible": false, "aTargets": [ 0,2 ] }, >+ { "bVisible": false, "aTargets": [ 0,3 ] }, > { "bSortable": false, "aTargets": ["_all"] } > ], >- "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ], >+ "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'], [4,'asc'] ], > "bPaginate": false, > "bAutoWidth": false > })); >@@ -1040,7 +1052,7 @@ > itm = $(this).text(); > itm = itm.replace(/^\s*|\s*$/g,''); > var current_column = $("#edit_row td:eq("+i+")"); >- if ( i == 3 ) { >+ if ( i == 4 ) { > // specific processing for the Note column > var note = $(this).find("a[name='viewnote']").data("content"); > $(current_column).find("input[type='text']").val(note); >@@ -1071,20 +1083,22 @@ > $(this).attr('selected', 'selected'); > } > }); >- if ( i == 0 || i == 1 ) { >+ if ( i == 0 || i == 1 || i == 2 ) { > // Disable the 2 first columns, we cannot update them. > var val = $(current_column).find("select option:selected").val(); >- var name = "categorycode"; >+ var name = "onsite_checkout"; > if ( i == 1 ) { >+ name="categorycode"; >+ } >+ if ( i == 2 ) { > name="itemtype"; > } > // 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 == 25 || i == 26 || i == 27 ) { >+ } else if ( i == 6 || i == 25 || i == 26 || i == 27 ) { > // If the value is not an integer for > // - "Current checkouts allowed" >- // - "Current on-site checkouts allowed" > // - "Holds allowed (total)" > // - "Holds allowed (daily)" > // - "Holds per record (count)" >@@ -1098,6 +1112,7 @@ > }); > $("#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); > return false; > }); > $(".clear_edit").on("click",function(e){ >-- >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