Merge pull request #17628 from atm-maxime/fix/ticket3
Fix missing substitutionarray on ticket presend
This commit is contained in:
commit
77bcd7ecff
@ -1297,15 +1297,28 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
|||||||
// add a message
|
// add a message
|
||||||
if ($action == 'presend' || $action == 'presend_addmessage')
|
if ($action == 'presend' || $action == 'presend_addmessage')
|
||||||
{
|
{
|
||||||
|
if ($object->fk_soc > 0) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
|
||||||
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||||
|
$newlang = GETPOST('lang_id', 'aZ09');
|
||||||
|
}
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
}
|
||||||
|
$arrayoffamiliestoexclude = array('objectamount');
|
||||||
|
|
||||||
$action = 'add_message'; // action to use to post the message
|
$action = 'add_message'; // action to use to post the message
|
||||||
$modelmail = 'ticket_send';
|
$modelmail = 'ticket_send';
|
||||||
|
|
||||||
// Substitution array
|
// Substitution array
|
||||||
$morehtmlright = '';
|
$morehtmlright = '';
|
||||||
$help = "";
|
$help = "";
|
||||||
$substitutionarray = array();
|
$substitutionarray = getCommonSubstitutionArray($newlang, 0, $arrayoffamiliestoexclude, $object);
|
||||||
if ($object->fk_soc > 0) {
|
if ($object->fk_soc > 0) {
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
|
$substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
|
||||||
}
|
}
|
||||||
$substitutionarray['__USER_SIGNATURE__'] = $user->signature;
|
$substitutionarray['__USER_SIGNATURE__'] = $user->signature;
|
||||||
@ -1338,16 +1351,6 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
|||||||
|
|
||||||
print '<hr>';
|
print '<hr>';
|
||||||
|
|
||||||
// Define output language
|
|
||||||
$outputlangs = $langs;
|
|
||||||
$newlang = '';
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {
|
|
||||||
$newlang = $_REQUEST['lang_id'];
|
|
||||||
}
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
|
|
||||||
$newlang = $object->default_lang;
|
|
||||||
}
|
|
||||||
|
|
||||||
$formticket = new FormTicket($db);
|
$formticket = new FormTicket($db);
|
||||||
|
|
||||||
$formticket->action = $action;
|
$formticket->action = $action;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user