comanage-dev - [comanage-dev] r662 - in registry/trunk/app: Config/Schema Console/Command Controller Controller/Component Lib Model View View/CoLocalizations View/CoNotifications View/Elements View/Pages
Subject: COmanage Developers List
List archive
[comanage-dev] r662 - in registry/trunk/app: Config/Schema Console/Command Controller Controller/Component Lib Model View View/CoLocalizations View/CoNotifications View/Elements View/Pages
Chronological Thread
- From:
- To:
- Subject: [comanage-dev] r662 - in registry/trunk/app: Config/Schema Console/Command Controller Controller/Component Lib Model View View/CoLocalizations View/CoNotifications View/Elements View/Pages
- Date: Sat, 1 Feb 2014 10:21:30 -0500
Author: benno
Date: 2014-02-01 10:21:30 -0500 (Sat, 01 Feb 2014)
New Revision: 662
Added:
registry/trunk/app/Console/Command/NotificationShell.php
registry/trunk/app/Controller/CoNotificationsController.php
registry/trunk/app/Model/CoNotification.php
registry/trunk/app/View/CoNotifications/
registry/trunk/app/View/CoNotifications/fields.inc
registry/trunk/app/View/CoNotifications/view.ctp
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Console/Command/DatabaseShell.php
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoInvitesController.php
registry/trunk/app/Controller/Component/RoleComponent.php
registry/trunk/app/Lib/enum.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/Model/AppModel.php
registry/trunk/app/Model/Co.php
registry/trunk/app/Model/CoGroup.php
registry/trunk/app/Model/CoPerson.php
registry/trunk/app/View/CoLocalizations/fields.inc
registry/trunk/app/View/Elements/secondaryMenu.ctp
registry/trunk/app/View/Pages/home.ctp
Log:
Initial infrastructure for notifications (CO-207)
Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2014-01-25 12:54:19 UTC (rev
661)
+++ registry/trunk/app/Config/Schema/schema.xml 2014-02-01 15:21:30 UTC (rev
662)
@@ -5,7 +5,7 @@
Version: $Revision$
Date: $Date$
- Copyright (C) 2010-2013 University Corporation for Advanced Internet
Development, Inc.
+ Copyright (C) 2010-2014 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
@@ -485,6 +485,50 @@
</index>
</table>
+ <table name="co_notifications">
+ <field name="id" type="I">
+ <key />
+ <autoincrement />
+ </field>
+ <field name="subject_co_person_id" type="I">
+ <notnull />
+ <constraint>REFERENCES cm_co_people(id)</constraint>
+ </field>
+ <field name="actor_co_person_id" type="I">
+ <constraint>REFERENCES cm_co_people(id)</constraint>
+ </field>
+ <field name="recipient_co_person_id" type="I">
+ <constraint>REFERENCES cm_co_people(id)</constraint>
+ </field>
+ <field name="recipient_co_group_id" type="I">
+ <constraint>REFERENCES cm_co_groups(id)</constraint>
+ </field>
+ <field name="resolver_co_person_id" type="I">
+ <constraint>REFERENCES cm_co_people(id)</constraint>
+ </field>
+ <field name="action" type="C" size="4" />
+ <field name="comment" type="C" size="160" />
+ <field name="source_url" type="C" size="160" />
+ <field name="source_controller" type="C" size="80" />
+ <field name="source_action" type="C" size="80" />
+ <field name="source_id" type="I" />
+ <field name="status" type="C" size="2" />
+ <field name="notification_time" type="T" />
+ <field name="resolution_time" type="T" />
+ <field name="created" type="T" />
+ <field name="modified" type="T" />
+
+ <index name="co_notifications_i1">
+ <col>subject_co_person_id</col>
+ </index>
+ <index name="co_notifications_i2">
+ <col>recipient_co_person_id</col>
+ </index>
+ <index name="co_notifications_i3">
+ <col>recipient_co_graup_id</col>
+ </index>
+ </table>
+
<table name="cmp_enrollment_configurations">
<field name="id" type="I">
<key />
@@ -832,13 +876,13 @@
<field name="created" type="T" />
<field name="modified" type="T" />
- <index name="co_history_records_i1">
+ <index name="history_records_i1">
<col>co_person_id</col>
</index>
- <index name="co_history_records_i2">
+ <index name="history_records_i2">
<col>co_person_role_id</col>
</index>
- <index name="co_history_records_i3">
+ <index name="history_records_i3">
<col>org_identity_id</col>
</index>
</table>
Modified: registry/trunk/app/Console/Command/DatabaseShell.php
===================================================================
--- registry/trunk/app/Console/Command/DatabaseShell.php 2014-01-25
12:54:19 UTC (rev 661)
+++ registry/trunk/app/Console/Command/DatabaseShell.php 2014-02-01
15:21:30 UTC (rev 662)
@@ -35,7 +35,6 @@
class DatabaseShell extends AppShell {
function main()
{
- print get_include_path();
// Database schema management. We use adodb rather than Cake's native
schema
// management because the latter is lacking (foreign keys not
migrated, hard
// to do upgrades).
Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2014-01-25 12:54:19
UTC (rev 661)
+++ registry/trunk/app/Controller/AppController.php 2014-02-01 15:21:30
UTC (rev 662)
@@ -2,7 +2,7 @@
/**
* Application level Controller
*
- * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-14 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-13 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1, CakePHP(tm) v 0.2.9
@@ -276,10 +276,24 @@
$this->menuAuth();
$this->menuContent();
$this->getNavLinks();
+ $this->getNotifications();
}
}
/**
+ * Determine the CO ID based on some attribute of the request.
+ * This method is intended to be overridden by model-specific controllers.
+ *
+ * @since COmanage Registry v0.9
+ * @return Integer CO ID, or null if not implemented or not applicable.
+ * @throws InvalidArgumentException
+ */
+
+ protected function calculateImpliedCoId() {
+ return null;
+ }
+
+ /**
* Compare two arrays and generate a string describing what changed,
suitable for
* including in a history record.
*
@@ -1070,6 +1084,24 @@
}
/**
+ * Obtain notifications for the currently logged in user, if any
+ * - precondition: Session.Auth holds current CO Person ID
+ * - postcondition: $vv_my_notifications will be set
+ *
+ * @since COmanage Registry v0.9
+ */
+
+ protected function getNotifications() {
+ $copersonid = $this->Session->read('Auth.User.co_person_id');
+
+ if(!empty($copersonid)) {
+ $this->loadModel('CoNotification');
+
+ $this->set('vv_my_notifications',
$this->CoNotification->pending($copersonid));
+ }
+ }
+
+ /**
* Called from beforeRender to set permissions for display in menus
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: permissions for menu are set
@@ -1244,16 +1276,20 @@
// Get a pointer to our model
$req = $this->modelClass;
- $coid = -1;
+ // First try to look up the CO ID based on the request. This will become
more
+ // common as part of CO-620.
+ $coid = $this->calculateImpliedCoId();
- if(isset($this->params['named']['co']))
- $coid = $this->params['named']['co'];
- elseif(isset($this->request->data['Co']['id']))
- $coid = $this->request->data['Co']['id'];
- elseif(isset($this->request->data[$req]['co_id']))
- $coid = $this->request->data[$req]['co_id'];
- elseif(isset($this->impliedCoId))
- $coid = $this->impliedCoId;
+ if(!$coid) {
+ if(isset($this->params['named']['co']))
+ $coid = $this->params['named']['co'];
+ elseif(isset($this->request->data['Co']['id']))
+ $coid = $this->request->data['Co']['id'];
+ elseif(isset($this->request->data[$req]['co_id']))
+ $coid = $this->request->data[$req]['co_id'];
+ else
+ $coid = -1;
+ }
return $coid;
}
@@ -1418,6 +1454,7 @@
* @since COmanage Registry v0.8
* @return Boolean True if sanity check is successful
* @throws InvalidArgumentException
+ * @todo This can probably be thrown away after CO-620 is fully
implemented
*/
public function verifyRequestedId() {
Modified: registry/trunk/app/Controller/CoInvitesController.php
===================================================================
--- registry/trunk/app/Controller/CoInvitesController.php 2014-01-25
12:54:19 UTC (rev 661)
+++ registry/trunk/app/Controller/CoInvitesController.php 2014-02-01
15:21:30 UTC (rev 662)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Invite Controller
*
- * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-14 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-13 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -94,9 +94,27 @@
*/
function beforeFilter() {
- if($this->action == "send")
+ if($this->action == "send") {
$this->requires_co = true;
+ }
+ // Since we're overriding, we need to call the parent to run the authz
check
+ parent::beforeFilter();
+
+ // Allow invite handling to process without a login page
+ $this->Auth->allow('confirm', 'decline', 'reply');
+ }
+
+ /**
+ * Determine the CO ID based on some attribute of the request.
+ * This method is intended to be overridden by model-specific controllers.
+ *
+ * @since COmanage Registry v0.9
+ * @return Integer CO ID, or null if not implemented or not applicable.
+ * @throws InvalidArgumentException
+ */
+
+ protected function calculateImpliedCoId() {
if($this->action == "confirm" || $this->action == "authconfirm") {
// Identifier assignment requires the CO ID to be set, but since CO ID
isn't
// provided as an explicit parameter, beforeFilter can't find it.
@@ -111,16 +129,16 @@
$coPerson = $this->CoInvite->CoPerson->find('first', $args);
- if(isset($coPerson['CoPerson']['co_id'])) {
- $this->impliedCoId = $coPerson['CoPerson']['co_id'];
+ if(!empty($coPerson['CoPerson']['co_id'])) {
+ return $coPerson['CoPerson']['co_id'];
+ } else {
+ throw InvalidArgumentException(_txt('er.notfound',
+ array(_txt('ct.co_invites.1'),
+
Sanitize::html($this->request->params['pass'][0]))));
}
}
- // Since we're overriding, we need to call the parent to run the authz
check
- parent::beforeFilter();
-
- // Allow invite handling to process without a login page
- $this->Auth->allow('confirm', 'decline', 'reply');
+ return null;
}
/**
Modified: registry/trunk/app/Controller/Component/RoleComponent.php
===================================================================
--- registry/trunk/app/Controller/Component/RoleComponent.php 2014-01-25
12:54:19 UTC (rev 661)
+++ registry/trunk/app/Controller/Component/RoleComponent.php 2014-02-01
15:21:30 UTC (rev 662)
@@ -2,7 +2,7 @@
/**
* COmanage Registy Role Component Model
*
- * Copyright (C) 2012-3 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2012-14 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-3 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2012-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.8
@@ -402,6 +402,67 @@
}
/**
+ * Determine if a CO Person can request email verification for another CO
Person.
+ *
+ * @since COmanage Registry v0.9
+ * @param Integer CO Person ID of requestor
+ * @param Integer Email Address ID to request email verification of
+ * @return Boolean True if email verification may be requested, false
otherwise
+ * @throws InvalidArgumentException
+ */
+
+ public function canRequestVerificationOfEmailAddress($coPersonId,
$emailAddressId) {
+ // First pull the email address
+ $args = array();
+ $args['conditions']['EmailAddress.id'] = $emailAddressId;
+ $args['contain'] = false;
+
+ $EmailAddress = ClassRegistry::init('EmailAddress');
+
+ $ea = $EmailAddress->find('first', $args);
+
+ if(empty($ea)) {
+ throw new InvalidArgumentException(_txt('er.notfound',
array(_txt('ct.email_addresses.1'), $emailAddressId)));
+ }
+
+ // One can request their own verification
+
+ if(!empty($ea['EmailAddress']['co_person_id'])
+ && $coPersonId == $ea['EmailAddress']['co_person_id']) {
+ return true;
+ }
+
+ if(!empty($ea['EmailAddress']['org_identity_id'])) {
+ // See if the CO Person and org identity are linked (ie: are the same
person)
+
+ $Link = ClassRegistry::init('CoOrgIdentityLink');
+
+ $args = array();
+ $args['conditions']['CoOrgIdentityLink.co_person_id'] = $coPersonId;
+ $args['conditions']['CoOrgIdentityLink.org_identity_id'] =
$ea['EmailAddress']['org_identity_id'];
+ $args['contain'] = false;
+
+ if($Link->find('count', $args) > 0) {
+ return true;
+ }
+ }
+
+ // A CO or COU Admin can request verification
+
+ if(!empty($ea['EmailAddress']['co_person_id'])
+ && $this->isCoOrCouAdminForCoPerson($coPersonId,
$ea['EmailAddress']['co_person_id'])) {
+ return true;
+ }
+
+ if(!empty($ea['EmailAddress']['org_identity_id'])
+ && $this->isCoOrCouAdminForOrgIdentity($coPersonId,
$ea['EmailAddress']['org_identity_id'])) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
* Determine what COUs a CO Person is a COU Admin for. Note this function
will return
* no COUs if the CO Person is a CO Admin but not a COU Admin.
*
@@ -875,7 +936,6 @@
* @since COmanage Registry v0.8
* @param Integer CO Person ID of potential CO(U) Admin
* @param Integer CO Person ID of subject
- * @param Integer CO ID
* @return Boolean True if the CO Person is a CO or COU Administrator for
the subject, false otherwise
*/
@@ -1116,4 +1176,113 @@
return $this->isCoAdmin($coPersonId, $coId);
}
+
+ /**
+ * Determine if a CO Person is a participant (subject, recipient, or
actor) for a CO Notification.
+ *
+ * @since COmanage Registry v0.9
+ * @param Integer $coNotificationId CO Notification ID
+ * @param Integer $coPersonId CO Person ID
+ * @return Boolean True if the CO Person ID is a participant in the
notification, false otherwise
+ * @throws InvalidArgumentException
+ */
+
+ public function isNotificationParticipant($coNotificationId,
+ $coPersonId) {
+ return $this->isNotificationRole($coNotificationId, $coPersonId,
'participant');
+ }
+
+ /**
+ * Determine if a CO Person is a recipient of a CO Notification.
+ *
+ * @since COmanage Registry v0.9
+ * @param Integer $coNotificationId CO Notification ID
+ * @param Integer $coPersonId CO Person ID
+ * @return Boolean True if the CO Person ID is a recipient of the
notification, false otherwise
+ * @throws InvalidArgumentException
+ */
+
+ public function isNotificationRecipient($coNotificationId,
+ $coPersonId) {
+ return $this->isNotificationRole($coNotificationId, $coPersonId,
'recipient');
+ }
+
+ /**
+ * Determine if a CO Person has the specified role for a CO Notification.
+ *
+ * @since COmanage Registry v0.9
+ * @param Integer $coNotificationId CO Notification ID
+ * @param Integer $coPersonId CO Person ID
+ * @param String $role 'actor', 'participant', 'recipient',
'subject'
+ * @return Boolean True if the CO Person ID has the specified role for
the notification, false otherwise
+ * @throws InvalidArgumentException
+ */
+
+ protected function isNotificationRole($coNotificationId,
+ $coPersonId,
+ $role) {
+ // Check the cache
+
if(isset($this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]))
{
+ return
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role];
+ }
+
+ $CoNotification = ClassRegistry::init('CoNotification');
+
+ $not = $CoNotification->findById($coNotificationId);
+
+ if(!empty($not['CoNotification'])) {
+ if(($role == 'actor' || $role == 'participant')
+ && $not['CoNotification']['actor_co_person_id'] == $coPersonId) {
+
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]
= true;
+
+ return true;
+ }
+
+ if($role == 'recipient' || $role == 'participant') {
+ if($not['CoNotification']['recipient_co_person_id'] == $coPersonId) {
+
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]
= true;
+
+ return true;
+ }
+
+ // Check the recipient group
+ if(!empty($not['CoNotification']['recipient_co_group_id'])) {
+ if($this->cachedGroupCheck($coPersonId, "", "",
$not['CoNotification']['recipient_co_group_id'])) {
+
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]
= true;
+
+ return true;
+ }
+ }
+ }
+
+ if(($role == 'subject' || $role == 'participant')
+ && $not['CoNotification']['subject_co_person_id'] == $coPersonId) {
+
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]
= true;
+
+ return true;
+ }
+ } else {
+ throw new InvalidArgumentException(_txt('er.notfound',
+
array(_txt('ct.co_notifications.1'), $coNotificationId)));
+ }
+
+
$this->cache['coperson'][$coPersonId]['co_notification'][$coNotificationId][$role]
= false;
+
+ return false;
+ }
+
+ /**
+ * Determine if a CO Person is the sender of a CO Notification.
+ *
+ * @since COmanage Registry v0.9
+ * @param Integer $coNotificationId CO Notification ID
+ * @param Integer $coPersonId CO Person ID
+ * @return Boolean True if the CO Person ID is the sender of the
notification, false otherwise
+ * @throws InvalidArgumentException
+ */
+
+ public function isNotificationSender($coNotificationId,
+ $coPersonId) {
+ return $this->isNotificationRole($coNotificationId, $coPersonId,
'actor');
+ }
}
\ No newline at end of file
Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2014-01-25 12:54:19 UTC (rev 661)
+++ registry/trunk/app/Lib/enum.php 2014-02-01 15:21:30 UTC (rev 662)
@@ -56,6 +56,10 @@
const NameDeleted = 'DNAM';
const NameEdited = 'ENAM';
const NamePrimary = 'PNAM';
+ const NotificationAcknowledged = 'NOTA';
+ const NotificationCanceled = 'NOTX';
+ const NotificationDelivered = 'NOTD';
+ const NotificationResolved = 'NOTR';
const OrgIdAddedManual = 'AOIM';
const OrgIdAddedPetition = 'AOIP';
const OrgIdEditedManual = 'EOIM';
@@ -229,6 +233,16 @@
);*/
}
+class NotificationStatusEnum
+{
+ const Acknowledged = 'A';
+ const Canceled = 'X';
+ const Deleted = 'D';
+ const PendingAcknowledgment = 'PA';
+ const PendingResolution = 'PR';
+ const Resolved = 'R';
+}
+
class NSFRaceEnum
{
const Asian = 'A';
Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2014-01-25 12:54:19 UTC (rev 661)
+++ registry/trunk/app/Lib/lang.php 2014-02-01 15:21:30 UTC (rev 662)
@@ -78,10 +78,12 @@
'ct.co_groups.1' => 'Group',
'ct.co_groups.pl' => 'Groups',
'ct.co_invites.1' => 'Invite',
- 'ct.co_localizations.1' => 'Localization',
- 'ct.co_localizations.pl' => 'Localizations',
+ 'ct.co_localizations.1' => 'Localization',
+ 'ct.co_localizations.pl' => 'Localizations',
'ct.co_navigation_links.1' => 'Navigation Link',
'ct.co_navigation_links.pl' => 'Navigation Links',
+ 'ct.co_notifications.1' => 'Notification',
+ 'ct.co_notifications.pl' => 'Notifications',
'ct.co_invites.pl' => 'Invites',
'ct.co_nsf_demographics.1' => 'NSF Demographic Record',
'ct.co_nsf_demographics.pl' => 'NSF Demographic Records',
@@ -166,6 +168,10 @@
ActionEnum::InvitationDeclined => 'Invitation Declined',
ActionEnum::InvitationExpired => 'Invitation Expired',
ActionEnum::InvitationSent => 'Invitation Sent',
+ ActionEnum::NotificationAcknowledged => 'Notification Acknowledged',
+ ActionEnum::NotificationCanceled => 'Notification Canceled',
+ ActionEnum::NotificationDelivered => 'Notification Delivered',
+ ActionEnum::NotificationResolved => 'Notification Resolved',
ActionEnum::OrgIdAddedManual => 'Org Identity Created
(Manual)',
ActionEnum::OrgIdAddedPetition => 'Org Identity Created
(Petition)',
ActionEnum::OrgIdEditedManual => 'Org Identity Edited
(Manual)',
@@ -309,6 +315,15 @@
StatusEnum::PendingConfirmation => 'Pending
Confirmation',
StatusEnum::Suspended => 'Suspended'),
+ 'en.status.not' => array(
+ NotificationStatusEnum::Acknowledged => 'Acknowledged',
+ NotificationStatusEnum::Canceled => 'Canceled',
+ NotificationStatusEnum::Deleted => 'Deleted',
+ NotificationStatusEnum::PendingAcknowledgment => 'Pending
Acknowledgment',
+ NotificationStatusEnum::PendingResolution => 'Pending Resolution',
+ NotificationStatusEnum::Resolved => 'Resolved'
+ ),
+
'en.status.prov' => array(
ProvisionerStatusEnum::AutomaticMode => 'Automatic Mode',
ProvisionerStatusEnum::ManualMode => 'Manual Mode',
@@ -424,13 +439,17 @@
'er.ia.failed' => 'Failed to find a unique identifier to assign',
'er.ia.none' => 'No identifier assignments configured',
'er.id.unk' => 'Unknown Identifier',
+ 'er.id.unk-a' => 'Unknown Identifier "%1$s"',
'er.inv.exp' => 'Invitation Expired',
'er.inv.exp.use' => 'Processing of invitation failed due to invitation
expiration',
'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.ack' => 'Notification is not pending acknowledgment and cannot
be acknowledged',
+ 'er.nt.cxl' => 'Notification is not pending and cannot be canceled',
'er.nt.email' => 'Notification could not be sent because no email
address was found',
+ 'er.nt.res' => 'Notification is not pending resolution and cannot be
resolved',
'er.nt.send' => 'Notification to %1$s failed (%2$s)',
'er.notfound' => '%1$s "%2$s" Not Found',
'er.notprov' => 'Not Provided',
@@ -646,6 +665,7 @@
'fd.name.primary_name' => 'Primary',
'fd.name.fields.req' => 'A name must consist of at least these fields:',
'fd.no' => 'No',
+ 'fd.not.last' => 'Last Notification',
'fd.null' => 'Null',
'fd.o' => 'Organization',
'fd.open' => 'Open',
@@ -660,13 +680,17 @@
'fd.plugin.ptwarn' => 'Once a Provisioning Target has been created, the
Plugin cannot be changed',
'fd.prov.status.for' => 'Provisioning Status for %1$s',
'fd.pt.required' => '† denotes required fields if you populate this
section',
+ 'fd.recipient' => 'Recipient',
'fd.req' => '* denotes required field',
'fd.required' => 'Required',
+ 'fd.resolved' => 'Resolved',
'fd.roles' => 'Roles',
'fd.searchbase' => 'Search Base',
+ 'fd.source' => 'Source',
'fd.sponsor' => 'Sponsor',
'fd.sponsor.desc' =>'(for continued membership)',
'fd.status' => 'Status',
+ 'fd.subject' => 'Subject',
'fd.tc.agree.desc' => 'You must agree to the following Terms and
Conditions before continuing.<br />You must review the T&C before you can
click <i>I Agree</i>, and you must agree before you can submit.',
'fd.tc.agree.no' => 'Not Agreed',
'fd.tc.agree.yes' => 'Agreed',
@@ -712,6 +736,7 @@
// Operations
'op.accept' => 'Accept',
+ 'op.ack' => 'Acknowledge',
'op.add' => 'Add',
'op.add-a' => 'Add "%1$s"',
'op.add.new' => 'Add a New %1$s',
@@ -801,6 +826,13 @@
'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.ackd' => 'Notification acknowledged',
+ 'rs.nt.ackd-a' => 'Notification acknowledged: "%1$s"',
+ 'rs.nt.cxld' => 'Notification canceled',
+ 'rs.nt.cxld-a' => 'Notification canceled: "%1$s"',
+ 'rs.nt.delivered' => 'Notification delivered: "%1$s"',
+ 'rs.nt.delivered.email' => 'Notification delivered to %1$s: "%2$s"',
+ 'rs.nt.resd-a' => 'Notification resolved: "%1$s"',
'rs.nt.sent' => 'Approval notification sent to %1$s',
'rs.prov-a' => 'Provisioned %1$s',
'rs.prov.ok' => 'Provisioning completed successfully',
Modified: registry/trunk/app/Model/AppModel.php
===================================================================
--- registry/trunk/app/Model/AppModel.php 2014-01-25 12:54:19 UTC (rev
661)
+++ registry/trunk/app/Model/AppModel.php 2014-02-01 15:21:30 UTC (rev
662)
@@ -209,6 +209,18 @@
if(!empty($copt['CoProvisioningTarget']['co_id'])) {
return $copt['CoProvisioningTarget']['co_id'];
}
+ } elseif(isset($this->validate['subject_co_person_id'])) {
+ // Notifications will reference a subject CO Person
+
+ $args = array();
+ $args['conditions'][$this->alias.'.id'] = $id;
+ $args['contain'][] = 'SubjectCoPerson';
+
+ $cop = $this->find('first', $args);
+
+ if(!empty($cop['SubjectCoPerson']['co_id'])) {
+ return $cop['SubjectCoPerson']['co_id'];
+ }
} else {
throw new LogicException(_txt('er.co.fail'));
}
Modified: registry/trunk/app/Model/Co.php
===================================================================
--- registry/trunk/app/Model/Co.php 2014-01-25 12:54:19 UTC (rev 661)
+++ registry/trunk/app/Model/Co.php 2014-02-01 15:21:30 UTC (rev 662)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Model
*
- * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-14 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-13 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -76,7 +76,8 @@
'allowEmpty' => true
),
'status' => array(
- 'rule' => array('inList', array('A', 'S')),
+ 'rule' => array('inList', array(SuspendableStatusEnum::Active,
+ SuspendableStatusEnum::Suspended)),
'required' => true,
'message' => 'A valid status must be selected'
)
Modified: registry/trunk/app/Model/CoGroup.php
===================================================================
--- registry/trunk/app/Model/CoGroup.php 2014-01-25 12:54:19 UTC (rev
661)
+++ registry/trunk/app/Model/CoGroup.php 2014-02-01 15:21:30 UTC (rev
662)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Group Model
*
- * Copyright (C) 2011-13 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2011-14 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-13 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2011-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -41,6 +41,10 @@
'className' => 'CoEnrollmentFlow',
'foreignKey' => 'authz_co_group_id'
),
+ "CoNotificationRecipient" => array(
+ 'className' => 'CoNotification',
+ 'foreignKey' => 'recipient_co_group_id'
+ ),
"CoProvisioningExport" => array('dependent' => true)
);
@@ -50,7 +54,8 @@
public $displayField = "name";
// Default ordering for find operations
- public $order = array("CoGroup.name");
+// XXX CO-296 Toss default order?
+// public $order = array("CoGroup.name");
public $actsAs = array('Containable', 'Provisioner');
Modified: registry/trunk/app/Model/CoPerson.php
===================================================================
--- registry/trunk/app/Model/CoPerson.php 2014-01-25 12:54:19 UTC (rev
661)
+++ registry/trunk/app/Model/CoPerson.php 2014-02-01 15:21:30 UTC (rev
662)
@@ -2,7 +2,7 @@
/**
* COmanage Registry CO Person Model
*
- * Copyright (C) 2010-13 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-14 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-13 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2010-14 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.1
@@ -51,6 +51,22 @@
public $hasMany = array(
// A person can have one or more groups
"CoGroupMember" => array('dependent' => true),
+ "CoNotificationSubject" => array(
+ 'className' => 'CoNotification',
+ 'foreignKey' => 'subject_co_person_id'
+ ),
+ "CoNotificationActor" => array(
+ 'className' => 'CoNotification',
+ 'foreignKey' => 'actor_co_person_id'
+ ),
+ "CoNotificationRecipient" => array(
+ 'className' => 'CoNotification',
+ 'foreignKey' => 'recipient_co_person_id'
+ ),
+ "CoNotificationResolver" => array(
+ 'className' => 'CoNotification',
+ 'foreignKey' => 'resolver_co_person_id'
+ ),
// A person can have more than one org identity
"CoOrgIdentityLink" => array('dependent' => true),
// A person can have one or more person roles
Modified: registry/trunk/app/View/CoLocalizations/fields.inc
===================================================================
--- registry/trunk/app/View/CoLocalizations/fields.inc 2014-01-25 12:54:19
UTC (rev 661)
+++ registry/trunk/app/View/CoLocalizations/fields.inc 2014-02-01 15:21:30
UTC (rev 662)
@@ -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) 201 University Corporation for Advanced
Internet Development, Inc.
+ * @copyright Copyright (C) 2013 University Corporation for Advanced
Internet Development, Inc.
* @link http://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v0.8.3
@@ -59,7 +59,7 @@
<tbody>
<tr class="line1">
<td>
- <b><?php print _txt('fd.key'); ?></b></b><font
class="required">*</font>
+ <b><?php print _txt('fd.key'); ?></b><font class="required">*</font>
</td>
<td>
<?php
Property changes on: registry/trunk/app/View/CoNotifications/view.ctp
___________________________________________________________________
Added: svn:special
+ *
Modified: registry/trunk/app/View/Elements/secondaryMenu.ctp
===================================================================
--- registry/trunk/app/View/Elements/secondaryMenu.ctp 2014-01-25 12:54:19
UTC (rev 661)
+++ registry/trunk/app/View/Elements/secondaryMenu.ctp 2014-02-01 15:21:30
UTC (rev 662)
@@ -46,70 +46,43 @@
}
?>
- <?php if($this->Session->check('Auth.User') != NULL) :
- // Notification Dropdown
- ?>
+ <?php if(isset($vv_my_notifications)): ?>
<div id="notification">
<ul class="sf-menu">
<li>
<a>
<span>
- <?php
- // XXX placeholder until notifications is implemented
- $notifArray['approval'] = array();
- $notifArray['accepted'] = array();
-
- /*
- $notifArray['approval'] = array("Scott Koranda (UWM)",
- "Stuart Anderson (CalTech)",
- "Benn Oshrin (Internet2)");
- $notifArray['accepted'] = array("Scott Koranda (UWM)",
- "Stuart Anderson (CalTech)",
- "Heather Flanagan (Internet2)");
- */
-
- $notificationCount = count($notifArray['approval']) +
count($notifArray['accepted']);
- print $notificationCount ? $notificationCount : 0 ?>
+ <?php print count($vv_my_notifications); ?>
</span>
<span class="ui-icon ui-icon-mail-closed"></span>
</a>
<ul>
<div>
- <?php if(count($notifArray['approval']) > 0) : ?>
- <div class='sectionTitle titleColor'>Pending Your
Approval:</div>
- <div class='names'>
- <?php foreach($notifArray['approval'] as $n) {
- print $n;
- print "<br>";
- } ?>
- </div>
- <div class = "seemore">
- <a href="#">See More »</a>
- </div>
- <?php endif; // count($notifArray['approval']) > 0 ?>
-
- <?php if(count($notifArray['accepted']) > 0) : ?>
- <div class='sectionTitle titleColor'>Accepted
Invitations:</div>
- <div class='names'>
- <?php foreach($notifArray['accepted'] as $n) {
- print $n;
- print "<br>";
- } ?>
- </div>
- <div class = "seemore">
- <a href="#">See More »</a>
- </div>
- <?php endif; // count($notifArray['accepted']) > 0 ?>
-
- <div class="seeOther">
- <a href="#">See Other Notifications »</a>
+ <!-- XXX use this div class? -->
+ <!-- XXX list maybe 10 max, then link to index view -->
+ <?php foreach($vv_my_notifications as $n): ?>
+ <div class="names">
+ <?php
+ $args = array(
+ 'controller' => 'co_notifications',
+ 'action' => 'view',
+ $n['CoNotification']['id']
+ );
+
+ print $this->Html->link($n['CoNotification']['comment']
+ . " ("
+ .
$this->Time->timeAgoInWords($n['CoNotification']['created'])
+ . ")",
+ $args);
+ ?>
</div>
+ <?php endforeach; ?>
</div>
</ul>
</li>
</ul>
</div>
- <?php endif; // $this->Session->check('Auth.User') != NULL ?>
+ <?php endif; ?>
<?php if (!isset($noLoginLogout)) : ?>
<div id="logout">
Modified: registry/trunk/app/View/Pages/home.ctp
===================================================================
--- registry/trunk/app/View/Pages/home.ctp 2014-01-25 12:54:19 UTC (rev
661)
+++ registry/trunk/app/View/Pages/home.ctp 2014-02-01 15:21:30 UTC (rev
662)
@@ -9,7 +9,7 @@
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agrxeed to in writing, software
distributed under
+ * Unless required by applicable law or agreed to in writing, software
distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
* KIND, either express or implied. See the License for the specific
language governing
* permissions and limitations under the License.
- [comanage-dev] r662 - in registry/trunk/app: Config/Schema Console/Command Controller Controller/Component Lib Model View View/CoLocalizations View/CoNotifications View/Elements View/Pages, svnlog, 02/01/2014
Archive powered by MHonArc 2.6.16.