Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r266 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/Addresses View/CmpEnrollmentConfigurations View/CoEnrollmentAttributes View/CoEnrollmentFlows View/CoExtendedAttributes View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/Identifiers View/Layouts View/OrgIdentities View/TelephoneNumbers

Subject: COmanage Developers List

List archive

[comanage-dev] r266 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/Addresses View/CmpEnrollmentConfigurations View/CoEnrollmentAttributes View/CoEnrollmentFlows View/CoExtendedAttributes View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/Identifiers View/Layouts View/OrgIdentities View/TelephoneNumbers


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r266 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/Addresses View/CmpEnrollmentConfigurations View/CoEnrollmentAttributes View/CoEnrollmentFlows View/CoExtendedAttributes View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/Identifiers View/Layouts View/OrgIdentities View/TelephoneNumbers
  • Date: Tue, 20 Mar 2012 18:13:01 -0400

Author: benno
Date: 2012-03-20 18:13:01 -0400 (Tue, 20 Mar 2012)
New Revision: 266

Added:
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/Model/AppModel.php
registry/trunk/app/View/CoEnrollmentFlows/select.ctp
registry/trunk/app/View/CoPetitions/
registry/trunk/app/View/CoPetitions/add.ctp
registry/trunk/app/View/CoPetitions/fields.inc
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Config/bootstrap.php
registry/trunk/app/Controller/CoEnrollmentAttributesController.php
registry/trunk/app/Controller/CoEnrollmentFlowsController.php
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/Controller/CousController.php
registry/trunk/app/Lib/enum.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/Model/Address.php
registry/trunk/app/Model/CmpEnrollmentConfiguration.php
registry/trunk/app/Model/Co.php
registry/trunk/app/Model/CoEnrollmentAttribute.php
registry/trunk/app/Model/CoEnrollmentFlow.php
registry/trunk/app/Model/CoExtendedAttribute.php
registry/trunk/app/Model/CoPersonRole.php
registry/trunk/app/Model/CoPetition.php
registry/trunk/app/Model/EmailAddress.php
registry/trunk/app/Model/Identifier.php
registry/trunk/app/Model/Name.php
registry/trunk/app/Model/OrgIdentity.php
registry/trunk/app/Model/TelephoneNumber.php
registry/trunk/app/View/Addresses/fields.inc
registry/trunk/app/View/Addresses/index.ctp
registry/trunk/app/View/CmpEnrollmentConfigurations/fields.inc
registry/trunk/app/View/CoEnrollmentAttributes/fields.inc
registry/trunk/app/View/CoEnrollmentFlows/fields.inc
registry/trunk/app/View/CoExtendedAttributes/fields.inc
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/CoPeople/index.ctp
registry/trunk/app/View/CoPersonRoles/fields.inc
registry/trunk/app/View/EmailAddresses/fields.inc
registry/trunk/app/View/EmailAddresses/index.ctp
registry/trunk/app/View/Identifiers/fields.inc
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/fields.inc
registry/trunk/app/View/TelephoneNumbers/index.ctp
Log:
Partial commit for enrollment petitions [CO-177, CO-208]

Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Config/Schema/schema.xml 2012-03-20 22:13:01 UTC (rev
266)
@@ -441,6 +441,7 @@
<field name="admin_require_authn" type="L" />
<field name="attrs_from_ldap" type="L" />
<field name="attrs_from_saml" type="L" />
+ <field name="attrs_from_coef" type="L" />
<field name="pool_org_identities" type="L" />
<field name="status" type="C" size="2" />
<field name="created" type="T" />

Modified: registry/trunk/app/Config/bootstrap.php
===================================================================
--- registry/trunk/app/Config/bootstrap.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Config/bootstrap.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -69,4 +69,4 @@

include APP."Lib/enum.php";
include APP."Lib/lang.php";
-include APP."Lib/util.php";
\ No newline at end of file
+include APP."Lib/util.php";

Modified: registry/trunk/app/Controller/CoEnrollmentAttributesController.php
===================================================================
--- registry/trunk/app/Controller/CoEnrollmentAttributesController.php
2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Controller/CoEnrollmentAttributesController.php
2012-03-20 22:13:01 UTC (rev 266)
@@ -49,16 +49,20 @@
function add() {
if(!empty($this->request->data) &&
(!isset($this->request->data['CoEnrollmentAttribute']['ordr'])
- || $this->request->data['CoEnrollmentAttribute']['ordr'] == ''))
- {
- $args['fields'][] = "MAX(ordr)+1 as m";
+ || $this->request->data['CoEnrollmentAttribute']['ordr'] == '')) {
+ $args['fields'][] = "MAX(ordr) as m";
+ $args['conditions']['CoEnrollmentAttribute.co_enrollment_flow_id'] =
Sanitize::paranoid($this->request->data['CoEnrollmentAttribute']['co_enrollment_flow_id']);
$args['order'][] = "m";

$o = $this->CoEnrollmentAttribute->find('first', $args);
+ $n = 1;

- // XXX this is broken in Cake 2
+ if(!empty($o)) {
+ $n = $o[0]['m'] + 1;
+ }
+
if(!empty($o))
- $this->data['CoEnrollmentAttribute']['ordr'] = $o[0]['m'];
+ $this->request->data['CoEnrollmentAttribute']['ordr'] = $n;
}

parent::add();

Modified: registry/trunk/app/Controller/CoEnrollmentFlowsController.php
===================================================================
--- registry/trunk/app/Controller/CoEnrollmentFlowsController.php
2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Controller/CoEnrollmentFlowsController.php
2012-03-20 22:13:01 UTC (rev 266)
@@ -68,6 +68,9 @@
// View all existing CO Enrollment Flows?
$p['index'] = ($cmr['cmadmin'] || $cmr['coadmin']);

+ // Select a CO Enrollment Flow to create a petition from?
+ $p['select'] = ($cmr['cmadmin'] || $cmr['coadmin'] ||
!empty($cmr['couadmin']));
+
// View an existing CO Enrollment Flow?
$p['view'] = ($cmr['cmadmin'] || $cmr['coadmin']);

@@ -93,4 +96,22 @@
else
parent::performRedirect();
}
+
+ /**
+ * Select an enrollment flow to create a petition from.
+ * - postcondition: $co_enrollment_flows set
+ *
+ * @since COmanage Registry v0.5
+ */
+
+ function select() {
+ // Determine the Enrollment Flows for this CO and pass them to the view.
+ // Currently, we don't check for COU-specific flows.
+
+ // Set page title
+ $this->set('title_for_layout', _txt('ct.co_enrollment_flows.pl'));
+
+ $this->paginate['conditions']['CoEnrollmentFlow.co_id'] =
$this->cur_co['Co']['id'];
+ $this->set('co_enrollment_flows', $this->paginate('CoEnrollmentFlow'));
+ }
}

Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2012-03-20
22:11:16 UTC (rev 265)
+++ registry/trunk/app/Controller/CoPeopleController.php 2012-03-20
22:13:01 UTC (rev 266)
@@ -86,6 +86,24 @@
}

/**
+ * Callback before views are rendered.
+ * - postcondition: $co_enrollment_flows set
+ *
+ * @since COmanage Registry v0.5
+ */
+
+ function beforeRender() {
+ // Determine if there are any Enrollment Flows for this CO and if so pass
+ // them to the view. Currently, we don't check for COU-specific flows.
+
+ $args['conditions']['CoEnrollmentFlow.co_id'] =
$this->cur_co['Co']['id'];
+// $args['contain'][] = 'CoEnrollmentFlow';
+
+ $this->loadModel('CoEnrollmentFlow');
+ $this->set('co_enrollment_flows', $this->CoEnrollmentFlow->find('all',
$args));
+ }
+
+ /**
* Perform any dependency checks required prior to a delete operation.
* - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
*
@@ -119,7 +137,7 @@
// At the moment, we're unlikely to get here since REST authz is
// currently all or nothing.

- $this->restResultHeader(403, "CouPerson Exists In Unowned COU");
+ $this->restResultHeader(499, "CouPerson Exists In Unowned COU");
}

$this->Session->setFlash(_txt('er.coumember',
@@ -140,7 +158,7 @@

if(!empty($curdata['CoPersonRole'])) {
if($this->restful)
- $this->restResultHeader(403, "CoPersonRole Exists");
+ $this->restResultHeader(499, "CoPersonRole Exists");
else
$this->Session->setFlash(_txt('er.copr.exists',
array(generateCn($curdata['Name']))),

Modified: registry/trunk/app/Controller/CousController.php
===================================================================
--- registry/trunk/app/Controller/CousController.php 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/Controller/CousController.php 2012-03-20 22:13:01
UTC (rev 266)
@@ -63,8 +63,6 @@

$this->set('parent_options', $options);
}
-
- parent::beforeRender();
}

/**

Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Lib/enum.php 2012-03-20 22:13:01 UTC (rev 266)
@@ -53,13 +53,6 @@
const LibraryWalkIn = 'L';
}

-class NSFCitizenshipEnum
-{
- const USCitizen = 'US';
- const USPermanentResident = 'P';
- const Other = 'O';
-}
-
class ContactEnum
{
const Fax = 'F';
@@ -88,6 +81,19 @@
);*/
}

+class ExtendedAttributeEnum {
+ const Integer = 'INTEGER';
+ const Timestamp = 'TIMESTAMP';
+ const Varchar32 = 'VARCHAR(32)';
+}
+
+class NSFCitizenshipEnum
+{
+ const USCitizen = 'US';
+ const USPermanentResident = 'P';
+ const Other = 'O';
+}
+
class NSFDisabilityEnum
{
const Hearing = 'H';
@@ -187,7 +193,9 @@
class StatusEnum
{
const Active = 'A';
+ const Approved = 'Y';
const Deleted = 'D';
+ const Denied = 'N';
const Invited = 'I';
const Pending = 'P';
const Suspended = 'S';
@@ -214,7 +222,8 @@

// Old style enums below, deprecated
// In order to switch away from them, AppController::convertRestPost
-// and checkRestPost must be rewritten
+// and checkRestPost must be rewritten, as well as
Model/CoEnrollmentAttribute::enrollmentFlowAttributes.
+// See also new use of Model::validEnumsForSelect.

global $affil_t, $affil_ti;
global $contact_t, $contact_ti;
@@ -311,16 +320,20 @@
'A' => 'Active',
'D' => 'Deleted',
'I' => 'Invited',
+ 'N' => 'Denied',
'P' => 'Pending',
'S' => 'Suspended',
- 'X' => 'Declined'
+ 'X' => 'Declined',
+ 'Y' => 'Approved'
);

$status_ti = array(
'Active' => 'A',
'Deleted' => 'D',
'Invited' => 'I',
+ 'Denied' => 'N',
'Pending' => 'P',
'Suspended' => 'S',
- 'Declined' => 'X'
+ 'Declined' => 'X',
+ 'Approved' => 'Y'
);

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Lib/lang.php 2012-03-20 22:13:01 UTC (rev 266)
@@ -75,6 +75,8 @@
'ct.co_people.pl' => 'CO People',
'ct.co_person_roles.1' => 'CO Person Role',
'ct.co_person_roles.pl' => 'CO Person Roles',
+ 'ct.co_petitions.1' => 'CO Petition',
+ 'ct.co_petitions.pl' => 'CO Petitions',
'ct.cos.1' => 'CO',
'ct.cos.pl' => 'COs',
'ct.cous.1' => 'COU',
@@ -126,9 +128,9 @@
ContactEnum::Mobile => 'Mobile',
ContactEnum::Office => 'Office'),

- 'en.extattr' => array('INTEGER' => 'Integer',
- 'TIMESTAMP' => 'Timestamp',
- 'VARCHAR(32)' => 'String (32)'),
+ 'en.extattr' => array(ExtendedAttributeEnum::Integer => 'Integer',
+ ExtendedAttributeEnum::Timestamp => 'Timestamp',
+ ExtendedAttributeEnum::Varchar32 => 'String
(32)'),

'en.identifier' => array(IdentifierEnum::ePPN => 'ePPN',
IdentifierEnum::ePTID => 'ePTID',
@@ -145,12 +147,13 @@
RequiredEnum::Optional => 'Optional',
RequiredEnum::NotPermitted => 'Not Permitted'),

- 'en.status' => array('A' => 'Active',
- 'D' => 'Deleted',
- 'I' => 'Invited',
- 'P' => 'Pending',
- 'S' => 'Suspended',
- 'X' => 'Declined'),
+ 'en.status' => array(StatusEnum::Active => 'Active',
+ StatusEnum::Approved => 'Approved',
+ StatusEnum::Declined => 'Declined',
+ StatusEnum::Denied => 'Denied',
+ StatusEnum::Invited => 'Invited',
+ StatusEnum::Pending => 'Pending',
+ StatusEnum::Suspended => 'Suspended'),

// Demographics
'en.nsf.gender' => array(NSFGenderEnum::Male => 'Male',
@@ -192,6 +195,7 @@
'er.co.none' => 'No COs found (did you run setup.php?)',
'er.co.unk' => 'Unknown CO',
'er.co.unk-a' => 'Unknown CO "%1$s"',
+ 'er.coef.unk' => 'Unknown CO Enrollment Flow',
'er.comember' => '%1$s is a member of one or more COs (%2$s) and cannot
be removed.',
'er.coumember' => '%1$s is a member of one or more COUs that you do not
manage (%2$s) and cannot be removed.',
'er.cop.member' => '%1$s is already a member of %2$s and cannot be added
again. However, an additional role may be added.',
@@ -242,8 +246,13 @@
// Fields
'fd.actions' => 'Actions',
'fd.address' => 'Address',
- 'fd.address.1' => 'Address Line 1',
- 'fd.address.2' => 'Address Line 2',
+ // The next set must be named fd.model.validation-field
+ 'fd.address.country' => 'Country',
+ 'fd.address.line1' => 'Address Line 1',
+ 'fd.address.line2' => 'Address Line 2',
+ 'fd.address.locality' => 'City',
+ 'fd.address.postal_code' => 'ZIP/Postal Code',
+ 'fd.address.state' => 'State',
'fd.admin' => 'Administrator',
'fd.affiliation' => 'Affiliation',
'fd.an.desc' => 'Alphanumeric characters only',
@@ -253,10 +262,8 @@
'fd.attrs.cop' => 'Person Attributes',
'fd.attrs.copr' => 'Role Attributes',
'fd.attrs.org' => 'Organizational Attributes',
- 'fd.city' => 'City',
'fd.closed' => 'Closed',
'fd.cou' => 'COU',
- 'fd.country' => 'Country',
// Demographics fields
'fd.de.persid' => 'Person ID',
'fd.de.gender' => 'Gender',
@@ -283,6 +290,8 @@
'fd.ef.appr' => 'Require Approval For Enrollment',
'fd.ef.appr.desc' => 'If administrator approval is required, a member of
the appropriate <tt>admin.approvers</tt> group must approve the enrollment',
'fd.ef.cf.cmp' => 'Platform Enrollment Configuration',
+ 'fd.ef.coef' => 'Enable Attributes Via CO Enrollment Flow',
+ 'fd.ef.coef.desc' => 'If enabled, allow organizational identity attributes
to be collected via forms during CO enrollment flows (these attributes will
be less authoritative than those obtained via LDAP or SAML)',
'fd.ef.epx' => 'Early Provisioning Executable',
'fd.ef.epx.desc' => '(Need for this TBD)',
'fd.ef.ldap' => 'Enable LDAP Attribute Retrieval',
@@ -306,28 +315,31 @@
'fd.ef.sea' => 'Require Authentication For Self Enrollment',
'fd.ef.sea.desc' => 'If self enrollment is enabled, require enrollees who
are self-enrolling to authenticate to the platform',
// (End enrollment configuration fields)
+ // This must be named fd.model.validation-field
+ 'fd.email_address.mail' => 'Email',
'fd.false' => 'False',
'fd.group.desc.adm' => '%1$s Administrators',
'fd.group.mem' => 'Member',
'fd.group.memin' => 'membership in "%1$s"',
'fd.group.own' => 'Owner',
'fd.groups' => 'Groups',
- 'fd.id' => 'Identifier',
+ // The next set must be named fd.model.validation-field
+ 'fd.identifier.identifier' => 'Identifier',
+ 'fd.identifier.login' => 'Login',
+ 'fd.identifier.login.desc' => 'Allow this identifier to login to
Registry',
'fd.ids' => 'Identifiers',
'fd.index' => 'Index',
- 'fd.login' => 'Login',
- 'fd.login.desc' => 'Allow this identifier to login to COordinate',
- 'fd.mail' => 'Email',
'fd.members' => 'Members',
'fd.name' => 'Name',
'fd.name.d' => 'Display Name',
- 'fd.name.f' => 'Family Name',
- 'fd.name.g' => 'Given Name',
- 'fd.name.h' => 'Honorific',
'fd.name.h.desc' => '(Dr, Hon, etc)',
- 'fd.name.m' => 'Middle Name',
- 'fd.name.s' => 'Suffix',
'fd.name.s.desc' => '(Jr, III, etc)',
+ // The next set must be named fd.model.validation-field
+ 'fd.name.honorific' => 'Honorific',
+ 'fd.name.given' => 'Given Name',
+ 'fd.name.middle' => 'Middle Name',
+ 'fd.name.family' => 'Family Name',
+ 'fd.name.suffix' => 'Suffix',
'fd.no' => 'No',
'fd.o' => 'Organization',
'fd.open' => 'Open',
@@ -335,16 +347,15 @@
'fd.ou' => 'Department',
'fd.parent' => 'Parent COU',
'fd.perms' => 'Permissions',
- 'fd.phone' => 'Phone',
- 'fd.postal' => 'ZIP/Postal Code',
'fd.req' => '* denotes required field',
'fd.required' => 'Required',
'fd.roles' => 'Roles',
'fd.searchbase' => 'Search Base',
'fd.sponsor' => 'Sponsor',
'fd.sponsor.desc' =>'(for continued membership)',
- 'fd.state' => 'State',
'fd.status' => 'Status',
+ // This must be named fd.model.validation-field
+ 'fd.telephone_number.number' => 'Phone',
'fd.title' => 'Title',
'fd.true' => 'True',
'fd.type' => 'Type',
@@ -361,6 +372,7 @@
'op.add-a' => 'Add "%1$s"',
'op.add.new' => 'Add a New %1$s',
'op.back' => 'Back',
+ 'op.begin' => 'Begin',
'op.cancel' => 'Cancel',
'op.compare' => 'Compare',
'op.db.ok' => 'Database schema update successful',
@@ -371,6 +383,7 @@
'op.edit.ea' => 'Edit Enrollment Attributes',
'op.edit-a' => 'Edit "%1$s"',
'op.edit-f' => 'Edit %1$s for %2$s',
+ 'op.enroll' => 'Enroll',
'op.find.inv' => 'Find a Person to Invite to %1$s',
'op.gr.memadd' => 'Add Person %1$s to Group',
'op.grm.add' => 'Add Person to %1$s Group %2$s',
@@ -397,6 +410,7 @@
'rs.added-a' => '"%1$s" Added',
'rs.inv.conf' => 'Invitation Confirmed',
'rs.inv.dec' => 'Invitation Declined',
+ 'rs.pt.create' => 'Petition Created',
'rs.updated' => '"%1$s" Updated',

// Setup

Modified: registry/trunk/app/Model/Address.php
===================================================================
--- registry/trunk/app/Model/Address.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/Address.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -47,34 +47,36 @@
public $validate = array(
// Don't require any element since $belongsTo saves won't validate if
they're empty
'line1' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => false
),
'line2' => array(
- 'rule' => '/.*/',
+ 'rule' => array('maxLength', 128),
'required' => false
),
'locality' => array(
- 'rule' => '/.*/',
+ 'rule' => array('maxLength', 128),
'required' => false
),
'state' => array(
- 'rule' => '/.*/',
+ 'rule' => array('maxLength', 128),
'required' => false
),
'postal_code' => array(
- 'rule' => '/.*/',
+ 'rule' => array('maxLength', 16),
'required' => false
),
'country' => array(
- 'rule' => '/.*/',
+ 'rule' => array('maxLength', 128),
'required' => false
),
'type' => array(
'rule' => array('inList', array(ContactEnum::Home,
ContactEnum::Office,
ContactEnum::Postal)),
- 'required' => false
+ 'required' => false,
+ 'allowEmpty' => true
),
'co_person_role_id' => array(
'rule' => 'numeric',

Modified: registry/trunk/app/Model/CmpEnrollmentConfiguration.php
===================================================================
--- registry/trunk/app/Model/CmpEnrollmentConfiguration.php 2012-03-20
22:11:16 UTC (rev 265)
+++ registry/trunk/app/Model/CmpEnrollmentConfiguration.php 2012-03-20
22:13:01 UTC (rev 266)
@@ -141,24 +141,24 @@
return(array(
array('attr' => 'names:honorific',
'type' => NameEnum::Official,
- 'label' => _txt('fd.name.h'),
+ 'label' => _txt('fd.name.honorific'),
'desc' => _txt('fd.name.h.desc'),
'assoc' => $name_assoc),
array('attr' => 'names:given',
'type' => NameEnum::Official,
- 'label' => _txt('fd.name.g'),
+ 'label' => _txt('fd.name.given'),
'assoc' => $name_assoc),
array('attr' => 'names:middle',
'type' => NameEnum::Official,
- 'label' => _txt('fd.name.m'),
+ 'label' => _txt('fd.name.middle'),
'assoc' => $name_assoc),
array('attr' => 'names:family',
'type' => NameEnum::Official,
- 'label' => _txt('fd.name.f'),
+ 'label' => _txt('fd.name.family'),
'assoc' => $name_assoc),
array('attr' => 'names:suffix',
'type' => NameEnum::Official,
- 'label' => _txt('fd.name.s'),
+ 'label' => _txt('fd.name.suffix'),
'desc' => _txt('fd.name.s.desc'),
'assoc' => $name_assoc),
array('attr' => 'affiliation',
@@ -181,40 +181,62 @@
'assoc' => $id_assoc),
array('attr' => 'email_addresses:mail',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.mail'),
+ 'label' => _txt('fd.email_address.mail'),
'assoc' => $email_assoc),
array('attr' => 'telephone_numbers:number',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.phone'),
+ 'label' => _txt('fd.telephone_number.number'),
'assoc' => $phone_assoc),
array('attr' => 'addresses:line1',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.address.1'),
+ 'label' => _txt('fd.address.line1'),
'assoc' => $address_assoc),
array('attr' => 'addresses:line2',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.address.2'),
+ 'label' => _txt('fd.address.line2'),
'assoc' => $address_assoc),
array('attr' => 'addresses:locality',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.city'),
+ 'label' => _txt('fd.address.locality'),
'assoc' => $address_assoc),
array('attr' => 'addresses:state',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.state'),
+ 'label' => _txt('fd.address.state'),
'assoc' => $address_assoc),
array('attr' => 'addresses:postal_code',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.postal'),
+ 'label' => _txt('fd.address.postal_code'),
'assoc' => $address_assoc),
array('attr' => 'addresses:country',
'type' => ContactEnum::Office,
- 'label' => _txt('fd.country'),
+ 'label' => _txt('fd.address.country'),
'assoc' => $address_assoc)
));
}

/**
+ * Determine if organizational identities may be provided by CO enrollment
+ * flows in the default (ie: active) CMP Enrollment Configuration for this
platform.
+ * - precondition: Initial setup (performed by select()) has been completed
+ *
+ * @since COmanage Registry v0.5
+ * @return boolean True if org identities may be provided by CO enrollment
flows, false otherwise
+ */
+
+ public function orgIdentitiesFromCOEF() {
+ $r = $this->find('first',
+ array('conditions' =>
+ array('CmpEnrollmentConfiguration.name' => 'CMP
Enrollment Configuration',
+ 'CmpEnrollmentConfiguration.status' =>
StatusEnum::Active),
+ // We don't need to pull attributes, just the
configuration
+ 'contain' => false,
+ 'fields' =>
+
array('CmpEnrollmentConfiguration.attrs_from_coef')));
+
+ return($r['CmpEnrollmentConfiguration']['attrs_from_coef']);
+ }
+
+ /**
* Determine if organizational identities are pooled in the default (ie:
active)
* CMP Enrollment Configuration for this platform.
* - precondition: Initial setup (performed by select()) has been completed

Modified: registry/trunk/app/Model/Co.php
===================================================================
--- registry/trunk/app/Model/Co.php 2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Model/Co.php 2012-03-20 22:13:01 UTC (rev 266)
@@ -42,7 +42,11 @@
// A CO can have zero or more petitions
"CoPetition" => array('dependent' => true),
// A CO has zero or more COUs
- "Cou" => array('dependent' => true)
+ "Cou" => array('dependent' => true),
+ // A CO has zero or more OrgIdentities, depending on if they are pooled.
+ // It's OK to make the model dependent, because if they are pooled the
+ // link won't be there to delete.
+ "OrgIdentity" => array('dependent' => true)
);

// Default display field for cake generated views

Modified: registry/trunk/app/Model/CoEnrollmentAttribute.php
===================================================================
--- registry/trunk/app/Model/CoEnrollmentAttribute.php 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/Model/CoEnrollmentAttribute.php 2012-03-20 22:13:01
UTC (rev 266)
@@ -59,7 +59,8 @@
'rule' => array('range', -2, 2)
),
'ordr' => array(
- 'rule' => 'numeric'
+ 'rule' => 'numeric',
+ 'allowEmpty' => true
),
'description' => array(
'rule' => '/.*/',
@@ -80,42 +81,339 @@

$ret = array();

- // There are three types of attributes we need to assemble...
+ // There are several types of attributes we need to assemble. We encode
information
+ // about them into their key to make it easier for the petition process
to figure
+ // out what's what. The general form is
+ // <code>:<name>:<type>
+ // though there are variations described below. <type> is optional, and
for
+ // multi-valued person attributes to indicate the type of that attribute
that is
+ // being collected.

- // (1) Single valued attributes, generally attached to the Person Role
+ // (1) Single valued CO Person Role attributes (code=r)

- $ret['s:affiliation'] = _txt('fd.affiliation');
- $ret['s:title'] = _txt('fd.title');
- $ret['s:o'] = _txt('fd.o');
- $ret['s:ou'] = _txt('fd.ou');
- $ret['s:valid_from'] = _txt('fd.valid.f');
- $ret['s:valid_through'] = _txt('fd.valid.u');
+ $ret['r:cou_id'] = _txt('fd.cou') . " (" . _txt('ct.co_person_roles.1')
. ")";
+ $ret['r:affiliation'] = _txt('fd.affiliation') . " (" .
_txt('ct.co_person_roles.1') . ")";
+ $ret['r:title'] = _txt('fd.title') . " (" . _txt('ct.co_person_roles.1')
. ")";
+ $ret['r:o'] = _txt('fd.o') . " (" . _txt('ct.co_person_roles.1') . ")";
+ $ret['r:ou'] = _txt('fd.ou') . " (" . _txt('ct.co_person_roles.1') . ")";
+ $ret['r:valid_from'] = _txt('fd.valid.f') . " (" .
_txt('ct.co_person_roles.1') . ")";
+ $ret['r:valid_through'] = _txt('fd.valid.u') . " (" .
_txt('ct.co_person_roles.1') . ")";

- // (2) Multi valued attributes, mostly (but not exclusively) attached
- // to the Person Role... add one entry per defined type
+ // (2) Multi valued CO Person attributes (code=p)

foreach(array_keys($cm_texts[ $cm_lang ]['en.name']) as $k)
- $ret['m:name:'.$k] = _txt('fd.name') . " (" . $cm_texts[ $cm_lang
]['en.name'][$k] . ")";
-
+ $ret['p:name:'.$k] = _txt('fd.name') . " (" . $cm_texts[ $cm_lang
]['en.name'][$k] . ", " . _txt('ct.co_people.1') . ")";
+
foreach(array_keys($cm_texts[ $cm_lang ]['en.identifier']) as $k)
- $ret['m:identifier:'.$k] = _txt('fd.id') . " (" . $cm_texts[ $cm_lang
]['en.identifier'][$k] . ")";
-
- foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.address']) as $k)
- $ret['m:address:'.$k] = _txt('fd.address') . " (" . $cm_texts[
$cm_lang ]['en.contact.address'][$k] . ")";
-
+ $ret['p:identifier:'.$k] = _txt('fd.identifier.identifier') . " (" .
$cm_texts[ $cm_lang ]['en.identifier'][$k] . ", " . _txt('ct.co_people.1') .
")";
+
foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.mail']) as $k)
- $ret['m:mail:'.$k] = _txt('fd.mail') . " (" . $cm_texts[ $cm_lang
]['en.contact.mail'][$k] . ")";
+ $ret['p:email_address:'.$k] = _txt('fd.email_address.mail') . " (" .
$cm_texts[ $cm_lang ]['en.contact.mail'][$k] . ", " . _txt('ct.co_people.1')
. ")";

+ // (3) Multi valued CO Person Role attributes (code=m)
+
foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.phone']) as $k)
- $ret['m:phone:'.$k] = _txt('fd.phone') . " (" . $cm_texts[ $cm_lang
]['en.contact.phone'][$k] . ")";
-
- // (3) Extended Attributes, which are specific to the CO and single
valued
+ $ret['m:telephone_number:'.$k] = _txt('fd.telephone_number.number') .
" (" . $cm_texts[ $cm_lang ]['en.contact.phone'][$k] . ", " .
_txt('ct.co_person_roles.1') . ")";

+ foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.address']) as $k)
+ $ret['m:address:'.$k] = _txt('fd.address') . " (" . $cm_texts[
$cm_lang ]['en.contact.address'][$k] . ", " . _txt('ct.co_person_roles.1') .
")";
+
+ // (4) CO Person Role Extended attributes (code=x)
+
$extAttrs =
$this->CoEnrollmentFlow->Co->CoExtendedAttribute->findAllByCoId($coid);

foreach($extAttrs as $e)
- $ret['s:' . $e['CoExtendedAttribute']['id']] =
$e['CoExtendedAttribute']['display_name'];
+ $ret['x:' . $e['CoExtendedAttribute']['id'] . ':' .
$e['CoExtendedAttribute']['name']] =
$e['CoExtendedAttribute']['display_name'];

+ $cmpEnrollmentConfiguration =
ClassRegistry::init('CmpEnrollmentConfiguration');
+
+ if($cmpEnrollmentConfiguration->orgIdentitiesFromCOEF()) {
+ // (5) Single valued Org Identity attributes, if enabled (code=o)
+
+ $ret['o:affiliation'] = _txt('fd.affiliation') . " (" .
_txt('ct.org_identities.1') . ")";
+ $ret['o:title'] = _txt('fd.title') . " (" .
_txt('ct.org_identities.1') . ")";
+ $ret['o:o'] = _txt('fd.o') . " (" . _txt('ct.org_identities.1') . ")";
+ $ret['o:ou'] = _txt('fd.ou') . " (" . _txt('ct.org_identities.1') .
")";
+
+ // (6) Multi valued Org Identity attributes, if enabled (code=i)
+
+ foreach(array_keys($cm_texts[ $cm_lang ]['en.name']) as $k)
+ $ret['i:name:'.$k] = _txt('fd.name') . " (" . $cm_texts[ $cm_lang
]['en.name'][$k] . ", " . _txt('ct.org_identities.1') . ")";
+
+ foreach(array_keys($cm_texts[ $cm_lang ]['en.identifier']) as $k)
+ $ret['i:identifier:'.$k] = _txt('fd.identifier.identifier') . " (" .
$cm_texts[ $cm_lang ]['en.identifier'][$k] . ", " .
_txt('ct.org_identities.1') . ")";
+
+ foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.address']) as $k)
+ $ret['i:address:'.$k] = _txt('fd.address') . " (" . $cm_texts[
$cm_lang ]['en.contact.address'][$k] . ", " . _txt('ct.org_identities.1') .
")";
+
+ foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.mail']) as $k)
+ $ret['i:email_address:'.$k] = _txt('fd.email_address.mail') . " (" .
$cm_texts[ $cm_lang ]['en.contact.mail'][$k] . ", " .
_txt('ct.org_identities.1') . ")";
+
+ foreach(array_keys($cm_texts[ $cm_lang ]['en.contact.phone']) as $k)
+ $ret['i:telephone_number:'.$k] = _txt('fd.telephone_number.number')
. " (" . $cm_texts[ $cm_lang ]['en.contact.phone'][$k] . ", " .
_txt('ct.org_identities.1') . ")";
+ }
+
return($ret);
}
+
+ /**
+ * Obtain the configured attributes for a particular Enrollment Flow.
+ *
+ * @since COmanage Registry 0.5
+ * @param integer CO Enrollment Flow ID
+ * @return Array Configured attributes and metadata
+ */
+
+ public function enrollmentFlowAttributes($coef) {
+ $attrs = array();
+
+ // First, retrieve the configured attributes
+
+ $efAttrs = $this->findAllByCoEnrollmentFlowId($coef,
+ array(),
+
array('CoEnrollmentAttribute.ordr' => 'asc'));
+
+ foreach($efAttrs as $efAttr) {
+ $attr = array();
+
+ // Figure out what we're dealing with
+ $a = explode(':', $efAttr['CoEnrollmentAttribute']['attribute'], 4);
+
+ // See availableAttributes() for the various codes
+ $attrCode = array_shift($a);
+
+ if($attrCode == 'x') {
+ // Extended Attribute ID, needed to pull metadata about the extended
attribute
+ $attrId = array_shift($a);
+ }
+
+ // attribute name (as per availableAttributes)
+ $attrName = array_shift($a);
+
+ // optional constraining type, for multi-valued attributes
+ $attrType = array_shift($a);
+
+ if($attrCode == 'o' || $attrCode == 'r' || $attrCode == 'x') {
+ $attrModel = null;
+
+ switch($attrCode) {
+ case 'o':
+ $attrModel = $this->CoEnrollmentFlow->CoPetition->Co->OrgIdentity;
+ break;
+ case 'r':
+ $attrModel =
$this->CoEnrollmentFlow->CoPetition->Co->CoPerson->CoPersonRole;
+ break;
+ case 'x':
+ $attrModel =
$this->CoEnrollmentFlow->CoPetition->Co->CoExtendedAttribute;
+ break;
+ }
+
+ // The attribute ID
+ $attr['id'] = $efAttr['CoEnrollmentAttribute']['id'];
+
+ // The attribute key/shorthand
+ $attr['attribute'] = $efAttr['CoEnrollmentAttribute']['attribute'];
+
+ // Required? We're using required when perhaps we should be using
allowEmpty.
+ // An attribute is required if the enrollment flow requires it OR if
it is
+ // type 'o' or 'r' and is required by the data model.
+ $attr['required'] = $efAttr['CoEnrollmentAttribute']['required'];
+
+ if(($attrCode == 'o' || $attrCode == 'r')
+ && $attrModel->validate[$attrName]['required'])
+ $attr['required'] = true;
+
+ // Label
+ $attr['label'] = $efAttr['CoEnrollmentAttribute']['label'];
+
+ // Description
+ $attr['description'] =
$efAttr['CoEnrollmentAttribute']['description'];
+
+ // Single value attributes are never hidden
+ $attr['hidden'] = 0;
+
+ // Model, in cake's Model.field.
+ if($attrCode == 'o') {
+ $attr['model'] = 'EnrolleeOrgIdentity';
+ } elseif($attrCode == 'r') {
+ $attr['model'] = 'EnrolleeCoPersonRole';
+ } else {
+ // Model is Co#PersonExtendedAttribute
+ $attr['model'] = 'EnrolleeCoPersonRole.Co' .
$efAttr['CoEnrollmentFlow']['co_id'] . 'PersonExtendedAttribute';
+ }
+
+ // Field, in cake's Model.field
+ $attr['field'] = $attrName;
+
+ // Attach the validation rules so the form knows how to render the
field.
+ if($attrCode == 'o') {
+ $attr['validate'] = $attrModel->validate[$attrName];
+
+ if(isset($attr['validate']['rule'][0])
+ && $attr['validate']['rule'][0] == 'inList') {
+ // If this is a select field, get the set of options
+ $attr['select'] = $attrModel->validEnumsForSelect($attrName);
+ }
+ } elseif($attrCode == 'r') {
+ if($attrName == 'cou_id') {
+ // We have to set up a select based on the available COUs
+
+ $args = array();
+ $args['fields'] = array('Cou.id', 'Cou.name');
+ $args['conditions'] = array('CoEnrollmentFlow.id' => $coef);
+ $args['joins'][0]['table'] = 'co_enrollment_flows';
+ $args['joins'][0]['alias'] = 'CoEnrollmentFlow';
+ $args['joins'][0]['type'] = 'INNER';
+ $args['joins'][0]['conditions'][0] =
'Cou.co_id=CoEnrollmentFlow.co_id';
+
+ $attr['select'] =
$this->CoEnrollmentFlow->CoPetition->Cou->find('list', $args);
+ $attr['validate']['rule'][0] = 'inList';
+ $attr['validate']['rule'][1] = array_keys($attr['select']);
+ } else {
+ // Default behavior for all other attributes
+
+ $attr['validate'] = $attrModel->validate[$attrName];
+
+ if(isset($attr['validate']['rule'][0])
+ && $attr['validate']['rule'][0] == 'inList') {
+ // If this is a select field, get the set of options
+ $attr['select'] = $attrModel->validEnumsForSelect($attrName);
+ }
+ }
+ } else {
+ // Extended attributes
+
+ $attr['validate'] = $attrModel->validationRules($attrId);
+ }
+
+ // Single valued attributes don't have types, so we can ignore
$attrType
+
+ $attrs[] = $attr;
+ } elseif($attrCode == 'i' || $attrCode == 'm' || $attrCode == 'p') {
+ // For multivalued attributes, we figure out the relevant fields to
pass to the view.
+
+ // Figure out the model name. $attrName is the lowercased version.
+ $attrModelName = Inflector::camelize($attrName);
+ $attrIsHasMany = false;
+
+ $attrModel = null;
+
+ switch($attrCode) {
+ case 'i':
+ $attrModel =
$this->CoEnrollmentFlow->CoPetition->Co->OrgIdentity->$attrModelName;
+
if(isset($this->CoEnrollmentFlow->CoPetition->Co->OrgIdentity->hasMany[$attrModelName]))
+ $attrIsHasMany = true;
+ break;
+ case 'm':
+ $attrModel =
$this->CoEnrollmentFlow->CoPetition->Co->CoPerson->CoPersonRole->$attrModelName;
+
if(isset($this->CoEnrollmentFlow->CoPetition->Co->CoPerson->CoPersonRole->hasMany[$attrModelName]))
+ $attrIsHasMany = true;
+ break;
+ case 'p':
+ $attrModel =
$this->CoEnrollmentFlow->CoPetition->Co->CoPerson->$attrModelName;
+
if(isset($this->CoEnrollmentFlow->CoPetition->Co->CoPerson->hasMany[$attrModelName]))
+ $attrIsHasMany = true;
+ break;
+ }
+
+ if($attrModel == null) {
+ throw new RuntimeException("Failed to find attribute model: " .
$attrModelName . " (" . $attrCode . ")");
+ }
+
+ // Model, in cake's Model.field. We prefix it with the parent model
so
+ // CoPetitionsController can figure out where to map multi-valued
attributes.
+ // For hasmany relations, we enumerate using the attribute ID in
order to
+ // permit multiples of an attribute (eg: Foo.23, Foo.29). This is
easier than
+ // trying to correlate in order to produce Foo.0, Foo.1 etc.
+
+ switch($attrCode) {
+ case 'i':
+ $m = "EnrolleeOrgIdentity." . $attrModelName . ($attrIsHasMany ?
"." . $efAttr['CoEnrollmentAttribute']['id'] : "");
+ break;
+ case 'm':
+ $m = "EnrolleeCoPersonRole." . $attrModelName . ($attrIsHasMany ?
"." . $efAttr['CoEnrollmentAttribute']['id'] : "");
+ break;
+ case 'p':
+ $m = "EnrolleeCoPerson." . $attrModelName . ($attrIsHasMany ? "."
. $efAttr['CoEnrollmentAttribute']['id'] : "");
+ break;
+ }
+
+ // Inject a hidden attribute to link this attribute back to its
definition.
+
+ $attr = array();
+
+ $attr['id'] = $efAttr['CoEnrollmentAttribute']['id'];
+ $attr['attribute'] = $efAttr['CoEnrollmentAttribute']['attribute'];
+ $attr['hidden'] = true;
+ $attr['default'] = $attr['id'];
+ $attr['model'] = $m;
+ $attr['field'] = "co_enrollment_attribute_id";
+
+ $attrs[] = $attr;
+
+ // Loop through the fields in the model.
+
+ foreach(array_keys($attrModel->validate) as $k) {
+ // Skip fields that are autopopulated
+ if($k != 'co_person_id'
+ && $k != 'co_person_role_id'
+ && $k != 'org_identity_id') {
+ $attr = array();
+
+ // The attribute ID and attribute key will be the same for all
components
+ // of a multi-valued attribute
+ $attr['id'] = $efAttr['CoEnrollmentAttribute']['id'];
+ $attr['attribute'] =
$efAttr['CoEnrollmentAttribute']['attribute'];
+
+ // Required? We use allowEmpty to check, which is more accurate
than $validate->required.
+ // Required is true if the attribute is required by the
enrollment flow configuration,
+ // AND of the MVPA's element is also required/allowEmpty (eg:
Email requires mail to be set).
+
+ $attr['required'] = ($efAttr['CoEnrollmentAttribute']['required']
+ &&
+
isset($attrModel->validate[$k]['allowEmpty'])
+ &&
+ !$attrModel->validate[$k]['allowEmpty']);
+
+ // We hide type
+ $attr['hidden'] = ($k == 'type' ? 1 : 0);
+
+ if($attr['hidden']) {
+ // Populate a default value. For now, the only hidden
attribute is type,
+ // so we can get away with just using $attrType.
+ $attr['default'] = $attrType;
+ } else {
+ // Label
+ $attr['label'] = $efAttr['CoEnrollmentAttribute']['label'] .
": " . _txt('fd.' . $attrName . '.' . $k);
+
+ // Description
+ $attr['description'] =
$efAttr['CoEnrollmentAttribute']['description'];
+ }
+
+ // Model, in cake's Model.field
+ $attr['model'] = $m;
+
+ // Field, in cake's Model.field
+ $attr['field'] = $k;
+
+ // Attach the validation rules so the form knows how to render
the field.
+ $attr['validate'] = $attrModel->validate[$k];
+
+ if($k != 'type'
+ && isset($attr['validate']['rule'][0])
+ && $attr['validate']['rule'][0] == 'inList') {
+ // If this is a select field, get the set of options
+ $attr['select'] = $attrModel->validEnumsForSelect($attrName);
+ }
+
+ $attrs[] = $attr;
+ }
+ }
+ } else {
+ throw new RuntimeException("Unknown attribute code: " . $attrCode);
+ }
+ }
+
+ return $attrs;
+ }
}

Modified: registry/trunk/app/Model/CoEnrollmentFlow.php
===================================================================
--- registry/trunk/app/Model/CoEnrollmentFlow.php 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/Model/CoEnrollmentFlow.php 2012-03-20 22:13:01
UTC (rev 266)
@@ -29,6 +29,9 @@
// Current schema version for API
public $version = "1.0";

+ // Add behaviors
+ public $actsAs = array('Containable');
+
// Association rules from this model to other models
public $belongsTo = array("Co"); // A CO Enrollment Flow is attached
to a CO

@@ -70,15 +73,15 @@
),
'notify_on_early_provision' => array(
'rule' => 'email',
- 'required' => false
+ 'allowEmpty' => true
),
'notify_on_provision' => array(
'rule' => 'email',
- 'required' => false
+ 'allowEmpty' => true
),
'notify_on_active' => array(
'rule' => 'email',
- 'required' => false
+ 'allowEmpty' => true
),
'status' => array(
'rule' => array('inList', array(StatusEnum::Active,

Modified: registry/trunk/app/Model/CoExtendedAttribute.php
===================================================================
--- registry/trunk/app/Model/CoExtendedAttribute.php 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/Model/CoExtendedAttribute.php 2012-03-20 22:13:01
UTC (rev 266)
@@ -64,4 +64,36 @@
'rule' => array('boolean')
)
);
+
+ /**
+ * Dynamically assemble validation rules for an extended attribute.
+ *
+ * @since COmanage Registry v0.5
+ * @param integer ID of Extended Attribute
+ * @return Array Validation rules, in the standard Cake format
+ */
+
+ public function validationRules($id) {
+ $ret = array();
+
+ // Pull the type of the attribute and put together a suitable array
+
+ $extAttr = $this->findById($id);
+
+ if($extAttr) {
+ switch($extAttr['CoExtendedAttribute']['type']) {
+ case ExtendedAttributeEnum::Integer:
+ $ret['rule'] = array('numeric');
+ break;
+ case ExtendedAttributeEnum::Timestamp:
+ $ret['rule'] = array('validateTimestamp');
+ break;
+ case ExtendedAttributeEnum::Varchar32:
+ $ret['rule'] = array('maxLength', 128);
+ break;
+ }
+ }
+
+ return $ret;
+ }
}

Modified: registry/trunk/app/Model/CoPersonRole.php
===================================================================
--- registry/trunk/app/Model/CoPersonRole.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/CoPersonRole.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -64,33 +64,39 @@
// Validation rules for table elements
public $validate = array(
'co_person_id' => array(
- 'rule' => 'numeric',
+ 'rule' => array('numeric'),
'required' => true,
'message' => 'A CO Person ID must be provided'
),
'cou_id' => array(
- 'rule' => 'numeric',
- 'required' => false
+ 'rule' => array('numeric'),
+ 'required' => false,
+ 'allowEmpty' => true
),
'title' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => true
),
'o' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => true
),
'ou' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => true
),
'valid_from' => array(
- 'rule' => '/.*/', // The 'date' rule is too constraining
- 'required' => false
+ 'rule' => array('validateTimestamp'),
+ 'required' => false,
+ 'allowEmpty' => true
),
'valid_through' => array(
- 'rule' => '/.*/', // The 'date' rule is too constraining
- 'required' => false
+ 'rule' => array('validateTimestamp'),
+ 'required' => false,
+ 'allowEmpty' => true
),
'status' => array(
'rule' => array('inList', array(StatusEnum::Active,
@@ -101,8 +107,9 @@
StatusEnum::Declined))
),
'sponsor_co_person_id' => array(
- 'rule' => '/.*/', // Cake makes this required=true when numeric
- 'required' => false
+ 'rule' => array('numeric'),
+ 'required' => false,
+ 'allowEmpty' => true
),
'affiliation' => array(
'rule' => array('inList', array(AffiliationEnum::Faculty,
@@ -119,6 +126,11 @@

// Enum type hints

+ public $cm_enum_txt = array(
+ 'affiliation' => 'en.affil',
+ 'status' => 'en.status'
+ );
+
public $cm_enum_types = array(
'affiliation' => 'affil_t',
'status' => 'status_t'

Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/CoPetition.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -26,6 +26,9 @@
// Define class name for cake
public $name = "CoPetition";

+ // Current schema version for API
+ public $version = "1.0";
+
// Association rules from this model to other models
public $belongsTo = array(
"ApproverCoPerson" => array(
@@ -40,7 +43,7 @@
'foreignKey' => 'enrollee_co_person_id'
),
"EnrolleeCoPersonRole" => array(
- 'className' => 'CoPerson',
+ 'className' => 'CoPersonRole',
'foreignKey' => 'enrollee_co_person_role_id'
),
"EnrolleeOrgIdentity" => array(
@@ -70,8 +73,57 @@

// Validation rules for table elements
public $validate = array(
+ 'co_enrollment_flow_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'co_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'cou_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'enrollee_org_identity_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'enrollee_co_person_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'enrollee_co_person_role_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'petitioner_co_person_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'sponsor_co_person_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
+ 'approver_co_person_id' => array(
+ 'rule' => 'numeric',
+ 'required' => false,
+ 'allowEmpty' => true
+ ),
'status' => array(
- 'rule' => array('inList', array(StatusEnum::Active,
+ 'rule' => array('inList', array(StatusEnum::Approved,
+ StatusEnum::Declined,
+ StatusEnum::Denied,
+ StatusEnum::Invited,
+ StatusEnum::Pending,
StatusEnum::Suspended)),
'required' => true,
'message' => 'A valid status must be selected'

Modified: registry/trunk/app/Model/EmailAddress.php
===================================================================
--- registry/trunk/app/Model/EmailAddress.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/EmailAddress.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -47,14 +47,16 @@
public $validate = array(
// Don't require mail or type since $belongsTo saves won't validate if
they're empty
'mail' => array(
- 'rule' => 'email',
+ 'rule' => array('email'),
'required' => false,
+ 'allowEmpty' => false,
'message' => 'Please enter a valid email address'
),
'type' => array(
'rule' => array('inList', array(ContactEnum::Home,
ContactEnum::Office)),
- 'required' => false
+ 'required' => false,
+ 'allowEmpty' => false
),
'co_person_id' => array(
'rule' => 'numeric',

Modified: registry/trunk/app/Model/Identifier.php
===================================================================
--- registry/trunk/app/Model/Identifier.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/Identifier.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -47,8 +47,9 @@
public $validate = array(
// Don't require any element since $belongsTo saves won't validate if
they're empty
'identifier' => array(
- 'rule' => 'notEmpty',
- 'required' => false
+ 'rule' => array('maxLength', 256),
+ 'required' => false,
+ 'allowEmpty' => false
),
'type' => array(
'rule' => array('inList', array(IdentifierEnum::ePPN,
@@ -56,7 +57,8 @@
IdentifierEnum::Mail,
IdentifierEnum::OpenID,
IdentifierEnum::UID)),
- 'required' => false
+ 'required' => false,
+ 'allowEmpty' => false
),
'login' => array(
'rule' => array('boolean'),

Modified: registry/trunk/app/Model/Name.php
===================================================================
--- registry/trunk/app/Model/Name.php 2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/Model/Name.php 2012-03-20 22:13:01 UTC (rev 266)
@@ -49,25 +49,30 @@
// Validation rules for table elements
public $validate = array(
'honorific' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 32),
+ 'required' => false,
+ 'allowEmpty' => true
),
'given' => array(
- 'rule' => 'notEmpty',
+ 'rule' => array('maxLength', 128),
'required' => true,
+ 'allowEmpty' => false,
'message' => 'A given name must be provided'
),
'middle' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => true
),
'family' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 128),
+ 'required' => false,
+ 'allowEmpty' => true
),
'suffix' => array(
- 'rule' => '/.*/',
- 'required' => false
+ 'rule' => array('maxLength', 32),
+ 'required' => false,
+ 'allowEmpty' => true
),
'type' => array(
'rule' => array('inList', array(NameEnum::Author,

Modified: registry/trunk/app/Model/OrgIdentity.php
===================================================================
--- registry/trunk/app/Model/OrgIdentity.php 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/Model/OrgIdentity.php 2012-03-20 22:13:01 UTC (rev
266)
@@ -58,7 +58,12 @@
"TelephoneNumber" => array('dependent' => true)
);

- public $belongsTo = array("Organization"); // A person may belong to
an organization (if pre-defined)
+ public $belongsTo = array(
+ // A person may belong to an organization (if pre-defined)
+ "Organization",
+ // An Org Identity may belong to a CO, if not pooled
+ "Co"
+ );

// Default display field for cake generated views
public $displayField = "Name.family";
@@ -104,6 +109,10 @@

// Enum type hints

+ public $cm_enum_txt = array(
+ 'affiliation' => 'en.affil',
+ );
+
public $cm_enum_types = array(
'affiliation' => 'affil_t'
);

Modified: registry/trunk/app/Model/TelephoneNumber.php
===================================================================
--- registry/trunk/app/Model/TelephoneNumber.php 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/Model/TelephoneNumber.php 2012-03-20 22:13:01
UTC (rev 266)
@@ -47,15 +47,17 @@
public $validate = array(
// Don't require number or type since $belongsTo saves won't validate if
they're empty
'number' => array(
- 'rule' => '/.*/', // cake has telephone number validation, but US
only
- 'required' => false // We allow any chars to cover things like "ext
2009"
+ 'rule' => array('maxLength', 64), // cake has telephone number
validation, but US only
+ 'required' => false, // We allow any chars to cover
things like "ext 2009"
+ 'allowEmpty' => false
),
'type' => array(
'rule' => array('inList', array(ContactEnum::Fax,
ContactEnum::Home,
ContactEnum::Mobile,
ContactEnum::Office)),
- 'required' => false
+ 'required' => false,
+ 'allowEmpty' => true
),
'co_person_role_id' => array(
'rule' => 'numeric',

Modified: registry/trunk/app/View/Addresses/fields.inc
===================================================================
--- registry/trunk/app/View/Addresses/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/Addresses/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -64,7 +64,7 @@
<tbody>
<tr class="line1">
<td>
- <?php echo _txt('fd.address.1'); ?>
+ <?php echo _txt('fd.address.line1'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('line1') :
Sanitize::html($addresses[0]['Address']['line1'])); ?>
@@ -72,7 +72,7 @@
</tr>
<tr class="line2">
<td>
- <?php echo _txt('fd.address.2'); ?>
+ <?php echo _txt('fd.address.line2'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('line2') :
Sanitize::html($addresses[0]['Address']['line2'])); ?>
@@ -80,7 +80,7 @@
</tr>
<tr class="line1">
<td>
- <?php echo _txt('fd.city'); ?>
+ <?php echo _txt('fd.address.locality'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('locality') :
Sanitize::html($addresses[0]['Address']['locality'])); ?>
@@ -88,7 +88,7 @@
</tr>
<tr class="line2">
<td>
- <?php echo _txt('fd.state'); ?>
+ <?php echo _txt('fd.address.state'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('state') :
Sanitize::html($addresses[0]['Address']['state'])); ?>
@@ -96,7 +96,7 @@
</tr>
<tr class="line1">
<td>
- <?php echo _txt('fd.postal'); ?>
+ <?php echo _txt('fd.address.postal_code'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('postal_code') :
Sanitize::html($addresses[0]['Address']['postal_code'])); ?>
@@ -104,7 +104,7 @@
</tr>
<tr class="line2">
<td>
- <?php echo _txt('fd.country'); ?>
+ <?php echo _txt('fd.address.country'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('country') :
Sanitize::html($addresses[0]['Address']['country'])); ?>

Modified: registry/trunk/app/View/Addresses/index.ctp
===================================================================
--- registry/trunk/app/View/Addresses/index.ctp 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/View/Addresses/index.ctp 2012-03-20 22:13:01 UTC (rev
266)
@@ -28,7 +28,7 @@
<table id="addresses" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('line1', _txt('fd.address.1'));
?></th>
+ <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>

Modified: registry/trunk/app/View/CmpEnrollmentConfigurations/fields.inc
===================================================================
--- registry/trunk/app/View/CmpEnrollmentConfigurations/fields.inc
2012-03-20 22:11:16 UTC (rev 265)
+++ registry/trunk/app/View/CmpEnrollmentConfigurations/fields.inc
2012-03-20 22:13:01 UTC (rev 266)
@@ -225,6 +225,17 @@
</tr>
<tr class="line2">
<td>
+ <b><?php print _txt('fd.ef.coef'); ?></b><br />
+ <font class="desc"><?php print _txt('fd.ef.coef.desc'); ?></font>
+ </td>
+ <td>
+ <?php print ($e
+ ? $this->Form->input('attrs_from_coef')
+ :
Sanitize::html($cmp_enrollment_configurations[0]['CmpEnrollmentConfiguration']['attrs_from_coef']));
?>
+ </td>
+ </tr>
+ <tr class="line1">
+ <td>
<b><?php print _txt('fd.ef.pool'); ?></b><br />
<font class="desc"><?php print _txt('fd.ef.pool.desc'); ?></font>
</td>

Modified: registry/trunk/app/View/CoEnrollmentAttributes/fields.inc
===================================================================
--- registry/trunk/app/View/CoEnrollmentAttributes/fields.inc 2012-03-20
22:11:16 UTC (rev 265)
+++ registry/trunk/app/View/CoEnrollmentAttributes/fields.inc 2012-03-20
22:13:01 UTC (rev 266)
@@ -35,8 +35,8 @@
return(false);

if($e)
- print $this->Hhtml->link(_txt('op.cancel'),
- array('controller' =>
'co_enrollment_attributes',
+ print $this->Html->link(_txt('op.cancel'),
+ array('controller' =>
'co_enrollment_attributes',
'action' => 'index',
'coef' =>
Sanitize::html($this->request->params['named']['coef'])),
array('class' => 'cancelbutton'));

Modified: registry/trunk/app/View/CoEnrollmentFlows/fields.inc
===================================================================
--- registry/trunk/app/View/CoEnrollmentFlows/fields.inc 2012-03-20
22:11:16 UTC (rev 265)
+++ registry/trunk/app/View/CoEnrollmentFlows/fields.inc 2012-03-20
22:13:01 UTC (rev 266)
@@ -37,7 +37,7 @@
if($e)
{
echo $this->Html->link(_txt('op.cancel'),
- array('controller' => 'co_enrollment_flows',
'action' => 'index', 'co' =>
Sanitize::html($this->request->params['named']['co'])),
+ array('controller' => 'co_enrollment_flows',
'action' => 'index', 'co' => $cur_co['Co']['id']),
array('class' => 'cancelbutton'));

if($this->action == "edit" && $permissions['edit'])
@@ -57,8 +57,7 @@
<br />
';

- if(isset($this->request->params['named']['co']))
- echo $this->Form->hidden('co_id', array('default' =>
$cur_co['Co']['id'])) . "\n";
+ echo $this->Form->hidden('co_id', array('default' => $cur_co['Co']['id']))
. "\n";
?>
<table id="<?php print $this->action; ?>_co_enrollment_configuration"
class="ui-widget">
<tbody>

Modified: registry/trunk/app/View/CoExtendedAttributes/fields.inc
===================================================================
--- registry/trunk/app/View/CoExtendedAttributes/fields.inc 2012-03-20
22:11:16 UTC (rev 265)
+++ registry/trunk/app/View/CoExtendedAttributes/fields.inc 2012-03-20
22:13:01 UTC (rev 266)
@@ -36,11 +36,11 @@

if($e)
echo $this->Html->link(_txt('op.cancel'),
- array('controller' => 'co_extended_attributes',
'action' => 'index', 'co' => $this->request->params['named']['co']),
+ array('controller' => 'co_extended_attributes',
'action' => 'index', 'co' => $cur_co['Co']['Id']),
array('class' => 'cancelbutton'));
else
echo $this->Html->link(_txt('op.back'),
- array('controller' => 'co_extended_attributes',
'action' => 'index', 'co' => $this->request->params['named']['co']),
+ array('controller' => 'co_extended_attributes',
'action' => 'index', 'co' => $cur_co['Co']['Id']),
array('class' => 'backbutton'));

echo '
@@ -48,8 +48,7 @@
<br />
';

- if(isset($this->request->params['named']['co']))
- echo $this->Form->hidden('co_id', array('default' =>
Sanitize::html($this->request->params['named']['co']))) . "\n";
+ echo $this->Form->hidden('co_id', array('default' => $cur_co['Co']['Id']))
. "\n";
?>
<table id="<?php echo $this->action; ?>_co" class="ui-widget">
<tbody>

Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/View/CoPeople/fields.inc 2012-03-20 22:13:01 UTC (rev
266)
@@ -116,7 +116,7 @@
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
<?php
- echo _txt('fd.name.h');
+ echo _txt('fd.name.honorific');

if($e)
echo " " . _txt('fd.name.h.desc');
@@ -138,7 +138,7 @@
</tr>
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
- <?php echo _txt('fd.name.g'); ?><font
class="required">*</font>
+ <?php echo _txt('fd.name.given'); ?><font
class="required">*</font>
</th>
<td>
<?php echo ($e ? $this->Form->input('Name.given',
array('default' => $co_people[0]['Name']['given']))
@@ -152,7 +152,7 @@
</tr>
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
- <?php echo _txt('fd.name.m'); ?>
+ <?php echo _txt('fd.name.middle'); ?>
</th>
<td>
<?php echo ($e ? $this->Form->input('Name.middle',
array('default' => $co_people[0]['Name']['middle']))
@@ -166,7 +166,7 @@
</tr>
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
- <?php echo _txt('fd.name.f'); ?>
+ <?php echo _txt('fd.name.family'); ?>
</th>
<td>
<?php echo ($e ? $this->Form->input('Name.family',
array('default' => $co_people[0]['Name']['family']))
@@ -181,7 +181,7 @@
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
<?php
- echo _txt('fd.name.s');
+ echo _txt('fd.name.suffix');

if($e)
echo " " . _txt('fd.name.s.desc');
@@ -244,7 +244,7 @@
</tr>
<tr class="line<?php echo ($l % 2); $l++; ?>">
<th>
- <?php echo _txt('fd.mail'); ?>
+ <?php echo _txt('fd.email_address.mail'); ?>
</th>
<td>
<?php

Modified: registry/trunk/app/View/CoPeople/index.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/index.ctp 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/View/CoPeople/index.ctp 2012-03-20 22:13:01 UTC (rev
266)
@@ -25,13 +25,21 @@
<h1 class="ui-state-default"><?php echo $cur_co['Co']['name']; ?> People</h1>

<?php
- if($permissions['add'])
- echo $this->Html->link(_txt('op.inv'),
- array('controller' => 'org_identities', 'action'
=> 'find', 'co' => $this->params['named']['co']),
- array('class' => 'addbutton')) . '
+ if($permissions['enroll'] && !empty($co_enrollment_flows)) {
+ print $this->Html->link(_txt('op.enroll'),
+ array('controller' => 'co_enrollment_flows',
'action' => 'select', 'co' => $cur_co['Co']['id']),
+ array('class' => 'addbutton')) . '
<br />
<br />
+ ';
+ } elseif($permissions['add']) {
+ print $this->Html->link(_txt('op.inv'),
+ array('controller' => 'org_identities', 'action'
=> 'find', 'co' => $cur_co['Co']['id']),
+ array('class' => 'addbutton')) . '
+ <br />
+ <br />
';
+ }
?>

<table id="co_people" class="ui-widget">
@@ -97,6 +105,9 @@
else
print $pr['title'];

+ if(isset($pr['Cou']['name']))
+ print " (" . $pr['Cou']['name'] . ")";
+
print "<br />\n";
}
?>

Modified: registry/trunk/app/View/CoPersonRoles/fields.inc
===================================================================
--- registry/trunk/app/View/CoPersonRoles/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/CoPersonRoles/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -23,7 +23,7 @@
*/
-->
<?php
-
+
// Globals
global $cm_lang, $cm_texts;

@@ -55,6 +55,9 @@
echo $this->Form->hidden('co_person_id', array('default' =>
$co_people[0]['CoPerson']['id'])). "\n";
// Default status is 'Active'
echo $this->Form->hidden('status', array('default' => 'A')). "\n";
+ // Make sure ID gets carried over
+ if(isset($co_person_roles[0]['CoPersonRole']['id']))
+ print $this->Form->hidden('id', array('default' =>
$co_person_roles[0]['CoPersonRole']['id']));

echo '
<br />
@@ -224,7 +227,7 @@
<?php if($this->action != "add"): ?>
<tr class="line<?php echo ($l % 2); $l++; ?>">
<td>
- <?php echo _txt('fd.phone'); ?>
+ <?php echo _txt('fd.telephone_number.number'); ?>
</td>
<td>
<?php


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

Modified: registry/trunk/app/View/EmailAddresses/fields.inc
===================================================================
--- registry/trunk/app/View/EmailAddresses/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/EmailAddresses/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -65,7 +65,7 @@
<tbody>
<tr class="line1">
<td>
- <?php echo _txt('fd.mail'); ?>
+ <?php echo _txt('fd.email_address.mail'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('mail') :
Sanitize::html($email_addresses[0]['EmailAddress']['mail'])); ?>

Modified: registry/trunk/app/View/EmailAddresses/index.ctp
===================================================================
--- registry/trunk/app/View/EmailAddresses/index.ctp 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/EmailAddresses/index.ctp 2012-03-20 22:13:01
UTC (rev 266)
@@ -27,7 +27,7 @@
<table id="email_addresses" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('email', _txt('fd.mail'));
?></th>
+ <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>

Modified: registry/trunk/app/View/Identifiers/fields.inc
===================================================================
--- registry/trunk/app/View/Identifiers/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/Identifiers/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -89,7 +89,7 @@
</tr>
<tr class="line2">
<td>
- <?php echo _txt('fd.id'); ?>
+ <?php echo _txt('fd.identifier.identifier'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('identifier', array('type' =>
'text'))
@@ -98,8 +98,8 @@
</tr>
<tr class="line1">
<td>
- <?php echo _txt('fd.login'); ?><br />
- <i><?php echo _txt('fd.login.desc'); ?></i>
+ <?php echo _txt('fd.identifier.login'); ?><br />
+ <i><?php echo _txt('fd.identifier.login.desc'); ?></i>
</td>
<td>
<?php echo ($e ? $this->Form->input('login') :
Sanitize::html($identifiers[0]['Identifier']['login'])); ?>

Modified: registry/trunk/app/View/Identifiers/index.ctp
===================================================================
--- registry/trunk/app/View/Identifiers/index.ctp 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/Identifiers/index.ctp 2012-03-20 22:13:01
UTC (rev 266)
@@ -27,9 +27,9 @@
<table id="identifiers" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('identifier', _txt('fd.id'));
?></th>
+ <th><?php echo $this->Paginator->sort('identifier',
_txt('fd.identifier.identifier')); ?></th>
<th><?php echo $this->Paginator->sort('type', _txt('fd.type')); ?></th>
- <th><?php echo $this->Paginator->sort('login', _txt('fd.login'));
?></th>
+ <th><?php echo $this->Paginator->sort('login',
_txt('fd.identifier.login')); ?></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>

Modified: registry/trunk/app/View/Layouts/default.ctp
===================================================================
--- registry/trunk/app/View/Layouts/default.ctp 2012-03-20 22:11:16 UTC (rev
265)
+++ registry/trunk/app/View/Layouts/default.ctp 2012-03-20 22:13:01 UTC (rev
266)
@@ -164,6 +164,12 @@
text: false
});

+ $(".forwardbutton").button({
+ icons: {
+ primary: 'ui-icon-circle-arrow-e'
+ }
+ });
+
$(".invitebutton").button({
icons: {
primary: 'ui-icon-mail-closed'

Modified: registry/trunk/app/View/OrgIdentities/fields.inc
===================================================================
--- registry/trunk/app/View/OrgIdentities/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/OrgIdentities/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -87,7 +87,7 @@
<tr class="line1">
<td>
<?php
- echo _txt('fd.name.h');
+ echo _txt('fd.name.honorific');

if($e)
echo " " . _txt('fd.name.h.desc');
@@ -103,7 +103,7 @@
</tr>
<tr class="line2">
<td>
- <?php echo _txt('fd.name.g'); ?><font class="required">*</font>
+ <?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'])); ?>
@@ -111,14 +111,14 @@
</tr>
<tr class="line1">
<td>
- <?php echo _txt('fd.name.m'); ?>
+ <?php echo _txt('fd.name.middle'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('Name.middle') :
Sanitize::html($org_identities[0]['Name']['middle'])); ?>
</td>
<tr class="line2">
<td>
- <?php echo _txt('fd.name.f'); ?>
+ <?php echo _txt('fd.name.family'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('Name.family') :
Sanitize::html($org_identities[0]['Name']['family'])); ?>
@@ -127,7 +127,7 @@
<tr class="line1">
<td>
<?php
- echo _txt('fd.name.s');
+ echo _txt('fd.name.suffix');

if($e)
echo " " . _txt('fd.name.s.desc');
@@ -236,7 +236,7 @@
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<td>
- <?php print _txt('fd.mail'); ?>
+ <?php print _txt('fd.email_address.mail'); ?>
</td>
<td>
<?php
@@ -280,7 +280,7 @@
</tr>
<tr class="line<?php print ($l % 2); $l++; ?>">
<td>
- <?php print _txt('fd.phone'); ?>
+ <?php print _txt('fd.telephone_number.number'); ?>
</td>
<td>
<?php

Modified: registry/trunk/app/View/OrgIdentities/find.ctp
===================================================================
--- registry/trunk/app/View/OrgIdentities/find.ctp 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/OrgIdentities/find.ctp 2012-03-20 22:13:01
UTC (rev 266)
@@ -31,7 +31,7 @@
<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>
- <th><?php echo _txt('fd.mail'); ?></th>
+ <th><?php echo _txt('fd.email_address.mail'); ?></th>
<th><?php echo _txt('op.inv'); ?></th>
</tr>
</thead>

Modified: registry/trunk/app/View/OrgIdentities/index.ctp
===================================================================
--- registry/trunk/app/View/OrgIdentities/index.ctp 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/OrgIdentities/index.ctp 2012-03-20 22:13:01
UTC (rev 266)
@@ -69,7 +69,7 @@
<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>
- <td><?php echo $cm_texts[ $cm_lang ]['en.affil'][
$p['OrgIdentity']['affiliation'] ]; ?></td>
+ <td><?php if(isset($p['OrgIdentity']['affiliation'])) print
_txt('en.affil', null, $p['OrgIdentity']['affiliation']); ?></td>
<td><?php if($p['OrgIdentity']['organization_id'] != "") print
$this->Html->link($p['OrgIdentity']['organization_id'],

array('controller' => 'organizations',

'action' => 'view',

Modified: registry/trunk/app/View/TelephoneNumbers/fields.inc
===================================================================
--- registry/trunk/app/View/TelephoneNumbers/fields.inc 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/TelephoneNumbers/fields.inc 2012-03-20 22:13:01
UTC (rev 266)
@@ -65,7 +65,7 @@
<tbody>
<tr class="line1">
<td>
- <?php echo _txt('fd.phone'); ?>
+ <?php echo _txt('fd.telephone_number.number'); ?>
</td>
<td>
<?php echo ($e ? $this->Form->input('number') :
Sanitize::html($telephone_numbers[0]['TelephoneNumber']['number'])); ?>

Modified: registry/trunk/app/View/TelephoneNumbers/index.ctp
===================================================================
--- registry/trunk/app/View/TelephoneNumbers/index.ctp 2012-03-20 22:11:16
UTC (rev 265)
+++ registry/trunk/app/View/TelephoneNumbers/index.ctp 2012-03-20 22:13:01
UTC (rev 266)
@@ -27,7 +27,7 @@
<table id="telephone_numbers" class="ui-widget">
<thead>
<tr class="ui-widget-header">
- <th><?php echo $this->Paginator->sort('number', _txt('fd.phone'));
?></th>
+ <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>



  • [comanage-dev] r266 - in registry/trunk/app: Config Config/Schema Controller Lib Model View View/Addresses View/CmpEnrollmentConfigurations View/CoEnrollmentAttributes View/CoEnrollmentFlows View/CoExtendedAttributes View/CoPeople View/CoPersonRoles View/CoPetitions View/EmailAddresses View/Identifiers View/Layouts View/OrgIdentities View/TelephoneNumbers, svnlog, 03/20/2012

Archive powered by MHonArc 2.6.16.

Top of Page