4 use C4::Circulation::Circ2;
11 my $headerbackgroundcolor='#99cc33';
12 #my $circbackgroundcolor='#555555';
13 my $circbackgroundcolor='#ffffcc';
14 my $linecolor1='#bbbbbb';
15 my $linecolor2='#dddddd';
16 my $backgroundimage="/images/background-mem.gif";
18 my $branches=getbranches(\%env);
19 my $printers=getprinters(\%env);
20 my $branch=$query->param('branch');
21 my $printer=$query->param('printer');
22 ($branch) || ($branch=$query->cookie('branch'));
23 ($printer) || ($printer=$query->cookie('printer'));
24 my ($oldbranch, $oldprinter);
25 if ($query->param('selectnewbranchprinter')) {
31 $env{'branchcode'}=$branch;
32 $env{'printer'}=$printer;
33 $env{'queue'}=$printer;
38 foreach (keys %$branches) {
43 ($selected='selected') if ($_ eq $oldbranch);
44 $branchoptions.="<option value=$_ $selected>$branches->{$_}->{'branchname'}\n";
46 foreach (keys %$printers) {
50 ($selected='selected') if ($_ eq $oldprinter);
51 $printeroptions.="<option value=$_ $selected>$printers->{$_}->{'printername'}\n";
53 if ($printercount==1) {
54 ($printer)=keys %$printers;
56 if ($branchcount==1) {
57 ($branch)=keys %$branches;
63 if ($branch && $printer) {
64 $branchname=$branches->{$branch}->{'branchname'};
65 $printername=$printers->{$printer}->{'printername'};
69 my $branchcookie=$query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
70 my $printercookie=$query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
72 print $query->header(-type=>'text/html',-expires=>'now', -cookie=>[$branchcookie,$printercookie]);
75 print startmenu('circulation');
81 <table border=0 width=100% cellspacing=0 bgcolor=$headerbackgroundcolor background=$backgroundimage>
84 <th width=30%><font color=black>$branchname</font></th>
86 <a href=circulation.pl?module=issues&branch=$branch&printer=$printer><font color=black><img src=/images/issues.gif border=0 height=40></font></a>
89 <a href=circulation.pl?selectnewbranchprinter=1><font color=black>Branch/Printer</font></a>
92 <a href=circulation.pl?module=returns&branch=$branch&printer=$printer><font color=black><img src=/images/returns.gif border=0 height=40></font></a>
94 <th width=30%><font color=black>$printername</font></th>
104 if ($printer && $branch) {
107 if ($query->param('module') eq 'issues') { issues(); last SWITCH; }
108 if ($query->param('module') eq 'returns') { returns(); last SWITCH; }
112 my ($printerform, $branchform);
113 if ($printercount>1) {
114 $printerform=<<"EOF";
115 <table border=0 cellspacing=0 cellpadding=5>
116 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Choose a Printer</font></td></tr>
118 <select name=printer>
125 my ($printer) = keys %$printers;
126 $printerform=<<"EOF";
127 <input type=hidden name=printer value=$printer>
131 if ($branchcount>1) {
133 <table border=0 cellpadding=5 cellspacing=0>
134 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Choose a Branch</font></td></tr>
144 Select a branch and a printer
159 print endmenu('circulation');
163 <a href=circulation.pl?module=issues&branch=$branch&printer=$printer>Issues</a>
164 <a href=circulation.pl?module=returns&branch=$branch&printer=$printer>Returns</a>
172 <table border=0 cellpadding=10 cellspacing=0 bgcolor=$headerbackgroundcolor cellpadding=5 background=$backgroundimage><tr><th><font color=black>Circulation - Returns</font></td></tr><tr><td bgcolor=$circbackgroundcolor align=center>
174 foreach ($query->param) {
175 (next) unless (/ri-(\d*)/);
177 (next) if ($counter>20);
178 my $barcode=$query->param("ri-$counter");
179 my $duedate=$query->param("dd-$counter");
180 my $borrowernumber=$query->param("bn-$counter");
182 $returneditems{$counter}=$barcode;
183 $riduedate{$counter}=$duedate;
184 $riborrowernumber{$counter}=$borrowernumber;
185 $ritext.="<input type=hidden name=ri-$counter value=$barcode>\n";
186 $ritext.="<input type=hidden name=dd-$counter value=$duedate>\n";
187 $ritext.="<input type=hidden name=bn-$counter value=$borrowernumber>\n";
189 if (my $barcode=$query->param('barcode')) {
190 $ritext.="<input type=hidden name=ri-0 value=$barcode>\n";
191 $returneditems{0}=$barcode;
194 my $barcodeentrytext= << "EOF";
196 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
197 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
198 <tr><td>Item Barcode:</td><td><input name=barcode size=10></td></tr>
200 <input type=hidden name=module value=returns>
201 <input type=hidden name=branch value=$branch>
202 <input type=hidden name=printer value=$printer>
205 if ((my $barcode=$query->param('barcode')) || (%returneditems)) {
206 my ($iteminformation, $borrower, $messages, $overduecharge) = returnbook(\%env, $barcode);
208 (my $nosuchitem=1) unless ($iteminformation);
209 $riborrowernumber{0}=$borrower->{'borrowernumber'};
210 $riduedate{0}=$iteminformation->{'date_due'};
211 $barcodeentrytext.= "<input type=hidden name=dd-0 value=$iteminformation->{'date_due'}>\n";
212 $barcodeentrytext.= "<input type=hidden name=bn-0 value=$borrower->{'borrowernumber'}>\n";
213 my @datearr = localtime(time());
214 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
215 my $itemtable=<<"EOF";
216 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
217 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Returned Item Information</font></th></tr>
219 Title: $iteminformation->{'title'}<br>
220 Author: $iteminformation->{'author'}<br>
221 Barcode: <a href=/cgi-bin/koha/detail.pl?bib=$iteminformation->{'biblionumber'}&type=intra onClick="openWindow(this, 'Item', 480, 640)">$iteminformation->{'barcode'}</a><br>
222 Date Due: $iteminformation->{'date_due'}
228 foreach (@$messages) {
229 $messagetext.="$_<p>\n";
232 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
233 <tr><th bgcolor=$headerbackgroundcolor $background=$backgroundimage><font color=black>Messages</font></th></tr>
241 if (($nosuchitem) && ($barcode)) {
243 <table border=0 cellpadding=1>
249 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
250 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
252 <table border=0 cellpadding=5>
254 $barcode is not a valid barcode.
263 } elsif ($nosuchitem) {
265 <table border=0 cellpadding=1>
274 if ($borrower->{'borrowernumber'}) {
275 my ($patrontable, $flaginfotext) = patrontable($borrower);
277 <table border=0 cellpadding=5>
282 <td align=center valign=top>
287 <td valign=top align=center colspan=2>
304 <table border=0 cellpadding=5>
310 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
311 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
313 <table border=0 cellpadding=5>
315 $iteminformation->{'title'} by $iteminformation->{'author'} was not loaned out.
328 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
329 <tr><th colspan=6 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Returned Items</font></th></tr>
330 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th><th>Borrower</th></tr>
333 foreach (sort {$a <=> $b} keys %returneditems) {
334 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
335 my $barcode=$returneditems{$_};
336 my $duedate=$riduedate{$_};
337 my @datearr = localtime(time());
338 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
339 my $overduetext="$duedate";
340 ($overduetext="<font color=red>$duedate</font>") if ($duedate lt $todaysdate);
341 ($duedate) || ($overduetext="<img src=/images/blackdot.gif>");
342 my $borrowernumber=$riborrowernumber{$_};
343 my ($borrower) = getpatroninformation(\%env,$borrowernumber,0);
344 my ($iteminformation) = getiteminformation(\%env, 0, $barcode);
345 print "<tr><td bgcolor=$color>$overduetext</td><td bgcolor=$color align=center><a href=/cgi-bin/koha/detail.pl?bib=$iteminformation->{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$barcode</a></td><td bgcolor=$color>$iteminformation->{'title'}</td><td bgcolor=$color>$iteminformation->{'author'}</td><td bgcolor=$color align=center>$iteminformation->{'dewey'} $iteminformation->{'subclass'}</td><td bgcolor=$color><img src=/images/blackdot.gif><a href=/cgi-bin/koha/moremember.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this,'Member', 480, 640)\">$borrower->{'cardnumber'}</a> $borrower->{'firstname'} $borrower->{'surname'}</td></tr>\n";
349 print $barcodeentrytext;
352 print "</td></tr></table>\n";
356 my ($noheader) = shift;
357 my $print=$query->param('print');
358 my $borrowernumber=$query->param('borrnumber');
359 if ($print eq 'yes'){
360 my ($borrower, $flags) = getpatroninformation(\%env,$borrowernumber,0);
361 $env{'todaysissues'}=1;
362 my ($borrowerissues) = currentissues(\%env, $borrower);
365 foreach (sort keys %$borrowerissues) {
366 $issues[$i]=$borrowerissues->{$_};
367 #print $issues[$i]->{'date_due'};
372 remoteprint(\%env,$issues,$borrower);
373 $query->param('borrnumber','')
378 <table border=0 bgcolor=$headerbackgroundcolor background=$backgroundimage cellpadding=10 cellspacing=0><tr><th><font color=black>Circulation - Issues
380 </font></td></tr><tr><td bgcolor=$circbackgroundcolor align=center>
383 if (my $borrnumber=$query->param('borrnumber')) {
384 my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
385 # my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
386 my $year=$query->param('year');
387 my $month=$query->param('month');
388 my $day=$query->param('day');
389 if (my $barcode=$query->param('barcode')) {
390 my $invalidduedate=0;
392 if (($year eq 0) && ($month eq 0) && ($year eq 0)) {
395 if (($year eq 0) || ($month eq 0) || ($year eq 0)) {
396 print "Invalid Due Date Specified. Book was not issued.<p>\n";
399 if (($day>30) && (($month==4) || ($month==6) || ($month==9) || ($month==11))) {
400 print "Invalid Due Date Specified. Book was not issued. Only 30 days in $month month.<p>\n";
402 } elsif (($day>29) && ($month==2)) {
403 print "Invalid Due Date Specified. Book was not issued. Never that many days in February!<p>\n";
405 } elsif (($month==2) && ($day>28) && (($year%4) && ((!($year%100) || ($year%400))))) {
406 print "Invalid Due Date Specified. Book was not issued. $year is not a leap year.<p>\n";
409 $env{'datedue'}="$year-$month-$day";
414 foreach (sort $query->param) {
415 if ($_ =~ /response-(\d*)/) {
416 $responses{$1}=$query->param($_);
419 if (my $qnumber=$query->param('questionnumber')) {
420 $responses{$qnumber}=$query->param('answer');
422 unless ($invalidduedate) {
423 my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) = issuebook(\%env, $borrower, $barcode, \%responses);
424 unless ($iteminformation) {
426 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
427 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
429 <table border=0 cellpadding=5>
431 $barcode is not a valid barcode.
437 if ($rejected == -1) {
440 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
441 <tr><th bgcolor= background=$backgroundimage><font color=black>Error Issuing Book</font></th></tr>
442 <tr><td><font color=red>$rejected</font></td></tr>
448 my $responsesform='';
449 foreach (keys %responses) {
450 $responsesform.="<input type=hidden name=response-$_ value=$responses{$_}>\n";
453 my $stickyduedate=$query->param('stickyduedate');
455 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
456 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Issuing Question</b></font></td></tr>
458 <table border=0 cellpadding=10>
460 Attempting to issue $iteminformation->{'title'} by $iteminformation->{'author'} to $borrower->{'firstname'} $borrower->{'surname'}.
467 <tr><td align=center>
471 <input type=hidden name=module value=issues>
472 <input type=hidden name=borrnumber value=$borrnumber>
473 <input type=hidden name=barcode value=$barcode>
474 <input type=hidden name=questionnumber value=$questionnumber>
475 <input type=hidden name=day value=$day>
476 <input type=hidden name=month value=$month>
477 <input type=hidden name=year value=$year>
478 <input type=hidden name=stickyduedate value=$stickyduedate>
479 <input type=hidden name=branch value=$branch>
480 <input type=hidden name=printer value=$printer>
482 <input type=hidden name=answer value=Y>
483 <input type=submit value=Yes>
488 <input type=hidden name=module value=issues>
489 <input type=hidden name=borrnumber value=$borrnumber>
490 <input type=hidden name=barcode value=$barcode>
491 <input type=hidden name=questionnumber value=$questionnumber>
492 <input type=hidden name=day value=$day>
493 <input type=hidden name=month value=$month>
494 <input type=hidden name=year value=$year>
495 <input type=hidden name=stickyduedate value=$stickyduedate>
496 <input type=hidden name=branch value=$branch>
497 <input type=hidden name=printer value=$printer>
499 <input type=hidden name=answer value=N>
500 <input type=submit value=No>
514 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
515 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Message</font></th></tr>
516 <tr><td>$message</td></tr>
523 my $issueid=$query->param('issueid');
524 ($issueid) || ($issueid=int(rand()*1000000000));
528 foreach $flag (sort keys %$flags) {
529 if ($flags->{$flag}->{'noissues'}) {
530 $flagtext.="<font color=red>$flag</font> ";
534 $flags->{$flag}->{'message'}=~s/\n/<br>/g;
535 if ($flags->{$flag}->{'noissues'}) {
536 $flaginfotext.="<tr><td bgcolor=red valign=top><font color=black><b>$flag</b></font></td><td bgcolor=red><font color=black><b>$flags->{$flag}->{'message'}</b></font></td></tr>\n";
538 $flaginfotext.="<tr><td valign=top>$flag</td><td>$flags->{$flag}->{'message'}</td></tr>\n";
542 $flaginfotext="<table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd><tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage colspan=2><font color=black>Patron Flags</font></th></tr>$flaginfotext</table>\n";
544 $env{'nottodaysissues'}=1;
545 my ($borrowerissues) = currentissues(\%env, $borrower);
546 $env{'nottodaysissues'}=0;
547 $env{'todaysissues'}=1;
548 my ($today) = currentissues(\%env, $borrower);
549 $env{'todaysissues'}=0;
551 my @datearr = localtime(time());
552 my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]+1)).sprintf ("%0.2d", $datearr[3]);
554 foreach (sort keys %$borrowerissues) {
555 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
556 my $bookissue=$borrowerissues->{$_};
558 my $datedue=$bookissue->{'date_due'};
559 my $dd=$bookissue->{'date_due'};
561 if ($datedue < $todaysdate) {
562 $dd="<font color=red>$dd</font>\n";
564 $previssues.="<tr><td bgcolor=$color align=center>$dd</td><td bgcolor=$color align=center><a href=/cgi-bin/koha/detail.pl?bib=$bookissue->{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}</a></td><td bgcolor=$color>$bookissue->{'title'}</td><td bgcolor=$color>$bookissue->{'author'}</td><td bgcolor=$color align=center>$bookissue->{'dewey'} $bookissue->{'subclass'}</td></tr>\n";
568 foreach (sort keys %$today) {
569 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
570 my $bookissue=$today->{$_};
571 $todaysissues.="<tr><td bgcolor=$color align=center>$bookissue->{'date_due'}</td><td bgcolor=$color align=center><a href=/cgi-bin/koha/detail.pl?bib=$bookissue->{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}</a></td><td bgcolor=$color>$bookissue->{'title'}</td><td bgcolor=$color>$bookissue->{'author'}</td><td bgcolor=$color align=center>$bookissue->{'dewey'} $bookissue->{'subclass'}</td></tr>\n";
573 for ($i=1; $i<32; $i++) {
575 if (($query->param('stickyduedate')) && ($day==$i)) {
576 $selected='selected';
578 $dayoptions.="<option value=$i $selected>$i";
581 foreach (('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')) {
583 if (($query->param('stickyduedate')) && ($month==$counter)) {
584 $selected='selected';
586 $monthoptions.="<option value=$counter $selected>$_";
589 for ($i=$datearr[5]+1900; $i<$datearr[5]+1905; $i++) {
591 if (($query->param('stickyduedate')) && ($year==$i)) {
592 $selected='selected';
594 $yearoptions.="<option value=$i $selected>$i";
598 ($query->param('stickyduedate')) && ($selected='checked');
599 my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
600 my ($patrontable, $flaginfotable) = patrontable($borrower);
603 <table border=0 cellpadding=5>
605 <td align=center valign=top>
606 <table border=0 cellspacing=0 cellpadding=5 bgcolor=#dddddd width=100%>
607 <tr><td align=center bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
608 <tr><td align=center>
609 <table border=0 bgcolor=#dddddd>
610 <tr><td>Item Barcode:</td><td><input name=barcode size=10></td><td><input type=submit value=Issue></tr>
611 <tr><td colspan=3 align=center>
612 <table border=0 cellpadding=0 cellspacing=0>
614 <select name=day><option value=0>Day$dayoptions</select>
616 <select name=month><option value=0>Month$monthoptions</select>
618 <select name=year><option value=0>Year$yearoptions</select>
622 <input type=checkbox name=stickyduedate $selected> Sticky Due Date
627 <input type=hidden name=module value=issues>
628 <input type=hidden name=borrnumber value=$borrnumber>
629 <input type=hidden name=branch value=$branch>
630 <input type=hidden name=printer value=$printer>
633 <td align=center valign=top>
636 <a href=/cgi-bin/koha/circ/circulation.pl?borrnumber=$borrowernumber&module=issues&branch=$branch&printer=$printer&print=yes>Next borrower</a>
642 <td colspan=2 align=center>
643 <table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=#dddddd>
644 <tr><th colspan=5 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Issues Today</b></font></th></tr>
645 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th></tr>
651 <td colspan=2 align=center>
652 <table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=#dddddd>
653 <tr><th colspan=5 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Previous Issues</b></font></th></tr>
654 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th></tr>
664 if (my $findborrower=$query->param('findborrower')) {
665 my ($borrowers, $flags) = findborrower(\%env, $findborrower);
666 my @borrowers=@$borrowers;
667 if ($#borrowers == -1) {
668 $query->param('findborrower', '');
669 print "No borrower matched '$findborrower'<p>\n";
673 if ($#borrowers == 0) {
674 $query->param('borrnumber', $borrowers[0]->{'borrowernumber'});
678 print "<form method=get>\n";
679 print "<input type=hidden name=module value=issues>\n";
680 print "<input type=hidden name=branch value=$branch>\n";
681 print "<input type=hidden name=printer value=$printer>\n";
682 print "<table border=0 cellspacing=0 cellpadding=5 bgcolor=#dddddd>";
683 print "<tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Select a borrower</b></font></th></tr>\n";
684 print "<tr><td align=center>\n";
685 print "<select name=borrnumber size=7>\n";
686 foreach (sort {$a->{'surname'}.$a->{'firstname'} cmp $b->{'surname'}.$b->{'firstname'}} @$borrowers) {
687 print "<option value=$_->{'borrowernumber'}>$_->{'surname'}, $_->{'firstname'} ($_->{'cardnumber'})\n";
689 print "</select><br>";
690 print "<input type=submit>\n";
691 print "</td></tr></table>\n";
692 print "</td></tr></table>\n";
697 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
698 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Enter borrower card number<br> or partial last name</b></font></td></tr>
699 <tr><td><input name=findborrower></td></tr>
701 <input type=hidden name=module value=issues>
702 <input type=hidden name=branch value=$branch>
703 <input type=hidden name=printer value=$printer>
714 my $flags=$borrower->{'flags'};
716 my $flaginfotable='';
719 foreach $flag (sort keys %$flags) {
720 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
721 if ($flags->{$flag}->{'noissues'}) {
722 $flagtext.="<font color=red>$flag</font> ";
726 $flags->{$flag}->{'message'}=~s/\n/<br>/g;
727 if ($flags->{$flag}->{'noissues'}) {
728 if ($flag eq 'CHARGES') {
729 $flaginfotext.="<tr><td bgcolor=$color valign=top><font color=red>$flag</font></td><td bgcolor=$color><b>$flags->{$flag}->{'message'}</b> <a href=/cgi-bin/koha/pay.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment</a></td></tr>\n";
731 $flaginfotext.="<tr><td bgcolor=$color valign=top><font color=red>$flag</font></td><td bgcolor=$color>$flags->{$flag}->{'message'}</td></tr>\n";
734 if ($flag eq 'CHARGES') {
735 $flaginfotext.="<tr><td valign=top bgcolor=$color>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'} <a href=/cgi-bin/koha/pay.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment</a></td></tr>\n";
736 } elsif ($flag eq 'WAITING') {
738 my $items=$flags->{$flag}->{'itemlist'};
739 foreach $item (@$items) {
740 my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0);
741 $itemswaiting.="<a href=/cgi-bin/koha/detail.pl?bib=$iteminformation->{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'}</a> $iteminformation->{'title'} ($branches->{$iteminformation->{'holdingbranch'}}->{'branchname'})<br>\n";
743 $flaginfotext.="<tr><td bgcolor=$color valign=top>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'}<br>$itemswaiting</td></tr>\n";
744 } elsif ($flag eq 'ODUES') {
745 my $items=$flags->{$flag}->{'itemlist'};
746 my $itemswaiting="<table border=0 cellspacing=0 cellpadding=2>\n";
747 my $currentcolor=$color;
749 my $color=$currentcolor;
750 foreach $item (@$items) {
751 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
752 my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0);
753 $itemswaiting.="<tr><td bgcolor=$color><font color=red>$iteminformation->{'date_due'}</font></td><td bgcolor=$color><a href=/cgi-bin/koha/detail.pl?bib=$iteminformation->{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'}</a></td><td bgcolor=$color>$iteminformation->{'title'}</td></tr>\n";
756 $itemswaiting.="</table>\n";
757 $flaginfotext.="<tr><td bgcolor=$color valign=top>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'}<br>Overdue items can be seen in the Previous Issues table below</td></tr>\n";
759 $flaginfotext.="<tr><td bgcolor=$color valign=top>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'}</td></tr>\n";
763 ($flaginfotext) && ($flaginfotext="<table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd><tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage colspan=2><font color=black>Patron Flags</font></th></tr>$flaginfotext</table>\n");
764 my $patrontable= << "EOF";
765 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
766 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Patron Information</b></font></td></tr>
768 <a href=/cgi-bin/koha/moremember.pl?bornum=$borrower->{'borrowernumber'} onClick="openWindow(this,'Member', 480, 640)">$borrower->{'cardnumber'}</a> $borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'}<br>
769 $borrower->{'streetaddress'} $borrower->{'city'}<br>
770 $borrower->{'categorycode'} $flagtext
774 return($patrontable, $flaginfotext);