Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Show customer phone in staff index view

I would like to be able to see and sort the customers phone number (perhaps instead of priority if adding a whole new column is too much work).

I have found the relevant sections in the tickets.inc.php file. I'm just not sure how to grab/reference to the phone number information in the database (if possible). Any help would be greatly appreciated.

The header row:


<?if($canDelete || $canClose) {?>
 
<?}?>

<?=$qstr?>" title="Sort By Ticket ID <?=$negorder?>">Ticket

<?=$qstr?>" title="Sort By Date <?=$negorder?>">Date
Subject

<?=$qstr?>" title="Sort By Category <?=$negorder?>">Department

<?=$qstr?>" title="Sort By Priority <?=$negorder?>">Priority

From


and then the table row:

" id="<?=$row['ticket_id']?>">
<?if($canDelete || $canClose) {?>

" onClick="highLight(this.value,this.checked);">

<?}?>
" nowrap>
Ticket" title="<?=$row['source']?> Ticket: <?=$row['email']?>"
href="tickets.php?id=<?=$row['ticket_id']?>"><?=$row['ticketID']?>

<?=Format::db_date($row['created'])?>
class="Icon <?=$flag?>Ticket" title="<?=ucfirst($flag)?> Ticket" <?}?>
href="tickets.php?id=<?=$row['ticket_id']?>"><?=Format::truncate($row['subject'],32)?>

<?=$row['dept_name']?>
;"><?=$row['priority_desc']?>
<?=Format::truncate($row['name'],32)?>

Comments

  • This is possible if you want.

    Do the following in ./include/staff/tickets.inc.php:

    Change
    $sortOptions=array('date'=>'ticket.created','ID'=>'ticketID','pri'=>'priority_urgency','dept'=>'dept_name');

    into
    $sortOptions=array('date'=>'ticket.created','ID'=>'ticketID','pri'=>'priority_urgency','dept'=>'dept_name','pho'=>'phone');

    Change
    $qselect = 'SELECT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,subject,name,email,dept_name '.
    ',status,source,isoverdue,ticket.created,pri.*';
    $qfrom=' FROM '.TICKET_TABLE.' ticket LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '.
    ' LEFT JOIN '.TICKET_PRIORITY_TABLE.' pri ON ticket.priority_id=pri.priority_id '.
    ' LEFT JOIN '.TICKET_LOCK_TABLE.' tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() ';

    into
    $qselect = 'SELECT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,subject,name,email,dept_name '.
    ',status,source,isoverdue,ticket.created,ticket.phone,pri.*';
    $qfrom=' FROM '.TICKET_TABLE.' ticket LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '.
    ' LEFT JOIN '.TICKET_PRIORITY_TABLE.' pri ON ticket.priority_id=pri.priority_id '.
    ' LEFT JOIN '.TICKET_LOCK_TABLE.' tlock ON ticket.ticket_id=tlock.ticket_id AND tlock.expire>NOW() ';

    Change
    <th width=\"70\">
    <a href=\"tickets.php?sort=pri&order=<?=$negorder?><?=$qstr?>\" title=\"Sort By Priority <?=$negorder?>\">Priority</a></th>

    into
    <th width=\"70\">
    <a href=\"tickets.php?sort=pho&order=<?=$negorder?><?=$qstr?>\" title=\"Sort By Phone <?=$negorder?>\">Phone</a></th>

    and change
    <td class=\"nohover\" align=\"center\" style=\"background-color:<?=$row['priority_color']?>;\"><?=$row['priority_desc']?></td>

    into
    <td class=\"nohover\" align=\"center\"><?=$row['phone']?></td>


    Off course it's also possible to add another row if you want. Try to adjust the code as you see fit.
  • Worked perfectly. I went ahead and added a new column. In order to save myself headaches I didn't change the overall table size. I just shrunk some columns to get the space I needed to add some columns.

    Thanks for the help. Bravo!
Sign In or Register to comment.