/** * Update Job Title * @param sfWebRequest $request * @return unknown_type */ public function executeUpdateJobTitle(sfWebRequest $request) { $jobService = new JobService(); $jobTitle = $jobService->readJobTitle($request->getParameter('id')); $this->jobTitle = $jobTitle; if ($request->isMethod('post')) { $arrEmployeeStatus = array(); $jobTitle->setName($request->getParameter('txtName')); $jobTitle->setDescription($request->getParameter('txtJobTitleDesc')); $jobTitle->setComments($request->getParameter('txtJobTitleComments')); $jobTitle->setJobspecId($request->getParameter('txtSpec')); $jobTitle->setSalaryGradeId($request->getParameter('txtPayGrade')); foreach (explode(',', $request->getParameter('selEmpStatus')) as $empStatusId) { if ($empStatusId != '') { $employeeStatus = $jobService->readEmployeeStatus($empStatusId); array_push($arrEmployeeStatus, $employeeStatus); } } $jobService->saveJobTitle($jobTitle, $arrEmployeeStatus); $this->setMessage('SUCCESS', array(TopLevelMessages::UPDATE_SUCCESS)); $this->redirect('admin/listJobTitle'); } $this->listJobSpecifications = $jobService->getJobSpecificationsList(); $this->saleryGradeList = $jobService->getSaleryGradeList(); $this->listEmploymentStatus = $jobService->getEmployeeStatusList(); }