api_get_path(WEB_CODE_PATH).'ticket/tickets.php', 'name' => get_lang('MyTickets') ); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TicketDetail')); $disableReponseButtons = ''; $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; $ticket_id = $_GET['ticket_id']; $ticket = TicketManager::get_ticket_detail_by_id($ticket_id, $user_id); if (!isset($ticket['ticket'])) { api_not_allowed(); } if (!isset($_GET['ticket_id'])) { header('Location: '.api_get_path(WEB_CODE_PATH).'ticket/tickets.php'); exit; } if (isset($_POST['response'])) { if ($user_id == $ticket['ticket']['assigned_last_user']) { $response = $_POST['response'] == '1' ? true : $_POST['response'] == "0" ? false : null; if ($response && $ticket['ticket']['status_id'] == TicketManager::STATUS_UNCONFIRMED) { /*TicketManager::close_ticket($_GET['ticket_id'], $user_id); $ticket['ticket']['status_id'] = TicketManager::STATUS_CLOSE; $ticket['ticket']['status'] = get_lang('Closed');*/ } else if (!is_null($response) && $ticket['ticket']['status_id'] == TicketManager::STATUS_UNCONFIRMED) { TicketManager::update_ticket_status(TicketManager::STATUS_PENDING, $_GET['ticket_id'], $user_id); $ticket['ticket']['status_id'] = TicketManager::STATUS_PENDING; $ticket['ticket']['status'] = get_lang('StatusPending'); } } } if (isset($_REQUEST['action'])) { $action = $_REQUEST['action']; switch ($action) { case 'assign': if (api_is_platform_admin() && isset($_GET['ticket_id'])) { TicketManager::assign_ticket_user($_GET['ticket_id'], $_POST['admins']); } Display::addFlash(Display::return_message(get_lang('Updated'))); header("Location:" . api_get_self() . "?ticket_id=" . $ticket_id); exit; break; case 'unassign': if (api_is_platform_admin() && isset($_GET['ticket_id'])) { TicketManager::assign_ticket_user($_GET['ticket_id'], 0); } Display::addFlash(Display::return_message(get_lang('Updated'))); header("Location:" . api_get_self() . "?ticket_id=" . $ticket_id); exit; break; default: break; } } $title = 'Ticket #' . $ticket['ticket']['code']; if (!isset($_POST['compose'])) { if (isset($_REQUEST['close'])) { TicketManager::close_ticket($_REQUEST['ticket_id'], $user_id); $ticket['ticket']['status_id'] = TicketManager::STATUS_CLOSE; $ticket['ticket']['status'] = get_lang('Closed'); } /*$ticket['ticket']['request_user'] = intval($ticket['ticket']['request_user']); if ($ticket['ticket']['request_user'] == $user_id || intval($ticket['ticket']['assigned_last_user']) == $user_id) { TicketManager::update_message_status($ticket_id, $ticket['ticket']['request_user']); }*/ Display::display_header(); $form_close_ticket = ''; if ($ticket['ticket']['status_id'] != TicketManager::STATUS_FORWARDED && $ticket['ticket']['status_id'] != TicketManager::STATUS_CLOSE && $isAdmin ) { /*if (intval($ticket['ticket']['assigned_last_user']) == $user_id) { if ($ticket['ticket']['status_id'] != TicketManager::STATUS_CLOSE) { $form_close_ticket.= ''; $form_close_ticket.= get_lang('Close') . ''; } }*/ } $img_assing = ''; if (empty($ticket['ticket']['assigned_last_user'])) { $img_assing = ''.get_lang('Assign').''; } else { if ($isAdmin) { $img_assing = ' '.get_lang('ChangeAssign').' '; } } $bold = ''; if ($ticket['ticket']['status_id'] == TicketManager::STATUS_CLOSE) { $bold = 'style = "font-weight: bold;"'; echo ""; } if ($isAdmin) { $senderData = get_lang('AddedBy'). ' '.$ticket['ticket']['user_url'].' (' . $ticket['usuario']['username'] . ').'; } else { $senderData = get_lang('AddedBy'). ' '.$ticket['usuario']['complete_name'].' (' . $ticket['usuario']['username']. ').'; } echo '
'.$title.' '.$form_close_ticket.' '.$img_assing.''.$ticket['ticket']['subject'].''.$senderData.' ' . get_lang('Created') . ' '. Display::url( date_to_str_ago($ticket['ticket']['start_date_from_db']), '#', ['title' => $ticket['ticket']['start_date'], 'class' => 'boot-tooltip'] ).'. '. get_lang('TicketUpdated').' '. Display::url( date_to_str_ago($ticket['ticket']['sys_lastedit_datetime_from_db']), '#', ['title' => $ticket['ticket']['sys_lastedit_datetime'], 'class' => 'boot-tooltip'] ).' |
|||
' . get_lang('Category') . ': ' . $ticket['ticket']['name'] . ' |
|||
' . get_lang('Status') . ': ' . $ticket['ticket']['status'] . ' |
|||
' . get_lang('Priority') . ': ' . $ticket['ticket']['priority'] . ' |
|||
' . get_lang('AssignedTo') . ': ' . $assignedUser['complete_name'] . ' |
|||
' . get_lang('AssignedTo') . ': - |
|||
' . get_lang('Course') . ': ' . $ticket['ticket']['course_url'] . ' | |||
' . get_lang('Session') . ': ' . $sessionInfo['name'] . ' | |||
' . get_lang('Description') . ': '.$ticket['ticket']['message'].' |