Central::showGlobalView PHP Method

showGlobalView() static public method

Show the central global view
static public showGlobalView ( )
    static function showGlobalView()
    {
        $showticket = Session::haveRight("ticket", Ticket::READALL);
        $showproblem = Session::haveRight("problem", Problem::READALL);
        echo "<table class='tab_cadre_central'><tr class='noHover'>";
        echo "<td class='top' width='50%'>";
        echo "<table class='central'>";
        echo "<tr class='noHover'><td>";
        if ($showticket) {
            Ticket::showCentralCount();
        } else {
            Ticket::showCentralCount(true);
        }
        if ($showproblem) {
            Problem::showCentralCount();
        }
        if (Contract::canView()) {
            Contract::showCentral();
        }
        echo "</td></tr>";
        echo "</table></td>";
        if (Session::haveRight("logs", READ)) {
            echo "<td class='top'  width='50%'>";
            //Show last add events
            Event::showForUser($_SESSION["glpiname"]);
            echo "</td>";
        }
        echo "</tr></table>";
        if ($_SESSION["glpishow_jobs_at_login"] && $showticket) {
            echo "<br>";
            Ticket::showCentralNewList();
        }
    }

Usage Example

Example #1
0
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
checkCentralAccess();
$central = new Central();
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
switch ($_REQUEST['glpi_tab']) {
    case 2:
        $central->showGroupView();
        break;
    case 3:
        $central->showGlobalView();
        break;
    case -1:
        // all
        $central->showMyView();
        echo "<br>";
        $central->showGroupView();
        echo "<br>";
        $central->showGlobalView();
        echo "<br>";
        Plugin::displayAction($central, $_REQUEST['glpi_tab']);
        break;
    default:
        if (!Plugin::displayAction($central, $_REQUEST['glpi_tab'])) {
            $central->showMyView();
        }