From 222e55c1743b66161b8a38063a4e880170e0b1c4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Dec 2012 10:13:49 +0100 Subject: [PATCH] [Signed off] Bug 7919: Followup: Fix plural and GetAuthvalueDropbox Remove plural if there is just one branch limitation (authorised_values.tt, categorie.tt and patron-attr-types.tt) FIX a bug in GetAuthvalueDropbox (called by acqui/fetch_sort_dropbox.pl) Signed-off-by: Melia Meggs --- C4/Budgets.pm | 8 ++++---- .../prog/en/modules/admin/authorised_values.tt | 7 ++++++- .../prog/en/modules/admin/categorie.tt | 8 +++++++- .../prog/en/modules/admin/patron-attr-types.tt | 10 ++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index a054ac7..7b553e6 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -400,11 +400,11 @@ sub GetAuthvalueDropbox { my $option_list = []; my @authorised_values = ( q{} ); - while (my ($value, $lib) = $sth->fetchrow_array) { + while (my $av = $sth->fetchrow_hashref) { push @{$option_list}, { - value => $value, - label => $lib, - default => ($default eq $value), + value => $av->{authorised_value}, + label => $av->{lib}, + default => ($default eq $av->{authorised_value}), }; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 8d60493..e464617 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -274,7 +274,12 @@ [% FOREACH branch IN loo.branches %] [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] [% END %] - [% loo.branches.size %] branches limitations + + [% IF loo.branches.size > 1 %] + [% loo.branches.size %] branches limitations + [% ELSE %] + [% loo.branches.size %] branch limitation + [% END %] [% ELSE %] No limitation [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index 9398ca6..6c3114f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -371,7 +371,13 @@ Confirm deletion of category [% categorycode |html %][% END %] [% FOREACH branch IN loo.branches %] [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] [% END %] - [% loo.branches.size %] branches limitations + + [% IF loo.branches.size > 1 %] + [% loo.branches.size %] branches limitations + [% ELSE %] + [% loo.branches.size %] branch limitation + [% END %] + [% ELSE %] No limitation [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index 3fb9760..d70bdbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -315,12 +315,18 @@ function CheckAttributeTypeForm(f) { [% item.code |html %] [% item.description %] - [% IF item.branches > 0 %] + [% IF item.branches.size > 0 %] [% branches_str = "" %] [% FOREACH branch IN item.branches %] [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] [% END %] - [% item.branches.size %] branches limitations + + [% IF item.branches.size > 1 %] + [% item.branches.size %] branches limitations + [% ELSE %] + [% item.branches.size %] branch limitation + [% END %] + [% ELSE %] No limitation [% END %] -- 1.7.2.5