public function employeestatusAction() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('employeestatus', 'html')->initContext(); $flag = $this->_request->getParam('flag'); $appraisalid = $this->_request->getParam('appraisalid'); $department_id = $this->_request->getParam('deptid'); $businessunit_id = $this->_request->getParam('bunitid'); $performanceappflag = $this->_request->getParam('perf_app_flag'); $app_status = $this->_request->getParam('app_status'); $appqsprivilegesModel = new Default_Model_Appraisalqsmain(); $appempModel = new Default_Model_Appraisalgroupemployees(); $appInitModel = new Default_Model_Appraisalinit(); $empratingsModel = new Default_Model_Appraisalemployeeratings(); $employeeIds = ''; $msgarray = array(); $employeeArr = array(); $getEmployeeRatingsArr = array(); $errorMsg = ''; $budeptArr = array(); if ($flag == 1) { if ($appraisalid) { $getEmployeeRatingsArr = $empratingsModel->getEmployeeIds($appraisalid, '', $app_status); if (!empty($getEmployeeRatingsArr)) { foreach ($getEmployeeRatingsArr as $ids) { $employeeIds .= $ids['employee_id'] . ','; } $employeeIds = rtrim($employeeIds, ','); } if ($employeeIds != '') { $employeedetailsArr = $appempModel->getEmployeeList(array(), $employeeIds, 2); } if (!empty($employeedetailsArr)) { foreach ($employeedetailsArr as $key => $val) { $employeeArr[$val['user_id']] = $val; } } //$budeptArr = $this->getbudeptname($appraisalid); $budeptArr = sapp_Global::getbudeptname($appraisalid); } } else { $checkActiveApp = $appInitModel->checkAppraisalExists($businessunit_id, $department_id, $performanceappflag); if (count($checkActiveApp) > 0) { $checkActiveApp = $checkActiveApp[0]; if ($checkActiveApp['enable_step'] == 2 && $checkActiveApp['status'] == 1) { $appraisalid = $checkActiveApp['id']; $getEmployeeRatingsArr = $empratingsModel->getEmployeeIds($checkActiveApp['id'], '', $app_status); if (!empty($getEmployeeRatingsArr)) { foreach ($getEmployeeRatingsArr as $ids) { $employeeIds .= $ids['employee_id'] . ','; } $employeeIds = rtrim($employeeIds, ','); } if ($employeeIds != '') { $employeedetailsArr = $appempModel->getEmployeeList(array(), $employeeIds, 2); } if (!empty($employeedetailsArr)) { foreach ($employeedetailsArr as $key => $val) { $employeeArr[$val['user_id']] = $val; } } } else { if ($checkActiveApp['enable_step'] == 1) { $errorMsg = 'Appraisal process is enabled to managers.'; } if ($checkActiveApp['status'] == 2) { $errorMsg = 'Appraisal process is closed.'; } } //$budeptArr = $this->getbudeptname($checkActiveApp['id']); $budeptArr = sapp_Global::getbudeptname($checkActiveApp['id']); } else { $errorMsg = 'Appraisal process is not yet configured.'; } } $this->view->flag = $flag; $this->view->msgarray = $msgarray; $this->view->ermsg = $errorMsg; $this->view->employeeArr = $employeeArr; $this->view->employeeratingsArr = $getEmployeeRatingsArr; $this->view->appraisalid = $appraisalid; $this->view->budeptArr = $budeptArr; }
public static function displayappdetails($appraisalid) { //$appperiod = ''; $budeptArr = sapp_Global::getbudeptname($appraisalid); $appstring = ''; if (isset($budeptArr['appdata'])) { $appraisalInfo = $budeptArr['appdata']; $appstring = self::getAppraisalText($appraisalInfo); } ?> <div id="deptinfo" class="deptinfo"> <span class="head_txt">Business Unit : </span><span><?php echo $budeptArr['buname'] . '' . ($budeptArr['deptname'] != '' ? '</span> <span class="head_txt">Department : </span><span> ' . $budeptArr['deptname'] : ''); ?> </span> </div> <div id="appraisalinfo" class="appraisalinfo"> <?php echo $appstring; ?> </div> <?php }
public function appraisalinitialized($data) { $employmentstatusModel = new Default_Model_Employmentstatus(); $category_model = new Default_Model_Appraisalcategory(); $eligibility = ''; $category = ''; $budeptArr = sapp_Global::getbudeptname($data['id']); $empstatusArr = $employmentstatusModel->getEmploymentStatusName($data['eligibility']); if (!empty($empstatusArr)) { foreach ($empstatusArr as $status) { $eligibility .= $status['statusname'] . ','; } $eligibility = rtrim($eligibility, ','); } $categoryArr = $category_model->getCategoryNameByIds($data['category_id']); if (!empty($categoryArr)) { foreach ($categoryArr as $catid) { $category .= $catid['category_name'] . ','; } $category = rtrim($category, ','); } $data['process_status'] = ''; if ($data['initialize_status'] == 1) { if ($data['enable_step'] == 1) { $data['process_status'] = 'Enabled to Managers'; } if ($data['enable_step'] == 2) { $data['process_status'] = 'Enabled to Employees'; } } else { if ($data['initialize_status'] == 2) { $data['process_status'] = 'Initialize Later'; } else { $data['process_status'] = 'In progress'; } } $this->view->ermsg = ''; $this->view->eligibility = $eligibility; $this->view->category = $category; $this->view->budeptArr = $budeptArr; $this->view->data = $data; }