/** * The default action - show the home page */ public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } }
public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('addtasksproject', 'html')->initContext(); $ajaxContext->addActionContext('addtasks', 'html')->initContext(); $ajaxContext->addActionContext('checkempforprojects', 'json')->initContext(); }
public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('save', 'json')->initContext(); $ajaxContext->addActionContext('submit', 'json')->initContext(); $ajaxContext->addActionContext('eraseweek', 'json')->initContext(); $ajaxContext->addActionContext('converdate', 'json')->initContext(); }
public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('viewtasksresources', 'html')->initContext(); $ajaxContext->addActionContext('deletetask', 'json')->initContext(); $ajaxContext->addActionContext('assignresourcestotask', 'html')->initContext(); $ajaxContext->addActionContext('saveresources', 'json')->initContext(); $ajaxContext->addActionContext('edittaskname', 'json')->initContext(); }
public function preDispatch() { /*$userModel = new Timemanagement_Model_Users(); $checkTmEnable = $userModel->checkTmEnable(); if(!$checkTmEnable){ $this->_redirect('error'); }*/ //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); }
/** * The default action - show the home page */ public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('displayweeks', 'html')->initContext(); $ajaxContext->addActionContext('empdisplayweeks', 'html')->initContext(); $ajaxContext->addActionContext('accordion', 'html')->initContext(); $ajaxContext->addActionContext('emptimesheetmonthly', 'html')->initContext(); $ajaxContext->addActionContext('emptimesheetweekly', 'html')->initContext(); $ajaxContext->addActionContext('getweekstartenddates', 'json')->initContext(); }
public function preDispatch() { //check Time management module enable if (!sapp_Helper::checkTmEnable()) { $this->_redirect('error'); } $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('viewemptasks', 'html')->initContext(); $ajaxContext->addActionContext('addresourcesproject', 'html')->initContext(); $ajaxContext->addActionContext('addresources', 'html')->initContext(); $ajaxContext->addActionContext('deleteprojectresource', 'json')->initContext(); $ajaxContext->addActionContext('taskassign', 'json')->initContext(); $ajaxContext->addActionContext('assigntasktoresources', 'html')->initContext(); $ajaxContext->addActionContext('resourcetaskdelete', 'json')->initContext(); $ajaxContext->addActionContext('resourcetaskassigndelete', 'json')->initContext(); }
/** * * @param type $user_id * @return type */ public function getCompensationData($user_id) { $db = Zend_Db_Table::getDefaultAdapter(); $query = "select * from main_compensation_details where user_id = " . $user_id . ";"; $result = $db->query($query); $row = $result->fetch(); $panel = array(); $panel[signonbonus] = sapp_Helper::_dataDecrypt($row["signonbonus"], ENCRYPTION_KEY); $panel[relocationcost] = sapp_Helper::_dataDecrypt($row["relocationcost"], ENCRYPTION_KEY); $panel[noticebuyout] = sapp_Helper::_dataDecrypt($row["noticebuyout"], ENCRYPTION_KEY); $panel[others1] = sapp_Helper::_dataDecrypt($row["others1"], ENCRYPTION_KEY); $panel[fixedctc] = sapp_Helper::_dataDecrypt($row["fixedctc"], ENCRYPTION_KEY); $panel[variablepay] = sapp_Helper::_dataDecrypt($row["variablepay"], ENCRYPTION_KEY); $panel[lta] = sapp_Helper::_dataDecrypt($row["lta"], ENCRYPTION_KEY); $panel[others2] = sapp_Helper::_dataDecrypt($row["others2"], ENCRYPTION_KEY); return $panel; }
public function recentlyviewed() { $request = Zend_Controller_Front::getInstance(); $params = $request->getRequest()->getParams(); $moduleName = $request->getRequest()->getModuleName(); $controllerName = $request->getRequest()->getControllerName(); $actionName = $request->getRequest()->getActionName(); $mparams['module'] = $params['module']; $mparams['controller'] = $params['controller']; $mparams['action'] = $params['action']; $actionurl = ''; $id_name = 'yes'; $burl = $controllerName . "/" . $actionName; if ($actionName != '') { $actionurl = strstr($_SERVER['REQUEST_URI'], $actionName); $actionurl = str_replace($actionName, '', $actionurl); } else { if ($controllerName != '') { $actionurl = strstr($_SERVER['REQUEST_URI'], $controllerName); $actionurl = str_replace($actionName, '', $actionurl); } else { $actionurl = strstr($_SERVER['REQUEST_URI'], $moduleName); $actionurl = str_replace($actionName, '', $actionurl); } } $burl = $burl . $actionurl; $tmpPageLink = explode("/", $_SERVER['REQUEST_URI']); $pageName = $controllerName; $pageLink = $burl; $reportsArr = array('leavesreport' => '-' . TAB_EMP_LEAVES, 'leavemanagementreport' => '-Leave Management', 'holidaygroupreports' => '-' . TAB_EMP_HOLIDAYS, 'activeuser' => '-Active Users', 'employeereport' => '-Employees', 'rolesgroup' => '-Roles', 'emprolesgroup' => '-Employee Roles', 'userlogreport' => '-User Logs', 'activitylogreport' => '-Activity Logs', 'requisitionstatusreport' => '-Requisition', 'candidatesreport' => '-Candidates', 'interviewrounds' => '-Interview Rounds', 'agencylistreport' => '-Agency List', 'empscreening' => '-Employee Screening', 'businessunits' => '-Business Units', 'departments' => '-Departments'); $emptabarr = array('dependencydetails' => TAB_EMP_DEPENDENCY, 'creditcarddetails' => TAB_EMP_CORPORATE_CARD, 'visaandimmigrationdetails' => TAB_EMP_VISA_EMIGRATION, 'workeligibilitydetails' => TAB_EMP_WORK_ELIGIBILITY, 'disabilitydetails' => TAB_EMP_DISABILITY, 'empcommunicationdetails' => TAB_EMP_CONTACT, 'empskills' => TAB_EMP_SKILLS, 'empleaves' => TAB_EMP_LEAVES, 'empholidays' => TAB_EMP_HOLIDAYS, 'medicalclaims' => TAB_EMP_MEDICAL_CLAIMS, 'educationdetails' => TAB_EMP_EDUCATION, 'experiencedetails' => TAB_EMP_EXPERIENCE, 'trainingandcertificationdetails' => TAB_EMP_TRAINING_CERTIFY, 'emppersonaldetails' => TAB_EMP_PERSONAL, 'empperformanceappraisal' => TAB_EMP_PERFORMANCE_APPRAISAL, 'emppayslips' => TAB_EMP_PAY_SLIPS, 'empbenefits' => TAB_EMP_BENEFITS, 'emprenumerationdetails' => TAB_EMP_REMUNERATION, 'empadditionaldetails' => TAB_EMP_ADDITIONAL, 'empsecuritycredentials' => TAB_EMP_SECURITY_CREDENTIALS, 'empsalarydetails' => TAB_EMP_SALARY, 'empjobhistory' => TAB_EMP_JOB_HISTORY, 'mydetails' => "", "myemployees" => "My Team", "userloginlog" => "User Log", "logmanager" => "Activity Log", "empconfiguration" => "Employee Tabs"); $myemployees_arr = array('view' => '-View', 'trainingview' => '-' . TAB_EMP_TRAINING_CERTIFY, 'comview' => '-' . TAB_EMP_CONTACT, 'skillsview' => '-' . TAB_EMP_SKILLS, 'eduview' => '-' . TAB_EMP_EDUCATION, 'expview' => '-' . TAB_EMP_EXPERIENCE, 'perview' => '-' . TAB_EMP_PERSONAL, 'additionaldetailsview' => '-' . TAB_EMP_ADDITIONAL, 'jobhistoryview' => '-' . TAB_EMP_JOB_HISTORY); $myemployeesedit_arr = array('edit' => '-Edit', 'trainingedit' => '-' . TAB_EMP_TRAINING_CERTIFY, 'comedit' => '-' . TAB_EMP_CONTACT, 'skillsedit' => '-' . TAB_EMP_SKILLS, 'eduedit' => '-' . TAB_EMP_EDUCATION, 'expedit' => '-' . TAB_EMP_EXPERIENCE, 'peredit' => '-' . TAB_EMP_PERSONAL, 'additionaldetailsedit' => '-' . TAB_EMP_ADDITIONAL, 'jobhistoryedit' => '-' . TAB_EMP_JOB_HISTORY); $myDetailsEmployeesarr = array('mydetails', 'myemployees'); $mydetails_arr = array('communicationdetailsview' => TAB_EMP_CONTACT . '-View', 'communication' => TAB_EMP_CONTACT . '-Edit', 'disabilitydetailsview' => TAB_EMP_DISABILITY . '-View', 'disability' => TAB_EMP_DISABILITY . '-Edit', 'workeligibilitydetailsview' => TAB_EMP_WORK_ELIGIBILITY . '-View', 'workeligibility' => TAB_EMP_WORK_ELIGIBILITY . '-Edit', 'visadetailsview' => TAB_EMP_VISA_EMIGRATION . '-View', 'visa' => TAB_EMP_VISA_EMIGRATION . '-Edit', 'creditcarddetailsview' => TAB_EMP_CORPORATE_CARD . '-View', 'creditcard' => TAB_EMP_CORPORATE_CARD . "-Edit", "additionaldetails" => TAB_EMP_ADDITIONAL . "-Edit", "additionaldetailsview" => TAB_EMP_ADDITIONAL . "-View", "salarydetails" => TAB_EMP_SALARY . "-Edit", "salarydetailsview" => TAB_EMP_SALARY . "-View", "personaldetailsview" => TAB_EMP_PERSONAL . "-View", "personal" => TAB_EMP_PERSONAL . "-Edit", "jobhistory" => TAB_EMP_JOB_HISTORY, "certification" => TAB_EMP_TRAINING_CERTIFY, "experience" => TAB_EMP_EXPERIENCE, "education" => TAB_EMP_EDUCATION, "medicalclaims" => TAB_EMP_MEDICAL_CLAIMS, "leaves" => TAB_EMP_LEAVES, "skills" => TAB_EMP_SKILLS, "dependency" => TAB_EMP_DEPENDENCY, "index" => TAB_EMP_OFFICIAL . "-View", "edit" => TAB_EMP_OFFICIAL . "-Edit"); //The Logic used behind this functionality is we are using the object of zend session to store the action $recentlyViewed = new Zend_Session_Namespace('recentlyViewed'); // Creating a new session with namespace if (!empty($recentlyViewed->recentlyViewedObject)) { echo '<div class="recentviewd"><label id="recentviewtext">Recently viewed</label><ul>'; $rvSize = 0; if (sizeof($recentlyViewed->recentlyViewedObject) > 3) { $rvSize = 3; $recentlyViewed->recentlyViewedObject = array_slice($recentlyViewed->recentlyViewedObject, 1); } else { $rvSize = sizeof($recentlyViewed->recentlyViewedObject); } $menuName = ''; $pagesplitName = ''; for ($i = 0; $i < $rvSize; $i++) { $pagesplit = $recentlyViewed->recentlyViewedObject[$i]; $pagesplitName = isset($pagesplit['controller_name']) ? $pagesplit['controller_name'] : ""; $pagesplitLink = isset($pagesplit['url']) ? $pagesplit['url'] : ""; $pagesplit_action = isset($pagesplit['action_name']) ? $pagesplit['action_name'] : ""; $pagesplit_idname = isset($pagesplit['id_name']) ? $pagesplit['id_name'] : ""; // Instead of url - display menu name for each list item if ($pagesplitName != 'dashboard' && $pagesplitName != 'welcome' && $pagesplitName != 'viewsettings') { if (array_key_exists($pagesplitName, $emptabarr) !== false) { $menuName = $emptabarr[$pagesplitName]; } else { $selectQuery1 = "select m.menuName from main_menu m where m.url = '/" . $pagesplitName . "'"; $db = Zend_Db_Table::getDefaultAdapter(); $sql = $db->query($selectQuery1); $resultarray = $sql->fetchAll(); if (!empty($resultarray)) { $menuName = ucfirst($resultarray[0]['menuName']); } else { $menuName = ucfirst($pagesplitName); if ($menuName == 'Appraisalstatus') { $menuName = ''; } } } } else { if ($pagesplitName == 'viewsettings') { $flagnumber = substr($pagesplitLink, -1); if ($flagnumber != '') { if ($flagnumber == 1) { $menuName = "Settings-Widgets"; } else { if ($flagnumber == 2) { $menuName = "Settings-Shortcuts"; } } } else { $menuName = "Settings"; } } else { $menuName = ucfirst($pagesplitName); } } // Display of add, edit or view in each list item // Checking condition for my employee and my details static controllers if ($pagesplitName != '' && in_array($pagesplitName, $myDetailsEmployeesarr)) { if ($pagesplit_action != '') { if ($pagesplitName == 'myemployees') { if (array_key_exists($pagesplit_action, $myemployees_arr) !== false) { $menuName .= $myemployees_arr[$pagesplit_action]; } else { if (array_key_exists($pagesplit_action, $myemployeesedit_arr) !== false) { $menuName .= $myemployeesedit_arr[$pagesplit_action]; } else { if ($actionName == 'add') { $menuName .= '-Add'; } } } } else { if (array_key_exists($pagesplit_action, $mydetails_arr) !== false) { $menuName .= $mydetails_arr[$pagesplit_action]; } } } else { if ($pagesplit_action == '') { if ($pagesplitName == 'mydetails') { $menuName .= TAB_EMP_OFFICIAL . "-View"; } } else { $menuName .= ''; } } } else { if ($pagesplitName != '' && $pagesplitName == 'reports') { if ($pagesplit_action != '') { if (array_key_exists($pagesplit_action, $reportsArr) !== false) { $menuName .= $reportsArr[$pagesplit_action]; } } } else { if ($pagesplitName != '' && $pagesplitName == 'servicerequests') { if ($pagesplit_action != '') { $param_t = isset($pagesplit['t']) ? sapp_Global::_decrypt($pagesplit['t']) : ""; $param_v = isset($pagesplit['v']) ? sapp_Global::_decrypt($pagesplit['v']) : ""; $service_menu = sapp_Helper::sd_menu_names(); $service_action_arr = sapp_Helper::sd_action_names(); if ($param_t != '' && isset($service_menu[$param_t])) { $menuName .= " - " . $service_menu[$param_t]; } if ($param_v != '' && isset($service_action_arr[$param_v])) { $menuName .= " - " . $service_action_arr[$param_v]; } } } else { if ($pagesplitName != '' && $pagesplitName == 'appraisalinit') { if ($pagesplit_action != '') { if ($pagesplit_action == 'edit') { $menuName .= '-Edit'; } if ($pagesplit_action == 'view') { $menuName .= '-View'; } if ($pagesplit_action == 'add') { $menuName .= '-Add'; } if ($pagesplit_action == 'assigngroups') { $menuName .= '-Edit Questions'; } if ($pagesplit_action == 'confmanagers') { $menuName .= '-Edit Managers'; } if ($pagesplit_action == 'viewassigngroups') { $menuName .= '-View Questions'; } if ($pagesplit_action == 'viewconfmanagers') { $menuName .= '-View Managers'; } } } else { if ($pagesplitName != '' && $pagesplitName == 'appraisalstatus') { if ($pagesplit_action != '') { if ($pagesplit_action == 'employee') { $menuName .= 'Employee Status'; } if ($pagesplit_action == 'manager') { $menuName .= 'Manager Status'; } } } else { if ($pagesplit_action != '' && $pagesplitName != 'reports') { if ($pagesplit_action == 'add') { $menuName .= '-Add'; } else { if ($pagesplit_action == 'edit' && $pagesplit_idname == 'yes') { $menuName .= '-Edit'; } else { if ($pagesplit_action == 'edit') { $menuName .= '-Add'; } else { if ($pagesplit_action == 'view') { $menuName .= '-View'; } else { if ($pagesplit_action == 'viewsettings') { $menuName = 'Settings'; } else { if ($pagesplit_action == 'viewprofile') { $menuName = 'Profile'; } else { if ($pagesplit_action == 'changepassword') { $menuName = 'Change password'; } else { if ($pagesplit_action == 'emailsettings') { $menuName = 'Email Settings'; } else { if ($pagesplit_action == 'upgradeapplication') { $menuName = 'Upgrade Application'; } } } } } } } } } } } } } } } if ($menuName) { echo '<li><span id="redirectlink" title = "' . $menuName . '" onclick ="redirecttolink(\'' . $pagesplitLink . '\');">' . $menuName . '</span><a href="javascript:void(0);" onClick="closetab(this,\'' . $pagesplitName . '\',\'' . $pagesplitLink . '\')"></a></li>'; } } } //end of display if (isset($recentlyViewed->recentlyViewedObject)) { if (sizeof($recentlyViewed->recentlyViewedObject) > 3 && $pageLink != DOMAIN && !in_array($pageName . "!@#" . $pageLink, $recentlyViewed->recentlyViewedObject)) { array_shift($recentlyViewed->recentlyViewedObject); } if ($pageName != 'public' && $pageName != 'welcome' && $controllerName != 'error') { if (!in_array('PIE.htc', $tmpPageLink)) { if ($pageLink != DOMAIN && $controllerName != 'index' && $actionName != 'welcome') { if ($this->recentlyviewed_helper($pageLink, $recentlyViewed->recentlyViewedObject) === true) { if ($controllerName == 'servicerequests') { array_push($recentlyViewed->recentlyViewedObject, array('url' => $burl, 'controller_name' => $controllerName, 'action_name' => $actionName, 'id_name' => $id_name, 't' => isset($params['t']) ? $params['t'] : "", 'v' => isset($params['v']) ? $params['v'] : "")); } else { array_push($recentlyViewed->recentlyViewedObject, array('url' => $burl, 'controller_name' => $controllerName, 'action_name' => $actionName, 'id_name' => $id_name)); } } } } } } else { $recentlyViewed->recentlyViewedObject = array(); if ($pageLink != DOMAIN && $controllerName != 'index' && $actionName != 'welcome' && $controllerName != 'error' && !in_array('PIE.htc', $tmpPageLink)) { if ($this->recentlyviewed_helper($pageLink, $recentlyViewed->recentlyViewedObject) === true) { if ($controllerName == 'servicerequests') { array_push($recentlyViewed->recentlyViewedObject, array('url' => $burl, 'controller_name' => $controllerName, 'action_name' => $actionName, 'id_name' => $id_name, 't' => isset($params['t']) ? $params['t'] : "", 'v' => isset($params['v']) ? $params['v'] : "")); } else { array_push($recentlyViewed->recentlyViewedObject, array('url' => $burl, 'controller_name' => $controllerName, 'action_name' => $actionName, 'id_name' => $id_name)); } } } } echo '</ul></div>'; }
public function breadcrumbs($baseUrlString = '') { $request = Zend_Controller_Front::getInstance(); $params = $request->getRequest()->getParams(); $controllerName = $request->getRequest()->getControllerName(); $action_Name = $request->getRequest()->getActionName(); $tName = ''; $vName = ''; $tUrl = ''; $serviceUrl = ''; $burl = $controllerName . "/" . $action_Name; /** * * For service request modifying the breadcrum based on t and v params * @var t and @var v */ $param_t = isset($params['t']) ? sapp_Global::_decrypt($params['t']) : ""; $param_v = isset($params['v']) ? sapp_Global::_decrypt($params['v']) : ""; $service_menu = sapp_Helper::sd_menu_names(); $service_action_arr = sapp_Helper::sd_action_names(); if ($param_t != '' && isset($service_menu[$param_t])) { $tName = $service_menu[$param_t] . ' Summary'; $tUrl = $baseUrlString . '/' . $controllerName . '/index/t/' . sapp_Global::_encrypt($param_t); } if ($param_v != '' && isset($service_action_arr[$param_v])) { $vName = $service_action_arr[$param_v]; } else { $vName = $action_Name != 'index' ? $action_Name : ''; } if ($vName != '') { if ($tName != '') { $serviceUrl = '<a href=' . $tUrl . '>' . $tName . '</a><span class="arrows">›</span>'; } $serviceUrl .= '<span>' . ucfirst($vName) . '</span>'; } else { $serviceUrl = '<span>' . $tName . '</span>'; } /** * End modifying breadcrum for servicerequest. */ unset($params['module'], $params['controller'], $params['action']); if (isset($params['error_handler'])) { unset($params['error_handler']); } $id_name = ''; if (is_array($params) && !empty($params)) { foreach ($params as $key => $value) { if (!is_array($value)) { $burl .= "/" . $key . "/" . $value; } } $id_name = "yes"; } $pageUrl = explode("/", $_SERVER['REQUEST_URI']); $serverUrl = $_SERVER['HTTP_HOST']; $reportsArr = array('leavesreport' => 'Leaves', 'holidaygroupreports' => 'Holidays', 'activeuser' => 'Active Users', 'employeereport' => 'Employees', 'rolesgroup' => 'Roles', 'emprolesgroup' => 'Employee Roles', 'userlogreport' => 'User Logs', 'activitylogreport' => 'Activity Logs', 'requisitionstatusreport' => 'Requisition'); $pageName = $controllerName; $actionName = $action_Name; $breadCrumbsData = ''; $mydetails_arr = array('jobhistory' => 'Employee Job History', 'certification' => 'Training & Certification Details', 'experience' => 'Experience Details', 'education' => 'Education Details', 'medicalclaims' => 'Medical Claims', 'leaves' => 'Employee Leaves', 'skills' => 'Employee Skills', 'communication' => 'Contact Details', 'communicationdetailsview' => 'Contact Details', 'disability' => 'Disability Details', 'disabilitydetailsview' => 'Disability Details', 'workeligibility' => 'Work Eligibility Details', 'workeligibilitydetailsview' => 'Work Eligibility Details', 'visa' => 'Visa and Immigration Details', 'visadetailsview' => 'Visa and Immigration Details', 'additionaldetails' => 'Additional Details', 'additionaldetailsview' => 'Additional Details', 'salarydetails' => 'Salary Details', 'salarydetailsview' => 'Salary Details', 'personal' => 'Personal Details', 'personaldetailsview' => 'Personal Details', 'creditcard' => 'Corporate Card Details', 'creditcarddetailsview' => 'Corporate Card Details', 'dependency' => 'Dependency Details', 'edit' => 'Edit'); $myemployees_arr = array('additionaldetailsview' => 'Additional Details', 'jobhistoryview' => 'Job History', 'perview' => 'Personal Details', 'expview' => 'Experience Details', 'eduview' => 'Education Details', 'skillsview' => 'Employee Skills', 'comview' => 'Contact Details', 'trainingview' => 'Training & Certification Details', 'view' => 'View'); if ($pageName == '' || $pageName == 'welcome') { $breadCrumbsData .= ''; } else { if ($pageName == 'dashboard') { $breadCrumbsData = '<div class="breadcrumbs">'; if ($actionName == 'viewsettings') { $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Settings'; } else { if ($actionName == 'viewprofile') { $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Profile'; } else { if ($actionName == 'changepassword') { $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Change Password'; } else { if ($actionName == 'emailsettings') { $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Email Settings'; } else { if ($actionName == 'upgradeapplication') { $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Upgrade Application '; } } } } } $breadCrumbsData .= '</div>'; } else { if ($pageName == 'configuresite') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Configure Site'; $breadCrumbsData .= '</div>'; } else { if ($pageName == 'managemenus') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Manage Modules'; $breadCrumbsData .= '</div>'; } else { if ($pageName == 'logmanager') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Activity Log'; $breadCrumbsData .= '</div>'; } else { if ($pageName == 'userloginlog') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> User Log'; $breadCrumbsData .= '</div>'; } else { if ($pageName == 'servicerequests') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span> Service Request Management<span class="arrows">›</span>' . $serviceUrl . ''; $breadCrumbsData .= '</div>'; } else { if ($pageName == 'reports') { $breadCrumbsData = '<div class="breadcrumbs">'; $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">›</span>'; if (isset($actionName) && $actionName != '') { $breadCrumbsData .= '<span><a href="' . $baseUrlString . '/reports">Analytics</a></span>'; if ($actionName == 'userlogreport') { $breadCrumbsData .= '<span class="arrows">›</span>Audit Logs<span class="arrows">›</span><span>User log Report</span>'; } else { if ($actionName == 'activitylogreport') { $breadCrumbsData .= '<span class="arrows">›</span>Audit Logs<span class="arrows">›</span><span>Activity log Report</span>'; } else { if ($actionName == 'businessunits') { $breadCrumbsData .= '<span class="arrows">›</span>Organization<span class="arrows">›</span><span>Business Units Report</span>'; } else { if ($actionName == 'departments') { $breadCrumbsData .= '<span class="arrows">›</span>Organization<span class="arrows">›</span><span>Departments Report</span>'; } else { if ($actionName == 'leavesreport') { $breadCrumbsData .= '<span class="arrows">›</span>Leave Management<span class="arrows">›</span><span>Employee Leaves Summary Report</span>'; } else { if ($actionName == 'leavemanagementreport') { $breadCrumbsData .= '<span class="arrows">›</span>Leave Management<span class="arrows">›</span><span>Leave Management Summary Report</span>'; } else { if ($actionName == 'holidaygroupreports') { $breadCrumbsData .= '<span class="arrows">›</span>Holiday Management<span class="arrows">›</span><span>Holiday Groups & Holidays Report</span>'; } else { if ($actionName == 'employeereport') { $breadCrumbsData .= '<span class="arrows">›</span><span>Employees Report</span> '; } else { if ($actionName == 'rolesgroup') { $breadCrumbsData .= '<span class="arrows">›</span>User Management<span class="arrows">›</span><span>Groups & Roles Report</span>'; } else { if ($actionName == 'emprolesgroup') { $breadCrumbsData .= '<span class="arrows">›</span>User Management<span class="arrows">›</span><span>Groups, Roles & Employees Report</span>'; } else { if ($actionName == 'activeuser') { $breadCrumbsData .= '<span class="arrows">›</span>User Management<span class="arrows">›</span><span>Users & Employees Report</span>'; } else { if ($actionName == 'requisitionstatusreport') { $breadCrumbsData .= '<span class="arrows">›</span>Resource Requisition<span class="arrows">›</span><span>Requisitions Report</span>'; } else { if ($actionName == 'candidatesreport') { $breadCrumbsData .= '<span class="arrows">›</span>Resource Requisition<span class="arrows">›</span><span>Candidate Details Report</span>'; } else { if ($actionName == 'interviewrounds') { $breadCrumbsData .= '<span class="arrows">›</span>Resource Requisition<span class="arrows">›</span><span>Scheduled Interviews Report</span>'; } else { if ($actionName == 'empscreening') { $breadCrumbsData .= '<span class="arrows">›</span>Background Checks<span class="arrows">›</span><span>Employee / Candidate Screening Report</span>'; } else { if ($actionName == 'agencylistreport') { $breadCrumbsData .= '<span class="arrows">›</span>Background Checks<span class="arrows">›</span><span>Background Checks Agencies Report</span>'; } } } } } } } } } } } } } } } } } else { $breadCrumbsData .= '<span>Analytics</span>'; } $breadCrumbsData .= '</div>'; } else { $breadCrumbsData = '<div class="breadcrumbs">'; $url = "/" . $pageName; $breadCrumIds = $this->getBreadCrumDetails($url); $breadCrumNames = array(); if (!empty($breadCrumIds)) { $menu_model = new Default_Model_Menu(); $breadcrumstring = trim($breadCrumIds[0]['nav_ids'], ','); $breadcrumArr = explode(",", $breadcrumstring); $breadCrumNames = $breadCrumIds; $breadCrumbsData .= '<span class="firstbreadcrumb" onclick="window.location=\'' . $baseUrlString . '\'">Home</span> <span class="arrows">›</span> '; for ($b = 0; $b < sizeof($breadCrumNames); $b++) { $breadCrumNames[$b]['menuName'] = $menu_model->getMenuText($breadCrumNames[$b]['menuName']); if ($b == 0) { if ($breadCrumNames[$b]['url'] == '/sitepreference') { $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span>'; } else { $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span> <span class="arrows">›</span> '; } } else { if ($b == sizeof($breadCrumNames) - 1) { if ($actionName == '') { $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span>'; } else { $breadCrumbsData .= '<a href="' . $baseUrlString . $breadCrumNames[$b]['url'] . '" >' . $breadCrumNames[$b]['menuName'] . '</a>'; } } else { $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span> <span class="arrows">›</span> '; } } } if ($actionName == 'add' || $actionName == 'edit' && $id_name == '' || $actionName != '' && $actionName != 'view') { if ($actionName == 'edit' || $actionName != '') { $idvalindex = ''; if (in_array('id', $pageUrl)) { $idindex = array_search('id', $pageUrl); $idvalindex = $idindex + 1; } else { if (in_array('userid', $pageUrl)) { $idindex = array_search('userid', $pageUrl); $idvalindex = $idindex + 1; } } if ((in_array('id', $pageUrl) || in_array('userid', $pageUrl)) && $pageName != 'myemployees') { $idval = intval($pageUrl[$idvalindex]); if ($idval != 0) { $breadCrumbsData .= '<span class="arrows">›</span> <span>Edit</span>'; } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add</span>'; } } else { if ($pageName == 'mydetails') { if (isset($actionName) && $actionName != '') { if (array_key_exists($actionName, $mydetails_arr) !== false) { $breadCrumbsData .= '<span class="arrows">›</span> <span>' . $mydetails_arr[$actionName] . '</span>'; } } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>Edit</span>'; } } else { if ($pageName == 'myemployees') { if (isset($actionName) && $actionName != '') { if (array_key_exists($actionName, $myemployees_arr) !== false) { $breadCrumbsData .= '<span class="arrows">›</span> <span>' . $myemployees_arr[$actionName] . '</span>'; } } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>View</span>'; } } else { if ($actionName == 'multipleresume') { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add multiple CVs</span>'; } if ($actionName == 'edit' && $pageName == 'heirarchy') { $breadCrumbsData .= '<span class="arrows">›</span> <span>Edit</span>'; } else { if ($actionName == 'edit' || $actionName == 'add') { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add</span>'; } else { $breadCrumbsData .= ''; } } } } } } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add</span>'; } } else { if ($actionName == 'edit') { $idvalindex = ''; if (in_array('id', $pageUrl)) { $idindex = array_search('id', $pageUrl); $idvalindex = $idindex + 1; } else { if (in_array('userid', $pageUrl)) { $idindex = array_search('userid', $pageUrl); $idvalindex = $idindex + 1; } } if (in_array('id', $pageUrl) || in_array('userid', $pageUrl)) { $idval = intval($pageUrl[$idvalindex]); if ($idval != '') { $breadCrumbsData .= '<span class="arrows">›</span> <span>Edit</span>'; } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add</span>'; } } else { $breadCrumbsData .= '<span class="arrows">›</span> <span>Add</span>'; } } else { if ($actionName == 'view') { $breadCrumbsData .= '<span class="arrows">›</span> <span>View</span>'; } } } $breadCrumbsData .= '</div>'; } else { $breadCrumbsData = ''; } } } } } } } } } echo $breadCrumbsData; }
/** ** 1. gets menudata from database ** 2. prepares the first and second level menuids array ** 3. builds the menu tree html ** 4. con = settings for settings menu **/ public function menubuilder($con = "", $userRole = 2, $flag = "", $usergroup) { $uploadPath = BASE_URL . '/public/media/images/menuIcons/'; $menuheightclass = ''; $groupbasedclass = ''; $ulclass = ''; if ($usergroup == '' || $usergroup == MANAGEMENT_GROUP) { $menuheightclass = ''; $groupbasedclass = ''; } else { $menuheightclass = 'menuheight'; $groupbasedclass = '-common'; $ulclass = 'new-roles'; } $menu_model = new Default_Model_Menu(); $marr = $menu_model->getgroup_formenu($usergroup, $userRole, ''); $menuarr = $marr['tmpArr']; $parent_menu_class = array(SITECONFIGURATION => 'site-configuration', EMPLOYEECONFIGURATION => "employee-configuration", SITEPREFERENCE => "site-preferences", ORGANIZATION => "organization-menu", USERMANAGEMENT => "user-management", HUMANRESOURCE => "hr-module", RESOURCEREQUISITION => "req-module", EMPLOYEESELFSERVICE => "ess-module", BGCHECKS => "bg-module", REPORTS => "report-module", MANAGEMODULE => "manage-module", SERVICEDESK => 'service-desk', PERFORMANCEAPPRAISAL => "perf-app", FEED_FORWARD => "feed-forward", DASHBOARD_MENU => "dashboard"); $parent_menu_selected_class = array(SITECONFIGURATION => 'sitec-selected', EMPLOYEECONFIGURATION => "employeec-selected", SITEPREFERENCE => "sitep-selected", ORGANIZATION => "organization-selected", USERMANAGEMENT => "user-selected", HUMANRESOURCE => "hr-selected", RESOURCEREQUISITION => "req-selected", EMPLOYEESELFSERVICE => "ess-selected", BGCHECKS => "bg-selected", REPORTS => "report-selected", MANAGEMODULE => "manage-selected", SERVICEDESK => 'service-selected', PERFORMANCEAPPRAISAL => "perf-app-selected", FEED_FORWARD => 'feed-forward-selected', DASHBOARD_MENU => "dashboard-selected"); $tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration', EMPLOYEECONFIGURATION => "tour_employeeconfigurations", SITEPREFERENCE => "tour_sitepreferences", ORGANIZATION => "tour_organization", USERMANAGEMENT => "tour_usermanagement", HUMANRESOURCE => "tour_humanresource", RESOURCEREQUISITION => "tour_requisition", EMPLOYEESELFSERVICE => "tour_employeeselfservice", BGCHECKS => "tour_backgroundchecks", REPORTS => "tour_reports", MANAGEMODULE => "tour_managemodules", SERVICEDESK => 'tour_service', PERFORMANCEAPPRAISAL => "tour_performanceappraisal", FEED_FORWARD => 'tour_feedforward', DASHBOARD_MENU => "tour_dashboard"); $childs_menu = ""; $parent_menu = "<div class='home_menu'><div class='menu-head " . $menuheightclass . "' id='menu-shadow' style='display:none;'>\n\t\t\t\t<ul id='scroller' class='" . $ulclass . "'>"; $clas_drag = $con == 'settings' ? ' draggable-reports-li ' : ''; // Add draggable class for dashbord $parent_menu .= "<li id='main_parent_" . DASHBOARD_MENU . "' super-parent = 'main_parent_" . DASHBOARD_MENU . "' class = '" . $clas_drag . "clickable_menu " . $parent_menu_selected_class[DASHBOARD_MENU] . "-main " . $tour_menu_class[DASHBOARD_MENU] . "' menu-url ='" . BASE_URL . "/welcome' selected-class = '" . $parent_menu_selected_class[DASHBOARD_MENU] . "' > <a id='" . DASHBOARD_MENU . "' ><span class='scroll-menu dashboard dashboard-selected-common super_selected'></span><b>Dashboard</b></a></li>"; foreach ($menuarr as $menuid => $data) { $for_childs_str = ""; $parent_url = BASE_URL . $data['url']; if (isset($data['childs']) && count($data['childs']) > 0) { $for_childs_str = "div_mchilds_" . $menuid; $parent_url = ""; $childs_menu .= "<div class='side-menu " . $for_childs_str . "' style='display:none;'>\n\t\t\t\t\t\t\t\t\t<ul>"; foreach ($data['childs'] as $ch_menu_id => $ch_menu_data) { if (isset($ch_menu_data['childs']) && count($ch_menu_data['childs']) > 0) { $childs_menu .= "<li class='acc_li'><span class='acc_li_toggle' id='acc_li_toggle_" . $ch_menu_data['id'] . "' onclick='togglesubmenus(" . $ch_menu_data['id'] . ");'><b>" . $ch_menu_data['menuName'] . "</b></span><ul>"; foreach ($ch_menu_data['childs'] as $ch2_menu_id => $ch2_menu_data) { if ($con == 'settings') { $childs_menu .= "<li class = 'clickable_menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='javascript:void(0);'>" . $ch2_menu_data['menuName'] . "</a></li>"; } else { $childs_menu .= "<li class = 'clickable_menu' primary_parent = '" . $ch2_menu_data['parent'] . "' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='" . BASE_URL . $ch2_menu_data['url'] . "/'>" . $ch2_menu_data['menuName'] . "</a></li>"; } } $childs_menu .= "</ul></li>"; } else { if ($con == 'settings') { if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) { $storage = new Zend_Auth_Storage_Session(); $sess_data = $storage->read(); $childs_menu .= sapp_Helper::service_header($sess_data, 'menusettings'); } else { $childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='javascript:void(0);'>" . $ch_menu_data['menuName'] . "</a></li>"; } } else { if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) { $storage = new Zend_Auth_Storage_Session(); $sess_data = $storage->read(); $childs_menu .= sapp_Helper::service_header($sess_data, 'menu'); } else { $condition = $ch_menu_data['id'] == 168 ? "<span class='beta_menu'></span>" : ""; $childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='" . BASE_URL . $ch_menu_data['url'] . "/'>" . $ch_menu_data['menuName'] . $condition . "</a></li>"; } } } } $childs_menu .= "</ul></div>"; } $super_str = ""; $dummy_parent_div = ""; if ($menuid == SITEPREFERENCE) { $super_str = " super-parent = 'main_parent_" . $menuid . "' "; $dummy_parent_div = "parent-div = 'dummy'"; } if ($con == 'settings') { $parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'draggable-reports-li clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>"; } else { $groupclass = ""; $parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>"; } } //end of for loop if (($userRole == SUPERADMIN || $usergroup == MANAGEMENT_GROUP) && $con != 'settings') { $parent_menu .= "<li selected-class='log-selected' id='main_parent_logs' class='clickable_menu log-selected-main tour_logs' menu-url='' for-childs = 'div_mchilds_logs'><span class='scroll-menu log-module'></span><b>Logs</b></li>"; $childs_menu .= "<div class='side-menu div_mchilds_logs' style='display:none;'>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "/logmanager'><a href='" . BASE_URL . "/logmanager'>Activity Log</a></li>\n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "/userloginlog'><a href='" . BASE_URL . "/userloginlog'>User Log</a></li>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t </div>"; } $parent_menu .= " </ul>\n\t\t\t </div></div>\n\t\t"; return array('parent_menu' => $parent_menu, 'childs_menu' => $childs_menu); }
public function uploadexcelAction() { $savefolder = EMP_EXCEL_UPLOAD_PATH; // folder for upload $max_size = 1048576; // maxim size for image file, in KiloBytes // Allowed file types $allowtype = array('xls', 'xlsx'); $rezultat = ''; $result_status = ''; $result_msg = ''; // if is received a valid file if (isset($_FILES['emp_excel'])) { // checks to have the allowed extension $type = explode(".", strtolower($_FILES['emp_excel']['name'])); $ext = $type[count($type) - 1]; if (in_array($ext, $allowtype)) { // check its size if ($_FILES['emp_excel']['size'] <= $max_size * 1024) { // if no errors if ($_FILES['emp_excel']['error'] == 0) { $newname = 'ex_pre_' . date("His") . '.' . $ext; $thefile = $savefolder . "/" . $_FILES['emp_excel']['name']; $newfilename = $savefolder . "/" . $newname; $filename = $newname; if (!move_uploaded_file($_FILES['emp_excel']['tmp_name'], $newfilename)) { $rezultat = ''; $result_status = 'error'; $result_msg = 'The file cannot be uploaded, try again.'; } else { $rezultat = $filename; $stat = sapp_Helper::process_emp_excel($newfilename); $result_msg = $stat['msg']; $result_status = $stat['status']; } } } else { $rezultat = ''; $result_status = 'error'; $result_msg = 'The file exceeds the maximum permitted size ' . $max_size . ' KB.'; } } else { $rezultat = ''; $result_status = 'error'; $result_msg = 'Please upload only .xls,.xlsx files.'; } } else { $rezultat = ''; $result_status = 'error'; $result_msg = 'Please upload only .gif, .jpg, .jpeg, .png images.'; } $result = array('result' => $result_status, 'img' => $rezultat, 'msg' => $result_msg); $this->_helper->json($result); }
public function editsave($empsalarydetailsform, $userid) { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } if ($empsalarydetailsform->isValid($this->_request->getPost())) { $post_values = $this->_request->getPost(); if (isset($post_values['id'])) { unset($post_values['id']); } if (isset($post_values['user_id'])) { unset($post_values['user_id']); } if (isset($post_values['submit'])) { unset($post_values['submit']); } $new_post_values = array_filter($post_values); if (!empty($new_post_values)) { $empsalarydetailsModal = new Default_Model_Empsalarydetailsnew(); $id = $this->_request->getParam('id'); $user_id = $userid; $signonbonus = $this->_request->getParam('signonbonus'); $relocationcost = $this->_request->getParam('relocationcost'); $noticebuyout = $this->_request->getParam('noticebuyout'); $others1 = $this->_request->getParam('others1'); $fixedctc = $this->_request->getParam('fixedctc'); $variablepay = $this->_request->getParam('variablepay'); $lta = $this->_request->getParam('lta'); $others2 = $this->_request->getParam('others2'); $date = new Zend_Date(); $menumodel = new Default_Model_Menu(); $actionflag = ''; $tableid = ''; $data = array('user_id' => $user_id, 'signonbonus' => sapp_Helper::_dataEncrypt($signonbonus, ENCRYPTION_KEY), 'relocationcost' => sapp_Helper::_dataEncrypt($relocationcost, ENCRYPTION_KEY), 'noticebuyout' => sapp_Helper::_dataEncrypt($noticebuyout, ENCRYPTION_KEY), 'others1' => sapp_Helper::_dataEncrypt($others1, ENCRYPTION_KEY), 'fixedctc' => sapp_Helper::_dataEncrypt($fixedctc, ENCRYPTION_KEY), 'variablepay' => sapp_Helper::_dataEncrypt($variablepay, ENCRYPTION_KEY), 'lta' => sapp_Helper::_dataEncrypt($lta, ENCRYPTION_KEY), 'others2' => sapp_Helper::_dataEncrypt($others2, ENCRYPTION_KEY), 'isactive' => 1, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $recExists = $empsalarydetailsModal->isCompensationDataExists($user_id); if ($recExists == "true") { $where = array('user_id=?' => $user_id); $actionflag = 2; } else { $data['createdby'] = $loginUserId; $data['createddate'] = gmdate("Y-m-d H:i:s"); $data['isactive'] = 1; $where = ''; $actionflag = 1; } $Id = $empsalarydetailsModal->SaveorUpdateEmpSalaryData($data, $where); if ($Id == 'update') { $tableid = $id; $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Employee salary details updated successfully.")); } else { $tableid = $Id; $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Employee salary details added successfully.")); } $menuidArr = $menumodel->getMenuObjID('/employee'); $menuID = $menuidArr[0]['id']; $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $user_id); } else { $this->_helper->getHelper("FlashMessenger")->addMessage(array("error" => FIELDMSG)); } $this->_redirect('empsalarydetails/edit/userid/' . $userid); } else { $messages = $empsalarydetailsform->getMessages(); foreach ($messages as $key => $val) { foreach ($val as $key2 => $val2) { $msgarray[$key] = $val2; break; } } return $msgarray; } }
/** ** 1. gets menudata from database ** 2. prepares the first and second level menuids array ** 3. builds the menu tree html ** 4. con = settings for settings menu **/ public function menubuilder($con = "", $userRole = 2, $flag = "", $usergroup) { $uploadPath = BASE_URL . 'public/media/images/menuIcons/'; $menuheightclass = ''; $groupbasedclass = ''; $ulclass = ''; if ($usergroup == '' || $usergroup == MANAGEMENT_GROUP) { $menuheightclass = ''; $groupbasedclass = ''; } else { $menuheightclass = 'menuheight'; $groupbasedclass = '-common'; $ulclass = 'new-roles'; } $menu_model = new Default_Model_Menu(); $marr = $menu_model->getgroup_formenu($usergroup, $userRole, ''); $active_menus = $menu_model->getisactivemenus(); $act_menus = array(); if (!empty($active_menus)) { foreach ($active_menus as $act) { $act_menus[$act['id']] = $act; } } $menuarr = $marr['tmpArr']; /*** removing icons in the menu 07-08-2015 - START - *** $parent_menu_class = array(SITECONFIGURATION => 'site-configuration',EMPLOYEECONFIGURATION => "employee-configuration", SITEPREFERENCE => "site-preferences",ORGANIZATION => "organization-menu", USERMANAGEMENT => "user-management",HUMANRESOURCE => "hr-module",RESOURCEREQUISITION => "req-module", EMPLOYEESELFSERVICE => "ess-module",BGCHECKS => "bg-module", REPORTS => "report-module",MANAGEMODULE => "manage-module",SERVICEDESK => 'service-desk', PERFORMANCEAPPRAISAL => "perf-app",FEED_FORWARD => "feed-forward",DASHBOARD_MENU => "dashboard",ANNOUNCEMENTS => "" ); $parent_menu_selected_class = array( SITECONFIGURATION => 'sitec-selected',EMPLOYEECONFIGURATION => "employeec-selected", SITEPREFERENCE => "sitep-selected",ORGANIZATION => "organization-selected", USERMANAGEMENT => "user-selected",HUMANRESOURCE => "hr-selected",RESOURCEREQUISITION => "req-selected", EMPLOYEESELFSERVICE => "ess-selected",BGCHECKS => "bg-selected", REPORTS => "report-selected",MANAGEMODULE => "manage-selected", SERVICEDESK => 'service-selected',PERFORMANCEAPPRAISAL => "perf-app-selected",FEED_FORWARD => 'feed-forward-selected',DASHBOARD_MENU => "dashboard-selected",ANNOUNCEMENTS => "" ); $tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration', EMPLOYEECONFIGURATION => "tour_employeeconfigurations", SITEPREFERENCE => "tour_sitepreferences",ORGANIZATION => "tour_organization", USERMANAGEMENT => "tour_usermanagement",HUMANRESOURCE => "tour_humanresource", RESOURCEREQUISITION => "tour_requisition",EMPLOYEESELFSERVICE => "tour_employeeselfservice", BGCHECKS => "tour_backgroundchecks",REPORTS => "tour_reports", MANAGEMODULE =>"tour_managemodules",SERVICEDESK => 'tour_service',PERFORMANCEAPPRAISAL => "tour_performanceappraisal", FEED_FORWARD => 'tour_feedforward',DASHBOARD_MENU => "tour_dashboard" ,ANNOUNCEMENTS => "tour_dashboard" ); ******* removing icons in the menu 07-08-2015 - END - ***/ $parent_menu_class = array(SITECONFIGURATION => '', EMPLOYEECONFIGURATION => "", SITEPREFERENCE => "", ORGANIZATION => "", USERMANAGEMENT => "", HUMANRESOURCE => "", RESOURCEREQUISITION => "", EMPLOYEESELFSERVICE => "", BGCHECKS => "", REPORTS => "", MANAGEMODULE => "", SERVICEDESK => '', PERFORMANCEAPPRAISAL => "", FEED_FORWARD => "", DASHBOARD_MENU => "", ANNOUNCEMENTS => "", TIMEMANAGEMENT => ""); $parent_menu_selected_class = array(SITECONFIGURATION => '', EMPLOYEECONFIGURATION => "", SITEPREFERENCE => "", ORGANIZATION => "", USERMANAGEMENT => "", HUMANRESOURCE => "", RESOURCEREQUISITION => "", EMPLOYEESELFSERVICE => "", BGCHECKS => "", REPORTS => "", MANAGEMODULE => "", SERVICEDESK => '', PERFORMANCEAPPRAISAL => "", FEED_FORWARD => '', DASHBOARD_MENU => "", ANNOUNCEMENTS => "", TIMEMANAGEMENT => ""); $tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration', EMPLOYEECONFIGURATION => "tour_employeeconfigurations", SITEPREFERENCE => "tour_sitepreferences", ORGANIZATION => "tour_organization", USERMANAGEMENT => "tour_usermanagement", HUMANRESOURCE => "tour_humanresource", RESOURCEREQUISITION => "tour_requisition", EMPLOYEESELFSERVICE => "tour_employeeselfservice", BGCHECKS => "tour_backgroundchecks", REPORTS => "tour_reports", MANAGEMODULE => "tour_managemodules", SERVICEDESK => 'tour_service', PERFORMANCEAPPRAISAL => "tour_performanceappraisal", FEED_FORWARD => 'tour_feedforward', DASHBOARD_MENU => "tour_dashboard", ANNOUNCEMENTS => "tour_dashboard", TIMEMANAGEMENT => "tour_timemanagement"); $childs_menu = ""; $parent_menu = "<div class='home_menu'><div role='main' class='menu-head main" . $menuheightclass . "' id='menu-shadow' style='display:none;'>\n\t\t\t\t<ul id='main_ul' class='menu flex'>"; $clas_drag = $con == 'settings' ? ' draggable-reports-li ' : ''; // Add draggable class for dashbord /*** commented to remove menu icon 07-08-2015 - START - *** $parent_menu .= "<li id='main_parent_".DASHBOARD_MENU."' super-parent = 'main_parent_".DASHBOARD_MENU."' class = '".$clas_drag."clickable_menu ".$parent_menu_selected_class[DASHBOARD_MENU]."-main ".$tour_menu_class[DASHBOARD_MENU]."' menu-url ='".BASE_URL."welcome' selected-class = '".$parent_menu_selected_class[DASHBOARD_MENU]."' > <a id='".DASHBOARD_MENU."' ><span class='scroll-menu dashboard dashboard-selected-common super_selected'></span><b>Dashboard</b></a></li>"; *** commented to remove menu icon 07-08-2015 - END - ***/ $parent_menu .= "<li id='main_parent_" . DASHBOARD_MENU . "' super-parent = 'main_parent_" . DASHBOARD_MENU . "' class = '" . $clas_drag . "clickable_menu " . $parent_menu_selected_class[DASHBOARD_MENU] . "-main " . $tour_menu_class[DASHBOARD_MENU] . "' menu-url ='" . BASE_URL . "welcome' selected-class = '" . $parent_menu_selected_class[DASHBOARD_MENU] . "' > <a id='" . DASHBOARD_MENU . "' ><b>Dashboard</b></a></li>"; foreach ($menuarr as $menuid => $data) { $for_childs_str = ""; $parent_url = rtrim(BASE_URL, "/") . $data['url']; if (isset($data['childs']) && count($data['childs']) > 0) { $for_childs_str = "div_mchilds_" . $menuid; $parent_url = ""; $childs_menu .= "<div class='side-menu " . $for_childs_str . "' style='display:none;'>\n\t\t\t\t\t\t\t\t\t<ul>"; foreach ($data['childs'] as $ch_menu_id => $ch_menu_data) { if (isset($ch_menu_data['childs']) && count($ch_menu_data['childs']) > 0) { $childs_menu .= "<li class='acc_li'><span class='acc_li_toggle' id='acc_li_toggle_" . $ch_menu_data['id'] . "' onclick='togglesubmenus(" . $ch_menu_data['id'] . ");'><b>" . $ch_menu_data['menuName'] . "</b></span><ul>"; foreach ($ch_menu_data['childs'] as $ch2_menu_id => $ch2_menu_data) { if ($con == 'settings') { if ($ch2_menu_id == MANAGE_POLICY_DOCS) { /** policy document categories is not built as menu items ** for settings page **/ } else { $childs_menu .= "<li class = 'clickable_menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . "\t\thref='javascript:void(0);'>" . $ch2_menu_data['menuName'] . "</a></li>"; } } else { if ($ch2_menu_id == MANAGE_POLICY_DOCS) { /** to build policy document categories as menu items **/ $childs_menu .= sapp_Helper::viewPolicyDocuments('menu'); } else { $childs_menu .= "<li class = 'clickable_menu' primary_parent = '" . $ch2_menu_data['parent'] . "' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "/'>" . $ch2_menu_data['menuName'] . "</a></li>"; } } } $childs_menu .= "</ul></li>"; } else { if ($con == 'settings') { if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) { $storage = new Zend_Auth_Storage_Session(); $sess_data = $storage->read(); $childs_menu .= sapp_Helper::service_header($sess_data, 'menusettings'); } else { if ($menuid == MANAGE_POLICY_DOCS) { /** policy document categories is not built as menu items ** for settings page **/ } else { $childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='javascript:void(0);'>" . $ch_menu_data['menuName'] . "</a></li>"; } } } else { if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) { $storage = new Zend_Auth_Storage_Session(); $sess_data = $storage->read(); $childs_menu .= sapp_Helper::service_header($sess_data, 'menu'); } else { if ($menuid == MANAGE_POLICY_DOCS) { /** to build policy document categories as menu items **/ $childs_menu .= sapp_Helper::viewPolicyDocuments('menu'); } else { $condition = $ch_menu_data['id'] == 168 ? "<span class='beta_menu'></span>" : ""; $childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='" . rtrim(BASE_URL, "/") . $ch_menu_data['url'] . "/'>" . $ch_menu_data['menuName'] . $condition . "</a></li>"; } } } } } $childs_menu .= "</ul></div>"; } $super_str = ""; $dummy_parent_div = ""; if ($menuid == SITEPREFERENCE) { $super_str = " super-parent = 'main_parent_" . $menuid . "' "; $dummy_parent_div = "parent-div = 'dummy'"; } if ($con == 'settings') { $parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'draggable-reports-li clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>"; } else { if ($menuid != TIMEMANAGEMENT) { $groupclass = ""; $parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>"; } } } //end of for loop //for time management if (isset($act_menus[TIMEMANAGEMENT]) && $act_menus[TIMEMANAGEMENT]['isactive'] == 1 && $usergroup != USERS_GROUP) { $parent_menu .= "<li id='main_parent_" . TIMEMANAGEMENT . "' super-parent = 'main_parent_" . TIMEMANAGEMENT . "' class = '" . $clas_drag . "clickable_menu " . $parent_menu_selected_class[TIMEMANAGEMENT] . "-main " . $tour_menu_class[TIMEMANAGEMENT] . "' menu-url ='" . BASE_URL . "timemanagement' selected-class = '" . $parent_menu_selected_class[TIMEMANAGEMENT] . "' > <a id='" . TIMEMANAGEMENT . "' ><b>" . $act_menus[TIMEMANAGEMENT]['menuName'] . "</b></a></li>"; } if (($userRole == SUPERADMIN || $usergroup == MANAGEMENT_GROUP) && $con != 'settings') { /*** removing icon for Logs menu item 17-08-2015 - START --- **** $parent_menu .= "<li selected-class='log-selected' id='main_parent_logs' class='clickable_menu log-selected-main tour_logs' menu-url='' for-childs = 'div_mchilds_logs'><span class='scroll-menu log-module'></span><b>Logs</b></li>"; **** END ****/ $parent_menu .= "<li selected-class='log-selected' id='main_parent_logs' class='clickable_menu log-selected-main tour_logs' menu-url='' for-childs = 'div_mchilds_logs'><b>Logs</b></li>"; /** * * Logs links are static so <a> tags are required for these static links. * Remaingin links are dynamic (Exists in database) * @var String - HTML markup */ $childs_menu .= "<div class='side-menu div_mchilds_logs' style='display:none;'>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "logmanager'><a href='" . BASE_URL . "logmanager'>Activity Log</a></li>\n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "userloginlog'><a href='" . BASE_URL . "userloginlog'>User Log</a></li>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t </div>"; } $parent_menu .= " </ul>\n\t\t\t </div></div>\n\t\t"; return array('parent_menu' => $parent_menu, 'childs_menu' => $childs_menu); }