koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/circ circulation.pl,1.34,1.35


From: Finlay Thompson
Subject: [Koha-cvs] CVS: koha/circ circulation.pl,1.34,1.35
Date: Thu, 08 Aug 2002 21:03:46 -0700

Update of /cvsroot/koha/koha/circ
In directory usw-pr-cvs1:/tmp/cvs-serv30707

Modified Files:
        circulation.pl 
Log Message:

fixed up the todays issues and previous issues tables so that they are both 
listed in reverse order by issue date.



Index: circulation.pl
===================================================================
RCS file: /cvsroot/koha/koha/circ/circulation.pl,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** circulation.pl      24 Jul 2002 05:11:07 -0000      1.34
--- circulation.pl      9 Aug 2002 04:03:43 -0000       1.35
***************
*** 44,48 ****
  
  my @datearr = localtime(time());
! my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", 
($datearr[4]+1)).sprintf ("%0.2d", $datearr[3]);
  #warn $todaysdate;
  
--- 44,50 ----
  
  my @datearr = localtime(time());
! my $tday = localtime(time());
! warn "today: $tday \n";
! my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", 
($datearr[4]+1)).sprintf ("%0.2d", ($datearr[3]));
  #warn $todaysdate;
  
***************
*** 367,381 ****
  my $previssues='';
  if ($borrower) {
      my $issueslist = getissues($borrower);
!     my $tcolor = '';
!     my $pcolor = '';
!     foreach my $it (sort keys %$issueslist) {
!       my $dd = $issueslist->{$it}->{'date_due'};
        my $issuedate = $issueslist->{$it}->{'timestamp'};
        $issuedate = substr($issuedate, 0, 8);
! 
!       my $bookissue = $issueslist->{$it};
!       my $bgcolor='';
!       my $datedue = $bookissue->{'date_due'};
        #convert to nz style dates
        #this should be set with some kinda config variable         
--- 369,389 ----
  my $previssues='';
  if ($borrower) {
+     my @todaysissues;
+     my @previousissues;
      my $issueslist = getissues($borrower);
!     foreach my $it (keys %$issueslist) {
        my $issuedate = $issueslist->{$it}->{'timestamp'};
        $issuedate = substr($issuedate, 0, 8);
!       if ($todaysdate == $issuedate) {
!           push @todaysissues, $issueslist->{$it};
!       } else {
!           push @previousissues, $issueslist->{$it};
!       }
!     }
!     my $tcolor = '';
!     my $pcolor = '';
!     foreach my $book (sort {$b->{'timestamp'} <=> $a->{'timestamp'}} 
@todaysissues){
!       my $dd = $book->{'date_due'};
!       my $datedue = $book->{'date_due'};
        #convert to nz style dates
        #this should be set with some kinda config variable         
***************
*** 386,410 ****
            $dd="<font color=red>$dd</font>\n";
        }
!       if ($todaysdate == $issuedate) {
!           ($tcolor eq $linecolor1) ? ($tcolor=$linecolor2) : 
($tcolor=$linecolor1);
!           $todaysissues .=<< "EOF";
  <tr><td bgcolor=$tcolor align=center>$dd</td>
  <td bgcolor=$tcolor 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=$tcolor>$bookissue->{'title'}</td>
! <td bgcolor=$tcolor>$bookissue->{'author'}</td>
! <td bgcolor=$tcolor align=center>$bookissue->{'dewey'} 
$bookissue->{'subclass'}</td></tr>
! EOF
!         } else {
!           ($pcolor eq $linecolor1) ? ($pcolor=$linecolor2) : 
($pcolor=$linecolor1);
!           $previssues .= << "EOF";
  <tr><td bgcolor=$pcolor align=center>$dd</td>
  <td bgcolor=$pcolor 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=$pcolor>$bookissue->{'title'}</td>
! <td bgcolor=$pcolor>$bookissue->{'author'}</td>
! <td bgcolor=$pcolor align=center>$bookissue->{'dewey'} 
$bookissue->{'subclass'}</td></tr>
  EOF
-       }
      }
  }
--- 394,427 ----
            $dd="<font color=red>$dd</font>\n";
        }
!       ($tcolor eq $linecolor1) ? ($tcolor=$linecolor2) : 
($tcolor=$linecolor1);
!       $todaysissues .=<< "EOF";
  <tr><td bgcolor=$tcolor align=center>$dd</td>
  <td bgcolor=$tcolor align=center>
! <a href=/cgi-bin/koha/detail.pl?bib=$book->{'biblionumber'}&type=intra 
onClick=\"openWindow(this, 'Item', 480, 640)\">$book->{'barcode'}</a></td>
! <td bgcolor=$tcolor>$book->{'title'}</td>
! <td bgcolor=$tcolor>$book->{'author'}</td>
! <td bgcolor=$tcolor align=center>$book->{'dewey'} 
$book->{'subclass'}</td></tr>
! EOF
!     } 
!     foreach my $book (sort {$b->{'timestamp'} <=> $a->{'timestamp'}} 
@previousissues){
!       my $dd = $book->{'date_due'};
!       my $datedue = $book->{'date_due'};
!       #convert to nz style dates
!       #this should be set with some kinda config variable         
!       my @tempdate=split(/-/,$dd);
!       $dd="$tempdate[2]/$tempdate[1]/$tempdate[0]";
!       $datedue=~s/-//g;
!       if ($datedue < $todaysdate) {
!           $dd="<font color=red>$dd</font>\n";
!       }
!       ($pcolor eq $linecolor1) ? ($pcolor=$linecolor2) : 
($pcolor=$linecolor1);
!       $previssues .= << "EOF";
  <tr><td bgcolor=$pcolor align=center>$dd</td>
  <td bgcolor=$pcolor align=center>
! <a href=/cgi-bin/koha/detail.pl?bib=$book->{'biblionumber'}&type=intra 
onClick=\"openWindow(this, 'Item', 480, 640)\">$book->{'barcode'}</a></td>
! <td bgcolor=$pcolor>$book->{'title'}</td>
! <td bgcolor=$pcolor>$book->{'author'}</td>
! <td bgcolor=$pcolor align=center>$book->{'dewey'} 
$book->{'subclass'}</td></tr>
  EOF
      }
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]