Bugzilla – Attachment 148477 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: Make the code reusable
Bug-33104-Make-the-code-reusable.patch (text/plain), 4.20 KB, created by
PTFS Europe Sandboxes
on 2023-03-21 14:41:46 UTC
(
hide
)
Description:
Bug 33104: Make the code reusable
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2023-03-21 14:41:46 UTC
Size:
4.20 KB
patch
obsolete
>From 1e3b02802c8c4afcc602416efd89242baf42f456 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Mar 2023 10:56:42 +0100 >Subject: [PATCH] Bug 33104: Make the code reusable > >We could then reuse it for the contacts code in this same template, on >another bug report. > >Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> >--- > .../prog/en/modules/acqui/supplier.tt | 26 ++++++++++++++----- > 1 file changed, 19 insertions(+), 7 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 c68f1cfcc3..5f50130d58 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >@@ -580,13 +580,25 @@ > n.append("<legend>" + _("Interface details") + "</legend>"); > n.append(`<input type="hidden" name="interface_counter" value="${i}" />`); > let ol = $('<ol class="interface-form"></ol>'); >- ol.append(`<li><label for="interface_name_${i}">` + _("Name: ") + `</label><input type="text" size="40" id="interface_name_${i}" name="interface_name_${i}" value="${interface.name}" /></li>`); >- ol.append(`<li><label for="interface_type_${i}">` + _("Type: ") + `</label><input type="text" size="40" id="interface_type_${i}" name="interface_type_${i}" value="${interface.type}" /></li>`); >- ol.append(`<li><label for="interface_uri_${i}">` + _("URI: ") + `</label><input type="text" size="40" id="interface_uri_${i}" name="interface_uri_${i}" value="${interface.uri}" /></li>`); >- ol.append(`<li><label for="interface_login_${i}">` + _("Login: ") + `</label><input type="text" size="40" id="interface_login_${i}" name="interface_login_${i}" value="${interface.login}" /></li>`); >- ol.append(`<li><label for="interface_password_${i}">` + _("Password: ") + `</label><input type="text" size="40" id="interface_password_${i}" name="interface_password_${i}" value="${interface.password}" /></li>`); >- ol.append(`<li><label for="interface_account_email_${i}">` + _("Account email: ") + `</label><input type="text" size="40" id="interface_account_email_${i}" name="interface_account_email_${i}" value="${interface.account_email}" /></li>`); >- ol.append(`<li><label for="interface_notes_${i}">` + _("Notes: ") + `</label><textarea cols="40" rows="3" id="interface_notes_${i}" name="interface_notes_${i}">${interface.notes}</textarea></li>`); >+ let attributes = [ >+ { label: _("Name"), name: 'name', node: 'input' }, >+ { label: _("Type"), name: 'type', node: 'input' }, >+ { label: _("URI"), name: 'uri', node: 'input' }, >+ { label: _("Login"), name: 'login', node: 'input' }, >+ { label: _("Password"), name: 'password', node: 'input' }, >+ { label: _("Account email"), name: 'account_email', node: 'input' }, >+ { label: _("Notes"), name: 'notes', node: 'textarea' } >+ ]; >+ attributes.forEach((attribute, ii) => { >+ let li = $('<li></li>'); >+ li.append(`<label for="interface_${attribute.name}_${i}">${attribute.label}</label>`); >+ if( attribute.node == 'input' ) { >+ 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>`); >+ } >+ ol.append(li); >+ }); > ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> Delete interface</li>`); > n.append(ol); > nodes.append(n); >-- >2.30.2
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