Fix: Attached files on orders
This commit is contained in:
parent
507d96ec25
commit
5bf4a7203e
@ -482,7 +482,7 @@ if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
|
|||||||
$commande->set_draft($user);
|
$commande->set_draft($user);
|
||||||
|
|
||||||
$result = $commande->set_draft($user);
|
$result = $commande->set_draft($user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{ //regeneration pdf
|
{ //regeneration pdf
|
||||||
if ($_REQUEST['lang_id'])
|
if ($_REQUEST['lang_id'])
|
||||||
{
|
{
|
||||||
@ -674,23 +674,18 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
|
|||||||
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get list of attached files
|
// Create form object
|
||||||
$listofpaths=array();
|
include_once('../html.formmail.class.php');
|
||||||
$listofnames=array();
|
$formmail = new FormMail($db);
|
||||||
$listofmimes=array();
|
|
||||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=split(';',$_SESSION["listofpaths"]);
|
$attachedfiles=$formmail->get_attached_files();
|
||||||
if (! empty($_SESSION["listofnames"])) $listofnames=split(';',$_SESSION["listofnames"]);
|
$filepath = $attachedfiles['paths'];
|
||||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=split(';',$_SESSION["listofmimes"]);
|
$filename = $attachedfiles['names'];
|
||||||
if (! empty($_FILES['addedfile']['tmp_name']))
|
$mimetype = $attachedfiles['mimes'];
|
||||||
{
|
|
||||||
$listofpaths[] = $_FILES['addedfile']['tmp_name'];
|
|
||||||
$listofnames[] = $_FILES['addedfile']['name'];
|
|
||||||
$listofmimes[] = $_FILES['addedfile']['type'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$listofpaths,$listofmimes,$listofnames,$sendtocc,'',$deliveryreceipt);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$mailfile->error.'</div>';
|
$mesg='<div class="error">'.$mailfile->error.'</div>';
|
||||||
@ -1972,7 +1967,7 @@ else
|
|||||||
$formmail->withto=$liste;
|
$formmail->withto=$liste;
|
||||||
$formmail->withtocc=1;
|
$formmail->withtocc=1;
|
||||||
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
||||||
$formmail->withfile=1;
|
$formmail->withfile=2;
|
||||||
$formmail->withbody=1;
|
$formmail->withbody=1;
|
||||||
$formmail->withdeliveryreceipt=1;
|
$formmail->withdeliveryreceipt=1;
|
||||||
$formmail->withcancel=1;
|
$formmail->withcancel=1;
|
||||||
|
|||||||
@ -1100,7 +1100,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
|
|||||||
$filename = $attachedfiles['names'];
|
$filename = $attachedfiles['names'];
|
||||||
$mimetype = $attachedfiles['mimes'];
|
$mimetype = $attachedfiles['mimes'];
|
||||||
|
|
||||||
// Envoi de la facture
|
// Send mail
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user