当前位置: 首页>>代码示例>>PHP>>正文


PHP EmployeeService::getEmployee方法代码示例

本文整理汇总了PHP中EmployeeService::getEmployee方法的典型用法代码示例。如果您正苦于以下问题:PHP EmployeeService::getEmployee方法的具体用法?PHP EmployeeService::getEmployee怎么用?PHP EmployeeService::getEmployee使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmployeeService的用法示例。


在下文中一共展示了EmployeeService::getEmployee方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setReportCriteriaInfoInRequest

 public function setReportCriteriaInfoInRequest($formValues)
 {
     $employeeService = new EmployeeService();
     $jobService = new JobService();
     $empStatusService = new EmploymentStatusService();
     $companyStructureService = new CompanyStructureService();
     if (isset($formValues["employee"])) {
         $empNumber = $formValues["employee"];
         $employee = $employeeService->getEmployee($empNumber);
         $empName = $employee->getFirstAndLastNames();
         $this->getRequest()->setParameter('empName', $empName);
     }
     if (isset($formValues["employment_status"]) && $formValues["employment_status"] != 0) {
         $estatCode = $formValues["employment_status"];
         $estat = $empStatusService->getEmploymentStatusById($estatCode);
         $estatName = $estat->getName();
         $this->getRequest()->setParameter("empStatusName", $estatName);
     }
     if (isset($formValues["job_title"]) && $formValues["job_title"] != 0) {
         $jobTitCode = $formValues["job_title"];
         $jobTitle = $jobService->readJobTitle($jobTitCode);
         $jobTitName = $jobTitle->getJobTitName();
         $this->getRequest()->setParameter("jobTitName", $jobTitName);
     }
     if (isset($formValues["sub_unit"]) && $formValues["job_title"] != 0) {
         $value = $formValues["sub_unit"];
         $id = $value;
         $subunit = $companyStructureService->getSubunitById($id);
         $subUnitName = $subunit->getName();
         $this->getRequest()->setParameter("subUnit", $subUnitName);
     }
     $this->getRequest()->setParameter('attendanceDateRangeFrom', $formValues["attendance_date_range"]["from"]);
     $this->getRequest()->setParameter('attendanceDateRangeTo', $formValues["attendance_date_range"]["to"]);
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:34,代码来源:displayAttendanceTotalSummaryReportCriteriaAction.class.php

示例2: getEmployeeName

 public function getEmployeeName($employeeId)
 {
     $employeeService = new EmployeeService();
     $employee = $employeeService->getEmployee($employeeId);
     if ($employee->getMiddleName() != null) {
         return $employee->getFirstName() . " " . $employee->getMiddleName() . " " . $employee->getLastName();
     } else {
         return $employee->getFirstName() . " " . $employee->getLastName();
     }
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:10,代码来源:AttendanceRecordSearchForm.php

示例3: execute

 public function execute($request)
 {
     $jsonArray = array();
     $employeeService = new EmployeeService();
     $employeeService->setEmployeeDao(new EmployeeDao());
     $supervisorList = $employeeService->getSupervisorIdListBySubordinateId($request->getGetParameter('id'));
     foreach ($supervisorList as $supervisorId) {
         $employee = $employeeService->getEmployee($supervisorId);
         $name = $employee->getFirstName() . " " . $employee->getMiddleName();
         $name = trim(trim($name) . " " . $employee->getLastName());
         $jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
     }
     $jsonString = json_encode($jsonArray);
     echo $jsonString;
     exit;
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:16,代码来源:getSupervisorListAjaxAction.class.php

示例4: execute

 public function execute($request)
 {
     $userObj = $this->getContext()->getUser()->getAttribute('user');
     $employeeIdOfTheUser = $userObj->getEmployeeNumber();
     $this->backAction = $request->getParameter('actionName');
     $this->timesheetId = $request->getParameter('timesheetId');
     $this->employeeId = $request->getParameter('employeeId');
     if ($this->employeeId == $employeeIdOfTheUser) {
         $this->employeeName == null;
     } else {
         $employeeService = new EmployeeService();
         $employee = $employeeService->getEmployee($this->employeeId);
         $this->employeeName = $employee->getFirstName() . " " . $employee->getLastName();
     }
     $timesheet = $this->getTimesheetService()->getTimesheetById($this->timesheetId);
     $this->date = $timesheet->getStartDate();
     $this->endDate = $timesheet->getEndDate();
     $this->startDate = $this->date;
     $this->noOfDays = $this->timesheetService->dateDiff($this->startDate, $this->endDate);
     $values = array('date' => $this->startDate, 'employeeId' => $this->employeeId, 'timesheetId' => $this->timesheetId, 'noOfDays' => $this->noOfDays);
     $this->timesheetForm = new TimesheetForm(array(), $values);
     $this->currentWeekDates = $this->timesheetForm->getDatesOfTheTimesheetPeriod($this->startDate, $this->endDate);
     $this->timesheetItemValuesArray = $this->timesheetForm->getTimesheet($this->startDate, $this->employeeId, $this->timesheetId);
     $this->messageData = array($request->getParameter('message[0]'), $request->getParameter('message[1]'));
     if ($this->timesheetItemValuesArray == null) {
         $this->totalRows = 0;
         $this->timesheetForm = new TimesheetForm(array(), $values);
     } else {
         $this->totalRows = sizeOf($this->timesheetItemValuesArray);
         $this->timesheetForm = new TimesheetForm(array(), $values);
     }
     if ($request->isMethod('post')) {
         if ($request->getParameter('btnSave')) {
             $backAction = $this->backAction;
             $this->getTimesheetService()->saveTimesheetItems($request->getParameter('initialRows'), $this->employeeId, $this->timesheetId, $this->currentWeekDates, $this->totalRows);
             $this->messageData = array('SUCCESS', __(TopLevelMessages::SAVE_SUCCESS));
             $startingDate = $this->timesheetService->getTimesheetById($this->timesheetId)->getStartDate();
             $this->redirect('time/' . $backAction . '?' . http_build_query(array('message' => $this->messageData, 'timesheetStartDate' => $startingDate, 'employeeId' => $this->employeeId)));
         }
         if ($request->getParameter('buttonRemoveRows')) {
             $this->messageData = array('SUCCESS', __('Successfully Removed'));
         }
     }
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:44,代码来源:editTimesheetAction.class.php

示例5: setReportCriteriaInfoInRequest

 public function setReportCriteriaInfoInRequest($formValues)
 {
     $employeeService = new EmployeeService();
     $empStatusService = new EmploymentStatusService();
     $jobTitleService = new JobTitleService();
     $companyStructureService = new CompanyStructureService();
     if (isset($formValues["employeeId"]) || $formValues["employeeId"] == '-1') {
         if ($formValues["employeeId"] != '-1') {
             $empNumber = $formValues["employeeId"];
             $employee = $employeeService->getEmployee($empNumber);
             $empName = $employee->getFirstAndLastNames();
         } else {
             $empName = __("All");
         }
         $this->getRequest()->setParameter('empName', $empName);
     }
     if (isset($formValues["employeeStatus"]) && $formValues["employeeStatus"] != 0) {
         $estatCode = $formValues["employeeStatus"];
         $estat = $empStatusService->getEmploymentStatusById($estatCode);
         $estatName = $estat->getName();
         $this->getRequest()->setParameter("employeeStatus", $estatName);
     }
     if (isset($formValues["jobTitle"]) && $formValues["jobTitle"] != 0) {
         $jobTitCode = $formValues["jobTitle"];
         $jobTitle = $jobTitleService->getJobTitleById($jobTitCode);
         $jobTitName = $jobTitle->getJobTitleName();
         $this->getRequest()->setParameter("jobTitle", $jobTitName);
     }
     if (isset($formValues["subUnit"]) && $formValues["subUnit"] != 0) {
         $value = $formValues["subUnit"];
         $id = $value;
         $subunit = $companyStructureService->getSubunitById($id);
         $subUnitName = $subunit->getName();
         $this->getRequest()->setParameter("subUnit", $subUnitName);
     }
     $this->getRequest()->setParameter('attendanceDateRangeFrom', $formValues["fromDate"]);
     $this->getRequest()->setParameter('attendanceDateRangeTo', $formValues["toDate"]);
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:38,代码来源:displayAttendanceSummaryReportAction.class.php

示例6: getEmployeeName

 public function getEmployeeName($employeeId)
 {
     $employeeService = new EmployeeService();
     $employee = $employeeService->getEmployee($employeeId);
     return $employee->getFirstName() . " " . $employee->getLastName();
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:6,代码来源:viewTimesheetAction.class.php

示例7: render

    public function render($name, $value = null, $attributes = array(), $errors = array())
    {
        $empName = null;
        $empId = null;
        if ($value != null) {
            $service = new EmployeeService();
            if (is_array($value)) {
                $empId = isset($value['empId']) ? $value['empId'] : '';
                $empName = isset($value['empName']) ? $value['empName'] : '';
            } else {
                $empId = $value;
                $employee = $service->getEmployee($value);
                if (!empty($employee)) {
                    $empName = $employee->getFirstName() . " " . $employee->getMiddleName();
                    $empName = trim(trim($empName) . " " . $employee->getLastName());
                }
            }
        }
        $values = array_merge(array('empName' => '', 'empId' => ''), is_null($value) ? array() : array('empName' => $empName, 'empId' => $empId));
        $html = strtr($this->translate($this->getOption('template')), array('%empId%' => $this->getOption($this->attributes['id'] . '_' . 'empId')->render($name . '[empId]', $values['empId'], array('id' => $this->attributes['id'] . '_' . 'empId')), '%empName%' => $this->getOption($this->attributes['id'] . '_' . 'empName')->render($name . '[empName]', $values['empName'], array('id' => $this->attributes['id'] . '_' . 'empName'))));
        $noEmployeeMessage = __('No Employees Available');
        $requiredMessage = __(ValidationMessages::REQUIRED);
        $invalidMessage = __(ValidationMessages::INVALID);
        $typeHint = __('Type for hints') . ' ...';
        $javaScript = $javaScript = sprintf(<<<EOF
<script type="text/javascript">

    var employees = %s;
    var employeesArray = eval(employees);
    var errorMsge;
    var employeeFlag;
    var empId;
    var valid = false; 

\$(document).ready(function() {

            if (\$("#%s" + "_empName").val() == '') {
                \$("#%s" + "_empName").val('%s')
                .addClass("inputFormatHint");
            }

            \$("#%s" + "_empName").one('focus', function() {

                if (\$(this).hasClass("inputFormatHint")) {
                    \$(this).val("");
                    \$(this).removeClass("inputFormatHint");
                }
            })
            .data('typeHint', "{$typeHint}");
            

    \$("#%s" + "_empName").autocomplete(employees, {

            formatItem: function(item) {
                return \$('<div/>').text(item.name).html();
            },
            formatResult: function(item) {
                return item.name
            }
            ,matchContains:true
        }).result(function(event, item) {
            \$("#%s" + "_empId").val(item.id);
        }
    );

    \$('#btnSav').click(function() {
                \$('#defineReportForm input.inputFormatHint').val('');
                \$('#defineReportForm').submit();
        });

        \$('#defineReportFor').submit(function(){
            \$('#validationMsg').removeAttr('class');
            \$('#validationMsg').html("");
            var employeeFlag = validateInput();
            if(!employeeFlag) {
                \$('#validationMsg').attr('class', "messageBalloon_failure");
                \$('#validationMsg').html(errorMsge);
                return false;
            }
        });

 });

function validateInput(){

        var errorStyle = "background-color:#FFDFDF;";
        var empDateCount = employeesArray.length;
        var temp = false;
        var i;

        if(empDateCount==0){

            errorMsge = "{$noEmployeeMessage}";
            return false;
        }
        for (i=0; i < empDateCount; i++) {
            empName = \$.trim(\$('#%s' + '_empName').val()).toLowerCase();
            arrayName = employeesArray[i].name.toLowerCase();

            if (empName == arrayName) {
//.........这里部分代码省略.........
开发者ID:abdocmd,项目名称:orangehrm-3.0.1,代码行数:101,代码来源:ohrmReportWidgetEmployeeListAutoFill.php

示例8: getEmployeeName

 private function getEmployeeName($employeeId)
 {
     $employeeService = new EmployeeService();
     $employee = $employeeService->getEmployee($employeeId);
     $name = $employee->getFirstName() . " " . $employee->getLastName();
     if ($employee->getTerminationId()) {
         $name = $name . ' (' . __('Past Employee') . ')';
     }
     return $name;
 }
开发者ID:CamilleCrespeau,项目名称:orangehrm,代码行数:10,代码来源:editTimesheetAction.class.php

示例9: _isCorrectEmployee

 protected function _isCorrectEmployee($id, $name)
 {
     $flag = true;
     if (!empty($name) && $id == 0) {
         $flag = false;
     }
     if (!empty($name) && !empty($id)) {
         $employeeService = new EmployeeService();
         $employee = $employeeService->getEmployee($id);
         $nameArray = explode(' ', $name);
         if (count($nameArray) == 2 && strtolower($employee->getFirstName() . ' ' . $employee->getLastName()) != strtolower($name)) {
             $flag = false;
         } elseif (count($nameArray) == 3 && strtolower($employee->getFullName()) != strtolower($name)) {
             $flag = false;
         }
     }
     if ($flag) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:22,代码来源:actions.class.php

示例10: getDescriptionForScheduleInterview

 public function getDescriptionForScheduleInterview($object)
 {
     $interviewId = $object->getInterviewId();
     $jobInterview = $this->getInterviewService()->getInterviewById($interviewId);
     $interviewers = $object->getInterviewers();
     $interviewers = explode("_", $interviewers);
     if ($jobInterview->getInterviewTime() == '00:00:00') {
         $time = "";
     } else {
         $time = __("at") . " " . date('H:i', strtotime($jobInterview->getInterviewTime())) . " ";
     }
     $interviewersNameList = array();
     $employeeService = new EmployeeService();
     for ($i = 0; $i < sizeof($interviewers) - 1; $i++) {
         $interviewersNameList[] = $employeeService->getEmployee($interviewers[$i])->getFullName();
     }
     return __($object->getPerformerName()) . " " . __("scheduled") . " " . $jobInterview->getInterviewName() . " " . __("on") . " " . set_datepicker_date_format($jobInterview->getInterviewDate()) . " " . $time . __("with") . " " . implode(", ", $interviewersNameList) . " " . __("for") . " " . $object->getCandidateVacancyName();
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:18,代码来源:CandidateHistoryService.php

示例11: __

}
$userRoleManager = sfContext::getInstance()->getUserRoleManager();
$entities = array('Employee' => $empNumber);
// Old links require empNumber padded with 0's
$idLength = OrangeConfig::getInstance()->getSysConf()->getEmployeeIdLength();
$paddedEmpNumber = str_pad($empNumber, $idLength, "0", STR_PAD_LEFT);
$employeeService = new EmployeeService();
$empPicture = $employeeService->getEmployeePicture($empNumber);
$width = '150';
$height = '180';
$photographPermissions = $userRoleManager->getDataGroupPermissions(array('photograph'), array(), array(), $self, $entities);
if (!empty($empPicture) && $photographPermissions->canRead()) {
    $width = $empPicture->width;
    $height = $empPicture->height;
}
$employee = $employeeService->getEmployee($empNumber);
$allowedActions = $userRoleManager->getAllowedActions(WorkflowStateMachine::FLOW_EMPLOYEE, $employee->getState());
$allowActivate = in_array(WorkflowStateMachine::EMPLOYEE_ACTION_REACTIVE, $allowedActions);
$allowTerminate = in_array(WorkflowStateMachine::EMPLOYEE_ACTION_TERMINATE, $allowedActions);
?>

<form id="frmEmp" action=""></form>
<div id="pimleftmenu">
    <?php 
include_partial('photo', array('empNumber' => $empNumber, 'width' => $width, 'height' => $height, 'editMode' => isset($editPhotoMode) ? $editPhotoMode : false, 'fullName' => htmlspecialchars($form->fullName), 'photographPermissions' => $photographPermissions));
?>
    <ul class="pimleftmenu">
        <li class="l1 parent">
            <a href="#" class="expanded" onclick="showHideSubMenu(this);">
                <span class="parent personal"><?php 
echo __("Personal");
开发者ID:THM068,项目名称:orangehrm,代码行数:31,代码来源:_leftmenu.php

示例12: getEmployee

 /**
  * Get Employee object with values filled using form values
  */
 public function getEmployee()
 {
     $employeeService = new EmployeeService();
     $employee = $employeeService->getEmployee($this->getValue('emp_number'));
     $joinedDate = $employee->joined_date;
     $jobTitle = $this->getValue('job_title');
     $employee->job_title_code = $jobTitle;
     $empStatus = $this->getValue('emp_status');
     if ($empStatus == '') {
         $employee->emp_status = null;
     } else {
         $employee->emp_status = $empStatus;
     }
     $eeoCat = $this->getValue('eeo_category');
     if ($eeoCat == '') {
         $employee->eeo_cat_code = null;
     } else {
         $employee->eeo_cat_code = $eeoCat;
     }
     $employee->work_station = $this->getValue('sub_unit');
     $employee->joined_date = $this->getValue('joined_date');
     if ($joinedDate != '' && $joinedDate != $this->getValue('joined_date')) {
         $this->isJoinDateChanged = true;
     }
     // Location
     $location = $this->getValue('location');
     $foundLocation = false;
     //
     // Unlink all locations except current.
     //
     foreach ($employee->getLocations() as $empLocation) {
         if ($location == $empLocation->id) {
             $foundLocation = true;
         } else {
             $employee->unlink('locations', $empLocation->id);
         }
     }
     //
     // Link location if not already linked
     //
     if (!$foundLocation) {
         $employee->link('locations', $location);
     }
     // contract details
     $empContract = new EmpContract();
     $empContract->emp_number = $employee->empNumber;
     $empContract->start_date = $this->getValue('contract_start_date');
     $empContract->end_date = $this->getValue('contract_end_date');
     $empContract->contract_id = 1;
     $employee->contracts[0] = $empContract;
     return $employee;
 }
开发者ID:abdocmd,项目名称:spmillen,代码行数:55,代码来源:EmployeeJobDetailsForm.php


注:本文中的EmployeeService::getEmployee方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。