use Koha::Authority::Types;
use Koha::AuthorisedValueCategories;
+use Koha::Filter::MARC::ViewPolicy;
use List::MoreUtils qw( uniq );
$row_data{isurl} = $data->{isurl};
$row_data{row} = $i;
$row_data{link} = $data->{'link'};
+
+ if ( defined $data->{kohafield}
+ and $data->{kohafield} eq 'biblio.biblionumber' )
+ {
+ my $hidden_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
+ {
+ frameworkcode => $frameworkcode,
+ interface => "opac",
+ }
+ )->{biblionumber};
+
+ my $hidden_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
+ {
+ frameworkcode => $frameworkcode,
+ interface => "intranet",
+ }
+ )->{biblionumber};
+
+ if ( $hidden_opac or $hidden_intranet ) {
+ # We should allow editing for fixing it
+ $row_data{hidden_protected} = 0;
+ }
+ else {
+ $row_data{hidden_protected} = 1;
+ }
+ }
+
push( @loop_data, \%row_data );
$i++;
}
<ol><li><label for="defaultvalue[% loo.row | html %]">Default value:</label>
<input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /></li>
<li><label for="maxlength[% loo.row | html %]">Max length:</label><input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" /></li>
- <li><input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
+ <li><input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" [%- IF loo.hidden_protected -%]data-koha-protected="1"[%- END -%] />
<label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
<input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
<label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
hidden_value='8';
}
- enable_cb(tab);
+ var hidden_protected = $('#hidden-'+ tab).attr('data-koha-protected');
+ if ( hidden_protected != 1 ) {
+ enable_cb(tab);
+ }
$('#hidden-' + tab).val(hidden_value);
function populateHiddenCheckboxes(tab) {
// read the serialized value
var hidden_value = $('#hidden-' + tab).val();
+ var hidden_protected = $('#hidden-'+ tab).attr('data-koha-protected');
// deafult to false
var opac_checked = false;
var intranet_checked = false;
$("#hidden_collapsed_" + tab).prop('checked',collapsed_checked);
$("#hidden_flagged_" + tab).prop('checked',flagged_checked);
- enable_cb(tab);
-
+ if ( hidden_protected == 1 ) {
+ $("#hidden_opac_" + tab).prop('disabled','disabled');
+ $("#hidden_intranet_" + tab).prop('disabled','disabled');
+ $("#hidden_editor_" + tab).prop('disabled','disabled');
+ $("#hidden_collapsed_" + tab).prop('disabled','disabled');
+ $("#hidden_flagged_" + tab).prop('disabled','disabled');
+ }
+ else {
+ enable_cb(tab);
+ }
}