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

[MOD] Report Page v5.0

12346

Comments

  • scottro;28861 said:
    Yer saying you use that instead of ost_dept or??? I'm confused.
    I mean, I already change the usage of ost_department
    1. I used ost_department for Group of Help Topic
    ex.

    | Group | Topic
    --------------------------
    | software | Windows XP
    | software | Office
    | Hardware | Motherboard
    | Hardware | Monitor



    2. so I create another table to fill Department called ost_dept that filled with department, Purchasing, Accounting, Administration, Service, etc.

    and now I want to make report by this Department (ost_dept)
  • Thx

    Thank for the mod it's perfect !

    Just a question about Internet Explorer, I can't see the chart with IE8 or 9 ? Is it normal ? Do I have to do something ?

    Again many thanks for your great work ! :)
  • CSS Broken
    berlinger;28018 said:
    yes, Problem fixed... just to stupid to read all the instructions :-)


    But have anyone a German Version? Maybe a Alpha...


    Hi Berlinger,

    I'm having the same issue -my css broken after replacing the code. I was wondering if you could share with me how you fix it? Many thanks in advanced.

    Mike
    header.txt
    4K
    css_broken.jpg
    1280 x 760 - 83K
  • Thank you so much for this mod. Works like a charm and very helpful.

    Thanks again :)
  • Ketah;29257 said:
    Thank for the mod it's perfect !

    Just a question about Internet Explorer, I can't see the chart with IE8 or 9 ? Is it normal ? Do I have to do something ?

    Again many thanks for your great work ! :)
    Hi, perhaps for some who have still the problems:
    edit the file reports.php in the scp folder.
    At the start of line 177 there are the blocks of the different types (day, staff,...)
    For each type there is the "echo" part, which outputs the diagramdata.
    In the first 3-4 types there is a "," and the end.
    Replace the "," with "$comma" (without the "").
  • Additional Fields

    Hi Everyone

    I've spent quite a bit of time searching the forums first before posting, so my apologies if I missed the solution to this (and would appreciate a link to where I could find it!)

    I've implemented the reporting module and it works perfectly. I have a few other mods I'm wanting to install, one of them being the ability to add additional fields to the ticket but I'm not sure how to go about including them in reporting.

    We currently use osTicket for support issues with our products. We have 5 different products, with categories of support for each product (firmware, software, connection, etc). Right now we're using the Help Topics for the categories, but I want to add the additional product field so we can track these issues to each product.

    If I go through and add this additional field can I add this to the report module? I know PHP decently well, but I don't do a lot of short-handed coding so I get lost going through the files trying to trace it all out.

    Any help/suggestions would be greatly appreciated. Merry Christmas!
  • Hello,

    With the arrrival of this new year I have noticed a bug on this MOD v5.0.

    At statistics section, it performs well calculations but not for this year. It raises an error at function duration() when returning values.

    image

    image

    Any help will be highly appreciated :D
  • Nevermind... it was caused due to there were not closed tickets for this current year. Once closed, the time calculation is working fine.
  • Excellent !!! yesterday I implemented this MOD and work it fine.

    Thanks a lot.
  • Any Chance of this being ready to go on 1.7?

    Hi scottro,

    I know you have a life, but I figure Ill ask before anyone else does; any Chance of getting this working on 1.7?


    It seems like an obvious mod, Im not sure why osticket hasn't gobbled this up.

    In any case, thanks for sharing.
  • Yea, I suppose I'd better ;)

    I'll try to get to it sometime in March/April.
  • Great mod, thanks alot!

    I've got two questions:

    • Is it possible to add the real-time statistics to another page?
      e.g. in the staff header or the client frontpage.

    • Can I add new report criterias in an easy way?
      e.g. average handling time per staff agent
    Thanks!

    Robert
  • PleXy;36335 said:
    Great mod, thanks alot!

    I've got two questions:

    • Is it possible to add the real-time statistics to another page?
      e.g. in the staff header or the client frontpage.

    • Can I add new report criterias in an easy way?
      e.g. average handling time per staff agent
    Thanks!

    Robert
    Is it possible? Yes, you can copy and paste whatever relevant code for each report.

    Adding a new report? Add - Yes, easy? No.
  • Thanks, ill test it out!

    Are you planning to add more reports on a later version?
    Would also be cool if it's possible to see oldest open ticket for each help topic somewhere.
  • Trouble with 1.7

    Parse error: syntax error, unexpected end of file in C:\xampp2\htdocs\upload\scp\reports.php on line 617

    When I Navigate directly to the reports Page I get the Above error.

    I've done absolutely everything I can think of to troubleshoot the problem, but I am not a programmer and I Haven't had any luck deciphering the problem on my own. Has Anyone else been able to get this working on 1.7??

    I've already tried the following:
    -Fresh install of Xampp ( apache, mysql, php )
    -Fresh install of osTicket ( to remove all modded files )
    -Compiled php Code for reports.php to check for errors in "Netbean" program ( as recommended by one of internal programmers )
    -Various un successful changes to reports.php code

    Installed:
    Xampp on Windows XP sp3
    •Apache 2.4.3
    •MySQL 5.5.27
    •PHP 5.4.7
    •phpMyAdmin 3.5.2.2

    Any help / Advice would be greatly appreciated. I've spent a full day troubleshooting this and still no luck :(
  • @Rionoskae,
    This mod was not written to work with and does not work with 1.7.x Scottro is in the process of updating it to work with 1.7ST currently. I recommend that you wait until it is available for the new version.
  • ntozier;38350 said:
    @Rionoskae,
    This mod was not written to work with and does not work with 1.7.x Scottro is in the process of updating it to work with 1.7ST currently. I recommend that you wait until it is available for the new version.
    Fair enough :) Thanks for the quick reply. I know it wasn't developed with 1.7 in mind - But Their was a user reporting being able to use it with 1.7 on his Project Page. http://sudobash.net/ostickets-reports/

    I was hoping perhaps someone else was able to get it working and could lend some advice... i guess I'll just have to be patient!

    Additional Notes:
    *Just Tested on 1.6 - Works just Fine in Same enviornment.
    *Above error no longer occurs when accessing reports.php in 1.7 Since enabling "Short_Open_Tag" in PHP.INI - Now simply recieve "This page cannot be displayed"
  • That's the authors web site, and I do not see where he's reported it working with 1.7. :) He and I talk on a regular basis and I usually test new releases before he lets them go into the wild. At this time there is no beta version for 1.7. I'll ping him again later today though and see if I can't get him to give me a better estimate of release. :)
  • ntozier;38377 said:
    That's the authors web site, and I do not see where he's reported it working with 1.7. :) He and I talk on a regular basis and I usually test new releases before he lets them go into the wild. At this time there is no beta version for 1.7. I'll ping him again later today though and see if I can't get him to give me a better estimate of release. :)
    That would be great! Again - Very much appreciated.

    Sorry if I worded it odd -What I meant was, one of the users had posted that they were able to get this MOD working running version 1.7 rc2. in a Reply to his Post. If there is any way at all I can help - Please let me know. :D
  • Status? Can we help?

    Hi Scottro,

    First thank you for creating a very useful mod; dedicating the time to create and maintain it.

    I was wondering if can you let us know how the conversion to 1.7 is going; how we can help, etc.

    Thanks.
  • I use the reports in v1.7, it works after making some few changes. Example $thisuser should change to $thisstaff and wherever you have a post action below it add
    <?php csrf_token(); ?>

    search for TICKET_RESPONSE_TABLE in different files (Eg. avgrespontime_alltime.php) to TICKET_THREAD_TABLE
    I did that and it worked for me in 1.7:)
  • merali780;40033 said:
    I use the reports in v1.7, it works after making some few changes. Example $thisuser should change to $thisstaff and wherever you have a post action below it add
    <?php csrf_token(); ?>

    search for TICKET_RESPONSE_TABLE in different files (Eg. avgrespontime_alltime.php) to TICKET_THREAD_TABLE
    I did that and it worked for me in 1.7:)
    Awesome! Thank you for figuring this out, I'm trying to replicate your changes to get this working with 1.7. Can you elaborate on what you mean by "post action" ?
  • Just add it after any tag.

    This is everything I have done as well to get it working and it works for me but when I gave the files to someone else they weren't able to get the files running.
  • Ok I think i got it :D - I will detail each step shortly and put together a quick little guide for 1.7 and hopefully it work for anyone else looking to use this in 1.7 :D Thanks a ton guys!!
  • Rionoskae;40049 said:
    Ok I think i got it :D - I will detail each step shortly and put together a quick little guide for 1.7 and hopefully it work for anyone else looking to use this in 1.7 :D Thanks a ton guys!!

    Just to update, TICKET_THREAD_TABLE has all kinds of responses, Internal Notes, Replies and Messages from Client, to get the responses from staff you will have to add a condition where thread_type = 'R'
  • Updated for 1.7

    Download and Copy the Reports MOD From http://sudobash.net/ostickets-reports/

    Copy it to the \scp Folder as described on sudobash. Follow his Guide to modify your SQL DB and add the required tables. You will also need to follow his guide to add a Link to the Reports Page.

    \scp\reports_admin.php

    ADD @ Line 40
     
    <?php csrf_token(); ?>


    Then Replace all instances of " $thisuser " with " $thisstaff "

    \scp\reportsForm.php

    Add @ Line 11
     
    <?php csrf_token(); ?>



    \scp\reports.php

    Replace all instances of " $thisuser " with " $thisstaff "



    \scp\reports_includes\avgresponsetime_alltime.php

    Replace All instances of TICKET_RESPONSE_TABLE with TICKET_THREAD_TABLE

    Below all instances of "WHERE main.ticket_id = sec.ticket_id" add "sec.thread_type = 'R' "



    \scp\reports_includes\functions.php

    Replace all instances of TICKET_RESPONSE with TICKET_THREAD


    Now everything appears to be working as far as I can tell, However making changes in the Admin page or running a report takes longer than it probably should....but other than being a bit slow to respond everything appears to be working.


    Scottro:
    The only part of your MOD i wasn't able to translate into 1.7 was the last section of code as shown below. Is this still necessary in 1.7? If so, what am i missing??

    include/class.ticket.php
    remove staff_id=0


    Please comment if you you are able to get this working in 1.7 as well so we can help Scottro get this ready for 1.7 release!!

    ~Cheers:D
  • merali780;40050 said:
    Just to update, TICKET_THREAD_TABLE has all kinds of responses, Internal Notes, Replies and Messages from Client, to get the responses from staff you will have to add a condition where thread_type = 'R'
    Sorry i'm not really a coder....care to elaborate on that one as well?? I need step by step instructions or it takes me a while to dig through the code and figure it out....
  • Rionoskae;40052 said:
    Sorry i'm not really a coder....care to elaborate on that one as well?? I need step by step instructions or it takes me a while to dig through the code and figure it out....

    if you look at avgrespontime_alltime.php we have the following code
    <?php
    // MySQL Query from HELL
    $query = \"
    SELECT
    AVG(
    FLOOR(DATEDIFF(
    (SELECT sec.created
    FROM \".TICKET_THREAD_TABLE.\" as sec
    WHERE main.ticket_id = sec.ticket_id
    GROUP BY sec.ticket_id)
    ,main.created)/7)*5 +
    DATEDIFF(
    (SELECT sec.created
    FROM \".TICKET_THREAD_TABLE.\" as sec
    WHERE main.ticket_id = sec.ticket_id
    GROUP BY sec.ticket_id)
    ,main.created)%7 -
    IF( DAYOFWEEK(main.created) = 1, IF(DAYOFWEEK(
    (SELECT sec.created
    FROM \".TICKET_THREAD_TABLE.\" as sec
    WHERE main.ticket_id = sec.ticket_id
    GROUP BY sec.ticket_id)
    ) = 7, 2, 1),
    IF( DAYOFWEEK(main.created) = 7, IF(DAYOFWEEK(
    (SELECT sec.created
    FROM \".TICKET_THREAD_TABLE.\" as sec
    WHERE main.ticket_id = sec.ticket_id
    GROUP BY sec.ticket_id)
    ) = 1, 1, 2),
    IF( DAYOFWEEK(
    (SELECT sec.created
    FROM \".TICKET_THREAD_TABLE.\" as sec
    WHERE main.ticket_id = sec.ticket_id
    GROUP BY sec.ticket_id)
    ) < DAYOFWEEK(main.created), 2, 0 )))
    ) as fubar
    FROM \".TICKET_TABLE.\" as main\";
    $result=mysql_query($query);
    $fu = mysql_result($result,0);
    // convert days to seconds (*24 hours *60 minutes *60seconds)
    $timeInSeconds = $fu * 24 * 60 * 60;

    echo \"<b>All Time:</b> \".duration($timeInSeconds).\"<br>\";

    ?>


    so where you see the code WHERE main.ticket_id = sec.ticket_id below it add AND sec.thread_type = 'R' to get all replies from staff.
    Note: Running the Reports page may take a while as it takes the info from the DB and displays the same as graph(Pie Chart)
  • Got it! - Updated my post as well. Thank you!
  • Moved this MOD from my Base install of 1.7 to our production enviorment ( with data/ ticket info / etc )

    The average response time / reply time / etc doesn't appear to be working 100% correctly.... see screenshot. Otherwise everything works great :)
    Reports_avgtime.jpg
    905 x 347 - 35K
Sign In or Register to comment.