* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ class AgencyProfileForm extends ProfileForm { public function configure() { parent::configure(); unset($this['prepayment_from']); unset($this['prepayment_to']); unset($this['first_name']); unset($this['last_name']); unset($this['prefix']); unset($this['sufix']); unset($this['is_public']); unset($this['representant_id']); $this->validatorSchema['name']->setOption('required', true); if($this->isNew()) { // Automaticky nastavujeme tarif if(saSettings::get('auto_tarif', false)) { $this->widgetSchema['prepayment_type_id'] = new sfWidgetFormInputHidden(); } $this->widgetSchema['prepayment_type_id']->setLabel(__('Mám zájem o tarif')); // $this->widgetSchema['prepayment_count']->setLabel('Objednávám kreditů:'); // $this->setDefault('prepayment_count', 5); // $this->embedForm('prepayment_countttt', new PrepayProfileForm()); } else { unset($this['prepayment_type_id']); } $this->widgetSchema['type_id'] = new sfWidgetFormInputHidden(); $this->setDefault('type_id', ProfileType::AGENCY); $this->setDefault('web', 'http://'); if($page = Doctrine::getTable('Page')->findOneById(18)) { $this->widgetSchema['agree']->setOption('message', $page->getText()); } commonFormFunctions::setJqUiFormater($this); commonFormFunctions::addClasses($this); } public function bind(array $taintedValues = null, array $taintedFiles = null) { if($taintedValues['web'] == 'http://') { $taintedValues['web'] = null; } $taintedValues['type_id'] = ProfileType::AGENCY; parent::bind($taintedValues, $taintedFiles); } }