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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-2 / +2 lines)
Lines 272-283 Link Here
272
            <option value="0" selected="selected">Save as new template</option>
272
            <option value="0" selected="selected">Save as new template</option>
273
            <optgroup label="Update existing template">
273
            <optgroup label="Update existing template">
274
                [% FOREACH t IN item_templates.owned %]
274
                [% FOREACH t IN item_templates.owned %]
275
                    <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
275
                    <option data-editor="1" data-shared="[% t.is_shared %]" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
276
                [% END %]
276
                [% END %]
277
                [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
277
                [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
278
                    <optgroup label="Update shared template">
278
                    <optgroup label="Update shared template">
279
                        [% FOREACH t IN item_templates.shared %]
279
                        [% FOREACH t IN item_templates.shared %]
280
                            <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
280
                            <option data-editor="1" data-shared="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
281
                        [% END %]
281
                        [% END %]
282
                    </optgroup>
282
                    </optgroup>
283
                [% END %]
283
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js (-2 / +4 lines)
Lines 93-102 $(document).ready(function(){ Link Here
93
    });
93
    });
94
    $("#template_id").change(); // Trigger to enable delete button if patron's template is in use
94
    $("#template_id").change(); // Trigger to enable delete button if patron's template is in use
95
    $("#replace_template_id").on("change", function() {
95
    $("#replace_template_id").on("change", function() {
96
        if ( $(this).find(":selected").val() > 0 ) {
96
        let selected = $(this).find(":selected");
97
        if ( selected.val() > 0 ) {
97
            $("#template_name_block").hide();
98
            $("#template_name_block").hide();
99
            $("#template_is_shared").prop("checked", selected.data("shared"));
98
        } else {
100
        } else {
99
            $("#template_name_block").show();
101
            $("#template_name_block").show();
102
            $("#template_is_shared").prop("checked", false);
100
        }
103
        }
101
    });
104
    });
102
105
103
- 

Return to bug 24606