diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-07-02 11:53:40 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-07-02 11:53:40 -0700 |
commit | a563de5fc2f42abf16fbcfda7cf5bc5f1ce794e7 (patch) | |
tree | 21ed995983a9ef1f51055c8e4c6c6300863c5c66 /ng_selfservice/ticket.php | |
parent | 93f2d729dcc5c1bbf424a61ee49b985a4e3ed1d6 (diff) |
selfservice, TNG, RT#22193
Diffstat (limited to 'ng_selfservice/ticket.php')
-rw-r--r-- | ng_selfservice/ticket.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ng_selfservice/ticket.php b/ng_selfservice/ticket.php new file mode 100644 index 000000000..42a4bbe24 --- /dev/null +++ b/ng_selfservice/ticket.php @@ -0,0 +1,68 @@ +<? + +require_once('elements/session.php'); + +if ( $_POST['ticket_id'] ) { + $ticket_id = $_POST['ticket_id']; +} else { + $ticket_id = $_SERVER['QUERY_STRING']; +} + +if ( ! preg_match( '/^\d+$/', $ticket_id ) ) { + header('Location:index.php?error=No+ticket+ID'); + die(); +} + +$ticket_info = $freeside->get_ticket( array( + 'session_id' => $_COOKIE['session_id'], + 'ticket_id' => $ticket_id, + 'subject' => $_POST['subject'], + 'reply' => $_POST['reply'], +) ); + +if ( isset($ticket_info['error']) && $ticket_info['error'] ) { + $error = $ticket_info['error']; + header('Location:index.php?error='. urlencode($error)); + die(); +} + +extract($ticket_info); + +?> +<? $title = "View ticket #$ticket_id"; include('elements/header.php'); ?> +<? $current_menu = 'tickets.php'; include('elements/menu.php'); ?> + +<TABLE> +<? foreach ( $transactions AS $transaction ) { + if ( $transaction['content'] == 'This transaction appears to have no content' ) { continue; } +?> + <TR> + <TD> + <B> + <? echo $transaction['created'] ?> + + <? echo $transaction['description'] ?> + </B> + <PRE><? echo $transaction['content'] ?></PRE><BR> + </TD> + </TR> +<? } ?> +</TABLE> + +<BR><BR> +<FORM ACTION="ticket.php" METHOD=POST> + <input type="hidden" name="ticket_id" value="<? echo $ticket_id ?>"> + +<? if ( $edit_ticket_subject ) { ?> + Subject:<BR><input type="text" name="subject" value="<? htmlspecialchars($ticket_fields['subject']) ?>" style="width:440px"> + <BR><BR> +<? } ?> + + Add reply to ticket: + <BR> + <textarea name="reply" cols="60" rows="10" style="width:440px"></textarea> + <BR><input type="submit" value="Reply"> +</form> + +<? include('elements/menu_footer.php'); ?> +<? include('elements/footer.php'); ?> |