N°2044: Enable Search form prefill when adding objects to 1:n

This commit is contained in:
Stephen Abello
2019-06-11 16:59:27 +02:00
parent 9a5a5f858f
commit da5d8b20fa
2 changed files with 18 additions and 3 deletions

View File

@@ -409,8 +409,16 @@ try
$oWizardHelper = WizardHelper::FromJSON($sJson);
$oObj = $oWizardHelper->GetTargetObject();
}
$oAppContext = new ApplicationContext();
$aPrefillFormParam = array( 'user' => $_SESSION["auth_user"],
'context' => $oAppContext->GetAsHash(),
'att_code' => $sAttCode,
'origin' => 'console',
'source_obj' => $oObj,
);
$aPrefillFormParam['dest_class'] = ($oObj === null ? '' : $oObj->Get($sAttCode)->GetClass());
$oWidget = new UILinksWidgetDirect($sClass, $sAttCode, $iInputId);
$oWidget->SearchObjectsToAdd($oPage, $sRealClass, $aAlreadyLinked, $oObj);
$oWidget->SearchObjectsToAdd($oPage, $sRealClass, $aAlreadyLinked, $oObj, $aPrefillFormParam);
break;
// ui.linksdirectwidget