mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°895 Portal: Filter linkedsets on remote object scopes
This commit is contained in:
@@ -19,14 +19,14 @@
|
||||
|
||||
namespace Combodo\iTop\Renderer\Bootstrap\FieldRenderer;
|
||||
|
||||
use Exception;
|
||||
use ApplicationContext;
|
||||
use IssueLog;
|
||||
use Dict;
|
||||
use MetaModel;
|
||||
use AttributeFriendlyName;
|
||||
use Combodo\iTop\Renderer\FieldRenderer;
|
||||
use Combodo\iTop\Renderer\RenderingOutput;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use MetaModel;
|
||||
|
||||
/**
|
||||
* Description of BsLinkedSetFieldRenderer
|
||||
@@ -540,6 +540,7 @@ JS
|
||||
*/
|
||||
protected function PrepareItems(&$aItems, &$aItemIds)
|
||||
{
|
||||
/** @var \ormLinkSet $oValueSet */
|
||||
$oValueSet = $this->oField->GetCurrentValue();
|
||||
$oValueSet->OptimizeColumnLoad(array($this->oField->GetTargetClass() => $this->oField->GetAttributesToDisplay(true)));
|
||||
while ($oItem = $oValueSet->Fetch())
|
||||
@@ -564,6 +565,12 @@ JS
|
||||
$oRemoteItem = $oItem;
|
||||
}
|
||||
|
||||
// Skip item if not supposed to be displayed
|
||||
if ($this->oField->IsLimitedAccessItem($oRemoteItem->GetKey()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$aItemProperties = array(
|
||||
'id' => ($this->oField->IsIndirect() && $oItem->IsNew()) ? -1*$oRemoteItem->GetKey() : $oItem->GetKey(),
|
||||
'target_id' => $oRemoteItem->GetKey(),
|
||||
@@ -615,6 +622,7 @@ JS
|
||||
$aItems[] = $aItemProperties;
|
||||
$aItemIds[$aItemProperties['id']] = array();
|
||||
}
|
||||
$oValueSet->rewind();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user