Example #1
0
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     if ($item->getType() == __CLASS__) {
         switch ($tabnum) {
             case 1:
                 // all
                 Planning::showSelectionForm($_POST['type'], $_POST['date'], 'my', 0, $_POST["limititemtype"]);
                 Planning::showPlanning($_SESSION['glpiID'], $_POST["gID"], $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
                 break;
             case 2:
                 Planning::showSelectionForm($_POST['type'], $_POST['date'], 'mygroups', 0, $_POST["limititemtype"]);
                 Planning::showPlanning($_SESSION['glpiID'], 'mine', $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
                 break;
             case 3:
                 Planning::showSelectionForm($_POST['type'], $_POST['date'], 'users', $_POST["uID"], $_POST["limititemtype"]);
                 Planning::showPlanning($_POST['uID'], 0, $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
                 break;
             case 4:
                 Planning::showSelectionForm($_POST['type'], $_POST['date'], 'groups', $_POST["gID"], $_POST["limititemtype"]);
                 Planning::showPlanning(0, $_POST['gID'], $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
                 break;
         }
     }
     return true;
 }
Example #2
0
    $_GET["gID"] = 0;
}
if (!isset($_GET["usertype"])) {
    $_GET["usertype"] = "user";
}
switch ($_GET["usertype"]) {
    case "user":
        $_GET['gID'] = 0;
        break;
    case "group":
        $_GET['uID'] = 0;
        break;
    case "user_group":
        $_GET['gID'] = "mine";
        break;
}
if (isset($_GET['genical'])) {
    Planning::generateIcal($_GET["uID"], $_GET["gID"]);
} else {
    commonHeader($LANG['Menu'][29], $_SERVER['PHP_SELF'], "maintain", "planning");
    checkSeveralRightsOr(array('show_all_planning' => '1', 'show_planning' => '1'));
    if (!isset($_GET["date"]) || empty($_GET["date"])) {
        $_GET["date"] = strftime("%Y-%m-%d");
    }
    if (!isset($_GET["type"])) {
        $_GET["type"] = "week";
    }
    Planning::showSelectionForm($_GET['type'], $_GET['date'], $_GET["usertype"], $_GET["uID"], $_GET["gID"]);
    Planning::show($_GET['uID'], $_GET['gID'], $_GET["date"], $_GET["type"]);
    commonFooter();
}