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 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.
|
// 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';
|
$filename = dol_sanitizeFileName($objectobj->ref).'.pdf';
|
||||||
$filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref);
|
$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;
|
$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);
|
$mime = dol_mimetype($file);
|
||||||
|
|
||||||
if (dol_is_file($file))
|
if (dol_is_file($file))
|
||||||
|
|||||||
@ -359,6 +359,7 @@ class FormMail extends Form
|
|||||||
if ($this->param['models'] != 'none')
|
if ($this->param['models'] != 'none')
|
||||||
{
|
{
|
||||||
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($this->error, $this->errors, 'errors');
|
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);
|
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";
|
$topicmail="SendBillRef";
|
||||||
$modelmail="supplier_invoice_send";
|
$modelmail="invoice_supplier_send";
|
||||||
$objecttmp=new FactureFournisseur($db);
|
$objecttmp=new FactureFournisseur($db);
|
||||||
$trackid='sinv'.$object->id;
|
$trackid='sinv'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user