Show the availability of a user
static public checkAvailability ( $params = [] ) : Nothing | ||
$params | array of params must contain : - begin: begin date to check (default '') - end: end date to check (default '') - itemtype : User or Object type (Ticket...) - foreign key field of the itemtype to define which item to used optional : - limitto : limit display to a specific user | |
return | Nothing | (display function) |
if (($uid = Session::getLoginUserID()) && !Session::haveRight("planning", Planning::READALL)) { $_GET["uID"] = $uid; } else { $_GET["uID"] = 0; } } if (!isset($_GET["gID"])) { $_GET["gID"] = 0; } if (!isset($_GET["limititemtype"])) { $_GET["limititemtype"] = ""; } // Normal call via $_GET if (isset($_GET['checkavailability'])) { Html::popHeader(__('Availability')); Planning::checkAvailability($_GET); Html::popFooter(); } else { if (isset($_GET['genical'])) { if (isset($_GET['token'])) { // Check user token $user = new User(); if ($user->getFromDBByToken($_GET['token'])) { if (isset($_GET['entities_id']) && isset($_GET['is_recursive'])) { $user->loadMinimalSession($_GET['entities_id'], $_GET['is_recursive']); } //// check if the request is valid: rights on uID / gID // First check mine : user then groups $ismine = false; if ($user->getID() == $_GET["uID"]) { $ismine = true;
if (!isset($_GET["limititemtype"])) { $_GET["limititemtype"] = ""; } // Normal call via $_GET if (isset($_GET['checkavailability'])) { Html::popHeader(__('Availability')); if (!isset($_GET["begin"])) { $_GET["begin"] = ""; } if (!isset($_GET["end"])) { $_GET["end"] = ""; } if (!isset($_GET["users_id"])) { $_GET["users_id"] = ""; } Planning::checkAvailability($_GET['users_id'], $_GET['begin'], $_GET['end']); Html::popFooter(); } else { if (isset($_GET['genical'])) { if (isset($_GET['token'])) { // Check user token $user = new User(); if ($user->getFromDBByToken($_GET['token'])) { if (isset($_GET['entities_id']) && isset($_GET['is_recursive'])) { $user->loadMinimalSession($_GET['entities_id'], $_GET['is_recursive']); } //// check if the request is valid: rights on uID / gID // First check mine : user then groups $ismine = false; if ($user->getID() == $_GET["uID"]) { $ismine = true;