public function configure() { parent::configure(); $leaveTypeWidget = $this->getWidget('leave_type'); $choices = $leaveTypeWidget->getOption('choices'); if (!isset($choices[''])) { $choices = array('' => 'All') + $choices; $leaveTypeWidget->setOption('choices', $choices); $this->setDefault('leave_type', ''); $this->setValidator('leave_type', new sfValidatorChoice(array('choices' => array_keys($choices), 'required' => false))); } }
public function configure() { $this->bulkAssignForm = new LeaveEntitlementBulkAssignFilterForm(); $this->embedForm('filters', $this->bulkAssignForm, '<ol id="filter">%content%</ol>'); parent::configure(); $this->setWidget('id', new sfWidgetFormInputHidden()); $this->setValidator('id', new sfValidatorNumber(array('required' => false, 'min' => 1))); $this->addFilterWidgets(); $this->setWidget('entitlement', new sfWidgetFormInputText()); $this->setValidator('entitlement', new sfValidatorNumber(array('required' => true))); $this->getWidgetSchema()->setLabels($this->getFormLabels()); $this->widgetSchema->setLabel('filters', ' '); }
public function configure() { $this->bulkAssignForm = new LeaveEntitlementBulkAssignFilterForm(); $this->embedForm('filters', $this->bulkAssignForm, '<ol id="filter">%content%</ol>'); parent::configure(); $requiredPermissions = array(BasicUserRoleManager::PERMISSION_TYPE_ACTION => array('add_entitlements')); $employeeWidget = $this->getWidget('employee'); $employeeWidget->setOption('requiredPermissions', $requiredPermissions); $this->setWidget('employee', $employeeWidget); $this->setWidget('id', new sfWidgetFormInputHidden()); $this->setValidator('id', new sfValidatorNumber(array('required' => false, 'min' => 1))); $this->addFilterWidgets(); $this->setWidget('entitlement', new sfWidgetFormInputText()); $this->setValidator('entitlement', new sfValidatorNumber(array('required' => true))); $this->getWidgetSchema()->setLabels($this->getFormLabels()); $this->widgetSchema->setLabel('filters', ' '); }