Bug 25033: (follow-up) Deal with 'Any' branch and don't show dropdown if organized...
authorNick Clemens <nick@bywatersolutions.com>
Fri, 15 May 2020 12:25:05 +0000 (12:25 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 25 Aug 2020 09:31:42 +0000 (11:31 +0200)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
suggestion/suggestion.pl

index ce97205..ede593e 100644 (file)
 
 <h1>Suggestions management</h1>
 
-<label for="branchcode">Viewing suggestions for library:</label>
-<select name="branchcode" id="branchcode">
-    <option value="__ANY__">Any</option>
-    [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
-</select>
+[% IF ( displayby != "branchcode" ) %]
+    <label for="branchcode">Viewing suggestions for library:</label>
+    <select name="branchcode" id="branchcode">
+        <option value="__ANY__">Any</option>
+        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
+    </select>
+[% END %]
 
 
 [% FOR m IN messages %]
                 [% 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 ) %]
index 4f5c915..560a524 100755 (executable)
@@ -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';