Ejemplo n.º 1
0
            header('Location: viewticket.php?tid=' . $ticket['results']['reference'] . '&c=' . $ticket['results']['id']);
        }
    }
}
## Ticket updates
foreach ($ticket['results']['updates'] as $key => $value) {
    if (!$value['private']) {
        $replies[] = array('name' => $value['author']['name'] ? $value['author']['name'] : $value['author']['first_name'] . ' ' . $value['author']['last_name'], 'message' => nl2br(($value['message'] ? $value['message'] : strip_tags($value['html_body'])) . ($value['signature_text'] ? "<div class='signature'><p>" . $value['signature_text'] . "</p></div>" : "")), 'admin' => $value['author']['type'] == 'User' ? true : false, 'userid' => $value['author']['type'] == 'User' ? false : true, 'date' => fromMySQLDate($value['posted_at'], 'time'), 'user' => $value['author']['type'] == 'User' ? "{$value['author']['first_name']} {$value['author']['last_name']}" : "{$value['from_name']}");
    }
}
## Logged in?
if ($ca->isLoggedIn()) {
    $result = mysql_query("SELECT CONCAT_WS(' ', firstname, lastname) as full_name, email FROM tblclients WHERE id=" . $ca->getUserID());
    $client = mysql_fetch_array($result, MYSQL_ASSOC);
    $ca->assign('email', $client['email']);
    $ca->assign('clientname', $client['full_name']);
}
## Assign vars to the template
$ca->assign('tid', $ticket['results']['reference']);
$ca->assign('subject', $ticket['results']['subject']);
$ca->assign('date', fromMySQLDate($ticket['results']['submitted_at'], time));
$ca->assign('department', $ticket['results']['department']['name']);
$ca->assign('urgency', "<span style='color:#{$ticket['results']['priority']['colour']}'>{$ticket['results']['priority']['name']}</span>");
$ca->assign('status', "<span style='color:#{$ticket['results']['status']['colour']}'>{$ticket['results']['status']['name']}</span>");
$ca->assign('showclosebutton', $settings['close_ticket'] ? true : false);
$ca->assign('descreplies', array_reverse($replies));
$ca->assign('replies', array_reverse($replies));
$ca->assign('c', $_GET['c']);
$ca->setTemplate('viewticket');
$ca->output();