@@ -, +, @@
dropdown list
---
.../intranet-tmpl/prog/en/modules/acqui/supplier.tt | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt
@@ -373,7 +373,7 @@
[% IF i.type %]
- - Type: [% i.type | html %]
+ - Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]
[% END %]
[% IF i.uri %]
- URI: [% i.uri | html %]
@@ -588,6 +588,9 @@
});
refresh_interfaces();
}
+ let av_select = {
+ VENDOR_INTERFACE_TYPE: $("[% PROCESS 'av-build-dropbox.inc', category="VENDOR_INTERFACE_TYPE" empty=1 | replace('\n', '') | replace('"', '\"') %]"),
+ };
function refresh_interfaces(){
let nodes = $("");
interfaces.forEach((interface, i) => {
@@ -597,7 +600,7 @@
let ol = $('
');
let attributes = [
{ label: _("Name"), name: 'name', node: 'input' },
- { label: _("Type"), name: 'type', node: 'input' },
+ { label: _("Type"), name: 'type', node: 'av_select', av_cat: 'VENDOR_INTERFACE_TYPE' },
{ label: _("URI"), name: 'uri', node: 'input' },
{ label: _("Login"), name: 'login', node: 'input' },
{ label: _("Password"), name: 'password', node: 'input' },
@@ -611,6 +614,11 @@
li.append(``);
} else if ( attribute.node == 'textarea' ) {
li.append(``);
+ } else if ( attribute.node == 'av_select' ) {
+ let select = av_select[attribute.av_cat].clone();
+ select.attr('name', `interface_${attribute.name}_${i}`);
+ select.find(`option[value='${interface[attribute.name]}']`).prop("selected", true);
+ li.append(select);
}
ol.append(li);
});
--