public function setup() { $this->setWidgets(array('usuari_id' => new sfWidgetFormInputHidden(), 'app_id' => new sfWidgetFormChoice(array('choices' => AppsPeer::select())), 'nivell_id' => new sfWidgetFormChoice(array('choices' => NivellsPeer::getSelect())))); $this->setValidators(array('usuari_id' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID', 'required' => false)), 'app_id' => new sfValidatorPropelChoice(array('model' => 'Apps', 'column' => 'app_id', 'required' => false)), 'nivell_id' => new sfValidatorPropelChoice(array('model' => 'Nivells', 'column' => 'idNivells', 'required' => false)))); $this->widgetSchema->setNameFormat('usuaris_apps[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); parent::setup(); }
<form action="<?php echo url_for('gestio/gUsuaris'); ?> " method="post"> <DIV class="REQUADRE"> <?php include_partial('botonera', array('tipus' => 'Tancar', 'url' => 'gestio/gUsuaris?accio=FC')); echo input_hidden_tag('id_usuari', $USUARI->getUsuariId()); ?> <DIV class="TITOL">GestiĆ³ de permisos d'aplicacions de l'usuari <?php echo $USUARI->getNomComplet(); ?> </DIV> <TABLE class="DADES"> <?php foreach (AppsPeer::select() as $IDAPP => $APP) { $SELECT = isset($LLISTAT_PERMISOS[$IDAPP]) ? $LLISTAT_PERMISOS[$IDAPP] : NivellsPeer::CAP; echo '<tr><td>' . AppsPeer::getNom($IDAPP) . '</td> <td>' . select_tag('PERMIS[' . $IDAPP . ']', options_for_select(NivellsPeer::getSelect(), $SELECT, array('include_blank' => true))) . '</td> </tr>'; } echo '<TR><TD colspan="2"><button name="BACTUALITZA_PERMISOS" class="BOTO_ACTIVITAT">ACTUALITZA</TD></TR>'; ?> </TABLE> </DIV> </form> <?php } ?>