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

(-)a/admin/patron-attr-types.pl (+2 lines)
Lines 115-120 sub add_update_attribute_type { Link Here
115
    my $staff_searchable          = $input->param('staff_searchable')          ? 1 : 0;
115
    my $staff_searchable          = $input->param('staff_searchable')          ? 1 : 0;
116
    my $searched_by_default       = $input->param('searched_by_default')       ? 1 : 0;
116
    my $searched_by_default       = $input->param('searched_by_default')       ? 1 : 0;
117
    my $keep_for_pseudonymization = $input->param('keep_for_pseudonymization') ? 1 : 0;
117
    my $keep_for_pseudonymization = $input->param('keep_for_pseudonymization') ? 1 : 0;
118
    my $staff_viewonly            = $input->param('staff_viewonly')            ? 1 : 0;
118
    my $mandatory                 = $input->param('mandatory')                 ? 1 : 0;
119
    my $mandatory                 = $input->param('mandatory')                 ? 1 : 0;
119
    my $opac_mandatory            = $input->param('opac_mandatory')            ? 1 : 0;
120
    my $opac_mandatory            = $input->param('opac_mandatory')            ? 1 : 0;
120
    my $authorised_value_category = $input->param('authorised_value_category');
121
    my $authorised_value_category = $input->param('authorised_value_category');
Lines 152-157 sub add_update_attribute_type { Link Here
152
            staff_searchable          => $staff_searchable,
153
            staff_searchable          => $staff_searchable,
153
            searched_by_default       => $searched_by_default,
154
            searched_by_default       => $searched_by_default,
154
            keep_for_pseudonymization => $keep_for_pseudonymization,
155
            keep_for_pseudonymization => $keep_for_pseudonymization,
156
            staff_viewonly            => $staff_viewonly,
155
            mandatory                 => $mandatory,
157
            mandatory                 => $mandatory,
156
            opac_mandatory            => $opac_mandatory,
158
            opac_mandatory            => $opac_mandatory,
157
            authorised_value_category => $authorised_value_category,
159
            authorised_value_category => $authorised_value_category,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (+20 lines)
Lines 184-189 Link Here
184
                        [% END %]
184
                        [% END %]
185
                        <span class="hint"> If checked, this field will be included in 'Standard' patron searches. Requires field to be marked as searchable above </span>
185
                        <span class="hint"> If checked, this field will be included in 'Standard' patron searches. Requires field to be marked as searchable above </span>
186
                    </li>
186
                    </li>
187
                    <li
188
                        ><label for="staff_viewonly">View-only in Staff interface: </label>
189
                        [% IF attribute_type AND attribute_type.staff_viewonly %]
190
                            <input type="checkbox" id="staff_viewonly" name="staff_viewonly" checked="checked" />
191
                        [% ELSE %]
192
                            <input type="checkbox" id="staff_viewonly" name="staff_viewonly" />
193
                        [% END %]
194
                        <span class="hint">Check to make this attribute view-only, non-editable by staff in the staff interface.</span>
195
                    </li>
187
                    <li
196
                    <li
188
                        ><label for="mandatory">Staff interface mandatory: </label>
197
                        ><label for="mandatory">Staff interface mandatory: </label>
189
                        [% IF attribute_type AND attribute_type.mandatory %]
198
                        [% IF attribute_type AND attribute_type.mandatory %]
Lines 460-465 Link Here
460
                $("#branches option:first").attr("selected", "selected");
469
                $("#branches option:first").attr("selected", "selected");
461
            }
470
            }
462
471
472
            $("#staff_viewonly")
473
                .change(function () {
474
                    if (this.checked) {
475
                        $("#mandatory").prop("checked", false);
476
                        $("#mandatory").attr("disabled", true).parent().attr("aria-disabled", "true");
477
                    } else {
478
                        $("#mandatory").removeAttr("disabled").parent().removeAttr("aria-disabled");
479
                    }
480
                })
481
                .change();
482
463
            $("#is_date")
483
            $("#is_date")
464
                .change(function () {
484
                .change(function () {
465
                    if (this.checked) {
485
                    if (this.checked) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-6 / +26 lines)
Lines 1527-1533 Link Here
1527
                                                                    <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1527
                                                                    <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1528
                                                                [% END %]
1528
                                                                [% END %]
1529
                                                                [% IF ( patron_attribute.use_dropdown ) %]
1529
                                                                [% IF ( patron_attribute.use_dropdown ) %]
1530
                                                                    <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" [% IF patron_attribute.mandatory %]required="required"[% END %]>
1530
                                                                    <select
1531
                                                                        id="[% patron_attribute.form_id | html %]"
1532
                                                                        name="[% patron_attribute.form_id | html %]"
1533
                                                                        [% IF patron_attribute.mandatory %]required="required"[% END %]
1534
                                                                        [% IF ( patron_attribute.viewonly AND !CAN_user_superlibrarian ) %]disabled[% END %]
1535
                                                                    >
1531
                                                                        <option value=""></option>
1536
                                                                        <option value=""></option>
1532
                                                                        [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1537
                                                                        [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1533
                                                                            [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1538
                                                                            [% IF auth_val_loo.authorised_value == patron_attribute.value %]
Lines 1552-1558 Link Here
1552
                                                                            />
1557
                                                                            />
1553
                                                                        [% ELSE %]
1558
                                                                        [% ELSE %]
1554
                                                                            <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1559
                                                                            <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1555
[% patron_attribute.value | html %]</textarea
1560
                                                                            [% patron_attribute.value | html %]</textarea
1556
                                                                            >
1561
                                                                            >
1557
                                                                        [% END %]
1562
                                                                        [% END %]
1558
                                                                    [% ELSE %]
1563
                                                                    [% ELSE %]
Lines 1564-1581 Link Here
1564
                                                                                maxlength="10"
1569
                                                                                maxlength="10"
1565
                                                                                size="10"
1570
                                                                                size="10"
1566
                                                                                value="[% patron_attribute.value | html %]"
1571
                                                                                value="[% patron_attribute.value | html %]"
1567
                                                                                class="flatpickr"
1572
                                                                                [% IF ( patron_attribute.viewonly AND !CAN_user_superlibrarian ) -%]
1573
                                                                                    disabled
1574
                                                                                [%- ELSE -%]
1575
                                                                                    class="flatpickr"
1576
                                                                                [%- END %]
1568
                                                                            />
1577
                                                                            />
1569
                                                                        [% ELSE %]
1578
                                                                        [% ELSE %]
1570
                                                                            <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1579
                                                                            <textarea
1580
                                                                                rows="2"
1581
                                                                                cols="30"
1582
                                                                                id="[% patron_attribute.form_id | html %]"
1583
                                                                                name="[% patron_attribute.form_id | html %]"
1584
                                                                                [% IF ( patron_attribute.viewonly AND !CAN_user_superlibrarian ) %]disabled[% END %]
1585
                                                                            >
1586
                                                                            [%- patron_attribute.value | html %]</textarea
1587
                                                                            >
1571
                                                                        [% END %]
1588
                                                                        [% END %]
1572
                                                                    [% END %]
1589
                                                                    [% END %]
1573
                                                                [% END # /IF ( patron_attribute.use_dropdown ) %]
1590
                                                                [% END # /IF ( patron_attribute.use_dropdown ) %]
1591
                                                                [% IF ( patron_attribute.viewonly AND !CAN_user_superlibrarian ) %]
1592
                                                                    <input type="hidden" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" value="[% patron_attribute.value | html %]" />
1593
                                                                [% END %]
1574
                                                                <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1594
                                                                <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1575
                                                                [% IF ( !patron_attribute.is_date ) %]
1595
                                                                [% IF ( !patron_attribute.is_date AND ( !patron_attribute.viewonly || CAN_user_superlibrarian ) ) %]
1576
                                                                    <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
1596
                                                                    <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
1577
                                                                [% END %]
1597
                                                                [% END %]
1578
                                                                [% IF ( patron_attribute.repeatable ) %]
1598
                                                                [% IF ( patron_attribute.repeatable AND ( !patron_attribute.viewonly || CAN_user_superlibrarian ) ) %]
1579
                                                                    <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
1599
                                                                    <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
1580
                                                                [% END %]
1600
                                                                [% END %]
1581
                                                                [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
1601
                                                                [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
(-)a/members/memberentry.pl (-1 / +1 lines)
Lines 959-964 sub patron_attributes_form { Link Here
959
            category      => $attr_type->authorised_value_category(),
959
            category      => $attr_type->authorised_value_category(),
960
            category_code => $attr_type->category_code(),
960
            category_code => $attr_type->category_code(),
961
            mandatory     => $attr_type->mandatory(),
961
            mandatory     => $attr_type->mandatory(),
962
            viewonly      => $attr_type->staff_viewonly(),
962
            is_date       => $attr_type->is_date(),
963
            is_date       => $attr_type->is_date(),
963
        };
964
        };
964
        if ( exists $attr_hash{ $attr_type->code() } ) {
965
        if ( exists $attr_hash{ $attr_type->code() } ) {
965
- 

Return to bug 41101