소스 검색

Patch to support a different data model where contacts are not part of an org

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1006 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 년 전
부모
커밋
c0d3970b95
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      addons/userrights/userrightsprofile.class.inc.php

+ 5 - 1
addons/userrights/userrightsprofile.class.inc.php

@@ -442,7 +442,11 @@ class UserRightsProfile extends UserRightsAddOnAPI
 		$oContact->Set('name', 'My last name');
 		$oContact->Set('first_name', 'My first name');
 		//$oContact->Set('status', 'available');
-		$oContact->Set('org_id', $iOrgId);
+		if (MetaModel::IsValidAttCode('Person', 'org_id'))
+		{
+			// Protect for a different data model where contacts are not part of an org
+			$oContact->Set('org_id', $iOrgId);
+		}
 		$oContact->Set('email', 'my.email@foo.org');
 		//$oContact->Set('phone', '');
 		//$oContact->Set('location_id', $iLocationId);