| 1 | <?php | 
|---|
| 2 | // ************************************************************************************************************************************************* | 
|---|
| 3 | // Aplicación WEB: ogAdmWebCon | 
|---|
| 4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla | 
|---|
| 5 | // Fecha Creación: Año 2009-2010 | 
|---|
| 6 | // Fecha Última modificación: Agosto-2010 | 
|---|
| 7 | // Nombre del fichero: aula.php | 
|---|
| 8 | // Descripción : | 
|---|
| 9 | //              Visualiza los ordenadores de las aulas de un determinado Centro | 
|---|
| 10 | // ************************************************************************************************************************************************* | 
|---|
| 11 | include_once("../includes/ctrlacc.php"); | 
|---|
| 12 | include_once("../clases/AdoPhp.php"); | 
|---|
| 13 | include_once("../clases/XmlPhp.php"); | 
|---|
| 14 | include_once("../clases/MenuContextual.php"); | 
|---|
| 15 | include_once("../clases/SockHidra.php"); | 
|---|
| 16 | include_once("../includes/constantes.php"); | 
|---|
| 17 | include_once("../includes/comunes.php"); | 
|---|
| 18 | include_once("../includes/CreaComando.php"); | 
|---|
| 19 | include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php"); | 
|---|
| 20 | include_once("../idiomas/php/".$idioma."/estados_".$idioma.".php"); | 
|---|
| 21 | include_once("../idiomas/php/".$idioma."/comandos/mensajes_".$idioma.".php"); | 
|---|
| 22 | //________________________________________________________________________________________________________ | 
|---|
| 23 | $litambito=0; | 
|---|
| 24 | $idambito=0; | 
|---|
| 25 | $nombreambito=""; | 
|---|
| 26 | $idsrvrembo=0; | 
|---|
| 27 | $idsrvdhcp=0; | 
|---|
| 28 |  | 
|---|
| 29 | if (isset($_GET["litambito"])) $litambito=$_GET["litambito"]; // Recoge parametros | 
|---|
| 30 | if (isset($_GET["idambito"])) $idambito=$_GET["idambito"]; | 
|---|
| 31 | if (isset($_GET["nombreambito"])) $nombreambito=$_GET["nombreambito"]; | 
|---|
| 32 |  | 
|---|
| 33 | $Midordenador=  Array(); | 
|---|
| 34 | $Mnombreordenador=  Array(); | 
|---|
| 35 | $MimgOrdenador=Array(); | 
|---|
| 36 | $Mip= Array(); | 
|---|
| 37 | $Mmac=  Array(); | 
|---|
| 38 | $k=0; // Indice de la Matriz | 
|---|
| 39 |  | 
|---|
| 40 | $cadenaip=""; | 
|---|
| 41 | $idaula=0; | 
|---|
| 42 | $nombreaula=""; | 
|---|
| 43 | //________________________________________________________________________________________________________ | 
|---|
| 44 | $cmd=CreaComando($cadenaconexion); | 
|---|
| 45 | if (!$cmd) | 
|---|
| 46 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D. | 
|---|
| 47 | //________________________________________________________________________________________________________ | 
|---|
| 48 | ?> | 
|---|
| 49 | <HTML> | 
|---|
| 50 | <HEAD> | 
|---|
| 51 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 
|---|
| 52 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> | 
|---|
| 53 | </HEAD> | 
|---|
| 54 | <BODY OnContextMenu="return false"> | 
|---|
| 55 | <SCRIPT language="javascript" src="../clases/jscripts/ArbolVistaXML.js"></SCRIPT> | 
|---|
| 56 | <SCRIPT language="javascript" src="../clases/jscripts/MenuContextual.js"></SCRIPT> | 
|---|
| 57 | <SCRIPT language="javascript" src="../jscripts/aula.js"></SCRIPT> | 
|---|
| 58 | <SCRIPT language="javascript" src="../jscripts/aulas.js"></SCRIPT> | 
|---|
| 59 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> | 
|---|
| 60 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> | 
|---|
| 61 | <SCRIPT language="javascript" src="../jscripts/comunes.js"></SCRIPT> | 
|---|
| 62 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> | 
|---|
| 63 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comunes_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 64 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/aulas_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 65 | <?php | 
|---|
| 66 | //________________________________________________________________________________________________________ | 
|---|
| 67 | switch($litambito){ | 
|---|
| 68 | case $LITAMBITO_CENTROS : | 
|---|
| 69 | $ambito=$AMBITO_CENTROS; | 
|---|
| 70 | echo '<p align=center class=cabeceras>'.$TbMsg[22].'<br>'.$TbMsg[24].'<br><span class=subcabeceras>'.$nombreambito.'</span></p>'; | 
|---|
| 71 | $cmd->texto="SELECT idcentro,nombrecentro FROM centros WHERE idcentro=".$idambito; | 
|---|
| 72 | RecorreCentro($cmd); | 
|---|
| 73 | break; | 
|---|
| 74 | case $LITAMBITO_GRUPOSAULAS : | 
|---|
| 75 | $ambito=$AMBITO_GRUPOSAULAS; | 
|---|
| 76 | echo '<p align=center class=cabeceras>'.$TbMsg[22].'<br>'.$TbMsg[25].'<br><span class=subcabeceras>'.$nombreambito.'</span></p>'; | 
|---|
| 77 | $cmd->texto="SELECT idgrupo,nombregrupo FROM grupos WHERE tipo=".$AMBITO_GRUPOSAULAS." AND idgrupo=".$idambito; | 
|---|
| 78 | RecorreGruposAulas($cmd); | 
|---|
| 79 | break; | 
|---|
| 80 | case $LITAMBITO_AULAS : | 
|---|
| 81 | $ambito=$AMBITO_AULAS; | 
|---|
| 82 | $cmd->texto="SELECT idaula, nombreaula, idordprofesor FROM aulas WHERE idaula=".$idambito; | 
|---|
| 83 | RecorreAulas($cmd); | 
|---|
| 84 | break; | 
|---|
| 85 | case $LITAMBITO_GRUPOSORDENADORES : | 
|---|
| 86 | $ambito=$AMBITO_GRUPOSORDENADORES; | 
|---|
| 87 | echo '<p align=center class=cabeceras>'.$TbMsg[22].'<br>'.$TbMsg[26].'<br><span class=subcabeceras>'.$nombreambito.'</span></p>'; | 
|---|
| 88 | $cmd->texto="SELECT idgrupo,nombregrupoordenador FROM gruposordenadores WHERE idgrupo=".$idambito; | 
|---|
| 89 | RecorreGruposOrdenadores($cmd); | 
|---|
| 90 | pintaordenadores(); | 
|---|
| 91 | break; | 
|---|
| 92 | } | 
|---|
| 93 | ?> | 
|---|
| 94 | <FORM name="fcomandos" action="" method="post" target="frame_contenidos"> | 
|---|
| 95 | <INPUT type="hidden" name="idcomando" value=""> | 
|---|
| 96 | <INPUT type="hidden" name="descricomando" value=""> | 
|---|
| 97 | <INPUT type="hidden" name="ambito" value="<?php echo $ambito?>"> | 
|---|
| 98 | <INPUT type="hidden" name="idambito" value="<?php echo $idambito?>"> | 
|---|
| 99 | <INPUT type="hidden" name="nombreambito" value=""> | 
|---|
| 100 | <INPUT type="hidden" name="gestor" value=""> | 
|---|
| 101 | <INPUT type="hidden" name="funcion" value=""> | 
|---|
| 102 | <INPUT type="hidden" name="script" value=""> | 
|---|
| 103 | </FORM> | 
|---|
| 104 | <?php | 
|---|
| 105 | $flotante=new MenuContextual(); // Crea objeto menu contextual | 
|---|
| 106 | $XMLcontextual=ContextualXMLAulas();  // Crea contextual de aulas | 
|---|
| 107 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 108 | $XMLcontextual=ContextualXMLOrdenadores();  // Crea contextual de ordenadores | 
|---|
| 109 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 110 |  | 
|---|
| 111 | // Crea contextual de los comandos para los distintosn ámbitos | 
|---|
| 112 | $XMLcontextual=ContextualXMLComandos($LITAMBITO_AULAS,$AMBITO_AULAS); | 
|---|
| 113 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 114 | $XMLcontextual=ContextualXMLComandos($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES); | 
|---|
| 115 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 116 |  | 
|---|
| 117 | // Crea contextual de los asistentes para los distintosn ámbitos | 
|---|
| 118 | $XMLcontextual=ContextualXMLAsistentes($LITAMBITO_AULAS,$AMBITO_AULAS); | 
|---|
| 119 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 120 | $XMLcontextual=ContextualXMLAsistentes($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES); | 
|---|
| 121 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 122 |  | 
|---|
| 123 | // Crea contextual de los comandos para los distintos ámbitos | 
|---|
| 124 | $XMLcontextual=ContextualXMLSincronizacion($LITAMBITO_AULAS,$AMBITO_AULAS); | 
|---|
| 125 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 126 | $XMLcontextual=ContextualXMLSincronizacion($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES); | 
|---|
| 127 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 128 |  | 
|---|
| 129 | // Crea contextual de los comandos para los distintos �bitos | 
|---|
| 130 | $XMLcontextual=ContextualXMLDiferenciacion($LITAMBITO_AULAS,$AMBITO_AULAS); | 
|---|
| 131 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 132 | $XMLcontextual=ContextualXMLDiferenciacion($LITAMBITO_ORDENADORES,$AMBITO_ORDENADORES); | 
|---|
| 133 | echo $flotante->CreaMenuContextual($XMLcontextual); | 
|---|
| 134 |  | 
|---|
| 135 | ?> | 
|---|
| 136 | <SCRIPT language="javascript"> | 
|---|
| 137 | Sondeo(); | 
|---|
| 138 | </SCRIPT> | 
|---|
| 139 | </BODY> | 
|---|
| 140 | </HTML> | 
|---|
| 141 | <?php | 
|---|
| 142 | // ************************************************************************************************************************************************* | 
|---|
| 143 | function RecorreCentro($cmd){ | 
|---|
| 144 | global $AMBITO_GRUPOSAULAS; | 
|---|
| 145 | $rs=new Recordset; | 
|---|
| 146 | $rs->Comando=&$cmd; | 
|---|
| 147 | if (!$rs->Abrir()) return; // Error al abrir recordset | 
|---|
| 148 | $rs->Primero(); | 
|---|
| 149 | if(!$rs->EOF){ | 
|---|
| 150 | $idcentro=$rs->campos["idcentro"]; | 
|---|
| 151 | $cmd->texto="SELECT idgrupo,nombregrupo FROM grupos WHERE idcentro=".$idcentro." AND grupoid=0 AND tipo=".$AMBITO_GRUPOSAULAS." ORDER BY nombregrupo "; | 
|---|
| 152 | RecorreGruposAulas($cmd); | 
|---|
| 153 | $cmd->texto="SELECT idaula,nombreaula FROM aulas WHERE idcentro=".$idcentro." AND grupoid=0 ORDER BY nombreaula"; | 
|---|
| 154 | RecorreAulas($cmd); | 
|---|
| 155 | } | 
|---|
| 156 | $rs->Cerrar(); | 
|---|
| 157 | } | 
|---|
| 158 | //________________________________________________________________________________________________________ | 
|---|
| 159 | function RecorreGruposAulas($cmd){ | 
|---|
| 160 | global $AMBITO_GRUPOSAULAS; | 
|---|
| 161 | $rs=new Recordset; | 
|---|
| 162 | $rs->Comando=&$cmd; | 
|---|
| 163 | if (!$rs->Abrir()) return; // Error al abrir recordset | 
|---|
| 164 | $rs->Primero(); | 
|---|
| 165 | while (!$rs->EOF){ | 
|---|
| 166 | $idgrupo=$rs->campos["idgrupo"]; | 
|---|
| 167 | $cmd->texto="SELECT idgrupo,nombregrupo FROM grupos WHERE grupoid=".$idgrupo." AND tipo=".$AMBITO_GRUPOSAULAS." ORDER BY nombregrupo"; | 
|---|
| 168 | RecorreGruposAulas($cmd); | 
|---|
| 169 | $cmd->texto="SELECT idaula,nombreaula,idordprofesor FROM aulas WHERE  grupoid=".$idgrupo." ORDER BY nombreaula"; | 
|---|
| 170 | RecorreAulas($cmd); | 
|---|
| 171 | $rs->Siguiente(); | 
|---|
| 172 | } | 
|---|
| 173 | $rs->Cerrar(); | 
|---|
| 174 | } | 
|---|
| 175 | //________________________________________________________________________________________________________ | 
|---|
| 176 | function RecorreAulas($cmd){ | 
|---|
| 177 | global $idaula; | 
|---|
| 178 | global $nombreaula; | 
|---|
| 179 | global $idordprofesor; | 
|---|
| 180 | global $k; // Indice de la Matriz | 
|---|
| 181 | global $cadenaip; | 
|---|
| 182 |  | 
|---|
| 183 | $rs=new Recordset; | 
|---|
| 184 | $rs->Comando=&$cmd; | 
|---|
| 185 | if (!$rs->Abrir()) return; // Error al abrir recordset | 
|---|
| 186 | $rs->Primero(); | 
|---|
| 187 | while (!$rs->EOF){ | 
|---|
| 188 | $idaula=$rs->campos["idaula"]; | 
|---|
| 189 | $nombreaula=$rs->campos["nombreaula"]; | 
|---|
| 190 | $idordprofesor=(isset($rs->campos["idordprofesor"]) ? $rs->campos["idordprofesor"] : 0); | 
|---|
| 191 | $cmd->texto="SELECT idordenador,nombreordenador,ip,mac FROM ordenadores WHERE  idaula=".$idaula; | 
|---|
| 192 | $k=0; | 
|---|
| 193 | $cadenaip=""; | 
|---|
| 194 | RecorreOrdenadores($cmd); | 
|---|
| 195 | pintaordenadores(); | 
|---|
| 196 | $rs->Siguiente(); | 
|---|
| 197 | } | 
|---|
| 198 | $rs->Cerrar(); | 
|---|
| 199 | } | 
|---|
| 200 | //________________________________________________________________________________________________________ | 
|---|
| 201 | function RecorreGruposOrdenadores($cmd){ | 
|---|
| 202 | $rs=new Recordset; | 
|---|
| 203 | $rs->Comando=&$cmd; | 
|---|
| 204 | if (!$rs->Abrir()) return; // Error al abrir recordset | 
|---|
| 205 | $rs->Primero(); | 
|---|
| 206 | while (!$rs->EOF){ | 
|---|
| 207 | $idgrupo=$rs->campos["idgrupo"]; | 
|---|
| 208 | $cmd->texto="SELECT idgrupo,nombregrupoordenador FROM gruposOrdenadores WHERE grupoid=".$idgrupo." ORDER BY nombregrupoordenador"; | 
|---|
| 209 | RecorreGruposOrdenadores($cmd); | 
|---|
| 210 | $cmd->texto="SELECT idordenador,nombreordenador,ip,mac FROM ordenadores WHERE  grupoid=".$idgrupo; | 
|---|
| 211 | RecorreOrdenadores($cmd); | 
|---|
| 212 | $rs->Siguiente(); | 
|---|
| 213 | } | 
|---|
| 214 | $rs->Cerrar(); | 
|---|
| 215 | } | 
|---|
| 216 | //________________________________________________________________________________________________________ | 
|---|
| 217 | function RecorreOrdenadores($cmd){ | 
|---|
| 218 | global $Midordenador; | 
|---|
| 219 | global $Mnombreordenador; | 
|---|
| 220 | global $MimgOrdenador; | 
|---|
| 221 | global $Mip; | 
|---|
| 222 | global $Mmac; | 
|---|
| 223 | global $k; // Indice de la Matriz | 
|---|
| 224 |  | 
|---|
| 225 | global $cadenaip; | 
|---|
| 226 |  | 
|---|
| 227 | $cmd->texto.= " ORDER BY nombreordenador"; | 
|---|
| 228 | $rs=new Recordset; | 
|---|
| 229 | $rs->Comando=&$cmd; | 
|---|
| 230 | if (!$rs->Abrir()) return; // Error al abrir recordset | 
|---|
| 231 | $rs->Primero(); | 
|---|
| 232 |  | 
|---|
| 233 | while (!$rs->EOF){ | 
|---|
| 234 | $idordenador=$rs->campos["idordenador"]; | 
|---|
| 235 | $Midordenador[$k]=$rs->campos["idordenador"]; | 
|---|
| 236 | $Mnombreordenador[$k]=$rs->campos["nombreordenador"]; | 
|---|
| 237 | $MimgOrdenador[$k]="ordenador_OFF.png"; | 
|---|
| 238 | $Mip[$k]=$rs->campos["ip"]; | 
|---|
| 239 | $Mmac[$k]=$rs->campos["mac"]; | 
|---|
| 240 | $cadenaip.=$rs->campos["ip"].";"; | 
|---|
| 241 | $k++; | 
|---|
| 242 | $rs->Siguiente(); | 
|---|
| 243 | } | 
|---|
| 244 | $rs->Cerrar(); | 
|---|
| 245 | } | 
|---|
| 246 | //________________________________________________________________________________________________________ | 
|---|
| 247 | function pintaordenadores(){ | 
|---|
| 248 | global $AMBITO_AULAS; | 
|---|
| 249 | global $AMBITO_ORDENADORES; | 
|---|
| 250 | global $LITAMBITO_AULAS; | 
|---|
| 251 | global $LITAMBITO_ORDENADORES; | 
|---|
| 252 | global $LONCABECERA; | 
|---|
| 253 | global $Midordenador; | 
|---|
| 254 | global $Mnombreordenador; | 
|---|
| 255 | global $MimgOrdenador; | 
|---|
| 256 | global $Mip; | 
|---|
| 257 | global $Mmac; | 
|---|
| 258 | global $k; // Indice de la Matriz | 
|---|
| 259 | global $cadenaip; | 
|---|
| 260 | global $idaula; | 
|---|
| 261 | global $nombreaula; | 
|---|
| 262 | global $idordprofesor; | 
|---|
| 263 | global $servidorhidra,$hidraport; | 
|---|
| 264 | global $TbMsg; | 
|---|
| 265 |  | 
|---|
| 266 | $ntr=0; // Numero de ordenadores por fila | 
|---|
| 267 | if ($nombreaula!=""){ | 
|---|
| 268 | echo '<DIV>'; | 
|---|
| 269 | echo '<p align=center class=cabeceras><img  border=0 nod="'.$LITAMBITO_AULAS.'-'.$idaula.'" value="'.$nombreaula.'" | 
|---|
| 270 | style="cursor:pointer" src="../images/iconos/aula.gif" oncontextmenu="nwmenucontextual(this,' ."'flo_".$LITAMBITO_AULAS."'" .')" >  '.$TbMsg[23].'</br><span id="'.$LITAMBITO_AULAS.'-'.$idaula.'" class=subcabeceras>'.$nombreaula.'</span></p>'; | 
|---|
| 271 | } | 
|---|
| 272 | echo '<TABLE style="border: 1px solid #d4d0c8;" align="center"><TR>'; | 
|---|
| 273 | for($i=0;$i<$k;$i++){ // Vuelve a recorrer los datos de ordenadores para crear HTML | 
|---|
| 274 | $ntr++; | 
|---|
| 275 | echo '<TD>'; | 
|---|
| 276 | echo '<table border=0>'; | 
|---|
| 277 | echo '<tr>'; | 
|---|
| 278 | echo '  <td align=center width=70 height=40>'; | 
|---|
| 279 | echo '  <a href="#"><img  id="'.$Mip[$i].'" border=0 sondeo=""  nod="'.$LITAMBITO_ORDENADORES.'-'.$Midordenador[$i].'" | 
|---|
| 280 | value="'.$Mnombreordenador[$i].'" src="../images/'.$MimgOrdenador[$i].'" oncontextmenu="nwmenucontextual(this,'."'flo_".$LITAMBITO_ORDENADORES."'" .')"  width="32" height="32"></A>'; | 
|---|
| 281 | echo '  </td>'; | 
|---|
| 282 | echo '</tr>'; | 
|---|
| 283 | echo '<tr>'; | 
|---|
| 284 | echo '<td align=center  id="'.$LITAMBITO_ORDENADORES.'-'.$Midordenador[$i].'">'; | 
|---|
| 285 | echo '  <font color="#003300" size="1" face="Arial, Helvetica, sans-serif">'.$Mnombreordenador[$i].($Midordenador[$i]==$idordprofesor?' *':'').'</font>'; | 
|---|
| 286 | echo '  </br>'; | 
|---|
| 287 | echo '  <font color="#003300" size="1" face="Arial, Helvetica, sans-serif">'; | 
|---|
| 288 | echo '  <strong><font color="#D0A126">'.$Mip[$i].'</font></strong>'; | 
|---|
| 289 | echo '  </br>'; | 
|---|
| 290 | echo '  <font color="#003300" size="1" face="Arial, Helvetica, sans-serif">'.$Mmac[$i].'</font>'; | 
|---|
| 291 | echo '</td>'; | 
|---|
| 292 | echo '</tr>'; | 
|---|
| 293 | echo '</table>'; | 
|---|
| 294 | echo '</TD>'; | 
|---|
| 295 | if ($ntr>4){ | 
|---|
| 296 | $ntr=0; | 
|---|
| 297 | echo '</TR><TR>'; | 
|---|
| 298 | } | 
|---|
| 299 | } | 
|---|
| 300 | echo '</TABLE>'; | 
|---|
| 301 | echo '<p>'; | 
|---|
| 302 | echo '<table style="border: #d4d0c8 1px solid; background: #eeeeee" align="center">'; | 
|---|
| 303 | echo '  <tr align="center" valign="top">'; | 
|---|
| 304 | foreach (Array ("OPG", "WIN", "LNX", "OSX") as $status) { | 
|---|
| 305 | echo '    <td><img src="../images/ordenador_'.$status.'.png" alt="'.$status.'" width="24" /><br /><font color="#003300" size="1" face="Arial, Helvetica, sans-serif">'.$TbMsg["STATUS_$status"].'</font></td>'; | 
|---|
| 306 | } | 
|---|
| 307 | echo '  <tr align="center" valign="top">'; | 
|---|
| 308 | foreach (Array ("BSY", "WINS", "LNXS", "OFF") as $status) { | 
|---|
| 309 | echo '    <td><img src="../images/ordenador_'.$status.'.png" alt="'.$status.'" width="24" /><br /><font color="#003300" size="1" face="Arial, Helvetica, sans-serif">'.str_replace(" ", "<br>", $TbMsg["STATUS_$status"]).'</font></td>'; | 
|---|
| 310 | } | 
|---|
| 311 | echo '  </tr>'; | 
|---|
| 312 | echo '  </tr>'; | 
|---|
| 313 | echo '</table>'; | 
|---|
| 314 | if ($nombreaula!="") | 
|---|
| 315 | echo '</DIV>'; | 
|---|
| 316 | } | 
|---|
| 317 | //________________________________________________________________________________________________________ | 
|---|
| 318 | function ContextualXMLAulas(){ | 
|---|
| 319 | global $TbMsg; | 
|---|
| 320 | global $AMBITO_AULAS; | 
|---|
| 321 | global $LITAMBITO_AULAS; | 
|---|
| 322 | global $RESERVA_CONFIRMADA; | 
|---|
| 323 | global $OPERADOR; | 
|---|
| 324 |  | 
|---|
| 325 | $layerXML='<MENUCONTEXTUAL'; | 
|---|
| 326 | $layerXML.=' idctx="flo_'.$LITAMBITO_AULAS.'"'; | 
|---|
| 327 | $layerXML.=' maxanchu=185'; | 
|---|
| 328 | $layerXML.=' swimg=1'; | 
|---|
| 329 | $layerXML.=' clase="menu_contextual"'; | 
|---|
| 330 | $layerXML.='>'; | 
|---|
| 331 |  | 
|---|
| 332 | $layerXML.='<ITEM'; | 
|---|
| 333 | $layerXML.=' alpulsar="cola_acciones()"'; | 
|---|
| 334 | $layerXML.=' imgitem="../images/iconos/acciones.gif"'; | 
|---|
| 335 | $layerXML.=' textoitem='.$TbMsg[6]; | 
|---|
| 336 | $layerXML.='></ITEM>'; | 
|---|
| 337 |  | 
|---|
| 338 | $layerXML.='<SEPARADOR>'; | 
|---|
| 339 | $layerXML.='</SEPARADOR>'; | 
|---|
| 340 |  | 
|---|
| 341 |  | 
|---|
| 342 |  | 
|---|
| 343 | $layerXML.='<ITEM'; | 
|---|
| 344 | $layerXML.=' alpulsar="actualizar_ordenadores(this)"'; | 
|---|
| 345 | $layerXML.=' imgitem="../images/iconos/actualizar.gif"'; | 
|---|
| 346 | $layerXML.=' textoitem='.$TbMsg[4]; | 
|---|
| 347 | $layerXML.='></ITEM>'; | 
|---|
| 348 |  | 
|---|
| 349 | $layerXML.='<ITEM'; | 
|---|
| 350 | $layerXML.=' alpulsar="purgar_ordenadores()"'; | 
|---|
| 351 | $layerXML.=' imgitem="../images/iconos/purgar.gif"'; | 
|---|
| 352 | $layerXML.=' textoitem='.$TbMsg[2]; | 
|---|
| 353 | $layerXML.='></ITEM>'; | 
|---|
| 354 |  | 
|---|
| 355 | $layerXML.='<SEPARADOR>'; | 
|---|
| 356 | $layerXML.='</SEPARADOR>'; | 
|---|
| 357 |  | 
|---|
| 358 | $layerXML.='<ITEM'; | 
|---|
| 359 | $layerXML.=' alpulsar="consola_remota()"'; | 
|---|
| 360 | $layerXML.=' imgitem="../images/iconos/shell.gif"'; | 
|---|
| 361 | $layerXML.=' textoitem='.$TbMsg[33]; | 
|---|
| 362 | $layerXML.='></ITEM>'; | 
|---|
| 363 |  | 
|---|
| 364 | $layerXML.='<SEPARADOR>'; | 
|---|
| 365 | $layerXML.='</SEPARADOR>'; | 
|---|
| 366 |  | 
|---|
| 367 | $layerXML.='<ITEM'; | 
|---|
| 368 | $layerXML.=' subflotante="flo_comandos_'.$LITAMBITO_AULAS.'"'; | 
|---|
| 369 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 370 | $layerXML.=' textoitem='.$TbMsg[5]; | 
|---|
| 371 | $layerXML.='></ITEM>'; | 
|---|
| 372 |  | 
|---|
| 373 | $layerXML.='<ITEM'; | 
|---|
| 374 | $layerXML.=' subflotante="flo_sincronizacion_'.$LITAMBITO_AULAS.'"'; | 
|---|
| 375 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 376 | $layerXML.=' textoitem='.$TbMsg[49]; | 
|---|
| 377 | $layerXML.='></ITEM>'; | 
|---|
| 378 |  | 
|---|
| 379 | $layerXML.='<ITEM'; | 
|---|
| 380 | $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_AULAS.'"'; | 
|---|
| 381 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 382 | $layerXML.=' textoitem='.$TbMsg[38]; | 
|---|
| 383 | $layerXML.='></ITEM>'; | 
|---|
| 384 |  | 
|---|
| 385 | $layerXML.='<SEPARADOR>'; | 
|---|
| 386 | $layerXML.='</SEPARADOR>'; | 
|---|
| 387 |  | 
|---|
| 388 | $layerXML.='<ITEM'; | 
|---|
| 389 | $layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_AULAS.')"'; | 
|---|
| 390 | $layerXML.=' imgitem="../images/iconos/procedimiento.gif"'; | 
|---|
| 391 | $layerXML.=' textoitem='.$TbMsg[28]; | 
|---|
| 392 | $layerXML.='></ITEM>'; | 
|---|
| 393 |  | 
|---|
| 394 | $layerXML.='<SEPARADOR>'; | 
|---|
| 395 | $layerXML.='</SEPARADOR>'; | 
|---|
| 396 |  | 
|---|
| 397 | $layerXML.='<ITEM'; | 
|---|
| 398 | $layerXML.=' alpulsar="incorporarordenador()"'; | 
|---|
| 399 | $layerXML.=' imgitem="../images/iconos/aula.gif"'; | 
|---|
| 400 | $layerXML.=' textoitem='.$TbMsg[27]; | 
|---|
| 401 | $layerXML.='></ITEM>'; | 
|---|
| 402 |  | 
|---|
| 403 | $layerXML.='<ITEM'; | 
|---|
| 404 | $layerXML.=' alpulsar="ordenador_estandar()"'; | 
|---|
| 405 | $layerXML.=' imgitem="../images/iconos/ordenadores.gif"'; | 
|---|
| 406 | $layerXML.=' textoitem='.$TbMsg[12]; | 
|---|
| 407 | $layerXML.='></ITEM>'; | 
|---|
| 408 |  | 
|---|
| 409 | $layerXML.='<SEPARADOR>'; | 
|---|
| 410 | $layerXML.='</SEPARADOR>'; | 
|---|
| 411 |  | 
|---|
| 412 | $layerXML.='<ITEM'; | 
|---|
| 413 | $layerXML.=' alpulsar="configuraciones('.$AMBITO_AULAS.')"'; | 
|---|
| 414 | $layerXML.=' textoitem='.$TbMsg[10]; | 
|---|
| 415 | $layerXML.=' imgitem="../images/iconos/configuraciones.gif"'; | 
|---|
| 416 | $layerXML.='></ITEM>'; | 
|---|
| 417 |  | 
|---|
| 418 | $wLeft=170; | 
|---|
| 419 | $wTop=80; | 
|---|
| 420 | $wWidth=480; | 
|---|
| 421 | $wHeight=480; | 
|---|
| 422 | $wpages="../propiedades/propiedades_aulas.php"; | 
|---|
| 423 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
| 424 | $layerXML.='<ITEM'; | 
|---|
| 425 | $layerXML.=' alpulsar="modificar('.$wParam.')"'; | 
|---|
| 426 | $layerXML.=' textoitem='.$TbMsg[13]; | 
|---|
| 427 | $layerXML.=' imgitem="../images/iconos/propiedades.gif"'; | 
|---|
| 428 | $layerXML.='></ITEM>'; | 
|---|
| 429 |  | 
|---|
| 430 | $layerXML.='<SEPARADOR>'; | 
|---|
| 431 | $layerXML.='</SEPARADOR>'; | 
|---|
| 432 |  | 
|---|
| 433 | // Crear operador | 
|---|
| 434 | $wLeft=140; | 
|---|
| 435 | $wTop=115; | 
|---|
| 436 | $wWidth=400; | 
|---|
| 437 | $wHeight=320; | 
|---|
| 438 | $wpages="../propiedades/propiedades_usuarios.php?idtipousuario=".$OPERADOR; | 
|---|
| 439 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
| 440 | $layerXML.='<ITEM'; | 
|---|
| 441 | $layerXML.=' alpulsar="insertar('.$wParam.',3)"'; | 
|---|
| 442 | $layerXML.=' imgitem="../images/iconos/operadores.gif"'; | 
|---|
| 443 | $layerXML.=' textoitem='.$TbMsg[37]; | 
|---|
| 444 | $layerXML.='></ITEM>'; | 
|---|
| 445 |  | 
|---|
| 446 | $layerXML.='<ITEM'; | 
|---|
| 447 | $layerXML.=' alpulsar="cola_reservas('.$RESERVA_CONFIRMADA.')"'; | 
|---|
| 448 | $layerXML.=' imgitem="../images/iconos/reservas.gif"'; | 
|---|
| 449 | $layerXML.=' textoitem='.$TbMsg[29]; | 
|---|
| 450 | $layerXML.='></ITEM>'; | 
|---|
| 451 | $layerXML.='<SEPARADOR>'; | 
|---|
| 452 | $layerXML.='</SEPARADOR>'; | 
|---|
| 453 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 454 | return($layerXML); | 
|---|
| 455 | } | 
|---|
| 456 | //________________________________________________________________________________________________________ | 
|---|
| 457 | function ContextualXMLOrdenadores(){ | 
|---|
| 458 | global $TbMsg; | 
|---|
| 459 | global $AMBITO_ORDENADORES; | 
|---|
| 460 | global $LITAMBITO_ORDENADORES; | 
|---|
| 461 |  | 
|---|
| 462 | $layerXML='<MENUCONTEXTUAL'; | 
|---|
| 463 | $layerXML.=' idctx="flo_'.$LITAMBITO_ORDENADORES.'"'; | 
|---|
| 464 | $layerXML.=' maxanchu=140'; | 
|---|
| 465 | $layerXML.=' swimg=1'; | 
|---|
| 466 | $layerXML.=' clase="menu_contextual"'; | 
|---|
| 467 | $layerXML.='>'; | 
|---|
| 468 |  | 
|---|
| 469 | $layerXML.='<ITEM'; | 
|---|
| 470 | $layerXML.=' alpulsar="cola_acciones()"'; | 
|---|
| 471 | $layerXML.=' imgitem="../images/iconos/acciones.gif"'; | 
|---|
| 472 | $layerXML.=' textoitem='.$TbMsg[6]; | 
|---|
| 473 | $layerXML.='></ITEM>'; | 
|---|
| 474 |  | 
|---|
| 475 | $layerXML.='<SEPARADOR>'; | 
|---|
| 476 | $layerXML.='</SEPARADOR>'; | 
|---|
| 477 |  | 
|---|
| 478 | $layerXML.='<ITEM'; | 
|---|
| 479 | $layerXML.=' alpulsar="ver_log('.$AMBITO_ORDENADORES.')"'; | 
|---|
| 480 | $layerXML.=' imgitem="../images/iconos/acciones.gif"'; | 
|---|
| 481 | $layerXML.=' textoitem='.$TbMsg[47]; | 
|---|
| 482 | $layerXML.='></ITEM>'; | 
|---|
| 483 |  | 
|---|
| 484 | $layerXML.='<ITEM'; | 
|---|
| 485 | $layerXML.=' alpulsar="ver_log_seguimiento('.$AMBITO_ORDENADORES.')"'; | 
|---|
| 486 | $layerXML.=' imgitem="../images/iconos/acciones.gif"'; | 
|---|
| 487 | $layerXML.=' textoitem='.$TbMsg[48]; | 
|---|
| 488 | $layerXML.='></ITEM>'; | 
|---|
| 489 |  | 
|---|
| 490 | $layerXML.='<ITEM'; | 
|---|
| 491 | $layerXML.=' alpulsar="actualizar_ordenadores()"'; | 
|---|
| 492 | $layerXML.=' imgitem="../images/iconos/actualizar.gif"'; | 
|---|
| 493 | $layerXML.=' textoitem='.$TbMsg[4]; | 
|---|
| 494 | $layerXML.='></ITEM>'; | 
|---|
| 495 |  | 
|---|
| 496 | $layerXML.='<ITEM'; | 
|---|
| 497 | $layerXML.=' alpulsar="purgar_ordenadores()"'; | 
|---|
| 498 | $layerXML.=' imgitem="../images/iconos/purgar.gif"'; | 
|---|
| 499 | $layerXML.=' textoitem='.$TbMsg[2]; | 
|---|
| 500 | $layerXML.='></ITEM>'; | 
|---|
| 501 |  | 
|---|
| 502 | $layerXML.='<SEPARADOR>'; | 
|---|
| 503 | $layerXML.='</SEPARADOR>'; | 
|---|
| 504 |  | 
|---|
| 505 | $layerXML.='<ITEM'; | 
|---|
| 506 | $layerXML.=' alpulsar="consola_remota()"'; | 
|---|
| 507 | $layerXML.=' imgitem="../images/iconos/shell.gif"'; | 
|---|
| 508 | $layerXML.=' textoitem='.$TbMsg[33]; | 
|---|
| 509 | $layerXML.='></ITEM>'; | 
|---|
| 510 |  | 
|---|
| 511 | $layerXML.='<ITEM'; | 
|---|
| 512 | $layerXML.=' alpulsar="eco_remoto()"'; | 
|---|
| 513 | $layerXML.=' imgitem="../images/iconos/ecocon.gif"'; | 
|---|
| 514 | $layerXML.=' textoitem='.$TbMsg[39]; | 
|---|
| 515 | $layerXML.='></ITEM>'; | 
|---|
| 516 |  | 
|---|
| 517 | $layerXML.='<SEPARADOR>'; | 
|---|
| 518 | $layerXML.='</SEPARADOR>'; | 
|---|
| 519 |  | 
|---|
| 520 | $layerXML.='<ITEM'; | 
|---|
| 521 | $layerXML.=' subflotante="flo_comandos_'.$LITAMBITO_ORDENADORES.'"'; | 
|---|
| 522 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 523 | $layerXML.=' textoitem='.$TbMsg[5]; | 
|---|
| 524 | $layerXML.='></ITEM>'; | 
|---|
| 525 |  | 
|---|
| 526 | $layerXML.='<ITEM'; | 
|---|
| 527 | $layerXML.=' subflotante="flo_sincronizacion_'.$LITAMBITO_ORDENADORES.'"'; | 
|---|
| 528 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 529 | $layerXML.=' textoitem='.$TbMsg[49]; | 
|---|
| 530 | $layerXML.='></ITEM>'; | 
|---|
| 531 |  | 
|---|
| 532 | $layerXML.='<ITEM'; | 
|---|
| 533 | $layerXML.=' subflotante="flo_asistentes_'.$LITAMBITO_ORDENADORES.'"'; | 
|---|
| 534 | $layerXML.=' imgitem="../images/iconos/comandos.gif"'; | 
|---|
| 535 | $layerXML.=' textoitem='.$TbMsg[38]; | 
|---|
| 536 | $layerXML.='></ITEM>'; | 
|---|
| 537 |  | 
|---|
| 538 | $layerXML.='<SEPARADOR>'; | 
|---|
| 539 | $layerXML.='</SEPARADOR>'; | 
|---|
| 540 |  | 
|---|
| 541 | $layerXML.='<ITEM'; | 
|---|
| 542 | $layerXML.=' alpulsar="confirmarprocedimiento('.$AMBITO_ORDENADORES.')"'; | 
|---|
| 543 | $layerXML.=' imgitem="../images/iconos/procedimiento.gif"'; | 
|---|
| 544 | $layerXML.=' textoitem='.$TbMsg[28]; | 
|---|
| 545 | $layerXML.='></ITEM>'; | 
|---|
| 546 |  | 
|---|
| 547 | $layerXML.='<SEPARADOR>'; | 
|---|
| 548 | $layerXML.='</SEPARADOR>'; | 
|---|
| 549 |  | 
|---|
| 550 | $layerXML.='<ITEM'; | 
|---|
| 551 | $layerXML.=' alpulsar="configuraciones('.$AMBITO_ORDENADORES.')"'; | 
|---|
| 552 | $layerXML.=' textoitem='.$TbMsg[10]; | 
|---|
| 553 | $layerXML.=' imgitem="../images/iconos/configuraciones.gif"'; | 
|---|
| 554 | $layerXML.='></ITEM>'; | 
|---|
| 555 |  | 
|---|
| 556 | $wLeft=170; | 
|---|
| 557 | $wTop=80; | 
|---|
| 558 | $wWidth=480; | 
|---|
| 559 | $wHeight=400; | 
|---|
| 560 | $wpages="../propiedades/propiedades_ordenadores.php"; | 
|---|
| 561 | $wParam=$wLeft .",".$wTop.",".$wWidth.",".$wHeight.",'". $wpages."'"; | 
|---|
| 562 | $layerXML.='<ITEM'; | 
|---|
| 563 | $layerXML.=' alpulsar="modificar('.$wParam.')"'; | 
|---|
| 564 |  | 
|---|
| 565 | $layerXML.=' textoitem='.$TbMsg[13]; | 
|---|
| 566 | $layerXML.=' imgitem="../images/iconos/propiedades.gif"'; | 
|---|
| 567 | $layerXML.='></ITEM>'; | 
|---|
| 568 |  | 
|---|
| 569 | $layerXML.='<ITEM'; | 
|---|
| 570 | $layerXML.=' alpulsar="eliminar('.$wParam.')"'; | 
|---|
| 571 | $layerXML.=' imgitem="../images/iconos/eliminar.gif"'; | 
|---|
| 572 | $layerXML.=' textoitem='.$TbMsg[18]; | 
|---|
| 573 | $layerXML.='></ITEM>'; | 
|---|
| 574 |  | 
|---|
| 575 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 576 | return($layerXML); | 
|---|
| 577 | } | 
|---|
| 578 | //________________________________________________________________________________________________________ | 
|---|
| 579 | function ContextualXMLComandos($litambito,$ambito){ | 
|---|
| 580 | global $cmd; | 
|---|
| 581 | global $TbMsg; | 
|---|
| 582 | $maxlongdescri=0; | 
|---|
| 583 | $rs=new Recordset; | 
|---|
| 584 | $cmd->texto="SELECT  idcomando,descripcion,pagina,gestor,funcion | 
|---|
| 585 | FROM comandos | 
|---|
| 586 | WHERE activo=1 AND submenu='' AND aplicambito & ".$ambito.">0 | 
|---|
| 587 | ORDER BY descripcion"; | 
|---|
| 588 | $rs->Comando=&$cmd; | 
|---|
| 589 | if ($rs->Abrir()){ | 
|---|
| 590 | $layerXML=""; | 
|---|
| 591 | $rs->Primero(); | 
|---|
| 592 | while (!$rs->EOF){ | 
|---|
| 593 | $descrip=$TbMsg["COMMAND_".$rs->campos["funcion"]]; | 
|---|
| 594 | if (empty ($descrip)) { | 
|---|
| 595 | $descrip=$rs->campos["descripcion"]; | 
|---|
| 596 | } | 
|---|
| 597 | $layerXML.='<ITEM'; | 
|---|
| 598 | $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"'; | 
|---|
| 599 | $layerXML.=' textoitem="'.$descrip.'"'; | 
|---|
| 600 | $layerXML.='></ITEM>'; | 
|---|
| 601 | if ($maxlongdescri < strlen($descrip)) // Toma la Descripción de mayor longitud | 
|---|
| 602 | $maxlongdescri=strlen($descrip); | 
|---|
| 603 | $rs->Siguiente(); | 
|---|
| 604 | } | 
|---|
| 605 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 606 | $prelayerXML='<MENUCONTEXTUAL'; | 
|---|
| 607 | $prelayerXML.=' idctx="flo_comandos_'.$litambito.'"'; | 
|---|
| 608 | $prelayerXML.=' maxanchu='.$maxlongdescri*7; | 
|---|
| 609 | $prelayerXML.=' clase="menu_contextual"'; | 
|---|
| 610 | $prelayerXML.='>'; | 
|---|
| 611 | $finallayerXML=$prelayerXML.$layerXML; | 
|---|
| 612 | return($finallayerXML); | 
|---|
| 613 | } | 
|---|
| 614 | } | 
|---|
| 615 | //________________________________________________________________________________________________________ | 
|---|
| 616 | function ContextualXMLSincronizacion($litambito,$ambito){ | 
|---|
| 617 | global $cmd; | 
|---|
| 618 | global $TbMsg; | 
|---|
| 619 | $maxlongdescri=0; | 
|---|
| 620 | $rs=new Recordset; | 
|---|
| 621 | $cmd->texto="SELECT  idcomando,descripcion,pagina,gestor,funcion | 
|---|
| 622 | FROM comandos | 
|---|
| 623 | WHERE activo=1 AND submenu='Sincronizacion' AND aplicambito & ".$ambito.">0 | 
|---|
| 624 | ORDER BY descripcion"; | 
|---|
| 625 | $rs->Comando=&$cmd; | 
|---|
| 626 | if ($rs->Abrir()){ | 
|---|
| 627 | $layerXML=""; | 
|---|
| 628 | $rs->Primero(); | 
|---|
| 629 | while (!$rs->EOF){ | 
|---|
| 630 | $descrip=$TbMsg["COMMAND_".$rs->campos["funcion"]]; | 
|---|
| 631 | if (empty ($descrip)) { | 
|---|
| 632 | $descrip=$rs->campos["descripcion"]; | 
|---|
| 633 | } | 
|---|
| 634 | $layerXML.='<ITEM'; | 
|---|
| 635 | $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"'; | 
|---|
| 636 | $layerXML.=' textoitem="'.$descrip.'"'; | 
|---|
| 637 | $layerXML.='></ITEM>'; | 
|---|
| 638 | if ($maxlongdescri < strlen($descrip)) // Toma la Descripción de mayor longitud | 
|---|
| 639 | $maxlongdescri=strlen($descrip); | 
|---|
| 640 | $rs->Siguiente(); | 
|---|
| 641 | } | 
|---|
| 642 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 643 | $prelayerXML='<MENUCONTEXTUAL'; | 
|---|
| 644 | $prelayerXML.=' idctx="flo_sincronizacion_'.$litambito.'"'; | 
|---|
| 645 | $prelayerXML.=' maxanchu='.$maxlongdescri*7; | 
|---|
| 646 | $prelayerXML.=' clase="menu_contextual"'; | 
|---|
| 647 | $prelayerXML.='>'; | 
|---|
| 648 | $finallayerXML=$prelayerXML.$layerXML; | 
|---|
| 649 | return($finallayerXML); | 
|---|
| 650 | } | 
|---|
| 651 | } | 
|---|
| 652 | //________________________________________________________________________________________________________ | 
|---|
| 653 | function ContextualXMLDiferenciacion($litambito,$ambito){ | 
|---|
| 654 | global $cmd; | 
|---|
| 655 | global $TbMsg; | 
|---|
| 656 | $maxlongdescri=0; | 
|---|
| 657 | $rs=new Recordset; | 
|---|
| 658 | $cmd->texto="SELECT  idcomando,descripcion,pagina,gestor,funcion | 
|---|
| 659 | FROM comandos | 
|---|
| 660 | WHERE activo=1 AND submenu='diferenciacion' AND aplicambito & ".$ambito.">0 | 
|---|
| 661 | ORDER BY descripcion"; | 
|---|
| 662 | $rs->Comando=&$cmd; | 
|---|
| 663 | if ($rs->Abrir()){ | 
|---|
| 664 | $layerXML=""; | 
|---|
| 665 | $rs->Primero(); | 
|---|
| 666 | while (!$rs->EOF){ | 
|---|
| 667 | $descrip=$TbMsg["COMMAND_".$rs->campos["funcion"]]; | 
|---|
| 668 | if (empty ($descrip)) { | 
|---|
| 669 | $descrip=$rs->campos["descripcion"]; | 
|---|
| 670 | } | 
|---|
| 671 | $layerXML.='<ITEM'; | 
|---|
| 672 | $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"'; | 
|---|
| 673 | $layerXML.=' textoitem="'.$descrip.'"'; | 
|---|
| 674 | $layerXML.='></ITEM>'; | 
|---|
| 675 | if ($maxlongdescri < strlen($descrip)) // Toma la Descripción de mayor longitud | 
|---|
| 676 | $maxlongdescri=strlen($descrip); | 
|---|
| 677 | $rs->Siguiente(); | 
|---|
| 678 | } | 
|---|
| 679 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 680 | $prelayerXML='<MENUCONTEXTUAL'; | 
|---|
| 681 | $prelayerXML.=' idctx="flo_diferenciacion_'.$litambito.'"'; | 
|---|
| 682 | $prelayerXML.=' maxanchu='.$maxlongdescri*6; | 
|---|
| 683 | $prelayerXML.=' clase="menu_contextual"'; | 
|---|
| 684 | $prelayerXML.='>'; | 
|---|
| 685 | $finallayerXML=$prelayerXML.$layerXML; | 
|---|
| 686 | return($finallayerXML); | 
|---|
| 687 | } | 
|---|
| 688 | } | 
|---|
| 689 | //________________________________________________________________________________________________________ | 
|---|
| 690 | function ContextualXMLAsistentes($litambito,$ambito){ | 
|---|
| 691 | global $cmd; | 
|---|
| 692 | global $TbMsg; | 
|---|
| 693 | $maxlongdescri=0; | 
|---|
| 694 | $rs=new Recordset; | 
|---|
| 695 | $cmd->texto="SELECT  idcomando,descripcion,pagina,gestor,funcion | 
|---|
| 696 | FROM asistentes | 
|---|
| 697 | WHERE activo=1 AND aplicambito & ".$ambito.">0 | 
|---|
| 698 | ORDER BY descripcion"; | 
|---|
| 699 | $rs->Comando=&$cmd; | 
|---|
| 700 | if ($rs->Abrir()){ | 
|---|
| 701 | $layerXML=""; | 
|---|
| 702 | $rs->Primero(); | 
|---|
| 703 | while (!$rs->EOF){ | 
|---|
| 704 | $descrip=$TbMsg["WIZARD_".$rs->campos["descripcion"]]; | 
|---|
| 705 | if (empty ($descrip)) { | 
|---|
| 706 | $descrip=$rs->campos["descripcion"]; | 
|---|
| 707 | } | 
|---|
| 708 | $layerXML.='<ITEM'; | 
|---|
| 709 | $layerXML.=' alpulsar="confirmarcomando('."'".$ambito."'".','.$rs->campos["idcomando"].',\''.$rs->campos["descripcion"].'\',\''.$rs->campos["pagina"]. '\',\''.$rs->campos["gestor"]. '\',\''.$rs->campos["funcion"]. '\')"'; | 
|---|
| 710 | $layerXML.=' textoitem="'.$descrip.'"'; | 
|---|
| 711 | $layerXML.='></ITEM>'; | 
|---|
| 712 | if($maxlongdescri<strlen($descrip)) // Toma la Descripción de mayor longitud | 
|---|
| 713 | $maxlongdescri=strlen($descrip); | 
|---|
| 714 | $rs->Siguiente(); | 
|---|
| 715 | } | 
|---|
| 716 | $layerXML.='</MENUCONTEXTUAL>'; | 
|---|
| 717 | $prelayerXML='<MENUCONTEXTUAL'; | 
|---|
| 718 | $prelayerXML.=' idctx="flo_asistentes_'.$litambito.'"'; | 
|---|
| 719 | $prelayerXML.=' maxanchu='.$maxlongdescri*7; | 
|---|
| 720 | $prelayerXML.=' clase="menu_contextual"'; | 
|---|
| 721 | $prelayerXML.='>'; | 
|---|
| 722 | $finallayerXML=$prelayerXML.$layerXML; | 
|---|
| 723 | return($finallayerXML); | 
|---|
| 724 | } | 
|---|
| 725 | } | 
|---|