Merge pull request #21011 from OPEN-DSI/14.0_fix_get_origin_when_add_supplier_proposal
FIX: Fix get origin from other than supplier proposal when add a new supplier proposal
This commit is contained in:
commit
3ce58c2337
@ -303,8 +303,20 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$error) {
|
||||
if ($origin && $originid) {
|
||||
$element = 'supplier_proposal';
|
||||
$subelement = 'supplier_proposal';
|
||||
$element = $subelement = $origin;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
|
||||
// For compatibility
|
||||
if ($element == 'order') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
$element = 'comm/propal';
|
||||
$subelement = 'propal';
|
||||
}
|
||||
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
@ -1063,8 +1075,20 @@ if ($action == 'create') {
|
||||
|
||||
// Load objectsrc
|
||||
if (!empty($origin) && !empty($originid)) {
|
||||
$element = 'supplier_proposal';
|
||||
$subelement = 'supplier_proposal';
|
||||
$element = $subelement = GETPOST('origin');
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs)) {
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
|
||||
// For compatibility
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
$element = 'comm/propal';
|
||||
$subelement = 'propal';
|
||||
}
|
||||
|
||||
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user