Lines 370-376
Link Here
|
370 |
[% END %] |
370 |
[% END %] |
371 |
[% IF ( field.type == 'select' ) %] |
371 |
[% IF ( field.type == 'select' ) %] |
372 |
[% IF field.option.size %] |
372 |
[% IF field.option.size %] |
373 |
<select name="[% field.name | html %]" > |
373 |
<select id="[%field.name | html %]" name="[% field.name | html %]" > |
374 |
[% FOREACH opt IN field.option %] |
374 |
[% FOREACH opt IN field.option %] |
375 |
<option value="[% opt.value | html %]">[% opt.lib | html %]</option> |
375 |
<option value="[% opt.value | html %]">[% opt.lib | html %]</option> |
376 |
[% END %] |
376 |
[% END %] |
Lines 393-402
Link Here
|
393 |
[% END %] |
393 |
[% END %] |
394 |
[% IF ( patron_attributes_codes ) %] |
394 |
[% IF ( patron_attributes_codes ) %] |
395 |
<li class="attributes"> |
395 |
<li class="attributes"> |
396 |
<label style="width:auto;"> |
396 |
<label for="patron_attributes" style="width:auto;"> |
397 |
<span>Patron attribute:</span> |
397 |
<span>Patron attribute:</span> |
398 |
</label> |
398 |
</label> |
399 |
<select name="patron_attributes"> |
399 |
<select id="patron_attributes" name="patron_attributes"> |
400 |
<option value=""></option> |
400 |
<option value=""></option> |
401 |
[% FOREACH pac IN patron_attributes_codes %] |
401 |
[% FOREACH pac IN patron_attributes_codes %] |
402 |
<option value="[% pac.attribute_code | html %]" data-type="[% pac.type | html %]" data-category="[% pac.category_lib | html %]">[% pac.attribute_lib | html %]</option> |
402 |
<option value="[% pac.attribute_code | html %]" data-type="[% pac.type | html %]" data-category="[% pac.category_lib | html %]">[% pac.attribute_lib | html %]</option> |
Lines 571-582
Link Here
|
571 |
} |
571 |
} |
572 |
|
572 |
|
573 |
function add_attributes() { |
573 |
function add_attributes() { |
|
|
574 |
var count = $("li.attributes").length; |
574 |
var li_node = $("li.attributes:last"); |
575 |
var li_node = $("li.attributes:last"); |
575 |
var li_clone = $(li_node).clone(); |
576 |
var li_clone = $(li_node).clone(); |
576 |
if ( $(li_clone).find("a.del_attributes").length == 0 ) { |
577 |
if ( $(li_clone).find("a.del_attributes").length == 0 ) { |
577 |
var add_attributes = $(li_clone).find("a.add_attributes") |
578 |
var add_attributes = $(li_clone).find("a.add_attributes") |
578 |
$(add_attributes).after('<a href="#" title="' + _("Delete") + '" class="del_attributes"><i class="fa fa-fw fa-trash-can"></i> ' + _("Delete") + '</a>'); |
579 |
$(add_attributes).after('<a href="#" title="' + _("Delete") + '" class="del_attributes"><i class="fa fa-fw fa-trash-can"></i> ' + _("Delete") + '</a>'); |
579 |
} |
580 |
} |
|
|
581 |
li_node.find("label").attr("for", li_node.find("label").attr("for") + "_" + count ); |
582 |
li_node.find("input, select").attr("id", li_node.find("select").attr("id") + "_" + count ); |
583 |
|
580 |
$(li_clone).find('select[name="patron_attributes"]').change(function() { |
584 |
$(li_clone).find('select[name="patron_attributes"]').change(function() { |
581 |
updateAttrValues(this); |
585 |
updateAttrValues(this); |
582 |
} ); |
586 |
} ); |
583 |
- |
|
|