N°729 Form prefill : Minor fix for prefillSeachForm

SVN:trunk[5665]
This commit is contained in:
Stephen Abello
2018-04-13 14:17:03 +00:00
parent e026ecf92f
commit 163f5dba8a
2 changed files with 6 additions and 10 deletions

View File

@@ -418,7 +418,7 @@ EOF
* @throws DictExceptionMissingString
* @throws Exception
*/
public function GetObjectPickerDialog($oPage, $oCurrentObj, $sJson, $aAlreadyLinkedIds = array(), $aPreFillFormParam = array())
public function GetObjectPickerDialog($oPage, $oCurrentObj, $sJson, $aAlreadyLinkedIds = array(), $aPrefillFormParam = array())
{
$sHtml = "<div class=\"wizContainer\" style=\"vertical-align:top;\">\n";
@@ -439,8 +439,9 @@ EOF
if(!empty($oCurrentObj))
{
$this->SetSearchDefaultFromContext($oCurrentObj, $oFilter);
$aPreFillFormParam['filter'] = $oFilter;
$oCurrentObj->PrefillForm('search', $aPreFillFormParam);
$aPrefillFormParam['filter'] = $oFilter;
$aPrefillFormParam['dest_class'] = $this->m_sRemoteClass;
$oCurrentObj->PrefillForm('search', $aPrefillFormParam);
}
$oBlock = new DisplayBlock($oFilter, 'search', false);
$sHtml .= $oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",

View File

@@ -303,14 +303,9 @@ try
$aPrefillFormParam = array( 'user' => $_SESSION["auth_user"],
'context' => $oAppContext->GetAsHash(),
'att_code' => $sAttCode,
'origin' => 'console'
'origin' => 'console',
'source_obj' => $oObj
);
if (!empty($sJson))
{
$oWizardHelper = WizardHelper::FromJSON($sJson);
$oSourceObj = $oWizardHelper->GetTargetObject();
$aPrefillFormParam['source_obj'] = $oSourceObj;
}
$aAlreadyLinked = utils::ReadParam('aAlreadyLinked', array());
$oWidget->GetObjectPickerDialog($oPage, $oObj, $sJson, $aAlreadyLinked, $aPrefillFormParam);
break;