%[@ IncludeFile "Code/Util.vbs" ]%> <%[@ IncludeFile "Code/Lang.vbs" ]%> <%[ InitGlobalVariables ' 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 oDataSorter = Util.NewDataSorter() ' Add each valid family to the DataSorter For Each f In Families If (f.Name <> "" And Not f.IsLabel) Then Set oNameParent = f.Parents(0).Name If oNameparent.Last = "" Then Set oNameParent = f.Parents(1).Name Set oNameSpouse = f.Parents(0).Name Else Set oNameSpouse = f.Parents(1).Name End if oDataSorter.Add f, oNameParent.Last, oNameParent.First, oNameParent.Middle, oNameSpouse.Last 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 g_cTocExpand = -1 Or g_cTocExpand >= collFamiliesSorted.Count Then fTreeOpen = true strToggle="collapse" Else fTreeOpen = false strToggle = "expand" End If fPrivateFolder = Eval(Left(Report.FileOutput,g_nPrivateFolder)=g_strPrivateFolder) ]%>