From f422de735c0783177b9d3fcacff5d813bd067623 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 --- .../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 1c7a9c015d..ee0fe75aa9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -500,11 +500,13 @@

Suggestions management

- - +[% IF ( displayby != "branchcode" ) %] + + +[% END %] [% FOR m IN messages %] @@ -534,6 +536,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.20.1