Bug 2553: Alphabetization of branches in the catalogue stats report.
authorGarry Collum <gcollum@gmail.com>
Wed, 22 Jul 2009 00:36:15 +0000 (20:36 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:21 +0000 (23:19 +0200)
Improvement on previous patch by using GetBranchesLoop.

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/catalogue_stats.tmpl
reports/catalogue_stats.pl

index c367cec..419193e 100644 (file)
                                <td><select name="Filter" id="branch">
                                        <option value=""> </option>
                                        <!-- TMPL_LOOP NAME="CGIBranch" -->
-                                       <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></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 365065f..f3b92b3 100755 (executable)
@@ -153,18 +153,6 @@ if ($do_it) {
                push @authvals, { code => $_, description => $authvals->{$_} };
        }
        
-
-       my $branches=GetBranches();
-       my @branchloop;
-       foreach (sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches) {
-               my $thisbranch = ''; # FIXME: populate $thisbranch to preselect one
-               my %row = (branchcode => $_,
-                       selected => ($thisbranch eq $_ ? 1 : 0),
-                       branchname => $branches->{$_}->{'branchname'},
-               );
-               push @branchloop, \%row;
-       }
-
        my $locations = GetKohaAuthorisedValues("items.location");
        my @locations;
        foreach (sort keys %$locations) {
@@ -177,7 +165,7 @@ if ($do_it) {
                                        haslccn   => $haslccn,
                                        hascote   => $hascote,
                                        CGIItemType => $CGIitemtype,
-                                       CGIBranch    => \@branchloop,
+                                       CGIBranch    => GetBranchesLoop(C4::Context->userenv->{'branch'}),
                                        locationloop => \@locations,
                                        authvals     => \@authvals,
                                        CGIextChoice => \@mime,