Skip to content
2 changes: 1 addition & 1 deletion class/WorkflowState/CancelledState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class CancelledState extends WorkflowState {
const friendlyName = 'Cancelled';
const sortIndex = 8;
const sortIndex = 9;
}
8 changes: 8 additions & 0 deletions class/WorkflowState/DeanApprovedGradPendingState.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace Intern\WorkflowState;
use Intern\WorkflowState;

class DeanApprovedGradPendingState extends WorkflowState {
const friendlyName = 'Dean Approved / Pending Graduate School Approval';
const sortIndex = 5;
}
2 changes: 1 addition & 1 deletion class/WorkflowState/GradSchoolApprovedState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class GradSchoolApprovedState extends WorkflowState {
const friendlyName = 'Graduate School Approved / Pending Registration';
const sortIndex = 5;
const sortIndex = 6;
}
1 change: 0 additions & 1 deletion class/WorkflowState/NewState.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use Intern\WorkflowState;

class NewState extends WorkflowState {

const friendlyName = 'New';
const sortIndex = 1;
}
2 changes: 1 addition & 1 deletion class/WorkflowState/RegisteredState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class RegisteredState extends WorkflowState {
const friendlyName = 'Registered';
const sortIndex = 6;
const sortIndex = 7;
}
2 changes: 1 addition & 1 deletion class/WorkflowState/RegistrationIssueState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class RegistrationIssueState extends WorkflowState {
const friendlyName = 'Registration Issue';
const sortIndex = 7;
const sortIndex = 8;
}
1 change: 0 additions & 1 deletion class/WorkflowState/SigAuthReadyState.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Intern\WorkflowState;
use Intern\WorkflowState;

Expand Down
1 change: 1 addition & 0 deletions class/WorkflowStateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function getAllStates()

// Instantiate each one
$states[] = new $className;

}
}

Expand Down
2 changes: 1 addition & 1 deletion class/WorkflowTransition/CancelTransition.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getAllowedPermissionList(){
}

public function getSourceState(){
return array('NewState', 'SigAuthReadyState', 'SigAuthApprovedState', 'DeanApprovedState', 'GradSchoolApprovedState', 'RegistrationIssueState');
return array('NewState', 'SigAuthReadyState', 'SigAuthApprovedState', 'DeanApprovedState', 'DeanApprovedGradPendingState', 'GradSchoolApprovedState', 'RegistrationIssueState');
}

public function doNotification(Internship $i, $note = null)
Expand Down
27 changes: 15 additions & 12 deletions class/WorkflowTransition/DeanApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@ public function getAllowedPermissionList(){
return array('dean_approve');
}

public function isApplicable(Internship $i){
if ($i->isUndergraduate()){
return true;
}else{
return false;
}
}

public function doNotification(Internship $i, $note = null)
{
$settings = \Intern\InternSettings::getInstance();

// If this is an undergrad internship, then send the Registrar an email
// Graduate level internships have another workflow state to go through before we alert the Registrar
if($i->isUndergraduate()){
$email = new \Intern\Email\ReadyToRegisterEmail($settings, $i);
$email->send();
}

// If this is a graduate email, send the notification email to the grad school office
if($i->isGraduate()){
$email = new \Intern\Email\GradSchoolNotificationEmail($settings, $i);
$email->send();
}
/**
* Send the Registrar an email.
* Graduate level internships have another workflow state to go through
* before we alert the Registrar.
*/
$email = new \Intern\Email\ReadyToRegisterEmail($settings, $i);
$email->send();

// If the subject and course number are not registered with InternshipInventory,
// send an email to the appropriate receiver.
Expand Down
35 changes: 35 additions & 0 deletions class/WorkflowTransition/DeanApproveGradPending.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Intern\WorkflowTransition;
use Intern\WorkflowTransition;
use Intern\Internship;

class DeanApproveGradPending extends WorkflowTransition {

const sourceState = 'SigAuthApprovedState';
const destState = 'DeanApprovedGradPendingState';
const actionName = 'Mark as Dean Approved / Needs Graduate School Approval';

public function getAllowedPermissionList()
{
return array('dean_approve');
}

public function isApplicable(Internship $i)
{
if ($i->isGraduate()) {
return true;
} else {
return false;
}
}

public function doNotification(Internship $i, $note = null)
{
$settings = \Intern\InternSettings::getInstance();

//Send the notification email to the grad school office.
$email = new \Intern\Email\GradSchoolNotificationEmail($settings, $i);
$email->send();
}
}
5 changes: 3 additions & 2 deletions class/WorkflowTransition/GradSchoolApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

class GradSchoolApprove extends WorkflowTransition {

const sourceState = 'DeanApprovedState';
const sourceState = 'DeanApprovedGradPendingState';
const destState = 'GradSchoolApprovedState';
const actionName = 'Mark as Grad School Approved';
const actionName = 'Mark as Graduate School Approved';

public function getAllowedPermissionList(){
return array('grad_school_approve');
Expand All @@ -24,6 +24,7 @@ public function isApplicable(Internship $i){

public function doNotification(Internship $i, $note = null)
{
//Send notification that it is Dean Approved and Grad School Approved.
$email = new \Intern\Email\ReadyToRegisterEmail(\Intern\InternSettings::getInstance(), $i);
$email->send();
}
Expand Down
2 changes: 1 addition & 1 deletion class/WorkflowTransition/UndergradRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class UndergradRegistration extends WorkflowTransition {
const sourceState = 'DeanApprovedState';
const destState = 'RegisteredState';
const actionName = 'Mark as Registered / Enrollment Complete';
const actionName = 'Mark as Registered / Enrollment Complete (undergrad)';

public function getAllowedPermissionList(){
return array('register');
Expand Down
26 changes: 26 additions & 0 deletions class/WorkflowTransition/UndoDeanApprovalGradPending.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Intern\WorkflowTransition;
use Intern\WorkflowTransition;
use Intern\Internship;

class UndoDeanApprovalGradPending extends WorkflowTransition {

const sourceState = 'DeanApprovedGradPendingState';
const destState = 'SigAuthApprovedState';
const actionName = 'Return for Dean Approval';

const sortIndex = 6;

public function getAllowedPermissionList() {
return array('dean_approve','register');
}

public function isApplicable(Internship $i) {
if ($i->isGraduate()) {
return true;
} else {
return false;
}
}
}
12 changes: 11 additions & 1 deletion class/WorkflowTransition/UndoDeanApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
use Intern\Internship;

class UndoDeanApprove extends WorkflowTransition {

const sourceState = 'DeanApprovedState';
const destState = 'SigAuthApprovedState';
const actionName = 'Return for Dean Approval';

const sortIndex = 6;

public function getAllowedPermissionList(){
public function getAllowedPermissionList() {
return array('dean_approve','register');
}

public function isApplicable(Internship $i) {
if ($i->isUndergraduate()) {
return true;
} else {
return false;
}
}

}
1 change: 1 addition & 0 deletions class/WorkflowTransition/UndoDepartmentApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Intern\Internship;

class UndoDepartmentApprove extends WorkflowTransition {

const sourceState = 'SigAuthReadyState';
const destState = 'NewState';
const actionName = 'Send back to advisor';
Expand Down
12 changes: 6 additions & 6 deletions class/WorkflowTransition/UndoGradSchoolApproval.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
use Intern\Internship;

class UndoGradSchoolApproval extends WorkflowTransition {

const sourceState = 'GradSchoolApprovedState';
const destState = 'DeanApprovedState';
const destState = 'DeanApprovedGradPendingState';
const actionName = 'Return for Graduate School Approval';

const sortIndex = 6;

public function getAllowedPermissionList(){
return array('register', 'grad_school_approve');
}

public function isApplicable(Internship $i)
{
if($i->isGraduate()){
Expand All @@ -24,4 +24,4 @@ public function isApplicable(Internship $i)
return false;
}
}
}
}
2 changes: 1 addition & 1 deletion class/WorkflowTransition/UndoGraduateRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UndoGraduateRegistration extends WorkflowTransition {

const sourceState = 'RegisteredState';
const destState = 'GradSchoolApprovedState';
const actionName = 'Mark as not registered';
const actionName = 'Mark as Not Registered';

const sortIndex = 6;

Expand Down
2 changes: 1 addition & 1 deletion class/WorkflowTransition/UndoUndergradRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class UndoUndergradRegistration extends WorkflowTransition {
const sourceState = 'RegisteredState';
const destState = 'DeanApprovedState';
const actionName = 'Mark as not registered';
const actionName = 'Mark as Not Registered';

const sortIndex = 6;

Expand Down