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:
parent
0ddc99bc32
commit
9601ff2fc3
1 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue