generateIcal() static public method

Generate ical file content
static public generateIcal ( $who, $who_group, $limititemtype = '' ) : icalendar
$who user ID
$who_group group ID
$limititemtype itemtype only display this itemtype (default '')
return icalendar string
Example #1
0
                     if (count($intersect)) {
                         $canview = true;
                     }
                 }
                 // Else check group
                 if (!$canview && $_GET['gID']) {
                     $group = new Group();
                     if ($group->getFromDB($_GET['gID'])) {
                         if (in_array($group->getEntityID(), $entities)) {
                             $canview = true;
                         }
                     }
                 }
             }
             if ($ismine || $canview) {
                 Planning::generateIcal($_GET["uID"], $_GET["gID"], $_GET["limititemtype"]);
             }
         }
     }
 } else {
     Html::header(__('Planning'), $_SERVER['PHP_SELF'], "helpdesk", "planning");
     Session::haveRightsOr('planning', array(Planning::READALL, Planning::READMY));
     if (!isset($_GET["date"]) || empty($_GET["date"])) {
         $_GET["date"] = strftime("%Y-%m-%d");
     }
     if (!isset($_GET["type"])) {
         $_GET["type"] = "week";
     }
     $planning = new Planning();
     $planning->display($_GET);
     Html::footer();
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();
}