'myticket.php', 'name' => $plugin->get_lang('MyTickets')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TicketDetail')); $htmlHeadXtra[] = ' '; $htmlHeadXtra[] = ' '; $user_id = api_get_user_id(); $isAdmin = api_is_platform_admin(); $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:myticket.php'); } if (isset($_POST['response'])) { if ($user_id == $ticket['ticket']['request_user']) { $response = ($_POST['response'] == get_lang('Yes')) ? true : ($_POST['response'] == get_lang('No') ? false : null); if ($response && $ticket['ticket']['status_id'] == 'XCF') { TicketManager::close_ticket($_GET['ticket_id'], $user_id); $ticket['ticket']['status_id'] = 'CLS'; $ticket['ticket']['status'] = $plugin->get_lang('Closed'); } else if (!is_null($response) && $ticket['ticket']['status_id'] == 'XCF') { TicketManager::update_ticket_status('PND', $_GET['ticket_id'], $user_id); $ticket['ticket']['status_id'] = 'PND'; $ticket['ticket']['status'] = $plugin->get_lang('Pending'); } } } 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']); $ticket['ticket']['assigned_last_user'] = $_POST['admins']; break; case 'unassign': if (api_is_platform_admin() && isset($_GET['ticket_id'])) TicketManager::assign_ticket_user($_GET['ticket_id'], 0); $ticket['ticket']['assigned_last_user'] = 0; break; default: break; } } if (!isset($_POST['compose'])) { if (isset($_POST['close'])) { $_GET['ticket_id'] = $_POST['ticket_id']; TicketManager::close_ticket($_GET['ticket_id'], $user_id); $ticket['ticket']['status_id'] = 'CLS'; $ticket['ticket']['status'] = $plugin->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'] != 'REE' && $ticket['ticket']['status_id'] != 'CLS' && $isAdmin) { if (intval($ticket['ticket']['assigned_last_user']) == $user_id) { if ($ticket['ticket']['status_id'] != 'CLS') { $form_close_ticket.= '
'; } } } $titulo = '
';
} else {
$img_assing .= '
';
}
}
$bold = ($ticket['ticket']['status_id'] == 'CLS') ? 'style = "font-weight: bold;"' : '';
echo '| ' . $titulo . ' | ' . $img_assing . ' | ' . $form_close_ticket . ' | ||
' . get_lang('Sent') . ': ' . $ticket['ticket']['start_date'] . ' |
' . $plugin->get_lang('LastResponse') . ': ' . $ticket['ticket']['sys_lastedit_datetime'] . ' |
|||
' . get_lang('Subject') . ': ' . $ticket['messages'][0]['subject'] . ' |
' . get_lang('Status') . ': ' . $ticket['ticket']['status'] . ' |
|||
' . get_lang('Category') . ': ' . $ticket['ticket']['name'] . ' |
' . get_lang('Priority') . ':' . $ticket['ticket']['priority'] . ' |
|||
' . get_lang('Course') . ': |
' . $ticket['ticket']['course_url'] . ' | |||
' . get_lang('User') . ': ' . $user_info = $ticket['ticket']['user_url'] . ' (' . $ticket['usuario']['username'] . ') |
||||