Skip to content
Snippets Groups Projects
Commit a4461c6f authored by Peter Rotich's avatar Peter Rotich
Browse files

Add SLA plan selection

Make the new ticket form more intuitive (move things around)
parent b7b9f1c5
Branches
Tags
No related merge requests found
......@@ -24,7 +24,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<input type="text" size="45" name="email" id="email" class="typeahead" value="<?php echo $info['email']; ?>"
<input type="text" size="50" name="email" id="email" class="typeahead" value="<?php echo $info['email']; ?>"
autocomplete="off" autocorrect="off" autocapitalize="off">
&nbsp;<span class="error">*&nbsp;<?php echo $errors['email']; ?></span>
<?php
......@@ -40,7 +40,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Full Name:
</td>
<td>
<input type="text" size="45" name="name" id="name" value="<?php echo $info['name']; ?>">
<input type="text" size="50" name="name" id="name" value="<?php echo $info['name']; ?>">
&nbsp;<span class="error">*&nbsp;<?php echo $errors['name']; ?></span>
</td>
</tr>
......@@ -49,15 +49,15 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Phone Number:
</td>
<td>
<input type="text" size="18" name="phone" id="phone" value="<?php echo $info['phone']; ?>">
<input type="text" size="20" name="phone" id="phone" value="<?php echo $info['phone']; ?>">
&nbsp;<span class="error">&nbsp;<?php echo $errors['phone']; ?></span>
Ext <input type="text" size="5" name="phone_ext" id="phone_ext" value="<?php echo $info['phone_ext']; ?>">
Ext <input type="text" size="6" name="phone_ext" id="phone_ext" value="<?php echo $info['phone_ext']; ?>">
&nbsp;<span class="error">&nbsp;<?php echo $errors['phone_ext']; ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Ticket Information</strong>:</em>
<em><strong>Ticket Information &amp; Options</strong>:</em>
</th>
</tr>
<tr>
......@@ -114,92 +114,45 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
</tr>
<tr>
<td width="160" class="required">
Subject:
<td width="160">
Priority:
</td>
<td>
<input type="text" name="subject" size="55" value="<?php echo $info['subject']; ?>">
&nbsp;<font class="error">*&nbsp;<?php echo $errors['subject']; ?></font>
<select name="priorityId">
<option value="0" selected >&mdash; System Default &mdash;</option>
<?php
if($priorities=Priority::getPriorities()) {
foreach($priorities as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['priorityId']==$id)?'selected="selected"':'',$name);
}
}
?>
</select>
&nbsp;<font class="error">&nbsp;<?php echo $errors['priorityId']; ?></font>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Issue summary</strong>: Detailed summary of the reason(s) of opening the ticket. <font class="error">*&nbsp;<?php echo $errors['issue']; ?></font></em>
</th>
</tr>
<tr>
<td colspan=2>
<textarea name="issue" cols="21" rows="8" style="width:80%;"><?php echo $info['issue']; ?></textarea>
<br><em>The user will be able to see the summary and any associated responses.</em>
</tr>
<tr>
<td width="160">
SLA Plan:
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Response</strong>: Optional response to the above issue.</em>
</th>
</tr>
<tr>
<td colspan=2>
<?php
if(($cannedResponses=Canned::getCannedResponses())) {
?>
<div>
Canned Response:&nbsp;
<select id="cannedResp" name="cannedResp">
<option value="0" selected="selected">&mdash; Select a canned response &mdash;</option>
<?php
foreach($cannedResponses as $id =>$title) {
echo sprintf('<option value="%d">%s</option>',$id,$title);
}
?>
</select>
&nbsp;&nbsp;&nbsp;
<label><input type='checkbox' value='1' name="append" id="append" checked="checked">Append</label>
</div>
<?php
} ?>
<textarea name="response" id="response" cols="21" rows="8" style="width:80%;"><?php echo $info['response']; ?></textarea>
<?php
if($cfg->allowAttachments()) { ?>
<br><em><b>Attachments:</b> Response required when files are attached.</em>
<div class="canned_attachments">
<td>
<select name="slaId">
<option value="0" selected="selected" >&mdash; System Default &mdash;</option>
<?php
if($info['cannedattachments']) {
foreach($info['cannedattachments'] as $k=>$id) {
if(!($file=AttachmentFile::lookup($id))) continue;
$hash=$file->getHash().md5($file->getId().session_id().$file->getHash());
echo sprintf('<label><input type="checkbox" name="cannedattachments[]" id="f%d" value="%d" checked="checked">
<a href="file.php?h=%s">%s</a>&nbsp;&nbsp;</label>&nbsp;',
$file->getId(), $file->getId() , $hash, $file->getName());
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['slaId']==$id)?'selected="selected"':'',$name);
}
}
?>
</div>
<div class="uploads"></div>
<div class="file_input">
<input type="file" class="multifile" name="attachments[]" size="30" value="" />
</div>
<?php
} ?>
</select>
&nbsp;<font class="error">&nbsp;<?php echo $errors['slaId']; ?></font>
</td>
</tr>
</tr>
<tr>
<th colspan="2">
<em><strong>Internal Note</strong>: Optional internal note (recommended on assignment) <font class="error">&nbsp;<?php echo $errors['note']; ?></font></em>
</th>
</tr>
<tr>
<td colspan=2>
<textarea name="note" cols="21" rows="6" style="width:80%;"><?php echo $info['note']; ?></textarea>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Ticket Options</strong>: Due date, when set, overwrites SLA grace period.</em>
</th>
</tr>
<tr>
<tr>
<td width="160">
Due Date:
</td>
......@@ -210,32 +163,14 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
$min=$hr=null;
if($info['time'])
list($hr, $min)=explode(':', $info['time']);
echo Misc::timeDropdown($hr, $min, 'time');
?>
&nbsp;<font class="error">&nbsp;<?php echo $errors['duedate']; ?> &nbsp; <?php echo $errors['time']; ?></font>
<em>Time is based on your time zone (GMT <?php echo $thisstaff->getTZoffset(); ?>)</em>
</td>
</tr>
<tr>
<td width="160">
Priority:
</td>
<td>
<select name="priorityId">
<option value="0" selected >&mdash; System Default &mdash;</option>
<?php
if($priorities=Priority::getPriorities()) {
foreach($priorities as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['priorityId']==$id)?'selected="selected"':'',$name);
}
}
?>
</select>
&nbsp;<font class="error">&nbsp;<?php echo $errors['priorityId']; ?></font>
</td>
</tr>
<?php
if($thisstaff->canAssignTickets()) { ?>
<tr>
......@@ -253,7 +188,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
}
echo '</OPTGROUP>';
}
if(($teams=Team::getActiveTeams())) {
echo '<OPTGROUP label="Teams ('.count($teams).')">';
foreach($teams as $id => $name) {
......@@ -269,37 +204,114 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</tr>
<?php
} ?>
<?php
if($thisstaff->canCloseTickets()) { ?>
<tr>
<td width="160">
Ticket Status:
</td>
<td>
<input type="checkbox" name="ticket_state" value="closed" <?php echo $info['ticket_state']?'checked="checked"':''; ?>>
<b>Close On Response</b>&nbsp;<em>(Only applicable if response is entered)</em>
<th colspan="2">
<em><strong>Issue</strong>: The user will be able to see the issue summary below and any associated responses.</em>
</th>
</tr>
<tr>
<td colspan=2>
<div>
<em><strong>Subject</strong>: Issue summary </em> &nbsp;<font class="error">*&nbsp;<?php echo $errors['subject']; ?></font><br>
<input type="text" name="subject" size="60" value="<?php echo $info['subject']; ?>">
</div>
<div><em><strong>Issue</strong>: Details on the reason(s) for opening the ticket.</em> <font class="error">*&nbsp;<?php echo $errors['issue']; ?></font></div>
<textarea name="issue" cols="21" rows="8" style="width:80%;"><?php echo $info['issue']; ?></textarea>
</td>
</tr>
<?php
} ?>
<tr>
<td>Signature:</td>
<td>
<?php
$info['signature']=$info['signature']?$info['signature']:$thisstaff->getDefaultSignatureType();
<th colspan="2">
<em><strong>Response</strong>: Optional response to the above issue.</em>
</th>
</tr>
<tr>
<td colspan=2>
<?php
if(($cannedResponses=Canned::getCannedResponses())) {
?>
<label><input type="radio" name="signature" value="none" checked="checked"> None</label>
<?php
if($thisstaff->getSignature()) { ?>
<label><input type="radio" name="signature" value="mine"
<?php echo ($info['signature']=='mine')?'checked="checked"':''; ?>> My signature</label>
<div>
Canned Response:&nbsp;
<select id="cannedResp" name="cannedResp">
<option value="0" selected="selected">&mdash; Select a canned response &mdash;</option>
<?php
foreach($cannedResponses as $id =>$title) {
echo sprintf('<option value="%d">%s</option>',$id,$title);
}
?>
</select>
&nbsp;&nbsp;&nbsp;
<label><input type='checkbox' value='1' name="append" id="append" checked="checked">Append</label>
</div>
<?php
} ?>
<textarea name="response" id="response" cols="21" rows="8" style="width:80%;"><?php echo $info['response']; ?></textarea>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<?php
} ?>
<label><input type="radio" name="signature" value="dept"
<?php echo ($info['signature']=='dept')?'checked="checked"':''; ?>>
Dept. Signature (if set)</label>
<span style="padding-left:25px;">
if($cfg->allowAttachments()) { ?>
<tr><td width="100" valign="top">Attachments:</td>
<td>
<div class="canned_attachments">
<?php
if($info['cannedattachments']) {
foreach($info['cannedattachments'] as $k=>$id) {
if(!($file=AttachmentFile::lookup($id))) continue;
$hash=$file->getHash().md5($file->getId().session_id().$file->getHash());
echo sprintf('<label><input type="checkbox" name="cannedattachments[]"
id="f%d" value="%d" checked="checked"
<a href="file.php?h=%s">%s</a>&nbsp;&nbsp;</label>&nbsp;',
$file->getId(), $file->getId() , $hash, $file->getName());
}
}
?>
</div>
<div class="uploads"></div>
<div class="file_input">
<input type="file" class="multifile" name="attachments[]" size="30" value="" />
</div>
</td>
</tr>
<?php
} ?>
<?php
if($thisstaff->canCloseTickets()) { ?>
<tr>
<td width="100">Ticket Status:</td>
<td>
<input type="checkbox" name="ticket_state" value="closed" <?php echo $info['ticket_state']?'checked="checked"':''; ?>>
<b>Close On Response</b>&nbsp;<em>(Only applicable if response is entered)</em>
</td>
</tr>
<?php
} ?>
<tr>
<td width="100">Signature:</td>
<td>
<?php
$info['signature']=$info['signature']?$info['signature']:$thisstaff->getDefaultSignatureType();
?>
<label><input type="radio" name="signature" value="none" checked="checked"> None</label>
<?php
if($thisstaff->getSignature()) { ?>
<label><input type="radio" name="signature" value="mine"
<?php echo ($info['signature']=='mine')?'checked="checked"':''; ?>> My signature</label>
<?php
} ?>
<label><input type="radio" name="signature" value="dept"
<?php echo ($info['signature']=='dept')?'checked="checked"':''; ?>> Dept. Signature (if set)</label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Internal Note</strong>: Optional internal note (recommended on assignment) <font class="error">&nbsp;<?php echo $errors['note']; ?></font></em>
</th>
</tr>
<tr>
<td colspan=2>
<textarea name="note" cols="21" rows="6" style="width:80%;"><?php echo $info['note']; ?></textarea>
</td>
</tr>
</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment