コード例 #1
0
ファイル: EmployeeForm.class.php プロジェクト: anvaya/nckids
 public function configure()
 {
     $years = range(date('Y') - 100, date('Y') + 5);
     //Creates array of years between 1920-2000
     $years_list = array_reverse(array_combine($years, $years), true);
     //Creates new array where key and value are both values from $years list
     sfProjectConfiguration::getActive()->loadHelpers('Global');
     unset($this['created_at'], $this['updated_at'], $this['clearance'], $this['keys_returned'], $this['email_removed'], $this['server_removed'], $this['dist_list_removed']);
     $this->widgetSchema['dob'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{changeYear:true, yearRange: \'1920:2009\'}'), array('class' => 'date'));
     $this->widgetSchema['license_expiration'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['doh'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['physical_date'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['tb_date'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['osha_date'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['cpr_date'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['dof'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['tc_effective'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['tc_exp'] = new sfWidgetFormJQueryDate(array('years' => $years_list, 'image' => '/images/calendar.png', 'config' => '{}'), array('class' => 'date'));
     $this->widgetSchema['tc_type'] = new sfWidgetFormChoice(array('expanded' => false, 'multiple' => false, 'choices' => EmployeePeer::getTcTypeOptions()));
     $this->validatorSchema['tc_type'] = new sfValidatorChoice(array('required' => false, 'multiple' => false, 'choices' => array_keys(EmployeePeer::getTcTypeOptions())));
     $this->widgetSchema['employee_to_location_list']->setOption('expanded', true);
     $this->widgetSchema['employee_finger_to_location_list']->setOption('expanded', true);
     $this->widgetSchema['tc_type']->setLabel('Teacher Cert. Type');
     $this->widgetSchema['tc_effective']->setLabel('Teacher Cert. Effective');
     $this->widgetSchema['tc_number']->setLabel('Teacher Cert. Number');
     $this->widgetSchema['tc_exp']->setLabel('Cert. Through (expires)');
     $this->widgetSchema['has_dist_list']->setLabel('On distribution list');
     // $this->widgetSchema['clearance']->setLabel('SCR Clearance');
     $this->widgetSchema['first_name']->setLabel('First Name');
     $this->widgetSchema['last_name']->setLabel('Last Name');
     $this->widgetSchema['job_id']->setLabel('Job Title');
     $this->widgetSchema['home_phone']->setLabel('Home Phone');
     $this->widgetSchema['cell_phone']->setLabel('Cell Phone');
     $this->widgetSchema['company_email']->setLabel('Company Email');
     $this->widgetSchema['personal_email']->setLabel('Personal Email');
     $this->widgetSchema['zip']->setLabel('ZIP');
     $this->widgetSchema['ssn']->setLabel('SSN');
     $this->widgetSchema['npi']->setLabel('NPI');
     $this->widgetSchema['doh']->setLabel('Date of Hire');
     $this->widgetSchema['dof']->setLabel('Date of Termination');
     $this->widgetSchema['dob']->setLabel('DOB');
     $this->widgetSchema['license_number']->setLabel('License Number');
     $this->widgetSchema['license_expiration']->setLabel('License Expires');
     $this->widgetSchema['physical_date']->setLabel('Physical Expiration Date');
     $this->widgetSchema['physical_notes']->setLabel('Physical Notes');
     $this->widgetSchema['tb_date']->setLabel('TB Expiration Date');
     $this->widgetSchema['tb_notes']->setLabel('TB Notes');
     $this->widgetSchema['osha_date']->setLabel('OSHA Expiration Date');
     $this->widgetSchema['cpr_date']->setLabel('CPR Expiration Date');
     $this->widgetSchema['suplimental_health']->setLabel('Supplemental health');
     $this->widgetSchema['employee_finger_to_location_list']->setLabel('Fingerprints');
     $this->widgetSchema['finger_print_notes']->setLabel('Fingerprint Notes');
     $this->widgetSchema['employee_to_location_list']->setLabel('SCR Clearance');
     $this->widgetSchema['picture'] = new sfWidgetFormInputFileEditable(array('label' => 'Picture', 'file_src' => '/uploads/' . sfConfig::get('app_employee_images_dir', 'employee') . '/' . $this->getObject()->getPicture(), 'is_image' => false, 'edit_mode' => !$this->isNew(), 'template' => '<div><label>Delete the picture?</label> %delete%<br /><label>New Picture</label> %input%</div>'));
     $this->validatorSchema['picture'] = new sfValidatorFile();
     $this->validatorSchema['picture']->setOption('required', false);
     $this->validatorSchema['picture_delete'] = new sfValidatorBoolean();
 }