Bugzilla – Attachment 79322 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.99 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-09-24 15:51:47 UTC
(
hide
)
Description:
Bug 15486: Make circ rules UI handle holds_per_day
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-09-24 15:51:47 UTC
Size:
6.99 KB
patch
obsolete
>From 23256e8c0b21df6ecfc4aa9a8d393e1e4fe3ae29 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. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > admin/smart-rules.pl | 11 +++++--- > .../prog/en/modules/admin/smart-rules.tt | 26 ++++++++++++++----- > 2 files changed, 27 insertions(+), 10 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index d87d8e5451..257b885cef 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -146,7 +146,10 @@ 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'); >+ $holds_per_day =~ s/\s//g; >+ $holds_per_day = undef if $holds_per_day !~ /^\d+/; > my $onshelfholds = $input->param('onshelfholds') || 0; > $maxissueqty =~ s/\s//g; > $maxissueqty = undef if $maxissueqty !~ /^\d+/; >@@ -187,6 +190,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, >@@ -555,9 +559,10 @@ 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_max_holds} = 1 unless defined($entry->{max_holds}); >+ $entry->{unlimited_max_holds} = 1 unless defined($entry->{max_holds}); >+ $entry->{unlimited_holds_per_day} = 1 unless defined($entry->{holds_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 5bc7e003cf..9b96500642 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 >@@ -87,7 +87,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> >@@ -182,7 +183,13 @@ > <td>[% rule.no_auto_renewal_after | html %]</td> > <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td> > <td>[% rule.reservesallowed | html %]</td> >- <td>[% rule.holds_per_record | html %]</td> >+ <td>[% IF rule.unlimited_holds_per_day %] >+ <span>Unlimited</span> >+ [% ELSE %] >+ [% rule.holds_per_day | html %] >+ [% END %] >+ </td> >+ <td>[% rule.holds_per_record | html %]</td> > <td> > [% IF rule.onshelfholds == 1 %] > <span>Yes</span> >@@ -288,7 +295,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 | html %]" 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"> >@@ -343,8 +351,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> >@@ -847,8 +856,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 == 24 ) { >+ // 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.19.0
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