diff --git a/application/ui.linkswidget.class.inc.php b/application/ui.linkswidget.class.inc.php index 7ba5745c8..059d027ec 100644 --- a/application/ui.linkswidget.class.inc.php +++ b/application/ui.linkswidget.class.inc.php @@ -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 .= "
m_sAttCode}{$this->m_sNameSuffix}\">\n"; $sHtml .= "
m_sAttCode}{$this->m_sNameSuffix}\" style=\"vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;\">\n"; diff --git a/pages/ajax.searchform.php b/pages/ajax.searchform.php index 113f21f66..71faad1fa 100644 --- a/pages/ajax.searchform.php +++ b/pages/ajax.searchform.php @@ -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).