Skip to content

Commit

Permalink
Merge branch 'develop' into patch-12
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Oct 3, 2024
2 parents 4e550e4 + 7f946dc commit 5acea7c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions htdocs/ticket/class/ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ public function createTicketMessage($user, $notrigger = 0, $filename_list = arra
// If there is some files, we must now link them to the event, so we can show them per event.
foreach ($attachedfiles['paths'] as $key => $filespath) {
// Disabled the move into another directory, Files for a ticket should be stored into ticket directory. It generates too much troubles.
//$destdir = $conf->agenda->dir_output.'/'.$actionid;
$destdir = $conf->ticket->dir_output.'/'.$this->ref;
//$destfile = $destdir.'/'.$attachedfiles['names'][$key];
//if (dol_mkdir($destdir) >= 0) {
//require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
Expand All @@ -1909,7 +1909,7 @@ public function createTicketMessage($user, $notrigger = 0, $filename_list = arra
$destdir = preg_replace('/[\\/]$/', '', $destdir);
$destdir = preg_replace('/^[\\/]/', '', $destdir);

$ecmfile->fetch(0, '', $destdir.'/'.$attachedfiles['names'][$key]);
$result = $ecmfile->fetch(0, '', $destdir.'/'.$attachedfiles['names'][$key]);

// TODO We must add a column into ecm_files table agenda_id to store the ID of event.
// $ecmfile->agenda_id = $actionid;
Expand All @@ -1918,9 +1918,11 @@ public function createTicketMessage($user, $notrigger = 0, $filename_list = arra
//require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
//$ecmfile->share = getRandomPassword(true);

$result = $ecmfile->update($user);
if ($result < 0) {
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
if ($result > 0) {
$result = $ecmfile->update($user);
if ($result < 0) {
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
}
}
//}
Expand Down

0 comments on commit 5acea7c

Please sign in to comment.