Advanced Search: Fix direct links search

SVN:b1162[5603]
This commit is contained in:
Eric Espié
2018-04-04 08:16:48 +00:00
parent 54c5edc5da
commit 8b300358e9
3 changed files with 12 additions and 1 deletions

View File

@@ -396,6 +396,8 @@ class UILinksWidgetDirect
}
if ($oCurrentObj != null)
{
$this->SetSearchDefaultFromContext($oCurrentObj, $oFilter);
$aArgs = array_merge($oCurrentObj->ToArgs('this'), $oFilter->GetInternalParams());
$oFilter->SetInternalParams($aArgs);
}

View File

@@ -184,6 +184,15 @@ $(function()
oParams.real_class = '';
oParams.att_code = this.options.att_code;
oParams.iInputId = this.id;
// Gather the already linked target objects
oParams.aAlreadyLinked = new Array();
$('#'+this.id+' .listResults td input:checkbox').each(function () {
iKey = parseInt(this.value, 10); // Numbers are in base 10
oParams.aAlreadyLinked.push(iKey);
}
);
if (this.options.oWizardHelper)
{
this.options.oWizardHelper.UpdateWizard();

View File

@@ -58,7 +58,7 @@ class SearchFormTest extends ItopDataTestCase
{
return array(
array("SELECT Contact", 8, 'zlist'),
array("SELECT Contact AS C WHERE C.status = 'active'", 2, 'others'),
array("SELECT Contact AS C WHERE C.status = 'active'", 3, 'others'),
array("SELECT Person", 12, 'zlist'),
array(
"SELECT Person AS p JOIN UserRequest AS u ON u.agent_id = p.id WHERE u.status != 'closed'",