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.

[My time spent mod.txt](https://forum.osticket.com/assets/files/migrated/FileUpload/32/da4ae4c9ab5d7bb20ad1799e005a61.txt)

Thanks for the heads up ntozier

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:ALTER TABLE ost_ticket ADD COLUMN time_spent FLOAT(4,2)  NOT NULL DEFAULT '0.00' AFTER closed;alter table ost_ticket_thread add column time_spent FLOAT(4,2) NOT NULL DEFAULT '0.00' after thread_type;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.

[time spent lines.zip](https://forum.osticket.com/assets/files/migrated/FileUpload/f2/7f4dcde7eab039bc59bd9f2bb72910.zip)

What browser are you using? If you are using IE, try Firefox or Chrome.

4 days later

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?

22 days later

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/view.inc.php insert after line 71 <tr>                   <th>Time Spent:</th>                   <td><?php echo $ticket->getTimeSpent(); ?></td>   </tr>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.

15 days later

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)

osTicket  Staff Control Panel - Google Chrome.jpg

Have you made the rest of the changes as well? (SQL update and replacing the other files)

@[deleted], 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.@[deleted], if you've not found the issue yet check your php log which likely contains an error message giving you some direction.

a month later

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!