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

Status Column in Agent View

Is there a way to have the "Ticket Status" be a column on Agent view in version 1.10?

Comments

  • It appears that you linked the thread that I was going to point you to. :)
  • I read that whole thread and can't make heads or tails of how to do this in 1.10
  • So things changed a little bit with v1.10, and I just re-learned how to do this.  

    Step 1
    Starting at Line 476 of ./includes/staff/tickets.inc.php:

    Change
    if ($search && !$status)
      unset($queue_columns['priority']);
    else
      unset($queue_columns['status']);

    To
    if ($search && !$status)
      unset($queue_columns['priority']);

    if(!strcasecmp($status,'closed'))
      unset($queue_columns['status']);

    Why?
    Originally, the system is going to only display the priority or the status, not both.  The status will only show up if there is a search.  In the change, I made it look at two different events.  Priority will show as expected, but the status will show only when looking at open tickets.  If you always want to see the status (including when looking at closed tickets), delete the second if statement altogether.

    Step 2
    We need to add the column data for the <td>s.  You should notice that the status field appears between the From and Priority fields.  This is where we will need to put the output for the status.

    Starting at Line 582 of ./includes/staff/tickets.inc.php

    Change
    if($search && !$status){
      $displaystatus=TicketStatus::getLocalById($T['status_id'], 'value', $T['status__name']);
      if(!strcasecmp($T['status__state'],'open'))
        $displaystatus="<b>$displaystatus</b>";
        echo "<td>$displaystatus</td>";
      } else { ?>
        <td class="nohover" align="center"
          style="background-color:<?php echo $T['cdata__:priority__priority_color']; ?>;">
          <?php echo $T['cdata__:priority__priority_desc']; ?></td>
      <?php
      }

    To
    $displaystatus=TicketStatus::getLocalById($T['status_id'], 'value', $T['status__name']);
    if($search && !$status){
      if(!strcasecmp($T['status__state'],'open'))
        $displaystatus="<b>$displaystatus</b>";
      }
      if(strcasecmp($status,'closed'))
        echo "<td>$displaystatus</td>";
    ?>
    <td class="nohover" align="center"
      style="background-color:<?php echo $T['cdata__:priority__priority_color']; ?>;">
      <?php echo $T['cdata__:priority__priority_desc']; ?></td>

    Why?
    I separated out the if statements so that the status would display so long as the status was not set to closed.  If you always want to see the status, just remove the if(strcasecmp($status,'closed')) statement and you will always see that column.
  • Thank you rowlandan25!

    It works perfectly, I just added to line 607(number after the addition of your modifications):
    <td colspan="8"> instead of 7.
    It did not change the functionality, but it kept the previous appearance.

  • Thanks so much for posting this!! I have a quick question. I am doing a "test" upgrade on the system, and after adding the code, I noticed the top section still is off a bit from the tickets portion (on the right side). Did this happen to you too, and if so, did you have a fix for that? Just curious if you knew before I started messing with stuff. (picture attached)

    Dustin
    helpdeks.JPG
    1065 x 172 - 34K
  • Disregard my last post... the page wasn't updating the change, came back from lunch and saw it working correctly...

    Dustin
  • Thanks rowlandan25 for a easy mod something that should have been included several releases ago..

    I applied the mod, but have the following display bug (attached).. any ideas?

    Thanx!




    Screenshot_2.jpg
    835 x 323 - 82K
  • RRRrrrr.. image
    Screenshot_2.jpg
    835 x 323 - 82K
Sign In or Register to comment.