Bug 36396: Prevent link to av for 'specials'

See previous commit message, 'QA' part.
We do not support the "specials" categories.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-03-22 09:29:45 +01:00 committed by Katrin Fischer
parent 901f550a47
commit 4941197a4b
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 10 additions and 7 deletions

View File

@ -28,7 +28,7 @@ use Koha::SearchEngine::Elasticsearch::QueryBuilder;
use Koha::SearchMarcMaps;
use Koha::SearchFields;
use Koha::Caches;
use Koha::AuthorisedValueCategories;
use Koha::AuthorisedValues;
use Try::Tiny qw( catch try );
use Module::Load::Conditional qw( can_load );
@ -119,7 +119,7 @@ if ( $op eq 'cud-edit' ) {
my $field_weight = $field_weight[$i];
my $field_staff_client = $field_staff_client[$i];
my $field_opac = $field_opac[$i];
my $av_category = $input->param('facet_av_cat_' . $field_name);
my $av_category = $input->param( 'facet_av_cat_' . $field_name );
my $search_field = Koha::SearchFields->find_or_create(
{
@ -300,13 +300,13 @@ while ( my $search_field = $search_fields->next ) {
push @all_search_fields, $search_field_unblessed;
}
my @authorised_value_categories = Koha::AuthorisedValueCategories->search->get_column('category_name');
my @authorised_value_categories = Koha::AuthorisedValues->new->categories;
push @messages, @errors;
$template->param(
indexes => \@indexes,
all_search_fields => \@all_search_fields,
facetable_fields => \@facetable_fields,
messages => \@messages,
indexes => \@indexes,
all_search_fields => \@all_search_fields,
facetable_fields => \@facetable_fields,
messages => \@messages,
authorised_value_categories => \@authorised_value_categories,
);

View File

@ -527,7 +527,9 @@ a.add, a.delete {
<input type="hidden" name="facet_name" value="[% f.name | html %]" />
</td>
<td>
[% IF f.name != 'itype' && f.name != 'location' && f.name != 'holdingbranch' && f.name != 'homebranch' && f.name != 'ln' && f.name != 'ccode' %]
<select name="facet_av_cat_[% f.name | html %]">
<option value=""></option>
[% FOR av_cat IN authorised_value_categories %]
[% IF f.authorised_value_category == av_cat %]
<option value="[% av_cat | html %]" selected="selected">[% av_cat | html %]</option>
@ -536,6 +538,7 @@ a.add, a.delete {
[% END %]
[% END %]
</select>
[% END %]
</td>
<td>
<a class="btn btn-default btn-xs delete-facet" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a>