Ejemplo n.º 1
0
 public function getdisplayacontentreportacc($init_id, $manager_id)
 {
     $data = array();
     if ($init_id !== '' && $manager_id !== '') {
         /***
          *** edited on 12-03-2015 , soujanya
          *** for filtering employees based on business unit id in Initialize appraisal > step -2
          ***/
         //echo $init_id.">>".$manager_id;die;
         $appInitializationData = $this->getConfigData($init_id);
         if (!empty($appInitializationData)) {
             $businessUnitId = $appInitializationData[0]['businessunit_id'];
             $departmentId = $appInitializationData[0]['department_id'];
             $eligibility = $appInitializationData[0]['eligibility'];
             $emp_model = new Default_Model_Employee();
             $data = $emp_model->getEmployeesUnderRM($manager_id, $businessUnitId, $departmentId, $eligibility);
         }
     }
     return $data;
 }
Ejemplo n.º 2
0
    public function changereportingmanagerAction()
    {
        $oldRM = $this->_getParam('empid', null);
        $newRM = $this->_getParam('newrmanager', null);
        $status = trim($this->_getParam('status', null));
        $ishead = trim($this->_getParam('ishead', null));
        $baseUrl = BASE_URL;
        $employeeModal = new Default_Model_Employee();
        $employessunderEmpId = $employeeModal->getEmployeesUnderRM($oldRM);
        $updateTable = $employeeModal->changeRM($oldRM, $newRM, $status, $ishead);
        /* Send Mails to the employees whose reporting manager is changed */
        $oldRMData = $employeeModal->getsingleEmployeeData($oldRM);
        $newRMData = $employeeModal->getsingleEmployeeData($newRM);
        foreach ($employessunderEmpId as $employee) {
            $options['subject'] = APPLICATION_NAME . ' : Change of reporting manager';
            $options['header'] = 'Change of reporting manager';
            $options['toEmail'] = $employee['emailaddress'];
            $options['toName'] = $employee['userfullname'];
            $options['message'] = '<div>Hello ' . ucfirst($employee['userfullname']) . ',
										<div>' . ucfirst($newRMData[0]['userfullname']) . ' is your new reporting manager.</div>
										<div style="padding:20px 0 10px 0;">Please <a href="' . $baseUrl . '/index/popup" target="_blank" style="color:#b3512f;">click here</a> to login </div>
									</div>';
            $result = sapp_Global::_sendEmail($options);
        }
        $this->_helper->json(array('result' => $updateTable));
    }
Ejemplo n.º 3
0
    public function employeedetails($emparr, $conText, $userId)
    {
        $session = new Zend_Auth_Storage_Session();
        $data = $session->read();
        $loggedinuser = $data['id'];
        $group_id = $data['group_id'];
        $empdata = '';
        $employeetabsStr = '';
        $empdata = '<div class="ml-alert-1-success" id="empdetailsmsgdiv" style="display:none;">';
        $empdata .= '<div class="style-1-icon success" style="display:block;"></div>';
        $empdata .= '<div id="successtext"></div>';
        $empdata .= '</div>';
        $empdata .= '<div class="all-bg-ctrl">';
        $employeeModal = new Default_Model_Employee();
        $employessunderEmpId = $employeeModal->getEmployeesUnderRM($userId);
        if (!empty($employessunderEmpId)) {
            $empdata .= '<input type="hidden" value="true" id="hasteam" name="hasteam" />';
        } else {
            $empdata .= '<input type="hidden" value="false" id="hasteam" name="hasteam" />';
        }
        if ($conText == 'edit' || $conText == 'view') {
            //If the user has BG status as "Yet to start" then we should enable the link....
            $usersModel = new Default_Model_Users();
            $bgstatusArr = $usersModel->getBGstatus($userId);
            if (!empty($bgstatusArr) && isset($bgstatusArr) && $bgstatusArr[0]['group_id'] != MANAGEMENT_GROUP) {
                if ($bgstatusArr[0]['isactive'] == 1) {
                    $empdata .= '<div id="hrbgchecklink" style="display:none;" class="action-to-page"><a href="' . BASE_URL . '/empscreening/checkscreeningstatus/empid/' . $userId . '">Send for background checks</a></div>';
                }
            }
        }
        if ($conText != 'mydetails') {
            $empdata .= '<div class="back-to-page"><input type="button" value="Back" name="Back" onclick="gobacktocontroller(\'' . $conText . '\');"></div>';
        }
        $empdata .= '<div class="emp-screen-view">';
        $empdata .= '<div class="display-img-div" id="displayimg" >';
        $empdata .= '<div class="employee-pic-emp">';
        if ($emparr['profileimg'] != '') {
            $empdata .= '<img id="userImage" src="' . BASE_URL . "/public/uploads/profile/" . $emparr['profileimg'] . '" onerror="this.src=\'' . BASE_URL . '/public/media/images/default-profile-pic.jpg\'"/>';
        } else {
            $empdata .= '<img id="userImage" src="' . BASE_URL . '/public/media/images/employee-deafult-pic.jpg" />';
        }
        if ($conText != 'mydetails') {
            if ($group_id == HR_GROUP || $loggedinuser == SUPERADMIN || $group_id == MANAGEMENT_GROUP) {
                $sel_act = $sel_dact = "";
                if ($emparr['isactive'] < 2 && $emparr['emptemplock'] == 0) {
                    if ($emparr['isactive'] == 1) {
                        $sel_act = "selected";
                    } else {
                        if ($emparr['isactive'] == 0) {
                            $sel_dact = "selected";
                        }
                    }
                    $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                    if ($sel_act == "selected") {
                        $empdata .= "\n\t\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\t\$('.cb-disable').click(function(){              \n\t\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('inactive','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script> ";
                    } else {
                        if ($sel_dact == "selected") {
                            $empdata .= "\n\t\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\t\$('.cb-enable').click(function(){                \n\t\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('active','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script> ";
                        }
                    }
                } else {
                    if ($emparr['isactive'] < 2 && $emparr['emptemplock'] == 1) {
                        $sel_dact = "selected";
                        $sel_act = "";
                        $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                        $empdata .= "\n\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\$('.cb-enable').click(function(){                \n\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('active','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</script>   \n\t\t\t\t\t\t\t\t";
                    } else {
                        $sel_dact = "selected";
                        $sel_act = "";
                        $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                        $empdata .= "\n\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\$('.cb-enable,.cb-disable').click(function(){                \n\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('other','" . $emparr['isactive'] . "');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</script>   \n\t\t\t\t\t\t\t\t";
                    }
                }
            }
        }
        $empdata .= '</div>';
        $empdata .= '<div id="loaderimg" style="display:none; clear:both; margin:0 auto; text-align: center; width:100%;"><img src="' . BASE_URL . "/public/media/images/loaderwhite_21X21.gif" . '" style="width:21px; height: 21px; float: none; "/>';
        $empdata .= '</div>';
        $empdata .= '</div>';
        $empdata .= '<div id="personalDetailsDiv">';
        if ($emparr['is_orghead'] == '1') {
            $headicon = '<img src="' . BASE_URL . "/public/media/images/org-head.png" . '" class="org-head-icon" />';
        } else {
            $headicon = '';
        }
        if (isset($emparr['active_prefix']) && isset($emparr['prefix']) && $emparr['active_prefix'] == 1 && $emparr['prefix'] != '') {
            $empdata .= '<p><b>Employee Name <i>:</i></b><span class="emp-name-span bold-text">' . $emparr['prefix'] . '.&nbsp;' . $emparr['userfullname'] . '</span>' . $headicon . '</p>';
        } else {
            $empdata .= '<p><b>Employee Name <i>:</i></b><span class="emp-name-span bold-text">' . $emparr['userfullname'] . '</span>' . $headicon . '</p>';
        }
        $empdata .= '<p><b>Employee Id <i>:</i></b><span class="emp-name-span" id ="spanempid">' . $emparr['employeeId'] . '</span></p>';
        $empdata .= '<p><b>Email Id <i>:</i></b><span><a href="javascript:void(0)">' . $emparr['emailaddress'] . '</a></span></p>';
        if ($emparr['contactnumber'] != '') {
            $empdata .= '<p><b>Contact Number <i>:</i></b>';
            $empdata .= '<span id="contactnospan" >' . $emparr['contactnumber'] . '</span>';
            if ($group_id == HR_GROUP || $loggedinuser == SUPERADMIN || $loggedinuser == $userId || $group_id == MANAGER_GROUP) {
                $empdata .= '<span class="number-edit"><input type="button" value="Update" id="editcontactnumber" name="Edit Number" onclick="opencontactnumberpopup(\'' . $emparr['id'] . '\',\'edit\',\'' . $emparr['contactnumber'] . '\');">';
                $empdata .= '</span>';
            }
            $empdata .= '</p>';
        } else {
            $empdata .= '<p><b>Contact Number <i>:</i></b>';
            $empdata .= '<span id="contactnospan" ></span>';
            if ($group_id == HR_GROUP || $loggedinuser == SUPERADMIN || $loggedinuser == $userId || $group_id == MANAGER_GROUP) {
                $empdata .= '<span class="number-add"><input type="button" value="Add" id="addcontactnumber" name="Add Number" onclick="opencontactnumberpopup(\'' . $emparr['id'] . '\',\'add\',\'\');">';
                $empdata .= '</span>';
            }
            $empdata .= '</p>';
        }
        $empdata .= '</div>';
        $empdata .= '</div>';
        $empdata .= '<div id="employeeContainer"  style="display: none; overflow: auto;">
						<div class="heading">
							<a href="javascript:void(0)">
								<img src="' . BASE_URL . '/public/media/images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> 
							</a>
						</div>
						<iframe id="employeeCont" name="employeeCont" class="business_units_iframe" frameborder="0"></iframe>
					</div>';
        $empdata .= '</div>';
        echo $empdata;
        $employeetabsStr = $this->employeetabs($conText, $userId);
        echo $employeetabsStr;
    }
    public function sendmailstoemployees($oldRM, $newRM)
    {
        $baseUrl = BASE_URL;
        $employeeModal = new Default_Model_Employee();
        $employessunderEmpId = $employeeModal->getEmployeesUnderRM($oldRM);
        /* Send Mails to the employees whose reporting manager is changed */
        $oldRMData = $employeeModal->getsingleEmployeeData($oldRM);
        $newRMData = $employeeModal->getsingleEmployeeData($newRM);
        if (!empty($newRMData)) {
            foreach ($employessunderEmpId as $employee) {
                $options['subject'] = APPLICATION_NAME . ' : Change of reporting manager';
                $options['header'] = 'Change of reporting manager';
                $options['toEmail'] = $employee['emailaddress'];
                $options['toName'] = $employee['userfullname'];
                $options['message'] = '<div>Hello ' . ucfirst($employee['userfullname']) . ',
											<div>' . ucfirst($newRMData[0]['userfullname']) . ' is your new reporting manager.</div>
											<div style="padding:20px 0 10px 0;">Please <a href="' . $baseUrl . '/index/popup" target="_blank" style="color:#b3512f;">click here</a> to login </div>
										</div>';
                $result = sapp_Global::_sendEmail($options);
            }
        }
    }