public function setup() { $this->setWidgets(array('site_id_my' => new sfWidgetFormChoice(array('choices' => SitesPeer::getSelectUser($this->getOption('idU')))), 'site_id' => new sfWidgetFormChoice(array('choices' => SitesPeer::getSelect(false))))); $this->setValidators(array('site_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->getSiteId()), 'empty_value' => $this->getObject()->getSiteId(), 'required' => false)), 'site_id_my' => new sfValidatorChoice(array('choices' => array($this->getObject()->getSiteId()), 'empty_value' => $this->getObject()->getSiteId(), 'required' => false)))); $this->widgetSchema->setNameFormat('sites[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); $this->widgetSchema->setLabels(array('site_id' => "Totes les entitats: ", 'site_id_my' => 'Entitats on he participat: ')); }
public function configure() { $this->setWidgets(array('site' => new sfWidgetFormChoice(array('choices' => SitesPeer::getSelect(false, true))), 'nick' => new sfWidgetFormInputText(array(), array('style' => 'width:100px;')), 'password' => new sfWidgetFormInputPassword(array(), array('style' => 'width:100px;')))); $this->setValidator('password', new sfValidatorString(array('required' => false))); $this->setValidator('nick', new sfValidatorString(array('required' => false))); $this->setValidator('site', new sfValidatorString(array('required' => true))); $this->widgetSchema->setlabels(array('nick' => 'DNI: ', 'password' => 'CONTRASENYA: ')); $this->widgetSchema->setNameFormat('login[%s]'); }
public function setup() { $BASE = OptionsPeer::getString('SF_WEBROOT', $this->getOption('IDS')); $this->setWidget('IDS', new sfWidgetFormChoice(array('choices' => SitesPeer::getSelect(false, false)), array('style' => 'width:400px'))); $this->setValidator('IDS', new sfValidatorPass(array(), array())); $this->widgetSchema->setNameFormat('super_admin_menus[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); $this->setWidgetUsers(); }
/** * Menus GestiĆ³ Tab * */ function MenusgestioTab($LMENUS = "", $FMENUUSUARI) { ?> <form id="FMENUS" action="<?php echo url_for('gestio/gConfigSuperAdmin'); ?> " method="POST" enctype="multipart/form-data"> <?php echo select_tag('MENU_SITES', options_for_select(SitesPeer::getSelect(false, false)), array('multiple' => 'multiple', 'style' => 'height:200px; width:40%;')); ?> <?php echo select_tag('MENU_USUARIS', null, array('multiple' => 'multiple', 'style' => 'height:200px; width:40%;')); ?> <br /><br /> <?php echo select_tag('MENU_DISPONIBLES', null, array('multiple' => 'multiple', 'style' => 'height:400px; width:80%')); ?> <br /><br /> <button type="submit" name="BSAVEUSERMENU" class="BOTO_ACTIVITAT"><?php echo image_tag('template/disk.png'); ?> Guardar i sortir</button> </form> <?php }
/** * Permisos Tab * */ function PermisosTab($SITE, $LUSERSITES = "") { $RET = ' <form id="FESPAIS" action="' . url_for('gestio/gConfigSuperAdmin') . '" method="POST" enctype="multipart/form-data"> Site : ' . select_tag('SITE', options_for_select(SitesPeer::getSelect(), $SITE)); $RET .= '<br /><br /><table>'; $RET .= '<tr><td class="titol">User</td><td class="titol">Nivell</td><td class="titol"></td></tr>'; foreach ($LUSERSITES as $OUS) { $USUARI = $OUS->getUsuariId(); $RET .= '<tr><td>' . select_tag('dades[' . $USUARI . '][IDU]', options_for_select(UsuarisPeer::selectAllUsers(), $USUARI)) . '</td>'; $RET .= '<td>' . select_tag('dades[' . $USUARI . '][IDN]', options_for_select(NivellsPeer::getSelect(), $OUS->getNivellId())) . '</td>'; $RET .= '<td>' . link_to('esborra', 'gestio/gConfigSuperAdmin?accio=DELETE_USER_SITE&USUARI=' . $USUARI . '&SITE=' . $SITE) . '</td></tr>'; } $RET .= '<tr><td>' . select_tag('dades[0][IDU]', options_for_select(UsuarisPeer::selectAllUsers(), 0)) . '</td>'; $RET .= '<td>' . select_tag('dades[0][IDN]', options_for_select(NivellsPeer::getSelect(), 0)) . '</td></tr>'; $RET .= '</table>'; $RET .= ' <div style="text-align:right"> <button style="margin-top:10px;" name="BSEARCHUSERSITES" class="BOTO_ACTIVITAT"> ' . image_tag('template/find.png') . ' Consulta </BUTTON> <button type="submit" name="BSAVEUSERSITE" class="BOTO_ACTIVITAT" onClick="return confirm(\'Segur que vols guardar els canvis?\')"> ' . image_tag('template/disk.png') . ' Guardar i sortir </button> </div> </form>'; return $RET; }