Update card_presend.tpl.php
TODO Get also the main_lastdoc field of $object
This commit is contained in:
parent
33ad0de37e
commit
7344b1946a
@ -43,8 +43,11 @@ 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
|
||||||
|
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;
|
||||||
|
} else {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
// Special case
|
// Special case
|
||||||
if ($object->element == 'invoice_supplier') {
|
if ($object->element == 'invoice_supplier') {
|
||||||
@ -52,6 +55,7 @@ if ($action == 'presend') {
|
|||||||
} else {
|
} else {
|
||||||
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user