diff --git a/include/class.list.php b/include/class.list.php index f6bc85ea95b0063f44359f7c44374e795ee63131..274009de9e1a2f82ae458143f0b405aa78363aa4 100644 --- a/include/class.list.php +++ b/include/class.list.php @@ -1015,7 +1015,7 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { } function __toString() { - return $this->getName(); + return __($this->getName()); } static function create($ht) { diff --git a/include/client/tickets.inc.php b/include/client/tickets.inc.php index 2453f4f30844d318a61e994408fcf41277eaf7d0..23de9015af7d85bf9c03a5bd0eb0e81d7f3a3976 100644 --- a/include/client/tickets.inc.php +++ b/include/client/tickets.inc.php @@ -6,13 +6,16 @@ $status=null; if(isset($_REQUEST['status'])) { //Query string status has nothing to do with the real status used below. $qstr.='status='.urlencode($_REQUEST['status']); //Status we are actually going to use on the query...making sure it is clean! + $status=strtolower($_REQUEST['status']); switch(strtolower($_REQUEST['status'])) { case 'open': $results_type=__('Open Tickets'); case 'closed': - $status=strtolower($_REQUEST['status']); $results_type=__('Closed Tickets'); break; + case 'resolved': + $results_type=__('Resolved Tickets'); + break; default: $status=''; //ignore } @@ -43,7 +46,7 @@ $$x=' class="'.strtolower($order).'" '; $qselect='SELECT ticket.ticket_id,ticket.`number`,ticket.dept_id,isanswered, ' .'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 '. 'LEFT JOIN '.FORM_ENTRY_TABLE.' entry ON entry.id=ans.entry_id '. @@ -127,7 +130,8 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting if($thisclient->getNumResolvedTickets()) { ?> <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 } ?> @@ -168,24 +172,13 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting if($res && ($num=db_num_rows($res))) { $defaultDept=Dept::getDefaultDeptName(); //Default public dept. while ($row = db_fetch_array($res)) { - $ticketstatus=''; - switch($row['status']) { - case 'open': - $ticketstatus=__('open'); - break; - case 'closed': - $ticketstatus=__('closed'); - break; - default: - $ticketstatus=__('open'); - } - $dept=$row['ispublic']?$row['dept_name']:$defaultDept; + $dept= $row['ispublic']? $row['dept_name'] : $defaultDept; $subject=Format::htmlchars(Format::truncate($row['subject'],40)); if($row['attachments']) $subject.=' <span class="Icon file"></span>'; $ticketNumber=$row['number']; - if($row['isanswered'] && !strcasecmp($row['status'],'open')) { + if($row['isanswered'] && !strcasecmp($row['state'], 'open')) { $subject="<b>$subject</b>"; $ticketNumber="<b>$ticketNumber</b>"; } @@ -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> </td> <td> <?php echo Format::db_date($row['created']); ?></td> - <td> <?php echo ucfirst($ticketstatus); ?></td> + <td> <?php echo $row['status']; ?></td> <td> <a href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a> </td> diff --git a/include/client/view.inc.php b/include/client/view.inc.php index 8a6c2c4ee7d3b049a2e77e9c1ff1f3124cf40753..454cc9e7d80e8977d32803417dc927d8167ef0e7 100644 --- a/include/client/view.inc.php +++ b/include/client/view.inc.php @@ -43,21 +43,7 @@ if ($thisclient && $thisclient->isGuest() <table class="infoTable" cellspacing="1" cellpadding="3" width="100%" border="0"> <tr> <th width="100"><?php echo __('Ticket Status');?>:</th> - <?php - - $ticketstatus=''; - switch($ticket->getStatus()) { - case 'open': - $ticketstatus=__('open'); - break; - case 'closed': - $ticketstatus=__('closed'); - break; - default: - $ticketstatus=__('open'); - } - ?> - <td><?php echo ucfirst($ticketstatus); ?></td> + <td><?php echo $ticket->getStatus(); ?></td> </tr> <tr> <th><?php echo __('Department');?>:</th>