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:

The HTML part:

... <&|/l&>Worked:

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

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@ptsowa.org mailto:asallade@ptsowa.orgFrom: Greg Evans [mailto:gevans@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:

The HTML part:

<form action="Update.html" name="TicketUpdate"
    method="post" enctype="multipart/form-data">

<&|/l&>Worked</&>:

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

Also,

The function “display” is self referencing, but I see nothing that calls
it the first time. Maybe an onload event is needed?

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@ptsowa.org mailto:asallade@ptsowa.orgFrom: Greg Evans [mailto:gevans@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:

The HTML part:

<form action="Update.html" name="TicketUpdate"
    method="post" enctype="multipart/form-data">

<&|/l&>Worked</&>:

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

That seemed weird to me as well, but I have an example here (that I got
somewhere else) that I was working from. Here is the code of the example if
you would like to try to paste it into a file and see what happens.

You have

visited my page for:

seconds!

So in RT I am merely changing the document.d.d2.value= to
document.TicketUpdate.UpdateTimeWorked.value=

And if we look at the page, we see.

.

<&|/l&>Worked</&>:

The <!-value=""–> is what I changed. That was originally inside the input
tag

Greg Evans
Hood Canal Communications
(360) 898-2481 ext.212From: Aaron Sallade [mailto:asallade@PTSOWA.ORG]
Sent: Monday, April 21, 2008 3:24 PM
To: Greg Evans; RT Users
Subject: RE: [rt-users] Timer for TimeWorked

Also,

The function “display” is self referencing, but I see nothing that calls it
the first time. Maybe an onload event is needed?

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

From: Greg Evans [mailto:gevans@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:

The HTML part:

<form action="Update.html" name="TicketUpdate"
    method="post" enctype="multipart/form-data">

<&|/l&>Worked</&>:

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

Greg Evans schrieb:

That seemed weird to me as well, but I have an example here (that I
got somewhere else) that I was working from. Here is the code of the
example if you would like to try to paste it into a file and see what
happens.

Hi,

did you find a working solution for your problem in the meantime?
I couldn’t find anything in the wiki about it.
I either need to get a timer working (with a start/stop button, which I
personally find stupid but may be helpful to some of our users) or at
least I need to make “Time Worked” a mandatory field.

Browsing through my personal RT archive, it seems this feature request
comes up every once in a while…

Any ideas?

Rainer