Merge pull request #6012 from atm-florian/dev_NEW_copyeventfiles
NEW : option to copy attachment files of emails into the event document area
This commit is contained in:
commit
78c3a1a3a1
@ -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');
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user