top.window.location = '../../index.php'"; exit; } require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php"; require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php"; use includes\classes\ConnectPDO; $conn = ConnectPDO::getInstance(); $auth = new AuthNew($_SESSION['s_logado'], $_SESSION['s_nivel'], 3, 1); $currentUrl = $_SERVER['PHP_SELF']; /* Alterar o basename para ficar compatível com o data-app para marcação no menu lateral */ $dataAppUrl = str_replace(basename($currentUrl), 'ticket_add.php', $currentUrl); $_SESSION['s_page_ocomon'] = $dataAppUrl; $onlyOpen = $_SESSION['s_nivel'] == 3; $jumpToChooseTicketType = false; if ($onlyOpen) { $basic_users_can_open_as_others = getConfigValue($conn, 'ALLOW_BASIC_USERS_REQUEST_AS_OTHERS') ?? 0; /* Buscar o departamento do usuário */ $department = getUserDepartment($conn, $_SESSION['s_uid']); $jumpToChooseTicketType = (empty($department) || !$basic_users_can_open_as_others ? true : false); } $params = ""; $paramPrefix = "amp;"; if (isset($_GET) && !empty($_GET)) { foreach ($_GET as $key => $value) { if (strpos($key, $paramPrefix) !== false) { $newKey = str_replace($paramPrefix, "", $key); $_GET[$newKey] = $value; } } } // if (isset($_GET) && !empty($_GET) && !$onlyOpen) { if (isset($_GET) && !empty($_GET) && !$jumpToChooseTicketType) { $_GET = filter_input_array(INPUT_GET, FILTER_DEFAULT); $params = "&" . http_build_query($_GET, "", "&"); } // if ($onlyOpen) { if ($jumpToChooseTicketType) { $requester["requester"] = $_SESSION['s_uid']; $params = "&" . http_build_query($requester, "", "&"); header("Location: ./choose_ticket_type.php?" . $params); return; } // $users = getUsers($conn); $users = (!$onlyOpen ? getUsers($conn, null, [1,2,3]) : getUsers($conn, null, [3], null, null, null, $department)); $classMarginTop = "mt-4"; ?> <?= APP_NAME; ?> <?= VERSAO; ?>