Fixed bugs linked to the bookmark creation:

- There must be a user specific menu entry in the list of menuNodes
- The asynchronous ajax page must use the authentication stored in the session
- The query must be stored in OQL instead of sibusQL

SVN:0.7[57]
This commit is contained in:
Denis Flaven
2009-04-28 11:52:38 +00:00
parent bf864bee78
commit fa9c92c8d8
4 changed files with 55 additions and 15 deletions

View File

@@ -89,14 +89,17 @@ class menuNode extends DBObject
return $this->Get('hyperlink')."?".implode("&", $aParams);
}
public function GetChildNodesSet($sType)
public function GetChildNodesSet($sType = null)
{
$oSearchFilter = new DBObjectSearch("menuNode");
$oSearchFilter->AddCondition('parent_id', $this->GetKey(), '=');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
if ($sType != null)
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
}
}
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
return $oSet;
@@ -184,10 +187,13 @@ class menuNode extends DBObject
{
$oSearchFilter = new DbObjectSearch("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
if ($sType != null)
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
}
}
$oRootSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while($oNode = $oRootSet->Fetch())
@@ -207,10 +213,13 @@ class menuNode extends DBObject
$oSearchFilter = new DBObjectSearch("menuNode");
$oSearchFilter->AddCondition('parent_id', $this->Get('parent_id'));
$oSearchFilter->AddCondition('rank', $this->Get('rank'), '>');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
if ($sType != null)
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
}
}
$oSet = new DBObjectSet($oSearchFilter, array('rank'=> true)); // Order by rank (true means ascending)
return $oSet;