// Set tmp user directory
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    dol_add_file_process($upload_dir_tmp, 0, 0);
    $action = 'presend';
}
/*
 * Remove file in email form
 */
if (!empty($_POST['removedfile'])) {
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    // Set tmp user directory
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    // TODO Delete only files that was uploaded from email form
    dol_remove_file_process($_POST['removedfile'], 0);
    $action = 'presend';
}
/*
 * Send mail
 */
if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST['removedfile'] && !$_POST['cancel']) {
    $langs->load('mails');
    $subject = '';
    $actionmsg = '';
    $actionmsg2 = '';
    $result = $object->fetch($id);
    $sendtosocid = 0;
    if (method_exists($object, "fetch_thirdparty") && $object->element != 'societe') {
        $result = $object->fetch_thirdparty();
        $thirdparty = $object->thirdparty;
Example #2
0
    // Set tmp user directory TODO Use a dedicated directory for temp mails files
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    $mesg = dol_add_file_process($upload_dir_tmp, 0, 0);
    $action = 'presend';
}
/*
 * Remove file in email form
*/
if (GETPOST('removedfile')) {
    require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
    // Set tmp user directory
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    // TODO Delete only files that was uploaded from email form
    $mesg = dol_remove_file_process(GETPOST('removedfile'), 0);
    $action = 'presend';
}
/*
 * Send mail
*/
if ($action == 'send' && !GETPOST('addfile') && !GETPOST('removedfile') && !GETPOST('cancel')) {
    $langs->load('mails');
    if ($object->id > 0) {
        //        $ref = dol_sanitizeFileName($object->ref);
        //        $file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
        //        if (is_readable($file))
        //        {
        if (GETPOST('sendto')) {
            // Le destinataire a ete fourni via le champ libre
            $sendto = GETPOST('sendto');
Example #3
0
 if (GETPOST('addfile')) {
     require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
     // Set tmp user directory TODO Use a dedicated directory for temp mails files
     $vardir = $conf->user->dir_output . "/" . $user->id;
     $upload_dir_tmp = $vardir . '/temp';
     dol_add_file_process($upload_dir_tmp, 0, 0);
     $action = 'presend';
 }
 // Remove file in email form
 if (!empty($_POST['removedfile'])) {
     require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
     // Set tmp user directory
     $vardir = $conf->user->dir_output . "/" . $user->id;
     $upload_dir_tmp = $vardir . '/temp';
     // TODO Delete only files that was uploaded from email form
     dol_remove_file_process(GETPOST('removedfile', 'alpha'), 0);
     $action = 'presend';
 }
 // Send mail
 if ($action == 'send' && !$_POST['addfile'] && !$_POST['removedfile'] && !$_POST['cancel']) {
     $langs->load('mails');
     $object->fetch($id);
     $result = $object->fetch_thirdparty();
     if ($result > 0) {
         if ($_POST['sendto']) {
             // Le destinataire a ete fourni via le champ libre
             $sendto = $_POST['sendto'];
             $sendtoid = 0;
         } elseif ($_POST['receiver'] != '-1') {
             // Recipient was provided from combo list
             if ($_POST['receiver'] == 'thirdparty') {
    // Set tmp user directory TODO Use a dedicated directory for temp mails files
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    dol_add_file_process($upload_dir_tmp, 0, 0);
    $action = 'presend';
}
/*
 * Remove file in email form
*/
if (GETPOST('removedfile', 'alpha')) {
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    // Set tmp user directory
    $vardir = $conf->user->dir_output . "/" . $user->id;
    $upload_dir_tmp = $vardir . '/temp';
    // TODO Delete only files that was uploaded from email form
    dol_remove_file_process(GETPOST('removedfile', 'int'), 0);
    $action = 'presend';
}
/*
 * Send mail
*/
if ($action == 'send' && !GETPOST('addfile', 'alpha') && !GETPOST('removedfile', 'alpha') && !GETPOST('cancel', 'alpha')) {
    $langs->load('mails');
    //        $ref = dol_sanitizeFileName($object->ref);
    //        $file = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
    //        if (is_readable($file))
    //        {
    if (GETPOST('sendto', 'alpha')) {
        // Le destinataire a ete fourni via le champ libre
        $sendto = GETPOST('sendto', 'alpha');
        $sendtoid = 0;