From c017f7a17c884c8dae0441c6cd8242cf5d7fc895 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 56c01e175d3..70353367f6f 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 '{sftp_server}'", { sftp_server = sftp_server.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 sftp_auth_mode = $("#sftp_auth_mode").val(); + + if(sftp_auth_mode == "password") { + $("#sftp_password").removeAttr("disabled"); + $("#sftp_key_file").attr("disabled", "disabled"); + } else if(sftp_auth_mode == "key_file") { + $("#sftp_password").attr("disabled", "disabled"); + $("#sftp_key_file").removeAttr("disabled"); + } else { + $("#sftp_password").attr("disabled", "disabled"); + $("#sftp_key_file").attr("disabled", "disabled"); + } + } + + function modalChange() { + $('#modal_message').hide(); + if ( $('#sftp_transport').val() == 'sftp' ) $('#modal_message').show(); + + $('#modal_host').text( $('#sftp_host').val() ); + $('#modal_port').text( $('#sftp_port').val() ); + $('#modal_transport').text( $('#sftp_transport option:selected').text() ); + $('#modal_user_name').text( $('#sftp_user_name').val() ); + $('#modal_auth_mode').text( $('#sftp_auth_mode option:selected').text() ); + } + +[% END %] +[% INCLUDE 'intranet-bottom.inc' %] -- 2.34.1