View | Details | Raw Unified | Return to bug 1080
Collapse All | Expand All

(-)a/circ/circulation.pl (+54 lines)
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,
(-)a/circ/returns.pl (+12 lines)
Lines 73-78 my $printers = GetPrinters(); Link Here
73
#my $branch  = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
73
#my $branch  = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
74
my $printer = C4::Context->userenv?C4::Context->userenv->{'branchprinter'}:"";
74
my $printer = C4::Context->userenv?C4::Context->userenv->{'branchprinter'}:"";
75
my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
75
my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
76
my $sounderror;
77
my $soundok;
76
#
78
#
77
# Some code to handle the error if there is no branch or printer setting.....
79
# Some code to handle the error if there is no branch or printer setting.....
78
#
80
#
Lines 148-153 if ( $query->param('resbarcode') ) { Link Here
148
150
149
151
150
    if ( $messages->{'transfert'} ) {
152
    if ( $messages->{'transfert'} ) {
153
	$sounderror = 1;
151
        $template->param(
154
        $template->param(
152
            itemtitle      => $iteminfo->{'title'},
155
            itemtitle      => $iteminfo->{'title'},
153
			itembiblionumber => $iteminfo->{'biblionumber'},
156
			itembiblionumber => $iteminfo->{'biblionumber'},
Lines 206-211 if ($barcode) { Link Here
206
        itembiblionumber => $biblio->{'biblionumber'},    
209
        itembiblionumber => $biblio->{'biblionumber'},    
207
    );
210
    );
208
    if ($returned) {
211
    if ($returned) {
212
	$soundok = 1;
209
        $returneditems{0}    = $barcode;
213
        $returneditems{0}    = $barcode;
210
        $riborrowernumber{0} = $borrower->{'borrowernumber'};
214
        $riborrowernumber{0} = $borrower->{'borrowernumber'};
211
        $riduedate{0}        = $issueinformation->{'date_due'};
215
        $riduedate{0}        = $issueinformation->{'date_due'};
Lines 243-248 if ($barcode) { Link Here
243
        }
247
        }
244
        push( @inputloop, \%input );
248
        push( @inputloop, \%input );
245
    }
249
    }
250
    if ( ! $returned ) {
251
	$sounderror = 1;
252
    }
246
}
253
}
247
$template->param( inputloop => \@inputloop );
254
$template->param( inputloop => \@inputloop );
248
255
Lines 310-315 if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { Link Here
310
# reserve found and item arrived at the expected branch
317
# reserve found and item arrived at the expected branch
311
#
318
#
312
if ( $messages->{'ResFound'}) {
319
if ( $messages->{'ResFound'}) {
320
    $sounderror = 1;
313
    my $reserve        = $messages->{'ResFound'};
321
    my $reserve        = $messages->{'ResFound'};
314
    my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'};
322
    my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'};
315
    my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 );
323
    my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 );
Lines 454-459 if ($borrower) { Link Here
454
        $flaginfo{redfont} = ( $flags->{$flag}->{'noissues'} );
462
        $flaginfo{redfont} = ( $flags->{$flag}->{'noissues'} );
455
        $flaginfo{flag}    = $flag;
463
        $flaginfo{flag}    = $flag;
456
        if ( $flag eq 'CHARGES' ) {
464
        if ( $flag eq 'CHARGES' ) {
465
	    $sounderror = 1;
457
            $flaginfo{msg}            = $flag;
466
            $flaginfo{msg}            = $flag;
458
            $flaginfo{charges}        = 1;
467
            $flaginfo{charges}        = 1;
459
            $flaginfo{borrowernumber} = $borrower->{borrowernumber};
468
            $flaginfo{borrowernumber} = $borrower->{borrowernumber};
Lines 478-483 if ($borrower) { Link Here
478
            $flaginfo{itemloop} = \@waitingitemloop;
487
            $flaginfo{itemloop} = \@waitingitemloop;
479
        }
488
        }
480
        elsif ( $flag eq 'ODUES' ) {
489
        elsif ( $flag eq 'ODUES' ) {
490
	    $sounderror = 1;
481
            my $items = $flags->{$flag}->{'itemlist'};
491
            my $items = $flags->{$flag}->{'itemlist'};
482
            my @itemloop;
492
            my @itemloop;
483
            foreach my $item ( sort { $a->{'date_due'} cmp $b->{'date_due'} }
493
            foreach my $item ( sort { $a->{'date_due'} cmp $b->{'date_due'} }
Lines 581-586 $template->param( Link Here
581
    dropboxmode              => $dropboxmode,
591
    dropboxmode              => $dropboxmode,
582
    dropboxdate				=> $dropboxdate->output(),
592
    dropboxdate				=> $dropboxdate->output(),
583
	overduecharges          => $overduecharges,
593
	overduecharges          => $overduecharges,
594
    sounderror              => $sounderror,
595
    soundok                 => $soundok,
584
);
596
);
585
597
586
# actually print the page!
598
# actually print the page!
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl (+3 lines)
Lines 60-65 $.tablesorter.addParser({ Link Here
60
<!-- /TMPL_IF -->
60
<!-- /TMPL_IF -->
61
61
62
<!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
62
<!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
63
<!-- TMPL_IF NAME="sounderror" --><EMBED src="/intranet-tmpl/prog/img/error.swf" quality="high"  WIDTH="1" HEIGHT="1" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED><!-- /TMPL_IF -->
64
<!-- TMPL_IF NAME="inprocess" --><!-- Sound on successful issueing --><EMBED src="/intranet-tmpl/prog/img/ok.swf" quality="high"  WIDTH="1" HEIGHT="1" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED><!-- /TMPL_IF -->
65
63
<!-- TMPL_IF NAME="dateexpiry" --><div class="dialog message">Patron's account has been renewed until <!-- TMPL_VAR NAME="dateexpiry" --></div><!-- /TMPL_IF -->
66
<!-- TMPL_IF NAME="dateexpiry" --><div class="dialog message">Patron's account has been renewed until <!-- TMPL_VAR NAME="dateexpiry" --></div><!-- /TMPL_IF -->
64
<!-- TMPL_IF NAME="NEEDSCONFIRMATION" -->
67
<!-- TMPL_IF NAME="NEEDSCONFIRMATION" -->
65
<div class="yui-g">
68
<div class="yui-g">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl (+2 lines)
Lines 317-322 function Dopop(link) { Link Here
317
    </form>
317
    </form>
318
</div>
318
</div>
319
319
320
<!-- TMPL_IF NAME="sounderror" --><EMBED src="/intranet-tmpl/prog/img/error.swf" quality="high"  WIDTH="1" HEIGHT="1" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED><!-- /TMPL_IF -->
321
<!-- TMPL_IF NAME="soundok" --><EMBED src="/intranet-tmpl/prog/img/ok.swf" quality="high"  WIDTH="1" HEIGHT="1" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED><!-- /TMPL_IF -->
320
<!-- TMPL_IF Name="returned" -->
322
<!-- TMPL_IF Name="returned" -->
321
<div class="yui-g">    <table>
323
<div class="yui-g">    <table>
322
        <tr><th>Item Information</th><th>Patron Information</th></tr>
324
        <tr><th>Item Information</th><th>Patron Information</th></tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl (+1 lines)
Lines 81-86 if (nodename =="barcodes[]"){ Link Here
81
	<div id="yui-main">
81
	<div id="yui-main">
82
	<div class="yui-b">
82
	<div class="yui-b">
83
<!-- TMPL_INCLUDE NAME="members-toolbar.inc" -->
83
<!-- TMPL_INCLUDE NAME="members-toolbar.inc" -->
84
<!-- TMPL_IF NAME="sounderror" --><EMBED src="/intranet-tmpl/prog/img/error.swf" quality="high"  WIDTH="1" HEIGHT="1" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED><!-- <!-- TMPL_VAR NAME="sounderror" --> --><!-- /TMPL_IF -->
84
<!-- TMPL_IF NAME="error" -->
85
<!-- TMPL_IF NAME="error" -->
85
<div class="dialog alert">
86
<div class="dialog alert">
86
<!-- TMPL_IF NAME="AUTH_UPDATE_FAILED" -->
87
<!-- TMPL_IF NAME="AUTH_UPDATE_FAILED" -->
(-)a/members/member.pl (+4 lines)
Lines 78-83 $orderby = "surname,firstname" unless $orderby; Link Here
78
$member =~ s/,//g;   #remove any commas from search string
78
$member =~ s/,//g;   #remove any commas from search string
79
$member =~ s/\*/%/g;
79
$member =~ s/\*/%/g;
80
80
81
my $sessionID = $input->cookie("CGISESSID") ;
82
my $session = C4::Auth::get_session($sessionID);
83
$session->clear( 'soundederrors' );
84
81
my ($count,$results);
85
my ($count,$results);
82
86
83
if(length($member) == 1)
87
if(length($member) == 1)
(-)a/members/moremember.pl (-1 / +39 lines)
Lines 97-102 if ( not defined $data ) { Link Here
97
    exit;
97
    exit;
98
}
98
}
99
99
100
my $sessionID = $input->cookie("CGISESSID") ;
101
my $session = C4::Auth::get_session($sessionID);
102
my $sounderror;
103
my @soundederrors = @{ $session->param( 'soundederrors' ) } if ( $session->param( 'soundederrors' ) );
104
my %soundederrors;
105
for ( @soundederrors ) { $soundederrors{ $_ } = 1; }
106
107
if ( $$data{ debarred } && !$soundederrors{ DBARRED } ) {
108
    $sounderror = 1;
109
    $soundederrors{ DBARRED } = 1;
110
}
111
if ( $$data{ gonenoaddress } && !$soundederrors{ GNA } ) {
112
    $sounderror = 1;
113
    $soundederrors{ GNA } = 1;
114
}
115
if ( $$data{ lost } && !$soundederrors{ LOST } ) {
116
    $sounderror = 1;
117
    $soundederrors{ LOST } = 1;
118
}
119
if ( $$data{ dateexpiry } lt POSIX::strftime( "%Y-%m-%d", localtime ) && !$soundederrors{ EXPIRED } ) {
120
    $sounderror = 1;
121
    $soundederrors{ EXPIRED } = 1;
122
}
123
100
# re-reregistration function to automatic calcul of date expiry
124
# re-reregistration function to automatic calcul of date expiry
101
if ( $reregistration eq 'y' ) {
125
if ( $reregistration eq 'y' ) {
102
	$data->{'dateexpiry'} = ExtendMemberSubscriptionTo( $borrowernumber );
126
	$data->{'dateexpiry'} = ExtendMemberSubscriptionTo( $borrowernumber );
Lines 212-217 my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} ); Link Here
212
( $template->param( lib1 => $lib1 ) ) if ($lib1);
236
( $template->param( lib1 => $lib1 ) ) if ($lib1);
213
( $template->param( lib2 => $lib2 ) ) if ($lib2);
237
( $template->param( lib2 => $lib2 ) ) if ($lib2);
214
238
239
if ( $total > 0 && ! $soundederrors{ CHARGES } ) {
240
    $sounderror = 1;
241
    $soundederrors{ CHARGES } = 1;
242
}
243
215
# current issues
244
# current issues
216
#
245
#
217
my ( $count, $issue ) = GetPendingIssues($borrowernumber);
246
my ( $count, $issue ) = GetPendingIssues($borrowernumber);
Lines 231-236 for ( my $i = 0 ; $i < $count ; $i++ ) { Link Here
231
    if ( $datedue lt $today ) {
260
    if ( $datedue lt $today ) {
232
        $overdues_exist = 1;
261
        $overdues_exist = 1;
233
        $row{'red'} = 1;    #print "<font color=red>";
262
        $row{'red'} = 1;    #print "<font color=red>";
263
264
	unless ( $soundederrors{ ODUES } ) {
265
	    $sounderror = 1;
266
	    $soundederrors{ ODUES } = 1;
267
	}
234
	}
268
	}
235
    $row{toggle} = $toggle++ % 2;
269
    $row{toggle} = $toggle++ % 2;
236
270
Lines 363-366 $template->param( Link Here
363
	dateformat    => C4::Context->preference("dateformat"),
397
	dateformat    => C4::Context->preference("dateformat"),
364
);
398
);
365
399
400
$session->param('soundederrors', [ keys %soundederrors ] );
401
$template->param(
402
    sounderror => $sounderror,
403
    );
404
366
output_html_with_http_headers $input, $cookie, $template->output;
405
output_html_with_http_headers $input, $cookie, $template->output;
367
- 

Return to bug 1080