Advanced Search: Links n:n

SVN:b1162[5447]
This commit is contained in:
Eric Espié
2018-03-16 11:24:58 +00:00
parent bf02e04ae5
commit bb31cedcba
2 changed files with 12 additions and 2 deletions

View File

@@ -403,6 +403,7 @@ EOF
$oFilter->AddCondition('id', $aAlreadyLinkedIds, 'NOTIN');
}
$this->SetSearchDefaultFromContext($oCurrentObj, $oFilter);
$oBlock = new DisplayBlock($oFilter, 'search', false);
$sHtml .= $oBlock->GetDisplay($oPage, "SearchFormToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",
array(
@@ -412,7 +413,8 @@ EOF
'table_inner_id' => "ResultsToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}",
'selection_mode' => true,
'json' => $sJson,
'cssCount' => '#count_'.$this->m_sAttCode.$this->m_sNameSuffix
'cssCount' => '#count_'.$this->m_sAttCode.$this->m_sNameSuffix,
'query_params' => json_encode($oFilter->GetInternalParams()),
));
$sHtml .= "<form id=\"ObjectsAddForm_{$this->m_sAttCode}{$this->m_sNameSuffix}\">\n";
$sHtml .= "<div id=\"SearchResultsToAdd_{$this->m_sAttCode}{$this->m_sNameSuffix}\" style=\"vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;\">\n";

View File

@@ -73,7 +73,15 @@ try
$sJson = json_encode($aJson);
$oWizardHelper = WizardHelper::FromJSON($sJson);
$oObj = $oWizardHelper->GetTargetObject();
$aExtraParams['query_params'] = array('this' => $oObj);
if (array_key_exists('query_params', $aExtraParams))
{
$aExtraParams['query_params'] = json_decode($aExtraParams['query_params'], true);
$aExtraParams['query_params']['this'] = $oObj;
}
else
{
$aExtraParams['query_params'] = array('this' => $oObj);
}
// // Current extkey value, so we can display event if it is not available anymore (eg. archived).