<?xml version="1.0" encoding="UTF-8"?>
<Report>
	<!-- $Id$ -->
	<Title><var var="i18n::translate('Changes Report')" /></Title>
	<Description>Prints a list of individuals matching specific change criteria</Description>
	<Input name="changeRangeStart" lookup="DATE" type="text" default="NOW-30"><var var="i18n::translate('Starting range of change dates')" /></Input>
	<Input name="changeRangeEnd" lookup="DATE" type="text" default="NOW"><var var="i18n::translate('Ending range of change dates')" /></Input>
	<Input name="sortby" type="select" options="CHAN=>i18n::translate('Last change')|NAME=>i18n::translate('Name')|BIRT:DATE=>i18n::translate('Date of birth')"><var var="i18n::translate('Sort by')" /></Input>
	<Input name="pending" type="select" options="yes=>i18n::translate('Yes')|no=>i18n::translate('No')"><var var="i18n::translate('Show pending changes')" /></Input>
	<Input name="pageSize" type="select" default="A4" options="letter=>i18n::translate_c('paper size','Letter')|A3=>i18n::translate_c('paper size', 'A3')|A4=>i18n::translate_c('paper size','A4')|legal=>i18n::translate_c('paper size','Legal')"><var var="i18n::translate('Page size')" /></Input>
	<Input name="pageorient" type="select" default="landscape" options="landscape=>i18n::translate('Landscape')|portrait=>i18n::translate('Portrait')"><var var="i18n::translate('Orientation')" /></Input>
	<Input name="fonts" type="select" default="dejavusans" options="arialunicid0=>i18n::translate_c('font name', 'Arial')|dejavusans=>i18n::translate_c('font name', 'DejaVu')|helvetica=>i18n::translate_c('font name', 'Helvetica')"><var var="i18n::translate('Font')"/></Input>

	<!-- Header -->
	<Style name="header" font="$fonts" size="16" style="b" />
	<!-- Page numbers text -->
	<Style name="pagenum" font="$fonts" size="8"/>
	<!-- Standard text -->
	<Style name="text" font="$fonts" size="9"/>
	<!-- Column labels -->
	<Style name="label" font="$fonts" size="10" style="b"/>
	<!-- Generated by style - required style name by the generator -->
	<Style name="genby" font="$fonts" size="8" />
	<!-- Date text -->
	<Style name="date" font="$fonts" size="8"/>
	<Style name="header2" font="$fonts" size="12" style="b" />

	<if condition="$pageorient=='landscape'">
		<!-- landscape orientation -->
		<SetVar name="idwidth" value="50"/>
		<SetVar name="namewidth" value="220"/>
		<SetVar name="datewidth" value="300"/>
	</if>
	
	<if condition="$pageorient=='portrait'">
		<!-- portrait orientation -->
		<SetVar name="idwidth" value="40"/>
		<SetVar name="namewidth" value="170"/>
		<SetVar name="datewidth" value="190"/>
	</if>

	<Doc pageSize="$pageSize" orientation="$pageorient" >
		<Header>
			<Cell align="center" height="20" newline="1" style="header"><var var="i18n::translate('Changes Report')" /></Cell>
			<Cell align="rightrtl" newline="1" style="pagenum"><var var="i18n::translate('Page')" /> <PageNum /> <var var="i18n::translate('of')" /> <TotalPages /></Cell>
		</Header>

		<Body>

			<!-- Pending changes section Header -->
			<if condition="$pending=='yes'">
				<Cell align="center" height="20" newline="1" style="header2"><var var="i18n::translate('Pending changes')" /></Cell>
				<TextBox border="1" height="12" width="$idwidth">
					<Text style="label"> </Text>
				</TextBox>

				<SetVar name="fill" value="" />
				<if condition="$sortby=='NAME'"><SetVar name="fill" value="#AAAAAA" /></if>
				<TextBox bgcolor="$fill" border="1" height="12" width="$namewidth">
					<Text style="label"><var var="i18n::translate('Name')" /></Text>
				</TextBox>

				<TextBox border="1" height="12" width="$datewidth">
					<Text style="label"><var var="i18n::translate('Differences')" /></Text>
				</TextBox>

				<SetVar name="fill" value="" />
				<if condition="$sortby=='CHAN'"><SetVar name="fill" value="#AAAAAA" /></if>
				<TextBox bgcolor="$fill" border="1" height="12" newline="1">
					<Text style="label"><var var="i18n::translate('Last change')" /></Text>
				</TextBox>

				<!-- Pending Changes Section Data -->
				<List list="pending" sortby="$sortby">
					<TextBox height="12" width="$idwidth">
						<Text style="text"><GedcomValue tag="@id" /></Text>
					</TextBox>
					<TextBox height="12" width="$namewidth">
						<Text style="text"><GetPersonName id="" /></Text>
					</TextBox>
					<TextBox height="12" width="$datewidth">
						<Facts ignore="CHAN" families="0" diff="true">
							<Text style="text">
								<var var="@fact" /> <GedcomValue tag="@fact:DATE" /><br />
							</Text>
						</Facts>
					</TextBox>
					<TextBox height="12" newline="1">
						<Text style="text"><GedcomValue tag="CHAN:DATE" /> <GedcomValue tag="CHAN:DATE:TIME" /> - <GedcomValue tag="CHAN:_WT_USER" /></Text>
					</TextBox>

				</List>
				<Cell align="rightrtl" height="25" newline="1" style="label">
					<var var="i18n::translate('Total pending changes: ')" /><ListTotal /><br />
				</Cell>
			</if>

			<!-- Recent Changes Section Header -->
			<Cell align="center" height="20" newline="1" style="header2"><var var="i18n::translate('Recent changes')" /> <var var="changeRangeStart" date="1" /> - <var var="changeRangeEnd" date="1" /></Cell>
			<TextBox border="1" height="12" width="$idwidth">
				<Text style="label"> </Text>
			</TextBox>

			<SetVar name="fill" value="" />
			<if condition="$sortby=='NAME'"><SetVar name="fill" value="#AAAAAA" /></if>
			<TextBox bgcolor="$fill" border="1" height="12" width="$namewidth">
				<Text style="label"><var var="i18n::translate('Name')" /></Text>
			</TextBox>

			<SetVar name="fill" value="" />
			<if condition="$sortby=='BIRT:DATE'"><SetVar name="fill" value="#AAAAAA" /></if>
			<TextBox bgcolor="$fill" border="1" height="12" width="$datewidth">
				<Text style="label"><var var="i18n::translate('Birth')" /> - <var var="i18n::translate('Death')" /></Text>
			</TextBox>

			<SetVar name="fill" value="" />
			<if condition="$sortby=='CHAN'"><SetVar name="fill" value="#AAAAAA" /></if>
			<TextBox bgcolor="$fill" border="1" height="12" newline="1">
				<Text style="label"><var var="i18n::translate('Last change')" /></Text>
			</TextBox>

			<!-- Recent Changes Section Data -->
			<List list="individual" filter1="CHAN:DATE LTE $changeRangeEnd" filter2="CHAN:DATE GTE $changeRangeStart" sortby="$sortby">
				<TextBox height="12" width="$idwidth">
					<Text style="text"><GedcomValue tag="@id" /></Text>
				</TextBox>

				<TextBox height="12" width="$namewidth">
					<Text style="text"><GetPersonName id="" /></Text>
				</TextBox>

				<TextBox height="12" width="$datewidth">
					<Text style="text"><varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /><br /><varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" /></Text>
				</TextBox>

				<TextBox height="12" newline="1">
					<Text style="text"><GedcomValue tag="CHAN:DATE" /> <GedcomValue tag="CHAN:DATE:TIME" /> - <GedcomValue tag="CHAN:_WT_USER" /></Text>
				</TextBox>
			</List>

			<Cell align="rightrtl" height="25" newline="1" style="label">
				<var var="i18n::translate('Total accepted changes: ')" /><ListTotal />
			</Cell>
		</Body>
		<Footer>
			<Cell align="rightrtl" newline="1" style="date"><Now /></Cell>
		</Footer>
	</Doc>
</Report>
