[Koha-cvs] CVS: koha/C4 Bull.pm,1.6.2.5,1.6.2.6
Henri-Damien LAURENT
hdl at users.sourceforge.net
Thu Jun 2 23:04:38 CEST 2005
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17766/C4
Modified Files:
Tag: rel_2_2
Bull.pm
Log Message:
Adding full history support to opac serial
Needs fixing
Index: Bull.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bull.pm,v
retrieving revision 1.6.2.5
retrieving revision 1.6.2.6
diff -C2 -r1.6.2.5 -r1.6.2.6
*** Bull.pm 28 Apr 2005 08:49:40 -0000 1.6.2.5
--- Bull.pm 2 Jun 2005 21:04:35 -0000 1.6.2.6
***************
*** 47,50 ****
--- 47,51 ----
@EXPORT = qw(&newsubscription &modsubscription &delsubscription &getsubscriptions &getsubscription
&getsubscriptionfrombiblionumber &get_subscription_list_from_biblionumber
+ &get_full_subscription_list_from_biblionumber
&modsubscriptionhistory &newissue
&getserials &serialchangestatus
***************
*** 167,171 ****
my ($biblionumber) = @_;
my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*,aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
from subscription
left join subscriptionhistory on subscription.subscriptionid=subscriptionhistory.subscriptionid
--- 168,172 ----
my ($biblionumber) = @_;
my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*, aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
from subscription
left join subscriptionhistory on subscription.subscriptionid=subscriptionhistory.subscriptionid
***************
*** 186,189 ****
--- 187,223 ----
}
+ sub get_full_subscription_list_from_biblionumber {
+ 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'}=\@loopissues;
+ push @res,\%cell;
+ }
+ return \@res;
+ }
sub modsubscription {
More information about the Koha-cvs
mailing list