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->norma = array("ČSN","ČSN","EN","ISO", "DIN"); $this->setWidgets(array( 'typePop' => new sfWidgetFormSelectRadio(array('choices' => $this->typesPops)), 'nameParts' => new sfWidgetFormInput(), 'ozn' => new sfWidgetFormInput(), 'norma'=> new sfWidgetFormChoice(array('choices' => $this->norma)), 'notePart'=> 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)), 'nameParts' => new sfValidatorPass(array('required' => false)), 'ozn' => new sfValidatorPass(array('required' => false)), 'norma' => new sfValidatorPass(array('required' => false)), 'notePart' => 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 sfValidatorPass(array('required' => false)), 'street' => new sfValidatorString(array('required' => true)), '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', 'nameParts' => 'Název', 'ozn' => 'Rozměr - označení', 'norma' => 'Norma (ČSN, ČSN EN ISO, DIN...)', 'notePart' => 'Další údaje', 'name' => 'Kontaktní osoba', 'type' => 'Typ', '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 "Ostatní materiál (spojovací, ložiska…)"; } }