<?xml version="1.0" encoding="UTF-8"?>
<PGVReport>
<!-- $Id$ -->
	<PGVRTitle><PGVRvar var="i18n::translate('Expanded Relatives Report')" /></PGVRTitle>
	<PGVRDescription>Prints a list of individuals related to a specific person</PGVRDescription>
	<PGVRInput name="pid" lookup="INDI" type="text"><PGVRvar var="i18n::translate('Enter Individual ID')" /></PGVRInput>
	<PGVRInput name="relatives" type="select" options="child-family,spouse-family,direct-ancestors,ancestors,descendants,all"><PGVRvar var="i18n::translate('Choose relatives')" /></PGVRInput>
	<PGVRInput name="sortby" type="select" default="BIRT:DATE" options="none,ID,NAME,BIRT:DATE,DEAT:DATE"><PGVRvar var="i18n::translate('Sort by')" /></PGVRInput>
	<PGVRInput name="pageSize" type="select" default="A4" options="letter,A3,A4,legal"><PGVRvar var="i18n::translate('Page size')" /></PGVRInput>
	<PGVRInput name="fonts" type="select" default="dejavusans" options="arialunicid0,dejavusans,helvetica"><PGVRvar var="i18n::translate('Font')"/></PGVRInput>

	<!-- Header -->
	<PGVRStyle name="header" font="$fonts" size="14" />
	<!-- Page numbers text -->
	<PGVRStyle name="pagenum" font="$fonts" size="8" />
	<!-- Generated by style - required style name by the generator -->
	<PGVRStyle name="genby" font="$fonts" size="8" />
	<!-- Date text -->
	<PGVRStyle name="date" font="$fonts" size="8"/>
	<PGVRStyle name="text" font="$fonts" size="10" />
	<PGVRStyle name="bold" font="$fonts" size="10" style="b" />
	<PGVRStyle name="mini" font="$fonts" size="8" />
	<PGVRStyle name="minibold" font="$fonts" size="8" style="b" />
	<PGVRStyle name="label" font="$fonts" size="10" style="b" />

	<PGVRSetVar name="height1" value="14" />
	<PGVRSetVar name="height2" value="10" />
	<PGVRSetVar name="width1" value="45" />
	<PGVRSetVar name="width2" value="150" />
	<PGVRSetVar name="width3" value="120" />
	<PGVRSetVar name="width4" value="120" />
	<PGVRSetVar name="width5" value="150" />
	<PGVRSetVar name="width6" value="150" />
	<PGVRSetVar name="widthB2" value="280" />
	<PGVRSetVar name="widthB3" value="40" />
	<PGVRSetVar name="widthB4" value="375" />
	<PGVRSetVar name="leftbdp" value="$width1+$width2" />

	<PGVRDoc pageSize="$pageSize" orientation="landscape">
		<PGVRHeader>
			<PGVRCell align="center" height="20" newline="1" style="header"><PGVRvar var="i18n::translate('Expanded Relatives Report')" /></PGVRCell>
			<PGVRCell align="rightrtl" newline="1" style="pagenum"><PGVRvar var="i18n::translate('Page')" /> <PGVRPageNum /> <PGVRvar var="i18n::translate('of')" /> <PGVRTotalPages /></PGVRCell>

			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='ID'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRCell bgcolor="$fill" border="1" height="$height1" style="label" width="$width1"> </PGVRCell>

			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='NAME'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRCell bgcolor="$fill" border="1" height="$height1" style="label" width="$width2"> <PGVRvar var="i18n::translate('Name')" /></PGVRCell>

			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='BIRT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRCell bgcolor="$fill" border="1" height="$height1" style="label" width="$width3"> <PGVRvar var="i18n::translate('Birth')" /></PGVRCell>

			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='DEAT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRCell bgcolor="$fill" border="1" height="$height1" style="label" width="$width4"> <PGVRvar var="i18n::translate('Death')" /></PGVRCell>

			<PGVRCell border="1" height="$height1" style="label" width="$width5"> <PGVRvar var="i18n::translate('Father')" /></PGVRCell>
			<PGVRCell border="1" height="$height1" newline="1" style="label"> <PGVRvar var="i18n::translate('Mother')" /></PGVRCell>
		</PGVRHeader>

		<PGVRBody>
			<PGVRRelatives id="$pid" group="$relatives" sortby="$sortby">
				<PGVRSetVar name="sex" value="@SEX" />
				<!-- 1. Block -->
				<PGVRTextBox height="$height1" width="$width1">
					<PGVRText style="bold"><PGVRGedcomValue tag="@id" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox height="$height1" width="$width2">
					<PGVRText style="bold"><PGVRGetPersonName id="" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox height="$height1" width="$width3">
					<PGVRText style="text"><PGVRGedcomValue tag="BIRT:DATE" truncate="20" /><br/></PGVRText>
					<PGVRText style="mini"><PGVRGedcomValue tag="BIRT:PLAC" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox height="$height1" width="$width4">
					<PGVRText style="text"><PGVRGedcomValue tag="DEAT:DATE" truncate="20" /><br/></PGVRText>
					<PGVRText style="mini"><PGVRGedcomValue tag="DEAT:PLAC" /></PGVRText>
				</PGVRTextBox>
				<!-- If FAMC is empty all lines will be ignored. So, don't place any newline break in here -->
				<PGVRGedcom id="@FAMC">
					<PGVRTextBox height="$height1" width="$width5">
						<PGVRGedcom id="@HUSB">
							<PGVRText style="text"><PGVRGetPersonName id="" /> (<PGVRGedcomValue tag="@id" />)</PGVRText>
						</PGVRGedcom>
					</PGVRTextBox>
					<PGVRTextBox height="$height1" newline="1">
						<PGVRGedcom id="@WIFE">
							<PGVRText style="text"><PGVRGetPersonName id="" /> (<PGVRGedcomValue tag="@id" />)</PGVRText>
						</PGVRGedcom>
					</PGVRTextBox>
				</PGVRGedcom>
				<!-- one way or the other, we need a new line -->
				<PGVRif condition="@FAMC==''">
					<PGVRTextBox height="2" newline="1"/>
				</PGVRif>
				<!-- 2. Block -->
<!--				<PGVRTextBox height="$height2" left="$leftbdp" width="$width3">
					<PGVRText style="mini"><PGVRGedcomValue tag="BIRT:PLAC" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox height="$height2" newline="1" width="$width4">
					<PGVRText style="mini"><PGVRGedcomValue tag="DEAT:PLAC" /></PGVRText>
				</PGVRTextBox>
-->				<!-- 3. Block -->
				<PGVRRepeatTag tag="FAMS">
					<PGVRGedcom id="@FAMS">
						<PGVRTextBox height="$height2" left="$width1" width="$widthB2">
							<PGVRif condition="$sex=='M'">
								<PGVRText style="mini">
									<PGVRvar var="i18n::translate('Family')" /> (<PGVRGedcomValue tag="@id" />) <PGVRvar var="i18n::translate('with')" /> <PGVRGetPersonName id="@WIFE" /> (<PGVRGedcom id="@WIFE"><PGVRGedcomValue tag="@id" /></PGVRGedcom>) <PGVRGedcomValue tag="MARR:DATE" />
								</PGVRText>
							</PGVRif>
							<PGVRif condition="$sex=='F'">
								<PGVRText style="mini">
									<PGVRvar var="i18n::translate('Family')" /> (<PGVRGedcomValue tag="@id" />) <PGVRvar var="i18n::translate('with')" /> <PGVRGetPersonName id="@HUSB" /> (<PGVRGedcom id="@HUSB"><PGVRGedcomValue tag="@id" /></PGVRGedcom>) <PGVRGedcomValue tag="MARR:DATE" />
								</PGVRText>
							</PGVRif>
						</PGVRTextBox>
						<PGVRTextBox height="$height2" width="50">
							<PGVRText style="minibold"><PGVRvar var="i18n::translate('Children')" />:</PGVRText>
						</PGVRTextBox>
						<PGVRTextBox height="$height2" newline="1">
							<PGVRSetVar name="morechildren" value="0" />
							<PGVRRepeatTag tag="CHIL">
								<PGVRGedcom id="@CHIL">
									<PGVRText style="mini">
										<!-- Print this only when more then one child exist -->
										<PGVRif condition="$morechildren==1">, </PGVRif>
										<PGVRGetPersonName id="" /> (<PGVRGedcomValue tag="@id" />)
									</PGVRText>
									<PGVRSetVar name="morechildren" value="1" />
								</PGVRGedcom>
							</PGVRRepeatTag>
						</PGVRTextBox>
					</PGVRGedcom>
				</PGVRRepeatTag>

				<!-- keep distance between line -->
				<PGVRTextBox height="2" newline="1" padding="0"/>
				<PGVRLine />
				<PGVRTextBox height="2" newline="1" padding="0"/>

			</PGVRRelatives>
			<PGVRCell align="rightrtl" height="15" newline="1" style="label">
				<br /><PGVRvar var="i18n::translate('Total individuals')" />: <PGVRListTotal />
			</PGVRCell>
		</PGVRBody>
		
		<PGVRFooter>
			<PGVRCell align="rightrtl" newline="1" style="date"><PGVRNow /></PGVRCell>
		</PGVRFooter>
	</PGVRDoc>
</PGVReport>
