<?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'];
    }
  }
}
