コード例 #1
0
 public function viewgroupedemployeesAction()
 {
     $ajaxContext = $this->_helper->getHelper('AjaxContext');
     $ajaxContext->addActionContext('viewgroupedemployees', 'html')->initContext();
     $groupedEmployeeDetails = array();
     $ungroupedEmployeeDetails = array();
     $check_array = array();
     $questionsArr = array();
     $qsids = '';
     $groupid = $this->_request->getParam('groupid');
     $appraisalid = $this->_request->getParam('appraisalid');
     $groupname = $this->_request->getParam('groupname');
     $empcount = $this->_request->getParam('empcount');
     $appraisalinitmodel = new Default_Model_Appraisalinit();
     $appraisalQsModel = new Default_Model_Appraisalquestions();
     if ($appraisalid) {
         $appraisaldata = $appraisalinitmodel->getConfigData($appraisalid);
         $appraisaldata = $appraisaldata[0];
         if ($appraisaldata['initialize_status'] == 1) {
             $tablename = 'main_pa_questions_privileges';
         } else {
             $tablename = 'main_pa_questions_privileges_temp';
         }
         /** Start Fetching grouped employee details by joining with employee summary table.*/
         if ($groupid != '') {
             $groupedEmployeeDetails = $appraisalQsModel->getEmpGroupDetails($groupid, $appraisalid, $tablename);
         }
         /** End*/
         if ($groupid != '') {
             $questionPrivileges = $appraisalQsModel->gethrquestionprivileges($appraisalid, $tablename, $groupid);
         }
         if (!empty($questionPrivileges)) {
             if (isset($questionPrivileges['hr_qs']) && isset($questionPrivileges['hr_group_qs_privileges'])) {
                 if ($questionPrivileges['hr_qs'] != '' && $questionPrivileges['hr_group_qs_privileges'] != '') {
                     $hr_qs_Arr = explode(',', $questionPrivileges['hr_qs']);
                     $hr_qs_privileges = json_decode($questionPrivileges['hr_group_qs_privileges'], true);
                     foreach ($hr_qs_privileges as $key => $val) {
                         //$val = explode(',',substr($val, 1, -1));
                         $check_array[$key] = $val;
                     }
                 }
             }
             $qsids = $questionPrivileges['hr_qs'];
         }
         if ($appraisaldata['category_id'] != '' && $appraisaldata['category_id'] != 'null') {
             $questionsArr = $appraisalQsModel->getQuestionsByCategory($appraisaldata['category_id'], $qsids);
         }
         $this->view->groupid = $groupid;
         $this->view->groupname = $groupname;
         $this->view->empcount = $empcount;
         $this->view->appraisalid = $appraisalid;
         $this->view->groupedEmployeeDetails = $groupedEmployeeDetails;
         //$this->view->ungroupedEmployeeDetails = $ungroupedEmployeeDetails;
         $this->view->questionsArr = $questionsArr;
         $this->view->checkArr = $check_array;
         $this->view->initializationdata = $appraisaldata;
     }
 }