KataoNodeForm.class.php 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * KataoNode form.
  4. *
  5. * @package katao
  6. * @subpackage form
  7. * @author Your name here
  8. * @version SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
  9. */
  10. class KataoNodeForm extends BaseKataoNodeForm {
  11. public function configure() {
  12. unset($this->validatorSchema['is_default'], $this->validatorSchema['katao_supplier_node_list'], $this->validatorSchema['created_at'], $this->validatorSchema['updated_at']);
  13. unset($this->widgetSchema['is_default'], $this->widgetSchema['katao_supplier_node_list'], $this->widgetSchema['created_at'], $this->widgetSchema['updated_at']);
  14. $this->widgetSchema['responsible'] = new sfWidgetFormSelect(array('choices' => KataoUserPeer::getMembersByNodeToArray($this->getObject()->getId())));
  15. if ($this->getObject()->isNew()) {
  16. $this->setDefault('responsible', sfContext::getInstance()->getUser()->getInstance()->getId());
  17. }
  18. $this->widgetSchema['begin_at'] = new wpWidgetFormRichDate();
  19. $this->validatorSchema['begin_at'] = new sfValidatorDateTime(array('date_format' => '@(?P<day>\d{2}).(?P<month>\d{2}).(?P<year>\d{4})@'));
  20. $this->setDefault('begin_at', time());
  21. $this->widgetSchema->setLabels(array(
  22. 'city' => 'Ville',
  23. 'responsible' => 'Délégué',
  24. 'begin_at' => 'Date de création',
  25. ));
  26. }
  27. }