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

@ -1,25 +1,25 @@
<?php <?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
*/ */
/** /**
* \file htdocs/core/actions_sendmails.inc.php * \file htdocs/core/actions_sendmails.inc.php
* \brief Code for actions on sending mails from object page * \brief Code for actions on sending mails from object page
*/ */
// $mysoc must be defined // $mysoc must be defined
// $id must be defined // $id must be defined
@ -31,7 +31,7 @@
/* /*
* Add file in email form * Add file in email form
*/ */
if (GETPOST('addfile')) if (GETPOST('addfile'))
{ {
$trackid = GETPOST('trackid','aZ09'); $trackid = GETPOST('trackid','aZ09');

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)