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 ticket status in tickets view

Hi everybody

I edited tickets.inc.php to add a new column for Ticket Status.

Here is diff code:

--- ./tickets.inc.php    2015-08-19 16:31:22.000000000 +0200
+++ ./tickets.inc.php    2016-05-16 12:44:12.000000000 +0200
@@ -398,12 +398,18 @@
                             title="<?php echo sprintf(__('Sort by %s %s'), __("Closing Agent's Name"), __($negorder)); ?>"><?php echo __('Closed By'); ?></a></th>
                 <?php
                 } else { //assigned to ?>
+                    <th width="50">
+                        <a <?php echo $stat_sort; ?> href="tickets.php?sort=status&order=<?php echo $negorder;?><?php echo $qstr; ?>"
+                            title="<?php echo sprintf(__('Sort by %s %s'), __('Status'), __($negorder)); ?>"><?php echo __('Status');?></a></th>
                     <th width="150">
                         <a <?php echo $assignee_sort; ?> href="tickets.php?sort=assignee&order=<?php echo $negorder; ?><?php echo $qstr; ?>"
                             title="<?php echo sprintf(__('Sort by %s %s'), __('Assignee'), __($negorder)); ?>"><?php echo __('Assigned To'); ?></a></th>
                 <?php
                 }
             } else { ?>
+                <th width="50">
+                    <a <?php echo $stat_sort; ?> href="tickets.php?sort=status&order=<?php echo $negorder;?><?php echo $qstr; ?>"
+                        title="<?php echo sprintf(__('Sort by %s %s'), __('Status'), __($negorder)); ?>"><?php echo __('Status');?></a></th>
                 <th width="150">
                     <a <?php echo $dept_sort; ?> href="tickets.php?sort=dept&order=<?php echo $negorder;?><?php echo $qstr; ?>"
                         title="<?php echo sprintf(__('Sort by %s %s'), __('Department'), __($negorder)); ?>"><?php echo __('Department');?></a></th>
@@ -427,6 +433,7 @@
                 elseif($row['isoverdue'])
                     $flag='overdue';
 
+                $plc=Format::truncate($row['status'],40);
                 $lc='';
                 if($showassigned) {
                     if($row['staff_id'])
@@ -491,6 +498,7 @@
                 <?php
                 }
                 ?>
+                <td nowrap>&nbsp;<?php echo $plc; ?></td>
                 <td nowrap>&nbsp;<?php echo $lc; ?></td>
             </tr>
             <?php



Comments

  • edited May 2016
    Here is tickets.inc.php
    osticket_parche_estados_Tickets.rar
    690B
  • Screen capture
  • Screen capture
    status_column.png
    1360 x 500 - 87K
  • You may want to add a note to the thread
    http://osticket.com/forum/discussion/75457/a-better-ticket-list

    which is where a bunch of folks have posted their alterations to the ticket list.
  • edited May 2016
    Looks really nice, thanks @fbrines
    just the Little design but in the right Corner... here's the little fix :)


    <tr>
         <!--20.05.16 Add column for Ticket Status -->
            <td colspan="8">
      <!--20.05.16 Add column for Ticket Status END-->
                <?php if($res && $num && $thisstaff->canManageTickets()){ ?>
                <?php echo __('Select');?>:&nbsp;
                <a id="selectAll" href="#ckb"><?php echo __('All');?></a>&nbsp;&nbsp;
                <a id="selectNone" href="#ckb"><?php echo __('None');?></a>&nbsp;&nbsp;
                <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a>&nbsp;&nbsp;
                <?php }else{
  • edited May 2016
    There's also a bug in the "Closed Tickets view". The "Ticket Status" is also there, But theres no Table description for the field.

    should be fixed by:

    f($showassigned ) {
                    //Closed by
                    if(!strcasecmp($status,'closed')) { ?>
        <!--Add Column for Ticket Status -->
        <th width="80">
         <a <?php echo $stat_sort; ?> href="tickets.php?sort=status&order=<?php echo $negorder;?><?php echo $qstr; ?>"
           title="<?php echo sprintf(__('Sort by %s %s'), __('Status'), __($negorder)); ?>"><?php echo __('Status');?></a></th>
        <!--Add Column for Ticket Status END-->
        
                        <th width="150">
                            <a <?php echo $staff_sort; ?> href="tickets.php?sort=staff&order=<?php echo $negorder; ?><?php echo $qstr; ?>"
                                title="<?php echo sprintf(__('Sort by %s %s'), __("Closing Agent's Name"), __($negorder)); ?>"><?php echo __('Closed By'); ?></a></th>
                    <?php
  • Thanks, freshE!
  • can you please add here the complete file and not the only the diff file?
    thank you
  • anyone?
  • Tomorrow morning, eshabo.
  • Here is my full  tickets.inc.php file. Hope this help you.
    tickets.inc.rar
    8K
  • wow!!!!
    man I really appreciate it!
    thanks a lot!

  • is there any chance you could add "Estado1" filter right next to the "open(2)" and "my tickets(2)" in the upper frame?
  • @fbrines. Thanks for this mate, it's amazing!
  • Do you have updated version for V1.10?
    I tried to do something but it's working only when the "Open" tab is selected in the nav bar.

  • No, I did not updated yet...
  • Hello fbrines,

    can you please update the ticket view list fpr v1.10 ? Thanks ;)
  • I would like to second this for an udpate if you are still working on this.
  • I am also interested in update of this code (adding ticket status column)...thanks
  • I have attached  the pdf on how we added two columns to our OSticket V1.10 and also attached the already modified ticket.inc.php file you guy have to remove the .txt at the end.

    We added a status column and a department column
    tickets.inc.php.TXT
    28K
    osTicket add to columns - notes.pdf
    373K
  • Anyone know how to add Room Number as a column?
Sign In or Register to comment.