Hi,
I have added several fields to osTicket to meet our needs for a service desk I manage.
I'm not a PHP expert (I'm learning) I need to be able to sort the new fields alphabetically. Can someone advise the syntax for this.
Lets say the new variable is 'townland'
The following is the code I have referencing townland on staff/include/tickets.inc.php from the head.
" OR ticket.townland LIKE '%$queryterm%'".
" OR ticket.townland LIKE '%$queryterm%'".
$sortOptions=array('date'=>'ticket.created','ID'=>'ticketID','pri'=>'priority_urgency','dept'=>'dept_name','duedate'=>'duedate','cus'=>'customer','sol'=>'solution','tow'=>'townland','ass'=>'firstname','timeopen'=>'created','subject'=>'subject','pho'=>'phone');
$qselect = 'SELECT DISTINCT ticket.ticket_id,ticket.duedate,lock_id,ticketID,ticket.dept_id,customer,townland,solution,ticket.staff_id,subject,name,ticket.email,dept_name,staff.firstname,staff.lastname '.
',ticket.status,ticket.source,isoverdue,ticket.phone,ticket.created,pri.*,CASE WHEN status = "open" THEN FLOOR(TIME_TO_SEC(TIMEDIFF(now(),ticket.created))/60) ELSE FLOOR(TIME_TO_SEC(TIMEDIFF(ticket.closed,ticket.created))/60) END AS timeopen,count(attach.attach_id) as attachments ';
<th width="150" ><a href="tickets.php?sort=Town&order=<?=$negorder?><?=$qstr?>" title="Sort By Townland <?=$negorder?>">Townland</a></th>
<td class="nohover" align="left"<?=$row?>;"><?=$row?></td>
Thanks in advance.
Q