示例#1
0
文件: viewrole.php 项目: n2i/xvnkb
<?php

$AppUI->savePlace();
$perms =& $AppUI->acl();
$role_id = $_GET['role_id'];
$role = $perms->getRole($role_id);
if (isset($_GET['tab'])) {
    $AppUI->setState('RoleVwTab', $_GET['tab']);
}
$tab = $AppUI->getState('RoleVwTab') !== NULL ? $AppUI->getState('RoleVwTab') : 0;
if (!is_array($role)) {
    $titleBlock = new CTitleBlock('Invalid Role', 'roles-settings.png');
    $titleBlock->addButton('role list', '?m=system&u=roles');
    $titleBlcok->show();
} else {
    $titleBlock = new CTitleBlock('View Role', 'roles-settings.png');
    $titleBlock->addButton('role list', '?m=system&u=roles');
    $titleBlock->show();
    $tabBox = new CTabBox("?m=system&u=roles&a=viewrole&role_id={$role_id}", $tab);
    $tabBox->add('vw_role_perms', 'Permissions');
    $tabBox->setInfo('<table border="0" cellpadding="4" cellspacing="0" width="100%" class="internal">' . '<tr>' . '<td align="right" nowrap><b>' . $AppUI->_('Role ID') . ':</b></td>' . '<td width="100%">' . $role['value'] . '</td>' . '<td rowspan="2"><input type="button" value="' . $AppUI->_('Add permission') . '" onclick="doAddPermission()"></td>' . '</tr>' . '<tr>' . '<td align="right"><b>' . $AppUI->_('Description') . ':</b></td>' . '<td width="100%">' . $AppUI->_($role['name']) . '</td>' . '</tr>' . '</table>');
    $tabBox->show();
}
// End of check for valid role
示例#2
0
文件: index.php 项目: n2i/xvnkb
$handler = $tab == 0 && $psfilter != P_ALL ? 'class="filter" onclick="changeFilter(' . P_ALL . ')"' : 'class="status"';
$info = '<div id="idOtherTypes" style="position: absolute; display: none; visibility: hidden">' . ($tab == 0 ? '<table id="idOtherList" class="list" width="90px">' . '<tr><td class="last"><b>Other status</b></td></tr>' . $other_list . '</table>' : '') . '</div>' . '<table class="tabstatus" border="0" cellpadding="0" cellspacing="2" width="100%">' . '<tr>' . '<td ' . $handler . '>Total:</td>' . '<td class="value">' . count($projects) . '</td>' . $statistic . '<td align="right" width="100%">&nbsp;</td>' . '<td class="filter" onclick="showOthers(this)" nowrap="nowrap">' . $indicator . 'Others:</td><td>' . $others . '</td>' . '<td>&nbsp;</td>' . '</tr>' . '</table>';
function pfilter($p)
{
    global $perms, $psfilter;
    if (!$perms->checkModuleItem('projects', 'view', $p['project_id'])) {
        return false;
    }
    return $psfilter == P_ALL || $p["project_status"] == $psfilter;
}
$tabBox = new CTabBox('?m=projects', $tab);
//$tabBox->add($viewers[$psfilter], $pstatus[$psfilter] . ' Projects');
$tabBox->add('vw_idx_active', $pstatus[$psfilter] . ' Projects');
$min_view = true;
$tabBox->add('viewgantt', 'Gantt');
$tabBox->setInfo($info);
$tabBox->show();
?>
<script>
function changeFilter(v)
{
	go('index.php?m=projects&tab=0&psfilter=' + v);
}

function setMode(f) {
	go('index.php?m=projects&psfilter=<?php 
echo $psfilter;
?>
&orderby='+f.id);
}