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

Henri-Damien LAURENT laurenthdl at alinto.com
Mon Jun 26 02:17:12 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Henri-Damien LAURENT <hdl>	06/06/26 00:17:12

Modified files:
	C4             : Bull.pm 

Log message:
	Bug FIX : subscription renewal would renew ANY subscription and not the only one selected.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Bull.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.6.2.25&r2=1.6.2.26

Patches:
Index: Bull.pm
===================================================================
RCS file: /sources/koha/koha/C4/Bull.pm,v
retrieving revision 1.6.2.25
retrieving revision 1.6.2.26
diff -u -b -r1.6.2.25 -r1.6.2.26
--- Bull.pm	13 Jun 2006 12:34:15 -0000	1.6.2.25
+++ Bull.pm	26 Jun 2006 00:17:11 -0000	1.6.2.26
@@ -226,12 +226,8 @@
 	my $first;
 	my $previousnote="";
 	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'};
-# 		}
+### BUG To FIX: When there is no published date, will create many null ids!!!
+
 		if ($year and ($year==$subs->{year})){
 			if ($first eq 1){$first=0;}
 			my $temp=$res[scalar(@res)-1]->{'serials'};
@@ -745,7 +741,7 @@
 	my $biblio = $sth->fetchrow_hashref;
 	newsuggestion($user,$subscription->{bibliotitle},$biblio->{author},$biblio->{publishercode},$biblio->{note},'','','','','',$subscription->{biblionumber});
 	# renew subscription
-	$sth=$dbh->prepare("update subscription set startdate=?,numberlength=?,weeklength=?,monthlength=?");
-	$sth->execute(format_date_in_iso($startdate),$numberlength,$weeklength,$monthlength);
+	$sth=$dbh->prepare("update subscription set startdate=?,numberlength=?,weeklength=?,monthlength=? where subscriptionid=?");
+	$sth->execute(format_date_in_iso($startdate),$numberlength,$weeklength,$monthlength, $subscriptionid);
 }
 END { }       # module clean-up code here (global destructor)





More information about the Koha-cvs mailing list