4 use C4::Circulation::Circ2;
10 my $headerbackgroundcolor='#99cc33';
11 #my $circbackgroundcolor='#555555';
12 my $circbackgroundcolor='#ffffcc';
13 my $linecolor1='#bbbbbb';
14 my $linecolor2='#dddddd';
15 my $backgroundimage="/images/background-mem.gif";
17 my $branches=getbranches(\%env);
18 my $printers=getprinters(\%env);
19 my $branch=$query->param('branch');
20 my $printer=$query->param('printer');
21 ($branch) || ($branch=$query->cookie('branch'));
22 ($printer) || ($printer=$query->cookie('printer'));
23 my ($oldbranch, $oldprinter);
24 if ($query->param('selectnewbranchprinter')) {
30 $env{'branchcode'}=$branch;
31 $env{'printer'}=$printer;
36 foreach (keys %$branches) {
41 ($selected='selected') if ($_ eq $oldbranch);
42 $branchoptions.="<option value=$_ $selected>$branches->{$_}->{'branchname'}\n";
44 foreach (keys %$printers) {
48 ($selected='selected') if ($_ eq $oldprinter);
49 $printeroptions.="<option value=$_ $selected>$printers->{$_}->{'printername'}\n";
51 if ($printercount==1) {
52 ($printer)=keys %$printers;
54 if ($branchcount==1) {
55 ($branch)=keys %$branches;
61 if ($branch && $printer) {
62 $branchname=$branches->{$branch}->{'branchname'};
63 $printername=$printers->{$printer}->{'printername'};
67 my $branchcookie=$query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
68 my $printercookie=$query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
70 print $query->header(-type=>'text/html',-expires=>'now', -cookie=>[$branchcookie,$printercookie]);
72 print startmenu('circulation');
78 <table border=0 width=100% cellspacing=0 bgcolor=$headerbackgroundcolor background=$backgroundimage>
81 <th width=30%><font color=black>$branchname</font></th>
83 <a href=circulation.pl?module=issues&branch=$branch&printer=$printer><font color=black><img src=/images/issues.gif border=0 height=40></font></a>
86 <a href=circulation.pl?selectnewbranchprinter=1><font color=black>Branch/Printer</font></a>
89 <a href=circulation.pl?module=returns&branch=$branch&printer=$printer><font color=black><img src=/images/returns.gif border=0 height=40></font></a>
91 <th width=30%><font color=black>$printername</font></th>
101 if ($printer && $branch) {
104 if ($query->param('module') eq 'issues') { issues(); last SWITCH; }
105 if ($query->param('module') eq 'returns') { returns(); last SWITCH; }
109 my ($printerform, $branchform);
110 if ($printercount>1) {
111 $printerform=<<"EOF";
112 <table border=0 cellspacing=0 cellpadding=5>
113 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Choose a Printer</font></td></tr>
115 <select name=printer>
122 my ($printer) = keys %$printers;
123 $printerform=<<"EOF";
124 <input type=hidden name=printer value=$printer>
128 if ($branchcount>1) {
130 <table border=0 cellpadding=5 cellspacing=0>
131 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Choose a Branch</font></td></tr>
141 Select a branch and a printer
156 print endmenu('circulation');
160 <a href=circulation.pl?module=issues&branch=$branch&printer=$printer>Issues</a>
161 <a href=circulation.pl?module=returns&branch=$branch&printer=$printer>Returns</a>
169 <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>
171 foreach ($query->param) {
172 (next) unless (/ri-(\d*)/);
174 (next) if ($counter>20);
175 my $barcode=$query->param("ri-$counter");
176 my $duedate=$query->param("dd-$counter");
177 my $borrowernumber=$query->param("bn-$counter");
179 $returneditems{$counter}=$barcode;
180 $riduedate{$counter}=$duedate;
181 $riborrowernumber{$counter}=$borrowernumber;
182 $ritext.="<input type=hidden name=ri-$counter value=$barcode>\n";
183 $ritext.="<input type=hidden name=dd-$counter value=$duedate>\n";
184 $ritext.="<input type=hidden name=bn-$counter value=$borrowernumber>\n";
186 if (my $barcode=$query->param('barcode')) {
187 $ritext.="<input type=hidden name=ri-0 value=$barcode>\n";
188 $returneditems{0}=$barcode;
191 my $barcodeentrytext= << "EOF";
193 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
194 <tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
195 <tr><td>Item Barcode:</td><td><input name=barcode size=10></td></tr>
197 <input type=hidden name=module value=returns>
198 <input type=hidden name=branch value=$branch>
199 <input type=hidden name=printer value=$printer>
202 if ((my $barcode=$query->param('barcode')) || (%returneditems)) {
203 my ($iteminformation, $borrower, $messages, $overduecharge) = returnbook(\%env, $barcode);
205 (my $nosuchitem=1) unless ($iteminformation);
206 $riborrowernumber{0}=$borrower->{'borrowernumber'};
207 $riduedate{0}=$iteminformation->{'date_due'};
208 $barcodeentrytext.= "<input type=hidden name=dd-0 value=$iteminformation->{'date_due'}>\n";
209 $barcodeentrytext.= "<input type=hidden name=bn-0 value=$borrower->{'borrowernumber'}>\n";
210 my @datearr = localtime(time());
211 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
212 my $itemtable=<<"EOF";
213 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
214 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Returned Item Information</font></th></tr>
216 Title: $iteminformation->{'title'}<br>
217 Author: $iteminformation->{'author'}<br>
218 Barcode: <a href=/cgi-bin/koha/detail.pl?bib=$iteminformation->{'biblionumber'}&type=intra onClick="openWindow(this, 'Item', 480, 640)">$iteminformation->{'barcode'}</a><br>
219 Date Due: $iteminformation->{'date_due'}
225 foreach (@$messages) {
226 $messagetext.="$_<p>\n";
229 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
230 <tr><th bgcolor=$headerbackgroundcolor $background=$backgroundimage><font color=black>Messages</font></th></tr>
238 if (($nosuchitem) && ($barcode)) {
240 <table border=0 cellpadding=1>
246 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
247 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
249 <table border=0 cellpadding=5>
251 $barcode is not a valid barcode.
260 } elsif ($nosuchitem) {
262 <table border=0 cellpadding=1>
271 if ($borrower->{'borrowernumber'}) {
272 my ($patrontable, $flaginfotext) = patrontable($borrower);
274 <table border=0 cellpadding=5>
279 <td align=center valign=top>
284 <td valign=top align=center colspan=2>
301 <table border=0 cellpadding=5>
307 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
308 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
310 <table border=0 cellpadding=5>
312 $iteminformation->{'title'} by $iteminformation->{'author'} was not loaned out.
325 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
326 <tr><th colspan=6 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Returned Items</font></th></tr>
327 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th><th>Borrower</th></tr>
330 foreach (sort {$a <=> $b} keys %returneditems) {
331 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
332 my $barcode=$returneditems{$_};
333 my $duedate=$riduedate{$_};
334 my @datearr = localtime(time());
335 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
336 my $overduetext="$duedate";
337 ($overduetext="<font color=red>$duedate</font>") if ($duedate lt $todaysdate);
338 ($duedate) || ($overduetext="<img src=/images/blackdot.gif>");
339 my $borrowernumber=$riborrowernumber{$_};
340 my ($borrower) = getpatroninformation(\%env,$borrowernumber,0);
341 my ($iteminformation) = getiteminformation(\%env, 0, $barcode);
342 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";
346 print $barcodeentrytext;
349 print "</td></tr></table>\n";
353 my ($noheader) = shift;
357 <table border=0 bgcolor=$headerbackgroundcolor background=$backgroundimage cellpadding=10 cellspacing=0><tr><th><font color=black>Circulation - Issues</font></td></tr><tr><td bgcolor=$circbackgroundcolor align=center>
360 if (my $borrnumber=$query->param('borrnumber')) {
361 my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
362 my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
363 my $year=$query->param('year');
364 my $month=$query->param('month');
365 my $day=$query->param('day');
366 if (my $barcode=$query->param('barcode')) {
367 my $invalidduedate=0;
369 if (($year eq 0) && ($month eq 0) && ($year eq 0)) {
372 if (($year eq 0) || ($month eq 0) || ($year eq 0)) {
373 print "Invalid Due Date Specified. Book was not issued.<p>\n";
376 if (($day>30) && (($month==4) || ($month==6) || ($month==9) || ($month==11))) {
377 print "Invalid Due Date Specified. Book was not issued. Only 30 days in $month month.<p>\n";
379 } elsif (($day>29) && ($month==2)) {
380 print "Invalid Due Date Specified. Book was not issued. Never that many days in February!<p>\n";
382 } elsif (($month==2) && ($day>28) && (($year%4) && ((!($year%100) || ($year%400))))) {
383 print "Invalid Due Date Specified. Book was not issued. $year is not a leap year.<p>\n";
386 $env{'datedue'}="$year-$month-$day";
391 foreach (sort $query->param) {
392 if ($_ =~ /response-(\d*)/) {
393 $responses{$1}=$query->param($_);
396 if (my $qnumber=$query->param('questionnumber')) {
397 $responses{$qnumber}=$query->param('answer');
399 unless ($invalidduedate) {
400 my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) = issuebook(\%env, $borrower, $barcode, \%responses);
401 unless ($iteminformation) {
403 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
404 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Error</font></th></tr>
406 <table border=0 cellpadding=5>
408 $barcode is not a valid barcode.
414 if ($rejected == -1) {
417 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
418 <tr><th bgcolor= background=$backgroundimage><font color=black>Error Issuing Book</font></th></tr>
419 <tr><td><font color=red>$rejected</font></td></tr>
425 my $responsesform='';
426 foreach (keys %responses) {
427 $responsesform.="<input type=hidden name=response-$_ value=$responses{$_}>\n";
430 my $stickyduedate=$query->param('stickyduedate');
432 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
433 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Issuing Question</b></font></td></tr>
435 <table border=0 cellpadding=10>
437 Attempting to issue $iteminformation->{'title'} by $iteminformation->{'author'} to $borrower->{'firstname'} $borrower->{'surname'}.
444 <tr><td align=center>
448 <input type=hidden name=module value=issues>
449 <input type=hidden name=borrnumber value=$borrnumber>
450 <input type=hidden name=barcode value=$barcode>
451 <input type=hidden name=questionnumber value=$questionnumber>
452 <input type=hidden name=day value=$day>
453 <input type=hidden name=month value=$month>
454 <input type=hidden name=year value=$year>
455 <input type=hidden name=stickyduedate value=$stickyduedate>
456 <input type=hidden name=branch value=$branch>
457 <input type=hidden name=printer value=$printer>
459 <input type=hidden name=answer value=Y>
460 <input type=submit value=Yes>
465 <input type=hidden name=module value=issues>
466 <input type=hidden name=borrnumber value=$borrnumber>
467 <input type=hidden name=barcode value=$barcode>
468 <input type=hidden name=questionnumber value=$questionnumber>
469 <input type=hidden name=day value=$day>
470 <input type=hidden name=month value=$month>
471 <input type=hidden name=year value=$year>
472 <input type=hidden name=stickyduedate value=$stickyduedate>
473 <input type=hidden name=branch value=$branch>
474 <input type=hidden name=printer value=$printer>
476 <input type=hidden name=answer value=N>
477 <input type=submit value=No>
491 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
492 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black>Message</font></th></tr>
493 <tr><td>$message</td></tr>
500 my $issueid=$query->param('issueid');
501 ($issueid) || ($issueid=int(rand()*1000000000));
505 foreach $flag (sort keys %$flags) {
506 if ($flags->{$flag}->{'noissues'}) {
507 $flagtext.="<font color=red>$flag</font> ";
511 $flags->{$flag}->{'message'}=~s/\n/<br>/g;
512 if ($flags->{$flag}->{'noissues'}) {
513 $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";
515 $flaginfotext.="<tr><td valign=top>$flag</td><td>$flags->{$flag}->{'message'}</td></tr>\n";
519 $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";
521 $env{'nottodaysissues'}=1;
522 my ($borrowerissues) = currentissues(\%env, $borrower);
523 $env{'nottodaysissues'}=0;
524 $env{'todaysissues'}=1;
525 my ($today) = currentissues(\%env, $borrower);
526 $env{'todaysissues'}=0;
528 my @datearr = localtime(time());
529 my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]+1)).sprintf ("%0.2d", $datearr[3]);
531 foreach (sort keys %$borrowerissues) {
532 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
533 my $bookissue=$borrowerissues->{$_};
535 my $datedue=$bookissue->{'date_due'};
536 my $dd=$bookissue->{'date_due'};
538 if ($datedue < $todaysdate) {
539 $dd="<font color=red>$dd</font>\n";
541 $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";
545 foreach (sort keys %$today) {
546 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
547 my $bookissue=$today->{$_};
548 $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";
550 for ($i=1; $i<32; $i++) {
552 if (($query->param('stickyduedate')) && ($day==$i)) {
553 $selected='selected';
555 $dayoptions.="<option value=$i $selected>$i";
558 foreach (('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')) {
560 if (($query->param('stickyduedate')) && ($month==$counter)) {
561 $selected='selected';
563 $monthoptions.="<option value=$counter $selected>$_";
566 for ($i=$datearr[5]+1900; $i<$datearr[5]+1905; $i++) {
568 if (($query->param('stickyduedate')) && ($year==$i)) {
569 $selected='selected';
571 $yearoptions.="<option value=$i $selected>$i";
575 ($query->param('stickyduedate')) && ($selected='checked');
576 my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0);
577 my ($patrontable, $flaginfotable) = patrontable($borrower);
580 <table border=0 cellpadding=5>
582 <td align=center valign=top>
583 <table border=0 cellspacing=0 cellpadding=5 bgcolor=#dddddd width=100%>
584 <tr><td align=center bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
585 <tr><td align=center>
586 <table border=0 bgcolor=#dddddd>
587 <tr><td>Item Barcode:</td><td><input name=barcode size=10></td><td><input type=submit value=Issue></tr>
588 <tr><td colspan=3 align=center>
589 <table border=0 cellpadding=0 cellspacing=0>
591 <select name=day><option value=0>Day$dayoptions</select>
593 <select name=month><option value=0>Month$monthoptions</select>
595 <select name=year><option value=0>Year$yearoptions</select>
599 <input type=checkbox name=stickyduedate $selected> Sticky Due Date
604 <input type=hidden name=module value=issues>
605 <input type=hidden name=borrnumber value=$borrnumber>
606 <input type=hidden name=branch value=$branch>
607 <input type=hidden name=printer value=$printer>
610 <td align=center valign=top>
617 <td colspan=2 align=center>
618 <table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=#dddddd>
619 <tr><th colspan=5 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Issues Today</b></font></th></tr>
620 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th></tr>
626 <td colspan=2 align=center>
627 <table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=#dddddd>
628 <tr><th colspan=5 bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Previous Issues</b></font></th></tr>
629 <tr><th>Due Date</th><th>Bar Code</th><th>Title</th><th>Author</th><th>Class</th></tr>
639 if (my $findborrower=$query->param('findborrower')) {
640 my ($borrowers, $flags) = findborrower(\%env, $findborrower);
641 my @borrowers=@$borrowers;
642 if ($#borrowers == -1) {
643 $query->param('findborrower', '');
644 print "No borrower matched '$findborrower'<p>\n";
648 if ($#borrowers == 0) {
649 $query->param('borrnumber', $borrowers[0]->{'borrowernumber'});
653 print "<form method=get>\n";
654 print "<input type=hidden name=module value=issues>\n";
655 print "<input type=hidden name=branch value=$branch>\n";
656 print "<input type=hidden name=printer value=$printer>\n";
657 print "<table border=0 cellspacing=0 cellpadding=5 bgcolor=#dddddd>";
658 print "<tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Select a borrower</b></font></th></tr>\n";
659 print "<tr><td align=center>\n";
660 print "<select name=borrnumber size=7>\n";
661 foreach (sort {$a->{'surname'}.$a->{'firstname'} cmp $b->{'surname'}.$b->{'firstname'}} @$borrowers) {
662 print "<option value=$_->{'borrowernumber'}>$_->{'surname'}, $_->{'firstname'} ($_->{'cardnumber'})\n";
664 print "</select><br>";
665 print "<input type=submit>\n";
666 print "</td></tr></table>\n";
667 print "</td></tr></table>\n";
672 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
673 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Enter borrower card number<br> or partial last name</b></font></td></tr>
674 <tr><td><input name=findborrower></td></tr>
676 <input type=hidden name=module value=issues>
677 <input type=hidden name=branch value=$branch>
678 <input type=hidden name=printer value=$printer>
689 my $flags=$borrower->{'flags'};
691 my $flaginfotable='';
694 foreach $flag (sort keys %$flags) {
695 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
696 if ($flags->{$flag}->{'noissues'}) {
697 $flagtext.="<font color=red>$flag</font> ";
701 $flags->{$flag}->{'message'}=~s/\n/<br>/g;
702 if ($flags->{$flag}->{'noissues'}) {
703 if ($flag eq 'CHARGES') {
704 $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";
706 $flaginfotext.="<tr><td bgcolor=$color valign=top><font color=red>$flag</font></td><td bgcolor=$color>$flags->{$flag}->{'message'}</td></tr>\n";
709 if ($flag eq 'CHARGES') {
710 $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";
711 } elsif ($flag eq 'WAITING') {
713 my $items=$flags->{$flag}->{'itemlist'};
714 foreach $item (@$items) {
715 my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0);
716 $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";
718 $flaginfotext.="<tr><td bgcolor=$color valign=top>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'}<br>$itemswaiting</td></tr>\n";
719 } elsif ($flag eq 'ODUES') {
720 my $items=$flags->{$flag}->{'itemlist'};
721 my $itemswaiting="<table border=0 cellspacing=0 cellpadding=2>\n";
722 my $currentcolor=$color;
724 my $color=$currentcolor;
725 foreach $item (@$items) {
726 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
727 my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0);
728 $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";
731 $itemswaiting.="</table>\n";
732 $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";
734 $flaginfotext.="<tr><td bgcolor=$color valign=top>$flag</td><td bgcolor=$color>$flags->{$flag}->{'message'}</td></tr>\n";
738 ($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");
739 my $patrontable= << "EOF";
740 <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
741 <tr><th bgcolor=$headerbackgroundcolor background=$backgroundimage><font color=black><b>Patron Information</b></font></td></tr>
743 <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>
744 $borrower->{'streetaddress'} $borrower->{'city'}<br>
745 $borrower->{'categorycode'} $flagtext
749 return($patrontable, $flaginfotext);