Bugzilla – Attachment 187279 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: Update EDI accounts UI to use file transport selection
0152894.patch (text/plain), 9.56 KB, created by
Kyle M Hall (khall)
on 2025-10-02 13:35:47 UTC
(
hide
)
Description:
Bug 38489: Update EDI accounts UI to use file transport selection
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-10-02 13:35:47 UTC
Size:
9.56 KB
patch
obsolete
>From 0152894b353aa7d21fa1f11c058ea14eb7cd7540 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 23 Sep 2025 17:25:55 +0100 >Subject: [PATCH] Bug 38489: Update EDI accounts UI to use file transport > selection > >This patch updates the EDI accounts administration interface to use >the new file_transports system instead of direct transport configuration. > >Changes: >- Replace transport configuration fields with transport selection dropdown >- Add file_transports data to template for selection options >- Remove password decryption since credentials are now managed by transports >- Simplify form handling to only manage EDI-specific fields >- Add helpful link to file transport administration > >Sponsored-by: ByWater Solutions >Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/edi_accounts.pl | 43 ++++++++--------- > .../prog/en/modules/admin/edi_accounts.tt | 47 ++++--------------- > 2 files changed, 28 insertions(+), 62 deletions(-) > >diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl >index 52f472270ac..4aa11517614 100755 >--- a/admin/edi_accounts.pl >+++ b/admin/edi_accounts.pl >@@ -56,6 +56,13 @@ if ( $op eq 'acct_form' ) { > ); > $template->param( vendors => \@vendors ); > >+ # Get available file transports for selection >+ my @file_transports = $schema->resultset('FileTransport')->search( >+ {}, >+ { order_by => { -asc => 'name' } } >+ ); >+ $template->param( file_transports => \@file_transports ); >+ > if ( C4::Context->config("enable_plugins") ) { > my @plugins = Koha::Plugins->new()->GetPlugins( > { >@@ -71,29 +78,20 @@ if ( $op eq 'acct_form' ) { > if ( $op eq 'cud-save' ) { > > # validate & display >- my $id = $input->param('id'); >- my $password = scalar $input->param('password'); >- $password = $crypt->encrypt_hex($password); >+ my $id = $input->param('id'); > my $fields = { >- description => scalar $input->param('description'), >- host => scalar $input->param('host'), >- username => scalar $input->param('username'), >- password => $password, >- upload_port => scalar $input->param('upload_port') || $input->param('transport') eq 'FTP' ? 21 : 22, >- download_port => scalar $input->param('download_port') || $input->param('transport') eq 'FTP' ? 21 : 22, >- vendor_id => scalar $input->param('vendor_id'), >- upload_directory => scalar $input->param('upload_directory'), >- download_directory => scalar $input->param('download_directory'), >- san => scalar $input->param('san'), >- standard => scalar $input->param('standard'), >- transport => scalar $input->param('transport'), >- quotes_enabled => $input->param('quotes_enabled') ? 1 : 0, >- invoices_enabled => $input->param('invoices_enabled') ? 1 : 0, >- orders_enabled => $input->param('orders_enabled') ? 1 : 0, >- responses_enabled => $input->param('responses_enabled') ? 1 : 0, >- auto_orders => $input->param('auto_orders') ? 1 : 0, >- id_code_qualifier => scalar $input->param('id_code_qualifier'), >- plugin => scalar $input->param('plugin'), >+ description => scalar $input->param('description'), >+ vendor_id => scalar $input->param('vendor_id'), >+ file_transport_id => scalar $input->param('file_transport_id') || undef, >+ san => scalar $input->param('san'), >+ standard => scalar $input->param('standard'), >+ quotes_enabled => $input->param('quotes_enabled') ? 1 : 0, >+ invoices_enabled => $input->param('invoices_enabled') ? 1 : 0, >+ orders_enabled => $input->param('orders_enabled') ? 1 : 0, >+ responses_enabled => $input->param('responses_enabled') ? 1 : 0, >+ auto_orders => $input->param('auto_orders') ? 1 : 0, >+ id_code_qualifier => scalar $input->param('id_code_qualifier'), >+ plugin => scalar $input->param('plugin'), > }; > > if ($id) { >@@ -163,7 +161,6 @@ sub show_account { > my $acct_id = $input->param('id'); > if ($acct_id) { > my $acct = $schema->resultset('VendorEdiAccount')->find($acct_id); >- $acct->password( $crypt->decrypt_hex( $acct->password ) ); > if ($acct) { > $template->param( account => $acct ); > } >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 6a207b8ba01..25129642753 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 >@@ -134,49 +134,18 @@ > <input type="text" name="description" id="description" size="20" value="[% account.description | html %]" /> > </li> > <li> >- [% transport_types = [ 'FTP', 'SFTP', 'FILE' ] %] >- <label for="transport">Transport: </label> >- <select name="transport" title="valid types of transport are FTP and SFTP" id="transport"> >- [% FOREACH transport_type IN transport_types %] >- [% IF transport_type == account.transport %] >- <option value="[% transport_type | html %]" selected="selected">[% transport_type | html %]</option> >+ <label for="file_transport_id">File transport: </label> >+ <select name="file_transport_id" id="file_transport_id"> >+ <option value="">Select a file transport configuration</option> >+ [% FOREACH transport IN file_transports %] >+ [% IF transport.file_transport_id == account.file_transport_id %] >+ <option value="[% transport.file_transport_id | html %]" selected="selected">[% transport.name | html %] ([% transport.transport | upper | html %] - [% transport.host | html %])</option> > [% ELSE %] >- <option value="[% transport_type | html %]">[% transport_type | html %]</option> >+ <option value="[% transport.file_transport_id | html %]">[% transport.name | html %] ([% transport.transport | upper | html %] - [% transport.host | html %])</option> > [% END %] > [% END %] > </select> >- </li> >- <li> >- <label for="host">Remote host: </label> >- <input type="text" name="host" id="host" size="20" maxlength="40" value="[% account.host | html %]" /> >- </li> >- <li> >- <label for="username">Username: </label> >- <input type="text" name="username" id="username" size="20" maxlength="40" value="[% account.username | html %]" /> >- </li> >- <li> >- <label for="password">Password: </label> >- <input type="text" name="password" id="password" size="20" maxlength="40" value="[% account.password | html %]" /> >- </li> >- <li> >- <label for="upload_port">Upload port: </label> >- <input type="text" name="upload_port" id="upload_port" size="20" maxlength="40" value="[% account.upload_port | html %]" /> >- <div class="hint">The upload port will default to 22 (for SFTP) or 21 (for FTP) if not set.</div> >- </li> >- <li> >- <label for="download_port">Download port: </label> >- <input type="text" name="download_port" id="download_port" size="20" maxlength="40" value="[% account.download_port | html %]" /> >- <div class="hint">The download port will default to 22 (for SFTP) or 21 (for FTP) if not set.</div> >- </li> >- <li> >- <label for="download_directory">Download directory: </label> >- <input type="text" name="download_directory" id="download_directory" size="20" value="[% account.download_directory | html %]" /> >- <div class="hint">The download directory specifies the directory on the ftp site from which quotes and invoices are downloaded.</div> >- </li> >- <li> >- <label for="upload_directory">Upload directory: </label> >- <input type="text" name="upload_directory" id="upload_directory" size="20" value="[% account.upload_directory | html %]" /> >- <div class="hint">The upload directory specifies the directory on the ftp site to which orders are uploaded.</div> >+ <div class="hint"> Select a file transport configuration for this EDI account. File transports can be managed in <a href="/cgi-bin/koha/admin/file_transports.pl">Administration › File transports</a>. </div> > </li> > <li> > <label for="id_code_qualifier">Qualifier:</label> >-- >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