comanage-dev - [comanage-dev] r635 - in registry/trunk/app: Controller Model View/CoPeople
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r635 - in registry/trunk/app: Controller Model View/CoPeople
- Date: Sat, 7 Dec 2013 15:43:58 -0500
Author: benno
Date: 2013-12-07 15:43:58 -0500 (Sat, 07 Dec 2013)
New Revision: 635
Modified:
registry/trunk/app/Controller/CoInvitesController.php
registry/trunk/app/Controller/CoPetitionsController.php
registry/trunk/app/Model/CoInvite.php
registry/trunk/app/Model/CoPetition.php
registry/trunk/app/View/CoPeople/index.ctp
Log:
Use enrollment flow texts when resending petition invitation (CO-681)
Modified: registry/trunk/app/Controller/CoInvitesController.php
===================================================================
--- registry/trunk/app/Controller/CoInvitesController.php 2013-12-04
21:48:08 UTC (rev 634)
+++ registry/trunk/app/Controller/CoInvitesController.php 2013-12-07
20:43:58 UTC (rev 635)
@@ -487,9 +487,7 @@
$orgp['OrgIdentity']['id'],
$this->Session->read('Auth.User.co_person_id'),
$orgp['EmailAddress'][0]['mail'],
-
isset($this->cur_co['CoEnrollmentFlow'][0]['notify_from'])
- ?
$this->cur_co['CoEnrollmentFlow'][0]['notify_from']
- : null,
+ null,
$this->cur_co['Co']['name']);
$this->Session->setFlash(_txt('em.invite.ok',
array($orgp['EmailAddress'][0]['mail'])), '', array(), 'success');
Modified: registry/trunk/app/Controller/CoPetitionsController.php
===================================================================
--- registry/trunk/app/Controller/CoPetitionsController.php 2013-12-04
21:48:08 UTC (rev 634)
+++ registry/trunk/app/Controller/CoPetitionsController.php 2013-12-07
20:43:58 UTC (rev 635)
@@ -551,12 +551,21 @@
$this->Session->setFlash(_txt('rs.inv.sent', array($recipient)), '',
array(), 'success');
}
- // Redirect back to index
+ // Redirect back to index. We might have gotten here via co_petitions or
co_people,
+ // so try to figure out the right place to go back to.
- $this->redirect(array(
- 'controller' => 'co_petitions',
- 'action' => 'index',
- 'co' => $this->cur_co['Co']['id']
- ));
+ if(strstr($this->request->referer(), 'co_petitions')) {
+ $this->redirect(array(
+ 'controller' => 'co_petitions',
+ 'action' => 'index',
+ 'co' => $this->cur_co['Co']['id']
+ ));
+ } else {
+ $this->redirect(array(
+ 'controller' => 'co_people',
+ 'action' => 'index',
+ 'co' => $this->cur_co['Co']['id']
+ ));
+ }
}
}
Modified: registry/trunk/app/Model/CoInvite.php
===================================================================
--- registry/trunk/app/Model/CoInvite.php 2013-12-04 21:48:08 UTC (rev
634)
+++ registry/trunk/app/Model/CoInvite.php 2013-12-07 20:43:58 UTC (rev
635)
@@ -272,8 +272,13 @@
public function send($coPersonId, $orgIdentityID, $actorPersonId,
$toEmail, $fromEmail=null, $coName, $subject=null, $template=null) {
// Toss any prior invitations for $coPersonId to $toEmail
- $this->deleteAll(array('co_person_id' => $coPersonId,
- 'mail' => $toEmail));
+ try {
+ $this->deleteAll(array('co_person_id' => $coPersonId,
+ 'mail' => $toEmail));
+ }
+ catch(Exception $e) {
+ throw RuntimeException($e->getMessage());
+ }
$invite = array();
$invite['CoInvite']['co_person_id'] = $coPersonId;
Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2013-12-04 21:48:08 UTC (rev
634)
+++ registry/trunk/app/Model/CoPetition.php 2013-12-07 20:43:58 UTC (rev
635)
@@ -1009,7 +1009,11 @@
$email['EmailAddress']['mail'],
$enrollmentFlow['CoEnrollmentFlow']['notify_from'],
$this->Co->field('name',
- array('Co.id' =>
$enrollmentFlow['CoEnrollmentFlow']['co_id'])));
+ array('Co.id' =>
$enrollmentFlow['CoEnrollmentFlow']['co_id'])),
+
!empty($enrollmentFlow['CoEnrollmentFlow']['verification_subject'])
+ ?
$enrollmentFlow['CoEnrollmentFlow']['verification_subject'] : null,
+
!empty($enrollmentFlow['CoEnrollmentFlow']['verification_body'])
+ ?
$enrollmentFlow['CoEnrollmentFlow']['verification_body'] : null);
// Update the CO Petition with the new invite ID
Modified: registry/trunk/app/View/CoPeople/index.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/index.ctp 2013-12-04 21:48:08 UTC (rev
634)
+++ registry/trunk/app/View/CoPeople/index.ctp 2013-12-07 20:43:58 UTC (rev
635)
@@ -285,8 +285,8 @@
. "\n";
if($permissions['invite']
- && ($p['CoPerson']['status'] != StatusEnum::Active
- && $p['CoPerson']['status'] != StatusEnum::Deleted)) {
+ && ($p['CoPerson']['status'] == StatusEnum::Pending
+ || $p['CoPerson']['status'] == StatusEnum::Invited)) {
print '<button class="invitebutton" title="'
. _txt('op.inv.resend')
. '"
onclick="javascript:noprop(event);js_confirm_reinvite(\''
@@ -300,6 +300,21 @@
. _txt('op.inv.resend')
. '</button>'
. "\n";
+ } elseif($permissions['enroll']
+ && $p['CoPerson']['status'] ==
StatusEnum::PendingConfirmation) {
+ print '<button class="invitebutton" title="'
+ . _txt('op.inv.resend')
+ . '"
onclick="javascript:noprop(event);js_confirm_reinvite(\''
+ . _jtxt(Sanitize::html(generateCn($p['PrimaryName'])))
+ . '\', \''
+ . $this->Html->url(array('controller' => 'co_petitions',
+ 'action' => 'resend',
+
$p['CoInvite']['CoPetition']['id'],
+ 'co' =>
$cur_co['Co']['id']))
+ . '\')";>'
+ . _txt('op.inv.resend')
+ . '</button>'
+ . "\n";
}
}
?>
- [comanage-dev] r635 - in registry/trunk/app: Controller Model View/CoPeople, svnlog, 12/07/2013
Archive powered by MHonArc 2.6.16.