FIX: when create intervention from propal (or other object), element link is mising after creation (#32035)

* fix: when create intervention from propal, element link is mising

* fix: when create intervention from propal, element link is mising

* fix: when create intervention from propal, element link is mising
This commit is contained in:
HENRY Florian 2024-11-21 17:13:22 +01:00 committed by GitHub
parent 1a752c16cf
commit 0577fe44a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -844,7 +844,7 @@ if ($action == 'create') {
$res = $soc->fetch($socid);
}
if (GETPOSTINT('origin') && GETPOSTINT('originid')) {
if (GETPOST('origin', 'alphanohtml') && GETPOSTINT('originid')) {
// Parse element/subelement (ex: project_task)
$regs = array();
$element = $subelement = GETPOST('origin', 'alphanohtml');
@ -1011,6 +1011,7 @@ if ($action == 'create') {
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
$newclassname = $classname;
if ($newclassname == 'Propal') {
$langs->load('propal');
$newclassname = 'CommercialProposal';
}
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
@ -1054,7 +1055,7 @@ if ($action == 'create') {
print $form->buttonsSaveCancel("CreateDraftIntervention");
// Show origin lines
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
if (!empty($origin) && !empty($originid) && is_object($objectsrc) && !getDolGlobalInt('FICHINTER_DISABLE_DETAILS')) {
$title = $langs->trans('Services');
print load_fiche_titre($title);