|
Lines 101-106
my @failedrenews = $query->param('failedrenew');
Link Here
|
| 101 |
my @renew_failed; |
101 |
my @renew_failed; |
| 102 |
for (@failedrenews) { $renew_failed[$_] = 1; } |
102 |
for (@failedrenews) { $renew_failed[$_] = 1; } |
| 103 |
|
103 |
|
|
|
104 |
my $sessionID = $query->cookie("CGISESSID") ; |
| 105 |
my $session = get_session($sessionID); |
| 106 |
my $sounderror; |
| 107 |
my @soundederrors = @{ $session->param( 'soundederrors' ) } if ( $session->param( 'soundederrors' ) ); |
| 108 |
my %soundederrors; |
| 109 |
for ( @soundederrors ) { $soundederrors{ $_ } = 1; } |
| 110 |
|
| 104 |
my $findborrower = $query->param('findborrower'); |
111 |
my $findborrower = $query->param('findborrower'); |
| 105 |
$findborrower =~ s|,| |g; |
112 |
$findborrower =~ s|,| |g; |
| 106 |
#$findborrower =~ s|'| |g; |
113 |
#$findborrower =~ s|'| |g; |
|
Lines 188-199
if ( $print eq 'yes' && $borrowernumber ne '' ) {
Link Here
|
| 188 |
my $borrowerslist; |
195 |
my $borrowerslist; |
| 189 |
my $message; |
196 |
my $message; |
| 190 |
if ($findborrower) { |
197 |
if ($findborrower) { |
|
|
198 |
$session->clear( 'soundederrors' ); |
| 199 |
@soundederrors = (); |
| 200 |
%soundederrors = (); |
| 191 |
my ( $count, $borrowers ) = |
201 |
my ( $count, $borrowers ) = |
| 192 |
SearchMember($findborrower, 'cardnumber', 'web' ); |
202 |
SearchMember($findborrower, 'cardnumber', 'web' ); |
| 193 |
my @borrowers = @$borrowers; |
203 |
my @borrowers = @$borrowers; |
| 194 |
if ( $#borrowers == -1 ) { |
204 |
if ( $#borrowers == -1 ) { |
| 195 |
$query->param( 'findborrower', '' ); |
205 |
$query->param( 'findborrower', '' ); |
| 196 |
$message = "'$findborrower'"; |
206 |
$message = "'$findborrower'"; |
|
|
207 |
$sounderror = 1; |
| 197 |
} |
208 |
} |
| 198 |
elsif ( $#borrowers == 0 ) { |
209 |
elsif ( $#borrowers == 0 ) { |
| 199 |
$query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} ); |
210 |
$query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} ); |
|
Lines 212-217
if ($borrowernumber) {
Link Here
|
| 212 |
$borrower = GetMemberDetails( $borrowernumber, 0 ); |
223 |
$borrower = GetMemberDetails( $borrowernumber, 0 ); |
| 213 |
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
224 |
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
| 214 |
|
225 |
|
|
|
226 |
if ( $od && ! $soundederrors{ ODUES } ) { |
| 227 |
$sounderror = 1; |
| 228 |
$soundederrors{ ODUES } = 1; |
| 229 |
} |
| 230 |
if ( $fines > 0 && ! $soundederrors{ CHARGES } ) { |
| 231 |
$sounderror = 1; |
| 232 |
$soundederrors{ CHARGES } = 1; |
| 233 |
} |
| 234 |
|
| 215 |
# Warningdate is the date that the warning starts appearing |
235 |
# Warningdate is the date that the warning starts appearing |
| 216 |
my ( $today_year, $today_month, $today_day ) = Today(); |
236 |
my ( $today_year, $today_month, $today_day ) = Today(); |
| 217 |
my ( $warning_year, $warning_month, $warning_day ) = split /-/, |
237 |
my ( $warning_year, $warning_month, $warning_day ) = split /-/, |
|
Lines 234-239
if ($borrowernumber) {
Link Here
|
| 234 |
expired => format_date($borrower->{dateexpiry}), |
254 |
expired => format_date($borrower->{dateexpiry}), |
| 235 |
renewaldate => format_date("$renew_year-$renew_month-$renew_day") |
255 |
renewaldate => format_date("$renew_year-$renew_month-$renew_day") |
| 236 |
); |
256 |
); |
|
|
257 |
unless ( $soundederrors{ EXPIRED } ) { |
| 258 |
$sounderror = 1; |
| 259 |
$soundederrors{ EXPIRED } = 1; |
| 260 |
} |
| 237 |
} |
261 |
} |
| 238 |
# check for NotifyBorrowerDeparture |
262 |
# check for NotifyBorrowerDeparture |
| 239 |
elsif ( C4::Context->preference('NotifyBorrowerDeparture') && |
263 |
elsif ( C4::Context->preference('NotifyBorrowerDeparture') && |
|
Lines 271-276
if ($barcode) {
Link Here
|
| 271 |
IMPOSSIBLE => 1 |
295 |
IMPOSSIBLE => 1 |
| 272 |
); |
296 |
); |
| 273 |
$noerror = 0; |
297 |
$noerror = 0; |
|
|
298 |
$sounderror = 1; |
| 274 |
} |
299 |
} |
| 275 |
|
300 |
|
| 276 |
if ($issueconfirmed && $noerror) { |
301 |
if ($issueconfirmed && $noerror) { |
|
Lines 293-298
if ($barcode) {
Link Here
|
| 293 |
NEEDSCONFIRMATION => 1 |
318 |
NEEDSCONFIRMATION => 1 |
| 294 |
); |
319 |
); |
| 295 |
$noquestion = 0; |
320 |
$noquestion = 0; |
|
|
321 |
$sounderror = 1; |
| 296 |
} |
322 |
} |
| 297 |
# Because of the weird conditional structure (empty elsif block), |
323 |
# Because of the weird conditional structure (empty elsif block), |
| 298 |
# if we reached here, $issueconfirmed must be false. |
324 |
# if we reached here, $issueconfirmed must be false. |
|
Lines 563-574
foreach $flag ( sort keys %$flags ) {
Link Here
|
| 563 |
); |
589 |
); |
| 564 |
if ( $flag eq 'GNA' ) { |
590 |
if ( $flag eq 'GNA' ) { |
| 565 |
$template->param( gna => 'true' ); |
591 |
$template->param( gna => 'true' ); |
|
|
592 |
unless ( $soundederrors{ GNA } ) { |
| 593 |
$sounderror = 1; |
| 594 |
$soundederrors{ GNA } = 1; |
| 595 |
} |
| 566 |
} |
596 |
} |
| 567 |
if ( $flag eq 'LOST' ) { |
597 |
if ( $flag eq 'LOST' ) { |
| 568 |
$template->param( lost => 'true' ); |
598 |
$template->param( lost => 'true' ); |
|
|
599 |
unless ( $soundederrors{ LOST } ) { |
| 600 |
$sounderror = 1; |
| 601 |
$soundederrors{ LOST } = 1; |
| 602 |
} |
| 569 |
} |
603 |
} |
| 570 |
if ( $flag eq 'DBARRED' ) { |
604 |
if ( $flag eq 'DBARRED' ) { |
| 571 |
$template->param( dbarred => 'true' ); |
605 |
$template->param( dbarred => 'true' ); |
|
|
606 |
unless ( $soundederrors{ DBARRED } ) { |
| 607 |
$sounderror = 1; |
| 608 |
$soundederrors{ DBARRED } = 1; |
| 609 |
} |
| 572 |
} |
610 |
} |
| 573 |
if ( $flag eq 'CHARGES' ) { |
611 |
if ( $flag eq 'CHARGES' ) { |
| 574 |
$template->param( |
612 |
$template->param( |
|
Lines 576-581
foreach $flag ( sort keys %$flags ) {
Link Here
|
| 576 |
chargesmsg => $flags->{'CHARGES'}->{'message'}, |
614 |
chargesmsg => $flags->{'CHARGES'}->{'message'}, |
| 577 |
charges_is_blocker => 1 |
615 |
charges_is_blocker => 1 |
| 578 |
); |
616 |
); |
|
|
617 |
unless ( $soundederrors{ CHARGES } ) { |
| 618 |
$sounderror = 1; |
| 619 |
$soundederrors{ CHARGES } = 1; |
| 620 |
} |
| 579 |
} |
621 |
} |
| 580 |
if ( $flag eq 'CREDITS' ) { |
622 |
if ( $flag eq 'CREDITS' ) { |
| 581 |
$template->param( |
623 |
$template->param( |
|
Lines 591-596
foreach $flag ( sort keys %$flags ) {
Link Here
|
| 591 |
flagged => 1, |
633 |
flagged => 1, |
| 592 |
chargesmsg => $flags->{'CHARGES'}->{'message'} |
634 |
chargesmsg => $flags->{'CHARGES'}->{'message'} |
| 593 |
); |
635 |
); |
|
|
636 |
unless ( $soundederrors{ CHARGES } ) { |
| 637 |
$sounderror = 1; |
| 638 |
$soundederrors{ CHARGES } = 1; |
| 639 |
} |
| 594 |
} |
640 |
} |
| 595 |
if ( $flag eq 'CREDITS' ) { |
641 |
if ( $flag eq 'CREDITS' ) { |
| 596 |
$template->param( |
642 |
$template->param( |
|
Lines 604-609
foreach $flag ( sort keys %$flags ) {
Link Here
|
| 604 |
flagged => 1, |
650 |
flagged => 1, |
| 605 |
oduesmsg => $flags->{'ODUES'}->{'message'} |
651 |
oduesmsg => $flags->{'ODUES'}->{'message'} |
| 606 |
); |
652 |
); |
|
|
653 |
unless ( $soundederrors{ ODUES } ) { |
| 654 |
$sounderror = 1; |
| 655 |
$soundederrors{ ODUES } = 1; |
| 656 |
} |
| 607 |
|
657 |
|
| 608 |
my $items = $flags->{$flag}->{'itemlist'}; |
658 |
my $items = $flags->{$flag}->{'itemlist'}; |
| 609 |
# useless ??? |
659 |
# useless ??? |
|
Lines 714-719
if ($stickyduedate) {
Link Here
|
| 714 |
my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); |
764 |
my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); |
| 715 |
$template->param( picture => 1 ) if $picture; |
765 |
$template->param( picture => 1 ) if $picture; |
| 716 |
|
766 |
|
|
|
767 |
$session->param('soundederrors', [ keys %soundederrors ] ); |
| 768 |
$template->param( |
| 769 |
sounderror => $sounderror, |
| 770 |
); |
| 717 |
|
771 |
|
| 718 |
$template->param( |
772 |
$template->param( |
| 719 |
debt_confirmed => $debt_confirmed, |
773 |
debt_confirmed => $debt_confirmed, |