ExportForm.class.php 1.08 KB
Newer Older
Игорь's avatar
init    
Игорь committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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"));
  }
}