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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-7 / +19 lines)
Lines 58-64 Link Here
58
58
59
            $('select[name="patron_attributes"]').change();
59
            $('select[name="patron_attributes"]').change();
60
60
61
        } );
61
            $(".clear-date").on("click",function(e){
62
                e.preventDefault();
63
                var fieldID = this.id.replace("clear-date-","");
64
                $("#" + fieldID).val("");
65
            });
66
            $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){
67
                e.preventDefault();
68
                add_attributes();
69
            });
70
            $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){
71
                e.preventDefault();
72
                del_attributes(this);
73
            });
74
        });
62
75
63
        function updateAttrValues (select_attr) {
76
        function updateAttrValues (select_attr) {
64
            var attr_code = $(select_attr).val();
77
            var attr_code = $(select_attr).val();
Lines 84-91 Link Here
84
        function add_attributes() {
97
        function add_attributes() {
85
            var li_node = $("li.attributes:last");
98
            var li_node = $("li.attributes:last");
86
            var li_clone = $(li_node).clone();
99
            var li_clone = $(li_node).clone();
87
            if ( $(li_clone).find("a.delete").length == 0 ) {
100
            if ( $(li_clone).find("a.del_attributes").length == 0 ) {
88
                $(li_clone).append('<a href="#" title="Delete" class="delete" onclick="del_attributes(this);return false;"><i class="fa fa-fw fa-trash"></i> Delete</a>');
101
                $(li_clone).append('<a href="#" title="Delete" class="del_attributes"><i class="fa fa-fw fa-trash"></i> Delete</a>');
89
            }
102
            }
90
            $(li_clone).find('select[name="patron_attributes"]').change(function() {
103
            $(li_clone).find('select[name="patron_attributes"]').change(function() {
91
                updateAttrValues(this);
104
                updateAttrValues(this);
Lines 335-341 Link Here
335
                                            [% END %]
348
                                            [% END %]
336
                                            </label>
349
                                            </label>
337
                                            [% IF field.mandatory %]
350
                                            [% IF field.mandatory %]
338
                                                <input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name %]" readonly="readonly" onclick="return false;" />
351
                                                <input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name %]" disabled="disabled" readonly="readonly" />
339
                                            [% ELSE %]
352
                                            [% ELSE %]
340
                                                <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name %]" />
353
                                                <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name %]" />
341
                                            [% END %]
354
                                            [% END %]
Lines 355-361 Link Here
355
                                            [% END %]
368
                                            [% END %]
356
                                            [% IF ( field.type == 'date' ) %]
369
                                            [% IF ( field.type == 'date' ) %]
357
                                                <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
370
                                                <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
358
                                                <a href="#" onclick="clearDate('[% field.name %]');return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
371
                                                <a href="#"  class="clear-date" id="clear-date-[% field.name %]" ><i class="fa fa-fw fa-trash"></i> Clear</a>
359
                                            [% END %]
372
                                            [% END %]
360
                                            [% IF field.mandatory %]
373
                                            [% IF field.mandatory %]
361
                                                <span class="required">Required fields cannot be cleared</span>
374
                                                <span class="required">Required fields cannot be cleared</span>
Lines 373-379 Link Here
373
                                                </label>
386
                                                </label>
374
                                                <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
387
                                                <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
375
                                                <span class="patron_attributes_value"></span>
388
                                                <span class="patron_attributes_value"></span>
376
                                                <a href="#" title="Add an attribute" onclick="add_attributes(); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
389
                                                <a href="#" class="add_attributes" title="Add an attribute"><i class="fa fa-fw fa-plus"></i> New</a>
377
                                                <span class="information_category hint" style="width:25%;float:right;"></span>
390
                                                <span class="information_category hint" style="width:25%;float:right;"></span>
378
                                            </li>
391
                                            </li>
379
                                        [% END %]
392
                                        [% END %]
380
- 

Return to bug 16938