From e1baada2a10c2e1c471eb4e41bda1f779435047b Mon Sep 17 00:00:00 2001 From: Owen Leonard 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 Signed-off-by: David Nind --- 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 f482000815..adf6a90f10 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -372,6 +372,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 @@ -2580,4 +2628,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 351746f521..0bcb2a4971 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 ) %]

EDI accounts

- - - - - - - - - - - - - - - - - - - - - - - - [% FOREACH account IN ediaccounts %] +
IDVendorDescriptionTransportRemote hostUsernamePasswordUpload portDownload portDownload directoryUpload directoryQualifierSANStandard[% tp('EDIFACT message QUOTE', 'Quotes') | html %]OrdersInvoicesResponsesAuto orderingActions
+ - - - - - - - - - - - - - - - [% IF account.quotes_enabled %] - - [% ELSE %] - - [% END %] - [% IF account.orders_enabled %] - - [% ELSE %] - - [% END %] - [% IF account.invoices_enabled %] - - [% ELSE %] - - [% END %] - [% IF account.responses_enabled %] - - [% ELSE %] - - [% END %] - [% IF account.auto_orders %] - - [% ELSE %] - - [% END %] - + + + + + + + + + + + + + + + + + + + + - [% END %] + + + [% FOREACH account IN ediaccounts %] + + + + + + + + + + + + + + + + + + + + + + + [% END %] +
[% account.id | html %][% account.vendor.name | html %][% account.description | html %][% account.transport | html %][% account.host | html %][% account.username | html %][% IF account.password %]*****[% END %][% account.upload_port | html %][% account.download_port | html %][% account.download_directory | html %][% account.upload_directory | html %] - [% FOREACH qualifier IN code_qualifiers %] - [% IF qualifier.code == account.id_code_qualifier %] - [% qualifier.description | html %] - [% END %] - [% END %] - ([% account.id_code_qualifier | html %]) - [% account.san | html %][% IF account.standard == 'BIC' %]BiC[% ELSE %]EDItEUR[% END %]YesNoYesNoYesNoYesNoYesNo - Edit - Delete - IDVendorDescriptionTransportRemote hostUsernamePasswordUpload portDownload portDownload directoryUpload directoryQualifierSANStandard[% tp('EDIFACT message QUOTE', 'Quotes') | html %]OrdersInvoicesResponsesAuto orderingActions
[% account.id | html %][% account.vendor.name | html %][% account.description | html %][% account.transport | html %][% account.host | html %][% account.username | html %][% IF account.password %]*****[% END %][% account.upload_port | html %][% account.download_port | html %][% account.download_directory | html %][% account.upload_directory | html %] + [% FOREACH qualifier IN code_qualifiers %] + [% IF qualifier.code == account.id_code_qualifier %] + [% qualifier.description | html %] + [% END %] + [% END %] + ([% account.id_code_qualifier | html %]) + [% account.san | html %] + [% IF account.standard == 'BIC' %] + BiC + [% ELSE %] + EDItEUR + [% END %] + + [% IF account.quotes_enabled %] + Yes + [% ELSE %] + No + [% END %] + + [% IF account.orders_enabled %] + Yes + [% ELSE %] + No + [% END %] + + [% IF account.invoices_enabled %] + Yes + [% ELSE %] + No + [% END %] + + [% IF account.responses_enabled %] + Yes + [% ELSE %] + No + [% END %] + + [% IF account.auto_orders %] + Yes + [% ELSE %] + No + [% END %] + + Edit + Delete +
@@ -377,5 +398,17 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/admin-menu.js") | $raw %] + [% INCLUDE 'datatables.inc' %] + [% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5