Bugzilla – Attachment 53 Details for
Bug 1080
How about telling the template to make a noise on circulation errors?
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patches.
circ_errorsound.patch (text/plain), 7.85 KB, created by
Chris Cormack
on 2006-05-31 05:49:00 UTC
(
hide
)
Description:
proposed patches.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2006-05-31 05:49:00 UTC
Size:
7.85 KB
patch
obsolete
>diff -rc koha-2.2.5-orig/intranet-cgi/circ/circulation.pl koha-2.2.5-patch/intranet-cgi/circ/circulation.pl >*** koha-2.2.5-orig/intranet-cgi/circ/circulation.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/circ/circulation.pl 2006-05-23 17:10:33.000000000 -0600 >*************** >*** 104,115 **** >--- 119,133 ---- > # > my $borrowerslist; > my $message; >+ my $errorsound; > if ($findborrower) { > my ($count,$borrowers)=BornameSearch(\%env,$findborrower,'cardnumber','web'); > my @borrowers=@$borrowers; >+ $borrowernumber = 0; > if ($#borrowers == -1) { > $query->param('findborrower', ''); > $message = "'$findborrower'"; >+ $errorsound = 1; > } elsif ($#borrowers == 0) { > $query->param('borrnumber', $borrowers[0]->{'borrowernumber'}); > $query->param('barcode',''); >*************** >*** 149,166 **** > my ($datedue, $invalidduedate) = fixdate($year, $month, $day); > if ($issueconfirmed) { > issuebook(\%env, $borrower, $barcode, $datedue,$cancelreserve); > } else { > my ($error, $question) = canbookbeissued(\%env, $borrower, $barcode, $year, $month, $day); > my $noerror=1; > my $noquestion = 1; > foreach my $impossible (keys %$error) { > $template->param($impossible => $$error{$impossible}, > IMPOSSIBLE => 1); > $noerror = 0; > } > foreach my $needsconfirmation (keys %$question) { > $template->param($needsconfirmation => $$question{$needsconfirmation}, > NEEDSCONFIRMATION => 1); > $noquestion = 0; > } > $template->param(day => $day, >--- 175,194 ---- > my ($datedue, $invalidduedate) = fixdate($year, $month, $day); > if ($issueconfirmed) { > issuebook(\%env, $borrower, $barcode, $datedue,$cancelreserve); > } else { > my ($error, $question) = canbookbeissued(\%env, $borrower, $barcode, $year, $month, $day); > my $noerror=1; > my $noquestion = 1; > foreach my $impossible (keys %$error) { > $template->param($impossible => $$error{$impossible}, > IMPOSSIBLE => 1); >! $errorsound = 1; > $noerror = 0; > } > foreach my $needsconfirmation (keys %$question) { > $template->param($needsconfirmation => $$question{$needsconfirmation}, > NEEDSCONFIRMATION => 1); >! $errorsound = 1; > $noquestion = 0; > } > $template->param(day => $day, >*************** >*** 307,312 **** >--- 375,384 ---- > todayissues => \@realtodayissues, > previssues => \@realprevissues, > ); >+ if ($errorsound) { >+ $template->param(ERROR_SOUND => 1); >+ } >+ > # set return date if stickyduedate > if ($stickyduedate) { > my $t_year = "year".$year; >*************** >*** 345,350 **** >--- 427,433 ---- > flagged => 1, > noissues => 'true', > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > if ($flag eq 'GNA'){ > $template->param( > gna => 'true' >*************** >*** 363,378 **** > if ($flag eq 'CHARGES') { > $template->param( > charges => 'true', > chargesmsg => $flags->{'CHARGES'}->{'message'} > ); > } > } else { > if ($flag eq 'CHARGES') { > $template->param( > charges => 'true', > flagged => 1, > chargesmsg => $flags->{'CHARGES'}->{'message'} > ); > } > if ($flag eq 'WAITING') { > my $items=$flags->{$flag}->{'itemlist'}; >--- 446,463 ---- > if ($flag eq 'CHARGES') { > $template->param( > charges => 'true', > chargesmsg => $flags->{'CHARGES'}->{'message'} > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > } > } else { > if ($flag eq 'CHARGES') { > $template->param( > charges => 'true', > flagged => 1, > chargesmsg => $flags->{'CHARGES'}->{'message'} > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > } > if ($flag eq 'WAITING') { > my $items=$flags->{$flag}->{'itemlist'}; >*************** >*** 388,400 **** > waitingmsg => $flags->{'WAITING'}->{'message'}, > itemswaiting => \@itemswaiting, > ); > } > if ($flag eq 'ODUES') { > $template->param( > odues => 'true', > flagged => 1, > oduesmsg => $flags->{'ODUES'}->{'message'} > ); > > my $items=$flags->{$flag}->{'itemlist'}; > { >--- 473,487 ---- > waitingmsg => $flags->{'WAITING'}->{'message'}, > itemswaiting => \@itemswaiting, > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > } > if ($flag eq 'ODUES') { > $template->param( > odues => 'true', > flagged => 1, > oduesmsg => $flags->{'ODUES'}->{'message'} > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > > my $items=$flags->{$flag}->{'itemlist'}; > { >*************** >*** 412,419 **** > $template->param( > notes => 'true', > flagged => 1, > notesmsg => $flags->{'NOTES'}->{'message'} > ); > } > } > } >--- 499,507 ---- > $template->param( > notes => 'true', > flagged => 1, > notesmsg => $flags->{'NOTES'}->{'message'} > ); >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrowernumber); > } > } > } >diff -rc koha-2.2.5-orig/intranet-cgi/circ/returns.pl koha-2.2.5-patch/intranet-cgi/circ/returns.pl >*** koha-2.2.5-orig/intranet-cgi/circ/returns.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/circ/returns.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 135,140 **** >--- 135,141 ---- > > my $iteminformation; > my $borrower; >+ my $errorsound; > my $returned = 0; > my $messages; > my $barcode = $query->param('barcode'); >*************** >*** 401,406 **** >--- 406,425 ---- > ribortitle => $borrower->{'title'}, > riborfirstname => $borrower->{'firstname'} > ); >+ >+ if ($$flags{'GNA'} || $$flags{'LOST'} || $$flags{'DBARRED'} || $$flags{'CHARGES'} || $$flags{'WAITING'} || $$flags{'ODUES'}) { >+ $errorsound = 1 unless ($query->cookie('patron') eq $borrower->{'borrowernumber'}); >+ } >+ >+ if ($errorsound) { >+ $template->param(ERROR_SOUND => 1); >+ } > > # Check borrower cookie > if ($query->cookie('patron') != $borrower->{'borrowernumber'}) { > my $patroncookie = $query->cookie(-name=>'patron', -value=>$borrower->{'borrowernumber'}, -expires=>'+1y'); > $cookie = [@$cookie, $patroncookie]; > } > } > > my $color = ''; >diff -rc koha-2.2.5-orig/intranet-cgi/members/moremember.pl koha-2.2.5-patch/intranet-cgi/members/moremember.pl >*** koha-2.2.5-orig/intranet-cgi/members/moremember.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/members/moremember.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 69,74 **** >--- 69,82 ---- > }); > > my $bornum=$input->param('bornum'); >+ my $errorsound; > > #check patron cookie > > if ($bornum != $input->cookie('patron')) { > my $patroncookie = $input->cookie(-name=>'patron', -value=>"$bornum", -expires=>'+1h'); > $cookie = [@$cookie, $patroncookie]; > } > > #start the page and read in includes > >*************** >*** 83,88 **** >--- 91,109 ---- > > if($data->{'debarred'} || $data->{'gonenoaddress'} || $data->{'lost'} || $data->{'borrowernotes'}){ > $template->param(flagged =>1); >+ $errorsound = 1 unless ($input->cookie('patron') eq $bornum); >+ } >+ >+ # More stuff to trigger error sound >+ { >+ my $env; >+ my ($odues, $items) = C4::Circulation::Circ2::checkoverdues($env, $bornum, $dbh); >+ my $amount = C4::Circulation::Circ2::checkaccount($env, $bornum, $dbh); >+ my ($nowaiting, $waiting) = C4::Circulation::Circ2::CheckWaiting($bornum); >+ >+ if (($odues > 0) || ($amount > 0) || ($nowaiting > 0)) { >+ $errorsound = 1 unless ($input->cookie('patron') eq $bornum); >+ } > } > > $data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'}); >*************** >*** 201,205 **** >--- 229,236 ---- > issueloop => \@issuedata, > unvalidlibrarian => $unvalidlibrarian, > reserveloop => \@reservedata); >+ if ($errorsound) { >+ $template->param(ERROR_SOUND => 1); >+ } > > output_html_with_http_headers $input, $cookie, $template->output;
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 1080
:
53
|
54
|
55
|
56