Bugzilla – Attachment 147638 Details for
Bug 33104
Add vendor interfaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list
Bug-33104-Display-the-VENDORINTERFACETYPE-AVs-in-t.patch (text/plain), 3.42 KB, created by
Jonathan Druart
on 2023-03-02 14:36:47 UTC
(
hide
)
Description:
Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-03-02 14:36:47 UTC
Size:
3.42 KB
patch
obsolete
>From dd756d27ee526dfa019df622bfe94ff549c05437 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Mar 2023 14:40:42 +0100 >Subject: [PATCH] Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the > dropdown list > >--- > .../intranet-tmpl/prog/en/modules/acqui/supplier.tt | 13 +++++++++++-- > 1 file changed, 11 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 23fbed84ace..dbc01ab5cf2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >@@ -2,6 +2,7 @@ > [% USE To %] > [% USE Asset %] > [% USE KohaDates %] >+[% USE AuthorisedValues %] > [% BLOCK edit_contact %] > <ol id="contact-form"> > <input type="hidden" name="contact_id" value="[% contact.id | html %]" /> >@@ -369,7 +370,7 @@ > <legend>[% i.name | html %]</legend> > <ul> > [% IF i.type %] >- <li>Type: [% i.type | html %]</li> >+ <li>Type: [% AuthorisedValues.GetByCode( 'VENDOR_INTERFACE_TYPE', i.type) | html %]</li> > [% END %] > [% IF i.uri %] > <li>URI: [% i.uri | html %]</li> >@@ -569,6 +570,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 = $("<div id='interfaces'></div>"); > interfaces.forEach((interface, i) => { >@@ -578,7 +582,7 @@ > let ol = $('<ol class="interface-form"></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' }, >@@ -592,6 +596,11 @@ > li.append(`<input type="text" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`); > } else if ( attribute.node == 'textarea' ) { > li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`); >+ } 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.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33104
:
147632
|
147633
|
147634
|
147635
|
147636
|
147637
|
147638
|
147639
|
148459
|
148460
|
148461
|
148462
|
148463
|
148464
|
148465
|
148466
|
148473
|
148474
|
148475
|
148476
|
148477
|
148478
|
148479
|
148480
|
149375
|
149420
|
149421
|
149422
|
149431
|
149492
|
149493
|
149494
|
149495
|
149496
|
149497
|
149498
|
149499
|
149500
|
149501
|
149502
|
149503
|
149631
|
149632