From 664cae44d40569c33e7e67b10c6e3d73d25f1bba Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 15 May 2020 12:25:05 +0000 Subject: [PATCH] Bug 25033: (follow-up) Deal with 'Any' branch and don't show dropdown if organized by library Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 13 ++++++++----- suggestion/suggestion.pl | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index ce972056dd..ede593e118 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -506,11 +506,13 @@

Suggestions management

- - +[% IF ( displayby != "branchcode" ) %] + + +[% END %] [% FOR m IN messages %] @@ -540,6 +542,7 @@ [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Status unknown + [% ELSIF (suggestion.suggestiontypelabel == "__ANY__") %]Any [% ELSE %][% suggestion.suggestiontypelabel | html %][% END %] [% ELSE %] [% IF ( suggestion.suggestiontype ) %] diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 4f5c915e53..560a524c77 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -61,8 +61,9 @@ sub GetCriteriumDesc{ } return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); } - return Koha::Libraries->find($criteriumvalue)->branchname - if $displayby =~ /branchcode/; + if ( $displayby =~ /branchcode/ ) { + return $criteriumvalue ? Koha::Libraries->find($criteriumvalue)->branchname : "__ANY__"; + } if ( $displayby =~ /itemtype/ ) { my $av = Koha::AuthorisedValues->search({ category => 'SUGGEST_FORMAT', authorised_value => $criteriumvalue }); return $av->count ? $av->next->lib : 'Unknown'; -- 2.11.0