Bugzilla – Attachment 108885 Details for
Bug 25728
Add the ability to create a new authorised value within the cataloguing module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25728: Create AV when cataloguing an authority record
Bug-25728-Create-AV-when-cataloguing-an-authority-.patch (text/plain), 3.78 KB, created by
Jonathan Druart
on 2020-08-22 09:37:49 UTC
(
hide
)
Description:
Bug 25728: Create AV when cataloguing an authority record
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-22 09:37:49 UTC
Size:
3.78 KB
patch
obsolete
>From dd0298fa219755a3aea63ee6fc7b91102af46b11 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <hagud@orex.es> >--- > authorities/authorities.pl | 6 ++++-- > .../prog/en/modules/authorities/authorities.tt | 12 +++++++++++- > 2 files changed, 15 insertions(+), 3 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 fb33a1631c..601726a25f 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,9 @@ > <title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.js("lib/hc-sticky.js") | $raw %] >+<script> >+ var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]"; >+</script> > [% INCLUDE 'select2.inc' %] > [% Asset.js("js/cataloging.js") | $raw %] > >@@ -369,7 +372,12 @@ function confirmnotdup(redirect){ > > [% SET mv = subfield_loo.marc_value %] > [% IF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]"> >+ [% IF mv.category AND CAN_user_parameters_manage_auth_values %] >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]"> >+ [% ELSE %] >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]"> >+ [% END %] >+ > [% FOREACH aval IN mv.values %] > [% IF aval == mv.default %] > <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >@@ -444,6 +452,8 @@ function confirmnotdup(redirect){ > > </form> > >+[% INCLUDE 'modals/cataloguing_create_av.inc' %] >+ > </div> > </div> > </div> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25728
:
105837
|
105838
|
105839
|
105840
|
105841
|
105842
|
105852
|
106696
|
106697
|
106698
|
106699
|
106700
|
106701
|
106702
|
108356
|
108357
|
108358
|
108359
|
108360
|
108361
|
108362
|
108883
|
108884
|
108885
|
108886
|
108887
|
108888
|
108889
|
108890
|
108922
|
108923
|
108924
|
108925
|
108926
|
108927
|
108928
|
108929
|
108930
|
108931