|
Lines 78-85
$findborrower =~ s|,| |g;
Link Here
|
| 78 |
my $borrowernumber_hold = $input->param('borrowernumber') || ''; |
78 |
my $borrowernumber_hold = $input->param('borrowernumber') || ''; |
| 79 |
my $borrowerslist; |
79 |
my $borrowerslist; |
| 80 |
my $messageborrower; |
80 |
my $messageborrower; |
| 81 |
my $warnings; |
81 |
my $maxreserves; |
| 82 |
my $messages; |
|
|
| 83 |
|
82 |
|
| 84 |
my $date = C4::Dates->today('iso'); |
83 |
my $date = C4::Dates->today('iso'); |
| 85 |
my $action = $input->param('action'); |
84 |
my $action = $input->param('action'); |
|
Lines 127-133
if ($borrowernumber_hold && !$action) {
Link Here
|
| 127 |
my $diffbranch; |
126 |
my $diffbranch; |
| 128 |
my @getreservloop; |
127 |
my @getreservloop; |
| 129 |
my $count_reserv = 0; |
128 |
my $count_reserv = 0; |
| 130 |
my $maxreserves; |
|
|
| 131 |
|
129 |
|
| 132 |
# we check the reserves of the borrower, and if he can reserv a document |
130 |
# we check the reserves of the borrower, and if he can reserv a document |
| 133 |
# FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... |
131 |
# FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... |
|
Lines 136-142
if ($borrowernumber_hold && !$action) {
Link Here
|
| 136 |
GetReserveCount( $borrowerinfo->{'borrowernumber'} ); |
134 |
GetReserveCount( $borrowerinfo->{'borrowernumber'} ); |
| 137 |
|
135 |
|
| 138 |
if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) { |
136 |
if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) { |
| 139 |
$warnings = 1; |
|
|
| 140 |
$maxreserves = 1; |
137 |
$maxreserves = 1; |
| 141 |
} |
138 |
} |
| 142 |
|
139 |
|
|
Lines 145-156
if ($borrowernumber_hold && !$action) {
Link Here
|
| 145 |
my $expiry = 0; # flag set if patron account has expired |
142 |
my $expiry = 0; # flag set if patron account has expired |
| 146 |
if ($expiry_date and $expiry_date ne '0000-00-00' and |
143 |
if ($expiry_date and $expiry_date ne '0000-00-00' and |
| 147 |
Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { |
144 |
Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { |
| 148 |
$messages = $expiry = 1; |
145 |
$expiry = 1; |
| 149 |
} |
146 |
} |
| 150 |
|
147 |
|
| 151 |
# check if the borrower make the reserv in a different branch |
148 |
# check if the borrower make the reserv in a different branch |
| 152 |
if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) { |
149 |
if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) { |
| 153 |
$messages = 1; |
|
|
| 154 |
$diffbranch = 1; |
150 |
$diffbranch = 1; |
| 155 |
} |
151 |
} |
| 156 |
|
152 |
|
|
Lines 169-179
if ($borrowernumber_hold && !$action) {
Link Here
|
| 169 |
borrowercategory => $borrowerinfo->{'category'}, |
165 |
borrowercategory => $borrowerinfo->{'category'}, |
| 170 |
borrowerreservs => $count_reserv, |
166 |
borrowerreservs => $count_reserv, |
| 171 |
cardnumber => $borrowerinfo->{'cardnumber'}, |
167 |
cardnumber => $borrowerinfo->{'cardnumber'}, |
| 172 |
maxreserves => $maxreserves, |
|
|
| 173 |
expiry => $expiry, |
168 |
expiry => $expiry, |
| 174 |
diffbranch => $diffbranch, |
169 |
diffbranch => $diffbranch, |
| 175 |
messages => $messages, |
|
|
| 176 |
warnings => $warnings |
| 177 |
); |
170 |
); |
| 178 |
} |
171 |
} |
| 179 |
|
172 |
|
|
Lines 227-244
my @biblioloop = ();
Link Here
|
| 227 |
foreach my $biblionumber (@biblionumbers) { |
220 |
foreach my $biblionumber (@biblionumbers) { |
| 228 |
|
221 |
|
| 229 |
my %biblioloopiter = (); |
222 |
my %biblioloopiter = (); |
| 230 |
my $maxreserves; |
|
|
| 231 |
|
223 |
|
| 232 |
my $dat = GetBiblioData($biblionumber); |
224 |
my $dat = GetBiblioData($biblionumber); |
| 233 |
|
225 |
|
| 234 |
unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) { |
226 |
unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) { |
| 235 |
$warnings = 1; |
|
|
| 236 |
$maxreserves = 1; |
227 |
$maxreserves = 1; |
| 237 |
} |
228 |
} |
| 238 |
|
229 |
|
| 239 |
my $alreadypossession; |
230 |
my $alreadypossession; |
| 240 |
if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) { |
231 |
if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) { |
| 241 |
$warnings = 1; |
|
|
| 242 |
$alreadypossession = 1; |
232 |
$alreadypossession = 1; |
| 243 |
} |
233 |
} |
| 244 |
|
234 |
|
|
Lines 253-271
foreach my $biblionumber (@biblionumbers) {
Link Here
|
| 253 |
} |
243 |
} |
| 254 |
|
244 |
|
| 255 |
if ( defined $borrowerinfo && ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) ) { |
245 |
if ( defined $borrowerinfo && ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) ) { |
| 256 |
$warnings = 1; |
|
|
| 257 |
$alreadyreserved = 1; |
246 |
$alreadyreserved = 1; |
| 258 |
$biblioloopiter{warn} = 1; |
247 |
$biblioloopiter{warn} = 1; |
| 259 |
$biblioloopiter{alreadyres} = 1; |
248 |
$biblioloopiter{alreadyres} = 1; |
| 260 |
} |
249 |
} |
| 261 |
} |
250 |
} |
| 262 |
|
251 |
|
| 263 |
$template->param( alreadyreserved => $alreadyreserved, |
252 |
$template->param( |
| 264 |
messages => $messages, |
253 |
alreadyreserved => $alreadyreserved, |
| 265 |
warnings => $warnings, |
254 |
alreadypossession => $alreadypossession, |
| 266 |
maxreserves=>$maxreserves, |
255 |
); |
| 267 |
alreadypossession => $alreadypossession, |
|
|
| 268 |
); |
| 269 |
|
256 |
|
| 270 |
|
257 |
|
| 271 |
# FIXME think @optionloop, is maybe obsolete, or must be switchable by a systeme preference fixed rank or not |
258 |
# FIXME think @optionloop, is maybe obsolete, or must be switchable by a systeme preference fixed rank or not |
|
Lines 489-495
foreach my $biblionumber (@biblionumbers) {
Link Here
|
| 489 |
$template->param( override_required => 1 ); |
476 |
$template->param( override_required => 1 ); |
| 490 |
} elsif ( $num_available == 0 ) { |
477 |
} elsif ( $num_available == 0 ) { |
| 491 |
$template->param( none_available => 1 ); |
478 |
$template->param( none_available => 1 ); |
| 492 |
$template->param( warnings => 1 ); |
|
|
| 493 |
$biblioloopiter{warn} = 1; |
479 |
$biblioloopiter{warn} = 1; |
| 494 |
$biblioloopiter{none_avail} = 1; |
480 |
$biblioloopiter{none_avail} = 1; |
| 495 |
} |
481 |
} |
|
Lines 618-623
foreach my $biblionumber (@biblionumbers) {
Link Here
|
| 618 |
|
604 |
|
| 619 |
$template->param( biblioloop => \@biblioloop ); |
605 |
$template->param( biblioloop => \@biblioloop ); |
| 620 |
$template->param( biblionumbers => $biblionumbers ); |
606 |
$template->param( biblionumbers => $biblionumbers ); |
|
|
607 |
$template->param( maxreserves => $maxreserves ); |
| 621 |
|
608 |
|
| 622 |
if ($multihold) { |
609 |
if ($multihold) { |
| 623 |
$template->param( multi_hold => 1 ); |
610 |
$template->param( multi_hold => 1 ); |
| 624 |
- |
|
|