View | Details | Raw Unified | Return to bug 25826
Collapse All | Expand All

(-)a/admin/marc_subfields_structure.pl (+28 lines)
Lines 25-30 use C4::Context; Link Here
25
25
26
use Koha::Authority::Types;
26
use Koha::Authority::Types;
27
use Koha::AuthorisedValueCategories;
27
use Koha::AuthorisedValueCategories;
28
use Koha::Filter::MARC::ViewPolicy;
28
29
29
use List::MoreUtils qw( uniq );
30
use List::MoreUtils qw( uniq );
30
31
Lines 191-196 if ( $op eq 'add_form' ) { Link Here
191
        $row_data{isurl}             = $data->{isurl};
192
        $row_data{isurl}             = $data->{isurl};
192
        $row_data{row}               = $i;
193
        $row_data{row}               = $i;
193
        $row_data{link}              = $data->{'link'};
194
        $row_data{link}              = $data->{'link'};
195
196
        if ( defined $data->{kohafield}
197
            and $data->{kohafield} eq 'biblio.biblionumber' )
198
        {
199
            my $hidden_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
200
                    {
201
                        frameworkcode => $frameworkcode,
202
                        interface     => "opac",
203
                    }
204
                )->{biblionumber};
205
206
            my $hidden_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
207
                    {
208
                        frameworkcode => $frameworkcode,
209
                        interface     => "intranet",
210
                    }
211
                )->{biblionumber};
212
213
            if ( $hidden_opac or $hidden_intranet ) {
214
                # We should allow editing for fixing it
215
                $row_data{hidden_protected} = 0;
216
            }
217
            else {
218
                $row_data{hidden_protected} = 1;
219
            }
220
        }
221
194
        push( @loop_data, \%row_data );
222
        push( @loop_data, \%row_data );
195
        $i++;
223
        $i++;
196
    }
224
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-1 / +1 lines)
Lines 129-135 Link Here
129
                <ol><li><label for="defaultvalue[% loo.row | html %]">Default value:</label>
129
                <ol><li><label for="defaultvalue[% loo.row | html %]">Default value:</label>
130
                    <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /></li>
130
                    <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /></li>
131
                    <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>
131
                    <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>
132
                <li><input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
132
                <li><input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" [%- IF loo.hidden_protected -%]data-koha-protected="1"[%- END -%] />
133
                    <label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
133
                    <label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
134
                    <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
134
                    <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
135
                    <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
135
                    <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js (-4 / +15 lines)
Lines 70-76 function setHiddenValue() { Link Here
70
        hidden_value='8';
70
        hidden_value='8';
71
    }
71
    }
72
72
73
    enable_cb(tab);
73
    var hidden_protected = $('#hidden-'+ tab).attr('data-koha-protected');
74
    if ( hidden_protected != 1 ) {
75
        enable_cb(tab);
76
    }
74
77
75
    $('#hidden-' + tab).val(hidden_value);
78
    $('#hidden-' + tab).val(hidden_value);
76
79
Lines 79-84 function setHiddenValue() { Link Here
79
function populateHiddenCheckboxes(tab) {
82
function populateHiddenCheckboxes(tab) {
80
    // read the serialized value
83
    // read the serialized value
81
    var hidden_value = $('#hidden-' + tab).val();
84
    var hidden_value = $('#hidden-' + tab).val();
85
    var hidden_protected = $('#hidden-'+ tab).attr('data-koha-protected');
82
    // deafult to false
86
    // deafult to false
83
    var opac_checked = false;
87
    var opac_checked = false;
84
    var intranet_checked = false;
88
    var intranet_checked = false;
Lines 143-148 function populateHiddenCheckboxes(tab) { Link Here
143
    $("#hidden_collapsed_" + tab).prop('checked',collapsed_checked);
147
    $("#hidden_collapsed_" + tab).prop('checked',collapsed_checked);
144
    $("#hidden_flagged_" + tab).prop('checked',flagged_checked);
148
    $("#hidden_flagged_" + tab).prop('checked',flagged_checked);
145
149
146
    enable_cb(tab);
150
    if ( hidden_protected == 1 ) {
147
151
        $("#hidden_opac_" + tab).prop('disabled','disabled');
152
        $("#hidden_intranet_" + tab).prop('disabled','disabled');
153
        $("#hidden_editor_" + tab).prop('disabled','disabled');
154
        $("#hidden_collapsed_" + tab).prop('disabled','disabled');
155
        $("#hidden_flagged_" + tab).prop('disabled','disabled');
156
    }
157
    else {
158
        enable_cb(tab);
159
    }
148
}
160
}
149
- 

Return to bug 25826