<?xml version="1.0" encoding="UTF-8"?>
<PGVReport>
	<!-- $Id$ -->
	<PGVRTitle><PGVRvar var="i18n::translate('Individual Report')" /></PGVRTitle>
	<PGVRDescription>Prints an individual record report</PGVRDescription>
	<PGVRInput name="pid" lookup="INDI" type="text" default=""><PGVRvar var="i18n::translate('Enter Individual ID')" /></PGVRInput>
	<PGVRInput name="sources" type="checkbox" default="1"><PGVRvar var="i18n::translate('Show sources?')" /></PGVRInput>
	<PGVRInput name="notes" type="checkbox" default="1"><PGVRvar var="i18n::translate('Show notes?')" /></PGVRInput>
	<PGVRInput name="photos" type="select" default="highlighted" options="none,all,highlighted"><PGVRvar var="i18n::translate('Show photos?')"/></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="18" />
	<!-- Generated by style - required style name by the generator -->
	<PGVRStyle name="genby" font="$fonts" size="8" />
	<!-- Page numbers text -->
	<PGVRStyle name="pagenum" font="$fonts" size="8" />
	<!-- Source text - PGVRFootnoteTexts - required style name by the generator -->
	<PGVRStyle name="footnote" font="$fonts" size="8" />
	<!-- Links to sources - required style name by the generator -->
	<PGVRStyle name="footnotenum" font="$fonts" size="6" />
	<!-- Date text -->
	<PGVRStyle name="date" font="$fonts" size="8"/>
	<PGVRStyle name="label1" font="$fonts" size="9" />
	<PGVRStyle name="name" font="$fonts" size="10" />
	<PGVRStyle name="name1" font="$fonts" size="14" />
	<PGVRStyle name="text" font="$fonts" size="9" />

	<PGVRSetVar name="ignore" value="CHAN,NAME,SEX,SOUR,NOTE,OBJE,FAMC,FAMS,TITL,CHIL,HUSB,WIFE,_UID,_WT_OBJE_SORT" />
	<!-- Section title background color -->
	<PGVRSetVar name="stbgcolor" value="#AAAAAA"/>
	<!-- set the default widths -->
	<PGVRSetVar name="width" value="433" />
	<PGVRSetVar name="width1" value="418" />
	<PGVRSetVar name="width2" value="233" />
	<PGVRSetVar name="dwidth" value="200" />
	<PGVRSetVar name="pwidth" value="436" />
	<!-- change the widths for no pictures -->
	<PGVRif condition="$photos=='none'">
		<PGVRSetVar name="width" value="0"/>
		<PGVRSetVar name="width1" value="0"/>
		<PGVRSetVar name="width2" value="0"/>
	</PGVRif>
	<!-- New Page for Sources controller if SOUR exist -->
	<PGVRSetVar name="source_exist" value="0" />

	<PGVRDoc pageSize="$pageSize" >
		<PGVRHeader>
			<PGVRCell align="center" newline="1" style="header"><PGVRvar var="i18n::translate('Individual Report')" /></PGVRCell>
			<PGVRCell align="rightrtl" newline="1" style="pagenum"><PGVRvar var="i18n::translate('Page')" /> <PGVRPageNum /> <PGVRvar var="i18n::translate('of')" /> <PGVRTotalPages /></PGVRCell>
		</PGVRHeader>
		<PGVRBody>
			<!-- set the gedcom context for this individual -->
			<PGVRGedcom id="$pid">
				<PGVRCell newline="1" style="name1"><PGVRGetPersonName id=""/></PGVRCell>
				<!-- show the persons images -->
				<PGVRif condition="$photos=='all'">
					<!-- This is an image not a text, so don't use text padding
					Reset also the last height after all the images has been printed
					set pagecheck to 0, the image function check is too
					and "trick" the X-position back to the margin with a newline -->
					<PGVRTextBox left="$pwidth" newline="1" pagecheck="0" padding="0" reseth="1" width="80">
						<PGVRRepeatTag tag="OBJE">
							<PGVRImage file="@FILE" width="80" ln="N"/>
						</PGVRRepeatTag>
					</PGVRTextBox>
				</PGVRif>
				<!-- show the person's Highlighted Image -->
				<PGVRif condition="$photos=='highlighted'">
					<PGVRHighlightedImage left="$pwidth" width="80"/>
				</PGVRif>

				<!-- print the person's facts -->
				<PGVRTextBox bgcolor="$stbgcolor" border="1" height="16" newline="1" width="$width">
					<PGVRText style="label1"><PGVRvar var="i18n::translate('Personal Facts and Details')" /></PGVRText>
				</PGVRTextBox>
				
				<!-- print level 1 sources -->
				<PGVRTextBox border="1" width="$width" height="16" newline="1">
					<PGVRText style="name"><PGVRGetPersonName id=""/> </PGVRText>
					<PGVRif condition="$sources==1">
						<PGVRRepeatTag tag="SOUR">
							<PGVRFootnote>
								<PGVRGedcom id="@SOUR">
									<PGVRGedcomValue tag="TITL" />
								</PGVRGedcom>
								<PGVRif condition="@PAGE!=''">: </PGVRif>
								<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
							</PGVRFootnote>
							<PGVRSetVar name="source_exist" value="1"/>
						</PGVRRepeatTag>
					</PGVRif>
				</PGVRTextBox>
				<PGVRFacts ignore="$ignore" families="1">
					<PGVRTextBox border="1" width="$dwidth" height="16">
						<PGVRText style="pagenum"><PGVRvar var="i18n::translate('@fact')" />  </PGVRText>
						<PGVRText style="text"><PGVRGedcomValue tag="@fact:DATE" /> </PGVRText>
						<!-- look for fact level 2 sources -->
						<PGVRif condition="$sources==1">
							<PGVRRepeatTag tag="@fact:SOUR">
								<PGVRFootnote>
									<PGVRGedcom id="@SOUR">
										<PGVRGedcomValue tag="TITL" />
									</PGVRGedcom>
									<PGVRif condition="@PAGE!=''">: </PGVRif>
									<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
								</PGVRFootnote>
								<PGVRSetVar name="source_exist" value="1"/>
							</PGVRRepeatTag>
						</PGVRif>
					</PGVRTextBox>
					<!-- print a different layout for facts with descriptions -->
					<PGVRif condition="@desc!=''">
						<PGVRTextBox border="1" width="$width2" height="16" newline="1">
							<PGVRText style="text"><PGVRGedcomValue tag="@desc" />
								<!-- Print this only when it's needed -->
								<PGVRif condition="@PLAC!=''"> </PGVRif>
								<PGVRGedcomValue tag="@fact:PLAC" />
							</PGVRText>
							<PGVRGedcom id="@_PGVS">
								<PGVRif condition="@SEX=='M'">
									<PGVRText style="pagenum"> <PGVRvar var="i18n::translate('Husband')" /></PGVRText>
								</PGVRif>
								<PGVRif condition="@SEX=='F'">
									<PGVRText style="pagenum"> <PGVRvar var="i18n::translate('Wife')" /></PGVRText>
								</PGVRif>
								<PGVRText style="text"> <PGVRGetPersonName id="" /></PGVRText>
							</PGVRGedcom>
						</PGVRTextBox>
					</PGVRif>
					<!-- facts without descriptions -->
					<PGVRif condition="@desc==''">
						<PGVRTextBox border="1" width="$width2" height="16" newline="1">
							<PGVRif condition="@PLAC!=''">
								<PGVRText style="pagenum"><PGVRvar var="i18n::translate('Place')" />   </PGVRText>
							</PGVRif>
							<PGVRText style="text">
								<PGVRGedcomValue tag="@fact:PLAC" /> <PGVRGedcomValue tag="@fact:TEMP" />
							</PGVRText>
							<PGVRGedcom id="@_PGVS">
								<PGVRif condition="@SEX=='M'">
									<PGVRText style="pagenum"> <PGVRvar var="i18n::translate('Husband')" /></PGVRText>
								</PGVRif>
								<PGVRif condition="@SEX=='F'">
									<PGVRText style="pagenum"> <PGVRvar var="i18n::translate('Wife')" /></PGVRText>
								</PGVRif>
								<PGVRText style="text"> <PGVRGetPersonName id="" /></PGVRText>
							</PGVRGedcom>
						</PGVRTextBox>
					</PGVRif>
				</PGVRFacts>

				<!-- print any level 1 notes -->
				<PGVRif condition="($notes==1) and (@NOTE!='')">
					<PGVRTextBox width="15" height="16" newline="1" padding="0"/>
					<PGVRTextBox border="1" width="$width" height="16" newline="1" bgcolor="$stbgcolor">
						<PGVRText style="label1"><PGVRvar var="i18n::translate('Notes')" /></PGVRText>
					</PGVRTextBox>
					<PGVRRepeatTag tag="NOTE">
						<PGVRTextBox border="1" width="$width" height="16" newline="1">
							<PGVRText style="pagenum"><PGVRGedcomValue tag="NOTE" /><br/></PGVRText>
						</PGVRTextBox>
					</PGVRRepeatTag>
				</PGVRif>

				<!-- print family with parents and siblings -->
				<PGVRTextBox width="15" height="16" newline="1" padding="0"/>
				<PGVRTextBox border="1" width="$width" height="16" newline="1" bgcolor="$stbgcolor">
					<PGVRText style="label1"><PGVRvar var="i18n::translate('Family with Parents')" /></PGVRText>
				</PGVRTextBox>
				<PGVRRepeatTag tag="FAMC">
					<PGVRGedcom id="@FAMC">
						<!-- father -->
						<PGVRGedcom id="@HUSB">
							<PGVRTextBox border="1" width="$width" height="16" newline="1">
								<PGVRText style="label1"><PGVRvar var="i18n::translate('Father')" />  </PGVRText>
								<PGVRText style="name"> <PGVRGetPersonName id="" /> </PGVRText>
								<PGVRif condition="$sources==1">
									<PGVRRepeatTag tag="SOUR">
										<PGVRFootnote>
											<PGVRGedcom id="@SOUR">
												<PGVRGedcomValue tag="TITL" />
											</PGVRGedcom>
											<PGVRif condition="@PAGE!=''">: </PGVRif>
											<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
										</PGVRFootnote>
										<PGVRSetVar name="source_exist" value="1"/>
									</PGVRRepeatTag>
								</PGVRif>
								<PGVRText style="text"> (<PGVRvar var="i18n::translate('Birth')" />: <PGVRGedcomValue tag="BIRT:DATE" /> <PGVRGedcomValue tag="BIRT:PLAC" /> - <PGVRvar var="i18n::translate('Death')" />: <PGVRGedcomValue tag="DEAT:DATE" /> <PGVRGedcomValue tag="DEAT:PLAC" />)</PGVRText>
							</PGVRTextBox>
						</PGVRGedcom>
						<!-- mother -->
						<PGVRGedcom id="@WIFE">
							<PGVRTextBox border="1" width="$width" height="16" newline="1">
								<PGVRText style="label1"><PGVRvar var="i18n::translate('Mother')" />  </PGVRText>
								<PGVRText style="name"> <PGVRGetPersonName id="" /> </PGVRText>
								<PGVRif condition="$sources==1">
									<PGVRRepeatTag tag="SOUR">
										<PGVRFootnote>
											<PGVRGedcom id="@SOUR">
												<PGVRGedcomValue tag="TITL" />
											</PGVRGedcom>
											<PGVRif condition="@PAGE!=''">: </PGVRif>
											<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
										</PGVRFootnote>
										<PGVRSetVar name="source_exist" value="1"/>
									</PGVRRepeatTag>
								</PGVRif>
								<PGVRText style="text"> (<PGVRvar var="i18n::translate('Birth')" />: <PGVRGedcomValue tag="BIRT:DATE" /> <PGVRGedcomValue tag="BIRT:PLAC" /> - <PGVRvar var="i18n::translate('Death')" />: <PGVRGedcomValue tag="DEAT:DATE" /> <PGVRGedcomValue tag="DEAT:PLAC" />)</PGVRText>
							</PGVRTextBox>
						</PGVRGedcom>
						<!-- siblings -->
						<PGVRRepeatTag tag="CHIL">
							<PGVRif condition="@CHIL!=$pid">
								<PGVRGedcom id="@CHIL">
								<PGVRTextBox border="1" left="15" width="$width1" height="16" newline="1">
									<!-- Brother -->
									<PGVRif condition="@SEX=='M'">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Brother')" />  </PGVRText>
									</PGVRif>
									<!-- Sister -->
									<PGVRif condition="@SEX=='F'">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Sister')" />  </PGVRText>
									</PGVRif>
									<!-- Unknown gender -->
									<PGVRif condition="(@SEX=='U') or (@SEX=='')">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Gender')" /> <PGVRvar var="i18n::translate('Unknown')"/>  </PGVRText>
									</PGVRif>
									<PGVRText style="name"> <PGVRGetPersonName id="" /> </PGVRText>
									<PGVRif condition="$sources==1">
										<PGVRRepeatTag tag="SOUR">
											<PGVRFootnote>
												<PGVRGedcom id="@SOUR">
													<PGVRGedcomValue tag="TITL" />
												</PGVRGedcom>
												<PGVRif condition="@PAGE!=''">: </PGVRif>
												<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
											</PGVRFootnote>
											<PGVRSetVar name="source_exist" value="1"/>
										</PGVRRepeatTag>
									</PGVRif>
									<PGVRText style="text"> (<PGVRvar var="i18n::translate('Birth')" />: <PGVRGedcomValue tag="BIRT:DATE" /> <PGVRGedcomValue tag="BIRT:PLAC" /> - <PGVRvar var="i18n::translate('Death')" />: <PGVRGedcomValue tag="DEAT:DATE" /> <PGVRGedcomValue tag="DEAT:PLAC" />)</PGVRText>
								</PGVRTextBox>
							</PGVRGedcom>
						  </PGVRif>
						</PGVRRepeatTag>
					</PGVRGedcom>
				</PGVRRepeatTag>

				<!-- print family with spouse and children -->
				<PGVRRepeatTag tag="FAMS">
					<PGVRGedcom id="@FAMS">
						<!-- print wife if person is husband -->
						<PGVRif condition="$pid==@HUSB">
							<PGVRTextBox width="15" height="16" newline="1" padding="0"/>
							<PGVRTextBox border="1" width="$width" height="16" newline="1" bgcolor="$stbgcolor">
								<PGVRText style="label1"><PGVRvar var="i18n::translate('Family with wife')" /></PGVRText>
							</PGVRTextBox>
							<PGVRSetVar name="spid" value="@WIFE" />
						</PGVRif>
						<!-- print husband if person is wife -->
						<PGVRif condition="$pid==@WIFE">
							<PGVRTextBox width="15" height="16" newline="1" padding="0"/>
							<PGVRTextBox border="1" width="$width" height="16" newline="1" bgcolor="$stbgcolor">
								<PGVRText style="label1"><PGVRvar var="i18n::translate('Family with husband')" /></PGVRText>
							</PGVRTextBox>
							<PGVRSetVar name="spid" value="@HUSB" />
						</PGVRif>

						<!-- print information for spouse -->
						<PGVRGedcom id="$spid">
							<PGVRTextBox border="1" width="$width" height="16" newline="1">
								<PGVRif condition="@SEX=='M'">
									<PGVRText style="label1"><PGVRvar var="i18n::translate('Husband')" />  </PGVRText>
								</PGVRif>
								<PGVRif condition="@SEX=='F'">
									<PGVRText style="label1"><PGVRvar var="i18n::translate('Wife')" />  </PGVRText>
								</PGVRif>
								<PGVRText style="name"> <PGVRGetPersonName id="" /> </PGVRText>
								<PGVRif condition="$sources==1">
									<PGVRRepeatTag tag="SOUR">
										<PGVRFootnote>
											<PGVRGedcom id="@SOUR">
												<PGVRGedcomValue tag="TITL" />
											</PGVRGedcom>
											<PGVRif condition="@PAGE!=''">: </PGVRif>
											<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
										</PGVRFootnote>
										<PGVRSetVar name="source_exist" value="1"/>
									</PGVRRepeatTag>
								</PGVRif>
							<PGVRText style="text"> (<PGVRvar var="i18n::translate('Birth')" />: <PGVRGedcomValue tag="BIRT:DATE" /> <PGVRGedcomValue tag="BIRT:PLAC" /> - <PGVRvar var="i18n::translate('Death')" />: <PGVRGedcomValue tag="DEAT:DATE" /> <PGVRGedcomValue tag="DEAT:PLAC" />)</PGVRText>
							</PGVRTextBox>
						</PGVRGedcom>
						<!-- print children -->
						<PGVRRepeatTag tag="CHIL">
						  <PGVRif condition="@CHIL!=$pid">
							<PGVRGedcom id="@CHIL">
								<PGVRTextBox border="1" left="15" width="$width1" height="16" newline="1">
									<!-- Son -->
									<PGVRif condition="@SEX=='M'">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Son')" />  </PGVRText>
									</PGVRif>
									<!-- Daughter -->
									<PGVRif condition="@SEX=='F'">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Daughter')" />  </PGVRText>
									</PGVRif>
									<!-- Unknown gender -->
									<PGVRif condition="(@SEX=='U') or (@SEX=='')">
										<PGVRText style="label1"><PGVRvar var="i18n::translate('Gender')"/> <PGVRvar var="i18n::translate('Unknown')"/>  </PGVRText>
									</PGVRif>
									<PGVRText style="name"> <PGVRGetPersonName id="" /> </PGVRText>
									<PGVRif condition="$sources==1">
										<PGVRRepeatTag tag="SOUR">
											<PGVRFootnote>
												<PGVRGedcom id="@SOUR">
													<PGVRGedcomValue tag="TITL" />
												</PGVRGedcom>
												<PGVRif condition="@PAGE!=''">: </PGVRif>
												<PGVRGedcomValue tag="SOUR:PAGE"/> <PGVRGedcomValue tag="SOUR:DATA:TEXT"/>	
											</PGVRFootnote>
											<PGVRSetVar name="source_exist" value="1"/>
										</PGVRRepeatTag>
									</PGVRif>
									<PGVRText style="text"> (<PGVRvar var="i18n::translate('Birth')" />: <PGVRGedcomValue tag="BIRT:DATE" /> <PGVRGedcomValue tag="BIRT:PLAC" /> - <PGVRvar var="i18n::translate('Death')" />: <PGVRGedcomValue tag="DEAT:DATE" /> <PGVRGedcomValue tag="DEAT:PLAC" />)</PGVRText>
								</PGVRTextBox>
							</PGVRGedcom>
						  </PGVRif>
						</PGVRRepeatTag>
					</PGVRGedcom>
				</PGVRRepeatTag>
			</PGVRGedcom>

			<!-- print the sources -->
			<PGVRif condition="($sources==1) and ($source_exist==1)">
				<PGVRTextBox width="$width" newline="1">
					<PGVRText style="name1"><PGVRvar var="i18n::translate('Sources')" /><br /><br /></PGVRText>
					<PGVRFootnoteTexts />
				</PGVRTextBox>
			</PGVRif>
		</PGVRBody>
		<PGVRFooter>
			<PGVRCell align="rightrtl" newline="1" style="date"><PGVRNow /></PGVRCell>
		</PGVRFooter>
	</PGVRDoc>
</PGVReport>
