From a10f7eeda7c844d087546e7c3cf0d295babd626b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Oct 2025 11:16:30 +0200 Subject: [PATCH] Bug 38739: Fix admin/file_transports.pl --- .../prog/en/modules/admin/file_transports.tt | 1360 ++++++++--------- 1 file changed, 673 insertions(+), 687 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt index a14f419102a..226aa45b773 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt @@ -52,738 +52,724 @@ [% END #/ WRAPPER breadcrumbs %] [% END #/ WRAPPER sub-header.inc %] -
-
-
-
- [% INCLUDE 'messages.inc' %] - - [% FOREACH m IN messages %] -
- [% SWITCH m.code %] - [% CASE 'error_on_insert' %] - An error occurred when adding the server. The passed ID already exists. - [% CASE 'error_on_update' %] - An error occurred trying to open the server for editing. The passed ID is invalid. - [% CASE 'error_on_edit' %] - An error occurred trying to open the server for editing. The passed ID is invalid. - [% CASE 'success_on_update' %] - Server updated successfully. - [% CASE 'success_on_insert' %] - Server added successfully. - [% CASE %] - [% m.code | html %] - [% END %] -
- [% END %] - - - - - [% IF op == 'add_form' %] - -
+
+
+ + +

[% tx("Modify file transport '{file_transport}'", { file_transport = file_transport.name }) | html %]

+ +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+
    +
  1. + + + Required +
  2. +
+
+ +
+
    +
  1. + + + Required +
  2. +
  3. + + + Required +
  4. +
  5. + + + Required +
  6. +
  7. + + + Only applies to FTP connections +
  8. +
  9. + + +
  10. +
  11. + + + Required +
  12. +
  13. + + +
  14. +
  15. + + + Only applies to SFTP connections +
  16. +
  17. + +
    + The path on the remote server where we will download from +
  18. +
  19. + +
    + The path on the remote server where we will upload to +
  20. + +
  21. + + + Enables additional debug output in the logs +
  22. +
+
+
+ Submit + Cancel +
+
+ [% END %] + + [% IF op == 'list' %] + - -
- +

File transports

+ + [% IF servers_count < 1 %] +
+

+ There are no file transports defined.
+ To create one, use the new file transport button above. +

+
+ [% ELSE %] +
+ + + + + + + + + + + + + + + + +
NameHostPortTransportAuthentication modeUsernameDownload directoryUpload directoryStatusDebugActions
+
+ + [% END %] + [% END %] + + - - - [% MACRO jsinclude BLOCK %] - [% Asset.js("js/admin-menu.js") | $raw %] - [% Asset.js("js/transport_status.js") | $raw %] - [% INCLUDE 'datatables.inc' %] - - [% END %] - - [% INCLUDE 'intranet-bottom.inc' %] -
+ } + + function authModeChange() { + let auth_mode = $("#auth_mode").val(); + + if(auth_mode == "password") { + $("#password").removeAttr("disabled"); + $("#key_file").attr("disabled", "disabled"); + } else if(auth_mode == "key_file") { + $("#password").attr("disabled", "disabled"); + $("#key_file").removeAttr("disabled"); + } else { + $("#password").attr("disabled", "disabled"); + $("#key_file").attr("disabled", "disabled"); + } + } + + function modalChange() { + $('#modal_message').hide(); + if ( $('#transport').val() == 'sftp' ) $('#modal_message').show(); + + $('#modal_host').text( $('#host').val() ); + $('#modal_port').text( $('#port').val() ); + $('#modal_transport').text( $('#transport option:selected').text() ); + $('#modal_user_name').text( $('#user_name').val() ); + $('#modal_auth_mode').text( $('#auth_mode option:selected').text() ); + } + +[% END %] +[% INCLUDE 'intranet-bottom.inc' %] -- 2.43.0