Bugzilla – Attachment 18827 Details for
Bug 10247
Too many reserves due to syspref does not show warning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 10247 - Too many reserves due to syspref does not show warning
SIGNED-OFF-Bug-10247---Too-many-reserves-due-to-sy.patch (text/plain), 6.46 KB, created by
Srdjan Jankovic
on 2013-06-11 01:47:42 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 10247 - Too many reserves due to syspref does not show warning
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2013-06-11 01:47:42 UTC
Size:
6.46 KB
patch
obsolete
>From 8ddbfb88443cab096a7c0f6383094ac36b75befa Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 15 May 2013 11:52:57 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 10247 - Too many reserves due to syspref > does not show warning > >On intranet, when placing a reserve : >If borrower as reached the reserves quota, a warning should appear : > Cannot place hold > * Too Many Holds: TEST has too many holds. > >This works when quota defined in circulation rules is reached but not when quota specified in syspref maxreserves is reached, in case this quota is lower than the one defined is circulation rules. > >This is because template param maxreserves is set twice, this patch corrects this bug. >Also moves warnings and messages conditionnal variable from perl to template because it cause the same bug as for maxreserves. > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> >--- > .../prog/en/modules/reserve/request.tt | 8 +++---- > reserve/request.pl | 27 ++++++---------------- > 2 files changed, 11 insertions(+), 24 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 f2c7564..93b9849 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -206,7 +206,7 @@ function checkMultiHold() { > </form> > [% ELSE %] > >-[% IF ( warnings ) %] >+[% IF ( maxreserves || alreadyreserved || none_available || alreadypossession ) %] > <div class="dialog alert"> > > [% UNLESS ( multi_hold ) %] >@@ -232,13 +232,13 @@ function checkMultiHold() { > </div> > [% END %] > >-[% IF ( messages ) %] >- <div class="dialog message"><ul> >+[% IF ( expiry || diffbranch ) %] >+<div class="dialog message"><ul> > [% IF ( expiry ) %] > <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>'s <strong>account has expired</strong></li> > [% END %] > >-[% IF ( diffbranch ) %] >+ [% IF ( diffbranch ) %] > <li> <strong>Pickup library is different</strong> than <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>'s home library ([% borrower_branchname %] / [% borrower_branchcode %] )</li> > [% END %] > >diff --git a/reserve/request.pl b/reserve/request.pl >index aea1ff8..3f6d9b4 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -77,8 +77,7 @@ $findborrower = '' unless defined $findborrower; > $findborrower =~ s|,| |g; > my $borrowernumber_hold = $input->param('borrowernumber') || ''; > my $messageborrower; >-my $warnings; >-my $messages; >+my $maxreserves; > > my $date = C4::Dates->today('iso'); > my $action = $input->param('action'); >@@ -126,7 +125,6 @@ if ($borrowernumber_hold && !$action) { > my $diffbranch; > my @getreservloop; > my $count_reserv = 0; >- my $maxreserves; > > # we check the reserves of the borrower, and if he can reserv a document > # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... >@@ -135,7 +133,6 @@ if ($borrowernumber_hold && !$action) { > GetReserveCount( $borrowerinfo->{'borrowernumber'} ); > > if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) { >- $warnings = 1; > $maxreserves = 1; > } > >@@ -144,12 +141,11 @@ if ($borrowernumber_hold && !$action) { > my $expiry = 0; # flag set if patron account has expired > if ($expiry_date and $expiry_date ne '0000-00-00' and > Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { >- $messages = $expiry = 1; >+ $expiry = 1; > } > > # check if the borrower make the reserv in a different branch > if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) { >- $messages = 1; > $diffbranch = 1; > } > >@@ -168,11 +164,8 @@ if ($borrowernumber_hold && !$action) { > borrowercategory => $borrowerinfo->{'category'}, > borrowerreservs => $count_reserv, > cardnumber => $borrowerinfo->{'cardnumber'}, >- maxreserves => $maxreserves, > expiry => $expiry, > diffbranch => $diffbranch, >- messages => $messages, >- warnings => $warnings > ); > } > >@@ -194,18 +187,15 @@ my @biblioloop = (); > foreach my $biblionumber (@biblionumbers) { > > my %biblioloopiter = (); >- my $maxreserves; > > my $dat = GetBiblioData($biblionumber); > > unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) { >- $warnings = 1; > $maxreserves = 1; > } > > my $alreadypossession; > if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) { >- $warnings = 1; > $alreadypossession = 1; > } > >@@ -220,19 +210,16 @@ foreach my $biblionumber (@biblionumbers) { > } > > if ( defined $borrowerinfo && ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) ) { >- $warnings = 1; > $alreadyreserved = 1; > $biblioloopiter{warn} = 1; > $biblioloopiter{alreadyres} = 1; > } > } > >- $template->param( alreadyreserved => $alreadyreserved, >- messages => $messages, >- warnings => $warnings, >- maxreserves=>$maxreserves, >- alreadypossession => $alreadypossession, >- ); >+ $template->param( >+ alreadyreserved => $alreadyreserved, >+ alreadypossession => $alreadypossession, >+ ); > > > # FIXME think @optionloop, is maybe obsolete, or must be switchable by a systeme preference fixed rank or not >@@ -456,7 +443,6 @@ foreach my $biblionumber (@biblionumbers) { > $template->param( override_required => 1 ); > } elsif ( $num_available == 0 ) { > $template->param( none_available => 1 ); >- $template->param( warnings => 1 ); > $biblioloopiter{warn} = 1; > $biblioloopiter{none_avail} = 1; > } >@@ -590,6 +576,7 @@ foreach my $biblionumber (@biblionumbers) { > > $template->param( biblioloop => \@biblioloop ); > $template->param( biblionumbers => $biblionumbers ); >+$template->param( maxreserves => $maxreserves ); > > if ($multihold) { > $template->param( multi_hold => 1 ); >-- >1.8.1.2
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 10247
:
18148
|
18827
|
19190