Bugzilla – Attachment 182488 Details for
Bug 39897
Make EDI accounts a configurable DataTable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39897: Make EDI accounts a configurable DataTable
Bug-39897-Make-EDI-accounts-a-configurable-DataTab.patch (text/plain), 13.81 KB, created by
Owen Leonard
on 2025-05-15 11:39:54 UTC
(
hide
)
Description:
Bug 39897: Make EDI accounts a configurable DataTable
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-05-15 11:39:54 UTC
Size:
13.81 KB
patch
obsolete
>From 0b8395bb1c427c87a94730d077ae9eaee91a7ec8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 14 May 2025 12:20:06 +0000 >Subject: [PATCH] Bug 39897: Make EDI accounts a configurable DataTable > >This patch adds DataTable features and table settings to the EDI >accounts administration page. > >The patch also includes some minor simplification of template logic in >the table. > >To test, apply the patch and restart_all. > >- Go to Administration -> EDI accounts. >- If necessary, add at least a few random EDI accounts. >- Test the DataTable listing the accounts you added. Confirm that all > DataTable features work correctly: Sorting, filtering, column display, > etc. >- Click the "Configure" button to jump to the table settings page in > Administration. > - Alter the default configuration by hiding columns, changing default > sort order, etc. It's probably wise to uncheck the "Save > configuration state on page change" checkbox so that you can easily > see if your configuration changes work. >- Return to Administration -> EDI accounts and confirm that the new > configuration is being applied. > >Sponsored-by: Athens County Public Libraries >--- > admin/columns_settings.yml | 50 ++++- > .../prog/en/modules/admin/edi_accounts.tt | 183 +++++++++++------- > 2 files changed, 157 insertions(+), 76 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index bb1db657a5b..0d9106af972 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -370,6 +370,54 @@ modules: > cannot_be_toggled: 1 > cannot_be_modified: 1 > >+ edi_accounts: >+ edi_accounts_table: >+ default_display_length: 20 >+ default_sort_order: 1 >+ columns: >+ - >+ columnname: id >+ - >+ columnname: vendor >+ - >+ columnname: description >+ - >+ columnname: transport >+ - >+ columnname: remote_host >+ - >+ columnname: username >+ - >+ columnname: password >+ - >+ columnname: upload_port >+ - >+ columnname: download_port >+ - >+ columnname: download_directory >+ - >+ columnname: upload_directory >+ - >+ columnname: qualifier >+ - >+ columnname: san >+ - >+ columnname: standard >+ - >+ columnname: quotes >+ - >+ columnname: orders >+ - >+ columnname: invoices >+ - >+ columnname: responses >+ - >+ columnname: auto_ordering >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > itemtypes: > table_item_type: > default_display_length: 10 >@@ -2575,4 +2623,4 @@ modules: > - > columnname: actions > cannot_be_toggled: 1 >- cannot_be_modified: 1 >\ No newline at end of file >+ cannot_be_modified: 1 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >index 351746f5211..0bcb2a49718 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Koha %] > [% USE Asset %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -289,83 +290,103 @@ > [% IF ( ediaccounts ) %] > <h1>EDI accounts</h1> > <div class="page-section"> >- <table> >- <tr> >- <th>ID</th> >- <th>Vendor</th> >- <th>Description</th> >- <th>Transport</th> >- <th>Remote host</th> >- <th>Username</th> >- <th>Password</th> >- <th>Upload port</th> >- <th>Download port</th> >- <th>Download directory</th> >- <th>Upload directory</th> >- <th>Qualifier</th> >- <th>SAN</th> >- <th>Standard</th> >- <th>[% tp('EDIFACT message QUOTE', 'Quotes') | html %]</th> >- <th>Orders</th> >- <th>Invoices</th> >- <th>Responses</th> >- <th>Auto ordering</th> >- <th class="no-export">Actions</th> >- </tr> >- [% FOREACH account IN ediaccounts %] >+ <table id="edi_accounts_table"> >+ <thead> > <tr> >- <td>[% account.id | html %]</td> >- <td><a href="/cgi-bin/koha/acquisition/vendors/[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td> >- <td>[% account.description | html %]</td> >- <td>[% account.transport | html %]</td> >- <td>[% account.host | html %]</td> >- <td>[% account.username | html %]</td> >- <td>[% IF account.password %]*****[% END %]</td> >- <td>[% account.upload_port | html %]</td> >- <td>[% account.download_port | html %]</td> >- <td>[% account.download_directory | html %]</td> >- <td>[% account.upload_directory | html %]</td> >- <td> >- [% FOREACH qualifier IN code_qualifiers %] >- [% IF qualifier.code == account.id_code_qualifier %] >- [% qualifier.description | html %] >- [% END %] >- [% END %] >- ([% account.id_code_qualifier | html %]) >- </td> >- <td>[% account.san | html %]</td> >- <td>[% IF account.standard == 'BIC' %]BiC[% ELSE %]EDItEUR[% END %]</td> >- [% IF account.quotes_enabled %] >- <td>Yes</td> >- [% ELSE %] >- <td>No</td> >- [% END %] >- [% IF account.orders_enabled %] >- <td>Yes</td> >- [% ELSE %] >- <td>No</td> >- [% END %] >- [% IF account.invoices_enabled %] >- <td>Yes</td> >- [% ELSE %] >- <td>No</td> >- [% END %] >- [% IF account.responses_enabled %] >- <td>Yes</td> >- [% ELSE %] >- <td>No</td> >- [% END %] >- [% IF account.auto_orders %] >- <td>Yes</td> >- [% ELSE %] >- <td>No</td> >- [% END %] >- <td class="actions"> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form&id=[% account.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=delete_confirm&id=[% account.id | html %]"><i class="fa fa-trash-can"></i> Delete</a> >- </td> >+ <th>ID</th> >+ <th>Vendor</th> >+ <th>Description</th> >+ <th>Transport</th> >+ <th>Remote host</th> >+ <th>Username</th> >+ <th>Password</th> >+ <th>Upload port</th> >+ <th>Download port</th> >+ <th>Download directory</th> >+ <th>Upload directory</th> >+ <th>Qualifier</th> >+ <th>SAN</th> >+ <th>Standard</th> >+ <th>[% tp('EDIFACT message QUOTE', 'Quotes') | html %]</th> >+ <th>Orders</th> >+ <th>Invoices</th> >+ <th>Responses</th> >+ <th>Auto ordering</th> >+ <th class="no-sort no-export">Actions</th> > </tr> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH account IN ediaccounts %] >+ <tr> >+ <td>[% account.id | html %]</td> >+ <td><a href="/cgi-bin/koha/acquisition/vendors/[% account.vendor_id | uri %]">[% account.vendor.name | html %]</a></td> >+ <td>[% account.description | html %]</td> >+ <td>[% account.transport | html %]</td> >+ <td>[% account.host | html %]</td> >+ <td>[% account.username | html %]</td> >+ <td>[% IF account.password %]*****[% END %]</td> >+ <td>[% account.upload_port | html %]</td> >+ <td>[% account.download_port | html %]</td> >+ <td>[% account.download_directory | html %]</td> >+ <td>[% account.upload_directory | html %]</td> >+ <td> >+ [% FOREACH qualifier IN code_qualifiers %] >+ [% IF qualifier.code == account.id_code_qualifier %] >+ [% qualifier.description | html %] >+ [% END %] >+ [% END %] >+ ([% account.id_code_qualifier | html %]) >+ </td> >+ <td>[% account.san | html %]</td> >+ <td> >+ [% IF account.standard == 'BIC' %] >+ BiC >+ [% ELSE %] >+ EDItEUR >+ [% END %] >+ </td> >+ <td> >+ [% IF account.quotes_enabled %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF account.orders_enabled %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF account.invoices_enabled %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF account.responses_enabled %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF account.auto_orders %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td class="actions"> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=acct_form&id=[% account.id | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/edi_accounts.pl?op=delete_confirm&id=[% account.id | html %]"><i class="fa fa-trash-can"></i> Delete</a> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> > </table> > </div> > <!-- /.page-section --> >@@ -377,5 +398,17 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] >+ [% INCLUDE 'datatables.inc' %] >+ <script> >+ $(document).ready(function(){ >+ var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'edi_accounts', 'edi_accounts_table', 'json' ) | $raw %]; >+ $("#edi_accounts_table").kohaTable( >+ { >+ pagingType: "full", >+ }, >+ table_settings >+ ); >+ }); >+ </script> > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.39.5
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 39897
: 182488