Skip to content

Commit

Permalink
Update card_presend.tpl.php
Browse files Browse the repository at this point in the history
  • Loading branch information
leninrivas authored Oct 23, 2023
1 parent e64b237 commit eace59e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions htdocs/core/tpl/card_presend.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
//Get also the main_lastdoc field of $object. If not found, try to guess with following code
if (!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) {
//$fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc;
if(!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES)) {
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
if (!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES)) {
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
} else {
$fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc;
$fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc;
}
} else {
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
Expand All @@ -67,12 +67,12 @@
}

//$file = isset($fileparams['fullname'])?$fileparams['fullname']:null;
if(!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES) && count($fileparams) > 0) {
for ($i = 0; $i < count($fileparams); $i++) {
$files[$i] = isset($fileparams[$i]['fullname'])?$fileparams[$i]['fullname']:null;
}
if (!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES) && count($fileparams) > 0) {
for ($i = 0; $i < count($fileparams); $i++) {
$files[$i] = isset($fileparams[$i]['fullname'])?$fileparams[$i]['fullname']:null;
}
} else {
$file = isset($fileparams['fullname'])?$fileparams['fullname']:null;
$file = isset($fileparams['fullname'])?$fileparams['fullname']:null;
}
}

Expand Down Expand Up @@ -400,12 +400,12 @@
$formmail->param['id'] = $object->id;
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id;
//$formmail->param['fileinit'] = array($file);
if(!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES) && count($files) > 0) {
for ($i = 0; $i < count($files); $i++) {
$formmail->param['fileinit'] = $files;
}
if (!empty($conf->global->MAIN_EMAIL_ATTACH_ALL_FILES) && count($files) > 0) {
for ($i = 0; $i < count($files); $i++) {
$formmail->param['fileinit'] = $files;
}
} else {
$formmail->param['fileinit'] = array($file);
$formmail->param['fileinit'] = array($file);
}

// Show form
Expand Down

0 comments on commit eace59e

Please sign in to comment.