From 53d5867b9387af488d0f99172c4dae160f8c6cf0 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 3 Dec 2010 09:10:15 +0000 Subject: [PATCH] Patch to support a different data model where contacts are not part of an org SVN:trunk[1006] --- addons/userrights/userrightsprofile.class.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index 5cdad21c8..fc25b778c 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/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);