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

Support setting status on ticket open by staff

Staff can now select desired ticket status on create
Only allow staff with closing permission to set tickets to resolved state.
parent 5fa57edc
No related branches found
No related tags found
No related merge requests found
......@@ -330,17 +330,29 @@ if ($_POST)
<?php
} ?>
<?php
if($thisstaff->canCloseTickets()) { ?>
<tr>
<td width="100"><?php echo __('Ticket Status');?>:</td>
<td>
<input type="checkbox" name="ticket_state" value="closed" <?php echo $info['ticket_state']?'checked="checked"':''; ?>>
<b><?php echo __('Close On Response');?></b>&nbsp;<em>(<?php echo __('Only applicable if response is entered');?>)</em>
</td>
</tr>
<?php
} ?>
<tr>
<td width="100"><?php echo __('Ticket Status');?>:</td>
<td>
<select name="statusId">
<?php
$statusId = $info['statusId'] ?: $cfg->getDefaultTicketStatusId();
$states = array('open');
if ($thisstaff->canCloseTickets())
$states = array_merge($states, array('resolved', 'closed'));
foreach (TicketStatusList::getStatuses(
array('states' => $states)) as $s) {
if (!$s->isEnabled()) continue;
$selected = ($statusId == $s->getId());
echo sprintf('<option value="%d" %s>%s</option>',
$s->getId(),
$selected
? 'selected="selected"' : '',
__($s->getName()));
}
?>
</select>
</td>
</tr>
<tr>
<td width="100"><?php echo __('Signature');?>:</td>
<td>
......
......@@ -629,9 +629,9 @@ $tcount+= $ticket->getNumNotes();
<select name="reply_status_id">
<?php
$statusId = $info['reply_status_id'] ?: $ticket->getStatusId();
$states = array('open', 'resolved');
$states = array('open');
if ($thisstaff->canCloseTickets())
$states = array_merge($states, array('closed'));
$states = array_merge($states, array('resolved', 'closed'));
foreach (TicketStatusList::getStatuses(
array('states' => $states)) as $s) {
......@@ -641,7 +641,7 @@ $tcount+= $ticket->getNumNotes();
$s->getId(),
$selected
? 'selected="selected"' : '',
$s->getName(),
__($s->getName()),
$selected
? (' ('.__('current').')') : ''
);
......@@ -723,9 +723,9 @@ $tcount+= $ticket->getNumNotes();
<select name="note_status_id">
<?php
$statusId = $info['note_status_id'] ?: $ticket->getStatusId();
$states = array('open', 'resolved');
$states = array('open');
if ($thisstaff->canCloseTickets())
$states = array_merge($states, array('closed'));
$states = array_merge($states, array('resolved', 'closed'));
foreach (TicketStatusList::getStatuses(
array('states' => $states)) as $s) {
if (!$s->isEnabled()) continue;
......@@ -733,7 +733,7 @@ $tcount+= $ticket->getNumNotes();
echo sprintf('<option value="%d" %s>%s%s</option>',
$s->getId(),
$selected ? 'selected="selected"' : '',
$s->getName(),
__($s->getName()),
$selected ? (' ('.__('current').')') : ''
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment