UX for upload files in create ticket (#38202)

Improves user experience and prevents human error when creating tickets; files do not load.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Lenin Rivas 2026-05-13 07:28:26 -05:00 committed by GitHub
parent 0ddc99bc32
commit 9601ff2fc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Irvine FLEITH <irvine.fleith@atm-consulting.fr>
* Copyright (C) 2026 Jon Bendtsen <jon.bendtsen.github@jonb.dk>
* Copyright (C) 2026 Lenin Rivas <lenin.rivas777@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -635,6 +636,18 @@ class FormTicket
}
$out .= "</td></tr>\n";
// Improves user experience and prevents human error when creating tickets; files do not load.
$out .= '<script nonce="'.getNonce().'" type="text/javascript">
jQuery(document).ready(function () {
jQuery("#addedfile").on("change", function() {
// Dispara el clic automáticamente al seleccionar archivo
jQuery("#addfile").click();
});
// Oculta el botón redundante si JS está activo
jQuery("#addfile").hide();
});
</script>';
print $out;
}