[Koha-cvs] koha/acqui lateorders.pl newbiblio.pl supplier.pl

paul poulain paul at koha-fr.org
Wed Jan 18 15:52:08 CET 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	
Changes by:	paul poulain <tipaul at savannah.gnu.org>	06/01/18 14:52:07

Modified files:
	acqui          : lateorders.pl newbiblio.pl supplier.pl 

Log message:
	bugfixes xhtml & prog templates

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/acqui/lateorders.pl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/acqui/newbiblio.pl.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/acqui/supplier.pl.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: koha/acqui/lateorders.pl
diff -u koha/acqui/lateorders.pl:1.2 koha/acqui/lateorders.pl:1.3
--- koha/acqui/lateorders.pl:1.2	Fri Jan  6 16:39:37 2006
+++ koha/acqui/lateorders.pl	Wed Jan 18 14:52:07 2006
@@ -4,6 +4,7 @@
 use CGI;
 use C4::Acquisition;
 use C4::Auth;
+use C4::Koha;
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Context;
@@ -43,21 +44,14 @@
 
 $template->param(Supplier=>$supplierlist{$supplierid}) if ($supplierid);
 
-my @select_branches;
-my %select_branches;
-push @select_branches,"";
-$select_branches{""}="";
-my ($count, @branches) = branches(); 
-#branches is IndependantBranches aware
-foreach my $branch (@branches){
-	push @select_branches, $branch->{branchcode};
-	$select_branches{$branch->{branchcode}}=$branch->{branchname};
+my $branches = getbranches;
+my @branchloop;
+foreach my $thisbranch (sort keys %$branches) {
+	my %row =(value => $thisbranch,
+				branchname => $branches->{$thisbranch}->{'branchname'},
+			);
+	push @branchloop, \%row;
 }
-my $CGIbranch=CGI::scrolling_list( -name     => 'branch',
-				-values   => \@select_branches,
-				-labels   => \%select_branches,
-				-size     => 1,
-				-multiple => 0 );
 
 my ($count, @lateorders) = getlateorders($delay,$supplierid,$branch);
 my $total;
@@ -66,7 +60,7 @@
 }
 $template->param(delay=>$delay) if ($delay);
 $template->param(
-	CGIbranch => $CGIbranch,
+	branchloop => \@branchloop,
 	CGIsupplier => $CGIsupplier,
 	lateorders => \@lateorders,
 	total=>$total,
Index: koha/acqui/newbiblio.pl
diff -u koha/acqui/newbiblio.pl:1.29 koha/acqui/newbiblio.pl:1.30
--- koha/acqui/newbiblio.pl:1.29	Fri Jan  6 16:39:37 2006
+++ koha/acqui/newbiblio.pl	Wed Jan 18 14:52:07 2006
@@ -29,9 +29,11 @@
 use C4::Auth;
 use C4::Acquisition;
 use C4::Suggestions;
+use C4::Biblio;
 use C4::Search;
 use C4::Output;
 use C4::Input;
+use C4::Koha;
 use C4::Interface::CGI::Output;
 use HTML::Template;
 
@@ -111,29 +113,22 @@
 $sth->finish;
 
 # build branches list
-my @branches;
-my @select_branch;
-my %select_branches;
-my ($count2, at branches)=branches();
-for (my $i=0;$i<$count2;$i++){
-	if ((!C4::Context->preference('IndependantBranches'))||(C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} ==1))
-	||((C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} !=1) && (C4::Context->userenv->{branch} eq $branches[$i]->{'branchcode'})))){
-		push @select_branch, $branches[$i]->{'branchcode'};#
-		$select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
-	}
+my $branches = getbranches;
+my @branchloop;
+foreach my $thisbranch (sort keys %$branches) {
+	my %row =(value => $thisbranch,
+				branchname => $branches->{$thisbranch}->{'branchname'},
+			);
+	push @branchloop, \%row;
 }
-my $CGIbranch=CGI::scrolling_list( -name     => 'branch',
-			-values   => \@select_branch,
-			-default  => $data->{'branchcode'},
-			-labels   => \%select_branches,
-			-size     => 1,
-			-multiple => 0 );
+$template->param(branchloop =>\@branchloop);
 
 # build bookfund list
 my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
 $sthtemp->execute($loggedinuser);
 my ($flags, $homebranch)=$sthtemp->fetchrow;
 
+my $count2;
 my @bookfund;
 my @select_bookfund;
 my %select_bookfunds;
@@ -199,7 +194,6 @@
 						author => $data->{'author'},
 						copyrightdate => $data->{'copyrightdate'},
 						CGIitemtype => $CGIitemtype,
-						CGIbranch => $CGIbranch,
 						CGIbookfund => $CGIbookfund,
 						isbn => $data->{'isbn'},
 						seriestitle => $data->{'seriestitle'},
Index: koha/acqui/supplier.pl
diff -u koha/acqui/supplier.pl:1.9 koha/acqui/supplier.pl:1.10
--- koha/acqui/supplier.pl:1.9	Thu Aug 12 14:35:22 2004
+++ koha/acqui/supplier.pl	Wed Jan 18 14:52:07 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: supplier.pl,v 1.9 2004/08/12 14:35:22 tipaul Exp $
+# $Id: supplier.pl,v 1.10 2006/01/18 14:52:07 tipaul Exp $
 
 #script to show display basket of orders
 #written by chris at katipo.co.nz 24/2/2000
@@ -50,12 +50,12 @@
 my @loop_invoicecurrency;
 for (my $i=0;$i<$count;$i++) {
 	if ($booksellers[0]->{'listprice'} eq $currencies->[$i]->{'currency'}) {
-		push @loop_pricescurrency, { currency => "<option selected value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>" };
+		push @loop_pricescurrency, { currency => "<option selected=\"selected\" value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>" };
 	} else {
 		push @loop_pricescurrency, { currency => "<option value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>"};
 	}
 	if ($booksellers[0]->{'invoiceprice'} eq $currencies->[$i]->{'currency'}) {
-		push @loop_invoicecurrency, { currency => "<option selected value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>"};
+		push @loop_invoicecurrency, { currency => "<option selected=\"selected\" value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>"};
 	} else {
 		push @loop_invoicecurrency, { currency => "<option value=\"$currencies->[$i]->{'currency'}\">$currencies->[$i]->{'currency'}</option>"};
 	}





More information about the Koha-cvs mailing list