[Koha-patches] [PATCH] Bug 2553: Alphabetization of branches in Checkout Statistics form.

Garry Collum gcollum at gmail.com
Wed Jul 22 02:46:10 CEST 2009


Improvement of previous patch through the use of GetBranchLoop.
---
 .../prog/en/modules/reports/issues_stats.tmpl      |    2 +-
 reports/issues_stats.pl                            |   15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
index 5eb0101..6495a91 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
@@ -210,7 +210,7 @@
             <td><select name="Filter" id="branch">
                <option value=""> </option>
                <!-- TMPL_LOOP NAME="branchloop" -->
-<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="description" --></option><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_IF -->
 				<!-- /TMPL_LOOP -->
                </select>
              </td> 
diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl
index 11ecc77..cd00424 100755
--- a/reports/issues_stats.pl
+++ b/reports/issues_stats.pl
@@ -137,19 +137,6 @@ for my $itype ( sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{des
 	push @itemtypeloop, { code => $itype , description => $itemtypes->{$itype}->{description} } ;
 }
 
-my $branches=GetBranches();
-my @branchloop;
-foreach (sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches) {
-	my $thisbranch = ''; # FIXME 
-	my %row = (
-		branchcode => $_,
-		selected => ($thisbranch eq $_ ? 1 : 0),
-		code => $branches->{$_}->{'branchcode'},
-		description => $branches->{$_}->{'branchname'},
-	);
-	push @branchloop, \%row;
-}
-
     # location list
 my @locations;
 foreach (sort keys %$locations) {
@@ -178,7 +165,7 @@ $template->param(
 	itemtypeloop => \@itemtypeloop,
 	locationloop => \@locations,
 	   ccodeloop => \@ccodes,
-	  branchloop => \@branchloop,
+	  branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}),
 	hassort1=> $hassort1,
 	hassort2=> $hassort2,
 	Bsort1 => $Bsort1,
-- 
1.5.6.5




More information about the Koha-patches mailing list