mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
New data model: alpha version
SVN:trunk[484]
This commit is contained in:
@@ -69,7 +69,7 @@ class URP_Users extends UserRightsBaseClass
|
||||
MetaModel::Init_Params($aParams);
|
||||
//MetaModel::Init_InheritAttributes();
|
||||
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"bizPerson", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>true, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalKey("userid", array("targetclass"=>"Person", "allowed_values"=>null, "sql"=>"userid", "is_null_allowed"=>true, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("last_name", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"name")));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("first_name", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"first_name")));
|
||||
MetaModel::Init_AddAttribute(new AttributeExternalField("email", array("allowed_values"=>null, "extkey_attcode"=> 'userid', "target_attcode"=>"email")));
|
||||
@@ -715,10 +715,10 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
||||
$oChange->Set("userinfo", "Initialization");
|
||||
$iChangeId = $oChange->DBInsert();
|
||||
|
||||
$oOrg = new bizOrganization();
|
||||
$oOrg = new Organization();
|
||||
$oOrg->Set('name', 'My Company/Department');
|
||||
$oOrg->Set('code', 'SOMECODE');
|
||||
$oOrg->Set('status', 'implementation');
|
||||
// $oOrg->Set('status', 'implementation');
|
||||
//$oOrg->Set('parent_id', xxx);
|
||||
$iOrgId = $oOrg->DBInsertTrackedNoReload($oChange);
|
||||
|
||||
@@ -733,15 +733,15 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
||||
//$oLocation->Set('parent_location_id', xxx);
|
||||
//$iLocationId = $oLocation->DBInsertNoReload();
|
||||
|
||||
$oContact = new bizPerson();
|
||||
$oContact = new Person();
|
||||
$oContact->Set('name', 'My last name');
|
||||
$oContact->Set('first_name', 'My first name');
|
||||
$oContact->Set('status', 'available');
|
||||
//$oContact->Set('first_name', 'My first name');
|
||||
//$oContact->Set('status', 'available');
|
||||
$oContact->Set('org_id', $iOrgId);
|
||||
$oContact->Set('email', 'my.email@foo.org');
|
||||
$oContact->Set('phone', '');
|
||||
//$oContact->Set('phone', '');
|
||||
//$oContact->Set('location_id', $iLocationId);
|
||||
$oContact->Set('employee_number', '');
|
||||
//$oContact->Set('employee_number', '');
|
||||
$iContactId = $oContact->DBInsertTrackedNoReload($oChange);
|
||||
|
||||
$oUser = new URP_Users();
|
||||
@@ -1336,7 +1336,7 @@ class SetupProfiles
|
||||
protected static $m_aDimensions = array(
|
||||
'organization' => array(
|
||||
'description' => '',
|
||||
'type' => 'bizOrganization',
|
||||
'type' => 'Organization',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1528,6 +1528,9 @@ class SetupProfiles
|
||||
public static function DoCreateProfiles()
|
||||
{
|
||||
self::DoCreateAdminProfile();
|
||||
|
||||
// temporary
|
||||
return;
|
||||
|
||||
foreach(self::$m_aProfiles as $sName => $aProfileData)
|
||||
{
|
||||
@@ -1566,7 +1569,7 @@ class SetupProfiles
|
||||
//
|
||||
self::$m_aModules = array(
|
||||
'General' => array(
|
||||
'bizOrganization',
|
||||
'Organization',
|
||||
),
|
||||
'Documentation' => array(
|
||||
'bizDocument',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -582,7 +582,8 @@ class AttributeString extends AttributeDBField
|
||||
}
|
||||
else
|
||||
{
|
||||
return preg_match(preg_escape($sRegExp), $value);
|
||||
$sRegExp = str_replace('/', '\\/', $sRegExp);
|
||||
return preg_match("/$sRegExp/", $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -860,6 +861,27 @@ class AttributeTemplateText extends AttributeText
|
||||
public function GetTypeDesc() {return "Multiline template string";}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specialization of a text: wiki formatting
|
||||
*
|
||||
* @package iTopORM
|
||||
*/
|
||||
class AttributeWikiText extends AttributeText
|
||||
{
|
||||
public function GetTypeDesc() {return "Multiline string with special formatting such as links to objects";}
|
||||
|
||||
public function GetAsHTML($value)
|
||||
{
|
||||
// [SELECT xxxx.... [label]] => hyperlink to a result list
|
||||
// {SELECT xxxx.... [label]} => result list displayed inline
|
||||
// [myclass/nnn [label]] => hyperlink to an object
|
||||
// {myclass/nnn/attcode} => attribute displayed inline
|
||||
// etc.
|
||||
return parent::GetAsHTML($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a enum column to an attribute
|
||||
*
|
||||
|
||||
@@ -961,7 +961,7 @@ try
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_object($oObj))
|
||||
if (isset($oObj) && is_object($oObj))
|
||||
{
|
||||
$sClass = get_class($oObj);
|
||||
$sClassLabel = MetaModel::GetName($sClass);
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<Set>
|
||||
<TriggerOnObjectCreate id="2">
|
||||
<description>Incident Creation</description>
|
||||
<target_class>bizIncidentTicket</target_class>
|
||||
<target_class>Incident</target_class>
|
||||
</TriggerOnObjectCreate>
|
||||
<TriggerOnStateEnter id="5">
|
||||
<description>Incident ticket assigned to agent</description>
|
||||
<target_class>bizIncidentTicket</target_class>
|
||||
<target_class>Incident</target_class>
|
||||
<state>Assigned</state>
|
||||
</TriggerOnStateEnter>
|
||||
<TriggerOnStateEnter id="6">
|
||||
<description>Incident ticket resolved</description>
|
||||
<target_class>bizIncidentTicket</target_class>
|
||||
<target_class>Incident</target_class>
|
||||
<state>Resolved</state>
|
||||
</TriggerOnStateEnter>
|
||||
</Set>
|
||||
</Set>
|
||||
|
||||
@@ -632,6 +632,7 @@ function DisplayStep4(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAdminPwd
|
||||
else
|
||||
{
|
||||
// Creation failed
|
||||
$oP->error("Failed to create admin account or setup user rights");
|
||||
$oP->add("<button type=\"button\" onClick=\"window.history.back();\"><< Back</button>\n");
|
||||
}
|
||||
// End of visible form
|
||||
|
||||
Reference in New Issue
Block a user