Highlighted
forumadmin Absent Member.
Absent Member.
12180 views

Customising TT to include a calendar function


Discussion posted 3/6/08 by George Bonvanie, last edited 5/5/08 by a zonderman
Details:

tulla99

Hello,
We are currently looking to use TeamTrack as a resource scheduler, and i am enquiring as to what is the best way to go about this. As well as where to start when trying to incorperate a calendar into things. I understand TT is commonly used for holiday recording, would anyone be able to provide me with some examples pointers as to how this is done, with the hope this might give me some ideas.
Thanks.
Posted 1/14/2008 10:35 AM

brosenberger

Hi,
if you are used to TeamScript you can modify this Calendar Script to your needs:
'RFC-Calendar Ver. 1.0
'03.03.2007 Brian Rosenberger
'Serena Software GmbH
'Professional Services CE
'--------------------------------------------------------------------
'Description:
'This TeamScript will render a calendar view of changes from your
'TeamTrack ITIL Solution.
'Adjust the variables below to your needs. This script is directly
'called from URL-Context.
'--------------------------------------------------------------------
'--------------------------------------------------------------------
'
'Variables:
'--------------------------------------------------------------------
Option Explicit
'If any variable is marked as optional you can provide an empty value.
'Special characters
Dim QUOTE, RTN
QUOTE = Chr(34) 'Quote
RTN = Chr(10)&Chr(13) 'Carriage return/ Line feed
'TeamTrack options
Dim rfromFIELD, rtoFIELD, sfromFIELD, stoFIELD, fR_OR_S, nTABLEID
Dim fTYPE, fCIFILTER, bFILTERINVERSE, bFILTERENABLE
rfromFIELD = "RFROM" '<Request from> Date/Time Field, optional
rtoFIELD = "RTO" '<Request to> Date/Time Field, optional
sfromFIELD = "SFROM" '<Scheduled from> Date/Time Field
stoFIELD = "STO" '<Scheduled to> Date/Time Field
fR_OR_S = "FR_OR_S" 'The Calendar will decide on per change basis if
'either the requested or scheduled dates will be
'used. <Requested> are proposed dates,
'<scheduled> are approved dates. If the boolean
'attribute given in this setting has a nonzero
'value, the change is thought to be approved and
'therefore the scheduled dates are marked in the
'calender.
nTABLEID = 1000 'The TableId of your Change-Solution (can be
'found in the TS_ID column of the TS_TABLES
'table)
fTYPE = "ISSUETYPE" 'Single-Selection Field to decide on the Change
'type
fCIFILTER = "CI_SINGLE" 'If your changes have a reference to
'configuration items (single-relational or
'multi-relational field), you can add a filter
'to only display changes in the calendar that
'also reference at least one of the same CIs
'However you MUST provide your current change
'TS_ID as an URL Paramter:
' ...tmtrack.dll?ScriptPage&...&iid=<TS_ID>
bFILTERENABLE = true 'wether filter on CI is enabled or not
'can be set by URLbFilterEnable too
bFILTERINVERSE = true 'If true, an empty reference will be interpreted
'as referencing ALL CIs
'Time/ Date options
Dim GMToffset, ROLL, bMARKWEEKEND, CALENDARSTART, CALENDARINTERVAL
Dim bDISPLAYWEEKDAY, CALENDARUNIT, DISPLAYCINTERVAL, DISPLAYCUNIT
GMToffset = 0 'GMToffset the Calendar will have
ROLL = 7 'How many days the Calendar will display
bMARKWEEKEND = true 'If true, saturday and sunday are bolded
bDISPLAYWEEKDAY = false 'If true, dates are formatted with weekday
CALENDARSTART = Date 'Default Calendar start. If you provide an
'iid URL parameter, calender will try to
'use an appropiate range from the item instead
CALENDARINTERVAL = 5 'Minimum interval in CALENDARUNIT units
CALENDARUNIT = "N" ' "N" for minutes, "H" for hours
DISPLAYCINTERVAL = 2 'Interval stepping the calendar will display
DISPLAYCUNIT = "H" ' "N" for minutes, "H" for hours
'Font options
Dim fFamily, fSize, fColor
fFamily = "Verdana, Arial" 'Comma-separated list of fonts to use
fSize = 10 'Basis font size in points
fColor = "#000000" 'Font color in hexcode (#000000 is black)
'Various options
Dim RELOAD, cellsize
RELOAD = 30 'Seconds until auto-reload of the calendar
'a value of zero means no auto-reload
cellsize = 24 'Size of the Calendar cells
'Color options
Dim ColorSet, GridColor, HoverGridColor, pCOLOR
Set ColorSet = CreateObject("Scripting.Dictionary")
ColorSet.Add "UU", "#9900cc" 'Color for unknown Change-Types (default)
ColorSet.Add "SU", "#9900cc" 'Scheduled unknown Change type
ColorSet.Add "PU", "#9900cc" 'Proposed unknown Change type
ColorSet.Add "S1", "#3300ff" 'Scheduled Change with type-index 1
ColorSet.Add "P1", "#ff6600" 'Proposed Change with type-index 1
ColorSet.Add "S2", "#cc0000" 'Scheduled Change with type-index 2
ColorSet.Add "P2", "#ff6600" 'Proposed Change with type-index 2
ColorSet.Add "S3", "#ffff66" 'Scheduled Change with type-index 3
ColorSet.Add "P3", "#ff6600" 'Proposed Change with type-index 3
'Define as many as you like'
GridColor = "#000000" 'Color for the calendar grid
HoverGridColor = "red" 'Color for highlighter
pCOLOR = "#ffcc66" 'Color for popup background, "transparent"
'is a valid color
'Do not change below this line unless you know what you are doing!
'====================================================================
'====================================================================
Dim rfrom, rto, sfrom, sto, typ, ci, self, iid
rfrom = Shell.Params.Item("rfrom")
sfrom = Shell.Params.Item("sfrom")
rto = Shell.Params.Item("rto")
sto = Shell.Params.Item("sto")
typ = Shell.Params.Item("typ")
iid = Shell.Params.Item("iid")
If Len(Shell.Params.Item("urlbfilterenable"))>0 Then
bFILTERENABLE = Shell.Params.Item("urlbfilterenable")
End If
self = Shell.URLProtocol&"://"&Shell.URLServer&":"&Shell.URLPort&Shell.URLPath&"?ScriptPage&ScriptName=createChangeCalendar&iid="&iid&"&urlbfilterenable="&bFILTERENABLE
Dim myitem, result, globalCount, globalChangeList
globalCount = 0
Set myitem = Ext.CreateAppRecord(nTABLEID)
Call myitem.Read(iid)
Call myitem.GetFieldValue(fCIFILTER, ci)
Call Ext.LogInfoMsg("Mein CI:"&ci)
Dim chtypen
Set chtypen = Ext.CreateAppRecordList(Ext.TableId("TS_SELECTIONS"))
Call chtypen.ReadWithWhere("TS_FLDID in "& _
"(SELECT TS_ID FROM TS_FIELDS WHERE TS_TABLEID="&nTABLEID&" AND "& _
"TS_DBNAME like '"&fTYPE&"')")
If Len(rfrom) < 1 Then
If Len(iid) < 1 Then
rfrom = CALENDARSTART
Call Ext.LogInfoMsg(rfrom)
Else
Call myitem.GetFieldValue(sfromFIELD, rfrom)
rfrom = Ext.DbLongToDate(rfrom)
Call Ext.LogInfoMsg(rfrom)
End If
End If
rto = DateAdd("d", roll, rfrom)
Call Ext.WriteStream(createTable(rfrom, rto))
function createTable(von, bis)
Dim output, i, interval, j, mydatum
output = output & getHTMLHeader()&getCSS()&getHTMLBody()
output = output & "<p><a href="&QUOTE&self&"&rfrom="&DateAdd("d", -1*roll, rfrom)&"&rto="&DateAdd("d", -1*roll, rto)&QUOTE&">earlier</a> <a href="&QUOTE&self&"&rfrom="&DateAdd("d", roll, rfrom)&"&rto="&DateAdd("d", roll, rto)&QUOTE&">later</a> Last reload: "&Now&"<br>" & _
"<table class=calendar cellspacing=0 cellpadding=0>"
interval = DateDiff("d", von, bis)
For i=0 To interval+1
If i < interval+1 Then
output = output & getRow() & getDateColumn(DateAdd("d", i, von))
Else
output = output & getRow() & "<td> </td>"
End If
For j=0 To 23
'Call Ext.writestream(von)
mydatum = DateAdd("h", j, DateAdd("d", i, _
von))
If i < interval+1 Then
output = output & getCell(getChange(mydatum, ci))
Else
output = output & getIntervalRow(j)
End If
Next
output = output & "</tr>"
Next
output = output & "</table></body></html>"
createTable = output
End Function
Function getChange(datum, ci)
Dim changes, change, ctxt
datum = DateAdd("h", -1*GMToffset, datum)
Set changes = Ext.CreateAppRecordList(nTABLEID)
Set result = CreateObject("Scripting.Dictionary")
Set globalChangeList = CreateObject("Scripting.Dictionary")
Dim c, qsql
If bFILTERENABLE Then
'Set ci = parseMulti(ci)
'For Each c In ci
' qsql = qsql & " AND TS_"&fCIFILTER&" like '%,"&ci.Item(c)&",%'"
'Next
qsql = " AND TS_"&fCIFILTER&" = "&ci
End If
Dim chtyp
For Each chtyp In chtypen
Dim sql
sql = "(TS_SFROM < " & Ext.DateToDbLong(datum) & " AND TS_STO >= " & Ext.DateToDbLong(datum) & qsql&" AND (TS_"&fTYPE&"="&chtyp.GetId()&" OR TS_"&fTYPE&"=0))"
Call Ext.LogInfoMsg("SQL: " & sql)
Call changes.ReadWithWhere(sql)
For Each change in Changes
Dim appr, fTYPEtest
Call change.GetFieldValue(fR_OR_S, appr)
Call change.GetFieldValue(fTYPE, fTYPEtest)
If fTYPEtest <> 0 AND appr <> 0 Then
'typ + approved'
Call haengAn("S"&chtyp.GetId(), change)
If Not result.Exists("S"&chtyp.GetId()) Then
result.Add "S"&chtyp.GetId(), ""
End If
ElseIf fTYPEtest <> 0 AND appr = 0 Then
'typ + not approved'
Call haengAn("P"&chtyp.GetId(), change)
If Not result.Exists("P"&chtyp.GetId()) Then
result.Add "P"&chtyp.GetId(), ""
End If
ElseIf fTYPEtest = 0 AND appr <> 0 Then
'not type + approved'
Call haengAn("SU", change)
If Not result.Exists("SU") Then
result.Add "SU", ""
End If
ElseIf fTYPEtest = 0 AND appr = 0 Then
Call haengAn("PU", change)
If Not result.Exists("PU") Then
result.Add "PU", ""
End If
Else
Call haengAn("UU", change)
If Not result.Exists("UU") Then
result.Add "UU", ""
End If
End If
'alle Kombinationen kommen vor - Abbruch'
If result.Exists("S"&chtyp.GetId()) AND result.Exists("P"&chtyp.GetId()) AND result.Exists("PU") AND result.Exists("SU") AND result.Exists("UU") Then
Exit For
End If
Next
Next
getChange = getFilledCell(changes)
End Function
Function getHTMLHeader()
getHTMLHeader = "<!DOCTYPE HTML PUBLIC "&QUOTE& _
"-//W3C//DTD HTML 4.01 Transitional//EN"&QUOTE& _
">"&RTN& _
"<html>"&RTN&"<head>"&RTN& _
"<meta http-equiv="&QUOTE&"content-type "&QUOTE& _
"content="&QUOTE&"text/html; charset=windows-1250"&QUOTE& _
">" & RTN & _
"<meta name=generator "& _
"content="&QUOTE&"Serena TeamTrack, TeamScript"&QUOTE& _
">" & RTN & _
"<meta name=author "& _
"content="&QUOTE&"Brian Rosenberger"&QUOTE& _
">" & RTN & _
"<title>Serena TeamTrack - Change Calendar</title>" &RTN& _
"</head>"&RTN&RTN
End Function
Function GetHTMLBody()
Dim rltxt
If RELOAD > 0 Then
rltxt = "<!-- RELOAD FUNCTION: Brian Rosenberger -->"&RTN& _
"var aktiv = window.setInterval("&QUOTE& _
"history.go(0)"&QUOTE&", "&RELOAD*1000&");"&RTN&RTN
End If
getHTMLBody = "<body>"&RTN& _
"<!-- " &RTN& _
"######################################################"&RTN& _
"# JAVASCRIPT POPUPS ROUTINE VERSION 7 07-Feb-2001 #"&RTN& _
"# Written by Mike McGrath [mike_mcgrath@lineone.net] #"&RTN& _
"# PC-Tested for Netscape 3.04, 4.61, 6.0, IE5.5 #"&RTN& _
"# Note: Popups may not cover all form field inputs. #"&RTN& _
"# PLEASE RETAIN THIS NOTICE WHEN COPYING MY SCRIPT. #"&RTN& _
"# THIS SCRIPT IS COPYRIGHT OF MIKE MCGRATH 1998-2001 #"&RTN& _
"######################################################"&RTN& _
"-->"&RTN& _
"<script type="&QUOTE&"text/javascript"&QUOTE&">"&RTN& _
rltxt& _
"<!-- Original: Mike McGrath (mike_mcgrath@lineone.net) -->"&RTN& _
"<!-- Web Site: http://website.lineone.net/˜mike_mcgrath -->"&RTN& _
"<!--"&RTN& _
""&RTN& _
"var Xoffset=0; // modify these values to ..."&RTN& _
"var Yoffset= -50; // change the popup position."&RTN& _
"var popwidth=320; // popup width"&RTN& _
"var bcolor="&QUOTE&"darkgray"&QUOTE&"; // popup border color"&RTN& _
"var fcolor="&QUOTE&fColor&QUOTE&"; // popup font color"&RTN& _
"var fface="&QUOTE&fFamily&QUOTE&"; // popup font face"&RTN& _
""&RTN& _
"// create content box"&RTN& _
"document.write("&QUOTE&"<DIV ID='pup'></DIV>"&QUOTE&");"&RTN& _
""&RTN& _
"// id browsers"&RTN& _
"var iex=(document.all);"&RTN& _
"var nav=(document.layers);"&RTN& _
"var old=(navigator.appName=="&QUOTE&"Netscape"&QUOTE&" && !document.layers && !document.getElementById);"&RTN& _
"var n_6=(window.sidebar);"&RTN& _
""&RTN& _
"// assign object"&RTN& _
"var skin;"&RTN& _
"if(nav) skin=document.pup;"&RTN& _
"if(iex) skin=pup.style;"&RTN& _
"if(n_6) skin=document.getElementById("&QUOTE&"pup"&QUOTE&").style;"&RTN& _
""&RTN& _
"// park modifier"&RTN& _
"var yyy=-1000;"&RTN& _
""&RTN& _
"// capture pointer"&RTN& _
"if(nav)document.captureEvents(Event.MOUSEMOVE);"&RTN& _
"if(n_6) document.addEventListener("&QUOTE&"mousemove"&QUOTE&",get_mouse,true);"&RTN& _
"if(nav||iex)document.onmousemove=get_mouse;"&RTN& _
""&RTN& _
"// set dynamic coords"&RTN& _
"function get_mouse(e)"&RTN& _
"{"&RTN& _
" var x,y;"&RTN& _
""&RTN& _
" if(nav || n_6) x=e.pageX;"&RTN& _
" if(iex) x=event.x+document.body.scrollLeft; "&RTN& _
" "&RTN& _
" if(nav || n_6) y=e.pageY;"&RTN& _
" if(iex)"&RTN& _
" {"&RTN& _
" y=event.y;"&RTN& _
" if(navigator.appVersion.indexOf("&QUOTE&"MSIE 4"&QUOTE&")==-1)"&RTN& _
" y+=document.body.scrollTop;"&RTN& _
" }"&RTN& _
""&RTN& _
" if(iex || nav)"&RTN& _
" {"&RTN& _
" skin.top=y+yyy;"&RTN& _
" skin.left=x+Xoffset; "&RTN& _
" }"&RTN& _
""&RTN& _
" if(n_6)"&RTN& _
" {"&RTN& _
" skin.top=(y+yyy)+"&QUOTE&"px"&QUOTE&";"&RTN& _
" skin.left=x+Xoffset+"&QUOTE&"px"&QUOTE&";"&RTN& _
" } "&RTN& _
" nudge(x);"&RTN& _
"}"&RTN& _
""&RTN& _
"// avoid edge overflow"&RTN& _
"function nudge(x)"&RTN& _
"{"&RTN& _
" var extreme,overflow,temp;"&RTN& _
""&RTN& _
" // right"&RTN& _
" if(iex) extreme=(document.body.clientWidth-popwidth);"&RTN& _
" if(n_6 || nav) extreme=(window.innerWidth-popwidth);"&RTN& _
""&RTN& _
" if(parseInt(skin.left)>extreme)"&RTN& _
" {"&RTN& _
" overflow=parseInt(skin.left)-extreme;"&RTN& _
" temp=parseInt(skin.left);"&RTN& _
" temp-=overflow;"&RTN& _
" if(nav || iex) skin.left=temp;"&RTN& _
" if(n_6)skin.left=temp+"&QUOTE&"px"&QUOTE&";"&RTN& _
" }"&RTN& _
""&RTN& _
" // left"&RTN& _
" if(parseInt(skin.left)<1)"&RTN& _
" {"&RTN& _
" overflow=parseInt(skin.left)-1;"&RTN& _
" temp=parseInt(skin.left);"&RTN& _
" temp-=overflow;"&RTN& _
" if(nav || iex) skin.left=temp;"&RTN& _
" if(n_6)skin.left=temp+"&QUOTE&"px"&QUOTE&";"&RTN& _
" }"&RTN& _
"}"&RTN& _
""&RTN& _
"// write content & display"&RTN& _
"function popup(msg,bak)"&RTN& _
"{"&RTN& _
""&RTN& _
" var content="&QUOTE&"<TABLE WIDTH='"&QUOTE&"+popwidth+"&QUOTE&"' BORDER='1' BORDERCOLOR="&QUOTE&"+bcolor+"&QUOTE&" CELLPADDING=2 CELLSPACING=0 "&QUOTE&"+"&QUOTE&"BGCOLOR="&QUOTE&"+bak+"&QUOTE&"><TD ALIGN='center'><FONT COLOR="&QUOTE&"+fcolor+"&QUOTE&" FACE="&QUOTE&"+fface+"&QUOTE&" SIZE='2'>"&QUOTE&"+msg+"&QUOTE&"</FONT></TD></TABLE>"&QUOTE&";"&RTN& _
""&RTN& _
" if(old)"&RTN& _
" {"&RTN& _
" alert(msg);"&RTN& _
" return;"&RTN& _
" } "&RTN& _
" "&RTN& _
" yyy=Yoffset; "&RTN& _
" skin.width=popwidth;"&RTN& _
""&RTN& _
" if(nav)"&RTN& _
" { "&RTN& _
" skin.document.open();"&RTN& _
" skin.document.write(content);"&RTN& _
" skin.document.close();"&RTN& _
" skin.visibility="&QUOTE&"visible"&QUOTE&";"&RTN& _
" }"&RTN& _
""&RTN& _
" if(iex)"&RTN& _
" { "&RTN& _
" pup.innerHTML=content;"&RTN& _
" skin.visibility="&QUOTE&"visible"&QUOTE&";"&RTN& _
" } "&RTN& _
""&RTN& _
" if(n_6)"&RTN& _
" { "&RTN& _
" document.getElementById("&QUOTE&"pup"&QUOTE&").innerHTML=content;"&RTN& _
" skin.visibility="&QUOTE&"visible"&QUOTE&";"&RTN& _
" }"&RTN& _
"}"&RTN& _
""&RTN& _
""&RTN& _
"// park content box"&RTN& _
"function kill()"&RTN& _
"{"&RTN& _
" if(!old)"&RTN& _
" {"&RTN& _
" yyy=-1000;"&RTN& _
" skin.visibility="&QUOTE&"hidden"&QUOTE&";"&RTN& _
" skin.width=0;"&RTN& _
" }"&RTN& _
"}"&RTN& _
""&RTN& _
"//-->"&RTN& _
"</script>"&RTN
End Function
Function getCSS()
'Build StyleSheet'
getCSS = "<style type="&QUOTE&"text/css"&QUOTE&">" & RTN & _
"p {font-family:"&fFamily&"; font-size:"&fSize&"pt; "& _
"font-color:"&fColor&"; }" & RTN & _
"p.Weekend {font-weight:bold; }" & RTN & _
"td {border-width:0; "& _
"border-style:solid; }" & RTN & _
"td.CCell {border-bottom-width:1; border-top-width:1; border-left-width:0; border-right-width:0; padding:0; margin:0; "& _
"border-style:solid; }" & RTN & _
"td.ECell {border-width:1; padding:0px; "& _
"border-style:solid; }" & RTN & _
"table.calendar {border-color:"&GridColor&"; border-width:1; "& _
"border-style:solid; }" & RTN & _
"table.cell {border-color:"&GridColor&"; border-width:0; "& _
"border-style:solid; }" & RTN & _
"#pup { position:absolute; visibility:hidden; "& _
"z-index:200; width:240; margin:0; padding:0; border-width:0; }" & RTN & _
"div { text-align:left; width:100%; margin:0; padding:0; border-width:0; }" & RTN & _
"</style>" & RTN
End Function
Function getDateColumn(datum)
'Format DateColumn'
Dim out, weekd
weekd = Weekday(datum)
out = "<td align=right class="&QUOTE&"ECell"&QUOTE&">"
If bMARKWEEKEND AND (weekd = 1 OR weekd = 7) Then
out = out & "<p class="&QUOTE&"Weekend"&QUOTE&">"
Else
out = out & "<p>"
End If
If bDISPLAYWEEKDAY Then
out = out & WeekdayName(Weekday(datum))&", "
End If
out = out & FormatDateTime(datum, 2)
out = out & "</td>"&RTN
getDateColumn=out
End Function
Function getRow()
getRow = "<tr onmouseover="&QUOTE&"this.style.borderColor='" & _
HoverGridColor & "'"&QUOTE& _
" onmouseout="&QUOTE&"this.style.borderColor='" & _
GridColor & "'"&QUOTE&">"
End Function
Function getIntervalRow(j)
getIntervalRow = "<td class=ECell><p>"&j&"</td>"&RTN
End Function
Function getCell(txt)
Dim clss
clss = "CCell"
If txt = " " Then
'leere Zelle'
clss = "ECell"
txt = "<img src="&QUOTE&"images/cl.gif"&QUOTE& _
" width="&QUOTE&cellsize-2&QUOTE& _
" height="&QUOTE&cellsize-2&QUOTE& _
" border=0>"
End If
getCell = "<td class="&QUOTE&clss&QUOTE&">"&txt&"</td>"
End Function
Function getFilledCell(changes)
Dim hoch, out
If result.Count() = 0 Then
getFilledCell = " "
Else
hoch = CInt(cellsize/ result.Count())
End If
out = "<table class=cell border=0 cellpadding=0 cellspacing=0>"
Dim chtyp
For Each chtyp In chtypen
If result.Exists("P"&chtyp.GetId()) Then
out = out & "<tr><td style="&QUOTE& _
"background-color:"&ColorSet.Item("P"&chtyp.GetId())&";" _
&QUOTE&">"& _
"<div id="&QUOTE&"d"&globalCount&QUOTE&">"& RTN & _
"<a href="&QUOTE&"linkurlhier"&QUOTE& _
" onmouseover="&QUOTE& _
"popup('"&chtyp.GetName()&" (proposed)<br><hr><br><table border=0>"&globalChangeList.Item("P"&chtyp.GetId())&"</table>','"&pCOLOR&"')"&QUOTE& _
" onmouseout="&QUOTE&"kill()"&QUOTE&">" & RTN & _
"<img src="&QUOTE&"images/cl.gif"&QUOTE&" height="&QUOTE&hoch&QUOTE&" width="&QUOTE&cellsize&QUOTE&" border=0></a></div></td></tr>"
End If
If result.Exists("S"&chtyp.GetId()) Then
out = out & "<tr><td style="&QUOTE& _
"background-color:"&ColorSet.Item("S"&chtyp.GetId())&";" _
&QUOTE&">"& _
"<div id="&QUOTE&"d"&globalCount&QUOTE&">"& RTN & _
"<a href="&QUOTE&"linkurlhier"&QUOTE& _
" onmouseover="&QUOTE& _
"popup('"&chtyp.GetName()&" (scheduled)<br><hr><br><table border=0>"&globalChangeList.Item("S"&chtyp.GetId())&"</table>','"&pCOLOR&"')"&QUOTE& _
" onmouseout="&QUOTE&"kill()"&QUOTE&">" & RTN & _
"<img src="&QUOTE&"images/cl.gif"&QUOTE&" height="&QUOTE&hoch&QUOTE&" width="&QUOTE&cellsize&QUOTE&" border=0></a></div></td></tr>"
End If
Next
If result.Exists("PU") Then
out = out & "<tr><td style="&QUOTE& _
"background-color:"&ColorSet.Item("PU")&";" _
&QUOTE&">"& _
"<div id="&QUOTE&"d"&globalCount&QUOTE&">"& RTN & _
"<a href="&QUOTE&"linkurlhier"&QUOTE& _
" onmouseover="&QUOTE& _
"popup('type unknown (proposed)<br><hr><br><table border=0>"&globalChangeList.Item("PU")&"</table>','"&pCOLOR&"')"&QUOTE& _
" onmouseout="&QUOTE&"kill()"&QUOTE&">" & RTN & _
"<img src="&QUOTE&"images/cl.gif"&QUOTE&" height="&QUOTE&hoch&QUOTE&" width="&QUOTE&cellsize&QUOTE&" border=0></a></div></td></tr>"
End If
If result.Exists("SU") Then
out = out & "<tr><td style="&QUOTE& _
"background-color:"&ColorSet.Item("PU")&";" _
&QUOTE&">"& _
"<div id="&QUOTE&"d"&globalCount&QUOTE&">"& RTN & _
"<a href="&QUOTE&"linkurlhier"&QUOTE& _
" onmouseover="&QUOTE& _
"popup('type unknown (scheduled)<br><hr><br><table border=0>"&globalChangeList.Item("SU")&"</table>','"&pCOLOR&"')"&QUOTE& _
" onmouseout="&QUOTE&"kill()"&QUOTE&">" & RTN & _
"<img src="&QUOTE&"images/cl.gif"&QUOTE&" height="&QUOTE&hoch&QUOTE&" width="&QUOTE&cellsize&QUOTE&" border=0></a></div></td></tr>"
End If
If result.Exists("UU") Then
out = out & "<tr><td style="&QUOTE& _
"background-color:"&ColorSet.Item("PU")&";" _
&QUOTE&">"& _
"<div id="&QUOTE&"d"&globalCount&QUOTE&">"& RTN & _
"<a href="&QUOTE&"linkurlhier"&QUOTE& _
" onmouseover="&QUOTE& _
"popup('Unknown type, unknown state<br><hr><br><table border=0>"&globalChangeList.Item("UU")&"</table>','"&pCOLOR&"')"&QUOTE& _
" onmouseout="&QUOTE&"kill()"&QUOTE&">" & RTN & _
"<img src="&QUOTE&"images/cl.gif"&QUOTE&" height="&QUOTE&hoch&QUOTE&" width="&QUOTE&cellsize&QUOTE&" border=0></a></div></td></tr>"
End If
out = out & "</table>"
If result.Count() = 0 Then
out = " "
End If
globalCount = globalCount+1
getFilledCell = out
End Function
Sub haengAn(key, change)
Dim prefix, number, prefixid, ctxt
Call change.GetFieldValue("ISSUEID", number)
Call change.GetFieldValue("ISSUETYPE", prefixid)
Set prefix = Ext.CreateAppRecord(Ext.TableId("TS_SELECTIONS"))
Call prefix.Read(prefixid)
Dim myprefix
Call prefix.GetFieldValue("PREFIX", myprefix)
ctxt = "<tr><td valign=top><p>"&myprefix&number&"</td><td><p><i>"&change.GetName()&"</i></td></tr>"
If globalChangeList.Exists(key) Then
ctxt = ctxt & globalChangeList.Item(key)
globalChangeList.Remove key
globalChangeList.Add key, ctxt
Else
globalChangeList.Add key, ctxt
End If
End Sub
Function parseMulti(strFMulti)
Dim nStart, nEnd, nLength, nId, nKey, objIds
' Create the Dictionary object to hold the IDs
Set objIds = CreateObject("Scripting.Dictionary")
' If there are no IDs in the field, return the empty Dictionary object
' An empty multi-selection contains a single comma
' An empty multi-relational contains two commas
If (strFMulti = ",") OR (strFMulti = ",,") Then
Set parseMulti = objIds
Exit Function
End If
' Starting key number - 1
nKey = 0
' Length of the string of IDs
nLength = Len(strFMulti)
' Starting position in the string of IDs, past the first comma
nStart = 2
do while nStart <= nLength
' Find the next comma after the start comma
nEnd = InStr(nStart,strFMulti,",")
' Strip out the ID between the commas
nId = Mid(strFMulti, nStart, nEnd - nStart)
' Create the Dictionary entry using the count as the key
nKey = nKey + 1
objIds.Add nKey, nId
' Point past the next start comma
nStart = nEnd + 1
Loop
' Return the Dictionary object
Set parseMulti = objIds
End Function
Posted 1/14/2008 11:19 AM
0 Likes
1 Reply
forumadmin Absent Member.
Absent Member.

Re: Customising TT to include a calendar function


This is an old migrated post that has been assigned status Complete.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.