top.window.location = '../../index.php'"; exit; } require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php"; require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php"; require_once __DIR__ . "/" . "../../includes/components/html2text-master/vendor/autoload.php"; use includes\classes\ConnectPDO; $conn = ConnectPDO::getInstance(); $auth = new AuthNew($_SESSION['s_logado'], $_SESSION['s_nivel'], 2, 1); /* Para manter a compatibilidade com versões antigas */ $table = getTableCompat($conn); $sysConfig = getConfig($conn); $mailConfig = getMailConfig($conn); $isAdmin = $_SESSION['s_nivel'] == 1; $tickets_cost_field = (!empty($sysConfig['tickets_cost_field']) ? $sysConfig['tickets_cost_field'] : ""); $formatBar = $_SESSION['s_formatBarOco']; $version4 = $sysConfig['conf_updated_issues']; ?> <?= APP_NAME; ?> <?= VERSAO; ?> getText(); $isRequester = false; if ($_SESSION['s_uid'] == $row['aberto_por']) { $isRequester = true; } $isDone = $sysConfig['conf_status_done'] == $row['status']; $isClosed = $row['status'] == 4; $isRejected = $sysConfig['conf_status_done_rejected'] == $row['status']; /** Chamados concluídos não podem mais ser editados */ if ($isDone || $isClosed) { echo message('danger', 'Ooops!', TRANS('MSG_TICKET_DONE_CANT_BE_EDITED'), '', '', 1); exit; } /* Checagem para saber se o usuário logado pode tratar o chamado (edição e encerramento) */ $allowTreat = false; if ($_SESSION['s_nivel'] != 1) { if ($_SESSION['s_nivel'] > 2) { /* Somente-abertura não pode tratar */ $allowTreat = false; } elseif ($isRequester && !$sysConfig['conf_allow_op_treat_own_ticket']) { /* Se for operador solicitante, então depende da configuração sobre se o usuário operador pode tratar chamados abertos por ele mesmo*/ $allowTreat = false; } else { $allowTreat = true; } } else { /* Admin sempre pode tratar */ $allowTreat = true; } if (!$allowTreat) { redirect('ticket_show.php?numero=' . $numero); exit; } /* Controle para evitar acesso ao chamado por usuarios operadores que não fazem parte da area do chamado */ if (!$isAdmin) { $uareas = explode(',', $_SESSION['s_uareas']); if (!in_array($row['sistema'], $uareas)) { ?>

'.TRANS('MSG_TICKET_NOT_ALLOWED_TO_BE_VIEWED'), '', '', true); exit; } } if (!empty($row['problema']) && $row['problema'] != "-1") { $issue_selected_data = getIssueById($conn, $row['problema']); $issue_selected = $issue_selected_data['problema']; } /* ASSENTAMENTOS */ if ($_SESSION['s_nivel'] < 3) { $entries = getTicketEntries($conn, $numero, true); } else $entries = getTicketEntries($conn, $numero); $assentamentos = count($entries); /* ARQUIVOS */ $files = getTicketFiles($conn, $numero); $hasFiles = count($files); /* Checagem para identificar chamados relacionados */ $relatives = getTicketRelatives($conn, $numero); $hasRelatives = count($relatives); $hiddenStatus = []; $closed = false; $hadFirstResponse = false; if ($row['status'] == 4) { $closed = true; } else { $hiddenStatus[] = 4; } if (!empty($row['data_atendimento'])) { $hadFirstResponse = true; } /* Status que não serão selecionaveis na edição */ if ($sysConfig['conf_status_done'] && $sysConfig['conf_status_done'] != $row['status']) { $hiddenStatus[] = (int)$sysConfig['conf_status_done']; } if ($sysConfig['conf_status_done_rejected'] && $sysConfig['conf_status_done_rejected'] != $row['status'] && $sysConfig['conf_status_done_rejected'] != 1) { $hiddenStatus[] = (int)$sysConfig['conf_status_done_rejected']; } ?>
 " . $numero . ""; ?>
id="mailUS" checked>
.

' : ''); ?>
>
placeholder="" >
autocomplete="off"> autocomplete="off"> autocomplete="off"> autocomplete="off">
0 ? '' : ' disabled'); $ariaDisabledAssent = ($assentamentos > 0 ? '' : ' true'); $classDisabledFiles = ($hasFiles > 0 ? '' : ' disabled'); $ariaDisabledFiles = ($hasFiles > 0 ? '' : ' true'); $classDisabledSubs = ($hasRelatives > 0 ? '' : ' disabled'); $ariaDisabledSubs = ($hasRelatives > 0 ? '' : ' true'); ?>
>
"; } else { $viewImage = ""; } ?>
#
k  
" . 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 = trim(noHtml($rowDetail['descricao'])); if (strlen((string)$texto) > 200) { $texto = substr($texto, 0, 195) . " ..... "; }; ?>
" . TRANS('COL_PHONE'); ?> " . TRANS('DESCRIPTION'); ?> " . TRANS('COL_STATUS'); ?>
  " . $rowDetail['telefone']; ?> " . $texto; ?> " . $rowDetail['chamado_status']; ?>  
' /> ' />