Bug 25033: (follow-up) Deal with 'Any' branch and don't show dropdown if organized by library

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-05-15 12:25:05 +00:00 committed by Jonathan Druart
parent b893504ec9
commit 4d01e9da98
2 changed files with 11 additions and 7 deletions

View file

@ -506,11 +506,13 @@
<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 %]
@ -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 ) %]

View file

@ -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';