<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Timer for TimeWorked</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceName"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>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.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Aaron Sallade'<br>
Application Manager<br>
PTSO of <st1:State w:st="on"><st1:place w:st="on">Washington</st1:place></st1:State><br>
<em><i><font face=Arial><span style='font-family:Arial'>"Shared Technology
for Community Health"</span></font></i></em><i><span style='font-style:
italic'><br>
</span></i>(206) 613-8938 Desk<br>
(206) 521-8833 <st1:place w:st="on">Main</st1:place><br>
(206) 613-5078 Fax<br>
</span></font><font color=navy><span style='color:navy'><a
href="mailto:asallade@ptsowa.org"><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>asallade@ptsowa.org</span></font></a></span></font><o:p></o:p></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Greg Evans
[mailto:gevans@hcc.net] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, April 21, 2008 2:36
PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'RT Users'<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rt-users] Timer for
TimeWorked</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hello
all,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
am attempting to implement a timer for the</span></font> <font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>“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</span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>both work
just fine when tested. The Javascript one works on a webpage, and the perl one
works from the CLI. </span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
cannot, for the life of me, make either one work with RT. </span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The code is
below. It probably could be done better, but hey I didn’t write the code,
just borrowed it:</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><script
type = "text/javascript"></span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><!--</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>var
seconds=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>var
minutes=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>var
hours=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>function
display(){</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>if
(seconds>=60){</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>seconds=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>minutes+=1</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>else
if (minutes>59){</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>seconds=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>minutes=0</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>hours+=1</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>}</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>else</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>seconds+=1</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>document.TicketUpdate.UpdateTimeWorked.value=hours+":"+minutes+":"+seconds</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>setTimeout("display()",1000)</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>display()</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>}</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>//--></span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'></script></span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The
HTML part:</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><form
action="Update.html" name="TicketUpdate"</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>       
method="post" enctype="multipart/form-data"></span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>...</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><&|/l&>Worked</&>:
<input size="8" name="UpdateTimeWorked" />
<!--value=""--></span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
put all of this into /opt/rt3/local/html/Ticket/Update.html and was hoping to
do something Similar in Create.html </span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Any
ideas and any help appreciated</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Regards,</span></font><o:p></o:p></p>

<p><a name=""><b><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-weight:bold'>Greg Evans</span></font></b></a><o:p></o:p></p>

<p><st1:place w:st="on"><st1:PlaceName w:st="on"><font size=2 color="#374564"
  face=Arial><span style='font-size:10.0pt;font-family:Arial;color:#374564'>Hood</span></font></st1:PlaceName><font
 size=2 color="#374564" face=Arial><span style='font-size:10.0pt;font-family:
 Arial;color:#374564'> <st1:PlaceType w:st="on">Canal</st1:PlaceType></span></font></st1:place><font
size=2 color="#374564" face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:#374564'> Communications</span></font><o:p></o:p></p>

<p><font size=2 color="#374564" face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:#374564'>(360) 898-2481 ext.212</span></font> <o:p></o:p></p>

</div>

</body>

</html>