From 669a146e1a10b2b468e42039fa295d20b9d78b6c Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 9 Oct 2007 16:46:34 -0500 Subject: [PATCH] Sorting Branches by Branchcode on display. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- opac/opac-main.pl | 2 +- opac/opac-search.pl | 2 +- opac/opac-topissues.pl | 2 +- opac/opac-user.pl | 2 +- reports/bor_issues_top.pl | 39 ++++++++++++++++++-------------------- reports/borrowers_stats.pl | 2 +- 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 8ec0eb02d8..0a548a90f0 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -57,7 +57,7 @@ if ( C4::Context->preference("SearchMyLibraryFirst") ) { my $branches = GetBranches(); my @branchloop; - foreach my $thisbranch ( keys %$branches ) { + foreach my $thisbranch (sort keys %$branches ) { my $selected = 1 if ( C4::Context->userenv && ( $thisbranch eq C4::Context->userenv->{branch} ) ); diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 320336facc..90ed8c35e5 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -220,7 +220,7 @@ query parser. # load the branches my $branches = GetBranches(); my @branch_loop; -for my $branch_hash ( keys %$branches ) { +for my $branch_hash (sort keys %$branches ) { my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst')); push @branch_loop, { diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 1e8b1952b4..53ee77b8c6 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -96,7 +96,7 @@ $template->param(do_it => 1, # load the branches my $branches = GetBranches(); my @branch_loop; -for my $branch_hash ( keys %$branches ) { +for my $branch_hash (sort keys %$branches ) { my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst')); push @branch_loop, { diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 36395259f8..a6f385fde2 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -141,7 +141,7 @@ $template->param( overdues_count => $overdues_count ); # load the branches my $branches = GetBranches(); my @branch_loop; -for my $branch_hash ( keys %$branches ) { +for my $branch_hash (sort keys %$branches ) { my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst')); push @branch_loop, { diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index 0f7dc0eda0..01df7385db 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -122,28 +122,25 @@ if ($do_it) { # foreach my $mime (@mime){ # warn "".$mime; # } - - my $CGIextChoice=CGI::scrolling_list( - -name => 'MIME', - -id => 'MIME', - -values => \@mime, - -size => 1, - -multiple => 0 ); - - my @dels = ( C4::Context->preference("delimiter") ); - my $CGIsepChoice=CGI::scrolling_list( - -name => 'sep', - -id => 'sep', - -values => \@dels, - -size => 1, - -multiple => 0 ); - #branch - my $branches = GetBranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; + my $CGIextChoice=CGI::scrolling_list( + -name => 'MIME', + -id => 'MIME', + -values => \@mime, + -size => 1, + -multiple => 0 ); + + my @dels = ( C4::Context->preference("delimiter") ); + my $CGIsepChoice=CGI::scrolling_list( + -name => 'sep', + -id => 'sep', + -values => \@dels, + -size => 1, + -multiple => 0 ); + #branch + my $branches = GetBranches; + my @branchloop; + foreach my $thisbranch (sort keys %$branches) { my %row =(value => $thisbranch, -# selected => $selected, branchname => $branches->{$thisbranch}->{'branchname'}, ); push @branchloop, \%row; diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index eef46762d9..84654f8483 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -133,7 +133,7 @@ my @select_branch; #my %select_branches; push @select_branch,""; #$select_branches{""}=""; -foreach my $thisbranch (keys %$branches) { +foreach my $thisbranch (sort keys %$branches) { push @select_branch,$thisbranch; # my $selected = 1 if $thisbranch eq $branch; my %row =(value => $thisbranch, -- 2.20.1