/** * Get next state given workflow, state and action for this user * @param int $workFlow * @param string $state * @param int $action * @return string */ public function getNextState($workFlow, $state, $action) { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState($workFlow, $state, InterviewerUserRoleDecorator::INTERVIEWER, $action); $temp = $this->user->getNextState($workFlow, $state, $action); if (is_null($tempNextState)) { return $temp; } return $tempNextState; }
/** * Get next state given workflow, state and action for this user * @param int $workFlow * @param string $state * @param int $action * @return string */ public function getNextState($workFlow, $state, $action) { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState($workFlow, $state, HiringManagerUserRoleDecorator::HIRING_MANAGER, $action); $temp = $this->user->getNextState($workFlow, $state, $action); if (is_null($tempNextState)) { return $temp; } return $tempNextState; }
public function getNextState($workFlow, $state, $action) { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState($workFlow, $state, SupervisorUserRoleDecorator::SUPERVISOR_USER, $action); $temp = $this->user->getNextState($workFlow, $state, $action); if (is_null($tempNextState)) { return $temp; } return $tempNextState; }
/** * Get next state given workflow, state and action for this user * @param int $workFlow * @param string $state * @param int $action * @return string */ public function getNextState($workFlow, $state, $action) { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState($workFlow, $state, $this->getUserRoleName(), $action); $temp = $this->user->getNextState($workFlow, $state, $action); if (is_null($tempNextState)) { return $temp; } return $tempNextState; }
public function createTimesheets($startDate, $employeeId) { $datesInTheCurrenTimesheetPeriod = $this->getTimesheetPeriodService()->getDefinedTimesheetPeriod($startDate); $timesheetStartingDate = $datesInTheCurrenTimesheetPeriod[0]; $endDate = end($datesInTheCurrenTimesheetPeriod); $timesheet = $this->getTimesheetByStartDateAndEmployeeId($timesheetStartingDate, $employeeId); if ($timesheet == null) { if ($this->checkForOverlappingTimesheets($timesheetStartingDate, $endDate, $employeeId) == 0) { $statusValuesArray['state'] = 1; } else { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState(WorkflowStateMachine::FLOW_TIME_TIMESHEET, Timesheet::STATE_INITIAL, "SYSTEM", WorkflowStateMachine::TIMESHEET_ACTION_CREATE); $timesheet = new Timesheet(); $timesheet->setState($tempNextState); $timesheet->setStartDate($timesheetStartingDate); $timesheet->setEndDate($endDate); $timesheet->setEmployeeId($employeeId); $timesheet = $this->saveTimesheet($timesheet); $statusValuesArray['state'] = 2; $statusValuesArray['startDate'] = $timesheetStartingDate; } } else { $statusValuesArray['state'] = 3; } return $statusValuesArray; }
/** * Get next state given workflow, state and action for this user * @param int $workFlow * @param string $state * @param int $action * @return string */ public function getNextState($workFlow, $state, $action) { $accessFlowStateMachineService = new AccessFlowStateMachineService(); $tempNextState = $accessFlowStateMachineService->getNextState($workFlow, $state, ProjectAdminUserRoleDecorator::PROJECT_ADMIN_USER, $action); $temp = $this->user->getNextState($workFlow, $state, $action); if (is_null($tempNextState)) { return $temp; } return $tempNextState; }