mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 06:48:50 +02:00
Patch for supporting a data model without any Organization.
SVN:trunk[1015]
This commit is contained in:
@@ -431,12 +431,18 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
||||
$oChange->Set("userinfo", "Initialization");
|
||||
$iChangeId = $oChange->DBInsert();
|
||||
|
||||
$oOrg = new Organization();
|
||||
$oOrg->Set('name', 'My Company/Department');
|
||||
$oOrg->Set('code', 'SOMECODE');
|
||||
// $oOrg->Set('status', 'implementation');
|
||||
//$oOrg->Set('parent_id', xxx);
|
||||
$iOrgId = $oOrg->DBInsertTrackedNoReload($oChange, true /* skip security */);
|
||||
// Support drastic data model changes: no organization class !
|
||||
if (MetaModel::IsValidClass('Organization'))
|
||||
{
|
||||
$oOrg = new Organization();
|
||||
$oOrg->Set('name', 'My Company/Department');
|
||||
$oOrg->Set('code', 'SOMECODE');
|
||||
$iOrgId = $oOrg->DBInsertTrackedNoReload($oChange, true /* skip security */);
|
||||
}
|
||||
else
|
||||
{
|
||||
$iOrgId = 0;
|
||||
}
|
||||
|
||||
$oContact = new Person();
|
||||
$oContact->Set('name', 'My last name');
|
||||
|
||||
Reference in New Issue
Block a user