コード例 #1
0
 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $businessunit_id = $auth->getStorage()->read()->businessunit_id;
         $department_id = $auth->getStorage()->read()->department_id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $ffinitModel = new Default_Model_Feedforwardinit();
     $ffDataArr = $ffinitModel->getFFbyBUDept('', 'yes');
     $this->view->ffdataarr = $ffDataArr;
 }
コード例 #2
0
 public function checkffduedate()
 {
     $ffinitModel = new Default_Model_Feedforwardinit();
     $ffEmpRatModel = new Default_Model_Feedforwardemployeeratings();
     $ffDataArr = $ffinitModel->getFFbyBUDept('', 'yes');
     $ffIdArr = array();
     $ffIdList = '';
     $current_day = new DateTime('now');
     $current_day->sub(new DateInterval('P1D'));
     if (!empty($ffDataArr)) {
         foreach ($ffDataArr as $ffval) {
             if ($ffval['status'] == 1) {
                 if ($ffval['ff_due_date']) {
                     $due_date = new DateTime($ffval['ff_due_date']);
                 } else {
                     $due_date = '';
                 }
                 $interval = $current_day->diff($due_date);
                 $interval->format('%d');
                 $interval = $interval->days;
                 if ($interval <= 2) {
                     array_push($ffIdArr, $ffval['id']);
                 }
             }
         }
     }
     if (!empty($ffIdArr)) {
         $ffIdList = implode(',', $ffIdArr);
     }
     if ($ffIdList != '') {
         $ffEmpsStatusData = $ffEmpRatModel->getEmpsFFStatus($ffIdList, 'cron');
         if (!empty($ffEmpsStatusData)) {
             $empIdArr = array();
             foreach ($ffEmpsStatusData as $empval) {
                 array_push($empIdArr, $empval['emailaddress']);
             }
             $optionArr = array('subject' => 'Manager Feedforward submission pending', 'header' => 'Feedforward', 'toemail' => SUPERADMIN_EMAIL, 'toname' => 'Super Admin', 'bcc' => $empIdArr, 'message' => "<div style='padding: 0; text-align: left; font-size:14px; font-family:Arial, Helvetica, sans-serif;'>\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style='color:#3b3b3b;'>Hi, </span><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='padding:20px 0 0 0;color:#3b3b3b;'>Mangaer feedforward is pending.</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='padding:20px 0 10px 0;'>Please <a href=" . BASE_URL . " target='_blank' style='color:#b3512f;'>click here</a> to login  to your <b>" . APPLICATION_NAME . "</b> account to check the details.</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div> ", 'cron' => 'yes');
             sapp_PerformanceHelper::saveCronMail($optionArr);
         }
     }
 }
コード例 #3
0
 public function deleteAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $id = $this->_request->getParam('objid');
     $messages['message'] = '';
     $messages['msgtype'] = '';
     $count = 0;
     $actionflag = 3;
     if ($id) {
         $feedforwardInitModel = new Default_Model_Feedforwardinit();
         $ffdata = $feedforwardInitModel->getFFInitViewData($id);
         if ($ffdata[0]['initialize_status'] == 2) {
             $data = array('isactive' => 0, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby_role' => $loginuserRole, 'modifiedby_group' => $loginuserGroup, 'modifiedby' => $loginUserId);
             $where = array('id=?' => $id);
             $Id = $feedforwardInitModel->SaveorUpdateFeedforwardInitData($data, $where);
             if ($Id == 'update') {
                 $menuID = INITIALIZE_FEEDFORWARD;
                 $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
                 /***
                 			** commented on 29-04-2015 by sapplica
                 			** need to integrate mail template							
                 				$configmail = sapp_Global::send_configuration_mail('Feed Forward',$ffdata[0]['ff_mode']);		
                 			***/
                 $messages['message'] = 'Feedforward deleted successfully.';
                 $messages['msgtype'] = 'success';
             } else {
                 $messages['message'] = 'Feedforward cannot be deleted.';
                 $messages['msgtype'] = 'error';
             }
         } else {
             $messages['message'] = 'Feedforward cannot be deleted as the process is initialized/completed.';
             $messages['msgtype'] = 'error';
         }
     } else {
         $messages['message'] = 'Feedforward cannot be deleted.';
         $messages['msgtype'] = 'error';
     }
     $this->_helper->json($messages);
 }
コード例 #4
0
 public function getdetailedratingsbyquesAction()
 {
     $ff_id = $this->_request->getParam('ff_id');
     $mgr_id = $this->_request->getParam('mgr_id');
     $pa_conf_id = $this->_request->getParam('pa_conf_id');
     $ques_id = $this->_request->getParam('ques_id');
     $ffinitModel = new Default_Model_Feedforwardinit();
     $ffEmpRatModel = new Default_Model_Feedforwardemployeeratings();
     $empsData = $ffinitModel->getDetailEmpsDataByMgrId($ff_id, $mgr_id);
     $quesData = $ffEmpRatModel->getFFQuesDataByIDs($empsData[0]['question_ids']);
     // Employee response
     $emp_response = array();
     if ($empsData[0]['employee_response']) {
         $emp_response = json_decode($empsData[0]['employee_response'], true);
     }
     // get rating details using configuration id
     $ratingsData = $ffEmpRatModel->getAppRatingsDataByConfgId($pa_conf_id);
     $ratingType = $ratingsData[0]['rating_type'];
     $ratingText = array();
     $ratingTextDisplay = array();
     $ratingValues = array();
     foreach ($ratingsData as $rd) {
         $ratingText[] = $rd['rating_text'];
         $ratingTextDisplay[$rd['id']] = $rd['rating_text'];
         $ratingValues[$rd['id']] = $rd['rating_value'];
     }
     $this->view->empsData = $empsData;
     $this->view->quesData = $quesData;
     $this->view->ratingType = $ratingType;
     $this->view->ratingTextDisplay = $ratingTextDisplay;
     $this->view->ratingText = json_encode($ratingText);
     $this->view->ratingValues = $ratingValues;
     $this->view->emp_response = $emp_response;
     $this->view->ques_id = $ques_id;
     $this->view->emp_view_flag = $this->_request->getParam('emp_view_flag');
     //Condition is for checking of additional questions click event
     $this->view->additional_Qflag = '';
     if ($ques_id == '') {
         $this->view->additional_Qflag = 'additional_flag';
     }
 }
コード例 #5
0
 public function checkffduedate()
 {
     $ffinitModel = new Default_Model_Feedforwardinit();
     $ffEmpRatModel = new Default_Model_Feedforwardemployeeratings();
     $ffDataArr = $ffinitModel->getFFbyBUDept('', 'yes');
     $current_day = new DateTime('now');
     $current_day->sub(new DateInterval('P1D'));
     if (!empty($ffDataArr)) {
         foreach ($ffDataArr as $ffval) {
             if ($ffval['status'] == 1) {
                 if ($ffval['ff_due_date']) {
                     $due_date = new DateTime($ffval['ff_due_date']);
                 } else {
                     $due_date = '';
                 }
                 $ffEmpsStatusData = $ffEmpRatModel->getEmpsFFStatus($ffval['id'], 'cron');
                 if (!empty($ffEmpsStatusData)) {
                     foreach ($ffEmpsStatusData as $empval) {
                         if ($empval['ff_status'] != APP_COMPLETED) {
                             $interval = $current_day->diff($due_date);
                             $interval->format('%d');
                             $interval = $interval->days;
                             if ($interval <= 1) {
                                 $optionArr = array('subject' => 'Feed Forward Pending', 'header' => 'Feed Forward', 'toemail' => $empval['userfullname'], 'toname' => $empval['emailaddress'], 'message' => 'Dear ' . $empval['userfullname'] . ', feed forward is pending.', 'cron' => 'yes');
                                 sapp_PerformanceHelper::saveCronMail($optionArr);
                             }
                         }
                     }
                 }
             }
         }
     }
 }