Bugzilla – Attachment 71319 Details for
Bug 15486
Restrict number of holds placed by day
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15486: Make circ rules UI handle holds_per_day
Bug-15486-Make-circ-rules-UI-handle-holdsperday.patch (text/plain), 6.59 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-02-07 19:18:30 UTC
(
hide
)
Description:
Bug 15486: Make circ rules UI handle holds_per_day
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-02-07 19:18:30 UTC
Size:
6.59 KB
patch
obsolete
>From 3fd3307927b7eeec4cfe0c95f87980d42e299a0a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 7 Feb 2018 16:10:28 -0300 >Subject: [PATCH] Bug 15486: Make circ rules UI handle holds_per_day > >This patch makes the staff UI correctly handle the holds_per_day >configuration. >--- > admin/smart-rules.pl | 7 ++++-- > .../prog/en/modules/admin/smart-rules.tt | 26 ++++++++++++++++------ > 2 files changed, 24 insertions(+), 9 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index e9a7ad64cf..c5057fc008 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -141,7 +141,8 @@ elsif ($op eq 'add') { > $no_auto_renewal_after_hard_limit = eval { dt_from_string( $input->param('no_auto_renewal_after_hard_limit') ) } if ( $no_auto_renewal_after_hard_limit ); > $no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit ); > my $reservesallowed = $input->param('reservesallowed'); >- my $holds_per_record = $input->param('holds_per_record'); >+ my $holds_per_record = $input->param('holds_per_record'); >+ my $holds_per_day = $input->param('holds_per_day'); > my $onshelfholds = $input->param('onshelfholds') || 0; > $maxissueqty =~ s/\s//g; > $maxissueqty = undef if $maxissueqty !~ /^\d+/; >@@ -181,6 +182,7 @@ elsif ($op eq 'add') { > no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit, > reservesallowed => $reservesallowed, > holds_per_record => $holds_per_record, >+ holds_per_day => $holds_per_day, > issuelength => $issuelength, > lengthunit => $lengthunit, > hardduedate => $hardduedate, >@@ -543,8 +545,9 @@ my @sorted_branch_cat_rules = sort { $a->{'humancategorycode'} cmp $b->{'humanca > > # note undef maxissueqty so that template can deal with them > foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) { >- $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty}); >+ $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty}); > $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty}); >+ $entry->{unlimited_holds_per_day} = 1 unless defined($entry->{rules_per_day}); > } > > @sorted_row_loop = sort by_category_and_itemtype @row_loop; >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 6dc5042f48..0f11d9d2bf 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 >@@ -84,7 +84,8 @@ > <th>Automatic renewal</th> > <th>No automatic renewal after</th> > <th>No automatic renewal after (hard limit)</th> >- <th>Holds allowed (count)</th> >+ <th>Holds allowed (total)</th> >+ <th>Holds allowed (daily)</th> > <th>Holds per record (count)</th> > <th>On shelf holds allowed</th> > <th>Item level holds</th> >@@ -171,7 +172,13 @@ > </td> > <td>[% rule.no_auto_renewal_after %]</td> > <td>[% rule.no_auto_renewal_after_hard_limit %]</td> >- <td>[% rule.reservesallowed %]</td> >+ <td>[% rule.reservesallowed %]</td> >+ <td>[% IF rule.unlimited_holds_per_day %] >+ Unlimited >+ [% ELSE %] >+ [% rule.holds_per_day %] >+ [% END %] >+ </td> > <td>[% rule.holds_per_record %]</td> > <td> > [% IF rule.onshelfholds == 1 %] >@@ -268,7 +275,8 @@ > <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit %]" class="datepicker"/> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </td> >- <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td> >+ <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td> >+ <td><input type="text" name="holds_per_day" id="holds_per_day" size="2" /></td> > <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td> > <td> > <select name="onshelfholds" id="onshelfholds"> >@@ -322,8 +330,9 @@ > <th>No renewal before</th> > <th>Automatic renewal</th> > <th>No automatic renewal after</th> >- <th>No automatic renewal after (hard limit)</th> >- <th>Holds allowed (count)</th> >+ <th>No automatic renewal after (hard limit)</th> >+ <th>Holds allowed (total)</th> >+ <th>Holds allowed (daily)</th> > <th>Holds per record (count)</th> > <th>On shelf holds allowed</th> > <th>Item level holds</th> >@@ -816,8 +825,11 @@ > // Remove potential previous input added > $(current_column).find("input").remove(); > $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); >- } else if ( i == 3 || i == 4 ) { >- // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed" >+ } else if ( i == 3 || i == 4 || i == 23 ) { >+ // If the value is not an integer for >+ // - "Current checkouts allowed" >+ // - "Current on-site checkouts allowed" >+ // - "Holds allowed (daily)" > // The value is "Unlimited" (or an equivalent translated string) > // an it should be set to an empty string > if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) { >-- >2.16.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 15486
:
65128
|
65129
|
65130
|
65131
|
65132
|
65133
|
67202
|
67203
|
67204
|
67205
|
67206
|
67207
|
67337
|
67840
|
67841
|
67842
|
67843
|
67844
|
67845
|
68728
|
68729
|
68730
|
68731
|
68732
|
68733
|
68734
|
68735
|
68750
|
68751
|
68752
|
68791
|
71314
|
71315
|
71316
|
71317
|
71318
|
71319
|
72709
|
79318
|
79319
|
79320
|
79321
|
79322
|
79323
|
79324
|
79696
|
79697
|
79698
|
79699
|
79700
|
79701
|
79702
|
80478
|
80479
|
80480
|
80481
|
80482
|
80483
|
80484
|
81087