X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/e59d3170b36e5b9ccc19afcb1565faf4dcb40463..0094ad49f963f1aec143e5b8f375ecd5a5c69445:/sistema/www/sistemas.php diff --git a/sistema/www/sistemas.php b/sistema/www/sistemas.php index 98512a8..4c81300 100644 --- a/sistema/www/sistemas.php +++ b/sistema/www/sistemas.php @@ -54,13 +54,27 @@ $t->addRow($fila); $db = IntranetDB::connect(); $sistemas = AI_Sistema::getSistemas($db); -//$pct = intval(100/COLUMNAS) . '%'; +// Me fijo que sistemas puede ver este usuario. +require_once 'SAMURAI/Perm.php'; +$perm = new SAMURAI_Perm($_SESSION['usuario'], 0, $db); +foreach ($sistemas as $i => $s) { + // Si no tiene permisos para el sistema, lo saco de la lista. + $perm->setSistema($s->sistema); + if (!$perm->tiene()) { + unset($sistemas[$i]); + } +} + $sistema = @array_shift($sistemas); while ($sistema) { $row = array(); for ($j = 1; $j <= COLUMNAS; $j++) { if ($sistema) { - $row[] = new MECON_HTML_Image( + $url = $sistema->link; + if ($sistema->tipo == 'embperl') { + $url = '/Php2Embperl_Session?redirect=' . urlencode($url); + } + $img = new MECON_HTML_Image( "/sistemas/intranet/images/$sistema->icono", $sistema->nombre, array( @@ -69,12 +83,26 @@ while ($sistema) { 'height' => '46', ) ); + $row[] = new MECON_HTML_Link( + $url, + $img, + array(), + array( + 'OnClick' => + "javascript:window.open('$url','s{$sistema->sistema}'," + . "'width=800,height=600,scrollbars=yes');return false;", + 'target' => '_blank', + ) + ); $row[] = ' '; $link = new MECON_HTML_Link( - $sistema->link, + $url, $sistema->nombre, array(), array( + 'OnClick' => + "javascript:window.open('$url','s{$sistema->sistema}'," + . "'width=800,height=600,scrollbars=yes');return false;", 'target' => '_blank', 'class' => 'intranet_sistemas_txt', ) @@ -91,8 +119,11 @@ while ($sistema) { $img, array(), array( + 'OnClick' => + "javascript:window.open('{$sistema->link_ayuda}'," + . "'sa{$sistema->sistema}'," + . "'width=800,height=600,scrollbars=yes');return false;", 'target' => '_blank', - 'class' => 'intranet_sistemas_txt', ) ); $html .= $link->toHtml(); @@ -116,19 +147,13 @@ $m = new HTML_DietMarco('sistemas', 'Sistemas'); $m->addTitle('Sistemas'); $m->addStyleDeclaration(' .intranet_sistemas_txt { - COLOR: #003366; - FONT-FAMILY: Arial, Helvetica, sans-serif; - FONT-SIZE: 10pt; - FONT-WEIGHT: normal; - font-style: normal; - line-height: normal; - background-position: left centre; - text-align: left; - vertical-align: middle; - text-decoration: none; + color: #003366; + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; } A.intranet_sistemas_txt { font-weight: bold; + text-decoration: none; }' ); $m->addBodyContent($t);