Quantcast
Channel: Recent Discussions on osTicket Forums
Viewing all articles
Browse latest Browse all 7550

Adding Reports To Organizations

$
0
0
Hi, Guys...
I'm using osTicket 1.10 and sadly it is missing an Organization report, like how many ticket are opened and closed per organizations.

This is my first attempt on modifying codes and to be honest I'm not that good about coding. What I'm about to do is adding report below the organization details like this:


image

And then when we clicked the Reports tab, it will show this tabular data:


image


First thing to do, I'm adding the tab menu on 'org-view.inc.php'. Go to line 78-87 and then add Report tab below the Notes tab like this:

<ul class="clean tabs" id="orgtabs">
    <li class="active"><a href="#users"><i
    class="icon-user"></i>&nbsp;<?php echo __('Users'); ?></a></li>
    <li><a href="#tickets"><i
    class="icon-list-alt"></i>&nbsp;<?php echo __('Tickets'); ?></a></li>
    <li><a href="#notes"><i
    class="icon-pushpin"></i>&nbsp;<?php echo __('Notes'); ?></a></li>
    <li><a href="#reports"><i
    class="icon-bar-chart"></i>&nbsp;<?php echo __('Report'); ?></a></li>
</ul>

and then we will include the template data for the Report below the Notes template on line 100-106 like this:

<div class="hidden tab_content" id="notes">
<?php
$notes = QuickNote::forOrganization($org);
$create_note_url = 'orgs/'.$org->getId().'/note';
include STAFFINC_DIR . 'templates/notes.tmpl.php';
?>
</div>

<div class="hidden tab_content" id="reports">
<?php
include STAFFINC_DIR . 'templates/org-report.tmpl.php';
?>
</div>



Next, go to 'include/staff/templates' and create a new file 'org-report.tmpl.php'.

Now, at the moment I'm extremely confused since I don't know how osTicket linked (or JOIN) ticket ID with the associated organization ID, I can't find the exact code showing that. After checked out the database table, no org_id field on the ticket's table, so how did the osTicket know which ticket belongs to specific organization?

TO BE CONTINUED (I'm hungry, and I will post again after experimenting some codes)

Viewing all articles
Browse latest Browse all 7550

Trending Articles