mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Rework of the edition of 1-N and N-N links: managed as a delta from the GUI down to the the lowest APIs.
- Fixes the management of obsolete linked data. - N.744 Fixes concurrent modifications (example: a user modifies a team, another user modifies a person related to that same team). Still NOT fixed with the customer portal. - N.849 Fixes links edition in the case some data are not allowed to the current user (organization silos) -TO BE TESTED - #1145 Fixes the creation of duplicate links in one step (Server to NW Device) - #1147 Fixes the update of duplicate links SVN:trunk[4766]
This commit is contained in:
@@ -631,6 +631,10 @@ abstract class MetaModel
|
||||
private static $m_aIgnoredAttributes = array(); //array of ("classname" => array of ("attcode"))
|
||||
private static $m_aEnumToMeta = array(); // array of ("classname" => array of ("attcode" => array of ("metaattcode" => oMetaAttDef))
|
||||
|
||||
/**
|
||||
* @param $sClass
|
||||
* @return AttributeDefinition[]
|
||||
*/
|
||||
final static public function ListAttributeDefs($sClass)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
@@ -4855,10 +4859,23 @@ abstract class MetaModel
|
||||
return $oObj->GetHyperLink();
|
||||
}
|
||||
|
||||
public static function NewObject($sClass)
|
||||
/**
|
||||
* @param string $sClass
|
||||
* @param array|null $aValues array of attcode => value
|
||||
* @return DBObject
|
||||
*/
|
||||
public static function NewObject($sClass, $aValues = null)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
return new $sClass();
|
||||
$oRet = new $sClass();
|
||||
if (is_array($aValues))
|
||||
{
|
||||
foreach ($aValues as $sAttCode => $value)
|
||||
{
|
||||
$oRet->Set($sAttCode, $value);
|
||||
}
|
||||
}
|
||||
return $oRet;
|
||||
}
|
||||
|
||||
public static function GetNextKey($sClass)
|
||||
|
||||
Reference in New Issue
Block a user