Merge pull request #11326 from atm-greg/FIX_massaction_presend
Fix massaction presend
This commit is contained in:
commit
4f5f03b893
@ -257,9 +257,20 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
{
|
||||
// TODO Use future field $objectobj->fullpathdoc to know where is stored default file
|
||||
// TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
|
||||
$filename=dol_sanitizeFileName($objectobj->ref).'.pdf';
|
||||
$filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref);
|
||||
$filename = dol_sanitizeFileName($objectobj->ref).'.pdf';
|
||||
$subdir = '';
|
||||
// TODO Set subdir to be compatible with multi levels dir trees
|
||||
// $subdir = get_exdir($objectobj->id, 2, 0, 0, $objectobj, $objectobj->element)
|
||||
$filedir = $uploaddir . '/' . $subdir . dol_sanitizeFileName($objectobj->ref);
|
||||
$file = $filedir . '/' . $filename;
|
||||
|
||||
// For supplier invoices, we use the file provided by supplier, not the one we generate
|
||||
if ($objectobj->element == 'invoice_supplier')
|
||||
{
|
||||
$fileparams = dol_most_recent_file($uploaddir . '/' . get_exdir($objectobj->id,2,0,0,$objectobj,$objectobj->element).$objectobj->ref, preg_quote($objectobj->ref,'/').'([^\-])+');
|
||||
$file = $fileparams['fullname'];
|
||||
}
|
||||
|
||||
$mime = dol_mimetype($file);
|
||||
|
||||
if (dol_is_file($file))
|
||||
|
||||
@ -359,6 +359,7 @@ class FormMail extends Form
|
||||
if ($this->param['models'] != 'none')
|
||||
{
|
||||
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
|
||||
@ -496,7 +496,7 @@ if ($resql)
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
||||
|
||||
$topicmail="SendBillRef";
|
||||
$modelmail="supplier_invoice_send";
|
||||
$modelmail="invoice_supplier_send";
|
||||
$objecttmp=new FactureFournisseur($db);
|
||||
$trackid='sinv'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user