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

Merge pull request #1273 from protich/issue/client-ticket-status

bug: Fix status display on client interface

Shameless-Self-Merge: <peter@osticket.com>
parents a7f98bb4 a0dbfb8f
No related branches found
No related tags found
No related merge requests found
...@@ -1015,7 +1015,7 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { ...@@ -1015,7 +1015,7 @@ class TicketStatus extends VerySimpleModel implements CustomListItem {
} }
function __toString() { function __toString() {
return $this->getName(); return __($this->getName());
} }
static function create($ht) { static function create($ht) {
......
...@@ -6,13 +6,16 @@ $status=null; ...@@ -6,13 +6,16 @@ $status=null;
if(isset($_REQUEST['status'])) { //Query string status has nothing to do with the real status used below. if(isset($_REQUEST['status'])) { //Query string status has nothing to do with the real status used below.
$qstr.='status='.urlencode($_REQUEST['status']); $qstr.='status='.urlencode($_REQUEST['status']);
//Status we are actually going to use on the query...making sure it is clean! //Status we are actually going to use on the query...making sure it is clean!
$status=strtolower($_REQUEST['status']);
switch(strtolower($_REQUEST['status'])) { switch(strtolower($_REQUEST['status'])) {
case 'open': case 'open':
$results_type=__('Open Tickets'); $results_type=__('Open Tickets');
case 'closed': case 'closed':
$status=strtolower($_REQUEST['status']);
$results_type=__('Closed Tickets'); $results_type=__('Closed Tickets');
break; break;
case 'resolved':
$results_type=__('Resolved Tickets');
break;
default: default:
$status=''; //ignore $status=''; //ignore
} }
...@@ -43,7 +46,7 @@ $$x=' class="'.strtolower($order).'" '; ...@@ -43,7 +46,7 @@ $$x=' class="'.strtolower($order).'" ';
$qselect='SELECT ticket.ticket_id,ticket.`number`,ticket.dept_id,isanswered, ' $qselect='SELECT ticket.ticket_id,ticket.`number`,ticket.dept_id,isanswered, '
.'dept.ispublic, subject.value as subject,' .'dept.ispublic, subject.value as subject,'
.'dept_name,status.name as status, ticket.source, ticket.created '; .'dept_name, status.name as status, status.state, ticket.source, ticket.created ';
$dynfields='(SELECT entry.object_id, value FROM '.FORM_ANSWER_TABLE.' ans '. $dynfields='(SELECT entry.object_id, value FROM '.FORM_ANSWER_TABLE.' ans '.
'LEFT JOIN '.FORM_ENTRY_TABLE.' entry ON entry.id=ans.entry_id '. 'LEFT JOIN '.FORM_ENTRY_TABLE.' entry ON entry.id=ans.entry_id '.
...@@ -127,7 +130,8 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting ...@@ -127,7 +130,8 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting
if($thisclient->getNumResolvedTickets()) { if($thisclient->getNumResolvedTickets()) {
?> ?>
<option value="resolved" <option value="resolved"
<?php echo ($status=='resolved')?'selected="selected"':'';?>> Resolved (<?php echo $thisclient->getNumResolvedTickets(); ?>)</option> <?php echo ($status=='resolved')?'selected="selected"':'';?>><?php
echo __('Resolved'); ?> (<?php echo $thisclient->getNumResolvedTickets(); ?>)</option>
<?php <?php
} ?> } ?>
...@@ -168,24 +172,13 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting ...@@ -168,24 +172,13 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting
if($res && ($num=db_num_rows($res))) { if($res && ($num=db_num_rows($res))) {
$defaultDept=Dept::getDefaultDeptName(); //Default public dept. $defaultDept=Dept::getDefaultDeptName(); //Default public dept.
while ($row = db_fetch_array($res)) { while ($row = db_fetch_array($res)) {
$ticketstatus=''; $dept= $row['ispublic']? $row['dept_name'] : $defaultDept;
switch($row['status']) {
case 'open':
$ticketstatus=__('open');
break;
case 'closed':
$ticketstatus=__('closed');
break;
default:
$ticketstatus=__('open');
}
$dept=$row['ispublic']?$row['dept_name']:$defaultDept;
$subject=Format::htmlchars(Format::truncate($row['subject'],40)); $subject=Format::htmlchars(Format::truncate($row['subject'],40));
if($row['attachments']) if($row['attachments'])
$subject.=' &nbsp;&nbsp;<span class="Icon file"></span>'; $subject.=' &nbsp;&nbsp;<span class="Icon file"></span>';
$ticketNumber=$row['number']; $ticketNumber=$row['number'];
if($row['isanswered'] && !strcasecmp($row['status'],'open')) { if($row['isanswered'] && !strcasecmp($row['state'], 'open')) {
$subject="<b>$subject</b>"; $subject="<b>$subject</b>";
$ticketNumber="<b>$ticketNumber</b>"; $ticketNumber="<b>$ticketNumber</b>";
} }
...@@ -196,7 +189,7 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting ...@@ -196,7 +189,7 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting
href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $ticketNumber; ?></a> href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $ticketNumber; ?></a>
</td> </td>
<td>&nbsp;<?php echo Format::db_date($row['created']); ?></td> <td>&nbsp;<?php echo Format::db_date($row['created']); ?></td>
<td>&nbsp;<?php echo ucfirst($ticketstatus); ?></td> <td>&nbsp;<?php echo $row['status']; ?></td>
<td> <td>
<a href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a> <a href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a>
</td> </td>
......
...@@ -43,21 +43,7 @@ if ($thisclient && $thisclient->isGuest() ...@@ -43,21 +43,7 @@ if ($thisclient && $thisclient->isGuest()
<table class="infoTable" cellspacing="1" cellpadding="3" width="100%" border="0"> <table class="infoTable" cellspacing="1" cellpadding="3" width="100%" border="0">
<tr> <tr>
<th width="100"><?php echo __('Ticket Status');?>:</th> <th width="100"><?php echo __('Ticket Status');?>:</th>
<?php <td><?php echo $ticket->getStatus(); ?></td>
$ticketstatus='';
switch($ticket->getStatus()) {
case 'open':
$ticketstatus=__('open');
break;
case 'closed':
$ticketstatus=__('closed');
break;
default:
$ticketstatus=__('open');
}
?>
<td><?php echo ucfirst($ticketstatus); ?></td>
</tr> </tr>
<tr> <tr>
<th><?php echo __('Department');?>:</th> <th><?php echo __('Department');?>:</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment