[Koha-cvs] koha/admin aqbookfund.pl [rel_2_2]

Antoine Farnault antoine at koha-fr.org
Wed Feb 28 09:47:00 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Antoine Farnault <toins>	07/02/28 08:47:00

Modified files:
	admin          : aqbookfund.pl 

Log message:
	reporting bug fix from 2.2.7.1 to 2.2.7.
	LOG was :
		BUGFIX : budget branch was not retrieved in budget modification.
		
		bug probably exist also in 2.2 and in rel_3_0

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/admin/aqbookfund.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.19.2.10&r2=1.19.2.11

Patches:
Index: aqbookfund.pl
===================================================================
RCS file: /sources/koha/koha/admin/aqbookfund.pl,v
retrieving revision 1.19.2.10
retrieving revision 1.19.2.11
diff -u -b -r1.19.2.10 -r1.19.2.11
--- aqbookfund.pl	20 Jun 2006 16:21:42 -0000	1.19.2.10
+++ aqbookfund.pl	28 Feb 2007 08:47:00 -0000	1.19.2.11
@@ -123,14 +123,6 @@
 	$select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
 }
 
-my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
-			-values   => \@select_branch,
-			-labels   => \%select_branches,
-			-size     => 1,
-			-tabindex=>'',
-			-multiple => 0 );
-$template->param(CGIbranch => $CGIbranch);
-
 ################## ADD_FORM ##################################
 # called by default. Used to create form to add or  modify a record
 if ($op eq 'add_form') {
@@ -139,10 +131,26 @@
 	my $header;
 	if ($bookfundid) {
 		my $dbh = C4::Context->dbh;
-		my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid=?");
+		my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup,branchcode from aqbookfund where bookfundid=?");
 		$sth->execute($bookfundid);
 		$data=$sth->fetchrow_hashref;
 		$sth->finish;
+        my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+                    -values   => \@select_branch,
+                    -labels   => \%select_branches,
+                    -size     => 1,
+                    -tabindex=>'',
+                    -default=> $data->{branchcode},
+                    -multiple => 0 );
+        $template->param(CGIbranch => $CGIbranch);
+	    } else {
+            my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+                        -values   => \@select_branch,
+                        -labels   => \%select_branches,
+                        -size     => 1,
+                        -tabindex=>'',
+                        -multiple => 0 );
+            $template->param(CGIbranch => $CGIbranch);
 	    }
 	if ($bookfundid) {
 	    $header = "Modify book fund";
@@ -152,7 +160,7 @@
 	    $template->param('header-is-add-p' => 1);
 	}
 	$template->param('use-header-flags-p' => 1);
-	$template->param(header => $header); # NOTE deprecated
+	#$template->param(header => $header); # NOTE deprecated
 	my $add_or_modify=0;
 	if ($bookfundid) {
 	    $add_or_modify=1;





More information about the Koha-cvs mailing list