[Koha-cvs] CVS: koha/C4 Bull.pm,1.10,1.11
Henri-Damien LAURENT
hdl at users.sourceforge.net
Fri Jun 17 15:44:27 CEST 2005
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4905/C4
Modified Files:
Bull.pm
Log Message:
Detailing the three latest issues on OPAC for serials
Index: Bull.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bull.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** Bull.pm 16 Jun 2005 19:10:10 -0000 1.10
--- Bull.pm 17 Jun 2005 13:44:25 -0000 1.11
***************
*** 51,55 ****
&Find_Next_Date, &Get_Next_Seq
&hassubscriptionexpired &subscriptionexpirationdate &subscriptionrenew
! &getSupplierListWithLateIssues &GetLateIssues &serialdelete);
sub getSupplierListWithLateIssues {
--- 51,55 ----
&Find_Next_Date, &Get_Next_Seq
&hassubscriptionexpired &subscriptionexpirationdate &subscriptionrenew
! &getSupplierListWithLateIssues &GetLateIssues &serialdelete &getlatestserials);
sub getSupplierListWithLateIssues {
***************
*** 288,291 ****
--- 288,306 ----
return ($totalissues, at serials);
}
+ sub getlatestserials{
+ my ($subscriptionid,$limit) =@_;
+ my $dbh = C4::Context->dbh;
+ # status = 2 is "arrived"
+ my $strsth="select serialid,serialseq, status, planneddate from serial where subscriptionid = ? and (status =2 or status=4) order by planneddate DESC LIMIT 0,$limit";
+ my $sth=$dbh->prepare($strsth);
+ $sth->execute($subscriptionid);
+ my @serials;
+ while(my $line = $sth->fetchrow_hashref) {
+ $line->{"status".$line->{status}} = 1; # fills a "statusX" value, used for template status select list
+ $line->{"planneddate"} = format_date($line->{"planneddate"});
+ push @serials,$line;
+ }
+ return \@serials;
+ }
sub serialdelete {
***************
*** 317,321 ****
# change status & update subscriptionhistory
if ($status eq 6){
! delissue($serialseq, $subscriptionid)
}else{
$sth = $dbh->prepare("update serial set serialseq=?,planneddate=?,status=? where serialid = ?");
--- 332,336 ----
# change status & update subscriptionhistory
if ($status eq 6){
! delissue($serialseq, $subscriptionid);
}else{
$sth = $dbh->prepare("update serial set serialseq=?,planneddate=?,status=? where serialid = ?");
More information about the Koha-cvs
mailing list