typesPops = array('Poptávka','Objednávka'); $this->types = array(0 => 'Dle katalogového čísla', 1 => 'Bez katalogového čísla'); $this->parts = array('Motory', 'Převodový agregát', 'Hnací nápravy', 'Řídící nápravy', 'Zvedací zařízení', 'Pracovní hydraulika', 'Díly', 'Elektropříslušenství', 'Díly kabiny'); $this->setWidgets(array( 'typePop' => new sfWidgetFormSelectRadio(array('choices' => $this->typesPops)), 'type' => new sfWidgetFormSelectRadio(array('choices' => $this->types)), 'maker' => new sfWidgetFormInput(), 'typeTruck' => new sfWidgetFormInput(), 'year' => new sfWidgetFormInput(), 'factory_num' => new sfWidgetFormInput(), 'cat_num' => new sfWidgetFormInput(), 'notePart' => new sfWidgetFormTextarea(), 'part' => new sfWidgetFormChoice(array('choices' => $this->parts)), 'description' => new sfWidgetFormTextarea(), 'company' => new sfWidgetFormInput(), 'ico' => new sfWidgetFormInput(), 'dic' => new sfWidgetFormInput(), 'name' => new sfWidgetFormInput(), 'street' => new sfWidgetFormInput(), 'city' => new sfWidgetFormInput(), 'zip' => new sfWidgetFormInput(), 'tel' => new sfWidgetFormInput(), 'fax' => new sfWidgetFormInput(), 'mail' => new sfWidgetFormInput(), 'note' => new sfWidgetFormTextarea(), )); $this->setValidators(array( 'typePop' => new sfValidatorPass(array('required' => false)), 'type' => new sfValidatorPass(array('required' => false)), 'maker' => new sfValidatorPass(array('required' => false)), 'typeTruck' => new sfValidatorPass(array('required' => false)), 'year' => new sfValidatorPass(array('required' => false)), 'factory_num' => new sfValidatorPass(array('required' => false)), 'cat_num' => new sfValidatorPass(array('required' => false)), 'notePart' => new sfValidatorPass(array('required' => false)), 'part' => new sfValidatorPass(array('required' => false)), 'description' => new sfValidatorPass(array('required' => false)), 'company' => new sfValidatorPass(array('required' => false)), 'ico' => new sfValidatorPass(array('required' => false)), 'dic' => new sfValidatorPass(array('required' => false)), 'name' => new sfValidatorString(array('required' => true)), 'street' => new sfValidatorPass(array('required' => false)), 'city' => new sfValidatorPass(array('required' => false)), 'zip' => new sfValidatorPass(array('required' => false)), 'tel' => new sfValidatorPass(array('required' => false)), 'fax' => new sfValidatorPass(array('required' => false)), 'mail' => new sfValidatorEmail( array('required' => false)), 'note' => new sfValidatorPass(array('required' => false)), )); $this->widgetSchema->setLabels(array( 'typePop' => 'Druh poptávky', 'type' => 'Typ', 'maker' => 'Výrobce', 'notePart' => 'Popis dílu', 'typeTruck' => 'Typ vozíku', 'year' => 'Rok výroby', 'factory_num' => 'Výrobní číslo', 'cat_num' => 'Katalogové číslo', 'part' => 'Zařazení součástky', 'description' => 'Popis součástky', 'name' => 'Kontaktní osoba', 'company' => 'Společnost', 'ico' => 'IČO', 'dic' => 'DIČ', 'zip' => 'PSČ', 'city' => 'Město', 'street' => 'Ulice, číslo', 'tel' => 'Telefon', 'fax' => 'Fax', 'mail' => 'Email', 'note' => 'Poznámka', )); $this->widgetSchema->setNameFormat('parts_request_form[%s]'); $this->addStarToRequiredFieldsLabel(); $this->addMailTelPostvalidator('mail', 'tel'); $this->disableCSRFProtection(); } public function getNameForm() { return "Převodový agregát"; } }