.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $G_TABLE;
global $G_CONTENT;
global $collapsed;
global $URI_VARS;
global $dbc;
global $ses;
global $pathViewChart;
global $appid;
$appid = $_SESSION['CURRENT_APPLICATION'];
$pathViewChart = "";
$nodo = isset($_GET[0])?$_GET[0]:'';
if ( ! session_is_registered ("CHART_COLLAPSED") ) $_SESSION['CHART_COLLAPSED'] = Array ();
$collapsed = $_SESSION['CHART_COLLAPSED'];
if ( in_array ( $nodo, $collapsed) )
$collapsed [ array_search ($nodo, $collapsed) ] = NULL;
else
array_push ( $collapsed, $nodo);
$_SESSION['CHART_COLLAPSED'] = $collapsed;
//Obtener nombre de la applicacion
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME );
G::LoadClassRBAC ('applications');
$obj = new RBAC_Application;
$obj->SetTo ($dbc);
$obj->Load ($appid);
$_SESSION['STR_APP'] = $obj->Fields['APP_CODE'];;
$appCode = G::LoadMessage (11);
print "
$appCode";
$ses = new DBSession;
$ses->SetTo ($dbc);
function showLevel ( $i, $label1, $texto1, $texto2, $uid) {
global $pathViewChart;
global $collapsed;
global $appid;
global $dbc;
global $canCreateRole;
$MAX_LEVEL = 10;
$ses = new DBSession;
$ses->SetTo ($dbc);
$sql = "SELECT count(*) as CANT from ROLE WHERE ROL_APPLICATION = $appid AND ROL_PARENT = $uid ";
$dset = $ses->Execute($sql);
$row = $dset->Read();
$rolStatus = $row['CANT'];
$icon = "browse";
if ($row['CANT'] > 0 ) $icon = "minus";
if ( in_array ( $uid, $collapsed) ) $icon = "plus";
$link = "
";
if ($icon != "browse" )
$link = "
";
print "";
for ( $j = 1; $j <= $i; $j ++)
print " | ";
print "" . $link . " | ";
print "";
print " ";
if ($canCreateRole == 1)
print "" . $texto1 ."";
else
print "$texto1";
print " " . $texto2 . " ";
print " ";
if ($canCreateRole == 1) {
print " ";
if ($icon == "browse" )
print " ";
}
print " | ";
print "
";
}
function walkLevel ( $level, $label, $parent ) {
global $collapsed;
global $appid;
global $dbc;
$ses = new DBSession;
$ses->SetTo ($dbc);
$sql = "SELECT UID, ROL_CODE, ROL_DESCRIPTION from ROLE WHERE ROL_APPLICATION = $appid AND ROL_PARENT = " . $parent ;
$dset = $ses->Execute($sql);
$row = $dset->Read();
$c = 1;
while ( is_array ($row) ) {
if ($label === "*" )
{ $label = ""; $locLabel = $c; }
else
$locLabel = $label . "." . $c;
showLevel ( $level , $locLabel, $row['ROL_CODE'], $row['ROL_DESCRIPTION'], $row['UID'] );
if ( ! in_array ( $row['UID'], $collapsed) )
walkLevel ( $level + 1, $locLabel, $row['UID']);
$c++;
$row = $dset->Read();
}
}
?>
| /*$G_CONTENT->Output ("body.header");*/ ?> |
|
|