koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Bull.pm,1.6.2.6,1.6.2.7


From: Henri-Damien LAURENT
Subject: [Koha-cvs] CVS: koha/C4 Bull.pm,1.6.2.6,1.6.2.7
Date: Fri, 03 Jun 2005 05:53:10 -0700

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22616/C4

Modified Files:
      Tag: rel_2_2
        Bull.pm 
Log Message:
Featuring OPAC with Full History Subscription

Index: Bull.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bull.pm,v
retrieving revision 1.6.2.6
retrieving revision 1.6.2.7
diff -C2 -r1.6.2.6 -r1.6.2.7
*** Bull.pm     2 Jun 2005 21:04:35 -0000       1.6.2.6
--- Bull.pm     3 Jun 2005 12:53:08 -0000       1.6.2.7
***************
*** 190,220 ****
        my ($biblionumber) = @_;
        my $dbh = C4::Context->dbh;
!       my $sth = $dbh->prepare('select year(subscription.startdate) as 
year,subscription.*, aqbudget.bookfundid,aqbooksellers.name as 
aqbooksellername,biblio.title as bibliotitle 
!                                                       from subscription 
                                                        left join aqbudget on 
subscription.aqbudgetid=aqbudget.aqbudgetid 
                                                        left join aqbooksellers 
on subscription.aqbooksellerid=aqbooksellers.id 
                                                        left join biblio on 
biblio.biblionumber=subscription.biblionumber 
!                                                       where 
subscription.biblionumber = ? order by subscription.startdate');
        $sth->execute($biblionumber);
        my @res;
        my $year;
        my @loopissues;
        while (my $subs = $sth->fetchrow_hashref) {
!               my $sth2 = $dbh->prepare('select serial.serialseq, 
serial.planneddate, year(serial.planneddate) as year, serial.status from serial 
where serial.biblionumber = ? and serial.subscriptionid=? order by 
serial.planneddate');
!               $sth2->execute($biblionumber,$subs->{'subscriptionid'});
!               while (my $issues = $sth2->fetchrow_hashref){
!                               push @loopissues,
!                                       {'planneddate' => 
$issues->{'planneddate'}, 
!                                       'serialseq' => $issues->{'serialseq'},
!                                       'status' => $issues->{'status'}};
  #                             warn "planneddate ".$issues->{'planneddate'};
  #                             warn "serialseq".$issues->{'serialseq'};
                }
-               my %cell;
-               $cell{'year'}=$subs->{year};
-               $cell{'title'}=$subs->{title};
-               $cell{'booksellername'}=$subs->{booksellername};
-               $cell{'serials'address@hidden;
-               push @res,\%cell;
        }
        return address@hidden;
--- 190,250 ----
        my ($biblionumber) = @_;
        my $dbh = C4::Context->dbh;
!       my $sth = $dbh->prepare('select serial.serialseq, serial.planneddate, 
serial.status, year(serial.planneddate) as year,subscription.*, 
aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as 
bibliotitle 
!                                                       from serial left join 
subscription on (serial.subscriptionid=subscription.subscriptionid and 
subscription.biblionumber=serial.biblionumber)
                                                        left join aqbudget on 
subscription.aqbudgetid=aqbudget.aqbudgetid 
                                                        left join aqbooksellers 
on subscription.aqbooksellerid=aqbooksellers.id 
                                                        left join biblio on 
biblio.biblionumber=subscription.biblionumber 
!                                                       where 
subscription.biblionumber = ? order by year,serial.planneddate');
        $sth->execute($biblionumber);
        my @res;
        my $year;
+       my $startdate;
+       my $aqbooksellername;
+       my $bibliotitle;
        my @loopissues;
+       my $first;
        while (my $subs = $sth->fetchrow_hashref) {
! #             my $sth2 = $dbh->prepare('select * from serial where 
serial.biblionumber = ? and serial.subscriptionid=? order by 
serial.planneddate');
! #             $sth2->execute($biblionumber,$subs->{'subscriptionid'});
! #             while (my $issues = $sth2->fetchrow_hashref){
  #                             warn "planneddate ".$issues->{'planneddate'};
  #                             warn "serialseq".$issues->{'serialseq'};
+ #             }
+               if ($year and ($year==$subs->{year})){
+                       if ($first eq 1){$first=0;}
+                       my $temp=$res[scalar(@res)-1]->{'serials'};
+                       push @$temp,
+                               {'planneddate' => $subs->{'planneddate'}, 
+                               'serialseq' => $subs->{'serialseq'},
+                               'status1' => $subs->{'status'}==1,
+                               'status2' => $subs->{'status'}==2,
+                               'status3' => $subs->{'status'}==3,
+                               'status4' => $subs->{'status'}==4,
+                               };
+               }else {
+                       $year= $subs->{'year'};
+                       $startdate= $subs->{'startdate'};
+                       $aqbooksellername= $subs->{'aqbooksellername'};
+                       $bibliotitle= $subs->{'bibliotitle'};
+                       $first=1 if (not $year);
+                       my @temp;
+                       push @temp,
+                               {'planneddate' => $subs->{'planneddate'}, 
+                               'serialseq' => $subs->{'serialseq'},
+                               'status1' => $subs->{'status'}==1,
+                               'status2' => $subs->{'status'}==2,
+                               'status3' => $subs->{'status'}==3,
+                               'status4' => $subs->{'status'}==4,
+                               };
+                       
+                       push @res,{
+                               'year'=>$year,
+                               'startdate'=>$startdate,
+                               'aqbooksellername'=>$aqbooksellername,
+                               'bibliotitle'=>$bibliotitle,
+                               'serials'=>address@hidden,
+                               'first'=>$first 
+                       };
                }
        }
        return address@hidden;




reply via email to

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