From 80fd97df4ace92839043405b5d7c9ed0f3335cd9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Jun 2020 17:34:34 +0200 Subject: [PATCH] Bug 25728: Create AV when cataloguing an authority record Test plan: Same as the first patch but when cataloguing an authority record Sponsored-by: Orex Digital Signed-off-by: Hugo Agud --- authorities/authorities.pl | 6 ++++-- .../prog/en/modules/authorities/authorities.tt | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index e422cafb36..afd5749c9e 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -73,7 +73,8 @@ sub build_authorized_values_list { #---- branch - if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { + my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'}; + if ( $category eq "branches" ) { my $sth = $dbh->prepare( "select branchcode,branchname from branches order by branchname"); @@ -86,7 +87,7 @@ sub build_authorized_values_list { $authorised_lib{$branchcode} = $branchname; } } - elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { + elsif ( $category eq "itemtypes" ) { push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); @@ -121,6 +122,7 @@ sub build_authorized_values_list { values => \@authorised_values, labels => \%authorised_lib, default => $value, + ( ( grep { $_ eq $category } ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $category ) ), }; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index 3fcb56cb77..12a8d2a00e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -5,6 +5,10 @@ Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %] [% INCLUDE 'doc-head-close.inc' %] [% Asset.js("lib/hc-sticky.js") | $raw %] + + [% Asset.js("js/cataloging.js") | $raw %] - @@ -375,7 +373,7 @@ function confirmnotdup(redirect){ [% SET mv = subfield_loo.marc_value %] [% IF ( mv.type == 'select' ) %] - [% FOREACH aval IN mv.values %] [% IF aval == mv.default %] @@ -450,6 +448,8 @@ function confirmnotdup(redirect){ +[% INCLUDE 'modals/cataloguing_create_av.inc' %] + -- 2.20.1