ソースを参照

Patch for supporting a data model without any Organization.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1015 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年 前
コミット
4b840888aa
1 ファイル変更12 行追加6 行削除
  1. 12 6
      addons/userrights/userrightsprofile.class.inc.php

+ 12 - 6
addons/userrights/userrightsprofile.class.inc.php

@@ -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');