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

Time Spent Mod

2

Comments

  • I am really excited for this update.. I will also be interested in testing.
  • Dear All,

    this is my modification to have timespent in osticket 1.8.1.2. 
    follow all the steps and it will work for you  like for me: ready !!!!!
    Go !!!

    add_time_spent.txt
    4K
    tickets_list.png
    943 x 128 - 12K
    view_ticket.png
    862 x 480 - 22K

  • OSTicket Version v1.9-rc

    I implemented your mods with the following results:

    - When entering data into the timespend field on the ticket, the value does not seem to be saved to the database. When I open another ticket, then go back to the ticket where time was entered, there is no record of the time spend on the ticket.

    - You will notice from the screenshots, that the summary of tickets is also not functioning correctly now.

    Modified files:


    I am in no way a PHP expert, so im hoping you can help.

    image

    image

    image


  • edited May 2014
    > spartacus059 > Dear All,

    this is my modification to have timespent in osticket 1.8.1.2. 
    follow all the steps and it will work for you  like for me: ready !!!!!
    Go !!!

    @spartacus059... am i missing something? - i can't find any files or instructions for your mods!


    [EDIT] ... nevermind - i obviously had to wait for registered account to be approved or something, as now the text file image actually links to .txt, not just a thumbnail!


    cheers.
  • Hello all , If somebody  interrested , I've modify the last version to add the timespent field. ( 1.8.1.2) And it works in declarative mod, like the 1.7 version. It's on my production server , fully functionnal. I take inspiration from this thread to modify my own files. http://www.openscriptsolution.com/ticket-system/osticket/how-to-implement-simple-time-spent-by-staff-on-ticket-in-osticket-1-6-st/ I'll come back soon with the modified files. and the process to modify your own files. See you soon Spartacus
    Hello all , If somebody  interrested , I've modify the last version to add the timespent field. ( 1.8.1.2) And it works in declarative mod, like the 1.7 version. It's on my production server , fully functionnal. I take inspiration from this thread to modify my own files. http://www.openscriptsolution.com/ticket-system/osticket/how-to-implement-simple-time-spent-by-staff-on-ticket-in-osticket-1-6-st/ I'll come back soon with the modified files. and the process to modify your own files. See you soon Spartacus059

  • OSTicket Version v1.9.0 and Version v1.8.(later released) I implemented your mods with the following results: - When entering data into the timespend field on the ticket, the value does not seem to be saved to the database. When I open another ticket, then go back to the ticket where time was entered, there is no record of the time spend on the ticket. - You will notice from the screenshots, that the summary of tickets is also not functioning correctly now. Modified files: tickets.php ticket-view.inc.php tickets.inc.php class.ticket.php
  • OSTicket Version v1.9.0 and Version v1.8.(later released) I implemented your mods with the following results: - When entering data into the timespend field on the ticket, the value does not seem to be saved to the database. When I open another ticket, then go back to the ticket where time was entered, there is no record of the time spend on the ticket. - You will notice from the screenshots, that the summary of tickets is also not functioning correctly now. Modified files: tickets.php ticket-view.inc.php tickets.inc.php class.ticket.php
    image
    imageimageimage
    Time Spend 1.9.txt
    5K
  • Hello !

    This mod  is working for me.
    As I can see  , Your database field is not correctly set. time_spent is  FLOAT  and Setting 4,2  .
    Maybe its , the reason of non working.

    Hope this help !

    spartacus
  • yes, this picture is incomplet, but yes need to be float and setting 4,2, but is working on 1.8 and 1.9, thank you.
  • I got things working except for one thing.

    In the 'my tickets' display, I do not see the time spent column:

    image

    I have double-checked all the code and where it is suppose to be and all seems correct.

    Please advise,


  • I got things working except for one thing. In the 'my tickets' display, I do not see the time spent column: I have double-checked all the code and where it is suppose to be and all seems correct. Please advise,


    this is the code for spend column:

    /include/staff/tickets.inc.php

    near line 204 Remplace this code:

             .' ,ticket.status,ticket.source,ticket.isoverdue,ticket.isanswered,ticket.created ';

    by this ode:

             .' ,ticket.status,ticket.source,ticket.isoverdue,ticket.isanswered,ticket.created,ticket.time_spent ';

    near line 331 rempleace this code:

    <th width="180">
    <a <?php echo $name_sort; ?> href="tickets.php?sort=name&order=<?php echo $negorder; ?><?php echo $qstr; ?>"
                    title="Sort By Name <?php echo $negorder; ?>">From</a></th>

    with this code:

                <th width="120">
                    <a <?php echo $name_sort; ?> href="tickets.php?sort=name&order=<?php echo $negorder; ?><?php echo $qstr; ?>"
                         title="Sort By Name <?php echo $negorder; ?>">From</a></th>
                <th width="160">Time Spent</th>

    near line 428 after this code:

    <td nowrap>&nbsp;<?php echo Format::truncate($row['name'],22,strpos($row['name'],'@')); ?>&nbsp;</td>
                   
    add this code:

    <?php require_once(INCLUDE_DIR.'class.ticket.php'); ?> 
    <?php $ticket= new Ticket($row['ticket_id']); ?> 
    <?php $the_time_spent = $ticket->getTimeSpent(); ?>
    <td nowrap><?php echo $the_time_spent;?>&nbsp;</td>

  • That is perfect...that worked great.

    Thank you for your help!
  •  

    That is perfect...that worked great. Thank you for your help!
    your welcome!
  • for those that are cosmetically concerned:

    in the tickets.inc.php on line 456 you can change this line

    <td colspan="7">

    to

    <td colspan="8">

    to get rid of the darker gray spot at the end of the bottom column underneath the tickets...
  • Thank you!
  • I just added the mod in 1.9 and now i dont even see my tickets anymore...
    The system still says open tickets (2) but in the table it shows: There are no tickets here. (Leave a little early today).  And i dont see the time spend column, so my guess is i have not placed your code at the correct places due the guide not being 100% correct anymore. 

    Even some of your stated lines dont match anymore in 1.9 and the text you say we need to look for (example: on line 429 find X, X is not there). so this is all getting best guess work... please update this, or get the developers to add this function native!
  • This mod was not written or intended to be used with 1.9. I recommend that you revert to stock.
  • edited May 2014
    Only tested osTicket-v1.8.1.2  => Time Spent mod with on-call tracking for on-call duty employee.

    I currently added an on-call tracking for an on-call duty person.
    A lot of company do have an on-call person\field tech and needs to track it's time to get paid.  And an on-call person could use some help from it's team.  The person who help the on-call person can also record it's own minutes.

    When you view the ticket it will show the on-call person's time spent and total ticket time spent.
    IF someone else helps the on-call person to resolve the ticket.  The second employee's name will appear below the time spent with the on-call person.

    The inserted image below is a sample of working Time Spent with on-call duty.
    Ticket is assigned to the on-call person and enter it's time spent.
    The person who helped the on-call person can also add it's own time spent.  If the image does not show below hit the link.

    imageimage


    In the "Advance Search"  ->  I added a new search area for the on-call person.  The search result will only output the tickets that are tagged "on-call" for a selected employee.  


    I currently built this for 3 on-call duty employees, the coding is designed for 3 employees only.  I want to share it when it's ready.  Meaning it will use the staff table with added column and on-call duty feature will only get activated during a specified date/time.  This will avoid entering minutes for on-call during non on-call hours/days.  And still working a better export format after the search.

    BTW:  If you guys think this is useful I can start a new thread or keep it in this thread.

    Cheers :)
  • to print the spend time on the tickets you need to modified this file class.pdf.php

    I dont's use the SLA and i remplace this fileld on this report.

    near line 216 rempleace this original code:

            $this->SetFont('Arial', 'B', 11);
            $this->WriteCell($l, 7, 'SLA Plan', 1, 0, 'L', true);
            $this->SetFont('');
            $sla = $ticket->getSLA();
            $this->WriteCell($c, 7, $sla?$sla->getName():' -- ', 1, 0, 'L', true);

    with this code:

            $this->SetFont('Arial', 'B', 11);
            $this->WriteCell($l, 7, 'Time Spend', 1, 0, 'L', true);
            $this->SetFont('');
            $the_time_spent = $ticket->getTimeSpent();
            $this->WriteCell($c, 7, $the_time_spent, 1, 0, 'L', true);

    and you can print tickets with the spend time.

  • Only tested osTicket-v1.8.1.2  => Time Spent mod with on-call tracking for on-call duty employee. I currently added an on-call tracking for an on-call duty person. A lot of company do have an on-call person\field tech and needs to track it's time to get paid.  And an on-call person could use some help from it's team.  The person who help the on-call person can also record it's own minutes. When you view the ticket it will show the on-call person's time spent and total ticket time spent. IF someone else helps the on-call person to resolve the ticket.  The second employee's name will appear below the time spent with the on-call person. The inserted image below is a sample of working Time Spent with on-call duty. Ticket is assigned to the on-call person and enter it's time spent. The person who helped the on-call person can also add it's own time spent.  If the image does not show below hit the link. http://bit.ly/1k7lbv6 In the "Advance Search"  ->  I added a new search area for the on-call person.  The search result will only output the tickets that are tagged "on-call" for a selected employee.   I currently built this for 3 on-call duty employees, the coding is designed for 3 employees only.  I want to share it when it's ready.  Meaning it will use the staff table with added column and on-call duty feature will only get activated during a specified date/time.  This will avoid entering minutes for on-call during non on-call hours/days.  And still working a better export format after the search. BTW:  If you guys think this is useful I can start a new thread or keep it in this thread. Cheers :)
    i need this you finish this or is example, i need to track the time spend by tech.
  • Excellent Mod

    how would I add total time spent to Template ticket Response/Reply?


  • can anyone edit the mod to make it work with 1.9.2 ?
    i can't download file of johanbroersma that said it work on 1.9.2

  • I am actually running 1.9.1 at the moment. Have not tested on 1.9.2
  • We're in a 1.8 section but since the topic has been raised, I've got it working on 1.9.2 on this thread
  • Here's a bit different approach for those who want.  

    Instead of Table Alterations I created a new table and linked.   I have Total Time Spent on each ticket at top / each reply/internal note that has a time entry attached it will show how much on each entry response.  As well as time entry's you can specify what type of time was done, ie: travel, programming, etc.   I needed to hurry up and get this going but I will advance it more as I go and if people have suggestions / additions I am more than happy to apply (if they feasible).

    Attached is the ZIP of the Files, DB Alteration, and README.   Let me know if any issues.
    TimeEntry.zip
    49K
    Untitled-1.jpg
    957 x 902 - 67K
    Untitled-2.jpg
    938 x 576 - 27K
  • cgregory,

    Any way to have a report show the details of the ticket and the time each technician spent on the account? Very interested in this...
  • If I understand right it already has what your asking. In the first screen shot at the bottom it shows the 15 minutes for programming, sorry I should have done multiple entry's to show it in action. For every entry it will show the time that tech entered for that entry. The top is the only location where it will show total time (tally of all time entry's). Is this what your asking?
  • cregory,

    That would work - but just like you said with the total time. If one person worked on a ticket then you should show total time. But if you had mutiple people working on the ticket you could have somethink like:

    Total Time: 2 hrs
    John: 1.5 hrs
    Zach: .5 hrs
  • It would also be nice to see the total time on the ticket.php screen
Sign In or Register to comment.