Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r622 - in registry/trunk/app: Config Config/Schema Console/Command Controller Lib Model Model/Behavior Plugin/LdapProvisioner/Model View View/Addresses View/CoGroupMembers View/CoGroups View/CoInvites View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/HistoryRecords View/Identifiers View/Layouts View/Names View/Names/json View/Names/xml View/OrgIdentities View/TelephoneNumbers webroot/css

Subject: COmanage Developers List

List archive

[comanage-dev] r622 - in registry/trunk/app: Config Config/Schema Console/Command Controller Lib Model Model/Behavior Plugin/LdapProvisioner/Model View View/Addresses View/CoGroupMembers View/CoGroups View/CoInvites View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/HistoryRecords View/Identifiers View/Layouts View/Names View/Names/json View/Names/xml View/OrgIdentities View/TelephoneNumbers webroot/css


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r622 - in registry/trunk/app: Config Config/Schema Console/Command Controller Lib Model Model/Behavior Plugin/LdapProvisioner/Model View View/Addresses View/CoGroupMembers View/CoGroups View/CoInvites View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/HistoryRecords View/Identifiers View/Layouts View/Names View/Names/json View/Names/xml View/OrgIdentities View/TelephoneNumbers webroot/css
  • Date: Mon, 21 Oct 2013 23:21:21 -0400

Author: benno
Date: 2013-10-21 23:21:21 -0400 (Mon, 21 Oct 2013)
New Revision: 622

Added:
registry/trunk/app/Controller/NamesController.php
registry/trunk/app/View/Names/
registry/trunk/app/View/Names/add.ctp
registry/trunk/app/View/Names/edit.ctp
registry/trunk/app/View/Names/fields.inc
registry/trunk/app/View/Names/json/
registry/trunk/app/View/Names/json/add.ctp
registry/trunk/app/View/Names/json/delete.ctp
registry/trunk/app/View/Names/json/edit.ctp
registry/trunk/app/View/Names/json/index.ctp
registry/trunk/app/View/Names/json/view.ctp
registry/trunk/app/View/Names/view.ctp
registry/trunk/app/View/Names/xml/
registry/trunk/app/View/Names/xml/add.ctp
registry/trunk/app/View/Names/xml/delete.ctp
registry/trunk/app/View/Names/xml/edit.ctp
registry/trunk/app/View/Names/xml/index.ctp
registry/trunk/app/View/Names/xml/view.ctp
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Config/routes.php
registry/trunk/app/Console/Command/SetupShell.php
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoGroupMembersController.php
registry/trunk/app/Controller/CoGroupsController.php
registry/trunk/app/Controller/CoInvitesController.php
registry/trunk/app/Controller/CoOrgIdentityLinksController.php
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/Controller/CoPersonRolesController.php
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/Controller/CoTermsAndConditionsController.php
registry/trunk/app/Controller/HistoryRecordsController.php
registry/trunk/app/Controller/OrgIdentitiesController.php
registry/trunk/app/Controller/StandardController.php
registry/trunk/app/Controller/UsersController.php
registry/trunk/app/Lib/enum.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/Model/Behavior/ProvisionerBehavior.php
registry/trunk/app/Model/CoIdentifierAssignment.php
registry/trunk/app/Model/CoPerson.php
registry/trunk/app/Model/CoPetition.php
registry/trunk/app/Model/Name.php
registry/trunk/app/Model/OrgIdentity.php
registry/trunk/app/Plugin/LdapProvisioner/Model/CoLdapProvisionerTarget.php
registry/trunk/app/View/Addresses/index.ctp
registry/trunk/app/View/CoGroupMembers/select.ctp
registry/trunk/app/View/CoGroups/fields.inc
registry/trunk/app/View/CoInvites/reply.ctp
registry/trunk/app/View/CoInvites/send.ctp
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/CoPeople/index.ctp
registry/trunk/app/View/CoPeople/invite.ctp
registry/trunk/app/View/CoPeople/match.ctp
registry/trunk/app/View/CoPeople/provision.ctp
registry/trunk/app/View/CoPersonRoles/index.ctp
registry/trunk/app/View/CoPetitions/fields.inc
registry/trunk/app/View/CoPetitions/index.ctp
registry/trunk/app/View/CoPetitions/petition-attributes.inc
registry/trunk/app/View/EmailAddresses/index.ctp
registry/trunk/app/View/HistoryRecords/index.ctp
registry/trunk/app/View/Identifiers/index.ctp
registry/trunk/app/View/Layouts/default.ctp
registry/trunk/app/View/OrgIdentities/fields.inc
registry/trunk/app/View/OrgIdentities/find.ctp
registry/trunk/app/View/OrgIdentities/index.ctp
registry/trunk/app/View/TelephoneNumbers/index.ctp
registry/trunk/app/webroot/css/comanage.css
Log:
HasMany Name support (CO-333)

Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/Config/Schema/schema.xml 2013-10-22 03:21:21 UTC (rev
622)
@@ -205,8 +205,12 @@
<field name="org_identity_id" type="I">
<constraint>REFERENCES cm_org_identities(id)</constraint>
</field>
+ <field name="primary_name" type="L" />
<field name="created" type="T" />
<field name="modified" type="T" />
+
+ <!-- There should be a unique constraint on primary_name+co_person_id and
+ primary_name+org_identity_id, but the nulls may make that tricky -->
</table>

<table name="co_extended_attributes">

Modified: registry/trunk/app/Config/routes.php
===================================================================
--- registry/trunk/app/Config/routes.php 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/Config/routes.php 2013-10-22 03:21:21 UTC (rev
622)
@@ -77,6 +77,7 @@
'email_addresses',
'history_records',
'identifiers',
+ 'names',
'navigation_links',
'org_identities',
'organizations',

Modified: registry/trunk/app/Console/Command/SetupShell.php
===================================================================
--- registry/trunk/app/Console/Command/SetupShell.php 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/Console/Command/SetupShell.php 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Setup Shell
*
- * Copyright (C) 2011-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2011-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -131,10 +131,11 @@
'affiliation' => 'M',
'co_id' => $co_id
),
- 'Name' => array(
- 'given' => $gn,
- 'family' => $sn,
- 'type' => NameEnum::Official
+ 'PrimaryName' => array(
+ 'given' => $gn,
+ 'family' => $sn,
+ 'type' => NameEnum::Official,
+ 'primary_name' => true
)
);

@@ -166,10 +167,11 @@
'co_id' => $co_id,
'status' => StatusEnum::Active
),
- 'Name' => array(
- 'given' => $gn,
- 'family' => $sn,
- 'type' => NameEnum::Preferred
+ 'PrimaryName' => array(
+ 'given' => $gn,
+ 'family' => $sn,
+ 'type' => NameEnum::Official,
+ 'primary_name' => true
)
);


Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/Controller/AppController.php 2013-10-22 03:21:21
UTC (rev 622)
@@ -377,7 +377,7 @@

$ftxt = "(?)";

- if($model == 'Name' && $attr != 'type') {
+ if(($model == 'Name' || $model == 'PrimaryName') && $attr !=
'type') {
// Treat name specially
$ftxt = _txt('fd.name.'.$attr);
} else {
@@ -690,7 +690,7 @@
// solution could check (eg) $model->HasOne, however for now we
// just make a special exception for name.

- if($k == 'Name'
+ if($k == 'PrimaryName'
&& ($this->modelClass == 'OrgIdentity'
|| $this->modelClass == 'CoPerson')) {
continue;

Modified: registry/trunk/app/Controller/CoGroupMembersController.php
===================================================================
--- registry/trunk/app/Controller/CoGroupMembersController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoGroupMembersController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -32,8 +32,8 @@
public $paginate = array(
'limit' => 25,
'order' => array(
- 'Name.family' => 'asc',
- 'Name.given' => 'asc'
+ 'PrimaryName.family' => 'asc',
+ 'PrimaryName.given' => 'asc'
)
);

@@ -413,8 +413,8 @@
$args['joins'][0]['type'] = 'INNER';
$args['joins'][0]['conditions'][0] = 'CoPerson.co_id=CoGroup.co_id';
$args['conditions']['CoGroup.id'] =
$this->request->params['named']['cogroup'];
- $args['order'][] = 'Name.family';
- $args['contain'][] = 'Name';
+ $args['order'][] = 'PrimaryName.family';
+ $args['contain'][] = 'PrimaryName';

$this->set('co_people', $this->CoGroupMember->CoPerson->find('all',
$args));


Modified: registry/trunk/app/Controller/CoGroupsController.php
===================================================================
--- registry/trunk/app/Controller/CoGroupsController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoGroupsController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -148,8 +148,6 @@
return(true);
}

-
-
/**
* Update a CO Group.
* - precondition: Model specific attributes in $this->request->data
(optional)
@@ -173,6 +171,8 @@
// Grouper dataSource may be used and does not support
// recursion construct the necessary recursive information
// directly.
+ // XXX do we need this anymore? (Is Grouper dataSource going away?)
+ // If not, we should use containable to get PrimaryName alongside
CoPerson.
$allGroupMembers = $this->CoGroup->CoGroupMember->find('all',

array('conditions' =>

array('CoGroupMember.co_group_id' => $id)
@@ -194,7 +194,8 @@
$name = $this->Name->find('first',
array(
'conditions' =>
- array('Name.co_person_id' =>
$coPersonId),
+ array('Name.co_person_id' =>
$coPersonId,
+ 'Name.primary_name' => true),
'recursive' => -1
)
);
@@ -415,13 +416,13 @@

$args = array();
$args['conditions']['CoPerson.id'] =
$this->request->params['named']['copersonid'];
- $args['contain'] = 'Name';
+ $args['contain'] = 'PrimaryName';

$coPerson = $this->CoGroup->CoGroupMember->CoPerson->find('first',
$args);

if(!empty($coPerson)) {
// Set name for page title
- $this->set('name_for_title',
Sanitize::html(generateCn($coPerson['Name'])));
+ $this->set('name_for_title',
Sanitize::html(generateCn($coPerson['PrimaryName'])));
}

// XXX proper authz here is probably something like "(all open CO groups

Modified: registry/trunk/app/Controller/CoInvitesController.php
===================================================================
--- registry/trunk/app/Controller/CoInvitesController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoInvitesController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -365,7 +365,7 @@
$pArgs['conditions']['CoPetition.id'] = $invite['CoPetition']['id'];
$pArgs['contain'][] = 'CoPetitionHistoryRecord';
$pArgs['contain']['CoPetitionHistoryRecord'][0] = 'ActorCoPerson';
- $pArgs['contain']['CoPetitionHistoryRecord']['ActorCoPerson'] =
'Name';
+ $pArgs['contain']['CoPetitionHistoryRecord']['ActorCoPerson'] =
'PrimaryName';

$petition = $this->CoInvite->CoPetition->find('all', $pArgs);

@@ -492,7 +492,7 @@
: null,
$this->cur_co['Co']['name']);

- $this->Session->setFlash(_txt('em.invite.ok',
$orgp['EmailAddress'][0]['mail']), '', array(), 'success');
+ $this->Session->setFlash(_txt('em.invite.ok',
array($orgp['EmailAddress'][0]['mail'])), '', array(), 'success');
}
catch(Exception $e) {
$this->Session->setFlash($e->getMessage(), '', array(), 'error');

Modified: registry/trunk/app/Controller/CoOrgIdentityLinksController.php
===================================================================
--- registry/trunk/app/Controller/CoOrgIdentityLinksController.php
2013-10-21 22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoOrgIdentityLinksController.php
2013-10-22 03:21:21 UTC (rev 622)
@@ -71,7 +71,7 @@
}

// Can't contain OrgIdentity completely since Name is used for display
- $this->CoOrgIdentityLink->OrgIdentity->contain('Name');
+ $this->CoOrgIdentityLink->OrgIdentity->contain('PrimaryName');
$orgIdentity =
$this->CoOrgIdentityLink->OrgIdentity->findById($reqdata['CoOrgIdentityLink']['org_identity_id']);

if(empty($orgIdentity))

Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoPeopleController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -35,8 +35,8 @@
public $paginate = array(
'limit' => 25,
'order' => array(
- 'Name.family' => 'asc',
- 'Name.given' => 'asc'
+ 'PrimaryName.family' => 'asc',
+ 'PrimaryName.given' => 'asc'
)
);

@@ -150,7 +150,7 @@
}

$this->Session->setFlash(_txt('er.coumember',
- array(generateCn($curdata['Name']),
+ array(generateCn($curdata['PrimaryName']),
Sanitize::html($couname))),
'', array(), 'error');

@@ -170,7 +170,7 @@
$this->restResultHeader(499, "CoPersonRole Exists");
else
$this->Session->setFlash(_txt('er.copr.exists',
- array(generateCn($curdata['Name']))),
+
array(generateCn($curdata['PrimaryName']))),
'', array(), 'error');

return false;
@@ -193,7 +193,7 @@
// Check that an org identity being added is not already a member of the
CO.
// (A person can't be added to the same CO twice... that's what Person
Roles
// are for.) Note the REST check is in co_org_identity_links_controller.
-
+
if(!$this->restful
&& (!$curdata
||
@@ -204,7 +204,7 @@

$reqdata['CoOrgIdentityLink'][0]['org_identity_id']))
{
$this->Session->setFlash(_txt('er.cop.member',
- array(generateCn($this->data['Name']),
+
array(generateCn($this->data['PrimaryName']),
$this->cur_co['Co']['name'])),
'', array(), 'error');

@@ -218,9 +218,9 @@
}
}

- return(true);
+ return true;
}
-
+
/**
* Retrieve CO and Org attributes for comparison.
* - precondition: <id> must exist
@@ -267,6 +267,7 @@
* @since COmanage Registry v0.8
* @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
*/
+
function delete($id) {
// If a data store for groups and group memberships is being used that
// is not a relational database supporting SQL then temporarily remove
@@ -307,10 +308,10 @@

if(isset($c[$req][$model->displayField]))
return($c[$req][$model->displayField]);
- if(isset($this->request->data['Name']))
- return(generateCn($this->request->data['Name']));
- if(isset($c['Name']))
- return(generateCn($c['Name']));
+ elseif(isset($this->request->data['PrimaryName']))
+ return(generateCn($this->request->data['PrimaryName']));
+ elseif(isset($c['PrimaryName']))
+ return(generateCn($c['PrimaryName']));
else
return("(?)");
}
@@ -359,7 +360,7 @@

$this->Session->read('Auth.User.co_person_id'),

ActionEnum::CoPersonEditedManual,
_txt('en.action', null,
ActionEnum::CoPersonEditedManual) . ": " .
-
$this->changesToString($newdata, $olddata, array('CoPerson', 'Name')));
+
$this->changesToString($newdata, $olddata, array('CoPerson', 'PrimaryName')));
break;
}

@@ -404,12 +405,12 @@
if(!$this->restful)
{
// Set page title
- $this->set('title_for_layout', _txt('op.inv-a',
array(generateCn($orgp['Name']))));
+ $this->set('title_for_layout', _txt('op.inv-a',
array(generateCn($orgp['PrimaryName']))));
}

// Construct a CoPerson from the OrgIdentity. We only populate
defaulted values.

- $cop['Name'] = $orgp['Name'];
+ $cop['PrimaryName'] = $orgp['PrimaryName'];
$cop['CoOrgIdentityLink'][0]['org_identity_id'] =
$orgp['OrgIdentity']['id'];

$this->set('co_people', array(0 => $cop));
@@ -618,13 +619,13 @@
// Filter by given name
if(!empty($this->params['named']['Search.givenName'])) {
$searchterm = $this->params['named']['Search.givenName'];
- $pagcond['Name.given LIKE'] = "%$searchterm%";
+ $pagcond['PrimaryName.given LIKE'] = "%$searchterm%";
}

// Filter by Family name
if(!empty($this->params['named']['Search.familyName'])) {
$searchterm = $this->params['named']['Search.familyName'];
- $pagcond['Name.family LIKE'] = "%$searchterm%";
+ $pagcond['PrimaryName.family LIKE'] = "%$searchterm%";
}

// Filter by status
@@ -668,7 +669,7 @@

$args = array();
$args['conditions']['CoPerson.id'] = $id;
- $args['contain'][] = 'Name';
+ $args['contain'][] = 'PrimaryName';

$this->set('co_person', $this->CoPerson->find('first', $args));
}

Modified: registry/trunk/app/Controller/CoPersonRolesController.php
===================================================================
--- registry/trunk/app/Controller/CoPersonRolesController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoPersonRolesController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO People Controller
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2010-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.2
@@ -32,8 +32,8 @@
public $paginate = array(
'limit' => 25,
'order' => array(
- 'Name.family' => 'asc',
- 'Name.given' => 'asc'
+ 'PrimaryName.family' => 'asc',
+ 'PrimaryName.given' => 'asc'
)
);

@@ -74,7 +74,7 @@

// Append the person's name to the page title
$this->set('title_for_layout',
- $this->viewVars['title_for_layout'] . " (" .
generateCn($this->viewVars['co_people'][0]['Name']) . ")");
+ $this->viewVars['title_for_layout'] . " (" .
generateCn($this->viewVars['co_people'][0]['PrimaryName']) . ")");
}

/**
@@ -217,10 +217,10 @@

if(isset($c[$req][$model->displayField]))
return($c[$req][$model->displayField]);
- if(isset($this->request->data['Name']))
- return(generateCn($this->request->data['Name']));
- if(isset($this->viewVars['co_people'][0]['Name']))
- return(generateCn($this->viewVars['co_people'][0]['Name']));
+ if(isset($this->request->data['PrimaryName']))
+ return(generateCn($this->request->data['PrimaryName']));
+ if(isset($this->viewVars['co_people'][0]['PrimaryName']))
+ return(generateCn($this->viewVars['co_people'][0]['PrimaryName']));
else
return("(?)");
}

Modified: registry/trunk/app/Controller/CoPetitionsController.php
===================================================================
--- registry/trunk/app/Controller/CoPetitionsController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoPetitionsController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -35,10 +35,10 @@
'modified' => 'asc'
),
'contain' => array(
- 'ApproverCoPerson' => 'Name',
- 'EnrolleeCoPerson' => 'Name',
- 'PetitionerCoPerson' => 'Name',
- 'SponsorCoPerson' => 'Name'
+ 'ApproverCoPerson' => 'PrimaryName',
+ 'EnrolleeCoPerson' => 'PrimaryName',
+ 'PetitionerCoPerson' => 'PrimaryName',
+ 'SponsorCoPerson' => 'PrimaryName'
)
);

@@ -48,13 +48,13 @@
// For rendering views, we need more information than just the various ID
numbers
// stored in a petition.
public $view_contains = array(
- 'ApproverCoPerson' => 'Name',
- 'EnrolleeCoPerson' => 'Name',
- 'PetitionerCoPerson' => 'Name',
- 'SponsorCoPerson' => 'Name',
+ 'ApproverCoPerson' => 'PrimaryName',
+ 'EnrolleeCoPerson' => 'PrimaryName',
+ 'PetitionerCoPerson' => 'PrimaryName',
+ 'SponsorCoPerson' => 'PrimaryName',
'CoPetitionHistoryRecord' => array(
'ActorCoPerson' => array(
- 'Name'
+ 'PrimaryName'
)
)
);
@@ -331,7 +331,7 @@
$this->set('title_for_layout',
_txt('op.' . $this->action . '-f',
array(_txt('ct.co_petitions.1'),
-
generateCn($this->viewVars['co_petitions'][0]['EnrolleeCoPerson']['Name']))));
+
generateCn($this->viewVars['co_petitions'][0]['EnrolleeCoPerson']['PrimaryName']))));
}
}


Modified: registry/trunk/app/Controller/CoTermsAndConditionsController.php
===================================================================
--- registry/trunk/app/Controller/CoTermsAndConditionsController.php
2013-10-21 22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/CoTermsAndConditionsController.php
2013-10-22 03:21:21 UTC (rev 622)
@@ -175,7 +175,7 @@
// And also this CO Person
$args = array();
$args['conditions']['CoPerson.id'] =
$this->params['named']['copersonid'];
- $args['contain'][] = 'Name';
+ $args['contain'][] = 'PrimaryName';

$this->set('vv_co_person', $this->Co->CoPerson->find('first', $args));
}

Modified: registry/trunk/app/Controller/HistoryRecordsController.php
===================================================================
--- registry/trunk/app/Controller/HistoryRecordsController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/HistoryRecordsController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -42,10 +42,10 @@
'created' => 'desc'
),
'contain' => array(
- 'ActorCoPerson.Name',
- 'CoPerson.Name',
+ 'ActorCoPerson.PrimaryName',
+ 'CoPerson.PrimaryName',
'CoPersonRole',
- 'OrgIdentity.Name'
+ 'OrgIdentity.PrimaryName'
)
);


Modified: registry/trunk/app/Controller/OrgIdentitiesController.php
===================================================================
--- registry/trunk/app/Controller/OrgIdentitiesController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/OrgIdentitiesController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -34,8 +34,8 @@
public $paginate = array(
'limit' => 25,
'order' => array(
- 'Name.family' => 'asc',
- 'Name.given' => 'asc'
+ 'PrimaryName.family' => 'asc',
+ 'PrimaryName.given' => 'asc'
)
);

@@ -140,10 +140,10 @@
'', array(), 'error');
}

- return(false);
+ return false;
}

- return(true);
+ return true;
}

/**
@@ -195,10 +195,10 @@

if(isset($c[$req][$model->displayField]))
return($c[$req][$model->displayField]);
- elseif(isset($this->data['Name']))
- return(generateCn($this->data['Name']));
- elseif(isset($c['Name']))
- return(generateCn($c['Name']));
+ elseif(isset($this->data['PrimaryName']))
+ return(generateCn($this->data['PrimaryName']));
+ elseif(isset($c['PrimaryName']))
+ return(generateCn($c['PrimaryName']));
else
return("(?)");
}
@@ -236,7 +236,7 @@

$this->Session->read('Auth.User.co_person_id'),

ActionEnum::OrgIdEditedManual,
_txt('en.action', null,
ActionEnum::OrgIdEditedManual) . ": " .
-
$this->changesToString($newdata, $olddata, array('OrgIdentity', 'Name')));
+
$this->changesToString($newdata, $olddata, array('OrgIdentity',
'PrimaryName')));
break;
}

@@ -379,13 +379,13 @@
// Filter by given name
if(!empty($this->params['named']['Search.givenName'])) {
$searchterm = $this->params['named']['Search.givenName'];
- $pagcond['Name.given LIKE'] = "%$searchterm%";
+ $pagcond['PrimaryName.given LIKE'] = "%$searchterm%";
}

// Filter by Family name
if(!empty($this->params['named']['Search.familyName'])) {
$searchterm = $this->params['named']['Search.familyName'];
- $pagcond['Name.family LIKE'] = "%$searchterm%";
+ $pagcond['PrimaryName.family LIKE'] = "%$searchterm%";
}

// Filter by Organization
@@ -411,7 +411,7 @@
$searchterm = $this->params['named']['Search.affiliation'];
$pagcond['OrgIdentity.affiliation LIKE'] = "%$searchterm%";
}
-
+
return($pagcond);
}


Modified: registry/trunk/app/Controller/StandardController.php
===================================================================
--- registry/trunk/app/Controller/StandardController.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Controller/StandardController.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -324,7 +324,9 @@

$t = _txt('ct.' . $modelpl . '.1');

- if(!empty($curdata['Name'])) {
+ if(!empty($curdata['PrimaryName'])) {
+ $t = generateCn($curdata['PrimaryName']);
+ } elseif(!empty($curdata['Name'])) {
$t = generateCn($curdata['Name']);
} elseif(!empty($curdata[$req][ $model->displayField ])) {
$t = $curdata[$req][ $model->displayField ];
@@ -766,6 +768,11 @@

function performRedirect() {
if($this->requires_person) {
+ if(empty($this->viewVars['redirect'])) {
+ // $redirect doesn't seem to be set when deleting a name, so set it
if missing
+ $this->checkPersonID('set');
+ }
+
$redirect = $this->viewVars['redirect'];

// Sets tab to be opened by co_people page via jquery
@@ -913,8 +920,8 @@

$t = _txt('ct.' . $modelpl . '.1');

- if(!empty($obj['Name'])) {
- $t = generateCn($obj['Name']);
+ if(!empty($obj['PrimaryName'])) {
+ $t = generateCn($obj['PrimaryName']);
} elseif(!empty($obj[$req][ $model->displayField ])) {
$t = $obj[$req][ $model->displayField ];
}

Modified: registry/trunk/app/Controller/UsersController.php
===================================================================
--- registry/trunk/app/Controller/UsersController.php 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/Controller/UsersController.php 2013-10-22 03:21:21
UTC (rev 622)
@@ -24,6 +24,8 @@

class UsersController extends AppController {
public $name = 'Users';
+
+ public $uses = array("CoGroup", "CoGroupMember", "OrgIdentity");

public $components = array(
'Auth' => array(
@@ -86,8 +88,6 @@
// This is an Org Identity. Figure out which Org Identities this
username
// (identifier) is associated with. First, pull the identifiers.

- $this->loadModel('OrgIdentity');
-
$args['joins'][0]['table'] = 'identifiers';
$args['joins'][0]['alias'] = 'Identifier';
$args['joins'][0]['type'] = 'INNER';
@@ -99,7 +99,7 @@
$args['conditions']['OR'][]['Identifier.status <>'] =
StatusEnum::Deleted;
// Through the magic of containable behaviors, we can get all the
associated
// data we need in one clever find
- $args['contain'][] = 'Name';
+ $args['contain'][] = 'PrimaryName';
$args['contain']['CoOrgIdentityLink']['CoPerson'][0] = 'Co';
$args['contain']['CoOrgIdentityLink']['CoPerson']['CoGroupMember']
= 'CoGroup';

@@ -129,9 +129,6 @@

// And assemble the Group Memberships

- $this->loadModel('CoGroupMember');
- $this->loadModel('CoGroup');
-
$params = array(
'conditions' => array(
'CoGroupMember.co_person_id' => $l['co_person_id']
@@ -165,11 +162,10 @@
$this->Session->write('Auth.User.org_identities', $orgs);
$this->Session->write('Auth.User.cos', $cos);

- // Pick a name. We don't really have a good heuristic for this, so
for now we'll
- // go with the first one returned, which was probably added first.
+ // Use the primary organizational name as the session name.

- if(isset($orgIdentities[0]['Name'])) {
- $this->Session->write('Auth.User.name',
$orgIdentities[0]['Name']);
+ if(isset($orgIdentities[0]['PrimaryName'])) {
+ $this->Session->write('Auth.User.name',
$orgIdentities[0]['PrimaryName']);
}

$this->redirect($this->Auth->redirectUrl());

Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2013-10-21 22:38:36 UTC (rev 621)
+++ registry/trunk/app/Lib/enum.php 2013-10-22 03:21:21 UTC (rev 622)
@@ -49,6 +49,10 @@
const InvitationConfirmed = 'INVC';
const InvitationDeclined = 'INVD';
const InvitationSent = 'INVS';
+ const NameAdded = 'ANAM';
+ const NameDeleted = 'DNAM';
+ const NameEdited = 'ENAM';
+ const NamePrimary = 'PNAM';
const OrgIdAddedManual = 'AOIM';
const OrgIdAddedPetition = 'AOIP';
const OrgIdEditedManual = 'EOIM';
@@ -201,6 +205,7 @@

class NameEnum
{
+ const Alternate = 'L';
const Author = 'A';
const FKA = 'F';
const Official = 'O';
@@ -417,6 +422,7 @@
);

$name_t = array(
+ 'L' => 'Alternate',
'A' => 'Author',
'F' => 'FKA',
'O' => 'Official',
@@ -424,6 +430,7 @@
);

$name_ti = array(
+ 'Alternate' => 'L',
'Author' => 'A',
'FKA' => 'F',
'Official' => 'O',

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-10-21 22:38:36 UTC (rev 621)
+++ registry/trunk/app/Lib/lang.php 2013-10-22 03:21:21 UTC (rev 622)
@@ -100,6 +100,8 @@
'ct.history_records.pl' => 'History Records',
'ct.identifiers.1' => 'Identifier',
'ct.identifiers.pl' => 'Identifiers',
+ 'ct.names.1' => 'Name',
+ 'ct.names.pl' => 'Names',
'ct.navigation_links.1' => 'Navigation Link',
'ct.navigation_links.pl' => 'Navigation Links',
'ct.org_identities.1' => 'Organizational Identity',
@@ -270,7 +272,8 @@
'ur' => 'Urdu (اُردُو)'
),

- 'en.name' => array(NameEnum::Author => 'Author',
+ 'en.name' => array(NameEnum::Alternate => 'Alternate',
+ NameEnum::Author => 'Author',
NameEnum::FKA => 'FKA',
NameEnum::Official => 'Official',
NameEnum::Preferred => 'Preferred'),
@@ -408,6 +411,7 @@
'er.inv.nf' => 'Invitation Not Found',
'er.loc.exists' => 'A localization already exists for the key "%1$s" and
language "%2$s"',
'er.nd.already' => 'NSF Demographic data already exists for this person',
+ 'er.nm.primary' => '"%1$s" is the primary name and cannot be deleted',
'er.nt.email' => 'Notification could not be sent because no email
address was found',
'er.nt.send' => 'Notification to %1$s failed (%2$s)',
'er.notfound' => '%1$s "%2$s" Not Found',
@@ -607,6 +611,7 @@
'fd.name.family' => 'Family Name',
'fd.name.suffix' => 'Suffix',
'fd.name.language' => 'Language',
+ 'fd.name.primary' => 'Primary',
'fd.no' => 'No',
'fd.null' => 'Null',
'fd.o' => 'Organization',
@@ -713,6 +718,7 @@
'op.ok' => 'OK',
'op.petition' => 'Petition',
'op.petition.create' => 'Create Petition',
+ 'op.primary' => 'Make Primary',
'op.proceed.ok' => 'Are you sure you wish to proceed?',
'op.prov' => 'Provision',
'op.prov.confirm' => 'Are you sure you wish to (re)provision this record?',
@@ -737,6 +743,8 @@
// Results
'rs.added' => 'Added',
'rs.added-a' => '"%1$s" Added',
+ 'rs.added-a2' => '%1$s "%2$s" Added',
+ 'rs.deleted-a2' => '%1$s "%2$s" Deleted',
'rs.grm.added' => 'Added to CO Group %1$s (%2$s) (member=%3$s,
owner=%4$s)',
'rs.grm.deleted' => 'Removed from CO Group %1$s (%2$s)',
'rs.grm.edited' => 'Edited CO Group Roles %1$s (%2$s) (from member=%3$s,
owner=%4$s to member=%5$s, owner=%6$s)',
@@ -747,6 +755,8 @@
'rs.inv.dec-a' => 'Invitation to %1$s declined',
'rs.inv.sent' => 'Invitation sent to %1$s',
'rs.mail.verified' => 'Email Address "%1$s" verified',
+ 'rs.nm.primary' => 'Primary name updated',
+ 'rs.nm.primary-a' => 'Primary name updated to "%1$s"',
'rs.nt.sent' => 'Approval notification sent to %1$s',
'rs.prov-a' => 'Provisioned %1$s',
'rs.prov.ok' => 'Provisioning completed successfully',
@@ -764,6 +774,7 @@
'rs.tc.agree.ok' => 'Agreement to Terms and Conditions recorded',
'rs.saved' => 'Saved',
'rs.updated' => '"%1$s" Updated',
+ 'rs.updated-a2' => '%1$s "%2$s" Updated',

// Setup


Modified: registry/trunk/app/Model/Behavior/ProvisionerBehavior.php
===================================================================
--- registry/trunk/app/Model/Behavior/ProvisionerBehavior.php 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/Model/Behavior/ProvisionerBehavior.php 2013-10-22
03:21:21 UTC (rev 622)
@@ -513,7 +513,7 @@
'CoPersonRole.TelephoneNumber',
'EmailAddress',
'Identifier',
- 'Name'
+ 'PrimaryName'
);

$coPersonData = $coPersonModel->find('first', $args);

Modified: registry/trunk/app/Model/CoIdentifierAssignment.php
===================================================================
--- registry/trunk/app/Model/CoIdentifierAssignment.php 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/Model/CoIdentifierAssignment.php 2013-10-22 03:21:21
UTC (rev 622)
@@ -151,7 +151,7 @@

$args = array();
$args['conditions']['CoPerson.id'] = $coPersonID;
- $args['contain'][] = 'Name';
+ $args['contain'][] = 'PrimaryName';
$args['contain'][] = 'Identifier';

$coPerson = $this->Co->CoPerson->find('first', $args);
@@ -182,7 +182,7 @@

// Generate the new identifier. This requires several steps. First,
substitute
// non-collision number parameters. If no format is specified, default
to "(#)".
- // XXX Need to pick Name if more than one defined.
+ // We'll use PrimaryName in case there is more than one.

$iaFormat = "(#)";

@@ -191,7 +191,7 @@
$iaFormat =
$coIdentifierAssignment['CoIdentifierAssignment']['format'];
}

- $base = $this->substituteParameters($iaFormat, $coPerson['Name']);
+ $base = $this->substituteParameters($iaFormat, $coPerson['PrimaryName']);

// Now that we've got our base, loop until we get a unique identifier.
// We try a maximum of 10 (0 through 9) times, and track identifiers
we've

Modified: registry/trunk/app/Model/CoPerson.php
===================================================================
--- registry/trunk/app/Model/CoPerson.php 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/Model/CoPerson.php 2013-10-22 03:21:21 UTC (rev
622)
@@ -39,9 +39,13 @@
"CoNsfDemographic" => array('dependent' => true),
// A person can have one invite (per CO)
"CoInvite" => array('dependent' => true),
- // A person can have one (preferred) name per CO
- // This could change if Name became an MVPA
- "Name" => array('dependent' => true)
+ // An Org Identity has one Primary Name, which is a pointer to a Name
+ "PrimaryName" => array(
+ 'className' => 'Name',
+ 'conditions' => array('PrimaryName.primary_name' => true),
+ 'dependent' => false,
+ 'foreignKey' => 'co_person_id'
+ )
);

public $hasMany = array(
@@ -86,10 +90,11 @@
),
// A person can have many identifiers within a CO
"Identifier" => array('dependent' => true),
+ "Name" => array('dependent' => true)
);

// Default display field for cake generated views
- public $displayField = "CoPerson.id";
+ public $displayField = "PrimaryName.family";

// Default ordering for find operations
// XXX CO-296 Toss default order?
@@ -102,6 +107,11 @@
'required' => true,
'message' => 'A CO ID must be provided'
),
+ 'primary_name_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
'status' => array(
'rule' => array('inList', array(StatusEnum::Active,
StatusEnum::Approved,
@@ -295,10 +305,14 @@
$args['conditions']['LOWER(Name.family) LIKE'] =
strtolower($criteria['Name.family']) . '%';
}
$args['conditions']['CoPerson.co_id'] = $coId;
- $args['contain'][] = 'Name';
+ $args['joins'][0]['table'] = 'names';
+ $args['joins'][0]['alias'] = 'Name';
+ $args['joins'][0]['type'] = 'INNER';
+ $args['joins'][0]['conditions'][0] = 'CoPerson.id=Name.co_person_id';
+ $args['contain'][] = 'PrimaryName';
$args['contain'][] = 'CoPersonRole';

- return($this->find('all', $args));
+ return $this->find('all', $args);
}

/**
@@ -390,8 +404,8 @@
public function sponsorList($co_id) {
// Query database for people
$args = array(
- 'contain' => array('Name'),
- 'order' => array('Name.family ASC'),
+ 'contain' => array('PrimaryName'),
+ 'order' => array('PrimaryName.family ASC'),
'conditions' => array('CoPerson.co_id' => $co_id)
);

@@ -402,7 +416,7 @@

foreach($nameData as $pers)
{
- $drop[ $pers['CoPerson']['id'] ] = generateCn($pers['Name'], true);
+ $drop[ $pers['CoPerson']['id'] ] = generateCn($pers['PrimaryName'],
true);
}
return $drop;
}

Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/Model/CoPetition.php 2013-10-22 03:21:21 UTC (rev
622)
@@ -208,6 +208,15 @@
continue;
}

+ if($efAttr['field'] == 'login'
+ && (strncmp($efAttr['attribute'], 'i:identifier', 12)==0
+ || strncmp($efAttr['attribute'], 'p:identifier', 12)==0)) {
+ // For identifiers, skip login since it's not the primary element
and it's
+ // hard to tell if it's empty or not (since it's boolean)
+
+ continue;
+ }
+
if($efAttr['required']) {
// We found a required flag, so stop

@@ -1565,9 +1574,17 @@
$this->$primaryModel->validationErrors[$model][$instance] =
$errFields;
$err = true;
} else {
- // Add this entry to the $coData being assembled
+ // Add this entry to the $data being assembled. As an
exception, if we have a name
+ // of type official promote it to a HasOne relationship, since
it will be considered
+ // a primary name.

- $ret[$model][$instance] =
$relatedModels['hasMany'][$model][$instance];
+ if($model == 'Name'
+ && $relatedModels['hasMany'][$model][$instance]['type'] ==
NameEnum::Official) {
+ $ret['PrimaryName'] =
$relatedModels['hasMany'][$model][$instance];
+ $ret['PrimaryName']['primary_name'] = true;
+ } else {
+ $ret[$model][$instance] =
$relatedModels['hasMany'][$model][$instance];
+ }
}
}
}

Modified: registry/trunk/app/Model/Name.php
===================================================================
--- registry/trunk/app/Model/Name.php 2013-10-21 22:38:36 UTC (rev 621)
+++ registry/trunk/app/Model/Name.php 2013-10-22 03:21:21 UTC (rev 622)
@@ -78,18 +78,24 @@
'allowEmpty' => true
),
'type' => array(
- 'rule' => array('inList', array(NameEnum::Author,
+ 'rule' => array('inList', array(NameEnum::Alternate,
+ NameEnum::Author,
NameEnum::FKA,
NameEnum::Official,
NameEnum::Preferred)),
- 'required' => false,
- 'allowEmpty' => true
+ 'required' => true,
+ 'allowEmpty' => false
),
'language' => array(
'rule' => array('validateLanguage'),
'required' => false,
'allowEmpty' => true
),
+ 'primary_name' => array(
+ 'rule' => array('boolean'),
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
'co_person_id' => array(
'rule' => 'numeric',
'required' => false,
@@ -101,4 +107,10 @@
'allowEmpty' => true
)
);
+
+ // Enum type hints
+
+ public $cm_enum_types = array(
+ 'type' => 'name_t'
+ );
}
\ No newline at end of file

Modified: registry/trunk/app/Model/OrgIdentity.php
===================================================================
--- registry/trunk/app/Model/OrgIdentity.php 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/Model/OrgIdentity.php 2013-10-22 03:21:21 UTC (rev
622)
@@ -34,9 +34,13 @@

// Association rules from this model to other models
public $hasOne = array(
- // A person can have one (preferred) name per Org.
- // This could change if Name became an MVPA
- "Name" => array('dependent' => true)
+ // An Org Identity has one Primary Name, which is a pointer to a Name
+ "PrimaryName" => array(
+ 'className' => 'Name',
+ 'conditions' => array('PrimaryName.primary_name' => true),
+ 'dependent' => false,
+ 'foreignKey' => 'org_identity_id'
+ )
);

public $hasMany = array(
@@ -56,6 +60,7 @@
"HistoryRecord" => array('dependent' => true),
// A person can have many identifiers within an organization
"Identifier" => array('dependent' => true),
+ "Name" => array('dependent' => true),
// A person can have one or more telephone numbers
"TelephoneNumber" => array('dependent' => true)
);
@@ -68,7 +73,7 @@
);

// Default display field for cake generated views
- public $displayField = "Name.family";
+ public $displayField = "PrimaryName.family";

// XXX CO-296
// Default ordering for find operations
@@ -108,6 +113,11 @@
'required' => false,
'allowEmpty' => true
),
+ 'primary_name_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
'title' => array(
'rule' => '/.*/',
'required' => false,

Modified:
registry/trunk/app/Plugin/LdapProvisioner/Model/CoLdapProvisionerTarget.php
===================================================================
---
registry/trunk/app/Plugin/LdapProvisioner/Model/CoLdapProvisionerTarget.php
2013-10-21 22:38:36 UTC (rev 621)
+++
registry/trunk/app/Plugin/LdapProvisioner/Model/CoLdapProvisionerTarget.php
2013-10-22 03:21:21 UTC (rev 622)
@@ -195,18 +195,18 @@
case 'cn':
if($person) {
// Currently only preferred name supported (CO-333)
- $attributes[$attr] = generateCn($provisioningData['Name']);
+ $attributes[$attr] =
generateCn($provisioningData['PrimaryName']);
} else {
$attributes[$attr] = $provisioningData['CoGroup']['name'];
}
break;
case 'givenName':
// Currently only preferred name supported (CO-333)
- $attributes[$attr] = $provisioningData['Name']['given'];
+ $attributes[$attr] =
$provisioningData['PrimaryName']['given'];
break;
case 'sn':
// Currently only preferred name supported (CO-333)
- $attributes[$attr] = $provisioningData['Name']['family'];
+ $attributes[$attr] =
$provisioningData['PrimaryName']['family'];
break;
// Attributes from CO Person Role
case 'eduPersonAffiliation':

Modified: registry/trunk/app/View/Addresses/index.ctp
===================================================================
--- registry/trunk/app/View/Addresses/index.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/Addresses/index.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Address Index View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -34,8 +34,8 @@
<th><?php echo $this->Paginator->sort('line1',
_txt('fd.address.line1')); ?></th>
<th><?php echo $this->Paginator->sort('type', _txt('fd.type')); ?></th>
<!-- XXX Following needs to be I18N'd, and also render a full name, if
index view sticks around -->
- <th><?php echo $this->Paginator->sort('OrgIdentity.Name.family', 'Org
Identity'); ?></th>
- <th><?php echo $this->Paginator->sort('CoPersonRole.Name.family', 'CO
Person Role'); ?></th>
+ <th><?php echo
$this->Paginator->sort('OrgIdentity.PrimaryName.family', 'Org Identity');
?></th>
+ <th><?php echo
$this->Paginator->sort('CoPersonRole.PrimaryName.family', 'CO Person Role');
?></th>
<th><?php echo _txt('fd.actions'); ?></th>
</tr>
</thead>
@@ -60,7 +60,7 @@
{
// Generally, someone who has view permission on a telephone
number can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($a['OrgIdentity']['Name']),
+ echo
$this->Html->link(generateCn($a['OrgIdentity']['PrimaryName']),
array('controller' => 'org_identities',
'action' => 'view', $a['OrgIdentity']['id'])) . "\n";
}
?>
@@ -71,7 +71,7 @@
{
// Generally, someone who has view permission on a telephone
number can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($a['CoPersonRole']['Name']),
+ echo
$this->Html->link(generateCn($a['CoPersonRole']['PrimaryName']),
array('controller' =>
'co_person_roles', 'action' => 'view', $a['CoPersonRole']['id'])) . "\n";
}
?>

Modified: registry/trunk/app/View/CoGroupMembers/select.ctp
===================================================================
--- registry/trunk/app/View/CoGroupMembers/select.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/CoGroupMembers/select.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -53,7 +53,7 @@
<tr class="line<?php print ($i % 2)+1; ?>">
<td>
<?php
- print $this->Html->link(Sanitize::html(generateCn($p['Name'])),
+ print
$this->Html->link(Sanitize::html(generateCn($p['PrimaryName'])),
array('controller' => 'co_people',
'action' => 'edit',
$p['CoPerson']['id'],

Modified: registry/trunk/app/View/CoGroups/fields.inc
===================================================================
--- registry/trunk/app/View/CoGroups/fields.inc 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoGroups/fields.inc 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Group Fields
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -171,7 +171,7 @@
if($dok) {
print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(_txt('fd.group.memin',
array(Sanitize::html($co_groups[0]['CoGroup']['name'])))) . '\', \'' .
$this->Html->url(array('controller' => 'co_group_members', 'action' =>
'delete', $g['id'], 'copersonid' => $g['co_person_id'], 'co' =>
$cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') . '</a>' . "\n";
}
- print $this->Html->link(generateCn($c['CoPerson']['Name']),
+ print
$this->Html->link(generateCn($c['CoPerson']['PrimaryName']),
array('controller' =>
'co_group_members',
'action' => 'edit',
$g['id'],
@@ -197,7 +197,7 @@
}
} else {
foreach($co_group_members as $c)
- echo Sanitize::html(generateCn($c['CoPerson']['Name'])) . "<br
/>\n";
+ echo Sanitize::html(generateCn($c['CoPerson']['PrimaryName']))
. "<br />\n";
}
}
?>

Modified: registry/trunk/app/View/CoInvites/reply.ctp
===================================================================
--- registry/trunk/app/View/CoInvites/reply.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoInvites/reply.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Invite Reply View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -28,7 +28,7 @@
print $this->element("pageTitle", $params);
?>

-<h2 class="ui-state-default"><?php print _txt('fd.inv.for',
array(generateCn($invitee['Name']))); ?></h2>
+<h2 class="ui-state-default"><?php print _txt('fd.inv.for',
array(generateCn($invitee['PrimaryName']))); ?></h2>

<?php
print $this->Html->link(

Modified: registry/trunk/app/View/CoInvites/send.ctp
===================================================================
--- registry/trunk/app/View/CoInvites/send.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoInvites/send.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Invite Send View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -23,7 +23,7 @@
*/
-->
<?php
- $params = array('title' => "Invitation for " . $cur_co['Co']['name'] . "
Sent to " . generateCn($invitee['Name']));
+ $params = array('title' => "Invitation for " . $cur_co['Co']['name'] . "
Sent to " . generateCn($invitee['PrimaryName']));
print $this->element("pageTitle", $params);
?>


Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoPeople/fields.inc 2013-10-22 03:21:21 UTC (rev
622)
@@ -187,6 +187,7 @@

$("#autogenerate-dialog").dialog({
autoOpen: false,
+ <?php if($this->action == 'edit'): ?>
buttons: {
"<?php print _txt('op.cancel'); ?>": function() {
$(this).dialog("close");
@@ -205,7 +206,7 @@
hide: {
effect: "fade"
}
-
+ <?php endif; // edit ?>
});
});
</script>
@@ -246,81 +247,58 @@
</li>
<?php endif; ?>
</ul>
- <div id="tabs-name">
+ <div id="tabs-name" class="additionalinfo">
<table>
- <?php if($this->action == "compare"): ?>
- <tr>
- <th class="ui-widget-header"><?php print _txt('fd.attribute');
?></th>
- <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
- <?php if($this->action == "compare"): ?>
- <th class="ui-widget-header"><?php print
(!empty($org_identities[0]['OrgIdentity']['o']) ?
Sanitize::html($org_identities[0]['OrgIdentity']['o']) : _txt('fd.o'));
?></th>
- <?php endif; ?>
- </tr>
- <?php endif; ?>
+ <?php if($this->action == 'invite'): ?>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php
print _txt('fd.name.honorific');
-
+
if($e)
print " " . _txt('fd.name.h.desc');
?>
</th>
<td>
<?php
- print $this->Form->hidden('Name.id');
- print $this->Form->hidden('Name.type', array('default' =>
'P'));
- print ($e ? $this->Form->input('Name.honorific',
array('default' => $co_people[0]['Name']['honorific']))
- : Sanitize::html($co_people[0]['Name']['honorific']));
+ print $this->Form->hidden('PrimaryName.id');
+ print $this->Form->hidden('PrimaryName.type', array('default'
=> NameEnum::Official));
+ print $this->Form->hidden('PrimaryName.primary_name',
array('default' => true));
+ print ($e ? $this->Form->input('PrimaryName.honorific',
+ array('default' =>
$co_people[0]['PrimaryName']['honorific']))
+ :
Sanitize::html($co_people[0]['PrimaryName']['honorific']));
?>
</td>
- <?php if($this->action == "compare"): ?>
- <td>
- <?php print
Sanitize::html($org_identities[0]['Name']['honorific']); ?>
- </td>
- <?php endif; ?>
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php print _txt('fd.name.given'); ?><font
class="required">*</font>
</th>
<td>
- <?php print ($e ? $this->Form->input('Name.given',
array('default' => $co_people[0]['Name']['given']))
- :
Sanitize::html($co_people[0]['Name']['given'])); ?>
+ <?php print ($e ? $this->Form->input('PrimaryName.given',
+ array('default' =>
$co_people[0]['PrimaryName']['given']))
+ :
Sanitize::html($co_people[0]['PrimaryName']['given'])); ?>
</td>
- <?php if($this->action == "compare"): ?>
- <td>
- <?php print
Sanitize::html($org_identities[0]['Name']['given']); ?>
- </td>
- <?php endif; ?>
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php print _txt('fd.name.middle'); ?>
</th>
<td>
- <?php print ($e ? $this->Form->input('Name.middle',
array('default' => $co_people[0]['Name']['middle']))
- :
Sanitize::html($co_people[0]['Name']['middle'])); ?>
+ <?php print ($e ? $this->Form->input('PrimaryName.middle',
+ array('default' =>
$co_people[0]['PrimaryName']['middle']))
+ :
Sanitize::html($co_people[0]['PrimaryName']['middle'])); ?>
</td>
- <?php if($this->action == "compare"): ?>
- <td>
- <?php print
Sanitize::html($org_identities[0]['Name']['middle']); ?>
- </td>
- <?php endif; ?>
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php print _txt('fd.name.family'); ?>
</th>
<td>
- <?php print ($e ? $this->Form->input('Name.family',
array('default' => $co_people[0]['Name']['family']))
- :
Sanitize::html($co_people[0]['Name']['family'])); ?>
+ <?php print ($e ? $this->Form->input('PrimaryName.family',
+ array('default' =>
$co_people[0]['PrimaryName']['family']))
+ :
Sanitize::html($co_people[0]['PrimaryName']['family'])); ?>
</td>
- <?php if($this->action == "compare"): ?>
- <td>
- <?php print
Sanitize::html($org_identities[0]['Name']['family']); ?>
- </td>
- <?php endif; ?>
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
@@ -331,15 +309,19 @@
?>
</th>
<td>
- <?php print ($e ? $this->Form->input('Name.suffix',
array('default' => $co_people[0]['Name']['suffix']))
- :
Sanitize::html($co_people[0]['Name']['suffix'])); ?>
+ <?php print ($e ? $this->Form->input('PrimaryName.suffix',
+ array('default' =>
$co_people[0]['PrimaryName']['suffix']))
+ :
Sanitize::html($co_people[0]['PrimaryName']['suffix'])); ?>
</td>
- <?php if($this->action == "compare"): ?>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <th>
+ <?php print _txt('fd.type'); ?>
+ </th>
<td>
- <?php print
Sanitize::html($org_identities[0]['Name']['suffix']); ?>
+ <?php print _txt('en.name', null, NameEnum::Official); ?>
</td>
- <?php endif; ?>
- </tr>
+ </tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<th>
<?php print _txt('fd.language'); ?>
@@ -349,35 +331,26 @@
global $cm_lang, $cm_texts;

$attrs = array();
- $attrs['value'] = (isset($co_people[0]['Name']['language'])
- ? $co_people[0]['Name']['language']
+ $attrs['value'] =
(isset($co_people[0]['PrimaryName']['language'])
+ ? $co_people[0]['PrimaryName']['language']
: getPreferredLanguage());
$attrs['empty'] = true;

if($e) {
- print $this->Form->select('Name.language',
+ print $this->Form->select('PrimaryName.language',
$cm_texts[ $cm_lang
]['en.language'],
$attrs);

- if($this->Form->isFieldError('Name.language')) {
- print $this->Form->error('Name.language');
+ if($this->Form->isFieldError('PrimaryName.language')) {
+ print $this->Form->error('PrimaryName.language');
}
} else {
- if(!empty($co_people[0]['Name']['language'])) {
- print _txt('en.language', null,
$co_people[0]['Name']['language']);
+ if(!empty($co_people[0]['PrimaryName']['language'])) {
+ print _txt('en.language', null,
$co_people[0]['PrimaryName']['language']);
}
}
?>
</td>
- <?php if($this->action == "compare"): ?>
- <td>
- <?php
- if(!empty($co_people[0]['Name']['language'])) {
- print
Sanitize::html($org_identities[0]['Name']['language']);
- }
- ?>
- </td>
- <?php endif; ?>
</tr>
<tr>
<th>
@@ -386,13 +359,118 @@
<td>
<?php
if($e) {
- echo $this->Form->submit($submit_label);
+ print $this->Form->submit($submit_label);
print $this->Form->button(_txt('op.reset'),
array('type'=>'reset'));
}
?>
</td>
</tr>
+ <?php elseif($this->action == "compare"): ?>
+ <!-- Simply list the org names and then the CO names -->
+ <tr>
+ <th class="ui-widget-header"><?php print
Sanitize::html($cur_co['Co']['name']); ?></th>
+ </tr>
+ <?php foreach($co_people[0]['Name'] as $n): ?>
+ <tr>
+ <td>
+ <?php
+ print generateCn($n)
+ . " ("
+ . ($n['primary_name'] ? (_txt('fd.name.primary') . ",
") : "")
+ . _txt('en.name', null, $n['type'])
+ . (!empty($n['language']) ? (", " .
_txt('en.language', null, $n['language'])) : "")
+ . ")";
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ <tr>
+ <th class="ui-widget-header"><?php print
(!empty($org_identities[0]['OrgIdentity']['o']) ?
Sanitize::html($org_identities[0]['OrgIdentity']['o']) : _txt('fd.o'));
?></th>
+ </tr>
+ <?php foreach($org_identities[0]['Name'] as $n): ?>
+ <tr>
+ <td>
+ <?php
+ print generateCn($n)
+ . " ("
+ . ($n['primary_name'] ? (_txt('fd.name.primary') . ",
") : "")
+ . _txt('en.name', null, $n['type'])
+ . (!empty($n['language']) ? (", " .
_txt('en.language', null, $n['language'])) : "")
+ . ")";
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ <?php else: // invite/compare ?>
+ <?php foreach($co_people[0]['Name'] as $n): ?>
+ <div>
+ <div>
+ <?php
+ if($e) {
+ print $this->Html->link(generateCn($n),
+ array('controller' => 'names',
+ 'action' => 'edit',
+ $n['id'],
+ 'co' =>
$cur_co['Co']['id']));
+ } else {
+ print generateCn($n);
+ }
+
+ print " ("
+ . ($n['primary_name'] ? (_txt('fd.name.primary') . ",
") : "")
+ . _txt('en.name', null, $n['type'])
+ . (!empty($n['language']) ? (", " .
_txt('en.language', null, $n['language'])) : "")
+ . ")";
+ ?>
+ </div>
+ <div>
+ <?php
+ if($e) {
+ if(!$n['primary_name']) {
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($n))) . '\', \'' .
$this->Html->url(array('controller' => 'names', 'action' => 'delete',
$n['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' . _txt('op.delete')
.'</a>' . "\n";
+
+ print $this->Html->link(_txt('op.primary'),
+ array('controller' => 'names',
+ 'action' => 'primary',
+ $n['id'],
+ 'copersonid' =>
$co_people[0]['CoPerson']['id'],
+ 'co' =>
$cur_co['Co']['id']),
+ array('class' =>
'primarybutton')) . "\n";
+ }
+
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' => 'names',
+ 'action' => 'edit',
+ $n['id'],
+ 'co' => $cur_co['Co']['id']),
+ array('class' => 'editbutton')) .
"\n";
+ }
+ ?>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ <?php if($e): ?>
+ <div>
+ <div>
+ <?php print _txt('fd.name'); ?>
+ </div>
+ <div>
+ <?php
+ $linktarget = array('controller' => 'names',
+ 'action' => 'add',
+ 'copersonid' =>
$co_people[0]['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']);
+ $linkparams = array('class' => 'addbutton');
+
+ print $this->Html->link(_txt('op.add'),
+ $linktarget,
+ $linkparams);
+ ?>
+ </div>
+ </div>
+ <?php endif; // e ?>
+ <?php endif; // invite ?>
</table>
<div style="clear:both;"></div>
</div> <!-- tabs-name -->
@@ -668,7 +746,7 @@
'co' => $cur_co['Co']['id']
);
$linkparams = array('class' => 'addbutton');
- print $this->Html->link(_txt('op.add'),
+ print $this->Html->link(_txt('op.manage.grm'),
$linktarget,
$linkparams) . "\n";
}
@@ -774,7 +852,7 @@
array('controller'
=> 'co_person_roles', 'action' => 'edit', $r['id'], 'co' =>
$cur_co['Co']['id']),
array('class' =>
'editbutton')) . "\n";
if($permissions['delete'])
- print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($co_people[0]['Name']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_person_roles', 'action' =>
'delete', $r['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' .
_txt('op.delete') . '</a>' . "\n";
+ print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($co_people[0]['PrimaryName']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_person_roles', 'action' =>
'delete', $r['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' .
_txt('op.delete') . '</a>' . "\n";
} elseif($permissions['view']) {
print $this->Html->link(_txt('op.view'),
array('controller' =>
'co_person_roles', 'action' => 'view', $r['id'], 'co' => $cur_co['Co']['id']),

Modified: registry/trunk/app/View/CoPeople/index.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/index.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoPeople/index.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -176,7 +176,7 @@

<div id = "sorter">
<div>Sort By:</div>
- <div><?php print $this->Paginator->sort('Name.family', _txt('fd.name'));
?> </div>
+ <div><?php print $this->Paginator->sort('PrimaryName.family',
_txt('fd.name')); ?> </div>
<div><?php print $this->Paginator->sort('status', _txt('fd.status')); ?>
</div>
<div><?php print $this->Paginator->sort('created', _txt('fd.created')); ?>
</div>
<div><?php print $this->Paginator->sort('modified', _txt('fd.modified'));
?> </div>
@@ -189,7 +189,7 @@
<div class = "panel1">
<div class="name">
<?php
- print $this->Html->link(generateCn($p['Name']),
+ print $this->Html->link(generateCn($p['PrimaryName']),
array(
'controller' => 'co_people',
'action' => ($permissions['edit']
@@ -255,7 +255,7 @@
print '<button class="deletebutton" title="'
. _txt('op.delete')
. '"
onclick="javascript:noprop(event);js_confirm_delete(\''
- . _jtxt(Sanitize::html(generateCn($p['Name'])))
+ . _jtxt(Sanitize::html(generateCn($p['PrimaryName'])))
. '\', \''
. $this->Html->url(array('controller' => 'co_people',
'action' => 'delete',
@@ -272,7 +272,7 @@
print '<button class="invitebutton" title="'
. _txt('op.inv.resend')
. '"
onclick="javascript:noprop(event);js_confirm_reinvite(\''
- . _jtxt(Sanitize::html(generateCn($p['Name'])))
+ . _jtxt(Sanitize::html(generateCn($p['PrimaryName'])))
. '\', \''
. $this->Html->url(array('controller' => 'co_invites',
'action' => 'send',

Modified: registry/trunk/app/View/CoPeople/invite.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/invite.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoPeople/invite.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Person Invite View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2010-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -23,8 +23,7 @@
*/
-->
<?php
- $params = array('title' => _txt('op.inv-t',
array(Sanitize::html(generateCn($co_people[0]['Name'])),
Sanitize::html($cur_co['Co']['name']))));
- print $this->element("pageTitle", $params);
+ print $this->element("pageTitle", array('title' => $title_for_layout));

$submit_label = _txt('op.inv.send');
echo $this->Form->create('CoPerson',

Modified: registry/trunk/app/View/CoPeople/match.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/match.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/CoPeople/match.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Person Match View
*
- * Copyright (C) 2012 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2012-3 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2012 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2012-3 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.5
@@ -30,7 +30,7 @@
foreach ($matches as $m) {
print "<li>";
print $this->Html->link(
- generateCn($m['Name']),
+ generateCn($m['PrimaryName']),
array('controller' => 'co_people', 'action' => 'edit',
$m['CoPerson']['id'], 'co' => $m['CoPerson']['co_id'])
);
if(isset($m['CoPersonRole'][0])) {

Modified: registry/trunk/app/View/CoPeople/provision.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/provision.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/CoPeople/provision.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -23,7 +23,7 @@
*/
-->
<?php
- $params = array('title' => _txt('fd.prov.status.for',
array(generateCn($co_person['Name']))));
+ $params = array('title' => _txt('fd.prov.status.for',
array(generateCn($co_person['PrimaryName']))));
print $this->element("pageTitle", $params);
?>
<script type="text/javascript">

Modified: registry/trunk/app/View/CoPersonRoles/index.ctp
===================================================================
--- registry/trunk/app/View/CoPersonRoles/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/CoPersonRoles/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Person Index View
*
- * Copyright (C) 2011-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2011-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -42,7 +42,7 @@
<table id="co_person_roles" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('Name.family', _txt('fd.name'));
?></th>
+ <th><?php echo $this->Paginator->sort('PrimaryName.family',
_txt('fd.name')); ?></th>
<th><?php echo $this->Paginator->sort('o', _txt('fd.o')); ?></th>
<th><?php echo $this->Paginator->sort('Cou.ou', _txt('fd.cou'));
?></th>
<th><?php echo $this->Paginator->sort('title', _txt('fd.title'));
?></th>
@@ -58,7 +58,7 @@
<?php $i = 0; ?>
<?php foreach ($co_person_roles as $p): ?>
<tr class="line<?php print ($i % 2)+1; ?>">
- <td><?php echo $this->Html->link(generateCn($p['Name']),
+ <td><?php echo $this->Html->link(generateCn($p['PrimaryName']),
array('controller' =>
'co_person_roles', 'action' => ($permissions['edit'] ? 'edit' :
($permissions['view'] ? 'view' : '')), $p['CoPersonRole']['id'], 'co' =>
$cur_co['Co']['id'])); ?></td>
<td><?php echo Sanitize::html($p['CoPersonRole']['o']); ?></td>
<td><?php if(isset($p['CoPersonRole']['Cou']['name'])) echo
Sanitize::html($p['CoPersonRole']['Cou']['name']); ?></td>
@@ -86,10 +86,10 @@
array('class' => 'editbutton')) . "\n";

if($permissions['delete'])
- echo '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($p['Name']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_person_roles', 'action' =>
'delete', $p['CoPersonRole']['id'], 'co' => $cur_co['Co']['id'])) . '\')";>'
. _txt('op.delete') . '</button>' . "\n";
+ echo '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($p['PrimaryName']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_person_roles', 'action' =>
'delete', $p['CoPersonRole']['id'], 'co' => $cur_co['Co']['id'])) . '\')";>'
. _txt('op.delete') . '</button>' . "\n";

if($permissions['invite'] && ($p['CoPersonRole']['status'] != 'A'
&& $p['CoPersonRole']['status'] != 'D'))
- echo '<button class="invitebutton" title="' .
_txt('op.inv.resend') . '" onclick="javascript:js_confirm_reinvite(\'' .
_jtxt(Sanitize::html(generateCn($p['Name']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_invites', 'action' => 'send',
'copersonroleid' => $p['CoPersonRole']['id'], 'co' => $cur_co['Co']['id'])) .
'\')";>' . _txt('op.inv.resend') . '</button>' . "\n";
+ echo '<button class="invitebutton" title="' .
_txt('op.inv.resend') . '" onclick="javascript:js_confirm_reinvite(\'' .
_jtxt(Sanitize::html(generateCn($p['PrimaryName']))) . '\', \'' .
$this->Html->url(array('controller' => 'co_invites', 'action' => 'send',
'copersonroleid' => $p['CoPersonRole']['id'], 'co' => $cur_co['Co']['id'])) .
'\')";>' . _txt('op.inv.resend') . '</button>' . "\n";
?>
<?php ; ?>
</td>

Modified: registry/trunk/app/View/CoPetitions/fields.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/fields.inc 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/CoPetitions/fields.inc 2013-10-22 03:21:21
UTC (rev 622)
@@ -23,6 +23,9 @@
*/
-->
<script type="text/javascript">
+var givenNameAttr = "";
+var familyNameAttr = "";
+
$(document).ready(function() {
$("input.matchable").keyup(function(event) {
if(event.which != 13) {
@@ -31,8 +34,8 @@
$.ajax({
url: '/registry/co_people/match/co:<?php print $cur_co['Co']['id'];
?>'
+ '/coef:' + <?php print
Sanitize::html($co_enrollment_flow_id); ?>
- + '/given:' +
document.getElementById('EnrolleeCoPersonNameGiven').value
- + '/family:' +
document.getElementById('EnrolleeCoPersonNameFamily').value
+ + '/given:' + document.getElementById(givenNameAttr).value
+ + '/family:' + document.getElementById(familyNameAttr).value
}).done(function(data) {
$('div#results').html(data);
});

Modified: registry/trunk/app/View/CoPetitions/index.ctp
===================================================================
--- registry/trunk/app/View/CoPetitions/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/CoPetitions/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -132,7 +132,7 @@
<tr class="line<?php print ($i % 2)+1; ?>">
<td>
<?php
- print $this->Html->link(generateCn($p['EnrolleeCoPerson']['Name']),
+ print
$this->Html->link(generateCn($p['EnrolleeCoPerson']['PrimaryName']),
array(
'controller' => 'co_petitions',
'action' => ($permissions['edit']
@@ -147,7 +147,7 @@
<td>
<?php
if(isset($p['PetitionerCoPerson']['id']) &&
$p['PetitionerCoPerson']['id'] != '') {
- print
$this->Html->link(generateCn($p['PetitionerCoPerson']['Name']),
+ print
$this->Html->link(generateCn($p['PetitionerCoPerson']['PrimaryName']),
array(
'controller' => 'co_people',
'action' => 'view',
@@ -160,7 +160,7 @@
<td>
<?php
if(isset($p['SponsorCoPerson']['id']) &&
$p['SponsorCoPerson']['id'] != '') {
- print
$this->Html->link(generateCn($p['SponsorCoPerson']['Name']),
+ print
$this->Html->link(generateCn($p['SponsorCoPerson']['PrimaryName']),
array(
'controller' => 'co_people',
'action' => 'view',
@@ -173,7 +173,7 @@
<td>
<?php
if(isset($p['ApproverCoPerson']['id']) &&
$p['ApproverCoPerson']['id'] != '') {
- print
$this->Html->link(generateCn($p['ApproverCoPerson']['Name']),
+ print
$this->Html->link(generateCn($p['ApproverCoPerson']['PrimaryName']),
array(
'controller' => 'co_people',
'action' => 'view',

Modified: registry/trunk/app/View/CoPetitions/petition-attributes.inc
===================================================================
--- registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-10-21
22:38:36 UTC (rev 621)
+++ registry/trunk/app/View/CoPetitions/petition-attributes.inc 2013-10-22
03:21:21 UTC (rev 622)
@@ -29,6 +29,10 @@

// Are there T&C to agree to?
$tandc = !empty($vv_terms_and_conditions);
+
+ // Track the names of the matching fields and emit them later
+ $givenNameAttr = "";
+ $familyNameAttr = "";
?>

<style>
@@ -307,11 +311,21 @@
}

if($permissions['match']
- && ($fieldName == 'EnrolleeCoPerson.Name.given'
- || $fieldName ==
'EnrolleeCoPerson.Name.family')) {
+ // For now, match only on CO Person Official Name.
+ // (We can only have one name field match because
of how the
+ // javascript keyup triggered code works.)
+ && strcmp($ea['attribute'], 'p:name:O')==0
+ && ($ea['field'] == 'given'
+ || $ea['field'] == 'family')) {
# XXX Temp hack to enable real-time query. This
should
# instead be enabled for fields with an appropriate
flag.
$args['class'] = 'matchable';
+
+ if($ea['field'] == 'given') {
+ $givenNameAttr = preg_replace('/\./', '',
$ea['model']) . "Given";
+ } elseif($ea['field'] == 'family') {
+ $familyNameAttr = preg_replace('/\./', '',
$ea['model']) . "Family";
+ }
}

print $this->Form->input($fieldName, $args);
@@ -440,4 +454,9 @@
<div id="dialog-review" title="<?php print
_txt('ct.co_terms_and_conditions.1'); ?>">
<iframe id="tandc_content" height="600" width="700">
</iframe>
-</div>
\ No newline at end of file
+</div>
+
+<script type="text/javascript">
+ givenNameAttr = <?php print '"' . $givenNameAttr . '"'; ?>;
+ familyNameAttr = <?php print '"' . $familyNameAttr . '"'; ?>;
+</script>
\ No newline at end of file

Modified: registry/trunk/app/View/EmailAddresses/index.ctp
===================================================================
--- registry/trunk/app/View/EmailAddresses/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/EmailAddresses/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Email Address Index View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -33,8 +33,8 @@
<th><?php echo $this->Paginator->sort('email',
_txt('fd.email_address.mail')); ?></th>
<th><?php echo $this->Paginator->sort('type', _txt('fd.type')); ?></th>
<!-- XXX Following needs to be I18N'd, and also render a full name, if
index view sticks around -->
- <th><?php echo $this->Paginator->sort('OrgIdentity.Name.family', 'Org
Identity'); ?></th>
- <th><?php echo $this->Paginator->sort('CoPerson.Name.family', 'CO
Person'); ?></th>
+ <th><?php echo
$this->Paginator->sort('OrgIdentity.PrimaryName.family', 'Org Identity');
?></th>
+ <th><?php echo $this->Paginator->sort('CoPerson.PrimaryName.family',
'CO Person'); ?></th>
<th><?php echo _txt('fd.actions'); ?></th>
</tr>
</thead>
@@ -59,7 +59,7 @@
{
// Generally, someone who has view permission on an attribute
can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($e['OrgIdentity']['Name']),
+ echo
$this->Html->link(generateCn($e['OrgIdentity']['PrimaryName']),
array('controller' => 'org_identities',
'action' => 'view', $e['OrgIdentity']['id'])) . "\n";
}
?>
@@ -70,7 +70,7 @@
{
// Generally, someone who has view permission on an attribute
can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($e['CoPerson']['Name']),
+ echo
$this->Html->link(generateCn($e['CoPerson']['PrimaryName']),
array('controller' => 'co_people',
'action' => 'view', $e['CoPerson']['id'])) . "\n";
}
?>

Modified: registry/trunk/app/View/HistoryRecords/index.ctp
===================================================================
--- registry/trunk/app/View/HistoryRecords/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/HistoryRecords/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -32,9 +32,9 @@
<th><?php print $this->Paginator->sort('action', _txt('fd.action'));
?></th>
<th><?php print $this->Paginator->sort('created', _txt('fd.created'));
?></th>
<th><?php print $this->Paginator->sort('comment', _txt('fd.comment'));
?></th>
- <th><?php print $this->Paginator->sort('Actor.Name.family',
_txt('fd.actor')); ?></th>
- <th><?php print $this->Paginator->sort('OrgIdentity.Name.family',
_txt('ct.org_identities.1')); ?></th>
- <th><?php print $this->Paginator->sort('CoPerson.Name.family',
_txt('ct.co_people.1')); ?></th>
+ <th><?php print $this->Paginator->sort('Actor.PrimaryName.family',
_txt('fd.actor')); ?></th>
+ <th><?php print
$this->Paginator->sort('OrgIdentity.PrimaryName.family',
_txt('ct.org_identities.1')); ?></th>
+ <th><?php print $this->Paginator->sort('CoPerson.PrimaryName.family',
_txt('ct.co_people.1')); ?></th>
</tr>
</thead>

@@ -49,7 +49,7 @@
<?php
if(!empty($h['ActorCoPerson']['id'])) {
print $this->Html->link(
- generateCn($h['ActorCoPerson']['Name']),
+ generateCn($h['ActorCoPerson']['PrimaryName']),
array(
'controller' => 'co_people',
'action' => 'view',
@@ -64,7 +64,7 @@
<?php
if(!empty($h['OrgIdentity']['id'])) {
print $this->Html->link(
- generateCn($h['OrgIdentity']['Name']),
+ generateCn($h['OrgIdentity']['PrimaryName']),
array(
'controller' => 'org_identities',
'action' => 'view',
@@ -79,7 +79,7 @@
<?php
if(!empty($h['CoPerson']['id'])) {
print $this->Html->link(
- generateCn($h['CoPerson']['Name']),
+ generateCn($h['CoPerson']['PrimaryName']),
array(
'controller' => 'co_people',
'action' => 'view',

Modified: registry/trunk/app/View/Identifiers/index.ctp
===================================================================
--- registry/trunk/app/View/Identifiers/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/Identifiers/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Identifier Index View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -35,8 +35,8 @@
<th><?php echo $this->Paginator->sort('login',
_txt('fd.identifier.login')); ?></th>
<th><?php echo $this->Paginator->sort('status', _txt('fd.status'));
?></th>
<!-- XXX Following needs to be I18N'd, and also render a full name, if
index view sticks around -->
- <th><?php echo $this->Paginator->sort('OrgIdentity.Name.family', 'Org
Identity'); ?></th>
- <th><?php echo $this->Paginator->sort('CoPerson.Name.family', 'CO
Person'); ?></th>
+ <th><?php echo
$this->Paginator->sort('OrgIdentity.PrimaryName.family', 'Org Identity');
?></th>
+ <th><?php echo $this->Paginator->sort('CoPerson.PrimaryName.family',
'CO Person'); ?></th>
<th><?php echo _txt('fd.actions'); ?></th>
</tr>
</thead>
@@ -76,7 +76,7 @@
{
// Generally, someone who has view permission on an attribute
number can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($a['OrgIdentity']['Name']),
+ echo
$this->Html->link(generateCn($a['OrgIdentity']['PrimaryName']),
array('controller' => 'org_identities',
'action' => 'view', $a['OrgIdentity']['id'])) . "\n";
}
?>
@@ -87,7 +87,7 @@
{
// Generally, someone who has view permission on an attribute
can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($a['CoPerson']['Name']),
+ echo
$this->Html->link(generateCn($a['CoPerson']['PrimaryName']),
array('controller' => 'co_people',
'action' => 'view', $a['CoPerson']['id'])) . "\n";
}
?>

Modified: registry/trunk/app/View/Layouts/default.ctp
===================================================================
--- registry/trunk/app/View/Layouts/default.ctp 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/View/Layouts/default.ctp 2013-10-22 03:21:21 UTC (rev
622)
@@ -283,6 +283,13 @@
},
text: false
});
+
+ $(".primarybutton").button({
+ icons: {
+ primary: 'ui-icon-arrowthickstop-1-n'
+ },
+ text: false
+ });

$("button:reset").button();
$("button:reset").css('float', 'left');


Property changes on: registry/trunk/app/View/Names/add.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/edit.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/json/add.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/json/delete.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/json/edit.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/json/index.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/json/view.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/view.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/xml/add.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/xml/delete.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/xml/edit.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/xml/index.ctp
___________________________________________________________________
Added: svn:special
+ *


Property changes on: registry/trunk/app/View/Names/xml/view.ctp
___________________________________________________________________
Added: svn:special
+ *

Modified: registry/trunk/app/View/OrgIdentities/fields.inc
===================================================================
--- registry/trunk/app/View/OrgIdentities/fields.inc 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/OrgIdentities/fields.inc 2013-10-22 03:21:21
UTC (rev 622)
@@ -46,7 +46,6 @@
</script>

<?php
-
// Globals
global $cm_lang, $cm_texts;

@@ -137,64 +136,75 @@
<?php endif; ?>
</ul>

- <div id="tabs-name" class="ui-helper-clearfix">
+ <div id="tabs-name" class="ui-helper-clearfix additionalinfo">
<table id="<?php print $this->action; ?>_org_identity"
class="ui-widget">
<tbody>
- <tr class="line1">
+ <?php $l = 1; ?>
+ <?php if($this->action == 'add'): ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php
echo _txt('fd.name.honorific');
-
+
if($e)
echo " " . _txt('fd.name.h.desc');
?>
</td>
<td>
<?php
- echo $this->Form->hidden('Name.id');
- echo $this->Form->hidden('Name.type', array('default' =>
'O'));
- echo ($e ? $this->Form->input('Name.honorific') :
Sanitize::html($org_identities[0]['Name']['honorific']));
+ print $this->Form->hidden('PrimaryName.id');
+ print $this->Form->hidden('PrimaryName.type',
array('default' => NameEnum::Official));
+ print $this->Form->hidden('PrimaryName.primary_name',
array('default' => true));
+ print ($e ? $this->Form->input('PrimaryName.honorific') :
Sanitize::html($org_identities[0]['PrimaryName']['honorific']));
?>
</td>
</tr>
- <tr class="line2">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.name.given'); ?><font
class="required">*</font>
</td>
<td>
- <?php echo ($e ? $this->Form->input('Name.given') :
Sanitize::html($org_identities[0]['Name']['given'])); ?>
+ <?php echo ($e ? $this->Form->input('PrimaryName.given') :
Sanitize::html($org_identities[0]['PrimaryName']['given'])); ?>
</td>
</tr>
- <tr class="line1">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.name.middle'); ?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('Name.middle') :
Sanitize::html($org_identities[0]['Name']['middle'])); ?>
+ <?php echo ($e ? $this->Form->input('PrimaryName.middle') :
Sanitize::html($org_identities[0]['PrimaryName']['middle'])); ?>
</td>
- <tr class="line2">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.name.family'); ?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('Name.family') :
Sanitize::html($org_identities[0]['Name']['family'])); ?>
+ <?php echo ($e ? $this->Form->input('PrimaryName.family') :
Sanitize::html($org_identities[0]['PrimaryName']['family'])); ?>
</td>
</tr>
- <tr class="line1">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php
echo _txt('fd.name.suffix');
-
+
if($e)
echo " " . _txt('fd.name.s.desc');
?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('Name.suffix') :
Sanitize::html($org_identities[0]['Name']['suffix'])); ?>
+ <?php echo ($e ? $this->Form->input('PrimaryName.suffix') :
Sanitize::html($org_identities[0]['PrimaryName']['suffix'])); ?>
</td>
</tr>
- <tr class="line2">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
+ <?php print _txt('fd.type'); ?>
+ </td>
+ <td>
+ <?php print _txt('en.name', null, NameEnum::Official); ?>
+ </td>
+ </tr>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
+ <td>
<?php print _txt('fd.language'); ?>
</td>
<td>
@@ -202,26 +212,95 @@
global $cm_lang, $cm_texts;

$attrs = array();
- $attrs['value'] =
(isset($org_identities[0]['Name']['language'])
- ? $org_identities[0]['Name']['language']
+ $attrs['value'] =
(isset($org_identities[0]['PrimaryName']['language'])
+ ?
$org_identities[0]['PrimaryName']['language']
: getPreferredLanguage());
$attrs['empty'] = true;

if($e) {
- print $this->Form->select('Name.language',
+ print $this->Form->select('PrimaryName.language',
$cm_texts[ $cm_lang
]['en.language'],
$attrs);

- if($this->Form->isFieldError('Name.language')) {
- print $this->Form->error('Name.language');
+ if($this->Form->isFieldError('PrimaryName.language')) {
+ print $this->Form->error('PrimaryName.language');
}
} else {
- print _txt('en.language', null,
$org_identities[0]['Name']['language']);
+ print _txt('en.language', null,
$org_identities[0]['PrimaryName']['language']);
}
?>
</td>
</tr>
- <tr class="line1">
+ <?php else: // add ?>
+ <?php foreach($org_identities[0]['PrimaryName'] as $n): ?>
+ <div>
+ <div>
+ <?php
+ if($e) {
+ print $this->Html->link(generateCn($n),
+ array('controller' => 'names',
+ 'action' => 'edit',
+ $n['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
+ } else {
+ print generateCn($n);
+ }
+
+ print " ("
+ . ($n['primary_name'] ? (_txt('fd.name.primary') . ",
") : "")
+ . _txt('en.name', null, $n['type'])
+ . (!empty($n['language']) ? (", " .
_txt('en.language', null, $n['language'])) : "")
+ . ")";
+ ?>
+ </div>
+ <div>
+ <?php
+ if($e) {
+ if(!$n['primary_name']) {
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html(generateCn($n))) . '\', \'' .
$this->Html->url(array('controller' => 'names', 'action' => 'delete',
$n['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') .'</a>' . "\n";
+
+ print $this->Html->link(_txt('op.primary'),
+ array('controller' => 'names',
+ 'action' =>
'primary',
+ $n['id'],
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' =>
'primarybutton')) . "\n";
+ }
+
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' => 'names',
+ 'action' => 'edit',
+ $n['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) .
"\n";
+ }
+ ?>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ <?php if($e): ?>
+ <div>
+ <div>
+ <?php print _txt('fd.name'); ?>
+ </div>
+ <div>
+ <?php
+ $linktarget = array('controller' => 'names',
+ 'action' => 'add',
+ 'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
+ 'co' => ($pool_org_identities
? false : $cur_co['Co']['id']));
+ $linkparams = array('class' => 'addbutton');
+
+ print $this->Html->link(_txt('op.add'),
+ $linktarget,
+ $linkparams);
+ ?>
+ </div>
+ </div>
+ <?php endif; // e ?>
+ <?php endif; // add ?>
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.affiliation'); ?><font
class="required">*</font>
</td>
@@ -249,28 +328,31 @@
?>
</td>
</tr>
- <tr class="line2">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.title'); ?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('title') :
Sanitize::html($org_identities[0]['OrgIdentity']['title'])); ?>
+ <?php echo ($e ? $this->Form->input('title', array('size' =>
60))
+ :
Sanitize::html($org_identities[0]['OrgIdentity']['title'])); ?>
</td>
</tr>
- <tr class="line1">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.o'); ?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('o') :
Sanitize::html($org_identities[0]['OrgIdentity']['o'])); ?>
+ <?php echo ($e ? $this->Form->input('o', array('size' => 60))
+ :
Sanitize::html($org_identities[0]['OrgIdentity']['o'])); ?>
</td>
</tr>
- <tr class="line2">
+ <tr class="line<?php print ($l % 2); $l++; ?>">
<td>
<?php echo _txt('fd.ou'); ?>
</td>
<td>
- <?php echo ($e ? $this->Form->input('ou') :
Sanitize::html($org_identities[0]['OrgIdentity']['ou'])); ?>
+ <?php echo ($e ? $this->Form->input('ou', array('size' => 60))
+ :
Sanitize::html($org_identities[0]['OrgIdentity']['ou'])); ?>
</td>
</tr>
<tr>

Modified: registry/trunk/app/View/OrgIdentities/find.ctp
===================================================================
--- registry/trunk/app/View/OrgIdentities/find.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/OrgIdentities/find.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Org Identity Find View
*
- * Copyright (C) 2011-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2011-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.2
@@ -30,7 +30,7 @@
<table id="org_identities" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('Name.family', _txt('fd.name'));
?></th>
+ <th><?php echo $this->Paginator->sort('PrimaryName.family',
_txt('fd.name')); ?></th>
<th><?php echo $this->Paginator->sort('o', _txt('fd.o')); ?></th>
<th><?php echo $this->Paginator->sort('title', _txt('fd.title'));
?></th>
<th><?php echo $this->Paginator->sort('affiliation',
_txt('fd.affiliation')); ?></th>
@@ -43,8 +43,11 @@
<?php $i = 0; ?>
<?php foreach ($org_identities as $p): ?>
<tr class="line<?php print ($i % 2)+1; ?>">
- <td><?php echo $this->Html->link(generateCn($p['Name']),
- array('controller' => 'org_identities',
'action' => 'view', $p['OrgIdentity']['id'])); ?></td>
+ <td><?php print $this->Html->link(generateCn($p['PrimaryName']),
+ array('controller' =>
'org_identities',
+ 'action' =>
'view',
+ $p['OrgIdentity']['id'],
+ 'co' =>
($pool_org_identities ? false : $cur_co['Co']['id']))); ?></td>
<td><?php echo Sanitize::html($p['OrgIdentity']['o']); ?></td>
<td><?php echo Sanitize::html($p['OrgIdentity']['title']); ?></td>
<td><?php // Globals

Modified: registry/trunk/app/View/OrgIdentities/index.ctp
===================================================================
--- registry/trunk/app/View/OrgIdentities/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/OrgIdentities/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -56,7 +56,7 @@
<table id="org_identities" class="ui-widget" style=" width:100%;">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('Name.family', _txt('fd.name'));
?></th>
+ <th><?php echo $this->Paginator->sort('PrimaryName.family',
_txt('fd.name')); ?></th>
<th><?php echo $this->Paginator->sort('o', _txt('fd.o')); ?></th>
<th><?php echo $this->Paginator->sort('ou', _txt('fd.ou')); ?></th>
<th><?php echo $this->Paginator->sort('title', _txt('fd.title'));
?></th>
@@ -69,15 +69,19 @@
<?php $i = 0; ?>
<?php foreach ($org_identities as $p): ?>
<tr class="line<?php print ($i % 2)+1; ?>">
- <td><?php print $this->Html->link(
- generateCn($p['Name']),
+ <td>
+ <?php
+ print $this->Html->link(
+ generateCn($p['PrimaryName']),
array(
'controller' => 'org_identities',
'action' => ($permissions['edit'] ? 'edit' :
($permissions['view'] ? 'view' : '')),
$p['OrgIdentity']['id'],
'co' => ($pool_org_identities ? false :
$this->params['named']['co'])
)
- ); ?></td>
+ );
+ ?>
+ </td>
<td><?php echo Sanitize::html($p['OrgIdentity']['o']); ?></td>
<td><?php echo Sanitize::html($p['OrgIdentity']['ou']); ?></td>
<td><?php echo Sanitize::html($p['OrgIdentity']['title']); ?></td>
@@ -98,7 +102,7 @@
) . "\n";

if($permissions['delete'])
- echo '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
Sanitize::html(generateCn($p['Name'])) . '\', \'' .
$this->Html->url(array('controller' => 'org_identities', 'action' =>
'delete', $p['OrgIdentity']['id'], 'co' => ($pool_org_identities ? false :
$this->request->params['named']['co']))) . '\')";>' . _txt('op.delete') .
'</button>';
+ echo '<button class="deletebutton" title="' . _txt('op.delete')
. '" onclick="javascript:js_confirm_delete(\'' .
Sanitize::html(generateCn($p['PrimaryName'])) . '\', \'' .
$this->Html->url(array('controller' => 'org_identities', 'action' =>
'delete', $p['OrgIdentity']['id'], 'co' => ($pool_org_identities ? false :
$this->request->params['named']['co']))) . '\')";>' . _txt('op.delete') .
'</button>';
?>
<?php ; ?>
</td>

Modified: registry/trunk/app/View/TelephoneNumbers/index.ctp
===================================================================
--- registry/trunk/app/View/TelephoneNumbers/index.ctp 2013-10-21 22:38:36
UTC (rev 621)
+++ registry/trunk/app/View/TelephoneNumbers/index.ctp 2013-10-22 03:21:21
UTC (rev 622)
@@ -2,7 +2,7 @@
/**
* COmanage Registry Telephone Number Index View
*
- * Copyright (C) 2010-12 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
*
- * @copyright Copyright (C) 2011-12 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-13 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -33,8 +33,8 @@
<th><?php echo $this->Paginator->sort('number',
_txt('fd.telephone_number.number')); ?></th>
<th><?php echo $this->Paginator->sort('type', _txt('fd.type')); ?></th>
<!-- XXX Following needs to be I18N'd, and also render a full name, if
index view sticks around -->
- <th><?php echo $this->Paginator->sort('OrgIdentity.Name.family', 'Org
Identity'); ?></th>
- <th><?php echo $this->Paginator->sort('CoPersonRole.Name.family', 'CO
Person Role'); ?></th>
+ <th><?php echo
$this->Paginator->sort('OrgIdentity.PrimaryName.family', 'Org Identity');
?></th>
+ <th><?php echo
$this->Paginator->sort('CoPersonRole.PrimaryName.family', 'CO Person Role');
?></th>
<th><?php echo _txt('fd.actions'); ?></th>
</tr>
</thead>
@@ -59,7 +59,7 @@
{
// Generally, someone who has view permission on a telephone
number can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($t['OrgIdentity']['Name']),
+ echo
$this->Html->link(generateCn($t['OrgIdentity']['PrimaryName']),
array('controller' => 'org_identities',
'action' => 'view', $t['OrgIdentity']['id'])) . "\n";
}
?>
@@ -70,7 +70,7 @@
{
// Generally, someone who has view permission on a telephone
number can also see a person
if($permissions['view'])
- echo $this->Html->link(generateCn($t['CoPersonRole']['Name']),
+ echo
$this->Html->link(generateCn($t['CoPersonRole']['PrimaryName']),
array('controller' =>
'co_person_roles', 'action' => 'view', $t['CoPersonRole']['id'])) . "\n";
}
?>

Modified: registry/trunk/app/webroot/css/comanage.css
===================================================================
--- registry/trunk/app/webroot/css/comanage.css 2013-10-21 22:38:36 UTC (rev
621)
+++ registry/trunk/app/webroot/css/comanage.css 2013-10-22 03:21:21 UTC (rev
622)
@@ -4,7 +4,7 @@
* Version: $Revision: 111 $
* Date: $Date: 2011-11-01 10:05:17 -0700 (Tue, 01 Nov 2011) $
*
- * Copyright (C) 2010-2012 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -178,6 +178,7 @@
font-size:14px;
}

+/* XXX why are these here? they mess up invite form rendering
#CoPersonAddForm {
padding: 10px;
margin:10px;
@@ -191,7 +192,7 @@
#CoPersonAddForm input {
float:right;
}
-
+*/
/* 2-column layout */
.twocolumn{
border: solid gray 2px;



  • [comanage-dev] r622 - in registry/trunk/app: Config Config/Schema Console/Command Controller Lib Model Model/Behavior Plugin/LdapProvisioner/Model View View/Addresses View/CoGroupMembers View/CoGroups View/CoInvites View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/HistoryRecords View/Identifiers View/Layouts View/Names View/Names/json View/Names/xml View/OrgIdentities View/TelephoneNumbers webroot/css, svnlog, 10/21/2013

Archive powered by MHonArc 2.6.16.

Top of Page