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

Organization / Customer Column

Hi everyone!

We had an extra column in 1.9.14 and older which showed the organization of the ticketowner.
This was done by simply editing the select-statement with another join (of the organization table).

After updating our testsystem to 1.10, I wanted to reimplent this column but there were slight changes in the direction of object oriented php and I have seriously no idea how to do it know...

Does anyone have some hints for me?
Tagged:

Comments

  • This thread covers pretty much every contemporary version of osTicket for how to add columns.


    Side note: once the Custom Queues feature is included editting the source for this should no longer be necessary.
  • I saw greezybacon had a branch on this on github, but now that he's gone do we know if/when the feature will continue to be developed or included?


  • Last I heard it was going to be included with 1.11.
  • We didn't add an Organization or Customer column, but we added the Help Topic column by doing the following. Maybe it will help someone figure out how to add the column(s) they need my making a couple tweeks:

    In the include\staff\tickets.inc.php file


    Add Line 33: 'topic' => __('Help Topic')

    Add Line 77: 'topic' => array(
    Add Line 78: 'width' => '16%',
    Add Line 79: 'heading' => __('Help Topic'),
    Add Line 80: 'sort_col' => 'topic',
    Add Line 90: ),

    Add 'topic', to $queue_sort_options = array at lines 89, 96, 107, 116, 196
    Add 'topic', to $tickets->values( at line 375

    Add Line 602 <td class="nohover" align="left">
    Add Line 603 <?php echo Topic::getLocalNameById($T['topic']); ?></td>

    Change Line 613 <td colspan="8">

    Hope this helps someone.
  • Thanks for the responses, it would work, if the organization-table is directly associated with the ticket table but the relation has to go over the user table.
    ticket table < (join user table < join organization table)

    Looks like I have to wait for the 1.11 version :/
  • edited November 2016
    Add a user column, like Phone, to the main Tickets Table
    File tickets.inc.php

    First add the Phone Column bellow line 35

    // Queues columns
    $queue_columns = array(

    //new code start here 

            'phone' => array(
                'width' => '16%',
                'heading' => __('Phone'),
                'sort_col'  => 'user__cdata__phone',
    //End new code          ),  


    Then, add variable to $tickets->values bellow line 380

    // Select pertinent columns
    // ------------------------------------------------------------
    $tickets->values(             ,'user__cdata__phone',


    and finally to show it in the table, put the code inside foreach line 506.
    Maybe line 572 is a good place

                    <td>  <?php echo $T['user__cdata__phone']; ?>     </td>     

    You can view my fork in github/mpoma/osticket

    Enjoy...........
  • Hi, could anyone help with adding a custom list?

    I have a custom list (tickettype) that has four options i have followed the steps above but i only get the id displayed, how do i get the Value (textual description). Is there a function i can call to get it?

    Any help would be appreciated

    Thanks

    Andy
  • I managed to figure it out myself so thought i would help others.

    As mentioned in previous posts:

    Add to Queues columns
    Then, add column to pertinent columns (mine was named cdata__tickettype for a custom list)
    Then add to table definition 
    <td>  <?php echo DynamicList::lookup(['name' => 'ticket type'])->getItem(intval($T['cdata__tickettype'])); ?></td>

    The above works for me and as I am not a developer it might not be the best/most efficient way so please educate me!

    Andy

Sign In or Register to comment.