IT’S HERE! REPORTS 6.0 FOR OSTICKET VERSION 1.7
NOTE: If you are running any versions from 2.3 to 4.1 the “Replies per Staff” report is WRONG. I strongly suggest you upgrade to 4.2+
Ok, so after being on the osTicket forum since July 2009 I’ve noticed that one big MOD that everyone wants and never fully gets is reporting. The following is my stab at it.
This MOD has been implemented and tested on 1.6ST and 1.6RC5, please let me know if you run into any issues.
Note: For version 3.3+ you will need to create a scp/reports folder (and make sure its writable by Apache) and place the image (csv.png) into the scp/images folder.
Requirements: MySQL 5
pChart (for use with emailed reports) requires the GD and FreeType PHP extensions.
Note: Reports v2.4+ is compatible with Internet Explorer.
First off you need your actual reports.php page…
English v5.0 [broken link] (Place in your scp/ folder)
Now available in Italiano! Grazie playsoft!
Italiano v3.4 [broken link]
Now you just need to be able to easily browse to it
include/staff/header.inc.php
Replace:
<div id="container"> <div id="header"> <a id="logo" href="index.php" title="osTicket"><img src="images/ostlogo.jpg" width="188" height="72" alt="osTicket"></a> <p id="info">Welcome back, <strong><?=$thisuser->getUsername()?></strong> <?php if($thisuser->isAdmin() && !defined('ADMINPAGE')) { ?> | <a href="admin.php">Admin Panel</a> <?}else{?> | <a href="index.php">Staff Panel</a> <?}?> | <a href="profile.php?t=pref">My Preference</a> | <a href="logout.php">Log Out</a></p>
with
<? // Get the report options $OptionsQuery = "SELECT viewable from ".REPORTS_TABLE." LIMIT 1"; $OptionsResult = mysql_query($OptionsQuery) or die(mysql_error()); while($graphOptions = mysql_fetch_array($OptionsResult)){?> <div id="container"> <div id="header"> <a id="logo" href="index.php" title="osTicket"><img src="images/ostlogo.jpg" width="188" height="72" alt="osTicket"></a> <p id="info">Welcome back, <strong><?=$thisuser->getUsername()?></strong> <?php if($thisuser->isAdmin() && !defined('ADMINPAGE')) { ?> | <a href="admin.php">Admin Panel</a> | <a href="reports.php">Reports</a> <?}else{?> | <a href="index.php">Staff Panel </a> <? if((!$thisuser->isadmin() && !$thisuser->isManager() && $graphOptions['viewable']=='staff') || (!$thisuser->isadmin() && $thisuser->isManager() && (($graphOptions['viewable']=='managers') || ($graphOptions['viewable']=='staff'))) || $thisuser->isadmin()) {?> | <a href="reports.php">Reports</a> <?}?> <?}?> | <?="$isdeptmanager";?><a href="profile.php?t=pref">My Preference</a> | <a href="logout.php">Log Out</a></p> <?}?>
In order to use the “Report Settings” (admin) page then you’ll need to add a new table to your database and then fill it with initial data, make sure and change the table prefix (ost_) if you are not using the default.
CREATE TABLE `ost_reports` ( `3d` TINYINT NOT NULL , `graphWidth` INT NOT NULL , `graphHeight` INT NOT NULL , `resolution` VARCHAR( 255 ) NOT NULL , `viewable` VARCHAR( 255 ) NOT NULL ) ENGINE = MYISAM ;
INSERT INTO `ost_reports` (`3d`, `graphWidth`, `graphHeight`, `resolution`, `viewable`) VALUES ('1', '400', '240', 'hours', 'admins');
Add the REPORTS_TABLE constant to
main.inc.php
below
define('GROUP_TABLE',TABLE_PREFIX.'groups');
add
define('REPORTS_TABLE',TABLE_PREFIX.'reports');
include/class.ticket.php
remove staff_id=0 from the following line (If you do not do this tickets will be unassigned once they are closed and reports regarding staff will be inaccurate):
$sql= 'UPDATE '.TICKET_TABLE.' SET status='.db_input('closed').',isoverdue=0,duedate=NULL,updated=NOW(),closed=NOW() '.
ToDo
- Scheduled email reports
- Average time to initial response.
- Sorting by column title
- Language Support
Hi Scott,
I am new to report , followed your steps however report page showing blank and on top of admin pannel I am getting \\Error on report module
in error logs I am getting below message, kindly suggest
[Wed Dec 05 13:14:21 2012] [error] [client ::1] File does not exist: /var/www/html/images, referer: <a href="http://localhost/osticket/scp/css/main.css">http://localhost/osticket/scp/css/main.css</a>
sendmail: fatal: open /etc/postfix/main.cf: Permission denied
[Wed Dec 05 13:14:24 2012] [error] [client ::1] File does not exist: /var/www/html/images, referer: <a href="http://localhost/osticket/scp/css/login.css">http://localhost/osticket/scp/css/login.css</a>
[Wed Dec 05 13:14:29 2012] [error] [client ::1] File does not exist: /var/www/html/images, referer: <a href="http://localhost/osticket/scp/css/main.css">http://localhost/osticket/scp/css/main.css</a>
[Wed Dec 05 13:14:32 2012] [error] [client ::1] PHP Warning: require_once(reports_includes/functions.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: Permission denied in /var/www/html/osticket/scp/reports.php on line 26, referer: <a href="http://localhost/osticket/scp/index.php">http://localhost/osticket/scp/index.php</a>
[Wed Dec 05 13:14:32 2012] [error] [client ::1] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required ‘reports_includes/functions.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/osticket/scp/reports.php on line 26, referer: <a href="http://localhost/osticket/scp/index.php">http://localhost/osticket/scp/index.php</a>
[Wed Dec 05 13:25:36 2012] [error] [client ::1] File does not exist: /var/www/html/images, referer: <a href="http://localhost/osticket/scp/css/main.css">http://localhost/osticket/scp/css/main.css</a>
sendmail: fatal: open /etc/postfix/main.cf: Permission denied
[Wed Dec 05 13:25:41 2012] [error] [client ::1] PHP Warning: require_once(reports_includes/functions.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: Permission denied in /var/www/html/osticket/scp/reports.php on line 26, referer: <a href="http://localhost/osticket/scp/admin.php?t=email">http://localhost/osticket/scp/admin.php?t=email</a>
[Wed Dec 05 13:25:41 2012] [error] [client ::1] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required ‘reports_includes/functions.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/osticket/scp/reports.php on line 26, referer: <a href="http://localhost/osticket/scp/admin.php?t=email">http://localhost/osticket/scp/admin.php?t=email</a>
Hi,
I got my report page up and running, but when i try to create report i got :Can’t open reports_csv/Report_1355337383.csv”
Please help, Thank you in advance.
Eric
Check your path and permissions for reports_csv directory.
I set all report_xxx folder to 0777 and working, but ,missing the 3D graph any idea?
Hi Scott,
I have noticed the time stamps on my tickets are an hour behind.
I am in the Eastern Standard Time Zone.
When I select the Eastern Standard Time zone it places my tickets on Central Time.
My Server is located in Central Time.
1. I have modified my .htaccess file for EST with the below command. (No effect on tickets)
SetEnv TZ America/New_York
2. I went into the Preferred Timezone: and set it to Atlantic Time. The time shows correctly in preferences, but on the ticket it is an hour behind.
When you setup a new ticket Any suggestions.
Thanks,
Bill
Hi Scott,
I also have tried the Daylight saving check box as well.
Thanks,
Bill
Hi Scott,
I had this message sent on a stale ticket. Where can I edit the message to remove
“Enough baby talk…please address the issue or you will hear from me again.”.
Thanks,
Bill
————————————————————————
Admin,
A ticket, #391320 assigned to you or in your department is seriously overdue.
http://domain.com/helpdesk/scp/tickets.php?id=190
We should all work hard to guarantee that all tickets are being addressed in a timely manner. Enough baby talk…please address the issue or you will hear from me again.
————————————————————————
Pretty sure that comes with the default osTicket install. Should be somewhere in the email templates settings.
Hi Scott,
I have checked the default email templates and I don’t see it there.
Any other suggestions? I’ve checked the SQL databases as well.
I am sure it is something I have over looked.
Regards,
Bill
———————————————————————
Thanks as always for your help.
My donation is on the way. A little $$ helps to say Merry Christmas. I encourage all out there if you like the software and it helps you out please donate. Scott is always answering questions and development is time consuming.
Thanks again.
Hi Scott,
Ooops.. I am addressing this in the wrong forum.
Thanks again.
Bill
I Found It !!!!
Fixed and boy am I blind. Thanks for the help!!!
Thanks very much for the donation! 🙂
I just found “Enough baby talk” inside the ticket_overdue_body field of ost_email_template. If you check the default template again and look in the body section of the ticket overdue area you should find it.
Thanks again!
Hi scott this is very useful mod.
I have question for you .
Can you so me how to create detail message for the report ?
so I can see the details of the ticket (including subject and reply by staff)
thanks sir :D.
Is there a way to change the graph from pie to chart?
Hi Scott,
One thing I noticed after turning on the PHP display errors.
When logged on via the scp admin panel, clicking on “Reports” menu option an error is displayed:
Warning: session_start() [function.session-start]: Cannot send session cache limiter — headers already sent (output started at /usr/home/deb25520/domains/vhac.nl/public_html/support/tickets/scp/reports.php:5) in /usr/home/deb25520/domains/vhac.nl/public_html/support/tickets/main.inc.php on line 46
I briefly looked into the code and it must have something to do with the fact that there’s already data send in the reports.php file before the session start() function is called in main.inc.php, but I have no clue how to solve this. Do you have suggestion?
A second thing is the error being displayed in the Quick Stats part of the page, it seems like the duration calculation in functions.php goes wrong when there’s no data available for a given year:
Warning: implode() [function.implode]: Invalid arguments passed in /usr/home/deb25520/domains/vhac.nl/public_html/support/tickets/scp/reports_includes/functions.php on line 104
I can open a ticket for year 2012 and see if that takes away the error, but I just started using it this year, so I would rather prefer a software solution for this problem.
Any ideas for this issue?
Regards,
Sjaak
We are new users to OS Ticket. This mod is terrific. We have added it while in pre-deployment status and works well. Thanks!
Excellent !!! yesterday I implemented this MOD and work it fine.
Thanks a lot.
Hi can i get some help ived tried to implement this mod but im getting Can’t open reports_csv/Report_1360820383.csv my reports_csv is empty im not sure if i would need to generate a excel and put it there or what thanks
you have to change permission of “reports_csv” folder to 777 .
Doesn’t have to be 777 but it does need to be writable by the user and/or group that your webserver runs as (such as www-data)
Hai
can anyone help me to do this reports configuration.
Regards,
Gani
Hi is a great MOD I used in 1.6, but now I want to use 1.7 so work in 1.7?
Thanks
Hello Scott,
Thank you so much for all your additions. This is the second of your mods I’m installing and I hope o find new one with the new osticket version 🙂 I’m having an issue installing this one though and thought you might know where the error is…
This is my error log:
“GET /ostic/scp/admin.php?t=settings HTTP/1.1” 200 31286 “http://mydomain.com/ostic/scp/admin.php” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /ostic/scp/autocron.php HTTP/1.1” 200 42 “http://mydomain.com/ostic/scp/admin.php?t=settings” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /favicon.ico HTTP/1.1” 500 691 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /favicon.ico HTTP/1.1” 500 691 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“POST /ostic/scp/admin.php?t=pref HTTP/1.1” 200 31363 “http://mydomain.com/ostic/scp/admin.php?t=settings” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /ostic/scp/autocron.php HTTP/1.1” 200 42 “http://lastmilecorp.com/ostic/scp/admin.php?t=pref” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /favicon.ico HTTP/1.1” 500 691 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.17”
“GET /favicon.ico HTTP/1.1” 500 691 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.17 (KHTML, etc. and the GET favicon.ico keeps coming back after going through admin.php and autocron.php
Cheers!
Vicente
Hi Scott,
I really like what you are doing here. I have the same issue that others have seen. I am Using IIS/PHP/MySQL.
When I navigate to the reports page, I get the initial data but then at the bottom of the screen, I do not get any charts and I see the message:
Can’t open reports_csv/Report_1361304333.csv
If you or anyone else has any suggestions, I would greatly appreciate it.
Thanks,
Ryan
/facepalm.
I needed to give IUSER on the local machine write-access to the reports_csv directory.
Thank you for your time.
Can’t open reports_csv/Report_1363245498.csv
Still i have a problem
so anyone can help to solve this??
……….
You need to make sure that you installed the reports mod to the default location and that the permissions are correct.
I installed this reporting feature and have an issue with the avg time tickets remain open and average response time. It is not showing the stats in those sections, has anyone run into this?
Steve, thank you very much for the report module. I implemented it 6 months and the system is really fantastic.
Recently, I configured the e-mail piping so that whenever a customer drops an e-mail, a ticket should be created automatically. It was done successfully.
Then, the issue is:
when I try to generate a report, based on tickets by help topic, the tickets created by email are with help topic ‘null’. I want to create a default help topic where tickets created by email will have as their help topic. Any idea ?
Thanks
Hi Scott,
I’m having trouble installing the Reports mod. My installation is new, using osTickets 1.7; it is on shared hosting with GoDaddy. Here are the problem steps in the installation:
1. In header.inc.php, the starting code I have is not quite the same as what is shown in the instructions. I added in the new code, but the result is the page is truncated following the display of the username.
2. In class.ticket.php, I cannot find any line from which to remove staff_id=0. There are no lines with SET status.
Thanks for making the MOD available.
Cheers,
BD
BD,
Thanks for the reply. The MOD isn’t currently compatible with the new code in 1.7. I *just* started working on getting it to work with 1.7 in the last couple of days and I’m experiencing the same issues as you. I hope to have it compatible in by the end of the month so stay tuned.
Hi Scott,
Many thanks for responding. Please let me know if we can help with testing.
Cheers,
BD
Hi Scott,
Do you have any progress? Or anything we can help?
I need a database with some actual data already in place. I no longer am at a job that uses osTickets so the only data present would be data I manually enter in.
Sorry,
I can not provide you the actual database.
It’s firm property.
But I can help you to test the plugin with actual database.
If you need a database to get the reporting going I can help. Let me know where to send it. I need the reporting feature.
How is the reporting going? Was the database helpful?
Going good other than having someone else install it. They keep running into problems. Hope to have it out before the end of June at the latest.
Hi All,
Where can I download GD and FreeType PHP extensions.
when I click the tab reports an error message appears saying “GD extension must be loaded. ”
Can anyone help me?
Thanks in advanced
Hi All, I’ve already found the problem, I’ve noticed that this MOD is already included in the newer version that can export to file, my problem is that is this MOD capable of exporting tickets including the details of the ticket? like the logs and the activity or the status of the ticket?
thanks in advanced
I managed to get the reports page open in V1.7, I just replaced $thisuser with $thisstaff and found out that ost_ticket_response is not in v1.7 I see all responses are done in ost_ticket_thread so replaced ost_ticket_response with ost_ticket_thread. I see the default query for report criteria but when I change the criteria and submit the query I get an error as HTTP 400 Bad Request. Any idea on this?
ok the error message logged is Invalid CSRF Token __CSRFToken__, any idea on how to solve this?
ok solved the error.
made the following changes in the ReportsForm.php
under
I added
and it stopped giving me an error. Now I will try to actually add some data and see if I get the desired results.
ok solved the error.
made the following changes in the ReportsForm.php
under
“”
I added
” ”
and it stopped giving me an error. Now I will try to actually add some data and see if I get the desired results.
Will this work with OSTicket version 1.7?
Soon…..very soon….
Hi,
after I place youre code in the header.inc.php file, is the lay-out of my Staff Control Panel web page changed.
It seems that the basic structure is gone, tables are spread around the worl page.
Hopefully someone could help me with the problem!
Thanks in advance
greatz
i need help ,i installed ostickets on localhost 127.0.0.1 , when i change de header.inc.php , system returns this “Server Error 500”
What version of osTicket are you running?
Scott
How do I change the pie chart to a line chart?
Thanks
Scott hope you well , i hope you still involved in osticket
i would like to have a feature where customers can rate the IT staff on close of ticket , would it be possible to script within osticket , so that we can rate or measure the IT staff performance or is there any plugin for osticket to include such a feature
Hi Scott;
I think this post is quite old already but I am just starting to build osTicket system for our ISP business. I followed your instructions and I think it’s already working now, which I think i very very good for our business. There’s just one thing I notice at the bottom part of the reporting tab. There’s this one issue saying “Can’t open reports_csv/Report_1383128265.csv”. This Report_numberseries.csv always changes. Is there something I missed or I just need to let it run for a day. I just finished everything now though.
Many thanks in advance and to your very helpful and very useful MOD.
Julius
Julius,
This usually occurs when the file can’t be written into the reports_csv directory. Try setting the permissions on the directory to 775, if that doesn’t work you’ll need to set it to 777.
Hello, Scott, thank you very much for the great module you created. It saved me a lot. Now an issue is, probably, even anyone who is very good at linux can help me:
Before the report was working perfectly. Now, we moved our server to cloud. the same OS(centos 6). When I checked, the module was displaying error: GD extension must be loaded. I installed the 3 extensions:
yum install gcc
yum install php-gd
yum install php-devel
The error disappeared, but no data displaying. Anyone can give me a hint?
You should have a error_log floating around somewhere, can you look in that and see what it is now reporting for an error?
What version are you on now?
6.0.8, which is compatible with (at least) 1.6+
does this or v 6.0 work for osticket v1.9?
v6.x works with 1.7+
Hi really interested in this module will it be compatible for version 1.9.1
You’ll need http://www.sudobash.net/osticket-reports-6-0-osticket-release-1-7/ for 1.7+
Hi, i made these changes to my os ticket install and when you go to the main page it says unknown database. Now im am using mysql for the database on a ubuntu 12 machine. I replaced the header.inc.php with a back up and i was back in business. Any ideas on what would cause this? i dont see others with the same issue?
Hi there. Thank you very much for your work.
Can you give me a hand to install it? I am using osTicket v1.6 ST. My database is called osTicket.
I get lost in this part:
In order to use the “Report Settings” (admin) page then you’ll need to add a new table to your database and then fill It With initial data, make sure and change the table prefix (ost_) if you are not using the default.
CREATE TABLE `ost_reports` (
3d` `TINYINT NOT NULL,
graphWidth` `INT NOT NULL,
graphHeight` `INT NOT NULL,
resolution` `VARCHAR (255) NOT NULL,
viewable` `VARCHAR (255) NOT NULL
) ENGINE = MYISAM;
What should I put in “CREATE TABLE” ??
What would have to backup in case I break something ??
Greetings and thank you very much.
PS: Sorry I did not explain very well, but I do not know much English.
Sorry for the delay in responding to you. Were you able to get this resolved? The CREATE TABLE code can be copied into a mysql command line or phpmyadmin and run to create a new table with the necessary structure. If you want to back up anything beforehand it would be your osticket database.