<%[@ IncludeFile "Code/Util.vbs" ]%> <%[@ IncludeFile "Code/Lang.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 strName = i.Name 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]@
<%[ g_ichNotesStart = Report.BufferLength WriteHtmlButtonToggle("Notes") ichNotesEnd = Report.BufferLength g_ichReferencesStart = Report.BufferLength WriteHtmlButtonToggle("OtherDetails") ichReferencesEnd = Report.BufferLength ]%>
<%[ Set oHyperlinkRings = Session("oHyperlinkRings") Set oHyperlinkRingIndex = Session("oHyperlinkRingIndex") Report.WriteFormatted "

{}{&t}{}{}

", StrHtmlImgGender(i), strName, StrHtmlImgFileGno(i), StrHtmlImgFileSvg(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 WriteHtmlAdditionalInformation(i) WriteHtmlAnnotation Dic("AnnotationGeneral"), i.Comment WriteHtmlEducations(i) WriteHtmlOccupations(i) WriteHtmlOccupancies(i) WriteHtmlPedigreeChart(i) If i.Families.Order.Count > 0 Then Set collFamilies = i.Families.Order.ToGenoCollection Else Set collFamilies = i.Families.ToGenoCollection End If If collFamilies.Count > 0 Then If Not g_fHideFamilyDetails 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 Else For iFamily = 0 To collFamilies.Count - 1 Set f = collFamilies(iFamily) Set spouse = i.FindMate(f) ' Find the other spouse strSpouseName = spouse.Name If (strSpouseName = "") Then strSpouseName = Dic("_NoName") End If strHyperlinkText = Dic.FormatPhrase("PhFamilyWith", StrPossessiveProperNoun(i.Name.Short), Dic.Ordinal(nFamily), strSpouseName, Dic("DetailLink")) Report.WriteFormatted "

{}{}", StrHtmlImgFamily(f), Util.FormatHtmlHyperlink(f.Href, strHyperlinkText) Next End If 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"), _ i.Birth.Date.ToString(Dic("PedigreeChartDate")), i.Birth.Place.NameNarrative, _ i.Death.Date.ToString(Dic("PedigreeChartDate")), i.Death.Place.NameNarrative)," "," ") 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) 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 Set b = i.Birth Report.WritePhrase "Pedigree report of {0}[, {!1} of {2}[[{?2} and ]{3}]][, born{4}{5}].", _ i, Dic.LookupEx("Child_", i.Gender.ID), i.Father, i.Mother, b.Date.ToStringNarrative, b.Place.NameNarrative Set s = i.Mates.ToGenoCollection Set c = i.Children.ToGenoCollection Report.WritePhrase "{ }{!0} {!1} [{!2}[ named {3}]][[{?3} and] {4}[ named {5}]].", i.Name.Short, ToHave(i, s), _ Dic.PlurialCardinal("Spouse_", s.Count), s.ToString, _ Dic.PlurialCardinal("Child", c.Count), c.ToString("Name.Short") End Sub Sub WriteMetaKeywords(i) Report.WritePhrase "{0}[, {1} family and ancestry][{?2}, pictures of {!0}]", i, i.Name.Last, i.Pictures.Count > 0 End Sub ]%>