top.window.location = '../../login.php'"; // exit(); // } if (!isset($_GET['numero']) || !isset($_GET['id'])) { echo ""; exit(); } $numero = (int)$_GET['numero']; $id = $_GET['id']; $id = str_replace(" ", "+", $id); $id = noHtml($id); // var_dump([ // 'id' => $id, // 'getGlobalTicketId' => getGlobalTicketId($conn, $numero), // 'asEquals()' => asEquals($id, getGlobalTicketId($conn, $numero)), // '$_GET[rating_id]' => $_GET['rating_id'], // ]); exit; if (asEquals($id, getGlobalTicketId($conn, $numero))) { $GLOBALACCESS = true; } else { echo ""; exit(); } /** * Rating_id: possibilitará que o chamado seja avaliado */ $rating_id = ""; if (isset($_GET['rating_id']) && !empty($_GET['rating_id'])) { $rating_id = noHtml(str_replace(" ", "+", $_GET['rating_id'])); } $config = getConfig($conn); $onlyBusinessDays = ($config['conf_only_weekdays_to_count_after_done'] ? true : false); /* Para manter a compatibilidade com versões antigas */ $table = getTableCompat($conn); if (!isset($_POST['submit']) || empty($_POST)) { ?> <?= TRANS('TICKET_OPENING'); ?>
query($query); $row = $resultado->fetch(); $query2 = "SELECT a.*, u.* FROM assentamentos a LEFT JOIN usuarios u ON u.user_id = a.responsavel WHERE a.ocorrencia = {$numero} and a.asset_privated = 0"; $resultAssets = $conn->query($query2); $assentamentos = $resultAssets->rowCount(); /* CHECA SE A OCORRÊNCIA É SUB CHAMADO */ $sqlPai = "select * from ocodeps where dep_filho = " . $numero . " "; $execpai = $conn->query($sqlPai); $rowPai = $execpai->fetch(); if ($rowPai && $rowPai['dep_pai'] != "") { $msgPai = TRANS('FIELD_OCCO_SUB_CALL') . "" . $rowPai['dep_pai'] . ""; } else $msgPai = ""; /* Checagem para identificar chamados relacionados */ $qrySubCall = "SELECT * FROM ocodeps WHERE dep_pai = {$numero} OR dep_filho = {$numero}"; $execSubCall = $conn->query($qrySubCall); $existeSub = $execSubCall->rowCount(); /* INÍCIO DAS CHECAGENS PARA A MONTAGEM DO MENU DE OPÇÕES */ $showItemClosure = false; $showItemEdit = false; $showItemAttend = false; $showItemOpenSubcall = false; $showItemReopen = false; $showItemPrint = true; $showItemSla = true; $showItemDocTime = false; /* Essa função será removida - pouca utilidade e muito onerosa */ $showItemSendMail = false; $showItemHistory = true; $showItemSchedule = false; $itemClosure = ""; $itemEdit = ""; $itemAttend = ""; $itemOpenSubcall = ""; $itemReopen = ""; $itemPrint = "../geral/print_ticket.php?numero=" . $numero . "&id=" . $id; /* TRANS('FIELD_PRINT_OCCO') */ $itemSendMail = ""; $itemHistory = "ticket_history.php?numero=" . $row['numero']; /* INÍCIO DAS CONSULTAS REFERENTES À OCORRÊNCIA */ $isClosed = ($row['status_cod'] == 4 ? true : false); $isScheduled = ($row['oco_scheduled'] == 1 ? true : false); $ratedInfo = getRatedInfo($conn, $numero); $isDoneStatus = ($row['status_cod'] == $config['conf_status_done']); // $isRejected = (!empty($ratedInfo) && empty($ratedInfo['rate']) && !$isDoneStatus); $isRejected = isRejected($conn, $row['numero']); $isRequester = false; $showApprovalOption = false; /** * Definirá se o chamado poderá ser avaliado nessa tela */ $canBeRated = false; $isRated = isRated($conn, $numero); if (!empty($rating_id) && asEquals($rating_id, getGlobalTicketRatingId($conn, $numero))) { /* Se foi passado o rating_id corretamente, significa que o usuário possui o link para avaliação, pontanto, solicitante */ $isRequester = true; /* Checar o limite de tempo para a validacao do atendimento */ if (!empty($row['data_fechamento'])) { $deadlineToApprove = addDaysToDate($row['data_fechamento'], $config['conf_time_to_close_after_done'], $onlyBusinessDays); /* if (daysFromDate($row['data_fechamento']) <= $config['conf_time_to_close_after_done']) { $showApprovalOption = ($isRequester && !$isResponsible && !$isRated ? true : false); $canBeRated = (!$isRated ? true : false); } */ if (date('Y-m-d H:i:s') < $deadlineToApprove) { if ($isDoneStatus) { $showApprovalOption = ($isRequester && !$isRated ? true : false); $canBeRated = (!$isRated ? true : false); } } } } // if ($showApprovalOption) { // $itemClosure = " onClick=\"approvingTicket({$numero})\""; // } $issueDetails = (!empty($row['prob_cod'] && $row['prob_cod'] != '-1') ? getIssueDetailed($conn, $row['prob_cod'])[0] : []); $descricao = ""; if (isset($_GET['destaca'])) { $descricao = destaca($_GET['destaca'], toHtml(nl2br($row['descricao']))); } else { $descricao = toHtml(nl2br($row['descricao'])); } $ShowlinkScript = ""; $qryScript = "SELECT * FROM prob_x_script WHERE prscpt_prob_id = " . $row['prob_cod'] . ""; $execQryScript = $conn->query($qryScript); if ($execQryScript->rowCount() > 0) $ShowlinkScript = ""; $global_link = getGlobalUri($conn, $numero); $dateOpen = (!empty($row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00') ? formatDate($row['oco_real_open_date']) : formatDate($row['data_abertura'])); $dateClose = formatDate($row['data_fechamento']); $dateLastSchedule = formatDate($row['oco_scheduled_to']); $dateScheduleTo = ""; $timeScheduleTo = ""; $dateRealOpen = formatDate($row['oco_real_open_date']); $scriptSolution = ""; if ($isClosed) { if ($row['data_abertura'] != $row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00') { $dateLastSchedule = formatDate($row['data_abertura']); $dateClose = formatDate($row['data_fechamento']); $dateRealOpen = formatDate($row['oco_real_open_date']); } else { $dateOpen = (!empty($row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00') ? formatDate($row['oco_real_open_date']) : formatDate($row['data_abertura'])); $dateClose = formatDate($row['data_fechamento']); } $scriptSolution = $row['script_desc']; } else { if ($isScheduled) { $dateOpen = (!empty($row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00') ? formatDate($row['oco_real_open_date']) : formatDate($row['data_abertura'])); $dateScheduleTo = dateScreen($row['oco_scheduled_to'], 0, 'd/m/Y H:i'); $timeScheduleTo = explode(" ", $row['oco_scheduled_to'])[1]; } else { $dateOpen = (!empty($row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00') ? formatDate($row['oco_real_open_date']) : formatDate($row['data_abertura'])); } if ($row['data_abertura'] != $row['oco_real_open_date'] && $row['oco_real_open_date'] != '0000-00-00 00:00:00' && !empty($row['oco_real_open_date'])) { $dateLastSchedule = formatDate($row['data_abertura']); $dateRealOpen = formatDate($row['oco_real_open_date']); } } $qryMail = "SELECT * FROM mail_hist m, usuarios u WHERE m.mhist_technician=u.user_id AND m.mhist_oco=" . $numero . " ORDER BY m.mhist_date"; $execMail = $conn->query($qryMail); $emails = $execMail->rowCount(); $sqlFiles = "select * from imagens where img_oco = " . $numero . ""; $resultFiles = $conn->query($sqlFiles); $hasFiles = $resultFiles->rowCount(); /* FINAL DAS CONSULTAS REFERENTES À OCORRÊNCIA */ $colLabel = "col-sm-3 text-md-right font-weight-bold p-2"; $colsDefault = "small text-break border-bottom rounded p-2 bg-white"; /* border-secondary */ $colContent = $colsDefault . " col-sm-3 col-md-3"; $colContentLine = $colsDefault . " col-sm-9"; $colContentLineFile = " text-break border-bottom rounded p-2 bg-white col-sm-9"; ?>
$ticket_rate['rate'] ?? null, // 'isDoneStatus' => $isDoneStatus, // 'isRequester' => $isRequester, // 'isRejected' => $isRejected // ]); ?>
" . TRANS("SATS") . " " . $worktimeSets['sat']; $renderWtSets .= "
" . TRANS("SUNS") . " " . $worktimeSets['sun']; $renderWtSets .= "
" . TRANS("MNL_FERIADOS") . " " . $worktimeSets['off']; } ?>
$catKey) { if (!empty($issueDetails[$catKey]) && strlen($issueDetails[$catKey]) > 1) { $arrayCategories[] = $groupNames[$key] . ": " . $issueDetails[$catKey]; } } $categories = implode(",", $arrayCategories); ?>
" . $row['pr_descricao'] . ""; ?>
" . $row['chamado_status'] . ""; ?>
$field) { if (!empty($hiddenCustomFields) && in_array($field['field_id'], $hiddenCustomFields)) { unset($custom_fields[$key]); } } } $number_of_collumns = 2; if (count($custom_fields) && !empty($custom_fields[0]['field_id'])) { ?>

'; } $col = ($col > $number_of_collumns ? 1 : $col); if ($col == 1) { ?>
0 ? '' : ' disabled'); $ariaDisabledAssent = ($assentamentos > 0 ? '' : ' true'); $classDisabledEmails = ($emails > 0 ? '' : ' disabled'); $ariaDisabledEmails = ($emails > 0 ? '' : ' true'); $classDisabledFiles = ($hasFiles > 0 ? '' : ' disabled'); $ariaDisabledFiles = ($hasFiles > 0 ? '' : ' true'); $classDisabledSubs = ($existeSub > 0 ? '' : ' disabled'); $ariaDisabledSubs = ($existeSub > 0 ? '' : ' true'); ?>
fetchAll() as $rowAsset) { $transAssetText = ""; if ($rowAsset['asset_privated'] == 1) { $transAssetText = "" . TRANS('CHECK_ASSET_PRIVATED') . ""; } else { $transAssetText = "" . TRANS('CHECK_ASSET_PUBLIC') . ""; } /* Badge da primeira resposta */ $badgeFirstResponse = ""; if (!empty($row['data_atendimento']) && $row['data_atendimento'] == $rowAsset['created_at']) { $badgeFirstResponse = ' ' . TRANS('FIRST_RESPONSE') . ''; } $author = $rowAsset['nome'] ?? TRANS('AUTOMATIC_PROCESS'); ?>
#
fetchAll() as $rowMail) { $limite = 30; $shortBody = trim($rowMail['mhist_body']); if (strlen((string)$shortBody) > $limite) { $shortBody = substr($shortBody, 0, ($limite - 4)) . "..."; } ?>
#
fetchAll() as $rowFiles) { $size = round($rowFiles['img_size'] / 1024, 1); $rowFiles['img_tipo'] . "](" . $size . "k)"; if (isImage($rowFiles["img_tipo"])) { $viewImage = " "; } else { $viewImage = ""; } ?>
#
k
fetchAll() as $rowSubPai) { // $sqlStatus = "select o.*, s.* from ocorrencias o, `status` s where o.numero=" . $rowSubPai['dep_filho'] . " and o.`status`=s.stat_id and s.stat_painel not in (3) "; // $execStatus = $conn->query($sqlStatus); // $regStatus = $execStatus->rowCount(); // if ($regStatus > 0) { // $comDeps = true; // } // if ($comDeps) { // $imgSub = ICONS_PATH . "view_tree_red.png"; // } else { // $imgSub = ICONS_PATH . "view_tree_green.png"; // } $key = $rowSubPai['dep_filho']; $label = "" . TRANS('CHILD_TICKET') . ""; // $comDeps = false; if ($rowSubPai['dep_pai'] != $numero) { $key = $rowSubPai['dep_pai']; $label = "" . TRANS('PARENT_TICKET') . ""; } $qryDetail = $QRY["ocorrencias_full_ini"] . " WHERE o.numero = " . $key . " "; $execDetail = $conn->query($qryDetail); $rowDetail = $execDetail->fetch(); $texto = noHtml($rowDetail['descricao']); if (strlen((string)$texto) > 200) { $texto = substr($texto, 0, 195) . " ..... "; }; ?>
" . TRANS('COL_PHONE'); ?> " . TRANS('DESCRIPTION'); ?> " . TRANS('COL_STATUS'); ?>
  " . noHtml($rowDetail['telefone']); ?> " . $texto; ?> " . $rowDetail['chamado_status']; ?>