%[@ IncludeFile "Code/Util.vbs" ]%> <%[@ IncludeFile "Code/Lang.vbs" ]%> <%[@ IncludeFile "Code/TimelineInfo.vbs" ]%> <%[ If Session("Book") Or Not Session("Timelines") Then Report.AbortPage ' Create an timeline page for each GenoMap. Dim strSep, cchBegin, g_Delim, strLocale, oLinks, oObjRep, strWrapEvents, dupID Set oTLInfos = Util.NewObjectRepertory() Session("oTLInfos") = oTLInfos strWrapEvents = Util.IfElse(Session("TimelineWrapEvents"), "true", "false") Set oLinks = Util.NewStringDictionary() strLocale = GetLocale ' force Locale to be English so that dates are in english. SetLocale("en-gb") For Each g In GenoMaps Set collDrawingObjects = g.DrawingObjects.ToGenoCollection ' Get the collection of drawing objects for the GenoMap If (collDrawingObjects.Count > 0) Then Set o = Nothing cchBegin=Report.BufferLength Set oTLInfo = New TimelineInfo oTLInfo.AddHeader g.Name, False For Each o In collDrawingObjects On Error Resume Next On Error Goto 0 Select Case o.Class Case "Individual" : If Not o.IsLabel Then ' check if this Individual is already on the timeline i.e. hyperlinked on same GenoMap) see If o.IndividualInternalHyperlink.ID <> "" Then dupID = Not oLinks.Added(o.IndividualInternalHyperlink.ID) Else dupID = Not oLinks.Added(o.ID) End If ' don't add duplicates If Not dupID Then WriteIndividualEvents oTLInfo, o, Util.IfElse(Not Session("OriginalNamesTimelines"), o.Session("NameFull"), o.Session("NameOriginal")), True End If Case "Family" : If Not o.IsLabel Then WriteFamilyEvents oTLInfo, o, Util.IfElse(Not Session("OriginalNamesTimelines"), o.Session("Name"), o.Session("NameOriginal")), True, False Case "SocialEntity" : WriteOccupancyEvents oTLInfo, o, o.Session("Name"), True End Select If Report.BufferLength <> cchBegin Then strSep = "," & vbNewline Next oLinks.Clear oTLInfo.AddTrailer False, Util.IfElse(GenoMaps.Count > 1, Dic("HeaderTimeline"), Dic.PlurialCardinal("HeaderTimeline",1)) & g.Name If oTLInfo.Nodes > 1 Then strBuffer = Replace(Report.Buffer," ","") Report.BufferLength = 0 ]%>