本文整理汇总了PHP中sapp_Global::_checkprivileges方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::_checkprivileges方法的具体用法?PHP sapp_Global::_checkprivileges怎么用?PHP sapp_Global::_checkprivileges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::_checkprivileges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$addpermission = 'No';
$editpermission = 'No';
$structureModel = new Default_Model_Structure();
$orgData = $structureModel->getOrgData();
$heirarchyModel = new Default_Model_Heirarchy();
$levelsdata = $heirarchyModel->getlevelsusernames();
$baseUrl = $this->getBaseurl();
$emps = $heirarchyModel->getAllEmployees();
$vEmps = $heirarchyModel->getVAllEmployees();
$output = '';
$empData = array();
if (count($emps) > 0) {
foreach ($emps as $empRecord) {
$empData[] = array('id' => $empRecord['id'], 'name' => ucwords($empRecord['name']), 'profileimg' => $empRecord['profileimg']);
}
}
$editpermission = sapp_Global::_checkprivileges(HEIRARCHY, $loginuserGroup, $loginuserRole, 'edit');
$addpermission = sapp_Global::_checkprivileges(HEIRARCHY, $loginuserGroup, $loginuserRole, 'add');
$dataArr = array();
$tmplevelsdata = $levelsdata;
$parentArr = array();
for ($i = 0; $i < sizeof($levelsdata); $i++) {
$parentArr[] = $levelsdata[$i]['parent'];
}
$parentArr = array_unique($parentArr);
$parr = array();
foreach ($parentArr as $parent) {
foreach ($tmplevelsdata as $data) {
if ($data['parent'] == $parent) {
$parr[$parent][] = array('userid' => $data['userid'], 'userfullname' => $data['userfullname'], 'profileimg' => $data['profileimg'], 'level_number' => $data['level_number'], 'parent' => $data['parent'], 'jobtitlename' => $data['jobtitlename']);
}
}
}
if (!empty($parr)) {
$output = "<ul id='org' style='display:none;'>";
$output .= "<li>\r\n\t\t\t\t\t\t<i></i>\t\r\n\t\t\t\t\t\t<p class='tags-ctrl'>\t\t\t\t\t\t \r\n\t\t\t\t\t\t <img class='main-img' border='0' src='" . $baseUrl . "/public/uploads/profile/" . $parr[key($parr)][0]['profileimg'] . "' onerror='this.src=\"" . $baseUrl . "/public/media/images/hierarchy-deafult-pic.jpg\"' />\r\n\t\t\t\t\t\t <span class='main-name' title='" . ucwords($parr[key($parr)][0]['userfullname']) . "' id='" . $parr[key($parr)][0]['userid'] . "'>" . $parr[key($parr)][0]['userfullname'] . "</span>\r\n\t\t\t\t\t\t <span class='main-name' title='" . ucwords($parr[key($parr)][0]['jobtitlename']) . "'>" . $parr[key($parr)][0]['jobtitlename'] . "</span>\r\n\t\t\t\t\t\t </p>";
$output .= $this->hasChildNoEdit($parr[key($parr)][0]['userid'], $parr);
$output .= " </li></ul>";
}
$this->view->output = $output;
$this->view->allEmpdata = $vEmps;
$this->view->empData = $empData;
$this->view->orgData = $orgData;
$this->view->editpermission = $editpermission;
$this->view->addpermission = $addpermission;
}
示例2: welcomeAction
public function welcomeAction()
{
$auth = Zend_Auth::getInstance();
$businessunit_id = '';
$department_id = '';
$announcementPrivilege = '';
$isOrganizationHead = '';
$loginuserGroup = '';
$loginuserRole = '';
if ($auth->hasIdentity()) {
$businessunit_id = $auth->getStorage()->read()->businessunit_id;
$department_id = $auth->getStorage()->read()->department_id;
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
$isOrganizationHead = $auth->getStorage()->read()->is_orghead;
}
$this->view->loginuserGroup = $loginuserGroup;
$this->view->loginuserRole = $loginuserRole;
$widgetsModel = new Default_Model_Widgets();
// Birthdays & Announcements
$birthdaysRes = $widgetsModel->getTodaysBirthdays($businessunit_id, $department_id, $isOrganizationHead);
$upcomingBirthdyas = $widgetsModel->getUpcomingBirthdays($businessunit_id, $department_id, $isOrganizationHead);
$this->view->todyasBirthdays = $birthdaysRes;
$this->view->upcomingBirthdyas = $upcomingBirthdyas;
// Announcements - START
if (sapp_Global::_checkprivileges(ANNOUNCEMENTS, $loginuserGroup, $loginuserRole, 'view') == 'Yes') {
$announcementPrivilege = 'true';
$announcementsModel = new Default_Model_Announcements();
$announcementsData = $announcementsModel->getAllByBusiAndDeptId();
}
$this->view->announcementsData = !empty($announcementsData) ? $announcementsData : array();
$this->view->announcementPrivilege = $announcementPrivilege;
// Announcements - END
//Widgets formats
//Interview Schedules = 'format1';
//My Service Request = 'format2';
//Request Pending Approval = 'format3';
//Leaves Available = 'format4';
//My Leaves This Month = 'format5';
//Leave Management Options = 'format6';
//My details = 'format7';
$menuIdsArr = array(57 => 'format1', 10 => 'format5', 11 => 'format5', 20 => 'format5', 21 => 'format5', 14 => 'format4', 23 => 'format2', 32 => 'format7', 34 => 'format4', 35 => 'format5', 41 => 'format5', 42 => 'format5', 45 => 'format3', 54 => 'format4', 55 => 'format5', 56 => 'format4', 61 => 'format3', 65 => 'format3', 44 => 'format6', 43 => 'format5', 80 => 'format5', 86 => 'format5', 87 => 'format5', 88 => 'format5', 89 => 'format5', 90 => 'format5', 91 => 'format5', 92 => 'format5', 93 => 'format5', 100 => 'format5', 101 => 'format5', 102 => 'format5', 103 => 'format5', 107 => 'format5', 108 => 'format5', 110 => 'format5', 111 => 'format5', 114 => 'format5', 115 => 'format5', 116 => 'format5', 117 => 'format5', 118 => 'format5', 120 => 'format5', 121 => 'format5', 123 => 'format5', 124 => 'format5', 125 => 'format5', 126 => 'format5', 127 => 'format5', 128 => 'format5', 132 => 'format5', 136 => 'format5', 140 => 'format5', 143 => 'format3', 144 => 'format5', 145 => 'format5', 146 => 'format5', 148 => 'format3', 150 => 'format5', 151 => 'format5', 152 => 'format5', 154 => 'format4', 155 => 'format5', 165 => 'format5', 166 => 'format5', 62 => 'format3', 63 => 'format3', 64 => 'format3', 68 => 'format3', 69 => 'format3', 85 => 'format3', 131 => 'format5', 134 => 'format3', 135 => 'format3', 138 => 'format3', 139 => 'format3', 140 => 'format5', 142 => 'format5', 151 => 'format5', 154 => 'format6', 158 => 'format5', 159 => 'format5', 160 => '', 161 => 'format3', 165 => 'format5', 166 => 'format5', 167 => 'format6', 168 => '', 174 => 'format5', 169 => 'format3', 170 => 'format3', 172 => 'format5', 174 => 'format5', 182 => 'format5');
$getMenuIds = $widgetsModel->getWidgets($loginUserId, $loginuserRole);
$htmlcontent = '';
$tmpHtml1 = "";
$tmpHtml5 = "";
$tmpHtml2 = "";
$tmpHtml3 = "";
$tmpHtml4 = "";
$format = '';
if (!empty($getMenuIds)) {
//$i,j for css color changing for widgets
$i = 1;
$j = 1;
foreach ($getMenuIds as $getMenuIdArr) {
$i = $i >= 5 ? $i - 4 : $i;
// I for format 2,3,4
$j = $i >= 5 ? $j - 4 : $j;
// J for format 5
//echo "<pre>";print_r($menuIdsArr);
$menuId = $getMenuIdArr['id'];
$url = $getMenuIdArr['url'];
$format = isset($menuIdsArr[$menuId]) ? $menuIdsArr[$menuId] : '';
if ($menuId == 57) {
$tmpHtml1 = sapp_Global::format1($url);
} else {
if ($format == 'format2') {
$tmpHtml2 .= sapp_Global::format2($menuId, $i, $url);
$i++;
} else {
if ($format == 'format3') {
$tmpHtml2 .= sapp_Global::format3($menuId, $i, $url);
$i++;
} else {
if ($format == 'format4') {
$tmpHtml2 .= sapp_Global::format4($menuId, $i, $url);
$i++;
} else {
if ($format == 'format5') {
$tmpHtml5 .= sapp_Global::format5($menuId, $j, $url);
$j++;
} else {
if ($format == 'format6') {
$tmpHtml5 .= sapp_Global::format6($menuId, $url);
$j++;
} else {
if ($format != '') {
$htmlcontent .= sapp_Global::format7($menuId, $url);
} else {
if ($format == '') {
$htmlcontent = '';
}
}
}
}
}
}
}
}
//.........这里部分代码省略.........
示例3: multipleresumeAction
public function multipleresumeAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginUserId = trim($loginUserId);
}
$priv_check = sapp_Global::_checkprivileges(CANDIDATEDETAILS, '', $auth->getStorage()->read()->emprole, 'add');
if ($priv_check == 'Yes') {
$msgarray = $req_options = array();
$form = new Default_Form_Multipleresume();
$form->setAction(DOMAIN . 'candidatedetails/multipleresume');
// To show list of requisitions to user
$req_model = new Default_Model_Requisition();
$req_data = $req_model->getRequisitionsForCV("'Approved','In process'");
foreach ($req_data as $req) {
$req_options[$req['id']] = $req['requisition_code'] . ' - ' . $req['jobtitlename'];
}
if (count($req_options) == 0) {
$msgarray['requisition_id'] = "No active requisitions are found.";
}
$form->requisition_id->addMultiOptions(array('' => 'Select Requisition ID') + $req_options);
$form_post_status = $this->_request->getPost();
if ($form_post_status) {
$candidate_firstname = $this->_getParam('candidate_firstname', null);
$candidate_lastname = $this->_getParam('candidate_lastname', null);
$cand_resumes = $this->_getParam('cand_resume', null);
if ($form->isValid($form_post_status)) {
$cand_details_model = new Default_Model_Candidatedetails();
$requisition_id = $this->_getParam('requisition_id', null);
$cand_status = $this->_getParam('cand_status', null);
$req_records = $cand_details_model->getcountofrecords($requisition_id);
$curr_date = gmdate("Y-m-d H:i:s");
if (empty($req_records)) {
$rdata = array('req_status' => 'In process', 'modifiedby' => $loginUserId, 'modifiedon' => $curr_date);
$rwhere = ' id = ' . $requisition_id;
$req_model->SaveorUpdateRequisitionData($rdata, $rwhere);
}
// To insert records in a single query
$records = array();
foreach ($candidate_firstname as $key => $candidate_fname) {
$cfull_name = $candidate_fname . ' ' . $candidate_lastname[$key];
$records[] = "({$requisition_id}, '{$candidate_fname}','{$candidate_lastname[$key]}','{$cfull_name}', '{$cand_resumes[$key]}', '{$cand_status}', 1, {$loginUserId}, {$loginUserId}, '{$curr_date}', '{$curr_date}')";
}
$data_fields = array('requisition_id', 'candidate_firstname', 'candidate_lastname', 'candidate_name', 'cand_resume', 'cand_status', 'isactive', 'createdby', 'modifiedby', 'createddate', 'modifieddate');
$last_insert_id = $cand_details_model->insertMultipleRecords($data_fields, $records);
// Log status to Log manager and redirect to Resource Pooling list page.
if ($last_insert_id != '') {
$menumodel = new Default_Model_Menu();
$objidArr = $menumodel->getMenuObjID('/candidatedetails');
$objID = $objidArr[0]['id'];
$log_status = sapp_Global::logManager($objID, 1, $loginUserId, $last_insert_id);
//$this->_helper->FlashMessenger()->setNamespace('success')->addMessage('Candidate details added successfully.');
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Candidate details added successfully."));
$this->_redirect('/candidatedetails');
}
} else {
// To handle server validation, when Javascript is disabled
$messages = $form->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
$form->setDefault('candidate_firstname', $candidate_firstname[0]);
$form->setDefault('cand_resume', '');
}
}
$this->view->form = $form;
$this->view->msgarray = $msgarray;
} else {
$this->_redirect('error');
}
}
示例4: viewAction
public function viewAction()
{
$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->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$objName = 'leavemanagement';
$leavemanagementform = new Default_Form_leavemanagement();
$leavemanagementform->removeElement("submit");
$elements = $leavemanagementform->getElements();
if (count($elements) > 0) {
foreach ($elements as $key => $element) {
if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
$element->setAttrib("disabled", "disabled");
}
}
}
$permission = sapp_Global::_checkprivileges(LEAVEMANAGEMENT, $loginuserGroup, $loginuserRole, 'edit');
$this->view->editpermission = $permission;
try {
if ($id) {
if (is_numeric($id) && $id > 0) {
$leavemanagementmodel = new Default_Model_Leavemanagement();
$data = $leavemanagementmodel->getActiveleavemanagementId($id);
if (!empty($data)) {
$data = $data[0];
$monthslistmodel = new Default_Model_Monthslist();
$weekdaysmodel = new Default_Model_Weekdays();
$departmentsmodel = new Default_Model_Departments();
$busineesUnitModel = new Default_Model_Businessunits();
$businessunitData = $busineesUnitModel->getParicularBusinessUnit($data['businessunit_id']);
$particulardeptidArr = $departmentsmodel->getParicularDepartmentId($data['department_id']);
$monthslistdata = $monthslistmodel->getMonthlistData();
$weekdaysdata = $weekdaysmodel->getWeeklistData();
if (!empty($businessunitData) && !empty($particulardeptidArr) && !empty($monthslistdata) && !empty($weekdaysdata)) {
if (!empty($businessunitData)) {
$leavemanagementform->businessunit->addMultiOption($businessunitData[0]['id'], utf8_encode($businessunitData[0]['unitname']));
}
if (!empty($particulardeptidArr)) {
$leavemanagementform->department_id->addMultiOption($particulardeptidArr[0]['id'], utf8_encode($particulardeptidArr[0]['deptname']));
}
if (sizeof($monthslistdata) > 0) {
foreach ($monthslistdata as $monthslistres) {
$leavemanagementform->cal_startmonth->addMultiOption($monthslistres['month_id'], utf8_encode($monthslistres['month_name']));
}
}
if (sizeof($weekdaysdata) > 0) {
foreach ($weekdaysdata as $weekdaysres) {
$leavemanagementform->weekend_startday->addMultiOption($weekdaysres['day_id'], utf8_encode($weekdaysres['day_name']));
$leavemanagementform->weekend_endday->addMultiOption($weekdaysres['day_id'], utf8_encode($weekdaysres['day_name']));
}
}
$leavemanagementform->populate($data);
$leavemanagementform->setDefault('cal_startmonth', $data['cal_startmonth']);
$leavemanagementform->setDefault('weekend_startday', $data['weekend_startday']);
$leavemanagementform->setDefault('weekend_endday', $data['weekend_endday']);
$leavemanagementform->setDefault('businessunit', $data['businessunit_id']);
$leavemanagementform->setDefault('department_id', $data['department_id']);
$this->view->rowexist = "";
} else {
$this->view->rowexist = "rows";
}
} else {
$this->view->rowexist = "norows";
}
} else {
$this->view->rowexist = "norows";
}
} else {
$this->view->rowexist = "norows";
}
} catch (Exception $e) {
$this->view->rowexist = "norows";
}
$this->view->controllername = $objName;
$this->view->id = $id;
$this->view->form = $leavemanagementform;
}
示例5: editAction
public function editAction()
{
if (defined('EMPTABCONFIGS')) {
$popConfigPermission = array();
$empOrganizationTabs = explode(",", EMPTABCONFIGS);
if (in_array('empcommunicationdetails', $empOrganizationTabs)) {
$empDeptdata = array();
$employeeData = array();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
if (sapp_Global::_checkprivileges(COUNTRIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
$id = $this->getRequest()->getParam('userid');
if ($id == '') {
$id = $loginUserId;
}
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
try {
if ($id && is_numeric($id) && $id > 0 && $id != $loginUserId) {
$employeeModal = new Default_Model_Employee();
$empdata = $employeeModal->getsingleEmployeeData($id);
if ($empdata == 'norows') {
$this->view->rowexist = "norows";
$this->view->empdata = "";
} else {
$this->view->rowexist = "rows";
if (!empty($empdata)) {
$empDept = $empdata[0]['department_id'];
$empcommdetailsform = new Default_Form_empcommunicationdetails();
$empcommdetailsModal = new Default_Model_Empcommunicationdetails();
$usersModel = new Default_Model_Users();
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$orgInfoModel = new Default_Model_Organisationinfo();
$msgarray = array();
$orgid = 1;
$countryId = '';
$stateId = '';
$cityId = '';
$deptModel = new Default_Model_Departments();
if ($empDept != '' && $empDept != 'NULL') {
$empDeptdata = $deptModel->getEmpdepartmentdetails($empDept);
if (!empty($empDeptdata)) {
$countryId = $empDeptdata[0]['country'];
$stateId = $empDeptdata[0]['state'];
$cityId = $empDeptdata[0]['city'];
}
} else {
$empDeptdata = $orgInfoModel->getOrganisationDetails($orgid);
if (!empty($empDeptdata)) {
$countryId = $empDeptdata[0]['country'];
$stateId = $empDeptdata[0]['state'];
$cityId = $empDeptdata[0]['city'];
}
}
if ($countryId != '') {
$countryData = $countriesModel->getActiveCountryName($countryId);
}
if (!empty($countryData)) {
$empDeptdata[0]['country'] = $countryData[0]['country'];
} else {
$empDeptdata[0]['country'] = '';
}
if ($stateId != '') {
$stateData = $statesmodel->getStateNameData($stateId);
}
if (!empty($stateData)) {
$empDeptdata[0]['state'] = $stateData[0]['state'];
} else {
$empDeptdata[0]['state'] = '';
}
if ($cityId != '') {
$citiesData = $citiesmodel->getCitiesNameData($cityId);
}
if (!empty($citiesData)) {
$empDeptdata[0]['city'] = $citiesData[0]['city'];
} else {
$empDeptdata[0]['city'] = '';
}
$countrieslistArr = $countriesModel->getTotalCountriesList();
if (sizeof($countrieslistArr) > 0) {
$empcommdetailsform->perm_country->addMultiOption('', 'Select Country');
$empcommdetailsform->current_country->addMultiOption('', 'Select Country');
foreach ($countrieslistArr as $countrieslistres) {
$empcommdetailsform->perm_country->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
//.........这里部分代码省略.........
示例6: editAction
public function editAction()
{
$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->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$feedforwardquestionsform = new Default_Form_Feedforwardquestions();
$feedforwardquestionsmodel = new Default_Model_Feedforwardquestions();
$msgarray = array();
$popConfigPermission = array();
if (sapp_Global::_checkprivileges(FEEDFORWARDQUESTIONS, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'feedforwardquestions');
}
$feedforwardquestionsform->submit->setLabel('Update');
try {
if ($id) {
if (is_numeric($id) && $id > 0) {
$data = $feedforwardquestionsmodel->getFeedforwardQuestionbyID($id);
if (!empty($data)) {
$data = $data[0];
if ($data['isused'] != 1) {
$feedforwardquestionsform->populate($data);
$feedforwardquestionsform->setAttrib('action', BASE_URL . 'feedforwardquestions/edit/id/' . $id);
$this->view->data = $data;
} else {
$this->view->ermsg = 'noedit';
}
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = '';
}
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
$this->view->form = $feedforwardquestionsform;
if ($this->getRequest()->getPost()) {
$result = $this->save($feedforwardquestionsform);
$this->view->msgarray = $result;
}
$this->render('form');
}
示例7: editAction
public function editAction()
{
if (defined('EMPTABCONFIGS')) {
$empOrganizationTabs = explode(",", EMPTABCONFIGS);
if (in_array('workeligibilitydetails', $empOrganizationTabs)) {
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginUserRole = $auth->getStorage()->read()->emprole;
$loginUserGroup = $auth->getStorage()->read()->group_id;
}
$this->view->WorkeligibilitydoctypesPermission = sapp_Global::_checkprivileges(WORKELIGIBILITYDOCTYPES, $loginUserGroup, $loginUserRole, 'add');
$popConfigPermission = array();
if (sapp_Global::_checkprivileges(COUNTRIES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
$this->view->popConfigPermission = $popConfigPermission;
$userid = $this->getRequest()->getParam('userid');
$employeeModal = new Default_Model_Employee();
$workeligibilityform = new Default_Form_Workeligibilitydetails();
$workeligibilityModel = new Default_Model_Workeligibilitydetails();
$msgarray = array();
$emptyFlag = 0;
$issuingauthority = '';
//To check previliges for edit
$myEmployees_model = new Default_Model_Myemployees();
$getMyTeamIds = $myEmployees_model->getTeamIds($loginUserId);
$teamIdArr = array();
if (!empty($getMyTeamIds)) {
foreach ($getMyTeamIds as $teamId) {
array_push($teamIdArr, $teamId['user_id']);
}
}
if ($loginUserRole == SUPERADMINROLE || $loginUserGroup == MANAGEMENT_GROUP || $loginUserGroup == HR_GROUP || $loginUserGroup == MANAGER_GROUP && in_array($userid, $teamIdArr)) {
try {
if ($userid && is_numeric($userid) && $userid > 0 && $userid != $loginUserId) {
$usersModel = new Default_Model_Users();
$empdata = $employeeModal->getActiveEmployeeData($userid);
$employeeData = $usersModel->getUserDetailsByIDandFlag($userid);
if ($empdata == 'norows') {
$this->view->rowexist = "norows";
$this->view->empdata = "";
} else {
$this->view->rowexist = "rows";
if (!empty($empdata)) {
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$workeligibilityDoctypesModal = new Default_Model_Workeligibilitydoctypes();
$workeligibilityDoctypesData = $workeligibilityDoctypesModal->fetchAll('isactive=1', 'documenttype');
$workeligibilityDoctypesDataArr = $workeligibilityDoctypesData->toArray();
if (!empty($workeligibilityDoctypesDataArr)) {
foreach ($workeligibilityDoctypesDataArr as $data) {
$workeligibilityform->documenttype_id->addMultiOption($data['id'], $data['documenttype']);
}
} else {
$msgarray['documenttype_id'] = 'Work eligibility document types are not configured yet.';
$emptyFlag++;
}
$countrieslistArr = $countriesModel->getTotalCountriesList();
if (!empty($countrieslistArr)) {
$workeligibilityform->issuingauth_country->addMultiOption('', 'Select Country');
foreach ($countrieslistArr as $countrieslistres) {
$workeligibilityform->issuingauth_country->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
}
} else {
$msgarray['issuingauth_country'] = 'Countries are not configured yet.';
}
$data = $workeligibilityModel->getWorkEligibilityRecord($userid);
//echo "<pre>Work eligibility Data ";print_r($data);echo "</pre>"; die;
if (!empty($data) && isset($data)) {
$countryId = $data[0]['issuingauth_country'];
$stateId = $data[0]['issuingauth_state'];
$cityId = $data[0]['issuingauth_city'];
$documenttype_id = $data[0]['documenttype_id'];
if ($countryId != '') {
$statelistArr = $statesmodel->getStatesList($countryId);
if (!empty($statelistArr)) {
$workeligibilityform->issuingauth_state->addMultiOption('', 'Select State');
foreach ($statelistArr as $statelistres) {
$workeligibilityform->issuingauth_state->addMultiOption($statelistres['id'] . '!@#' . $statelistres['state_name'], $statelistres['state_name']);
}
}
}
if ($stateId != '') {
$citylistArr = $citiesmodel->getCitiesList($stateId);
if (!empty($citylistArr)) {
$workeligibilityform->issuingauth_city->addMultiOption('', 'Select City');
foreach ($citylistArr as $cityPermlistres) {
$workeligibilityform->issuingauth_city->addMultiOption($cityPermlistres['id'] . '!@#' . $cityPermlistres['city_name'], $cityPermlistres['city_name']);
}
}
$stateNameArr = $statesmodel->getStateName($stateId);
}
//.........这里部分代码省略.........
示例8: editAction
public function editAction()
{
$emptyFlag = 0;
$msgarray = array();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$popConfigPermission = sapp_Global::_checkprivileges(JOBTITLES, $loginuserGroup, $loginuserRole, 'add');
$this->view->popConfigPermission = $popConfigPermission;
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$positionsform = new Default_Form_positions();
$positionsform->submit->setLabel('Update');
$positionsmodel = new Default_Model_Positions();
$objName = 'positions';
try {
if ($id) {
$deptModel = new Default_Model_Departments();
$data = $positionsmodel->getsinglePositionData($id);
$jobtitleidmodel = new Default_Model_Jobtitles();
$jobtitleidmodeldata = $jobtitleidmodel->getJobTitleList();
if (!empty($jobtitleidmodeldata)) {
foreach ($jobtitleidmodeldata as $jobtitleidres) {
$positionsform->jobtitleid->addMultiOption($jobtitleidres['id'], utf8_encode($jobtitleidres['jobtitlename']));
}
} else {
$msgarray['jobtitleid'] = 'Job titles are not configured yet.';
$emptyFlag++;
}
if (!empty($data) && $data != 'norows') {
$positionsform->populate($data[0]);
$this->view->form = $positionsform;
$this->view->controllername = $objName;
$this->view->id = $id;
$this->view->ermsg = '';
$positionsform->setAttrib('action', BASE_URL . 'positions/edit');
} else {
$this->view->ermsg = 'norecord';
}
$this->view->emptyFlag = $emptyFlag;
}
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
if ($this->getRequest()->getPost()) {
$result = $this->save($positionsform);
$this->view->msgarray = $result;
}
}
示例9: createnewgroupAction
/**
* This action is used to create new group by manager.It will serve as ajax call.
*/
public function createnewgroupAction()
{
$appraisal_id = $this->_getParam('appraisal_id', null);
$manager_id = $this->_getParam('manager_id', null);
$flag = $this->_getParam('flag', null);
$group_id = $this->_getParam('group_id', null);
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
try {
if ($appraisal_id != '' && $manager_id != '') {
$appraisal_id = sapp_Global::_decrypt($appraisal_id);
$manager_id = sapp_Global::_decrypt($manager_id);
if ($flag == 'edit') {
$group_id = sapp_Global::_decrypt($group_id);
}
$app_manager_model = new Default_Model_Appraisalmanager();
$appraisal_init_model = new Default_Model_Appraisalinit();
$appraisal_qs_model = new Default_Model_Appraisalquestions();
$check_array = array();
$tablename = 'main_pa_questions_privileges';
$manager_emp = $app_manager_model->getmanager_emp($appraisal_id, $manager_id, '');
if (empty($manager_emp) && $flag == 'add') {
$this->view->ermsg = 'No employees to add.';
}
$appraisaldata = $appraisal_init_model->getConfigData($appraisal_id);
$appraisaldata = $appraisaldata[0];
$questionPrivileges = $appraisal_qs_model->gethrquestionprivileges($appraisal_id, $tablename, '');
$questionsArr = $appraisal_qs_model->getQuestionsByCategory($appraisaldata['category_id'], '');
if (!empty($questionPrivileges)) {
if (isset($questionPrivileges['manager_qs']) && isset($questionPrivileges['manager_qs_privileges'])) {
if ($questionPrivileges['manager_qs'] != '' && $questionPrivileges['manager_qs_privileges'] != '') {
$hr_qs_Arr = explode(',', $questionPrivileges['manager_qs']);
$hr_qs_privileges = json_decode($questionPrivileges['manager_qs_privileges'], true);
foreach ($hr_qs_privileges as $key => $val) {
//$val = explode(',',substr($val, 1, -1));
$check_array[$key] = $val;
}
}
}
}
if (sapp_Global::_checkprivileges(APPRAISALQUESTIONS, $loginuserGroup, $loginuserRole, 'edit') == 'Yes') {
$appraisaldata['poppermission'] = 'yes';
}
$appraisaldata['poppermission'] = 'yes';
$manager_emp_selected = array();
$group_name = "";
if ($flag == 'edit') {
$app_group_model = new Default_Model_Appraisalgroups();
$group_details = $app_group_model->getAppraisalGroupsDatabyID($group_id);
if (!empty($group_details)) {
$group_details = $group_details[0];
$group_name = $group_details['group_name'];
$manager_emp_selected = $app_manager_model->getmanager_emp($appraisal_id, $manager_id, $group_id);
$manager_qs_privileges = json_decode($manager_emp_selected[0]['manager_qs_privileges'], true);
foreach ($manager_qs_privileges as $key => $val) {
$check_array[$key] = $val;
}
} else {
$this->view->ermsg = 'No data found.';
}
}
$view = $this->view;
$view->appraisal_id = $appraisal_id;
$view->manager_id = $manager_id;
$view->manager_emp = $manager_emp;
$view->questionsArr = $questionsArr;
$view->checkArr = $check_array;
$view->appraisaldata = $appraisaldata;
$view->checkArr = $check_array;
$view->flag = $flag;
$view->group_name = $group_name;
$view->group_id = $group_id;
$view->selected_emp = $manager_emp_selected;
} else {
$this->view->ermsg = 'No data found.';
}
} catch (Exception $ex) {
$this->view->ermsg = 'No data found.';
}
}
示例10: editAction
public function editAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$popConfigPermission = sapp_Global::_checkprivileges(PAYFREQUENCY, $loginuserGroup, $loginuserRole, 'add');
$this->view->popConfigPermission = $popConfigPermission;
$objName = 'jobtitles';
$emptyFlag = 0;
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$jobtitlesform = new Default_Form_jobtitles();
$jobtitlesmodel = new Default_Model_Jobtitles();
$payfrequencyModal = new Default_Model_Payfrequency();
$payfreqData = $payfrequencyModal->getActivePayFreqData();
$msgarray = array();
if (sizeof($payfreqData) > 0) {
foreach ($payfreqData as $payfreqres) {
$jobtitlesform->jobpayfrequency->addMultiOption($payfreqres['id'], $payfreqres['freqtype']);
}
} else {
$msgarray['jobpayfrequency'] = 'Pay frequency is not configured yet.';
$emptyFlag++;
}
$this->view->msgarray = $msgarray;
$this->view->emptyFlag = $emptyFlag;
try {
if ($id) {
if (is_numeric($id) && $id > 0) {
$data = $jobtitlesmodel->getsingleJobTitleData($id);
if (!empty($data) && $data != "norows") {
$jobtitlesform->populate($data[0]);
$jobtitlesform->submit->setLabel('Update');
$this->view->form = $jobtitlesform;
$this->view->ermsg = '';
$this->view->controllername = $objName;
$this->view->id = $id;
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->form = $jobtitlesform;
$this->view->ermsg = '';
}
} catch (Exception $ex) {
$this->view->ermsg = 'nodata';
}
if ($this->getRequest()->getPost()) {
if ($jobtitlesform->isValid($this->_request->getPost())) {
$id = $this->_request->getParam('id');
$jobtitlecode = $this->_request->getParam('jobtitlecode');
$jobtitlename = $this->_request->getParam('jobtitlename');
$jobdescription = $this->_request->getParam('jobdescription');
$minexperiencerequired = $this->_request->getParam('minexperiencerequired');
$jobpaygradecode = $this->_request->getParam('jobpaygradecode');
$jobpayfrequency = $this->_request->getParam('jobpayfrequency');
$comments = $this->_request->getParam('comments');
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('jobtitlecode' => trim($jobtitlecode), 'jobtitlename' => trim($jobtitlename), 'jobdescription' => trim($jobdescription), 'minexperiencerequired' => trim($minexperiencerequired), 'jobpaygradecode' => trim($jobpaygradecode), 'jobpayfrequency' => trim($jobpayfrequency), 'comments' => trim($comments), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
if ($id != '') {
$where = array('id=?' => $id);
$actionflag = 2;
} else {
$data['createdby'] = $loginUserId;
$data['createddate'] = gmdate("Y-m-d H:i:s");
$data['isactive'] = 1;
$where = '';
$actionflag = 1;
}
$Id = $jobtitlesmodel->SaveorUpdateJobTitleData($data, $where);
if ($Id == 'update') {
$tableid = $id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Job title updated successfully."));
} else {
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Job title added successfully."));
}
$menuidArr = $menumodel->getMenuObjID('/jobtitles');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
$this->_redirect('jobtitles');
} else {
$messages = $jobtitlesform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
//.........这里部分代码省略.........
示例11: editAction
public function editAction()
{
$genderaddpermission = '';
$msaddpermission = '';
$ethnicaddpermission = '';
$racecodepermission = '';
$languagepermission = '';
$nationalityaddpermission = '';
$identityDocumentArr = array();
$documentsArr = array();
if (defined('EMPTABCONFIGS')) {
$empOrganizationTabs = explode(",", EMPTABCONFIGS);
if (in_array('emppersonaldetails', $empOrganizationTabs)) {
$loginUserId = '';
$loginUserGroup = '';
$loginUserRole = '';
$auth = Zend_Auth::getInstance();
$emptyFlag = 0;
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginUserGroup = $auth->getStorage()->read()->group_id;
$loginUserRole = $auth->getStorage()->read()->emprole;
}
$genderaddpermission = sapp_Global::_checkprivileges(GENDER, $loginUserGroup, $loginUserRole, 'add');
$msaddpermission = sapp_Global::_checkprivileges(MARITALSTATUS, $loginUserGroup, $loginUserRole, 'add');
$ethnicaddpermission = sapp_Global::_checkprivileges(ETHNICCODE, $loginUserGroup, $loginUserRole, 'add');
$racecodepermission = sapp_Global::_checkprivileges(RACECODE, $loginUserGroup, $loginUserRole, 'add');
$languagepermission = sapp_Global::_checkprivileges(LANGUAGE, $loginUserGroup, $loginUserRole, 'add');
$nationalityaddpermission = sapp_Global::_checkprivileges(NATIONALITY, $loginUserGroup, $loginUserRole, 'add');
$id = $this->getRequest()->getParam('userid');
if ($id == '') {
$id = $loginUserId;
}
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
try {
if ($id && is_numeric($id) && $id > 0 && $id != $loginUserId) {
$employeeModal = new Default_Model_Employee();
$empdata = $employeeModal->getsingleEmployeeData($id);
if ($empdata == 'norows') {
$this->view->rowexist = "norows";
$this->view->empdata = "";
} else {
$this->view->rowexist = "rows";
if (!empty($empdata)) {
$empperdetailsModal = new Default_Model_Emppersonaldetails();
$usersModel = new Default_Model_Users();
$empprobationreviewform = new Default_Form_empprobationreview();
$emppersonaldetailsform = new Default_Form_emppersonaldetails();
if ($loginUserGroup == MANAGEMENT_GROUP || $loginUserGroup == HR_GROUP || $loginUserRole == SUPERADMINROLE) {
$identitydocumentsModel = new Default_Model_Identitydocuments();
$identityDocumentArr = $identitydocumentsModel->getIdentitydocumnetsrecord();
}
$genderModel = new Default_Model_Gender();
$maritalstatusmodel = new Default_Model_Maritalstatus();
$nationalitymodel = new Default_Model_Nationality();
$ethniccodemodel = new Default_Model_Ethniccode();
$racecodemodel = new Default_Model_Racecode();
$languagemodel = new Default_Model_Language();
$msgarray = array();
$genderlistArr = $genderModel->getGenderList();
if (!empty($genderlistArr)) {
foreach ($genderlistArr as $genderlistres) {
$emppersonaldetailsform->genderid->addMultiOption($genderlistres['id'], $genderlistres['gendername']);
}
} else {
$msgarray['genderid'] = 'Gender is not configured yet.';
$emptyFlag++;
}
$maritalstatuslistArr = $maritalstatusmodel->getMaritalStatusList();
if (!empty($maritalstatuslistArr)) {
foreach ($maritalstatuslistArr as $maritalstatuslistres) {
$emppersonaldetailsform->maritalstatusid->addMultiOption($maritalstatuslistres['id'], $maritalstatuslistres['maritalstatusname']);
}
} else {
$msgarray['maritalstatusid'] = 'Marital status is not configured yet.';
$emptyFlag++;
}
$nationalitylistArr = $nationalitymodel->getNationalityList();
if (!empty($nationalitylistArr)) {
foreach ($nationalitylistArr as $nationalitylistres) {
$emppersonaldetailsform->nationalityid->addMultiOption($nationalitylistres['id'], $nationalitylistres['nationalitycode']);
}
} else {
$msgarray['nationalityid'] = 'Nationality is not configured yet.';
$emptyFlag++;
}
$ethniccodeArr = $ethniccodemodel->gettotalEthnicCodeData();
if (!empty($ethniccodeArr)) {
foreach ($ethniccodeArr as $ethniccoderes) {
$emppersonaldetailsform->ethniccodeid->addMultiOption($ethniccoderes['id'], $ethniccoderes['ethnicname']);
}
} else {
$msgarray['ethniccodeid'] = 'Ethnic codes are not configured yet.';
$emptyFlag++;
}
$racecodeArr = $racecodemodel->gettotalRaceCodeData();
if (!empty($racecodeArr)) {
//.........这里部分代码省略.........
示例12: addpopupAction
public function addpopupAction()
{
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$addcomp = sapp_Global::_checkprivileges(COMPETENCYLEVEL, $loginuserGroup, $loginuserRole, 'add');
$id = $this->getRequest()->getParam('unitId');
if ($id == '') {
$id = $loginUserId;
}
// For open the form in popup...
$emptyFlag = 0;
$empskillsform = new Default_Form_empskills();
$competencylevelModel = new Default_Model_Competencylevel();
$competencylevelArr = $competencylevelModel->getCompetencylevelList();
$msgarray = array();
$empskillsform->competencylevelid->addMultiOption('', 'Select Competency level');
if (!empty($competencylevelArr)) {
foreach ($competencylevelArr as $competencylevelres) {
$empskillsform->competencylevelid->addMultiOption($competencylevelres['id'], $competencylevelres['competencylevel']);
}
} else {
$msgarray['competencylevelid'] = 'Competency levels are not configured yet.';
$emptyFlag++;
}
$empskillsform->setAttrib('action', BASE_URL . 'empskills/addpopup/unitId/' . $id);
$this->view->form = $empskillsform;
$this->view->msgarray = $msgarray;
$this->view->emptyFlag = $emptyFlag;
$this->view->controllername = 'empskills';
$this->view->addcomp = $addcomp;
if ($this->getRequest()->getPost()) {
$result = $this->save($empskillsform, $id);
$this->view->msgarray = $result;
}
}
示例13: viewAction
public function viewAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$login_group_id = $auth->getStorage()->read()->group_id;
$login_role_id = $auth->getStorage()->read()->emprole;
}
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$objName = 'appraisalskills';
try {
if ($id) {
if (is_numeric($id) && $id > 0) {
$appraisalSkillsModel = new Default_Model_Appraisalskills();
$data = $appraisalSkillsModel->getAppraisalSkillsDatabyID($id);
$previ_data = sapp_Global::_checkprivileges(APPRAISALSKILLS, $login_group_id, $login_role_id, 'edit');
if (!empty($data)) {
$data = $data[0];
$this->view->ermsg = '';
$this->view->data = $data;
$this->view->previ_data = $previ_data;
$this->view->id = $id;
$this->view->controllername = $objName;
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
}
示例14: editAction
public function editAction()
{
if (defined('EMPTABCONFIGS')) {
$empOrganizationTabs = explode(",", EMPTABCONFIGS);
if (in_array('emp_holidays', $empOrganizationTabs)) {
$emptyFlag = 0;
$conText = "";
$userID = "";
$msgarray = array();
$empGroupId = '';
$holidayGroupConfigPermission = '';
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$holidayGroupConfigPermission = sapp_Global::_checkprivileges(HOLIDAYGROUPS, $loginuserGroup, $loginuserRole, 'add');
$this->view->holidayGroupConfigPermission = $holidayGroupConfigPermission;
$id = $this->getRequest()->getParam('userid');
$call = $this->_getParam('call');
if ($call == 'ajaxcall') {
$this->_helper->layout->disableLayout();
$userID = $this->_getParam('unitId') != '' ? $this->_getParam('unitId') : $this->_getParam('userid');
$conText = $this->_getParam('context') != '' ? $this->_getParam('context') : $this->getRequest()->getParam('context');
} else {
if (isset($_SESSION['holidaygroupid'])) {
unset($_SESSION['holidaygroupid']);
}
}
if ($id == '') {
$id = $userID;
}
$Uid = $id ? $id : $userID;
if ($Uid != "") {
//TO dispaly EMployee Profile information.....
$usersModel = new Default_Model_Users();
$employeeData = $usersModel->getUserDetailsByIDandFlag($Uid);
}
$employeesModel = new Default_Model_Employees();
$holidaydatesmodel = new Default_Model_Holidaydates();
$employeeModal = new Default_Model_Employee();
try {
if ($id && is_numeric($id) && $id > 0 && $id != $loginUserId) {
$isrowexist = $employeeModal->getsingleEmployeeData($id);
if ($isrowexist == 'norows') {
$this->view->rowexist = "norows";
} else {
$this->view->rowexist = "rows";
}
$empdata = $employeeModal->getActiveEmployeeData($id);
if (!empty($empdata)) {
if ($id) {
$empholidaysform = new Default_Form_empholidays();
$holidaygroupModel = new Default_Model_Holidaygroups();
$holidaygroupArr = $holidaygroupModel->getAllGroupData();
if (!empty($holidaygroupArr)) {
foreach ($holidaygroupArr as $holidaygroupres) {
$empholidaysform->holiday_group->addMultiOption($holidaygroupres['id'], $holidaygroupres['groupname']);
}
} else {
$msgarray['holiday_group'] = 'Holiday groups are not configured yet.';
$emptyFlag++;
}
$empholidaysform->holiday_group_name->setValue("Holiday group is not assigned yet.");
$data = $employeesModel->getHolidayGroupForEmployee($id);
if ($data[0]['holiday_group'] != '') {
$singleholidaygroupArr = $holidaygroupModel->getsingleGroupData($data[0]['holiday_group']);
$empholidaysform->populate($data[0]);
$empholidaysform->setDefault('holiday_group', $data[0]['holiday_group']);
$empGroupId = $data[0]['holiday_group'];
if (!empty($singleholidaygroupArr)) {
$empholidaysform->holiday_group_name->setValue($singleholidaygroupArr['groupname']);
}
$this->view->data = $data;
$empholidaysform->setAttrib('action', BASE_URL . 'empholidays/edit/userid/' . $id);
$objname = $this->_getParam('objname');
$refresh = $this->_getParam('refresh');
$dashboardcall = $this->_getParam('dashboardcall', null);
$data = array();
$searchQuery = '';
$searchArray = array();
$tablecontent = '';
if ($refresh == 'refresh') {
if ($dashboardcall == 'Yes') {
$perPage = DASHBOARD_PERPAGE;
} else {
$perPage = PERPAGE;
}
$sort = 'DESC';
$by = 'h.modifieddate';
$pageNo = 1;
$searchData = '';
$searchQuery = '';
$searchArray = array();
} else {
$sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC';
$by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'h.modifieddate';
if ($dashboardcall == 'Yes') {
$perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE);
//.........这里部分代码省略.........
示例15: viewAction
/**
*
* View function is used to populate the data for the particular ID.
*/
public function viewAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$login_group_id = $auth->getStorage()->read()->group_id;
$login_role_id = $auth->getStorage()->read()->emprole;
$businessUnit = $auth->getStorage()->read()->businessunit_id;
$department = $auth->getStorage()->read()->department_id;
}
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$objName = 'appraisalratings';
$appraisalratingsmodel = new Default_Model_Appraisalratings();
$appInitModel = new Default_Model_Appraisalinit();
$businessunitmodel = new Default_Model_Businessunits();
$deptmodel = new Default_Model_Departments();
$buname = '';
$deptname = '';
$performanceappflag = '';
try {
if ($id) {
if (is_numeric($id) && $id > 0) {
$data = $appraisalratingsmodel->getAppraisalRatingsbyInitId($id);
$previ_data = sapp_Global::_checkprivileges(APPRAISALRATINGS, $login_group_id, $login_role_id, 'edit');
if (!empty($data)) {
//$data = $data[0];
$appInitdata = $appInitModel->getConfigData($data[0]['pa_initialization_id']);
if ($login_role_id == SUPERADMINROLE || $login_group_id == MANAGEMENT_GROUP) {
if (!empty($appInitdata)) {
$businessUnit = $appInitdata[0]['businessunit_id'];
$department = $appInitdata[0]['department_id'];
}
}
$appImpleData = sapp_PerformanceHelper::check_per_implmentation($businessUnit, $department);
if (!empty($appImpleData)) {
$performanceappflag = $appImpleData['performance_app_flag'];
}
$buDataArr = $businessunitmodel->getSingleUnitData($businessUnit);
if (!empty($buDataArr)) {
$buname = $buDataArr['unitname'];
}
if ($performanceappflag == 0) {
if ($department != '') {
$deptArr = $deptmodel->getSingleDepartmentData($department);
if (!empty($deptArr)) {
$deptname = $deptArr['deptname'];
}
}
}
$this->view->checkActiveApp = $appInitdata[0];
$this->view->data = $data;
$this->view->ermsg = '';
$this->view->previ_data = $previ_data;
$this->view->id = $id;
$this->view->controllername = $objName;
$this->view->buname = $buname;
$this->view->deptname = $deptname;
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} else {
$this->view->ermsg = 'norecord';
}
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
}