[rt-users] Timer for TimeWorked

Aaron Sallade asallade at PTSOWA.ORG
Mon Apr 21 18:17:45 EDT 2008


When you go to the page in RT and view source from your browser, is the
javascript intact, and is it referencing the correct field name? Also,
it looks like you are missing a bracket after "else" in your code.

 

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
asallade at ptsowa.org <mailto:asallade at ptsowa.org> 

________________________________

From: Greg Evans [mailto:gevans at hcc.net] 
Sent: Monday, April 21, 2008 2:36 PM
To: 'RT Users'
Subject: [rt-users] Timer for TimeWorked

 

Hello all,

I am attempting to implement a timer for the "TimeWorked" field so that
technicians do not have to manually enter the time worked on each ticket
(from creation to close). I have created two timers, one in perl and one
in javascript (ok, I borrowed the one in javascript). They both work
just fine when tested. The Javascript one works on a webpage, and the
perl one works from the CLI. 

I cannot, for the life of me, make either one work with RT.  The code is
below. It probably could be done better, but hey I didn't write the
code, just borrowed it:

<script type = "text/javascript">

<!--

var seconds=0

var minutes=0

var hours=0

function display(){

if (seconds>=60){

seconds=0

minutes+=1

else if (minutes>59){

seconds=0

minutes=0

hours+=1

}

else

seconds+=1

document.TicketUpdate.UpdateTimeWorked.value=hours+":"+minutes+":"+secon
ds

setTimeout("display()",1000)

display()

}

//-->

</script>

The HTML part:

<form action="Update.html" name="TicketUpdate"

        method="post" enctype="multipart/form-data">

...

<&|/l&>Worked</&>: <input size="8" name="UpdateTimeWorked" />
<!--value=""-->

I put all of this into /opt/rt3/local/html/Ticket/Update.html and was
hoping to do something Similar in Create.html 

Any ideas and any help appreciated

Regards,

Greg Evans

Hood Canal Communications

(360) 898-2481 ext.212 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080421/7768eaf2/attachment.htm>


More information about the rt-users mailing list