Bugzilla – Attachment 187294 Details for
Bug 38489
EDI should be updated to use the new FTP/SFTP Servers management page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38489: (follow-up) Update EDI accounts list display
Bug-38489-follow-up-Update-EDI-accounts-list-displ.patch (text/plain), 6.63 KB, created by
Kyle M Hall (khall)
on 2025-10-02 13:52:51 UTC
(
hide
)
Description:
Bug 38489: (follow-up) Update EDI accounts list display
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-10-02 13:52:51 UTC
Size:
6.63 KB
patch
obsolete
>From 0f8284848ac3acf25d44fc355297ed87dd5757b6 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 1 Oct 2025 06:37:58 +0100 >Subject: [PATCH] Bug 38489: (follow-up) Update EDI accounts list display > >This patch updates the EDI accounts management page to display >the new file transport system instead of the old inline transport >configuration fields. > >Changes: >- Replaced multiple transport-related columns (Transport, Remote host, > Username, Password, Upload/Download ports and directories) with a > single "File transport" column >- The file transport column displays the transport name with its > connection test status in brackets >- Status indicators match the file_transports page: > * "Tests passing" (green with checkmark icon) for successful tests > * "Errors detected" (red with x icon) for failed tests > * "Never used" (italic) for untested transports >- Updated the Perl controller to decode the JSON status field from > the file_transports table and pass it to the template >- Uses get_inflated_columns to convert DBIx::Class results to plain > hashrefs for template consumption > >The display now correctly reflects the architectural change where >transport configuration is managed separately in the file_transports >table rather than duplicated in each EDI account. > >Note: At a future date we should replace the raw DBIx::Class methods >with Koha::Object based classes. I propose Koha::EDI::Account(s). > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/edi_accounts.pl | 21 ++++++++--- > .../prog/en/modules/admin/edi_accounts.tt | 35 ++++++++++--------- > 2 files changed, 36 insertions(+), 20 deletions(-) > >diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl >index 4aa11517614..ffbf6e9b04e 100755 >--- a/admin/edi_accounts.pl >+++ b/admin/edi_accounts.pl >@@ -20,6 +20,7 @@ > use Modern::Perl; > > use CGI; >+use JSON qw( decode_json ); > > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); >@@ -111,12 +112,24 @@ if ( $op eq 'acct_form' ) { > # we do a default display after deletes and saves > # as well as when that's all you want > $template->param( display => 1 ); >- my @ediaccounts = $schema->resultset('VendorEdiAccount')->search( >+ my $ediaccounts = $schema->resultset('VendorEdiAccount')->search( > {}, >- { >- join => 'vendor', >- } >+ { prefetch => [ 'vendor', 'file_transport' ] } > ); >+ >+ # Decode file_transport status for each account >+ my @ediaccounts; >+ while ( my $ediaccount = $ediaccounts->next ) { >+ my $unblessed = { $ediaccount->get_inflated_columns }; >+ $unblessed->{vendor} = { $ediaccount->vendor->get_inflated_columns }; >+ if ( $ediaccount->file_transport ) { >+ $unblessed->{file_transport} = { $ediaccount->file_transport->get_inflated_columns }; >+ $unblessed->{file_transport}->{status} = >+ $ediaccount->file_transport->status ? decode_json( $ediaccount->file_transport->status ) : undef; >+ } >+ push @ediaccounts, $unblessed; >+ } >+ > $template->param( ediaccounts => \@ediaccounts ); > } > >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 25129642753..4879e2bc4c3 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 >@@ -269,14 +269,7 @@ > <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>File transport</th> > <th>Qualifier</th> > <th>SAN</th> > <th>Standard</th> >@@ -294,14 +287,24 @@ > <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> >+ [% IF account.file_transport %] >+ [% account.file_transport.name | html %] >+ [% IF account.file_transport.status %] >+ [% IF account.file_transport.status.status == "ok" %] >+ (<i class="text-success fa-solid fa-circle-check"></i> <span class="text-success">Tests passing</span>) >+ [% ELSIF account.file_transport.status.status == "errors" %] >+ (<i class="text-danger fa-solid fa-circle-xmark"></i> <span class="text-danger">Errors detected</span>) >+ [% ELSE %] >+ (<em>Never used</em>) >+ [% END %] >+ [% ELSE %] >+ (<em>Never used</em>) >+ [% END %] >+ [% ELSE %] >+ <span class="text-danger">No transport configured</span> >+ [% END %] >+ </td> > <td> > [% FOREACH qualifier IN code_qualifiers %] > [% IF qualifier.code == account.id_code_qualifier %] >-- >2.39.5 (Apple Git-154)
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 38489
:
175204
|
175205
|
175206
|
175207
|
176118
|
176119
|
176161
|
185324
|
186819
|
186820
|
186845
|
186846
|
186847
|
186848
|
186849
|
186850
|
186851
|
186852
|
186854
|
187080
|
187081
|
187082
|
187083
|
187084
|
187085
|
187086
|
187087
|
187088
|
187089
|
187108
|
187147
|
187148
|
187149
|
187150
|
187151
|
187152
|
187153
|
187154
|
187155
|
187156
|
187157
|
187158
|
187159
|
187270
|
187271
|
187272
|
187273
|
187274
|
187275
|
187276
|
187277
|
187278
|
187279
|
187280
|
187281
|
187283
|
187284
|
187285
|
187286
|
187287
|
187288
|
187289
|
187290
|
187291
|
187292
|
187293
| 187294