Bugzilla – Attachment 55122 Details for
Bug 14695
Add ability to place multiple item holds on a given record per patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14695 - Warn librarian if max_holds_per_record is reached
Bug-14695---Warn-librarian-if-maxholdsperrecord-is.patch (text/plain), 6.12 KB, created by
Kyle M Hall (khall)
on 2016-09-02 13:13:35 UTC
(
hide
)
Description:
Bug 14695 - Warn librarian if max_holds_per_record is reached
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-09-02 13:13:35 UTC
Size:
6.12 KB
patch
obsolete
>From 47b429247256dac6bf728c5d7c7737462b2882e1 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 27 Jan 2016 16:48:02 +0100 >Subject: [PATCH] Bug 14695 - Warn librarian if max_holds_per_record is reached > >Signed-off-by: Jason M. Burds <JBurds@dubuque.lib.ia.us> >Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 14 +++++++++++--- > reserve/request.pl | 11 +++++++++-- > 2 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index e4e5467..b5fca88 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -253,7 +253,7 @@ function checkMultiHold() { > </form> > [% ELSIF NOT noitems %] > >-[% IF ( exceeded_maxreserves || alreadyreserved || none_available || alreadypossession || ageRestricted ) %] >+[% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %] > <div class="dialog alert"> > > [% UNLESS ( multi_hold ) %] >@@ -261,6 +261,8 @@ function checkMultiHold() { > <ul> > [% IF ( exceeded_maxreserves ) %] > <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% maxreserves %] total holds.</li> >+ [% ELSIF ( exceeded_holds_per_record ) %] >+ <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li> > [% ELSIF ( alreadypossession ) %] > <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>is already in possession</strong> of one item</lie > [% ELSIF ( alreadyreserved ) %] >@@ -277,6 +279,12 @@ function checkMultiHold() { > <h3>Cannot place hold on some items</h3> > [% IF ( exceeded_maxreserves ) %] > <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can place [% new_reserves_allowed %] of the requested [% new_reserves_count %] holds for a maximum of [% maxreserves %] total holds.</li> >+ [% ELSIF ( exceeded_holds_per_record ) %] >+ [% FOREACH biblioloo IN biblioloop %] >+ [% IF (biblioloo.tooManyHoldsForThisRecord) %] >+ <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]"> [% biblioloo.title %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li> >+ [% END %] >+ [% END %] > [% END %] > [% END %] > >@@ -406,12 +414,12 @@ function checkMultiHold() { > <input type="hidden" name="alreadyreserved" value="[% alreadyreserved %]" /> > </li> > >- [% IF max_holds_for_record > 1 %] >+ [% IF remaining_holds_for_record > 1 %] > [% SET count = 1 %] > <li> > <label for="holds_to_place_count">Holds to place (count)</label> > <select name="holds_to_place_count" id="holds_to_place_count"> >- [% WHILE count <= max_holds_for_record %] >+ [% WHILE count <= remaining_holds_for_record %] > <option value="[% count %]">[% count %]</option> > [% SET count = count + 1 %] > [% END %] >diff --git a/reserve/request.pl b/reserve/request.pl >index b44493f..1b6554c 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -82,6 +82,7 @@ my $messageborrower; > my $warnings; > my $messages; > my $exceeded_maxreserves; >+my $exceeded_holds_per_record; > > my $date = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); > my $action = $input->param('action'); >@@ -227,6 +228,10 @@ foreach my $biblionumber (@biblionumbers) { > elsif ( $canReserve eq 'tooManyReserves' ) { > $exceeded_maxreserves = 1; > } >+ elsif ( $canReserve eq 'tooManyHoldsForThisRecord' ) { >+ $exceeded_holds_per_record = 1; >+ $biblioloopiter{$canReserve} = 1; >+ } > elsif ( $canReserve eq 'ageRestricted' ) { > $template->param( $canReserve => 1 ); > $biblioloopiter{$canReserve} = 1; >@@ -256,9 +261,10 @@ foreach my $biblionumber (@biblionumbers) { > # For a librarian to be able to place multiple record holds for a patron for a record, > # we must find out what the maximum number of holds they can place for the patron is > my $max_holds_for_record = GetMaxPatronHoldsForRecord( $borrowerinfo->{borrowernumber}, $biblionumber ); >- $max_holds_for_record = $max_holds_for_record - $holds->count(); >- $biblioloopiter{max_holds_for_record} = $max_holds_for_record; >+ my $remaining_holds_for_record = $max_holds_for_record - $holds->count(); >+ $biblioloopiter{remaining_holds_for_record} = $max_holds_for_record; > $template->param( max_holds_for_record => $max_holds_for_record ); >+ $template->param( remaining_holds_for_record => $remaining_holds_for_record ); > } > > # Check to see if patron is allowed to place holds on records where the >@@ -635,6 +641,7 @@ foreach my $biblionumber (@biblionumbers) { > $template->param( biblioloop => \@biblioloop ); > $template->param( biblionumbers => $biblionumbers ); > $template->param( exceeded_maxreserves => $exceeded_maxreserves ); >+$template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); > > if ($multihold) { > $template->param( multi_hold => 1 ); >-- >2.1.4
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 14695
:
44143
|
44144
|
44145
|
45058
|
45059
|
45060
|
45061
|
45063
|
45064
|
46548
|
46549
|
46550
|
46551
|
46552
|
46553
|
46554
|
46555
|
46556
|
46557
|
46914
|
46915
|
46916
|
46917
|
46918
|
46919
|
46920
|
47183
|
47184
|
47185
|
47186
|
47187
|
47188
|
47189
|
47190
|
47191
|
47196
|
47227
|
47228
|
47229
|
47230
|
47231
|
47232
|
47233
|
47234
|
47355
|
47372
|
47606
|
47607
|
47608
|
47609
|
47610
|
47611
|
47612
|
47613
|
47614
|
47615
|
48792
|
48795
|
48796
|
48797
|
48798
|
48799
|
48800
|
48801
|
48802
|
48803
|
50056
|
50057
|
50058
|
50059
|
50060
|
50061
|
50062
|
50063
|
50064
|
50065
|
50327
|
50391
|
51006
|
51007
|
51008
|
51009
|
51010
|
51011
|
51012
|
51013
|
51014
|
51015
|
51016
|
51017
|
51027
|
51030
|
51031
|
51032
|
51033
|
51034
|
51035
|
51036
|
51037
|
51038
|
51039
|
51040
|
51041
|
51042
|
51277
|
51278
|
51279
|
51280
|
51281
|
51282
|
51283
|
51284
|
51285
|
51286
|
51287
|
51288
|
51289
|
52457
|
54546
|
54547
|
54548
|
54549
|
54550
|
54551
|
54552
|
54553
|
54554
|
54555
|
54556
|
54557
|
54558
|
54559
|
55114
|
55115
|
55116
|
55117
|
55118
|
55119
|
55120
|
55121
|
55122
|
55123
|
55124
|
55125
|
55126
|
55127
|
55128
|
55148
|
55149
|
55150
|
55151
|
55152
|
55153
|
55154
|
55155
|
55156
|
55157
|
55158
|
55159
|
55160
|
55161
|
55162
|
55163
|
55299
|
55332
|
55730
|
55731