本文整理匯總了PHP中Default_Model_Employee::getCurrentOrgHead方法的典型用法代碼示例。如果您正苦於以下問題:PHP Default_Model_Employee::getCurrentOrgHead方法的具體用法?PHP Default_Model_Employee::getCurrentOrgHead怎麽用?PHP Default_Model_Employee::getCurrentOrgHead使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Default_Model_Employee
的用法示例。
在下文中一共展示了Default_Model_Employee::getCurrentOrgHead方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addAction
public function addAction()
{
$emptyFlag = 0;
$report_opt = array();
$popConfigPermission = array();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$employeeModel = new Default_Model_Employee();
$currentOrgHead = $employeeModel->getCurrentOrgHead();
if (empty($currentOrgHead)) {
$this->addorganisationhead($loginUserId);
} else {
if (sapp_Global::_checkprivileges(PREFIX, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'prefix');
}
if (sapp_Global::_checkprivileges(IDENTITYCODES, $loginuserGroup, $loginuserRole, 'edit') == 'Yes') {
array_push($popConfigPermission, 'identitycodes');
}
if (sapp_Global::_checkprivileges(EMPLOYMENTSTATUS, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'empstatus');
}
if (sapp_Global::_checkprivileges(JOBTITLES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'jobtitles');
}
if (sapp_Global::_checkprivileges(POSITIONS, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'position');
}
$this->view->popConfigPermission = $popConfigPermission;
$employeeform = new Default_Form_employee();
$usersModel = new Default_Model_Users();
$employmentstatusModel = new Default_Model_Employmentstatus();
$busineesUnitModel = new Default_Model_Businessunits();
$user_model = new Default_Model_Usermanagement();
$candidate_model = new Default_Model_Candidatedetails();
$role_model = new Default_Model_Roles();
$jobtitlesModel = new Default_Model_Jobtitles();
$prefixModel = new Default_Model_Prefix();
$msgarray = array();
$identity_code_model = new Default_Model_Identitycodes();
$identity_codes = $identity_code_model->getIdentitycodesRecord();
$emp_identity_code = isset($identity_codes[0]) ? $identity_codes[0]['employee_code'] : "";
if ($emp_identity_code != '') {
$emp_id = $emp_identity_code . str_pad($user_model->getMaxEmpId($emp_identity_code), 4, '0', STR_PAD_LEFT);
} else {
$emp_id = '';
$msgarray['employeeId'] = 'Identity codes are not configured yet.';
}
$employeeform->employeeId->setValue($emp_id);
$employeeform->modeofentry->setValue('Direct');
$roles_arr = $role_model->getRolesList_EMP();
if (sizeof($roles_arr) > 0) {
$employeeform->emprole->addMultiOptions(array('' => 'Select Role') + $roles_arr);
} else {
$employeeform->emprole->addMultiOptions(array('' => 'Select Role'));
$msgarray['emprole'] = 'Roles are not configured yet.';
}
$candidate_options = $candidate_model->getCandidatesNamesForUsers();
if (sizeof($candidate_options) > 0) {
$employeeform->rccandidatename->addMultiOptions(array('' => 'Select Candidate') + $candidate_options);
} else {
$msgarray['rccandidatename'] = 'No candidates.';
}
$referedby_options = $user_model->getRefferedByForUsers();
if (sizeof($referedby_options) > 0) {
$employeeform->candidatereferredby->addMultiOptions(array('' => 'Select referred by') + $referedby_options);
} else {
$msgarray['candidatereferredby'] = 'Employees are not added yet.';
}
$employmentStatusData = $employmentstatusModel->getempstatusActivelist();
$employeeform->emp_status_id->addMultiOption('', 'Select Employment Status');
if (!empty($employmentStatusData)) {
foreach ($employmentStatusData as $employmentStatusres) {
$employeeform->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
}
} else {
$msgarray['emp_status_id'] = 'Employment status is not configured yet.';
$emptyFlag++;
}
$businessunitData = $busineesUnitModel->getDeparmentList();
if (!empty($businessunitData)) {
$employeeform->businessunit_id->addMultiOption('0', 'No Business Unit');
foreach ($businessunitData as $businessunitres) {
$employeeform->businessunit_id->addMultiOption($businessunitres['id'], $businessunitres['unitname']);
}
$departmentsmodel = new Default_Model_Departments();
$departmentlistArr = $departmentsmodel->getDepartmentList('0');
$totalDeptList = $departmentsmodel->getTotalDepartmentList();
$employeeform->department_id->clearMultiOptions();
$employeeform->department_id->addMultiOption('', 'Select Department');
if (count($departmentlistArr) > 0) {
foreach ($departmentlistArr as $departmentlistresult) {
$employeeform->department_id->addMultiOption($departmentlistresult['id'], utf8_encode($departmentlistresult['deptname']));
}
}
if (empty($totalDeptList)) {
$msgarray['department_id'] = 'Departments are not added yet.';
//.........這裏部分代碼省略.........
示例2: editAction
public function editAction()
{
$orgInfoModel = new Default_Model_Organisationinfo();
$getorgData = $orgInfoModel->getorgrecords();
$sitepreferencemodel = new Default_Model_Sitepreference();
$activerecordArr = $sitepreferencemodel->getActiveRecord();
$timezoneid = !empty($activerecordArr[0]['timezoneid']) ? $activerecordArr[0]['timezoneid'] : '';
$popConfigPermission = array();
$organisationHead = array();
if (!empty($getorgData)) {
$orgdata = '';
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginUserRole = $auth->getStorage()->read()->emprole;
$loginUserGroup = $auth->getStorage()->read()->group_id;
}
if (sapp_Global::_checkprivileges(TIMEZONE, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'timezone');
}
if (sapp_Global::_checkprivileges(COUNTRIES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
if (sapp_Global::_checkprivileges(EMPLOYEE, $loginUserGroup, $loginUserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'employee');
}
$msgarray = array();
$flag = 'true';
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
$deptModel = new Default_Model_Departments();
$deptform = new Default_Form_departments();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$timezonemodel = new Default_Model_Timezone();
$businessunitsmodel = new Default_Model_Businessunits();
$orgInfoModel = new Default_Model_Organisationinfo();
$employeeModal = new Default_Model_Employee();
$allTimezoneData = $timezonemodel->fetchAll('isactive=1', 'timezone')->toArray();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$allBusinessunitsData = $businessunitsmodel->fetchAll('isactive=1', 'unitname')->toArray();
$deptData = array();
$deptform->setAttrib('action', BASE_URL . 'departments/edit');
$country = $getorgData[0]['country'];
if (isset($_POST['country'])) {
$country = $_POST['country'];
}
$state = $getorgData[0]['state'];
if (isset($_POST['state'])) {
$state = $_POST['state'];
}
$city = $getorgData[0]['city'];
if (isset($_POST['city'])) {
$city = $_POST['city'];
}
$deptform->setDefault('timezone', $timezoneid);
$address = $getorgData[0]['address1'];
$organisationHead = $employeeModal->getCurrentOrgHead();
if (isset($country) && $country != 0 && $country != '') {
$deptform->setDefault('country', $country);
$statesData = $statesmodel->getBasicStatesList($country);
foreach ($statesData as $res) {
$deptform->state->addMultiOption($res['state_id_org'], utf8_encode($res['state']));
}
if (isset($state) && $state != 0 && $state != '') {
$deptform->setDefault('state', $state);
}
}
if (isset($state) && $state != 0 && $state != '') {
$citiesData = $citiesmodel->getBasicCitiesList($state);
foreach ($citiesData as $res) {
$deptform->city->addMultiOption($res['city_org_id'], utf8_encode($res['city']));
}
if (isset($city) && $city != 0 && $city != '') {
$deptform->setDefault('city', $city);
}
}
if (isset($address) && $address != '') {
$deptform->address1->setValue($address);
}
if (is_numeric($id) && $id > 0) {
$data = $deptModel->getSingleDepartmentData($id);
if (!empty($data)) {
$deptform->setAttrib('action', BASE_URL . 'departments/edit/id/' . $id);
$managementUsersData = $deptModel->getDepartmenttHead($data['depthead']);
foreach ($managementUsersData as $mgmtdata) {
$deptform->depthead->addMultiOption($mgmtdata['user_id'], $mgmtdata['userfullname']);
}
$deptform->populate($data);
//.........這裏部分代碼省略.........
示例3: edit_oldAction
//.........這裏部分代碼省略.........
$flag = 'false';
}
if (empty($role_data)) {
$msgarray['emprole'] = 'Roles are not added yet.';
$flag = 'false';
}
if (empty($allStatesData)) {
$msgarray['state'] = 'States are not configured yet.';
$flag = 'false';
}
if (empty($allCitiesData)) {
$msgarray['city'] = 'Cities are not configured yet.';
$flag = 'false';
}
$prefixData = $prefixModel->getPrefixList();
$form->prefix_id->addMultiOption('', 'Select Prefix');
if (!empty($prefixData)) {
foreach ($prefixData as $prefixres) {
$form->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
}
} else {
$msgarray['prefix_id'] = 'Prefixes are not configured yet.';
}
$jobtitleData = $jobtitlesModel->getJobTitleList();
if (!empty($jobtitleData)) {
foreach ($jobtitleData as $jobtitleres) {
$form->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
}
} else {
$msgarray['jobtitle_id'] = 'Job titles are not configured yet.';
$msgarray['position_id'] = 'Positions are not configured yet.';
}
$orgheadsData = $employeeModal->getEmployeesForOrgHead();
$currentOrgHead = $employeeModal->getCurrentOrgHead();
if (!empty($currentOrgHead)) {
$oldOrgHead = $currentOrgHead[0]['user_id'];
}
if ($id) {
$form->submit->setLabel('Update');
try {
$data = $orgInfoModel->getOrganisationData($id);
$form->setAttrib('action', BASE_URL . 'organisationinfo/edit/id/' . $id);
$data['org_startdate'] = sapp_Global::change_date($data['org_startdate'], 'view');
$form->populate($data);
$countryId = $data['country'];
$stateId = $data['state'];
$cityId = $data['city'];
$actionpage = 'edit';
if (count($_POST) > 0) {
$countryId = isset($_POST['country']) ? $_POST['country'] : "";
$stateId = isset($_POST['state']) ? $_POST['state'] : "";
$cityId = isset($_POST['city']) ? $_POST['city'] : "";
}
if ($countryId != '') {
$statesData = $statesmodel->getBasicStatesList((int) $countryId);
foreach ($statesData as $res) {
if ($stateId == $res['state_id_org']) {
$new_stateId = $res['state_id_org'] . '!@#' . utf8_encode($res['state']);
}
$form->state->addMultiOption($res['state_id_org'] . '!@#' . utf8_encode($res['state']), utf8_encode($res['state']));
}
if (count($_POST) == 0) {
$stateId = $new_stateId;
}
}
if ($stateId != '') {