Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2017-03-14 14:07:21 +01:00
commit ccbcd2b339
2 changed files with 136 additions and 121 deletions

View File

@ -865,6 +865,21 @@ class InterfaceActionsAuto extends DolibarrTriggers
$ret=$actioncomm->create($user); // User creating action $ret=$actioncomm->create($user); // User creating action
if ($ret > 0 && $conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)
{
if (is_array($object->attachedfiles) && array_key_exists('paths',$object->attachedfiles) && count($object->attachedfiles['paths'])>0) {
foreach($object->attachedfiles['paths'] as $key=>$filespath) {
$srcfile = $filespath;
$destdir = $conf->agenda->dir_output . '/' . $ret;
$destfile = $destdir . '/' . $object->attachedfiles['names'][$key];
if (dol_mkdir($destdir) >= 0) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_copy($srcfile, $destfile);
}
}
}
}
unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action. unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action.
if ($ret > 0) if ($ret > 0)