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