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 192-197 if ( $op eq 'add_form' ) { Link Here
192
        $row_data{isurl}             = $data->{isurl};
193
        $row_data{isurl}             = $data->{isurl};
193
        $row_data{row}               = $i;
194
        $row_data{row}               = $i;
194
        $row_data{link}              = $data->{'link'};
195
        $row_data{link}              = $data->{'link'};
196
197
        if ( defined $data->{kohafield}
198
            and $data->{kohafield} eq 'biblio.biblionumber' )
199
        {
200
            my $hidden_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
201
                    {
202
                        frameworkcode => $frameworkcode,
203
                        interface     => "opac",
204
                    }
205
                )->{biblionumber};
206
207
            my $hidden_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc(
208
                    {
209
                        frameworkcode => $frameworkcode,
210
                        interface     => "intranet",
211
                    }
212
                )->{biblionumber};
213
214
            if ( $hidden_opac or $hidden_intranet ) {
215
                # We should allow editing for fixing it
216
                $row_data{hidden_protected} = 0;
217
            }
218
            else {
219
                $row_data{hidden_protected} = 1;
220
            }
221
        }
222
195
        push( @loop_data, \%row_data );
223
        push( @loop_data, \%row_data );
196
        $i++;
224
        $i++;
197
    }
225
    }
(-)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