<%[@ IncludeFile "Code/Util.vbs" ]%> <%[@ IncludeFile "Code/Lang.vbs" ]%> <%[If Session("Book") Then Report.AbortTemplate]%> <%[ ' The following code generates list of families in the report. ' The sorting of families is done using the father's last name ' as the primary sort key, then the first and middle name. ' If a husband had multiple partners (therefore multiple ' families), then the sorting is done according to the ' spouse's last name, first and middle name. ' If the husband's name is unknown then the wife's name is used ' This is not the ideal method of grouping families, ' however it is better than nothing. Set oNameDicNames = Session("oNameDicNames") Set oDataSorter = Util.NewDataSorter() ' Add each valid family to the DataSorter For Each f In Families If (f.Name <> "" And Not f.IsLabel) Then Set oParent = f.Parents(0) If oParent.Name.Last = "" Then Set oParent = f.Parents(1) Set oSpouse = f.Parents(0) Else Set oSpouse = f.Parents(1) End if oDataSorter.Add f, oParent.Session("NameLast"), StrNameTranslate(oParent.Name.First, oNameDicNames, False), StrNameTranslate(oParent.Name.Middle, oNameDicNames, False), oSpouse.Session("NameLast") Else ' Prevent any hyperlink to a family without a name f.Href = "" End If Next ' Sort the families according the sort keys oDataSorter.SortByKey ' Now, get a normal collection of families from the DataSorter. Set collFamiliesSorted = oDataSorter.ToGenoCollection ' Store this collection in the Session object, so it can be accessed when generating the picture album too Session("collFamiliesSorted") = collFamiliesSorted If Session("cTocExpand") = -1 Or Session("cTocExpand") >= collFamiliesSorted.Count Then fTreeOpen = true strToggle="collapse" Else fTreeOpen = false strToggle = "expand" End If ]%> @[ Report.WriteFormatted Dic("FmtTitleTocFamilies"), Session("Title") ]@ <%[If Session("fUseTreeIndexes") Then]%> <%[If Session("fUseCurvyBoxes") Then CurvyBoxOpen() Else Report.WriteLn "
" End if ]%> @[WriteHtmlButtonToggle("Entries")]@ <%[Else]%> <%[If Session("fUseCurvyBoxes") Then CurvyBoxOpen() Else Report.WriteLn "
" End if End If]%>

@[ Report.WriteTextDic "TocIndexFamilies" ]@

<%[Report.Write Util.IfElse(Session("fUseCurvyBoxes"), "
", "
") Report.WriteLn "
    " ' Output those families to the report WriteHtmlTocFamilies fTreeOpen, false ]%> <%[If Session("fUseTreeIndexes") Then]%>
<%[End If]%>
<%[If Session("fUseCurvyBoxes") Then CurvyBoxClose()]%> <%[ WriteHtmlFramesetSafeguardK iFamilyLast, "GenoProReportFamilies", nothing ]%>