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

paul poulain paul at koha-fr.org
Fri Nov 25 18:09:03 CET 2005


Index: koha/C4/Bull.pm
diff -u koha/C4/Bull.pm:1.6.2.17 koha/C4/Bull.pm:1.6.2.18
--- koha/C4/Bull.pm:1.6.2.17	Fri Sep 23 09:36:25 2005
+++ koha/C4/Bull.pm	Fri Nov 25 17:09:03 2005
@@ -79,7 +79,7 @@
 							WHERE subscription.subscriptionid = serial.subscriptionid AND
 							((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and
 							subscription.aqbooksellerid=$supplierid and
-							biblio.biblionumber = subscription.biblionumber
+							biblio.biblionumber = subscription.biblionumber order by title
 							");
 	} else {
 		$sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid
@@ -87,16 +87,19 @@
 							LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
 							WHERE subscription.subscriptionid = serial.subscriptionid AND
 							((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and
-							biblio.biblionumber = subscription.biblionumber
+							biblio.biblionumber = subscription.biblionumber order by title
 							");
 	}
 	$sth->execute;
 	my @issuelist;
 	my $last_title;
+	my $odd=0;
 	while (my $line = $sth->fetchrow_hashref) {
+		$odd++ unless $line->{title} eq $last_title;
 		$line->{title} = "" if $line->{title} eq $last_title;
 		$last_title = $line->{title} if ($line->{title});
 		$line->{planneddate} = format_date($line->{planneddate});
+		$line->{'odd'} = 1 if $odd %2 ;
 		push @issuelist,$line;
 	}
 	return @issuelist;
@@ -296,25 +299,25 @@
 	my $dbh = C4::Context->dbh;
 	my $sth;
 	if ($biblionumber) {
-		$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?");
+		$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=? order by title");
 		$sth->execute($biblionumber);
 	} else {
 		if ($ISSN and $title)
 		{
-			$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )");
+			$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? order by title )");
 			$sth->execute("%$title%",$ISSN);
 		}
 		else
 		{
 			if ($ISSN)
 			{
-				$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ?");
+				$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ? order by title");
 				$sth->execute($ISSN);
 			}
 			else
 			{
 				$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where  biblio.biblionumber = biblioitems.biblionumber and
- biblio.biblionumber=subscription.biblionumber and biblio.title like ? ");
+ biblio.biblionumber=subscription.biblionumber and biblio.title like ?  order by title");
 				$sth->execute("%$title%");
 			}
 		}





More information about the Koha-cvs mailing list