<?php require_once 'main.php'; /*************************************** * Create Submit * ****************************************/ $ObjTicket = new TicketHandler(); if (!empty($_POST) && $_POST['StAction'] == 'create') { foreach ($_POST as &$StArg) { UserHandler::SQLInjectionHandle($StArg); } $IDCategory = $_POST['StCategory']; $IDPriority = $_POST['StPriority']; $StTitle = $_POST['StTitle']; $TxMessage = f1desk_escape_html($_POST['TxMessage']); $IDDepartment = $_POST['IDRecipient'] != 'null' ? $_POST['IDRecipient'] : ''; $IDDepartmentReader = isset($_POST['IDReader']) && $_POST['IDReader'] != 'null' ? $_POST['IDReader'] : ''; $ArUsers = isset($_POST['ArRecipients']) ? explode(',', $_POST['ArRecipients']) : array(); $ArReaders = isset($_POST['ArReaders']) ? explode(',', $_POST['ArReaders']) : array(); $ArAttached = isset($_POST['ArAttached']) ? explode(',', $_POST['ArAttached']) : array(); if (F1DeskUtils::IsSupporter()) { if (!empty($_FILES['Attachment']['name'])) { $IDTicket = $ObjTicket->createSupporterTicket(getSessionProp('IDSupporter'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $IDDepartmentReader, $ArUsers, $ArReaders, true, $_FILES); } else { $IDTicket = $ObjTicket->createSupporterTicket(getSessionProp('IDSupporter'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $IDDepartmentReader, $ArUsers, $ArReaders, true); } } else { if (!empty($_FILES['Attachment']['name'])) { $IDTicket = $ObjTicket->createUserTicket(getSessionProp('IDClient'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $_FILES); } else { $IDTicket = $ObjTicket->createUserTicket(getSessionProp('IDClient'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment);
<?php require_once 'main.php'; $ObjTicket = new TicketHandler(); if (F1DeskUtils::IsSupporter()) { $IDSupporter = getSessionProp('IDSupporter'); $ArDepartments = F1DeskUtils::getDepartments($IDSupporter); $ArIDDepartments = array_keys($ArDepartments); $ArTickets = $ObjTicket->getTickets($ArIDDepartments, $IDSupporter); } else { $IDUser = getSessionProp('IDUser'); $ArDepartments = F1DeskUtils::getUserDepartments(); $ArIDDepartments = array_keys($ArDepartments); $ArTickets = $ObjTicket->getUserTickets($IDUser); }
<?php require_once 'main.php'; Validate::Session(); if (isset($_GET['IDAttach'])) { $IDAttachment = $_GET['IDAttach']; } $TicketHandler = new TicketHandler(); UserHandler::SQLInjectionHandle($IDAttachment); $ID = getSessionProp('IDUser'); $ArResult = $TicketHandler->canDownload($IDAttachment, $ID); if (F1DeskUtils::isSupporter()) { $ArResult['BoPermission'] = 'true'; } if (isset($ArResult['BoPermission']) && $ArResult['BoPermission'] == 'true') { if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { $StFileName = preg_replace('/\\./', '%2e', $ArResult['StFile'], substr_count($ArResult['StFile'], '.') - 1); } else { $StFileName = $ArResult['StFile']; } $StFileName = strtr($StFileName, ' ', '_'); if (isset($ArResult['StLink']) && !is_dir($ArResult['StLink'])) { $ItFileSize = filesize($ArResult['StLink']); $tmpFile = F1DeskUtils::toTMP($ArResult['StLink'], 'path'); } else { $ItFileSize = mb_strlen($ArResult['ByFile'], 'latin1'); $tmpFile = F1DeskUtils::toTMP($ArResult['ByFile'], 'file'); } # # Verificar este header pois o mesmo não exibe corretamente o tamanho do arquivo, quando disponiblizado para download #
<?php require_once 'main.php'; $TicketHandler = new TicketHandler(); $ArTicketsByDepartment = $TicketHandler->reportTicketsByDepartment(); $ArAnswersByDepartment = $TicketHandler->reportAnswersByDepartment(); $ArAnswersBySupporter = $TicketHandler->reportAnswerBySupporter(); $ArSupportersByDepartment = $TicketHandler->reportSupportersByDepartments();
if (!$isSupporter) { throw new ErrorHandler(INVALID_OPTION); } $ArData = array("StTitle" => f1desk_escape_string($_POST['StTitle']), "TxNote" => f1desk_escape_string($_POST['TxMessage'])); $ItAffedcted = F1DeskUtils::editNote($_POST['IDEdit'], $ArData); if (!$ItAffedcted) { ErrorHandler::setNotice('note', ERROR_NOTES_EDIT . $_POST['IDEdit'], 'error'); } else { ErrorHandler::setNotice('note', NOTE_EDIT_OK, 'ok'); } break; case 'removeBookmark': if (!$isSupporter) { throw new ErrorHandler(INVALID_OPTION); } $TicketHandler = new TicketHandler(); $ItAffedcted = $TicketHandler->removeBookmark(getSessionProp('IDSupporter'), $_POST['IDTicket']); if (!$ItAffedcted) { ErrorHandler::setNotice('bookmark', ERROR, 'error'); } else { ErrorHandler::setNotice('bookmark', BOOKMARK_OK, 'ok'); } break; default: ErrorHandler::setNotice('user', NO_ACTION, 'error'); break; } } /*************************************** * Home data * ****************************************/
case 'close': if (empty($_POST['IDTicket'])) { ErrorHandler::setNotice('ticket', EXC_GLOBAL_EXPPARAM, 'error'); } else { } break; } } /************************** ### End - Actions ### ***************************/ /************************** ### Loading Data ### ***************************/ $IDTicket = array_key_exists('id', $_GET) ? $_GET['id'] : $_REQUEST['IDTicket']; $IDSupporter = getSessionProp('IDSupporter'); $IDUser = getSessionProp('IDUser'); $preview = isset($_POST['preview']) ? true : false; $isVisible = false; $ObjTicket = new TicketHandler(); if ($ObjTicket->ticketExists($IDTicket)) { if ($isSupporter || $ObjTicket->isVisible($IDTicket, $IDUser)) { $isVisible = true; } } if ($isVisible) { $ObjTicket->setAsRead(getSessionProp('IDUser'), $IDTicket); $ArHeaders = $ObjTicket->getTicketHeaders($IDTicket); $ArAttachments = $ObjTicket->getAttachments($IDTicket); if ($isSupporter) { $ArSupporters = $ObjUser->listSupporters($IDTicket); $BoCreate = F1DeskUtils::getPermission('BoCreateTicket', $IDSupporter); if ($BoCreate) { $ArDepartments = F1DeskUtils::getPublicDepartments(false); } else {