|
Lines 2-7
Link Here
|
| 2 |
[% USE To %] |
2 |
[% USE To %] |
| 3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
| 4 |
[% USE KohaDates %] |
4 |
[% USE KohaDates %] |
|
|
5 |
[% USE AuthorisedValues %] |
| 5 |
[% BLOCK edit_contact %] |
6 |
[% BLOCK edit_contact %] |
| 6 |
<ol id="contact-form"> |
7 |
<ol id="contact-form"> |
| 7 |
<input type="hidden" name="contact_id" value="[% contact.id | html %]" /> |
8 |
<input type="hidden" name="contact_id" value="[% contact.id | html %]" /> |
|
Lines 369-375
Link Here
|
| 369 |
<legend>[% i.name | html %]</legend> |
370 |
<legend>[% i.name | html %]</legend> |
| 370 |
<ul> |
371 |
<ul> |
| 371 |
[% IF i.type %] |
372 |
[% IF i.type %] |
| 372 |
<li>Type: [% i.type | html %]</li> |
373 |
<li>Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]</li> |
| 373 |
[% END %] |
374 |
[% END %] |
| 374 |
[% IF i.uri %] |
375 |
[% IF i.uri %] |
| 375 |
<li>URI: [% i.uri | html %]</li> |
376 |
<li>URI: [% i.uri | html %]</li> |
|
Lines 569-574
Link Here
|
| 569 |
}); |
570 |
}); |
| 570 |
refresh_interfaces(); |
571 |
refresh_interfaces(); |
| 571 |
} |
572 |
} |
|
|
573 |
let av_select = { |
| 574 |
VENDOR_INTERFACE_TYPE: $("[% PROCESS 'av-build-dropbox.inc', category="VENDOR_INTERFACE_TYPE" empty=1 | replace('\n', '') | replace('"', '\"') %]"), |
| 575 |
}; |
| 572 |
function refresh_interfaces(){ |
576 |
function refresh_interfaces(){ |
| 573 |
let nodes = $("<div id='interfaces'></div>"); |
577 |
let nodes = $("<div id='interfaces'></div>"); |
| 574 |
interfaces.forEach((interface, i) => { |
578 |
interfaces.forEach((interface, i) => { |
|
Lines 578-584
Link Here
|
| 578 |
let ol = $('<ol class="interface-form"></ol>'); |
582 |
let ol = $('<ol class="interface-form"></ol>'); |
| 579 |
let attributes = [ |
583 |
let attributes = [ |
| 580 |
{ label: _("Name"), name: 'name', node: 'input' }, |
584 |
{ label: _("Name"), name: 'name', node: 'input' }, |
| 581 |
{ label: _("Type"), name: 'type', node: 'input' }, |
585 |
{ label: _("Type"), name: 'type', node: 'av_select', av_cat: 'VENDOR_INTERFACE_TYPE' }, |
| 582 |
{ label: _("URI"), name: 'uri', node: 'input' }, |
586 |
{ label: _("URI"), name: 'uri', node: 'input' }, |
| 583 |
{ label: _("Login"), name: 'login', node: 'input' }, |
587 |
{ label: _("Login"), name: 'login', node: 'input' }, |
| 584 |
{ label: _("Password"), name: 'password', node: 'input' }, |
588 |
{ label: _("Password"), name: 'password', node: 'input' }, |
|
Lines 592-597
Link Here
|
| 592 |
li.append(`<input type="text" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`); |
596 |
li.append(`<input type="text" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`); |
| 593 |
} else if ( attribute.node == 'textarea' ) { |
597 |
} else if ( attribute.node == 'textarea' ) { |
| 594 |
li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`); |
598 |
li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`); |
|
|
599 |
} else if ( attribute.node == 'av_select' ) { |
| 600 |
let select = av_select[attribute.av_cat].clone(); |
| 601 |
select.attr('name', `interface_${attribute.name}_${i}`); |
| 602 |
select.find(`option[value='${interface[attribute.name]}']`).prop("selected", true); |
| 603 |
li.append(select); |
| 595 |
} |
604 |
} |
| 596 |
ol.append(li); |
605 |
ol.append(li); |
| 597 |
}); |
606 |
}); |
| 598 |
- |
|
|