Merge pull request #22082 from Radarjr2002/patch-3
Update card_presend.tpl.php
This commit is contained in:
commit
32e18735f4
@ -43,14 +43,18 @@ if ($action == 'presend') {
|
|||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
if (!in_array($object->element, array('user', 'member'))) {
|
if (!in_array($object->element, array('user', 'member'))) {
|
||||||
// TODO get also the main_lastdoc field of $object. If not found, try to guess with following code
|
//$fileparams['fullname'] can be filled from the card
|
||||||
|
//Get also the main_lastdoc field of $object. If not found, try to guess with following code
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
if (!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) {
|
||||||
// Special case
|
$fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc;
|
||||||
if ($object->element == 'invoice_supplier') {
|
|
||||||
$fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+');
|
|
||||||
} else {
|
} else {
|
||||||
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
// Special case
|
||||||
|
if ($object->element == 'invoice_supplier') {
|
||||||
|
$fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+');
|
||||||
|
} else {
|
||||||
|
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user