/** * */ public function configure() { $this->candidateVacancyId = $this->getOption('candidateVacancyId'); $this->selectedAction = $this->getOption('selectedAction'); $this->id = $this->getOption('id'); if ($this->candidateVacancyId > 0 && $this->selectedAction != "") { $stateMachine = new WorkflowStateMachine(); $this->actionName = $stateMachine->getRecruitmentActionName($this->selectedAction); $this->selectedCandidateVacancy = $this->getCandidateService()->getCandidateVacancyById($this->candidateVacancyId); } if ($this->id > 0) { $candidateHistory = $this->getCandidateService()->getCandidateHistoryById($this->id); $this->selectedCandidateVacancy = $this->getCandidateService()->getCandidateVacancyByCandidateIdAndVacancyId($candidateHistory->getCandidateId(), $candidateHistory->getVacancyId()); $this->performedActionName = $candidateHistory->getActionName(); $date = explode(" ", $candidateHistory->getPerformedDate()); $this->performedDate = set_datepicker_date_format($date[0]); $this->performedBy = $candidateHistory->getPerformerName(); $this->vacancyId = $candidateHistory->getVacancyId(); $this->selectedAction = $candidateHistory->getAction(); } $this->candidateId = $this->selectedCandidateVacancy->getCandidateId(); $this->vacancyId = $this->selectedCandidateVacancy->getVacancyId(); $this->candidateName = $this->selectedCandidateVacancy->getCandidateName(); $this->vacancyName = $this->selectedCandidateVacancy->getVacancyName(); $this->hiringManagerName = $this->selectedCandidateVacancy->getHiringManager(); $this->currentStatus = ucwords(strtolower($this->selectedCandidateVacancy->getStatus())); $this->setWidget('notes', new sfWidgetFormTextArea()); $this->setValidator('notes', new sfValidatorString(array('required' => false, 'max_length' => 2147483647))); $this->widgetSchema->setNameFormat('candidateVacancyStatus[%s]'); if ($this->id > 0) { $this->setDefault('notes', $candidateHistory->getNote()); $this->widgetSchema['notes']->setAttribute('disabled', 'disable'); $this->actionName = 'View Action History'; } }
/** * * @param <type> $state * @return <type> */ public function getNextActionsForCandidateVacancy($state, $userObj) { $stateMachine = new WorkflowStateMachine(); $list = array("" => __('Select Action')); $allowedActions = $userObj->getAllowedActions(PluginWorkflowStateMachine::FLOW_RECRUITMENT, $state); if (empty($allowedActions)) { $list[""] = __('No Actions'); } else { foreach ($allowedActions as $action) { $list[$action] = $stateMachine->getRecruitmentActionName($action); } } return $list; }
public function getActionName() { $stateMachine = new WorkflowStateMachine(); return $stateMachine->getRecruitmentActionName($this->getAction()); }