Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r563 - registry/trunk/app/Model

Subject: COmanage Developers List

List archive

[comanage-dev] r563 - registry/trunk/app/Model


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r563 - registry/trunk/app/Model
  • Date: Tue, 16 Jul 2013 21:51:29 -0400

Author: benno
Date: 2013-07-16 21:51:29 -0400 (Tue, 16 Jul 2013)
New Revision: 563

Modified:
registry/trunk/app/Model/CoPerson.php
Log:
Honor CO ID correctly in idForIdentifier/s when org identities are pooled
(CO-656)

Modified: registry/trunk/app/Model/CoPerson.php
===================================================================
--- registry/trunk/app/Model/CoPerson.php 2013-07-16 14:28:31 UTC (rev
562)
+++ registry/trunk/app/Model/CoPerson.php 2013-07-17 01:51:29 UTC (rev
563)
@@ -213,7 +213,14 @@
$args['joins'][1]['type'] = 'LEFT';
$args['joins'][1]['conditions'][0] =
'Identifier.org_identity_id=OrgIdentity.id';
$args['conditions']['OR']['CoPerson.co_id'] = $coId;
- $args['conditions']['OR']['OrgIdentity.co_id'] = $coId;
+
+ $CmpEnrollmentConfiguration =
ClassRegistry::init('CmpEnrollmentConfiguration');
+
+ if($CmpEnrollmentConfiguration->orgIdentitiesPooled()) {
+ $args['conditions']['OR'][] = 'OrgIdentity.co_id IS NULL';
+ } else {
+ $args['conditions']['OR']['OrgIdentity.co_id'] = $coId;
+ }
}

if($identifierType) {
@@ -239,6 +246,14 @@
$args['fields'][] = 'CoOrgIdentityLink.co_person_id';
$args['contain'] = false;

+ if($coId != null) {
+ $args['joins'][0]['table'] = 'co_people';
+ $args['joins'][0]['alias'] = 'CoPerson';
+ $args['joins'][0]['type'] = 'INNER';
+ $args['joins'][0]['conditions'][0] =
'CoOrgIdentityLink.co_person_id=CoPerson.id';
+ $args['conditions']['CoPerson.co_id'] = $coId;
+ }
+
$links = $this->CoOrgIdentityLink->find('list', $args);

if(!empty($links)) {



  • [comanage-dev] r563 - registry/trunk/app/Model, svnlog, 07/16/2013

Archive powered by MHonArc 2.6.16.

Top of Page