mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
User management by profile moving forward: pages to check the projection of objects/users in user defined dimensions
Introduced parameters in OQL (:myvar) Added the verb MetaModel::IsValidObject($oMyObj) SVN:trunk[88]
This commit is contained in:
@@ -104,14 +104,15 @@ class ValueSetObjects extends ValueSetDefinition
|
||||
{
|
||||
$this->m_aValues = array();
|
||||
|
||||
$oFilter = DBObjectSearch::FromSibuSQL($this->m_sFilterExpr, $aArgs);
|
||||
$oFilter = DBObjectSearch::FromSibusQL($this->m_sFilterExpr, $aArgs);
|
||||
if (!$oFilter) return false;
|
||||
|
||||
if (empty($this->m_sValueAttCode))
|
||||
{
|
||||
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
|
||||
}
|
||||
$oObjects = new DBObjectSet($oFilter, $this->m_aOrderBy);
|
||||
if (empty($this->m_sValueAttCode))
|
||||
{
|
||||
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
|
||||
}
|
||||
|
||||
$oObjects = new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
|
||||
while ($oObject = $oObjects->Fetch())
|
||||
{
|
||||
$this->m_aValues[$oObject->GetKey()] = $oObject->GetAsHTML($this->m_sValueAttCode);
|
||||
@@ -235,4 +236,35 @@ class ValueSetEnum extends ValueSetDefinition
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Data model classes
|
||||
*
|
||||
* @package iTopORM
|
||||
* @author Romain Quetiez <romainquetiez@yahoo.fr>
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.itop.com
|
||||
* @since 1.0
|
||||
* @version $itopversion$
|
||||
*/
|
||||
class ValueSetEnumClasses extends ValueSetEnum
|
||||
{
|
||||
public function __construct($sCategory = '', $sAdditionalValues = '')
|
||||
{
|
||||
// First, build it from the series of additional values
|
||||
parent::__construct($sAdditionalValues);
|
||||
|
||||
// Second: add the list of classes
|
||||
foreach (MetaModel::GetClasses($sCategory) as $sClass)
|
||||
{
|
||||
$this->m_aValues[$sClass] = MetaModel::GetName($sClass);
|
||||
}
|
||||
}
|
||||
|
||||
protected function LoadValues($aArgs)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user