Bug 2553: Alphabetization of branches in Checkout Statistics form.
authorGarry Collum <gcollum@gmail.com>
Wed, 22 Jul 2009 00:46:10 +0000 (20:46 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:21 +0000 (23:19 +0200)
Improvement of previous patch through the use of GetBranchLoop.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
reports/issues_stats.pl

index 5eb0101..6495a91 100644 (file)
             <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> 
index a497564..09842ba 100755 (executable)
@@ -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,