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


PHP EmployeeService::getAttachments方法代码示例

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


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

示例1: configure

 public function configure()
 {
     $empNumber = $this->getOption('empNumber');
     $employee = $this->getOption('employee');
     $this->fullName = $employee->getFullName();
     $jobTitleId = $employee->job_title_code;
     $empTerminatedId = $employee->termination_id;
     $jobTitles = $this->_getJobTitles($jobTitleId);
     $employeeStatuses = $this->_getEmpStatuses();
     $eeoCategories = $this->_getEEOCategories();
     $subDivisions = $this->_getSubDivisions();
     $locations = $this->_getLocations($employee);
     $empService = new EmployeeService();
     $attachmentList = $empService->getAttachments($empNumber, 'contract');
     if (count($attachmentList) > 0) {
         $this->attachment = $attachmentList[0];
     }
     $contractUpdateChoices = array(self::CONTRACT_KEEP => __('Keep Current'), self::CONTRACT_DELETE => __('Delete Current'), self::CONTRACT_UPLOAD => __('Replace Current'));
     // Note: Widget names were kept from old non-symfony version
     $this->setWidgets(array('emp_number' => new sfWidgetFormInputHidden(), 'job_title' => new sfWidgetFormSelect(array('choices' => $jobTitles)), 'emp_status' => new sfWidgetFormSelect(array('choices' => $employeeStatuses)), 'terminated_date' => new ohrmWidgetDatePickerNew(array(), array('id' => 'job_terminated_date')), 'termination_reason' => new sfWidgetFormTextarea(), 'eeo_category' => new sfWidgetFormSelect(array('choices' => $eeoCategories)), 'sub_unit' => new sfWidgetFormSelect(array('choices' => $subDivisions)), 'location' => new sfWidgetFormSelect(array('choices' => $locations)), 'joined_date' => new ohrmWidgetDatePickerNew(array(), array('id' => 'job_joined_date')), 'contract_start_date' => new ohrmWidgetDatePickerNew(array(), array('id' => 'job_contract_start_date')), 'contract_end_date' => new ohrmWidgetDatePickerNew(array(), array('id' => 'job_contract_end_date')), 'contract_file' => new sfWidgetFormInputFile(), 'contract_update' => new sfWidgetFormChoice(array('expanded' => true, 'choices' => $contractUpdateChoices))));
     // Default values
     $this->setDefault('emp_number', $empNumber);
     $this->setDefault('emp_status', $employee->emp_status);
     if (!empty($jobTitleId)) {
         $this->setDefault('job_title', $jobTitleId);
         $jobTitle = $this->getJobTitleService()->getJobTitleById($jobTitleId);
         $this->jobSpecAttachment = $jobTitle->getJobSpecificationAttachment();
     }
     if (!empty($empTerminatedId)) {
         $this->empTermination = $employee->getEmpTermination();
     }
     $this->setDefault('eeo_category', $employee->eeo_cat_code);
     $inputDatePattern = sfContext::getInstance()->getUser()->getDateFormat();
     sfContext::getInstance()->getConfiguration()->loadHelpers('OrangeDate');
     $this->setDefault('sub_unit', $employee->work_station);
     // Assign first location
     $locationList = $employee->locations;
     if (count($locationList) > 0) {
         $this->setDefault('location', $locationList[0]->id);
     }
     $contracts = $employee->contracts;
     if (count($contracts) > 0) {
         $contract = $contracts[0];
         $this->setDefault('contract_start_date', set_datepicker_date_format($contract->start_date));
         $this->setDefault('contract_end_date', set_datepicker_date_format($contract->end_date));
     }
     $this->setDefault('joined_date', set_datepicker_date_format($employee->joined_date));
     $this->setDefault('contract_update', self::CONTRACT_KEEP);
     $this->setValidators(array('emp_number' => new sfValidatorString(array('required' => true)), 'job_title' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($jobTitles))), 'emp_status' => new sfValidatorString(array('required' => false)), 'terminated_date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'termination_reason' => new sfValidatorString(array('required' => false)), 'eeo_category' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($eeoCategories))), 'sub_unit' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($subDivisions))), 'location' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($locations))), 'joined_date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'contract_start_date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'contract_end_date' => new ohrmDateValidator(array('date_format' => $inputDatePattern, 'required' => false), array('invalid' => 'Date format should be ' . $inputDatePattern)), 'contract_file' => new sfValidatorFile(array('required' => false, 'max_size' => 1000000), array('max_size' => __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE))), 'contract_update' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setNameFormat('job[%s]');
     // set up post validator method
     $this->validatorSchema->setPostValidator(new sfValidatorCallback(array('callback' => array($this, 'postValidate'))));
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:53,代码来源:EmployeeJobDetailsForm.php


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