<?xml version="1.0" encoding="UTF-8"?>
<PGVReport>
	<!-- $Id$ -->
	<PGVRDescription>Prints a list of addresses</PGVRDescription>
	<PGVRTitle><PGVRvar var="i18n::translate('Address List')" /></PGVRTitle>
	<PGVRInput name="address" type="text"><PGVRvar var="i18n::translate('Show addresses that contain:')" /> </PGVRInput>
	<PGVRInput name="sortby" type="select" options="NAME,ID"><PGVRvar var="i18n::translate('Sort by')" /></PGVRInput>
	<PGVRInput name="email_in" type="select" options="all,noemail,onlyemail"><PGVRvar var="i18n::translate('Include:')"/> </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="16" 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"/>
	<!-- Column labels -->
	<PGVRStyle name="label" font="$fonts" size="10" style="b" />

	<PGVRDoc pageSize="$pageSize" >
		<PGVRHeader>
			<PGVRCell align="center" height="20" newline="1" style="header"><PGVRvar var="i18n::translate('Address List')" /></PGVRCell>
			<PGVRCell align="rightrtl" newline="1" style="pagenum"><PGVRvar var="i18n::translate('Page')" /> <PGVRPageNum /> <PGVRvar var="i18n::translate('of')" /> <PGVRTotalPages /></PGVRCell>
			<PGVRTextBox border="1" height="12" width="40">
				<PGVRText style="label"> </PGVRText>
			</PGVRTextBox>
			<PGVRTextBox border="1" height="12" width="170">
				<PGVRText style="label"><PGVRvar var="i18n::translate('Name')" /></PGVRText>
			</PGVRTextBox>
			<PGVRTextBox border="1" height="12" width="160">
				<PGVRText style="label"><PGVRvar var="i18n::translate('Address')" /></PGVRText>
			</PGVRTextBox>
			<PGVRTextBox border="1" height="12" newline="1">
				<PGVRText style="label"><PGVRvar var="i18n::translate('Phone')" /> / <PGVRvar var="i18n::translate('Email Address')" /></PGVRText>
			</PGVRTextBox>
		</PGVRHeader>

		<PGVRBody>
			<PGVRSetVar name="email" value="" />
			<PGVRSetVar name="addrfilter" value="ADDR CONTAINS " />
			<PGVRSetVar name="addrfilter2" value="" />
			<PGVRif condition="$address != ''">
				<PGVRSetVar name="addrfilter2" value="ADDR SUBCONTAINS $address" />
			</PGVRif>
			<PGVRif condition="$email_in=='noemail'">
				<PGVRSetVar name="email" value="EMAIL EQUALS ''" />
			</PGVRif>
			<PGVRif condition="$email_in=='onlyemail'">
				<PGVRSetVar name="email" value="EMAIL CONTAINS ." />
				<PGVRif condition="$address==''">
					<PGVRSetVar name="addrfilter" value="EMAIL CONTAINS ." />
					<PGVRSetVar name="email" value="" />
				</PGVRif>
			</PGVRif>
			<PGVRList list="individual" filter1="$addrfilter" filter2="$addrfilter2" filter3="$email" sortby="$sortby">
				<PGVRTextBox width="40" height="52" border="1">
					<PGVRText style="text"><PGVRGedcomValue tag="@id" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox width="170" height="52" border="1">
					<PGVRText style="text"><PGVRGetPersonName id="" /></PGVRText>
				</PGVRTextBox>
				<PGVRTextBox width="160" height="52" border="1">
					<PGVRText style="text"><PGVRGedcomValue tag="ADDR" /><PGVRGedcomValue tag="RESI:ADDR" /></PGVRText>
					<PGVRif condition="@ADDR:ADR1 != ''">
						<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:ADR1" /></PGVRText>
					</PGVRif>
					<PGVRif condition="@ADDR:CITY != ''">
						<PGVRif condition="$POSTAL_CODE==false">
							<PGVRif condition="@ADDR:STAE != ''">
								<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:POST" /> <PGVRGedcomValue tag="ADDR:CITY" />, <PGVRGedcomValue tag="ADDR:STAE" /> </PGVRText>
							</PGVRif>
							<PGVRif condition="@ADDR:STAE == ''">
								<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:POST" /> <PGVRGedcomValue tag="ADDR:CITY" /></PGVRText>
							</PGVRif>
						</PGVRif>
						<PGVRif condition="$POSTAL_CODE==true">
							<PGVRif condition="@ADDR:STAE != ''">
								<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:CITY" />, <PGVRGedcomValue tag="ADDR:STAE" /> <PGVRGedcomValue tag="ADDR:POST" /></PGVRText>
							</PGVRif>
							<PGVRif condition="@ADDR:STAE == ''">
								<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:CITY" /> <PGVRGedcomValue tag="ADDR:POST" /></PGVRText>
							</PGVRif>
						</PGVRif>

					</PGVRif>
					<PGVRif condition="@ADDR:CTRY != ''">
						<PGVRText style="text"><br /><PGVRGedcomValue tag="ADDR:CTRY" /></PGVRText>
					</PGVRif>
				</PGVRTextBox>
				<PGVRTextBox height="52" border="1" newline="1">
					<PGVRText style="text">
						<PGVRvarLetter var="i18n::translate('Phone')" />: <PGVRGedcomValue tag="PHON" /><br />
						<PGVRvarLetter var="i18n::translate('FAX')" />: <PGVRGedcomValue tag="FAX" /><br />
						<PGVRvarLetter var="i18n::translate('Email Address')" />: <PGVRGedcomValue tag="_EMAIL" /><PGVRGedcomValue tag="EMAIL" />
					</PGVRText>
				</PGVRTextBox>
			</PGVRList>
			<PGVRCell align="rightrtl" 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>
