[Koha-cvs] koha/C4 Bull.pm [rel_2_2]

paul poulain paul at koha-fr.org
Tue Apr 4 15:15:50 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	paul poulain <tipaul at savannah.gnu.org>	06/04/04 13:15:50

Modified files:
	C4             : Bull.pm 

Log message:
	add the last 5 arrived serials for a given subscription (to enable "rollback")

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Bull.pm.diff?only_with_tag=rel_2_2&tr1=1.6.2.21&tr2=1.6.2.22&r1=text&r2=text

Patches:
Index: koha/C4/Bull.pm
diff -u koha/C4/Bull.pm:1.6.2.21 koha/C4/Bull.pm:1.6.2.22
--- koha/C4/Bull.pm:1.6.2.21	Wed Feb  8 09:20:11 2006
+++ koha/C4/Bull.pm	Tue Apr  4 13:15:50 2006
@@ -357,6 +357,18 @@
 sub getserials {
 	my ($subscriptionid) = @_;
 	my $dbh = C4::Context->dbh;
+	# OK, now add the last 5 issues arrives/missing
+	my $sth=$dbh->prepare("select serialid,serialseq, status, planneddate,notes from serial where subscriptionid = ? and (status in (2,4,5)) order by serialid DESC");
+	$sth->execute($subscriptionid);
+	my $counter=0;
+	my @serials;
+	while((my $line = $sth->fetchrow_hashref) && $counter <5) {
+		$counter++;
+		$line->{"status".$line->{status}} = 1; # fills a "statusX" value, used for template status select list
+		$line->{"planneddate"} = format_date($line->{"planneddate"});
+		push @serials,$line;
+	}
+	
 	# status = 2 is "arrived"
 	my $sth=$dbh->prepare("select serialid,serialseq, status, planneddate,notes from serial where subscriptionid = ? and status <>2 and status <>4 and status <>5");
 	$sth->execute($subscriptionid);





More information about the Koha-cvs mailing list