@@ -, +, @@ - catalogue (Required for staff login) - editcatalogue -> edit_catalogue - editcatalogue -> edit_items - editcatalogue -> edit_items_restricted -> Record Structure -> SubfieldsToAllowForRestrictedEditing all the 952 fields EXCEPT the ones desired to be disabled. In this case, we want to disallow editing of 952$2, 952$a, 952$b, 952$e, 952$h, and 952$o so we enter the following into the SubfieldsToAllowForRestrictedEditing (without quotes) "952$0 952$1 952$3 952$4 952$5 952$7 952$8 952$c 952$d 952$f 952$g 952$i 952$j 952$p 952$t 952$u 952$v 952$w 952$x 952$y 952$z" are editable --- cataloguing/additem.pl | 33 +++++++++--------- .../prog/en/modules/cataloguing/additem.tt | 40 +++++++++++++++------- 2 files changed, 45 insertions(+), 28 deletions(-) --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -164,14 +164,6 @@ sub generate_subfield_form { $value = $input->param('barcode'); } - # Getting list of subfields to keep when restricted editing is enabled - my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing'); - my $allowAllSubfields = ( - not defined $subfieldsToAllowForRestrictedEditing - or $subfieldsToAllowForRestrictedEditing == q|| - ) ? 1 : 0; - my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing); - if ( $subfieldlib->{authorised_value} ) { my @authorised_values; my %authorised_lib; @@ -241,13 +233,6 @@ sub generate_subfield_form { labels => \%authorised_lib, default => $value, }; - # If we're on restricted editing, and our field is not in the list of subfields to allow, - # then it is read-only - $subfield_data{marc_value}->{readonlyselect} = ( - not $allowAllSubfields - and $restrictededition - and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow - ) ? 1: 0; } } # it's a thesaurus / authority field @@ -333,7 +318,23 @@ sub generate_subfield_form { value => $value, }; } - + + # Getting list of subfields to keep when restricted editing is enabled + my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing'); + my $allowAllSubfields = ( + not defined $subfieldsToAllowForRestrictedEditing + or $subfieldsToAllowForRestrictedEditing == q|| + ) ? 1 : 0; + my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing); + + # If we're on restricted editing, and our field is not in the list of subfields to allow, + # then it is read-only + $subfield_data{marc_value}->{readonly} = ( + not $allowAllSubfields + and $restrictededition + and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow + ) ? 1: 0; + return \%subfield_data; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -266,7 +266,7 @@ function confirm_deletion() { [% IF ( mv.type == 'hidden' ) %] [% ELSIF ( mv.type == 'select' ) %] - [% IF ( mv.readonlyselect ) %] + [% IF ( mv.readonly ) %] @@ -280,21 +280,37 @@ function confirm_deletion() { [% END %] [% ELSIF ( mv.type == 'text_auth' ) %] - - [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] - ... + [% IF mv.readonly %] + + [% ELSE %] + + [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] + ... + [% END %] [% ELSIF ( mv.type == 'text_plugin' ) %] - - [% IF ( mv.nopopup ) %] - ... - [% ELSE %] - ... + [% IF mv.readonly %] + + [% ELSE %] + + [% IF ( mv.nopopup ) %] + ... + [% ELSE %] + ... + [% END %] + [%- mv.javascript -%] [% END %] - [%- mv.javascript -%] [% ELSIF ( mv.type == 'text' ) %] - + [% IF mv.readonly %] + + [% ELSE %] + + [% END %] [% ELSIF ( mv.type == 'textarea' ) %] - + [% IF mv.readonly %] + + [% ELSE %] + + [% END %] [% END %] --