Пример #1
0
 public function configure()
 {
     $this->widgetSchema['category'] = new sfWidgetFormChoice(array('choices' => Codes::getCategories()));
     $this->validatorSchema['category'] = new sfValidatorChoice(array('required' => false, 'choices' => array_keys(Codes::getCategories())));
     $this->widgetSchema['referenced_relation'] = new sfWidgetFormChoice(array('choices' => array('specimens' => 'Specimen Code', 'specimen_parts' => 'Parts Code')));
     $this->validatorSchema['referenced_relation'] = new sfValidatorChoice(array('required' => false, 'choices' => array('specimens' => 'specimens', 'specimen_parts' => 'specimen_parts')));
     $this->widgetSchema['code_part'] = new sfWidgetFormInput(array(), array('style' => 'width:97%;'));
     $this->widgetSchema['code_from'] = new sfWidgetFormInput(array(), array('class' => 'lsmall_size'));
     $this->widgetSchema['code_to'] = new sfWidgetFormInput(array(), array('class' => 'lsmall_size'));
     $this->validatorSchema['code_part'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->validatorSchema['code_from'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->validatorSchema['code_to'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->mergePostValidator(new CodesLineValidatorSchema());
 }
Пример #2
0
 public function configure()
 {
     $this->useFields(array('code_category', 'code_prefix', 'code_prefix_separator', 'code', 'code_suffix', 'code_suffix_separator'));
     $this->widgetSchema['code_category'] = new sfWidgetFormChoice(array('choices' => Codes::getCategories()));
     $this->validatorSchema['code_category'] = new sfValidatorChoice(array('required' => false, 'choices' => array_keys(Codes::getCategories())));
     $this->widgetSchema['code_prefix'] = new sfWidgetFormInput();
     $this->widgetSchema['code_prefix']->setAttributes(array('class' => 'lsmall_size'));
     $this->validatorSchema['code_prefix'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->widgetSchema['code_prefix_separator'] = new widgetFormSelectComplete(array('model' => 'Codes', 'table_method' => 'getDistinctPrefixSep', 'method' => 'getCodePrefixSeparator', 'key_method' => 'getCodePrefixSeparator', 'add_empty' => true, 'change_label' => '', 'add_label' => ''));
     $this->widgetSchema['code_prefix_separator']->setAttributes(array('class' => 'vvsmall_size'));
     $this->widgetSchema['code'] = new sfWidgetFormInput();
     //mrac 2015 06 03 new css class 'mrac_input_mask' for input mask
     $this->widgetSchema['code']->setAttributes(array('class' => 'medium_small_size code_mrac_input_mask'));
     $this->validatorSchema['code'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->widgetSchema['code_suffix'] = new sfWidgetFormInput();
     $this->widgetSchema['code_suffix']->setAttributes(array('class' => 'lsmall_size'));
     $this->validatorSchema['code_suffix'] = new sfValidatorString(array('required' => false, 'trim' => true));
     $this->widgetSchema['code_suffix_separator'] = new widgetFormSelectComplete(array('model' => 'Codes', 'table_method' => 'getDistinctSuffixSep', 'method' => 'getCodeSuffixSeparator', 'key_method' => 'getCodeSuffixSeparator', 'add_empty' => true, 'change_label' => '', 'add_label' => ''));
     $this->widgetSchema['code_suffix_separator']->setAttributes(array('class' => 'vvsmall_size'));
     $this->mergePostValidator(new CodesValidatorSchema());
 }