Browse Source

Internal: improved the API of PortalWebPage

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1491 a333f486-631f-4898-b8df-5754b55c2be0
romainq 13 years ago
parent
commit
b214c6145d
1 changed files with 9 additions and 2 deletions
  1. 9 2
      application/portalwebpage.class.inc.php

+ 9 - 2
application/portalwebpage.class.inc.php

@@ -342,7 +342,7 @@ EOF
 	 * @param $sEmptyListMessage The message to display if the list is empty	  
 	 * @return void
 	 */
-	public function DisplayObjectLinkset($oObj, $sLinkSetAttCode, $sRemoteAttCode, $aZList, $sEmptyListMessage = '')
+	public function DisplayObjectLinkset($oObj, $sLinkSetAttCode, $sRemoteAttCode, $aZList, $sEmptyListMessage = '', $oSearchRestriction = null)
 	{
 		if (empty($sEmptyListMessage))
 		{
@@ -356,7 +356,14 @@ EOF
 			$oExtKeyToRemote = MetaModel::GetAttributeDef($sClass, $sRemoteAttCode);
 			$sRemoteClass = $oExtKeyToRemote->GetTargetClass();			
 	
-			$oObjSearch = new DBObjectSearch($sRemoteClass);
+			if (is_null($oSearchRestriction))
+			{
+				$oObjSearch = new DBObjectSearch($sRemoteClass);
+			}
+			else
+			{
+				$oObjSearch = $oSearchRestriction;
+			}
 			$oObjSearch->AddCondition_ReferencedBy($oLinkSet->GetFilter(), $sRemoteAttCode);
 
 			$aExtraParams = array('menu' => false, 'zlist' => false, 'extra_fields' => implode(',', $aZList));