<%[@ IncludeFile "Code/Util.vbs" ]%> <%[@ IncludeFile "Code/Lang.vbs" ]%> <%[@ IncludeFile "Code/TimelineInfo.vbs" ]%> <%[ ' The following prevents the page to be generated if the name is empty or the individual is excluded from the report. ' This is achieved simply by checking if the Href is empty If (i.Href = "") Then Report.AbortPage End If Dim strName, g_strNameShort, strtTitle strName = i.Session("NameAlternative") g_strNameShort = i.Session("NameShort") strTitle = Util.JavaScriptEncode(strName) Report.TagBr = "
" & vbCRLF ' For debugging, but it does not harm to re-define the
tag InitGlobalVariables fPrivate = isPrivate(i) fPrivateFolder = Eval(Left(Report.FileOutput,g_nPrivateFolder)=g_strPrivateFolder) If (fPrivate <> fPrivateFolder) Then Report.AbortPage ]%> @[Report.WriteText strName]@ <%[If fPrivate Then Report.WriteFormattedLn "",g_strBaseUrl]%> <%[ ' create timeline data in JSON format. Dim nEvents, strLocale, strBuffer, collEvents, oEvent, strEvent, fTimeline, cchStart, oLinks, oTLInfo fTimeline = False If g_Timelines Then strLocale = GetLocale ' force Locale to be English so that dates are in english. SetLocale("en-gb") Set oLinks = Util.NewStringDictionary() Set oTLInfo = New TimelineInfo cchStart = Report.BufferLength oTLInfo.AddHeader True If i.Birth.Date.Year <> "" and i.Death.Date.Year <> "" Then oTLInfo.AddEvent i, i.Birth.Date, i.Death.Date, False, Dic("Lived"), "" Else oTLInfo.AddEvent i, i.Birth.Date, , False, Dic("Birth"), "" oTLInfo.AddEvent i, i.Death.Date ,i.Death.Date, False, Dic("Death"), "" End If oTLInfo.AddEvent "", i.Birth.Baptism.Date, , False, Util.FirstNonEmpty(i.Birth.CeremonyType, Dic("BirthCeremonyTypeDefault")), "" oTLInfo.AddEvent "", i.Death.Funerals.Date, , False, Dic("Funeral"), "" oTLInfo.AddEvent "", i.Death.Disposition.Date, , False, Dic.LookupEx("PhBD_", i.Death.Disposition.Type),"" Set collEvents = i.Educations.ToGenoCollection For Each oEvent In collEvents oTLInfo.AddEvent oEvent, oEvent.DateStart, oEvent.DateEnd, False, Util.FirstNonEmpty(oEvent.Institution, oEvent.Place.Session("NameFull"), oEvent.Level), "" Next Set collEvents = i.Occupations.ToGenoCollection For Each oEvent In collEvents oTLInfo.AddEvent oEvent, oEvent.DateStart, oEvent.DateEnd, False, Util.FirstNonEmpty(oEvent.Session("Title"), oEvent.Company, oEvent.Industry, oEvent.WorkType), "" Next Set collEvents = i.Contacts.ToGenoCollection For Each oEvent In collEvents oTLInfo.AddEvent oEvent, oEvent.DateStart, oEvent.DateEnd, False, Util.IfElse(oEvent.Place.Name <> "", Dic.FormatString("Timeline_" & oEvent.Type.ID, oEvent.Place.Session("NameFull")),""), "" Next Set collEvents = i.Families.ToGenoCollection For Each oEvent In collEvents WriteFamilyEvents oTLInfo, oEvent, Dic("Marriage") & " " & i.FindMate(oEvent).Session("NameFull"), False, True Next oTLInfo.AddTrailer True, "" If oTLInfo.Nodes >= g_TimeLineMinEventsIndividual Then fTimeline = True Else Report.BufferLength = cchStart End If setLocale(strLocale) End If ' style sheet after timeline so can override style if required Report.WriteLn "" Report.WriteLn "" If fTimeline Then Report.WriteFormattedLn "", strTitle Else Report.WriteFormattedLn "", strTitle End If Report.WriteLn "
" g_ichNotesStart = Report.BufferLength WriteHtmlButtonToggle("Notes") ichNotesEnd = Report.BufferLength g_ichReferencesStart = Report.BufferLength WriteHtmlButtonToggle("OtherDetails") ichReferencesEnd = Report.BufferLength Report.WriteLn "
" Set oHyperlinkRings = Session("oHyperlinkRings") Set oHyperlinkRingIndex = Session("oHyperlinkRingIndex") Report.WriteFormatted "

{}{&t}{}{}{}

", StrHtmlImgGender(i), strName, StrHtmlImgFileGno(i), StrHtmlImgFileSvg(i), StrHtmlImgTimeline(i) ' put pictures in a 'div' floating right. If no pictures added then remove the 'div' Dim cchBufferStart ' Start of the write operations Dim cchBufferBegin ' The begining of the picture data cchBufferStart = Report.BufferLength Report.WriteLn "
" cchBufferBegin = Report.BufferLength WriteHtmlPicturesLarge i, "right", "", "" if g_fShowPictureDetails Then WriteHtmlDetailsPicture i, "", False WriteHtmlAnnotationPicture Dic("Individual"), i, "right", g_cxPictureSizeLarge End If If Report.BufferLength = cchBufferBegin Then ' no picture information written Report.BufferLength = cchBufferStart ' so remove the 'div' by stepping back the buffer Else Report.WriteLn "
" ' close the 'div' with end tag End If WriteNarrativeIndividual i, false, Null WriteHtmlAnnotation i, Dic("AnnotationBirth"), i.birth.Comment WriteHtmlAnnotation i, Dic("AnnotationDeath"), i.death.Comment WriteHtmlAnnotation i, Dic("AnnotationGeneral"), i.Comment WriteHtmlExtraNarrative i WriteHtmlEducations(i) WriteHtmlOccupations(i) WriteHtmlPedigreeChart(i) if fTimeline Then ]%>
<%[ End If WriteHtmlAdditionalInformation(i) If i.Families.Order.Count > 0 Then Set collFamilies = i.Families.Order.ToGenoCollection Else Set collFamilies = i.Families.ToGenoCollection End If If Not g_fHideFamilyDetails Then If collFamilies.Count > 0 Then Report.WriteLn "" nFamily = 0 iFamilyLast = collFamilies.Count - 1 For iFamily = 0 To iFamilyLast If (iFamilyLast > 0) Then nFamily = iFamily + 1 End If WriteHtmlFamily collFamilies(iFamily), nFamily, i Next End If Else For iFamily = 0 To collFamilies.Count - 1 Set f = collFamilies(iFamily) Set spouse = i.FindMate(f) ' Find the other spouse strSpouseName = spouse.Session("NameFull") If (strSpouseName = "") Then strSpouseName = StrDicMFU("_NoName", spouse.Gender.ID) End If strHyperlinkText = Dic.FormatPhrase("PhFamilyWith", i.Session("NamePossessive"), Dic.Ordinal(nFamily), strSpouseName, Dic("DetailLink")) strHref = f.Href If isPrivate(f) Then strHref=Replace(strHref,"
{}{}", StrHtmlImgFamily(f), Util.FormatHtmlHyperlink(strHref, strHyperlinkText) Next End If If g_ichReferencesStart >= 0 Then ' We have no place references, so remove the "Show All References | Hide All References" Report.BufferRemoveAt g_ichReferencesStart, ichReferencesEnd End If If (g_ichNotesStart >= 0) Then ' We have no annotations, so remove the "collapse/expand all Notes" button Report.BufferRemoveAt g_ichNotesStart, ichNotesEnd End If WriteHtmlAllFootnotes i.Sources WriteHtmlFramesetSafeguardK i.Name, "GenoProReportIndividual", i '=========================================================== ' Subroutines to generate the page '=========================================================== Sub WriteHtmlPedigreeChart(i) If (i.Mother.Name<>"") Or (i.Father.Name<>"") Then g_ichReferencesStart = -1 ' indicate at least one collapse/expand non-notes section present Dim ChartMap Set ChartMap = Session("ChartMap") Dim Ancestors, g_fMore, depth fMore =False depth=0 Set Ancestors = Util.NewObjectRepertory SetAncestor i, Ancestors, "", depth Dim e, r, s, c, obj, k s = Array(0) If depth > 0 Then Report.WriteBr "
" Report.WriteLn "" End If End If End Sub Function PrintChartLine(r, i, s) Dim c, l, obj, strFill, strLink, fMore, gender, fPaddding fMore = False fPadding = False gender = Right(r(r(0)),1) If gender = "i" Then gender = gender & i.Gender.ID For c = 1 to s(0)-1 If s(c)="I" Or s(c)="T" Then Report.WriteFormatted "" fPadding = True End If Next If fPadding Then Report.WriteBr End If For c = 1 to r(0)-1 Report.WriteFormatted "", r(c) Next if i.Href <> "" Then strLink=Util.FormatString("{}", i.Href, Replace(i.Name," "," ")) l=10 - Len(i.Name) Else strLink=Dic("_NoName") l=10 - Len(strLink) End If If c=6 Then If i.Mother.Name <> "" Or i.Father.Name <> "" Then strLink = strLink & "* " fMore = True End If End If If l > 0 Then For c= 1 To L strLink = strLink & " " Next End If Report.WriteFormattedLn "
{1}
{2}{3}"+Report.TagBr, _ gender, strLink, " ",_ Replace(Util.FormatPhrase(Dic("PedigreeChartDetails"), _ Trim(i.Birth.Date.ToString(Dic("PedigreeChartDate"))), i.Birth.Place.Session("Locative"), _ Trim(i.Death.Date.ToString(Dic("PedigreeChartDate"))), i.Death.Place.Session("Locative"))," "," ") If fMore Then PrintChartLine = True Else PrintChartLine = False End If End Function Function SetAncestor(i, Ancestors, p, ByRef depth) Ancestors.Object(Util.FirstNonEmpty(p,"i")) = i If Len(p) < 5 Then If Not Util.IsNothing(i.Father) Then SetAncestor i.Father, Ancestors,p & "f", depth If Not Util.IsNothing(i.Mother) Then SetAncestor i.Mother, Ancestors,p & "m", depth End If If Len(p) > depth Then depth = Len(p) End Function Sub WriteHtmlEducations(i) Dim strPrefix, e, p, collEducations Set collEducations = i.Educations.ToGenoCollection If (collEducations.Count > 0) Then g_ichReferencesStart = -1 ' indicate at least one collapse/expand non-notes section present Report.WriteBr "
" Report.WriteLn "" End If End Sub Sub WriteHtmlOccupancies(i) Dim collOccupancies, o, ich, strName, strRelative Set collOccupancies = i.contacts.ToGenoCollection If (collOccupancies.Count > 0) Then g_ichReferencesStart = -1 ' indicate at least one collapse/expand non-notes section present Report.WriteBr "
" End If End Sub Sub WriteHtmlOccupations(i) Set collOccupations = i.Occupations.ToGenoCollection If (collOccupations.Count > 0) Then g_ichReferencesStart = -1 ' indicate at least one collapse/expand non-notes section present Report.WriteBr "
" End If End Sub Sub WriteMetaDescription(i) Dim b, c, s, cMateFemale, cChildFemale, o, strSpouse strSpouse = "_Spouse" Set b = i.Birth Report.WritePhraseDic "FmtMetaDescIndividual1", _ i.Session("NameFull"), Dic.LookupEx("Child_", i.Gender.ID), i.Father.Session("NameFull"), i.Mother.Session("NameFull"), b.Date.ToStringNarrative, b.Place.Session("Locative"), i.Gender.ID = "F" Set s = i.Mates.ToGenoCollection cMateFemale = 0 For Each o in s If o.Gender.ID = "F" Then cMateFemale = cMateFemale + 1 Next If s.Count = cMateFemale Then If Dic.Peek(strSpouse & "_" & i.Gender.ID & "_F") <> "" Then strSpouse = strSpouse & "_" & i.Gender.ID & "_F" End If Set c = i.Children.ToGenoCollection cChildFemale = 0 For Each o in c If o.Gender.ID = "F" Then cChildFemale = cChildFemale + 1 Next Report.WritePhraseDic "FmtMetaDescIndividual2", i.Session("NameShort"), ToHave(i, s), _ Dic.PlurialCardinal(strSpouse, s.Count), s.ToString, _ Dic.PlurialCardinal("Child", c.Count), c.ToString(g_NameTags(3)), _ s.Count = cMateFemale, s.Count > 1, c.Count = cChildFemale, c.Count > 1 End Sub Sub WriteMetaKeywords(i) Report.WritePhraseDic "FmtMetaKeyWordsIndividual", i, i.Name.Last, i.Pictures.Count > 0 End Sub ]%>