<?xml version="1.0" encoding="UTF-8"?>
<Report>
	<!-- $Id$ -->
	<Description>Prints a list of addresses</Description>
	<Title><var var="i18n::translate('Address List')" /></Title>
	<Input name="address" type="text"><var var="i18n::translate('Show addresses that contain:')" /> </Input>
	<Input name="sortby" type="select" options="NAME=>i18n::translate('Name')|ID=>i18n::translate('ID number')"><var var="i18n::translate('Sort by')" /></Input>
	<Input name="email_in" type="select" options="all=>i18n::translate('All addresses')|noemail=>i18n::translate('Addresses without emails')|onlyemail=>i18n::translate('Only addresses with emails')"><var var="i18n::translate('Include:')"/> </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="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"/>
	<!-- 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"/>
	<!-- Column labels -->
	<Style name="label" font="$fonts" size="10" style="b" />

	<Doc pageSize="$pageSize" >
		<Header>
			<Cell align="center" height="20" newline="1" style="header"><var var="i18n::translate('Address List')" /></Cell>
			<Cell align="rightrtl" newline="1" style="pagenum"><var var="i18n::translate('Page')" /> <PageNum /> <var var="i18n::translate('of')" /> <TotalPages /></Cell>
			<TextBox border="1" height="12" width="40">
				<Text style="label"> </Text>
			</TextBox>
			<TextBox border="1" height="12" width="170">
				<Text style="label"><var var="i18n::translate('Name')" /></Text>
			</TextBox>
			<TextBox border="1" height="12" width="160">
				<Text style="label"><var var="i18n::translate('Address')" /></Text>
			</TextBox>
			<TextBox border="1" height="12" newline="1">
				<Text style="label"><var var="i18n::translate('Phone')" /> / <var var="i18n::translate('Email address')" /></Text>
			</TextBox>
		</Header>

		<Body>
			<SetVar name="email" value="" />
			<SetVar name="addrfilter" value="ADDR CONTAINS " />
			<SetVar name="addrfilter2" value="" />
			<if condition="$address != ''">
				<SetVar name="addrfilter2" value="ADDR SUBCONTAINS $address" />
			</if>
			<if condition="$email_in=='noemail'">
				<SetVar name="email" value="EMAIL EQUALS ''" />
			</if>
			<if condition="$email_in=='onlyemail'">
				<SetVar name="email" value="EMAIL CONTAINS ." />
				<if condition="$address==''">
					<SetVar name="addrfilter" value="EMAIL CONTAINS ." />
					<SetVar name="email" value="" />
				</if>
			</if>
			<List list="individual" filter1="$addrfilter" filter2="$addrfilter2" filter3="$email" sortby="$sortby">
				<TextBox width="40" height="52" border="1">
					<Text style="text"><GedcomValue tag="@id" /></Text>
				</TextBox>
				<TextBox width="170" height="52" border="1">
					<Text style="text"><GetPersonName id="" /></Text>
				</TextBox>
				<TextBox width="160" height="52" border="1">
					<Text style="text"><GedcomValue tag="ADDR" /><GedcomValue tag="RESI:ADDR" /></Text>
					<if condition="@ADDR:ADR1 != ''">
						<Text style="text"><br /><GedcomValue tag="ADDR:ADR1" /></Text>
					</if>
					<if condition="@ADDR:CITY != ''">
						<if condition="$POSTAL_CODE==false">
							<if condition="@ADDR:STAE != ''">
								<Text style="text"><br /><GedcomValue tag="ADDR:POST" /> <GedcomValue tag="ADDR:CITY" />, <GedcomValue tag="ADDR:STAE" /> </Text>
							</if>
							<if condition="@ADDR:STAE == ''">
								<Text style="text"><br /><GedcomValue tag="ADDR:POST" /> <GedcomValue tag="ADDR:CITY" /></Text>
							</if>
						</if>
						<if condition="$POSTAL_CODE==true">
							<if condition="@ADDR:STAE != ''">
								<Text style="text"><br /><GedcomValue tag="ADDR:CITY" />, <GedcomValue tag="ADDR:STAE" /> <GedcomValue tag="ADDR:POST" /></Text>
							</if>
							<if condition="@ADDR:STAE == ''">
								<Text style="text"><br /><GedcomValue tag="ADDR:CITY" /> <GedcomValue tag="ADDR:POST" /></Text>
							</if>
						</if>

					</if>
					<if condition="@ADDR:CTRY != ''">
						<Text style="text"><br /><GedcomValue tag="ADDR:CTRY" /></Text>
					</if>
				</TextBox>
				<TextBox height="52" border="1" newline="1">
					<Text style="text">
						<varLetter var="PHON" /> <GedcomValue tag="PHON" /><br />
						<varLetter var="FAX" /> <GedcomValue tag="FAX" /><br />
						<varLetter var="EMAIL" /> <GedcomValue tag="_EMAIL" /><GedcomValue tag="EMAIL" />
					</Text>
				</TextBox>
			</List>
			<Cell align="rightrtl" newline="1" style="label">
				<br /><var var="i18n::translate('Total individuals')" />: <ListTotal />
			</Cell>
		</Body>
		
		<Footer>
			<Cell align="rightrtl" newline="1" style="date"><Now /></Cell>
		</Footer>
	</Doc>
</Report>
