diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 82f249ecbe2..a40ddf5ec6e 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -164,6 +164,7 @@ class FormTicket print '
'; print ''; print ''; + print ''; foreach ($this->param as $key => $value) { print ''; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 8d8dd2a3d58..5f9589277fa 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -289,7 +289,7 @@ if (empty($reshook)) { if (!$error) { // File transfer - $object->copyFilesForTicket(); + $object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was '' } if (!$error) { @@ -738,6 +738,7 @@ if ($action == 'create' || $action == 'presend') { print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket'); + $formticket->trackid = ''; // TODO Use a unique key to avoid conflict in upload file feature $formticket->withfromsocid = $socid ? $socid : $user->socid; $formticket->withfromcontactid = $contactid ? $contactid : ''; $formticket->withtitletopic = 1; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index cede4ace10a..95682453237 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2354,9 +2354,10 @@ class Ticket extends CommonObject * Used for files linked into messages. * Files may be renamed during copy to avoid overwriting existing files. * - * @return array Array with final path/name/mime of files. + * @param string $forcetrackid Force trackid + * @return array Array with final path/name/mime of files. */ - public function copyFilesForTicket() + public function copyFilesForTicket($forcetrackid = null) { global $conf; @@ -2371,7 +2372,7 @@ class Ticket extends CommonObject $maxheightmini = 72; $formmail = new FormMail($this->db); - $formmail->trackid = 'tic'.$this->id; + $formmail->trackid = (is_null($forcetrackid) ? 'tic'.$this->id : ''); $attachedfiles = $formmail->get_attached_files(); $filepath = $attachedfiles['paths'];