Bugzilla – Attachment 34164 Details for
Bug 13401
sort branches alphabetically in admin/authorised_values.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 13401 - sort branches alphabetically in admin/authorised_values.pl
Signed-off-Bug-13401---sort-branches-alphabeticall.patch (text/plain), 2.03 KB, created by
Marc Véron
on 2014-12-06 14:50:55 UTC
(
hide
)
Description:
[Signed-off] Bug 13401 - sort branches alphabetically in admin/authorised_values.pl
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2014-12-06 14:50:55 UTC
Size:
2.03 KB
patch
obsolete
>From 5f60a75e70e950581ef5a3c2a181d6ddbd5339df Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 5 Dec 2014 15:50:05 +0100 >Subject: [PATCH] [Signed-off] Bug 13401 - sort branches alphabetically in > admin/authorised_values.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds a sort of branches alphabetically by name in authorised values administration, like in many other pages. > >Also replaces var $branch (too ambigus) by $branchcode. > >Test plan : >- Create 2 branches : code=AAA,name=Zbranch and code=ZZZ,name=Abranch >- Create a new authorized value : admin/authorised_values.pl >- Look at "Libraries limitation" : >=> Without patch branches are sorted by code : Zbranch then Abranch >=> Without patch branches are sorted by name : Abranch then Zbranch >- Select a branch and save >- Re-edit >=> Check the same branch is selected > >Followed test plan. Patch behaves as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > admin/authorised_values.pl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl >index 35afaca..1e373c4 100755 >--- a/admin/authorised_values.pl >+++ b/admin/authorised_values.pl >@@ -85,11 +85,11 @@ if ($op eq 'add_form') { > my $branches = GetBranches; > my @branches_loop; > >- foreach my $branch (sort keys %$branches) { >- my $selected = ( grep {$_->{branchcode} eq $branch} @selected_branches ) ? 1 : 0; >+ foreach my $branchcode ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) { >+ my $selected = ( grep {$_->{branchcode} eq $branchcode} @selected_branches ) ? 1 : 0; > push @branches_loop, { >- branchcode => $branches->{$branch}{branchcode}, >- branchname => $branches->{$branch}{branchname}, >+ branchcode => $branchcode, >+ branchname => $branches->{$branchcode}->{branchname}, > selected => $selected, > }; > } >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13401
:
34146
|
34164
|
34345