本文整理汇总了PHP中Default_Model_Menu类的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Menu类的具体用法?PHP Default_Model_Menu怎么用?PHP Default_Model_Menu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Default_Model_Menu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save($holidaygroupsform)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
if ($holidaygroupsform->isValid($this->_request->getPost())) {
$id = $this->_request->getParam('id');
$groupname = $this->_request->getParam('title');
$description = $this->_request->getParam('description');
$date = new Zend_Date();
$holidaygroupsmodel = new Default_Model_Feedback();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('title' => $groupname, 'description' => trim($description), '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 = $holidaygroupsmodel->SaveorUpdateGroupData($data, $where);
if ($Id == 'update') {
$tableid = $id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Feedback updated successfully."));
} else {
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Feedback added successfully."));
}
$menuidArr = $menumodel->getMenuObjID('/feedback');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
//$this->_redirect('/feedback');
//$this->view->finalResult = $result;
return "Success...!";
} else {
$messages = $holidaygroupsform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
return $msgarray;
}
}
示例2: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', BASE_URL . 'reports/activitylogreport');
$this->setAttrib('id', 'activitylog');
$this->setAttrib('name', 'activitylog');
$username = new Zend_Form_Element_Text('username');
$username->setAttrib('onblur', 'clearautoactivity(this)');
$username->addFilter(new Zend_Filter_StringTrim());
$username->setLabel("User Name");
$menu = new Zend_Form_Element_Select('menu');
$menu->setLabel('Menu');
$menu->setAttrib('onchange', 'changeelement(this)');
$menuModel = new Default_Model_Menu();
$menuList = $menuModel->getMenuArrayActivityLogReport();
$menu->addMultiOption('', 'Select Menu');
foreach ($menuList as $menuitem) {
$menu->addMultiOption($menuitem['id'], $menuitem['menuName']);
}
$useraction = new Zend_Form_Element_Select('useraction');
$useraction->setLabel('User Action');
$useraction->setAttrib('onchange', 'changeelement(this)');
$useraction->addMultiOption('', 'Select Action');
$useraction->addMultiOption('1', 'Add');
$useraction->addMultiOption('5', 'Cancel');
$useraction->addMultiOption('3', 'Delete');
$useraction->addMultiOption('2', 'Edit');
$modifieddate = new ZendX_JQuery_Form_Element_DatePicker('modifieddate');
$modifieddate->setAttrib('onblur', 'blurelement(this)');
$modifieddate->setLabel("Modified Date");
$modifieddate->setAttrib('readonly', 'true');
$modifieddate->setAttrib('onfocus', 'this.blur()');
$modifieddate->setOptions(array('class' => 'brdr_none'));
$this->addElements(array($username, $menu, $useraction, $modifieddate));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('modifieddate'));
}
示例3: updateAction
public function updateAction()
{
$empDocuModel = new Default_Model_Employeedocs();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('doc_id');
$name = $this->_request->getParam('doc_name');
$userid = $this->_request->getParam('userid');
// Get attachments
$file_original_names = $this->getRequest()->getParam('file_original_names');
$file_new_names = $this->getRequest()->getParam('file_new_names');
$org_names = explode(',', $file_original_names);
$new_names = explode(',', $file_new_names);
$attachment_array = array();
for ($i = 0; $i < count($org_names); $i++) {
if ($new_names[$i] != '') {
$attachment_array[] = array("original_name" => $org_names[$i], "new_name" => $new_names[$i]);
}
}
$data = array('name' => $name, 'attachments' => count($attachment_array) > 0 ? json_encode($attachment_array) : null, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
// Validate duplicate document name
$empDocuments = $empDocuModel->checkDocNameByUserIdAndDocId($userid, $name, $id);
$count_emp_docs = count($empDocuments);
if ($count_emp_docs == 0) {
$where = array('id=?' => $id);
$actionflag = 2;
$recordId = $empDocuModel->SaveorUpdateEmpDocuments($data, $where);
$menumodel = new Default_Model_Menu();
$menuidArr = $menumodel->getMenuObjID('/employee');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $userid);
$this->_helper->json(array('result' => 'success'));
} else {
if ($count_emp_docs > 0) {
$this->_helper->json(array('result' => 'exists'));
} else {
$this->_helper->json(array('result' => 'error'));
}
}
}
示例4: 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');
}
}
示例5: deleteAction
public function deleteAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('objid');
$messages['message'] = '';
$messages['msgtype'] = '';
$actionflag = 3;
if ($id) {
$systempreferencemodel = new Default_Model_Sitepreference();
$menumodel = new Default_Model_Menu();
$data = array('isactive' => 0);
$where = array('id=?' => $id);
$Id = $systempreferencemodel->SaveorUpdateSystemPreferanceData($data, $where);
if ($Id == 'update') {
$menuidArr = $menumodel->getMenuObjID('/sitepreference');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
$messages['message'] = 'Site preferences deleted successfully.';
$messages['msgtype'] = 'success';
} else {
$messages['message'] = 'Site preferences cannot be deleted.';
}
$messages['msgtype'] = 'error';
} else {
$messages['message'] = 'Site preferences cannot be deleted.';
$messages['msgtype'] = 'error';
}
$this->_helper->json($messages);
}
示例6: grid
public function grid($dataArray)
{
$request = Zend_Controller_Front::getInstance();
$params = $request->getRequest()->getParams();
$menu_model = new Default_Model_Menu();
$session = new Zend_Auth_Storage_Session();
$data = $session->read();
$role_id = $data['emprole'];
$menunamestr = '';
$sortStr = '';
$actnArr = array();
$sortStr = $dataArray['by'];
$controllers_arr = $menu_model->getControllersByRole($role_id);
if ($dataArray['objectname'] == 'processes') {
$actionsobjname = 'empscreening';
} else {
$actionsobjname = $dataArray['objectname'];
}
if (isset($controllers_arr[$actionsobjname . "controller.php"])) {
$actions_arr = $controllers_arr[$actionsobjname . "controller.php"]['actions'];
$menuName = $actions_arr[sizeof($actions_arr) - 1];
} else {
$actions_arr = array();
}
$gridFieldsArr = array();
$tmpActionsArr = array();
$tmpActionsArr = $actions_arr;
array_pop($tmpActionsArr);
//last element of actions array is menuname so delete that & check the privileges are empty or not...
$actnArr = $tmpActionsArr;
if (($key = array_search('add', $actnArr)) !== false) {
unset($actnArr[$key]);
}
if (empty($tmpActionsArr)) {
$gridFieldsArr = $dataArray['tableheader'];
unset($gridFieldsArr['action']);
$dataArray['tableheader'] = $gridFieldsArr;
}
if (isset($dataArray['menuName'])) {
$menuName = $dataArray['menuName'];
}
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($dataArray['tablecontent']));
$paginator->setItemCountPerPage($dataArray['perPage'])->setCurrentPageNumber($dataArray['pageNo']);
if (empty($dataArray['tableheader'])) {
$widgetsModel = new Default_Model_Widgets();
$columnData = $widgetsModel->getTableFields('/' . $dataArray['objectname']);
$dataArray['tableheader'] = json_decode($columnData['menufields'], true);
}
$msgtitle = $dataArray['objectname'] . '_delete';
$msgtitle = strtoupper($msgtitle);
$msgflag = constant($msgtitle);
$msgAr = explode(' ', $msgflag);
$msgdta = implode('@#$', $msgAr);
if (isset($dataArray['formgrid']) && $dataArray['formgrid'] == 'true') {
if (isset($dataArray['unitId'])) {
$con = '/unitId/' . $dataArray['unitId'];
} else {
if (isset($params['id'])) {
$con = '/unitId/' . $params['id'];
}
}
$formgridVal = $dataArray['formgrid'];
if ($dataArray['objectname'] == 'departments') {
$viewaction = 'view';
} else {
$viewaction = 'viewpopup';
}
$editaction = 'editpopup';
if (isset($dataArray['menuName']) && $dataArray['menuName'] != '') {
$menunamestr = $dataArray['menuName'];
}
$viewpopup_str = '<a onclick="displaydeptform(\'' . DOMAIN . $dataArray['objectname'] . '/' . $viewaction . '/id/{{id}}' . $con . '/popup/1\',\'' . $menunamestr . '\')" name="{{id}}" class="sprite view" title=\'View\'></a>';
$editpopup_str = '<a id="edit{{id}}" onclick="displaydeptform(\'' . DOMAIN . $dataArray['objectname'] . '/' . $editaction . '/id/{{id}}' . $con . '/popup/1\',\'' . $menunamestr . '\')" name="{{id}}" class="sprite edit" title=\'Edit\' ></a>';
$deletepopup_str = '<a name="{{id}}" id="del{{id}}" onclick= changestatus(\'' . $dataArray['objectname'] . '\',\'{{id}}\',\'' . $msgdta . '\') href= javascript:void(0) title=\'Delete\' class="sprite delete" ></a>';
if (!in_array('view', $actions_arr) && !in_array('edit', $actions_arr) && !in_array('delete', $actions_arr)) {
if ($dataArray['objectname'] == 'processes') {
$extra['action'] = array('name' => 'edit', 'value' => '<div class="grid-action-align">
<a onclick="displaydeptform(\'' . DOMAIN . $dataArray['objectname'] . '/' . $viewaction . '/id/{{id}}' . $con . '/popup/1\',\'' . $menunamestr . '\')" name="{{id}}" class="sprite view" title=\'View\'></a>
<a onclick="displaydeptform(\'' . DOMAIN . $dataArray['objectname'] . '/' . $editaction . '/id/{{id}}' . $con . '/popup/1\',\'' . $menunamestr . '\')" name="{{id}}" class="sprite edit" title=\'Edit\' ></a>
<a name="{{id}}" id="{{id}}" onclick= changestatus(\'' . $dataArray['objectname'] . '\',\'{{id}}\',\'' . $msgdta . '\') href= javascript:void(0) title=\'Delete\' class="sprite delete" ></a>
</div>');
} else {
$extra['action'] = array();
}
} else {
if ($dataArray['objectname'] == 'empleavesummary' || $dataArray['objectname'] == 'empscreening') {
$view_str = '<a href= "' . DOMAIN . $dataArray['objectname'] . '/view/id/{{id}}" name="{{id}}" class="sprite view" title=\'View\'></a>';
$edit_str = '<a href= "' . DOMAIN . $dataArray['objectname'] . '/edit/id/{{id}}" name="{{id}}" class="sprite edit" title=\'Edit\'></a>';
$delete_str = '<a name="{{id}}" onclick= changestatus(\'' . $dataArray['objectname'] . '\',\'{{id}}\',\'' . $msgdta . '\') href= javascript:void(0) title=\'Delete\' class="sprite delete" ></a>';
$extra['action'] = array('name' => 'edit', 'value' => '<div class="grid-action-align">
' . (in_array('view', $actions_arr) ? $view_str : '') . '
' . (in_array('edit', $actions_arr) ? $edit_str : '') . '
' . (in_array('delete', $actions_arr) ? $delete_str : '') . '
</div>');
} else {
$extra['action'] = array('name' => 'edit', 'value' => '<div class="grid-action-align">
' . (in_array('view', $actions_arr) ? $viewpopup_str : '') . '
' . (in_array('edit', $actions_arr) ? $editpopup_str : '') . '
' . (in_array('delete', $actions_arr) ? $deletepopup_str : '') . '
</div>');
//.........这里部分代码省略.........
示例7: deleteAction
public function deleteAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('objid');
$messages['message'] = '';
$actionflag = 3;
if ($id) {
$departmentsmodel = new Default_Model_Departments();
$checkemployees = $departmentsmodel->checkemployeestodepartment($id);
if ($checkemployees == 0) {
$menumodel = new Default_Model_Menu();
$data = array('isactive' => 0);
$where = array('id=?' => $id);
$Id = $departmentsmodel->SaveorUpdateDepartmentsUnits($data, $where);
if ($Id == 'update') {
$menuidArr = $menumodel->getMenuObjID('/departments');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
$messages['message'] = 'Department deleted successfully.';
$messages['msgtype'] = 'success';
} else {
$messages['message'] = 'Department cannot be deleted.';
$messages['msgtype'] = 'error';
}
} else {
$messages['message'] = 'Please re-assign the employees to another department';
$messages['msgtype'] = 'error';
}
} else {
$messages['message'] = 'Department cannot be deleted.';
$messages['msgtype'] = 'error';
}
$this->_helper->json($messages);
}
示例8: save
public function save($empsalarydetailsform, $userid)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
if ($empsalarydetailsform->isValid($this->_request->getPost())) {
$empsalarydetailsModal = new Default_Model_Empsalarydetails();
$id = $this->_request->getParam('id');
$user_id = $userid;
$currencyid = $this->_request->getParam('currencyid');
$salarytype = $this->_request->getParam('salarytype');
$salary = $this->_request->getParam('salary');
$bankname = trim($this->_request->getParam('bankname'));
$accountholder_name = trim($this->_request->getParam('accountholder_name'));
$accountclasstypeid = $this->_request->getParam('accountclasstypeid');
$bankaccountid = $this->_request->getParam('bankaccountid');
$accountnumber = trim($this->_request->getParam('accountnumber'));
$accountholding = $this->_request->getParam('accountholding');
$accountholding = sapp_Global::change_date($accountholding, 'database');
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('user_id' => $user_id, 'currencyid' => $currencyid, 'salarytype' => $salarytype, 'salary' => $salary, 'bankname' => $bankname != '' ? $bankname : NULL, 'accountholder_name' => $accountholder_name != '' ? $accountholder_name : NULL, 'accountclasstypeid' => $accountclasstypeid != '' ? $accountclasstypeid : NULL, 'bankaccountid' => $bankaccountid != '' ? $bankaccountid : NULL, 'accountnumber' => $accountnumber != '' ? $accountnumber : NULL, 'accountholding' => $accountholding != '' ? $accountholding : NULL, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
if ($id != '') {
$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);
$this->_redirect('empsalarydetails/edit/userid/' . $user_id);
} else {
$messages = $empsalarydetailsform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
return $msgarray;
}
}
示例9: viewAction
/**
* @name viewAction
*
* This method is used to display the detail log info
*
* @author Deepthi
* @version 1.0
*/
public function viewAction()
{
$activitylog_model = new Default_Model_Activitylog();
$logmanager_model = new Default_Model_Logmanager();
$menu_model = new Default_Model_Menu();
//Pop up layout
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$perPage = PERPAGE;
$this->view->managemodule = 0;
if ($this->getRequest()) {
$id = $this->_request->getParam('id');
$viewLinkArray = array('101', '102');
// menu with view links
$logManagarRecord = $logmanager_model->getLogManagerDataByID($id);
$menuId = $logManagarRecord[0]['menuId'];
$action = $logManagarRecord[0]['user_action'];
switch ($action) {
case 1:
$userAction = 'add';
break;
case 2:
$userAction = 'edit';
break;
default:
$userAction = '';
break;
}
$url = $menu_model->getMenusDataById($menuId);
$modurl = ltrim($url[0]['url'], '/');
if (isset($logManagarRecord[0]['log_details']) && !empty($logManagarRecord[0]['log_details'])) {
$logdetails = '{"testjson":[' . $logManagarRecord[0]['log_details'] . ']}';
$logarr = @get_object_vars(json_decode($logdetails));
if (!empty($logarr)) {
$userArray = array();
$logarr['testjson'] = array_reverse($logarr['testjson']);
$this->logJsonCount = count($logarr['testjson']);
foreach ($logarr['testjson'] as $key => $curr) {
$currArray = @get_object_vars($curr);
$this->modArray[$key]['userid'] = $currArray['userid'];
if ($menuId != '142') {
if (in_array($menuId, $viewLinkArray)) {
$this->modArray[$key]['recordid'] = isset($currArray['recordid']) ? DOMAIN . $modurl . '/view/id/' . $currArray['recordid'] : '0';
} else {
$this->modArray[$key]['recordid'] = isset($currArray['recordid']) ? DOMAIN . $modurl . '/edit/id/' . $currArray['recordid'] : '0';
}
} else {
$this->view->managemodule = 1;
$this->modArray[$key]['recordid'] = $currArray['childrecordid'];
}
$this->modArray[$key]['date'] = $currArray['date'];
if (!in_array($currArray['userid'], $userArray)) {
array_push($userArray, $currArray['userid']);
}
}
$this->userNameArray = $activitylog_model->getuserNamesByIds($userArray);
if ($menuId != '61' && $menuId != '65') {
$this->view->viewrRecordFlag = true;
} else {
$this->view->viewrRecordFlag = false;
}
$this->view->mainArray = $this->modArray;
$this->view->userNameArray = $this->userNameArray;
$this->view->totalJsonCount = $this->logJsonCount;
$this->view->pageNo = 1;
$this->view->perPage = $perPage;
} else {
$this->view->message = "No records found";
exit;
}
}
}
}
示例10: save
public function save($appraisalconfigform)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$appraisalconfigmodel = new Default_Model_Appraisalconfig();
$departmentsmodel = new Default_Model_Departments();
$businessunitsmodel = new Default_Model_Businessunits();
$msgarray = array();
$resultArr = array();
$arrData = array();
$prevBusinessunit = '';
$errorflag = "true";
$id = $this->_request->getParam('id');
$businessunit_id = $this->_request->getParam('businessunit_id');
$performance_app_flag = $this->_request->getParam('performance_app_flag');
$department_id = $this->_request->getParam('department_id');
$appraisal_mode = $this->_request->getParam('appraisal_mode');
$approval_selection = $this->_request->getParam('approval_selection');
$appraisal_ratings = $this->_request->getParam('appraisal_ratings');
// Validation to check duplicate combinations
$arrData = array("business_unit_id" => $businessunit_id, "department_id" => $department_id, "id" => $id);
if ($appraisalconfigmodel->combinationExists($arrData)) {
$msgarray['businessunit_id'] = 'Business unit or department configuration already exists.';
$errorflag = "false";
}
/** Start
* Validating selection of department if implementaion is department wise
*/
if ($performance_app_flag == 0) {
if ($department_id == '') {
$msgarray['department_id'] = 'Please select department.';
$errorflag = "false";
}
}
/**
End validating selection of department
*/
/** Start
Validating unique service desk department
*/
if ($businessunit_id != '' && $id == '') {
$appraisalconigfArr = $appraisalconfigmodel->checkuniqueAppraisalConfigData($businessunit_id, $performance_app_flag, $department_id);
if (!empty($appraisalconigfArr)) {
if ($appraisalconigfArr[0]['count'] > 0) {
$msgarray['department_id'] = 'Please select a different department.';
$errorflag = "false";
}
}
}
/** End
* Validating uniques department
*/
$db = Zend_Db_Table::getDefaultAdapter();
$db->beginTransaction();
if ($appraisalconfigform->isValid($this->_request->getPost()) && $errorflag == 'true') {
try {
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('businessunit_id' => $businessunit_id, 'department_id' => $department_id != '' ? $department_id : NULL, 'performance_app_flag' => $performance_app_flag, 'appraisal_mode' => $appraisal_mode, 'appraisal_ratings' => $appraisal_ratings, 'module_flag' => 1, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
if ($id != '') {
/* for Update record */
$where = array('id=?' => $id);
$actionflag = 2;
} else {
/* for Insert new record */
$data['createdby'] = $loginUserId;
$data['createddate'] = gmdate("Y-m-d H:i:s");
$data['isactive'] = 1;
$where = '';
$actionflag = 1;
}
$Id = $appraisalconfigmodel->SaveorUpdateAppraisalConfigData($data, $where);
if ($Id == 'update') {
$tableid = $id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Appraisal settings updated successfully"));
} else {
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Appraisal settings added successfully"));
}
$menuidArr = $menumodel->getMenuObjID('/appraisalconfig');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
/** Start
* Sending Mails to employees
*/
/* if($performance_app_flag == 0)
$employeeDetailsArr = $appraisalconfigmodel->getUserDetailsByID($businessunit_id,$department_id);
else
$employeeDetailsArr = $appraisalconfigmodel->getUserDetailsByID($businessunit_id,'');
$msg_add_update = ($Id == 'update') ? "updated" : "added" ;
//Sending mail to Super admin
$options['subject'] = APPLICATION_NAME.': Performance Appraisal Settings '.ucfirst($msg_add_update);
$options['header'] = 'Performance Appraisal Configuration';
$options['toEmail'] = SUPERADMIN_EMAIL;
$options['toName'] = 'Super Admin';
//.........这里部分代码省略.........
示例11: 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;
}
$id = $this->getRequest()->getParam('id');
$controllername = 'nationality';
$nationalityform = new Default_Form_nationality();
$nationalitymodel = new Default_Model_Nationality();
$nationalityform->setAction(BASE_URL . 'nationality/addpopup');
if ($this->getRequest()->getPost()) {
if ($nationalityform->isValid($this->_request->getPost())) {
$nationalitycode = $this->_request->getParam('nationalitycode');
$description = $this->_request->getParam('description');
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('nationalitycode' => trim($nationalitycode), 'description' => trim($description), '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 = $nationalitymodel->SaveorUpdateNationalityData($data, $where);
$tableid = $Id;
$menuidArr = $menumodel->getMenuObjID('/nationality');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
$nationalitycodeData = $nationalitymodel->fetchAll('isactive = 1', 'nationalitycode')->toArray();
$opt = '';
foreach ($nationalitycodeData as $record) {
$opt .= sapp_Global::selectOptionBuilder($record['id'], $record['nationalitycode']);
}
$this->view->nationalitycodeData = $opt;
$this->view->eventact = 'added';
$close = 'close';
$this->view->popup = $close;
} else {
$messages = $nationalityform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
$this->view->msgarray = $msgarray;
}
}
$this->view->controllername = $controllername;
$this->view->form = $nationalityform;
}
示例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;
}
$controllername = 'bgscreeningtype';
$msgarray = array();
$bgscreeningtypeform = new Default_Form_bgscreeningtype();
$bgscreeningtypeform->setAttrib('action', DOMAIN . 'bgscreeningtype/addpopup');
$this->view->form = $bgscreeningtypeform;
if ($this->getRequest()->getPost()) {
$id = $this->_request->getParam('id');
$type = $this->_request->getParam('type');
$bgscreeningtypemodel = new Default_Model_Bgscreeningtype();
$typeExistance = $bgscreeningtypemodel->checktypeduplicates($type, $id);
$flag = 'true';
if ($typeExistance) {
$msgarray['type'] = 'Screening type already exists.';
$flag = 'false';
}
if ($bgscreeningtypeform->isValid($this->_request->getPost()) && $flag == 'true') {
$id = $this->_request->getParam('id');
$type = $this->_request->getParam('type');
$description = $this->_request->getParam('description');
if (!$typeExistance) {
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('type' => $type, 'description' => $description, '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 = $bgscreeningtypemodel->SaveorUpdateScreeningtype($data, $where);
$tableid = $Id;
$menuidArr = $menumodel->getMenuObjID('/bgscreeningtype');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
$screeningData = $bgscreeningtypemodel->fetchAll('isactive = 1', 'type')->toArray();
$opt = '';
foreach ($screeningData as $record) {
$opt .= sapp_Global::selectOptionBuilder($record['id'], $record['type']);
}
$this->view->screeningData = $opt;
$this->view->eventact = 'added';
$close = 'close';
$this->view->popup = $close;
} else {
$msgarray['message'] = 'Screening type already exists.';
$msgarray['msgtype'] = 'error';
}
} else {
$messages = $bgscreeningtypeform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
}
}
$this->view->controllername = $controllername;
$this->view->msgarray = $msgarray;
$this->view->messages = $msgarray;
}
示例13: deleteAction
public function deleteAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('objid');
$messages['message'] = '';
$actionflag = 3;
if ($id) {
$assignmententryreasoncodemodel = new Default_Model_Assignmententryreasoncode();
$menumodel = new Default_Model_Menu();
$data = array('isactive' => 0);
$where = array('id=?' => $id);
$Id = $assignmententryreasoncodemodel->SaveorUpdateAssignmentEntryData($data, $where);
if ($Id == 'update') {
$menuidArr = $menumodel->getMenuObjID('/assignmententryreasoncode');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
$messages['message'] = 'Assignment entry reason code deleted successfully.';
} else {
$messages['message'] = 'Assignment entry reason code cannot be deleted.';
}
} else {
$messages['message'] = 'Assignment entry reason code cannot be deleted.';
}
$this->_helper->json($messages);
}
示例14: breadcrumbs
//.........这里部分代码省略.........
$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)) {
示例15: menubuilder
/**
** 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);
}