comanage-dev - [comanage-dev] r494 - in registry/trunk/app: Lib Model
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r494 - in registry/trunk/app: Lib Model
- Date: Fri, 12 Apr 2013 20:46:21 -0400
- Authentication-results: sfpop-ironport01.merit.edu; dkim=neutral (message not signed) header.i=none
Author: benno
Date: 2013-04-12 20:46:21 -0400 (Fri, 12 Apr 2013)
New Revision: 494
Modified:
registry/trunk/app/Lib/enum.php
registry/trunk/app/Model/CoInvite.php
registry/trunk/app/Model/CoPetition.php
Log:
Fix petition status update from "Pending Confirmation" (CO-595)
Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2013-04-12 20:25:44 UTC (rev 493)
+++ registry/trunk/app/Lib/enum.php 2013-04-13 00:46:21 UTC (rev 494)
@@ -284,6 +284,7 @@
{
const Active = 'A';
const Approved = 'Y';
+ const Confirmed = 'C';
const Deleted = 'D';
const Denied = 'N';
const Invited = 'I';
Modified: registry/trunk/app/Model/CoInvite.php
===================================================================
--- registry/trunk/app/Model/CoInvite.php 2013-04-12 20:25:44 UTC (rev
493)
+++ registry/trunk/app/Model/CoInvite.php 2013-04-13 00:46:21 UTC (rev
494)
@@ -119,12 +119,11 @@
}
}
- // Update status to Approved. If this petition requires
approval, updateStatus()
- // will detect that and change the status to PendingApproval
instead.
+ // Update status to Confirmed. updateStatus() will promote to
PendingApproval or whatever
try {
$this->CoPetition->updateStatus($invite['CoPetition']['id'],
- StatusEnum::Approved,
+ StatusEnum::Confirmed,
$invite['CoPetition']['enrollee_co_person_id']);
}
catch(Exception $e) {
Modified: registry/trunk/app/Model/CoPetition.php
===================================================================
--- registry/trunk/app/Model/CoPetition.php 2013-04-12 20:25:44 UTC (rev
493)
+++ registry/trunk/app/Model/CoPetition.php 2013-04-13 00:46:21 UTC (rev
494)
@@ -988,19 +988,24 @@
if($curStatus == StatusEnum::PendingConfirmation) {
// A Petition can go from Pending Confirmation to Pending Approval,
Approved, or Denied.
+ // It can also go to Confirmed, though we'll override that.
if($newStatus == StatusEnum::Approved
+ || $newStatus == StatusEnum::Confirmed
|| $newStatus == StatusEnum::Denied
|| $newStatus == StatusEnum::PendingApproval) {
$valid = true;
}
- // If newStatus is Approved but approval is required, update to
PendingApproval instead
+ // If newStatus is Confirmed, set to PendingApproval or Approved as
necessary,
// and create an additional history record.
- if($newStatus == StatusEnum::Approved
- && $enrollmentFlow['CoEnrollmentFlow']['approval_required']) {
- $newPetitionStatus = StatusEnum::PendingApproval;
+ if($newStatus == StatusEnum::Confirmed) {
+ if($enrollmentFlow['CoEnrollmentFlow']['approval_required']) {
+ $newPetitionStatus = StatusEnum::PendingApproval;
+ } else {
+ $newPetitionStatus = StatusEnum::Approved;
+ }
try {
$this->CoPetitionHistoryRecord->record($id,
@@ -1027,11 +1032,11 @@
$coPersonRoleID = $this->field('enrollee_co_person_role_id');
if($coPersonRoleID) {
- $newCoPersonStatus = $newStatus;
+ $newCoPersonStatus = $newPetitionStatus;
// XXX This is temporary for CO-321 since there isn't currently a way
for an approved person
// to become active. This should be dropped when a more
workflow-oriented mechanism is implemented.
- if($newStatus == StatusEnum::Approved) {
+ if($newPetitionStatus == StatusEnum::Approved) {
$newCoPersonStatus = StatusEnum::Active;
}
}
@@ -1067,6 +1072,9 @@
case StatusEnum::Approved:
$petitionAction = PetitionActionEnum::Approved;
break;
+ case StatusEnum::Confirmed:
+ $petitionAction = PetitionActionEnum::InviteConfirmed;
+ break;
case StatusEnum::Denied:
$petitionAction = PetitionActionEnum::Denied;
break;
@@ -1111,7 +1119,7 @@
}
}
- // Maybe update CO Person state, but only if it's currently Pending
Approval
+ // Maybe update CO Person state, but only if it's currently Pending
Approval or Pending Confirmation
if(!$fail && isset($newCoPersonStatus)) {
$coPersonID = $this->field('enrollee_co_person_id');
@@ -1122,7 +1130,8 @@
$curCoPersonStatus = $this->EnrolleeCoPerson->field('status');
if(isset($curCoPersonStatus)
- && ($curCoPersonStatus == StatusEnum::PendingApproval)) {
+ && ($curCoPersonStatus == StatusEnum::PendingApproval
+ || $curCoPersonStatus == StatusEnum::PendingConfirmation)) {
$this->EnrolleeCoPerson->saveField('status', $newCoPersonStatus);
// Create a history record
@@ -1153,7 +1162,7 @@
// Maybe assign identifiers, but only for new approvals
- if(!$fail && $newStatus == StatusEnum::Approved) {
+ if(!$fail && $newPetitionStatus == StatusEnum::Approved) {
$coID = $this->field('co_id');
$coPersonID = $this->field('enrollee_co_person_id');
- [comanage-dev] r494 - in registry/trunk/app: Lib Model, svnlog, 04/12/2013
Archive powered by MHonArc 2.6.16.