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

Column "Organization" in tickets view + view filtered by organization

Hi!

I'm new of osTicket. In our company we are implementing this solution for our agent and for our clients and it works really fine at the moment.

I'm using osTicket v1.10 (901e5ea) and I would like to add a column in ticket view to show "Organization" field. Like this:
image

Also, is it possible to add a filter (maybe near the search box) to choose a specific Organization?

Is there already a solution found for this goal? Or I have to write some code from scratch? Is there already a set of instructions to retrieve data or I have to build all SQL queries?

Thanks in advance for your help!
Tagged:

Comments

  • This thread has directions for most contemporary versions of osTicket.  

    Personally I would just wait for the Custom Queues feature due out in 1.11, or use the feature from github in it's current alpha state.
  • @Pepozzo
    I have recently been modifying our version of 1.10 and I should be able to help you out here.
    If you want this column to show up in every Queue (Open, Answered, Assigned, Closed, etc) it is very easy.
    The only file you need to edit is:
    /include/staff/tickets.inc.php

    around line 37 $queue_columns

    add a column header for organization right before the one for priority, would look like this
    'organization' => array(
    'width' => '10%',
    'heading' => __('Organization'),
    'sort_col' => 'organization', ***********this will be your organization column from your table
    ),

    around line 390, $tickets->values
    you will need to add your organization field into these values, doesn't matter where you put it in the query, I just added mine to the end.

    then around line 598 you will need to add a new line for your table data
    <td> <?php echo $T['organization']; ?> </td> ****VARIABLE should match what you added into the values query above****

    You may need to play around where to place that line so it goes into the correct column.

    I hope this helps.
  • Hello,
    Can you tell me, where is the "from" clause in version 1.10 to add a join to the query ? Because my value is in another table.
    Thanks.
  • @jpichie: This doesn't work. 'organization' is not available in the $tickets array
    @
    ntozier: The link you provide is only relevant for fields in the TicketModel object. Not for 'organization'. (I did use it to add 'topic', which works fine)

    I use the 'organization' field in the scp panel in v1.9.x with a custom query as outlined in a post somewhere on this forum. I tried the same in 1.10 but didn't succeed, apparently I'm not the only one since this question has been asked several times. The reply is always the same link to 'a better ticket list' or the 'wait for 1.11 custom queues' response.

    Unless someone posts a working solution, the latter will be the only option.
  • Hi,

    So finally tried the custom queues feature. It works great!
    https://github.com/greezybacon/osTicket-1.8/tree/feature/custom-queues
  • is greezybacon custom queues avaiable for 1.10? I see it just says 1.8
  • custom queues was written for 1.10.
  • How can I implement this in my current system then.
  • Back up your database.
    Backup your core files.
    Download the changed files for custom queues from the repo.
    Install them in your instance.
  • ntozier, just to make sure, from the link above about custom queues, I don't download ALL of the files from that github right? I am guessing it is only certain ones?
    Some of the dates of last modified are super old.
  • Jpichie if you figure this out let me know
  • Hi everybody,

    i startet with osticket last week and was really excited about it's usability ... but was missing some property's on certain point's. So i startet to figure out how to modify the tool and on my way through the forum i found this thread.

    I'm a newbie in modifying osticket and far away from understanding the complete concept ... and i know that jpichie wanted to help, but sorry ... his soluton is half the truth and is a little bit confusing. So i want to deliver the missing parts and some corrections.

    He is right, that all necessary changes have to take place in : /include/staff/tickets.inc.php.

    The used version is v1.10 (901e5ea), here are the changes i made and which worked for me :

    on line 48 (in the definition of the 'subject'-column) i change the value for the column width from 29.8% to 21.8% (because we need some space for our new column) ...

    on line 57 (before the definition of the 'status'-column) i inserted the following

            'organization' => array(
                'width' => '8%',
                'heading' => __('Organization'),
                'sort_col' => 'user__org__name',
                ),

    here are the first differences ... i choose a width of 8%, cause the handling of the column-width is a little bit tricky in here and for me this delivered the best results ... the sort_col must be 'user__org__name', because neither the organization-id nor the -name are part of the ticket. But they can be reached over the user dataset. Notice, the divider's are double underscores '__' !!!

    at (unmodified original) line 377 (behind 'user__default_email__address' and before 'source'),i inserted a single line with the required field :

    'user__org__name',

    in (unmodified original) line 551 i change the value '$base = 279;' to 219 ...
     
    at (unmodified original) line 584 (before the 'body'-part of the ticket status), i inserted :

                    <td nowrap><div style="max-width: 100px; max-height: 1.2em">
                      <?php
                        $org = substr($T['user__org__name'],0,12);
                         echo Format::htmlchars($org);
                      ?></div>
                    </td>

    I delimited the length of the name ! ... and on (unmodified original) line 604 :

    change <td colspan="7"> to <td colspan="8">

    ... that's it.

    For me it works as a quick and dirty method, without modifiying the hole installation. Some may prefer a more 'professional' solution ... but not everybody has the time to be professional ... he has to be efficient ;-)

    hope this helped somebody ...
     
  • @bschramm
    this is literally exactly what I did, you just gave it a way better explanation with the field he actually required.
    I suppose with my explanation, you would need to have some sort of PHP/MySQL knowledge to troubleshoot the issues you encounter.
    so for that, thank you for your more detailed explanation, hopefully it was able to help him.
  • This is all great information from you guys, thank you very much for this. @Pepozzo, let us know if this is what you are looking for.
  • Hi. Could someone tell me how to implement Custom Quenes in 1.10? Which files from https://github.com/greezybacon/osTicket-1.8/tree/feature/custom-queues should I implement?
  • I've implemented Custom Quenes by upgrading my existing installation from github, I've used all files form zip package.
This discussion has been closed.