Newer
Older
<?php
if(!defined('OSTSCPINC') || !$thisstaff || !$thisstaff->canEditTickets() || !$ticket) die('Access Denied');
$info=Format::htmlchars(($errors && $_POST)?$_POST:$ticket->getUpdateInfo());
if ($_POST)
$info['duedate'] = Format::date($cfg->getDateFormat(),
strtotime($info['duedate']));
?>
<form action="tickets.php?id=<?php echo $ticket->getId(); ?>&a=edit" method="post" id="save" enctype="multipart/form-data">
<input type="hidden" name="do" value="update">
<input type="hidden" name="a" value="edit">
<input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>">
<h2>Update Ticket #<?php echo $ticket->getExtId(); ?></h2>
<table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<th colspan="2">
<em><strong>Client Information</strong>: Currently selected client</em>
</th>
</tr>
<?php
if(!$info['user_id'] || !($user = User::lookup($info['user_id'])))
$user = $ticket->getUser();
<div id="client-info">
<span id="client-name"><?php echo $user->getName(); ?></span>
<span id="client-email"><<?php echo $user->getEmail(); ?>></span>
<a class="action-button" style="float:none;overflow:inherit" href="#"
onclick="javascript:
$.userLookup('ajax.php/tickets/<?php echo $ticket->getId(); ?>/change-user',
function(user) {
$('input#user_id').val(user.id);
$('#client-name').html(user.name);
$('#client-email').html('<'+user.email+'>');
});
return false;
"><i class="icon-edit"></i> Change</a>
<input type="hidden" name="user_id" id="user_id"
value="<?php echo $info['user_id']; ?>" />
</div>
<em><strong>Ticket Information</strong>: Due date overrides SLA's grace period.</em>
</th>
</tr>
<tr>
<td width="160" class="required">
Ticket Source:
</td>
<td>
<select name="source">
<option value="" selected >— Select Source —</option>
<option value="Phone" <?php echo ($info['source']=='Phone')?'selected="selected"':''; ?>>Phone</option>
<option value="Email" <?php echo ($info['source']=='Email')?'selected="selected"':''; ?>>Email</option>
<option value="Web" <?php echo ($info['source']=='Web')?'selected="selected"':''; ?>>Web</option>
<option value="API" <?php echo ($info['source']=='API')?'selected="selected"':''; ?>>API</option>
<option value="Other" <?php echo ($info['source']=='Other')?'selected="selected"':''; ?>>Other</option>
</select>
<font class="error"><b>*</b> <?php echo $errors['source']; ?></font>
</td>
</tr>
<tr>
<td width="160" class="required">
Help Topic:
</td>
<td>
<select name="topicId">
<option value="" selected >— Select Help Topic —</option>
<?php
if($topics=Topic::getHelpTopics()) {
foreach($topics as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['topicId']==$id)?'selected="selected"':'',$name);
}
}
?>
</select>
<font class="error"><b>*</b> <?php echo $errors['topicId']; ?></font>
<tr>
<td width="160">
SLA Plan:
<option value="0" selected="selected" >— None —</option>
<?php
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['slaId']==$id)?'selected="selected"':'',$name);
}
}
?>
</select>
<font class="error"> <?php echo $errors['slaId']; ?></font>
</td>
</tr>
<tr>
<td width="160">
Due Date:
</td>
<td>
<input class="dp" id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="12" autocomplete=OFF>
<?php
$min=$hr=null;
if($info['time'])
<font class="error"> <?php echo $errors['duedate']; ?> <?php echo $errors['time']; ?></font>
<em>Time is based on your time zone (GMT <?php echo $thisstaff->getTZoffset(); ?>)</em>
</tbody>
<tbody id="dynamic-form">
<?php if ($forms)
foreach ($forms as $form) {
<tr>
<th colspan="2">
<em><strong>Internal Note</strong>: Reason for editing the ticket (required) <font class="error"> <?php echo $errors['note'];?></font></em>
</th>
</tr>
<tr>
<td colspan="2">
<textarea class="richtext no-bar" name="note" cols="21"
rows="6" style="width:80%;"><?php echo $info['note'];
?></textarea>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:250px;">
<input type="submit" name="submit" value="Save">
<input type="reset" name="reset" value="Reset">
<input type="button" name="cancel" value="Cancel" onclick='window.location.href="tickets.php?id=<?php echo $ticket->getId(); ?>"'>
</p>
</form>
<div style="display:none;" class="dialog draggable" id="user-lookup">
<div class="body"></div>
</div>