Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r632 - in registry/trunk/app: Controller Controller/Component Model View/CoPeople View/CoPetitions

Subject: COmanage Developers List

List archive

[comanage-dev] r632 - in registry/trunk/app: Controller Controller/Component Model View/CoPeople View/CoPetitions


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r632 - in registry/trunk/app: Controller Controller/Component Model View/CoPeople View/CoPetitions
  • Date: Mon, 2 Dec 2013 00:09:36 -0500

Author: benno
Date: 2013-12-02 00:09:36 -0500 (Mon, 02 Dec 2013)
New Revision: 632

Modified:
registry/trunk/app/Controller/Component/RoleComponent.php
registry/trunk/app/Controller/OrgIdentitiesController.php
registry/trunk/app/Model/CoPetition.php
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/CoPetitions/fields.inc
Log:
Fix copying of org name to co name when no other co person attributes (CO-710)

Modified: registry/trunk/app/Controller/Component/RoleComponent.php
===================================================================
--- registry/trunk/app/Controller/Component/RoleComponent.php 2013-11-29
03:15:57 UTC (rev 631)
+++ registry/trunk/app/Controller/Component/RoleComponent.php 2013-12-02
05:09:36 UTC (rev 632)
@@ -640,7 +640,9 @@
// Make sure we have a CO Person ID

if(!$coPersonId) {
- throw new InvalidArgumentException(_txt('er.cop.unk'));
+ // throw new InvalidArgumentException(_txt('er.cop.unk'));
+ // Just return false in case we're in the middle of an authenticated
self signup
+ return false;
}

// Find the person's CO
@@ -711,7 +713,9 @@
// Make sure we have a CO Person ID

if(!$coPersonId) {
- throw new InvalidArgumentException(_txt('er.cop.unk'));
+ // throw new InvalidArgumentException(_txt('er.cop.unk'));
+ // Just return false in case we're in the middle of an authenticated
self signup
+ return false;
}

// Try to find the enrollment flow

Modified: registry/trunk/app/Controller/OrgIdentitiesController.php
===================================================================
--- registry/trunk/app/Controller/OrgIdentitiesController.php 2013-11-29
03:15:57 UTC (rev 631)
+++ registry/trunk/app/Controller/OrgIdentitiesController.php 2013-12-02
05:09:36 UTC (rev 632)
@@ -135,7 +135,7 @@
$cs .= ($i > 0 ? "," : "") . $coppl[$i]['CoPerson']['Co']['name'];

$this->Session->setFlash(_txt('er.comember',
-
array(generateCn($coppl[0]['OrgIdentity']['Name']),
+
array(generateCn($coppl[0]['OrgIdentity']['PrimaryName']),
Sanitize::html($cs))),
'', array(), 'error');
}

Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2013-11-29 03:15:57 UTC (rev
631)
+++ registry/trunk/app/Model/CoPetition.php 2013-12-02 05:09:36 UTC (rev
632)
@@ -421,7 +421,9 @@
throw new RuntimeException($e->getMessage());
}
} else {
- $coData['EnrolleeCoPerson'] =
$this->EnrolleeCoPerson->filterModelAttributes($requestData['EnrolleeCoPerson']);
+ if(!empty($requestData['EnrolleeCoPerson'])) {
+ $coData['EnrolleeCoPerson'] =
$this->EnrolleeCoPerson->filterModelAttributes($requestData['EnrolleeCoPerson']);
+ }
$coData['EnrolleeCoPerson']['co_id'] = $coId;
$coData['EnrolleeCoPerson']['status'] = $initialStatus;

@@ -464,6 +466,15 @@
}
}

+ // PrimaryName shows up as a singleton, and so needs to be handled
separately.
+
+ if(!empty($orgData['PrimaryName']['co_enrollment_attribute_id'])
+ && isset($copyAttrs[
$orgData['PrimaryName']['co_enrollment_attribute_id'] ])) {
+ // Copy PrimaryName to the CO Person
+
+ $coData['PrimaryName'] = $orgData['PrimaryName'];
+ }
+
// Save the CO Person Data

if(!$fail) {
@@ -1508,6 +1519,11 @@
$ret = $validatedData;
$err = false;

+ // If there isn't anything set in $requestData, just return the
validated data
+ if(empty($requestData[$primaryModel])) {
+ return $ret;
+ }
+
// Because the petition form includes skeletal information for related
models
// (co_enrollment_attribute_id, type, etc), we don't need to worry about
required
// models not being submitted if the petitioner doesn't complete the
field.

Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2013-11-29 03:15:57 UTC (rev
631)
+++ registry/trunk/app/View/CoPeople/fields.inc 2013-12-02 05:09:36 UTC (rev
632)
@@ -827,8 +827,9 @@
<td><?php if(isset($r['status'])) print
_txt('en.status', null, $r['status']); ?></td>
<td>
<?php
- if(!isset($permissions['cous']) ||
empty($permissions['cous']) || $es ||
- (isset($r['Cou']['name']) &&
in_array($r['Cou']['name'], $permissions['cous'])))
+ if($es // Editing self
+ || empty($r['Cou']) // No COU set for this
person
+ || (isset($r['Cou']['name']) &&
in_array($r['Cou']['name'], $permissions['cous']))) // Admin for the COU
{
// COU Admins can only edit their own folks,
so we need a bit of
// a machination to determine if they can edit
these records

Modified: registry/trunk/app/View/CoPetitions/fields.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/fields.inc 2013-11-29 03:15:57
UTC (rev 631)
+++ registry/trunk/app/View/CoPetitions/fields.inc 2013-12-02 05:09:36
UTC (rev 632)
@@ -195,6 +195,8 @@
<?php

if(isset($co_petitions[0]['PetitionerCoPerson']['Name'])) {
print
generateCn($co_petitions[0]['PetitionerCoPerson']['Name']);
+ } else {
+ print _txt('fd.actor.self');
}
?>
</td>



  • [comanage-dev] r632 - in registry/trunk/app: Controller Controller/Component Model View/CoPeople View/CoPetitions, svnlog, 12/02/2013

Archive powered by MHonArc 2.6.16.

Top of Page