</form>
[% ELSE %]
-[% IF ( warnings ) %]
+[% IF ( maxreserves || alreadyreserved || none_available || alreadypossession ) %]
<div class="dialog alert">
[% UNLESS ( multi_hold ) %]
</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 %]
$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');
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" ...
GetReserveCount( $borrowerinfo->{'borrowernumber'} );
if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) {
- $warnings = 1;
$maxreserves = 1;
}
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;
}
borrowercategory => $borrowerinfo->{'category'},
borrowerreservs => $count_reserv,
cardnumber => $borrowerinfo->{'cardnumber'},
- maxreserves => $maxreserves,
expiry => $expiry,
diffbranch => $diffbranch,
- messages => $messages,
- warnings => $warnings
);
}
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;
}
if ( $holds_count ) {
$alreadyreserved = 1;
- $warnings = 1;
$biblioloopiter{warn} = 1;
$biblioloopiter{alreadyres} = 1;
}
- $template->param( alreadyreserved => $alreadyreserved,
- messages => $messages,
- warnings => $warnings,
- maxreserves => $maxreserves,
+ $template->param(
+ alreadyreserved => $alreadyreserved,
alreadypossession => $alreadypossession,
);
$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;
}
$template->param( biblioloop => \@biblioloop );
$template->param( biblionumbers => $biblionumbers );
+$template->param( maxreserves => $maxreserves );
if ($multihold) {
$template->param( multi_hold => 1 );