本文整理汇总了PHP中Default_Model_Users::getReportingManagerList方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Users::getReportingManagerList方法的具体用法?PHP Default_Model_Users::getReportingManagerList怎么用?PHP Default_Model_Users::getReportingManagerList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Default_Model_Users
的用法示例。
在下文中一共展示了Default_Model_Users::getReportingManagerList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewAction
public function viewAction()
{
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$objName = 'employee';
$employeeform = new Default_Form_employee();
$employeeform->removeElement("submit");
$elements = $employeeform->getElements();
if (count($elements) > 0) {
foreach ($elements as $key => $element) {
if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
$element->setAttrib("disabled", "disabled");
}
}
}
if ($id) {
$employeeModal = new Default_Model_Employee();
$usersModel = new Default_Model_Users();
$employmentstatusModel = new Default_Model_Employmentstatus();
$busineesUnitModel = new Default_Model_Businessunits();
$deptModel = new Default_Model_Departments();
$role_model = new Default_Model_Roles();
$user_model = new Default_Model_Usermanagement();
$candidate_model = new Default_Model_Candidatedetails();
$jobtitlesModel = new Default_Model_Jobtitles();
$positionsmodel = new Default_Model_Positions();
$prefixModel = new Default_Model_Prefix();
$data = $employeeModal->getsingleEmployeeData($id);
if ($data == 'norows') {
$this->view->rowexist = "norows";
} else {
if (!empty($data)) {
$this->view->rowexist = "rows";
$data = $data[0];
$employeeData = $employeeModal->getsingleEmployeeData($data['user_id']);
$roles_arr = $role_model->getRolesDataByID($data['emprole']);
if (sizeof($roles_arr) > 0) {
$employeeform->emprole->addMultiOption($roles_arr[0]['id'] . '_' . $roles_arr[0]['group_id'], utf8_encode($roles_arr[0]['rolename']));
}
$referedby_options = $user_model->getRefferedByForUsers();
$reportingManagerData = $usersModel->getReportingManagerList($data['department_id'], $data['id'], $roles_arr[0]['group_id']);
if (!empty($reportingManagerData)) {
$employeeform->reporting_manager->addMultiOption('', 'Select a Reporting Manager');
if ($roles_arr[0]['group_id'] == MANAGEMENT_GROUP) {
$employeeform->reporting_manager->addMultiOption(SUPERADMIN, 'Super Admin');
}
foreach ($reportingManagerData as $reportingManagerres) {
$employeeform->reporting_manager->addMultiOption($reportingManagerres['id'], $reportingManagerres['name']);
}
}
$employeeform->setDefault('reporting_manager', $data['reporting_manager']);
$employmentStatusData = $employmentstatusModel->getempstatuslist();
if (sizeof($employmentStatusData) > 0) {
$employeeform->emp_status_id->addMultiOption('', 'Select a Employment Status');
foreach ($employmentStatusData as $employmentStatusres) {
$employeeform->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
}
}
$businessunitData = $busineesUnitModel->getDeparmentList();
if (sizeof($businessunitData) > 0) {
$employeeform->businessunit_id->addMultiOption('0', 'No Business Unit');
foreach ($businessunitData as $businessunitres) {
$employeeform->businessunit_id->addMultiOption($businessunitres['id'], $businessunitres['unitname']);
}
}
$departmentsData = $deptModel->getDepartmentList($data['businessunit_id']);
if (sizeof($departmentsData) > 0) {
$employeeform->department_id->addMultiOption('', 'Select a Department');
foreach ($departmentsData as $departmentsres) {
$employeeform->department_id->addMultiOption($departmentsres['id'], $departmentsres['deptname']);
}
}
$jobtitleData = $jobtitlesModel->getJobTitleList();
if (sizeof($jobtitleData) > 0) {
$employeeform->jobtitle_id->addMultiOption('', 'Select a Job Title');
foreach ($jobtitleData as $jobtitleres) {
$employeeform->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
}
}
$positionlistArr = $positionsmodel->getPositionList($data['jobtitle_id']);
if (sizeof($positionlistArr) > 0) {
$employeeform->position_id->addMultiOption('', 'Select a Position');
foreach ($positionlistArr as $positionlistres) {
$employeeform->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
}
}
if (isset($data['prefix_id']) && $data['prefix_id'] != '') {
$singlePrefixArr = $prefixModel->getsinglePrefixData($data['prefix_id']);
if ($singlePrefixArr != 'norows') {
$employeeform->prefix_id->addMultiOption($singlePrefixArr[0]['id'], $singlePrefixArr[0]['prefix']);
}
}
$employeeform->populate($data);
$employeeform->setDefault('user_id', $data['user_id']);
$employeeform->setDefault('emp_status_id', $data['emp_status_id']);
$employeeform->setDefault('businessunit_id', $data['businessunit_id']);
$employeeform->setDefault('jobtitle_id', $data['jobtitle_id']);
//.........这里部分代码省略.........
示例2: updateempdetails
//.........这里部分代码省略.........
$isactivestatus = 4;
}
}
}
$statusdata = array('isactive' => $isactivestatus);
$empstatusId = $usersModel->SaveorUpdateUserData($statusdata, $statuswhere);
} else {
$statusdata = array('isactive' => 1);
$empstatusId = $usersModel->SaveorUpdateUserData($statusdata, $statuswhere);
}
if ($Id == 'update') {
$tableid = $id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Employee details updated successfully."));
} else {
//start of mailing
$base_url = 'http://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getBaseUrl();
$view = $this->getHelper('ViewRenderer')->view;
$this->view->emp_name = $emp_name;
$this->view->password = $emppassword;
$this->view->emp_id = $employeeId;
$this->view->base_url = $base_url;
$text = $view->render('mailtemplates/newpassword.phtml');
$options['subject'] = APPLICATION_NAME . ' login credentials';
$options['header'] = 'Greetings from Sentrifugo';
$options['toEmail'] = $emailaddress;
$options['toName'] = $this->view->emp_name;
$options['message'] = $text;
$result = sapp_Global::_sendEmail($options);
//end of mailing
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Employee details added successfully."));
}
$menuidArr = $menumodel->getMenuObjID('/employee');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
$menuidArr = $menumodel->getMenuObjID('/usermanagement');
$menuID_user = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $user_id);
if ($act_inact == 1) {
if ($user_data['isactive'] == 1) {
$act_str = array("Activated" => Zend_Registry::get('currentdate'));
} else {
$act_str = array("Inactivated" => Zend_Registry::get('currentdate'));
}
$result = sapp_Global::logManager($menuID_user, 4, $loginUserId, $user_id, '', $act_str);
}
$trDb->commit();
$this->_redirect('employee/edit/id/' . $user_id);
} catch (Exception $e) {
$trDb->rollBack();
$msgarray['employeeId'] = "Something went wrong,please try again later.";
return $msgarray;
}
} else {
$messages = $employeeform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
$usersModel = new Default_Model_Users();
if (isset($businessunit_id) && $businessunit_id != 0 && $businessunit_id != '') {
$departmentsmodel = new Default_Model_Departments();
$departmentlistArr = $departmentsmodel->getDepartmentList($businessunit_id);
$employeeform->department_id->clearMultiOptions();
$employeeform->reporting_manager->clearMultiOptions();
$employeeform->department_id->addMultiOption('', 'Select Department');
foreach ($departmentlistArr as $departmentlistresult) {
$employeeform->department_id->addMultiOption($departmentlistresult['id'], utf8_encode($departmentlistresult['deptname']));
}
if (isset($department_id) && $department_id != 0 && $department_id != '') {
$employeeform->setDefault('department_id', $department_id);
}
}
if (isset($department_id) && $department_id != 0 && $department_id != '') {
$reportingManagerArr = $usersModel->getReportingManagerList($department_id, $user_id);
$employeeform->reporting_manager->addMultiOption('', 'Select Reporting Manager');
foreach ($reportingManagerArr as $reportingManagerresult) {
$employeeform->reporting_manager->addMultiOption($reportingManagerresult['id'], utf8_encode($reportingManagerresult['userfullname']));
}
if (isset($reporting_manager) && $reporting_manager != 0 && $reporting_manager != '') {
$employeeform->setDefault('reporting_manager', $reporting_manager);
}
}
if (isset($jobtitle_id) && $jobtitle_id != 0 && $jobtitle_id != '') {
$positionsmodel = new Default_Model_Positions();
$positionlistArr = $positionsmodel->getPositionList($jobtitle_id);
$employeeform->position_id->clearMultiOptions();
$employeeform->position_id->addMultiOption('', 'Select Position');
foreach ($positionlistArr as $positionlistRes) {
$employeeform->position_id->addMultiOption($positionlistRes['id'], utf8_encode($positionlistRes['positionname']));
}
if (isset($position_id) && $position_id != 0 && $position_id != '') {
$employeeform->setDefault('position_id', $position_id);
}
}
return $msgarray;
}
}