typesPops = array('Poptávka','Objednávka'); $this->types = array(0 => 'Startovací', 1 => 'Trakční'); $this->parts = array('Baterie','Nabíječka, Napětí, Kapacita baterie','Ostatní (Kabely, konektory, články baterií...),'); $this->designs = array(0 => 'Standartní', 1 => 'Vysokofrekvenční'); $this->types2 = array(0 => 'Elektrolytická', 1 => 'Gelová'); $this->voltages = array(0 => 'Třífázové', 1 => 'Jednofázové'); $this->setWidgets(array( 'typePop' => new sfWidgetFormSelectRadio(array('choices' => $this->typesPops)), 'part' => new sfWidgetFormChoice(array('choices' => $this->parts)), 'type' => new sfWidgetFormSelectRadio(array('choices' => $this->types)), 'voltage' => new sfWidgetFormInput(), 'capacity' => new sfWidgetFormInput(), 'maker' => new sfWidgetFormInput(), 'typeTruck' => new sfWidgetFormInput(), 'design' => new sfWidgetFormChoice(array('choices' => $this->designs)), 'type2' => new sfWidgetFormChoice(array('choices' => $this->types2)), 'voltage2' => new sfWidgetFormChoice(array('choices' => $this->voltages)), 'notePart' => new sfWidgetFormTextarea(), 'description' => new sfWidgetFormTextarea(), '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)), 'part' => new sfValidatorPass(array('required' => false)), 'type' => new sfValidatorPass(array('required' => false)), 'capacity' => new sfValidatorPass(array('required' => false)), 'maker' => new sfValidatorPass(array('required' => false)), 'typeTruck' => new sfValidatorPass(array('required' => false)), 'voltage' => new sfValidatorPass(array('required' => false)), 'design' => new sfValidatorPass(array('required' => false)), 'types2' => new sfValidatorPass(array('required' => false)), 'voltage2' => new sfValidatorPass(array('required' => false)), 'notePart' => 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', 'part' => 'Díl', 'type' => 'Typ', 'voltage' => 'Napětí', 'capacity' => 'Kapacita', 'notePart' => 'Další údaje', 'maker' => 'Výrobce', 'typeTruck' => 'Typ vozíku', 'design' => 'Provedení', 'type2' => 'Typ', 'voltage2' => 'Napajení', 'description' => 'Popis dílu', '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 "Akumulátorové baterie a nabíječe (startovací, trakční)"; } }