From 338bc9e0ef7c9bcf974ad645b82d696b817f4c64 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 2 Mar 2023 14:40:42 +0100 Subject: [PATCH] Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list Signed-off-by: Jonathan Field Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/modules/acqui/supplier.tt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index ec8e951bce..20fa602794 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -362,7 +362,7 @@ [% i.name | html %]
    [% IF i.type %] -
  • Type: [% i.type | html %]
  • +
  • Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]
  • [% END %] [% IF i.uri %]
  • URI: [% i.uri | html %]
  • @@ -577,6 +577,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) => { @@ -586,7 +589,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' }, @@ -600,6 +603,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); }); -- 2.39.5