<?xml version="1.0" encoding="UTF-8"?>
<PGVReport>
	<!--
	@package webtrees
	@subpackage Reports
	@version $Id$
	-->
	<PGVRTitle><PGVRvar var="i18n::translate('Births, Deaths, Marriages')" /></PGVRTitle>
	<PGVRDescription>Prints a list of BIRT/DEAT/MARR events for individuals matching NAME or PLAC criteria.</PGVRDescription>
	<PGVRInput name="name" lookup="NAME" type="text"><PGVRvar var="i18n::translate('Name')" /></PGVRInput>
	<PGVRInput name="bdmplace" lookup="PLAC" type="text"><PGVRvar var="i18n::translate('Place')" /></PGVRInput>
	<PGVRInput name="birthdate1" lookup="DATE" type="text"><PGVRvar var="i18n::translate('Place')" /></PGVRInput>
	<PGVRInput name="birthdate2" lookup="DATE" type="text"><PGVRvar var="i18n::translate('Birth Date range end')" /></PGVRInput>
	<PGVRInput name="deathdate1" lookup="DATE" type="text"><PGVRvar var="i18n::translate('Death Date range start')" /></PGVRInput>
	<PGVRInput name="deathdate2" lookup="DATE" type="text"><PGVRvar var="i18n::translate('Death Date range end')" /></PGVRInput>
	<PGVRInput name="sortby" type="select" default="BIRT:DATE" options="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="15" style="b" />
	<!-- Page numbers text -->
	<PGVRStyle name="pagenum" font="$fonts" size="8"/>
	<!-- Standard text -->
	<PGVRStyle name="text" font="$fonts" size="9"/>
	<!-- 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="small" font="$fonts" size="7"/>
	<PGVRStyle name="label" font="$fonts" size="10" style="b" />

	<PGVRDoc pageSize="$pageSize" orientation="landscape">
		<PGVRHeader>
			<PGVRCell align="center" newline="1" style="label"><PGVRvar var="i18n::translate('Births, Deaths, Marriages')" /></PGVRCell>
			<PGVRCell align="center" newline="1" style="header">
				<PGVRif condition="$name!=''">
				    <PGVRvar var="name" /> 
				</PGVRif>
				<PGVRif condition="$bdmplace!=''">
					<PGVRvar var="bdmplace" />
				</PGVRif>
			</PGVRCell>
			<PGVRCell align="rightrtl" height="10" newline="1" style="pagenum"><PGVRvar var="i18n::translate('Page')" /> <PGVRPageNum /> <PGVRvar var="i18n::translate('of')" /> <PGVRTotalPages /></PGVRCell>
			<!-- ID -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='ID'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="40">
				<PGVRText style="label"></PGVRText>
			</PGVRTextBox>
			<!-- Name -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='NAME'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="205">
				<PGVRText style="label"><PGVRvar var="i18n::translate('Name')" /></PGVRText>
			</PGVRTextBox>
			<!-- Birth -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='BIRT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="165">
			<!-- todo: do not print [-] if no dates are selected -->
				<PGVRText style="label">
					<PGVRvar var="i18n::translate('Birth')" />   [
					<PGVRif condition="$birthdate1!=''">
						<PGVRvar var="birthdate1" />
					</PGVRif>
					-
					<PGVRif condition="$birthdate2!=''">
						<PGVRvar var="birthdate2" />
					</PGVRif>
					]
				</PGVRText>
			</PGVRTextBox>
			<!-- Marrige -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='MARR:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" width="165">
				<PGVRText style="label"><PGVRvar var="i18n::translate('Marriage')" /></PGVRText>
			</PGVRTextBox>
			<!-- Death -->
			<PGVRSetVar name="fill" value="" />
			<PGVRif condition="$sortby=='DEAT:DATE'">
				<PGVRSetVar name="fill" value="#AAAAAA" />
			</PGVRif>
			<PGVRTextBox bgcolor="$fill" border="1" height="12" newline="1">
			<!-- todo: do not print [-] if no dates are selected -->
				<PGVRText style="label">
					<PGVRvar var="i18n::translate('Death')" />   [
					<PGVRif condition="$deathdate1!=''">
						<PGVRvar var="deathdate1" />
					</PGVRif>
					-
					<PGVRif condition="$deathdate2!=''">
						<PGVRvar var="deathdate2" />
					</PGVRif>
					]
				</PGVRText>
			</PGVRTextBox>
		</PGVRHeader>

		<PGVRBody>
			<PGVRSetVar name="filter1" value="" />
			<PGVRif condition="$bdmplace!=''">
				<PGVRSetVar name="filter1" value=":PLAC CONTAINS $bdmplace" />
				<!-- todo: print only if BDM place is the searched place - use OR - search also on marriage place and date -->
			</PGVRif>

			<PGVRList list="individual" filter1="$filter1" filter2="BIRT:DATE GTE $birthdate1" filter3="BIRT:DATE LTE $birthdate2" filter4="DEAT:DATE GTE $deathdate1" filter5="DEAT:DATE LTE $deathdate2" filter6="NAME CONTAINS $name" sortby="$sortby">
				<PGVRSetVar name="spid" value="@ID" />

				<PGVRTextBox width="40" height="46">
					<PGVRText style="text">
						<PGVRGedcomValue tag="@id" />
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="205" height="46">
					<PGVRText style="text">
						<PGVRGetPersonName id="" />
					</PGVRText>
					<PGVRText style="small">
						<br />   <PGVRvar var="i18n::translate('Father')" />
						: <PGVRGedcom id="@FAMC"><PGVRGetPersonName id="@HUSB" /></PGVRGedcom>
						<br />   <PGVRvar var="i18n::translate('Mother')" />
						: <PGVRGedcom id="@FAMC"><PGVRGetPersonName id="@WIFE" /></PGVRGedcom>
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="165" height="46" border="1">
					<PGVRSetVar name="moreB" value="0" />
					<PGVRText style="small">
						<PGVRRepeatTag tag="BIRT">
							<PGVRif condition="$moreB==1">
								<br />
							</PGVRif>
							<PGVRvar var="i18n::translate('Date')" />
							: <PGVRGedcomValue tag="BIRT:DATE" />
							<br />  <PGVRvar var="i18n::translate('Place')" />
							: <PGVRGedcomValue tag="BIRT:PLAC" />
							<br />  <PGVRvar var="i18n::translate('Source')" />
							: <PGVRRepeatTag tag="BIRT:SOUR">
								<PGVRGedcomValue tag="SOUR" /> 
							</PGVRRepeatTag>
							<PGVRSetVar name="moreB" value="1" />
						</PGVRRepeatTag>
					</PGVRText>
				</PGVRTextBox>

				<PGVRTextBox width="165" height="46" border="1">
					<PGVRSetVar name="more" value="0" />
					<PGVRRepeatTag tag="FAMS">
						<PGVRText style="small">
							<PGVRGedcom id="@FAMS">
								<PGVRif condition="$more==1">
									<br />
									~~~~~~~~~~~~~~~~~~~~~~~~~~~
									<br />
								</PGVRif>
								<!-- todo: print the dates, places and sources of all the FAM MARR records -->
								<PGVRvar var="i18n::translate('Date')" />
								: <PGVRGedcomValue tag="MARR:DATE" />
								<br />  <PGVRvar var="i18n::translate('Place')" />
								: <PGVRGedcomValue tag="MARR:PLAC" />
								<br />  <PGVRvar var="i18n::translate('Source')" />
								: <PGVRRepeatTag tag="MARR:SOUR">
									<PGVRGedcomValue tag="SOUR" /> 
								</PGVRRepeatTag>
								<br />
								<PGVRvar var="i18n::translate('Spouse')" />
								: 
								<PGVRif condition="$spid==@WIFE">
									<PGVRGetPersonName id="@HUSB" />
								</PGVRif>
								<PGVRif condition="$spid==@HUSB">
									<PGVRGetPersonName id="@WIFE" />
								</PGVRif>
								<PGVRSetVar name="more" value="1" />
							</PGVRGedcom>
						</PGVRText>
					</PGVRRepeatTag>
				</PGVRTextBox>

				<PGVRTextBox border="1" height="46" newline="1">
					<PGVRSetVar name="moreD" value="0" />
					<PGVRText style="small">
						<PGVRRepeatTag tag="DEAT">
							<PGVRif condition="$moreD==1">
								<br />
							</PGVRif>
							<PGVRvar var="i18n::translate('Date')" />
							: <PGVRGedcomValue tag="DEAT:DATE" />
							<br />  <PGVRvar var="i18n::translate('Place')" />
							: <PGVRGedcomValue tag="DEAT:PLAC" />
							<br />  <PGVRvar var="i18n::translate('Source')" />
							: <PGVRRepeatTag tag="DEAT:SOUR">
								<PGVRGedcomValue tag="SOUR" /> 
							</PGVRRepeatTag>
							<PGVRSetVar name="moreD" value="1" />
						</PGVRRepeatTag>
						<PGVRRepeatTag tag="BURI:CEME">
							<br /><PGVRvar var="i18n::translate('Cemetery')" />
							: <PGVRGedcomValue tag="CEME" />
						</PGVRRepeatTag>
					</PGVRText>
				</PGVRTextBox>
				
			</PGVRList>

			<PGVRCell align="rightrtl" height="24" 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>
