UserForm.class.php 1.12 KB
Newer Older
Яков's avatar
first  
Яков 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
/*class UserForm extends PluginUserForm
{
  public function configure()
  {
    $this->useFields(array('username', 'fname', 'iname', 'oname', 'email', 'user_groups_list', 'user_permissions_list'));
    
    $this->widgetSchema['user_groups_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Groups', 'expanded' => true));
    $this->widgetSchema['user_permissions_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Permission', 'expanded' => true));
  }
}*/


class UserForm extends PluginUserForm
{
  public function configure()
  {
    $this->useFields(array('username', 'organization', 'city' , 'email', 'phone_number', 'password', 'is_active'));

    $this->widgetSchema['city'] = new sfWidgetFormInputText(array(), array("size" => 32, "maxlength" => 255));

    $q = Doctrine_Query::create()
      ->select("u.*")
      ->from("User u")
      ->where("u.is_super_admin = 1");
      
    $users = $q->fetchArray();
    $options = array('' => '&nbsp;');
    foreach($users as $user)
    {
      $options[$user['id']] = $user['iname'] ? $user['iname'] : $user['username'];
    }
  }
}