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

Get organization notes field content in ticket view

I use a "notes" field of the organization to maintain some general information which is important for the ticket processor. In the ticket (detail) view I want to see this note right below the standard info box (Status, Priority, Department ...). I want to do this as modification, until I found a better solution.

I don't develop in PHP very often, although I have some development skills. So I hope someone can help me to get the "notes" content from database. The output part should not be a problem for me.

<table class="ticket_info" ...
-> Here I will add a new row with the notes from organization ...

Get notes/Question:
  • The notes I want to display are stored in table ost_organization__cdata-notes - I am not sure if this is a standard field, it is also possible that we created this field by ourself in the organization form.
  • I found some other calls to access organozational data, e.g. $user->getOrganization()->getName()
  • I assume that getOrganziation will return an object of include/class.organization.php
  • I had a look into this class, but I found no method to return the notes (would be to easy ...), most probably because it is a dynamic field...
  • Is there any other way using this class to get the notes? Maybe with the getDynamicdata method?
Thanks a lot for any input :)


  • edited January 2017
    OK, got it - actually it wasn't to difficult once I understood the organizations class:
    <table class="ticket_info" cellspacing="0" cellpadding="0" width="940" border="0">
            <td width="50%">
                <table border="0" cellspacing="" cellpadding="4" width="100%">
                        <th width="100"><?php echo __('Status');?>:</th>
                        <td><?php echo ($S = $ticket->getStatus()) ? $S->display() : ''; ?></td>
                        <th><?php echo __('Priority');?>:</th>
                        <td><?php echo $ticket->getPriority(); ?></td>
                        <th><?php echo __('Department');?>:</th>
                        <td><?php echo Format::htmlchars($ticket->getDeptName()); ?></td>
                        <th><?php echo __('Create Date');?>:</th>
                        <td><?php echo Format::datetime($ticket->getCreateDate()); ?></td>
                    <!-- Modification -->
                        <td><?php if ($user->getOrganization()) 
                                     echo $user->getOrganization()->getVar('notes') 
                    <!-- End Of Modification -->
  • Glad you got it figured out, and thank you for sharing what you did.

Sign In or Register to comment.