Time spent on a ticket
Moderator: mkoch227
Time spent on a ticket
Hello,
I am looking for an add-on for the staff that indicates time spent on a ticket. Then we could add up all the time spent on the tickets of a person.
Thanks !
I am looking for an add-on for the staff that indicates time spent on a ticket. Then we could add up all the time spent on the tickets of a person.
Thanks !
I'm not aware of any such mods at the moment, but this should be added in the future.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 15
- Joined: Thu Jan 07, 2010 8:50 pm
Not yet, maybe in 2.3...
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
I need one too
Has anyone here perhaps made their own mod that doesn't come native w/ hesk. Or, maybe someone can help me w/ mine. I am to the point now where I have a field in the response section for minutes spent. It is saved into the MySQL database. Now all I need is some code to retrieve those entries from the database, add them up, and display them. Your help would be greatly appreciated!
All I did to add the time field to the database and modded the submission form and the processor page to add it upon submission.
All I did to add the time field to the database and modded the submission form and the processor page to add it upon submission.
-
- Posts: 3
- Joined: Tue Feb 22, 2011 3:51 pm
Re: Time spent on a ticket
As a work around, until someone writes this, I just setup a Checkbox field with these parameters.
Less than 15 minutes
15 minutes
30 minutes
45 minutes
1 hour
1.5 hours
2 hours
2.5 hours
3 hours
over 3 hours
Less than 15 minutes
15 minutes
30 minutes
45 minutes
1 hour
1.5 hours
2 hours
2.5 hours
3 hours
over 3 hours
-
- Posts: 5
- Joined: Fri Jul 22, 2011 7:30 pm
Re: Time spent on a ticket
I've done a little mod that should give you time spent on each ticket, also allowing for the creation of custom reports on time per category, customer, member of staff, company etc.
Depending on your setup the code position might need to be altered but I've put in the line numbers from a blank hesk.
Add a new field into the DB, notes table called 'timeSpent'. int(3) default value of 0.
Add another field into the tickets table called 'totalTimeSpent'. int(3) default value of 0.
Add the following into admin_ticket.php
Inside the add notes block for the following 2 code blocks.
Line 188
Replace 196 with the following
Add the following to just after the 'Add Note Action' (around line 204).
Add the following to the three statuses in the case blocks around line 301. Just after the s=3 $GET variables
Replace the DIV block for the notesform around line 465 with
Replace the Table Row which displays the notes (in the while loop) 493
Finally, in the change_status.php file:
Add the following to around line 56 (with the rest of the $GET variables)
Add this to the SQL block around line 79
Depending on your setup the code position might need to be altered but I've put in the line numbers from a blank hesk.
Add a new field into the DB, notes table called 'timeSpent'. int(3) default value of 0.
Add another field into the tickets table called 'totalTimeSpent'. int(3) default value of 0.
Add the following into admin_ticket.php
Inside the add notes block for the following 2 code blocks.
Line 188
Code: Select all
$msgTS = hesk_input($_POST['timeSpent']);
Code: Select all
'".hesk_dbEscape($msg)."',
'".hesk_dbEscape($msgTS)."')";
Code: Select all
//Time Spent Calculation and Diplay
$sqltime = 'SELECT sum(timeSpent) FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'notes` AS t1 WHERE `ticket`='.hesk_dbEscape($ticket['id']).' ORDER BY t1.`id` ASC';
$restime = hesk_dbQuery($sqltime);
$note = hesk_dbFetchAssoc($restime);
$timeTotal = $note['sum(timeSpent)'];
?>
<tr>
<td>Total time spent on ticket: </td>
<td><?php echo $timeTotal;?> minutes</td>
</tr>
Code: Select all
tS='.$timeTotal.'
Code: Select all
<div id="notesform" style="display:none">
<form method="post" action="admin_ticket.php" style="margin:0px; padding:0px;">
<p>
<span>Action / Detail</span><br />
<textarea name="notemsg" rows="6" cols="60"></textarea>
</p>
<p>
<span>Time Spent (in minutes)</span><br />
<input type="text" name="timeSpent" size="5" maxlength="3" value="0" />
</p>
<input type="submit" value="<?php echo $hesklang['s']; ?>" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /><input type="hidden" name="track" value="<?php echo $trackingID; ?>" />
<i><?php echo $hesklang['nhid']; ?></i>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
</form>
</div>
Code: Select all
<tr>
<td class="notes"><i><?php echo $hesklang['noteby']; ?> <b><?php echo ($note['name'] ? $note['name'] : $hesklang['e_udel']); ?></b></i> - <?php echo hesk_date($note['dt']); ?> - <b>Time Spent: </b><?php echo $note['timeSpent']; ?> minutes<br /><img src="../img/blank.gif" border="0" width="5" height="5" alt="" /><br />
<?php echo $note['message']; ?></td>
</tr>
Add the following to around line 56 (with the rest of the $GET variables)
Code: Select all
$totalTime = hesk_isNumber($_GET['tS'],"$hesklang[int_error]: $hesklang[status_not_valid].");
Code: Select all
`totalTimeSpent`='".hesk_dbEscape($totalTime)."',
Re: Time spent on a ticket
Now I wish I hadn't upgraded to beta.. 
Seems that the strucuture of the php files has changed too drastically, I can't follow your directions because the lines are not accurate at all.
really sucks too cuz this was a feature that I was waiting on.
Do you have a version of the instructions that are 2.3 compatible yet? Or possibly link the two modified files for download? Just a thought. Aside from time tracking HESK IS IT!!!
Thanks for the support all.

Seems that the strucuture of the php files has changed too drastically, I can't follow your directions because the lines are not accurate at all.
really sucks too cuz this was a feature that I was waiting on.

Do you have a version of the instructions that are 2.3 compatible yet? Or possibly link the two modified files for download? Just a thought. Aside from time tracking HESK IS IT!!!
Thanks for the support all.
-
- Posts: 5
- Joined: Fri Jul 22, 2011 7:30 pm
Re: Time spent on a ticket
I've just upgraded to 2.3 - about to re-create the add-on again.
If anyone has any advice on how to package it properly I'm open to suggestions!

If anyone has any advice on how to package it properly I'm open to suggestions!

Re: Time spent on a ticket
Anyword on the 2.3 repack of this feature? I would really like to utilize it.
Thanks so much for any update, in advance.
Thanks so much for any update, in advance.
-
- Posts: 12
- Joined: Fri Jan 06, 2012 3:15 pm
Re: Time spent on a ticket
Today I combined the code made by seanieboy02 » Fri Jul 22, 2011 10:13 pm into the 2.3 version and have it working as wanted.
Please advice me how to share this code now here, as I cannot seem to be able to upload files.
Do I need to copy & paste code like seanieboy02 did?
Please advice me how to share this code now here, as I cannot seem to be able to upload files.
Do I need to copy & paste code like seanieboy02 did?