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 manual mod

Thanks to post by Masino Sinaga for version 1.6 osticket, I've followed those instructions and found edits to make on version 1.9.2 to get the Time Spent modification working.

I've not done lots of testing so far, but it does allow for decimal time entry and subtraction (using negative sign like -0.2) for a deduction.  I've set my time entry to be on the Post Internal Note tab, but you can move the code accordingly if you want it somewhere else.

See attached notes about altering your database table and editing 3 files.  I have not touched reporting at this time.


  • attachment missing
  • edited July 2014
    Thanks for the heads up ntozier
  • Trying again...
  • edited July 2014
    I took this a step further and set it up to save time spent PER internal note.  It now includes a time_type as well.  This requires 3 modifications to the database in total as follows:

    1. ALTER TABLE ost_ticket ADD COLUMN time_spent FLOAT(4,2)  NOT NULL DEFAULT '0.00' AFTER closed;
    2. alter table ost_ticket_thread add column time_spent FLOAT(4,2) NOT NULL DEFAULT '0.00' after thread_type;
    3. alter table ost_ticket_thread add column time_type CHAR(1) NOT NULL after time_spent;
    *NOTE* my attached changed files include another mod to put DEPARTMENT on the ticket list page instead of help topic I think was on there.  I tried commenting all my changes, search for "201407" to find them.

    Again, not fully tested but seems to be working okay.

  • edited July 2014
    Where are the instructions how to attach files in this forum?  So I've got it attached twice.  Seems that attachments have a delay before they show up.
  • What browser are you using? If you are using IE, try Firefox or Chrome.
  • edited July 2014
    Where are the instructions how to attach files in this forum?  So I've got it attached twice.  Seems that attachments have a delay before they show up.

  • For some reason my timing is not coming back correctly. If I put in 1.00 = 2 Hours show up. If I put in 0.95 = 1 hour shows up. Also is there a way to add it to a report.
  • Is it possible you're double clicking the submit button?
  • Followed the txt doc you have up top and it worked. Only need the Time Spent part anyway. Can I add this to the statistics menu instead of service time?
  • Thanks edge, for the work.

    For users popping in here from google, I found I wasn't able to get the attachments until I registered on the forums.

    I'm trying this on 1.9.3 ...
  • It seems to work OK, though once I put in 1.0 and it recorded 3 hours .., but other times it was fine.

    What I would like is for the user to see it also ... can anybody tell me the file associated with the user's view of the thread? (apologies I'm new to the code) cheers.
  • OK, found it ... include/client/ 
    insert after line 71

                       <th>Time Spent:</th>
                       <td><?php echo $ticket->getTimeSpent(); ?></td>
    Now the client can see the taximeter on his ticket ... let the fun begin!
  • OK, I was doing all this on a test installation. When I wenbt over to production,  I copied over the files but the accumulation of the time_spent in the ost_ticket table was not occuring. I went through a barrage of debugging tests .. my worries were that PHP and mysql were not the exact same versions on the production server.

    Finally cracked it: of course it wasn't anything like that, it was qutie simply that I had forgotten to copy over the scp/tickets.php file. That's the trouble with these manual mods, they're great for learning, and I'm sure a know a whole more about osticket now, but that it took a whole day to sort out the the problem. I really have to put it into a github branch.

    I hesitated to do this because it's not my mod. But I'm sorry, I need to incorporate somebody else's mod into my github feature branch, giving credit of course.
  • Great mod, works like a charm.

    If anyone is interested; replace the content of the attached file with the existing file in \include\staff in order to see the time spent in the ticket overview:

  • edited August 2014
    I did this, but now i am unable to view any tickets...
    Tickets seems to be there, and i can create a ticket by sending e-mail, but not access them (see attach)
  • Have you made the rest of the changes as well? (SQL update and replacing the other files)
  • @arthro, if you want to make a github mod it wouldn't bother me.  Most of my clues for making this modification came from Masino Sinaga for the version 1.6 mod.

    @PABben, if you've not found the issue yet check your php log which likely contains an error message giving you some direction.
  • edited October 2014

    This is a fantastic mod to which I have started a branch as this should really be in the core of the system. So far I have the following: -

    • Time Spent added to the ticket, and continually adds up
    • Ability to add time via internal post and reply to client
    • Use Custom List to hold ticket time type
    • Display Total time in ticket information at top
    • Display ticket time and time type in thread header

    Even though I have got all this working I do currently have a little bug which is that for some reason the ticket time and type is not saving to the threat.
    Will keep you all updated though, and any help is welcome!

  • I have finished the mod if any one is interested.
    Details can be found here: -

    The main team seem to like the idea but have asked if I can make it a Plugin instead so having a go to convert it now and hopefully will make it out there for the masses to use.
  • Attached is the full code for the finished Mod.
    Based on all the information above but finished and tested on version 1.9.x

    As previously stated I'm now working on converting this to a plugin for official release.
  • Hello robintoy, Are you still working on a plugin for osTicket Time Spent? I just installed osTicket (v1.9.4-rc5) and sure would like to try that plugin :) Regards, James
  • Github is your friend.
    I think that this is what your looking for:
  • Thanks ntozier, I see now that there is no plugin. The mods look great but are probably only compatible with ver1.8. I'm looking forward to the feature possibly being added into a future release. Regards, James
  • That mod is 13 hours old.  It's written for the current version.
  • Oh...sorry..Thanks :)
  • Does this works or is it not stable?
  • Has anyone gotten this mod working with 1.9.5? I've worked through implementing it by adding or modifying code (not just replacing files), but there's definitely something I put in the wrong place. Thanks!
  • @yorickr Do you have updated your timespent-column customization in the staff view on 1.9.5 version?
    I hope so.
    Thank you anyway.
  • edited January 2015
    Anyone manage to get the timespent-Column in the staff view working on 1.9.4

Sign In or Register to comment.