Explorar o código

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 %!s(int64=14) %!d(string=hai) anos
pai
achega
c0d3970b95
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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);