<?php

/**
 * Export form.
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ExportForm extends BaseExportForm
{
  public function configure()
  {
    $this->useFields(array('logic_type', 'cat_id', 'weight', 'sum', 'user_id'));

      $logic_type = array(
          'bid' => 'Оформленная сразу',
          'wait' => 'Буду копить',
          'bid_after_wait' => 'Оформлена после накопления'
      );

      $this->widgetSchema['logic_type'] = new sfWidgetFormChoice(array('choices' => $logic_type), array());

      $user_q = Doctrine_Query::create()
          ->select("u.*")
          ->from("User u")
          ->where("u.is_super_admin = ?", 0)
          ->andWhere("u.username != 'root'")
          ->orderBy("u.username");

      $this->widgetSchema['user_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => false, 'query' => $user_q), array("autocomplete" => "off"));
  }
}
