summaryrefslogtreecommitdiff
path: root/modules/ahnentafel_report/report.xml
blob: 805f2297f552824775d573cbfd80740b32a1eddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?xml version="1.0" encoding="UTF-8"?>
<Report>
<!-- $Id$ -->
	<Title><var var="i18n::translate('Ahnentafel Report')" /></Title>
	<Description>Prints an Ahnentafel report for the selected individual</Description>
	<Input name="pid" lookup="INDI" type="text"><var var="i18n::translate('Enter Individual ID')" /></Input>
	<Input name="maxgen" type="select" options="3=>3|4=>4|5=>5|6=>6|7=>7|8=>8|9=>9|*=>*"><var var="i18n::translate('Generations')" /></Input>
	<Input name="sources" type="checkbox" default="1"><var var="i18n::translate('Show sources?')" /></Input>
	<Input name="notes" type="checkbox" default="1"><var var="i18n::translate('Show notes?')" /></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="14" style="b" />
	<!-- Page numbers text -->
	<Style name="pagenum" font="$fonts" size="8"/>
	<!-- Standard text -->
	<Style name="text" font="$fonts" size="10"/>
	<!-- Links to sources - required style name by the generator -->
	<Style name="footnotenum" font="$fonts" size="7"/>
	<!-- Source text - FootnoteTexts - required style name by the generator -->
	<Style name="footnote" font="$fonts" size="8"/>
	<!-- 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"/>
	<!-- Note Text -->
	<Style name="note" font="$fonts" size="9"/>
	<!-- Individual name -->
	<Style name="name" font="$fonts" size="10" style="b" />
	<Style name="subheader" font="$fonts" size="12" style="b" />

	<SetVar name="num" value="1" />
	<SetVar name="generation" value="0" />
	<SetVar name="empty_name" value="f" />
	<SetVar name="empty_start_value" value="0" />
	<!-- New Page for Sources controller if SOUR exist -->
	<SetVar name="source_exist" value="0" />

	<Doc pageSize="$pageSize">
		<Header>
			<Cell align="center" height="30" newline="1" style="header"><var var="i18n::translate('Ahnentafel Report for ')" /><GetPersonName id="$pid" /></Cell>
			<Cell align="rightrtl" newline="1" style="pagenum"><var var="i18n::translate('Page')" /> <PageNum /> <var var="i18n::translate('of')" /> <TotalPages /></Cell>
		</Header>

		<Body>
			<Relatives id="$pid" group="direct-ancestors" sortby="none" maxgen="$maxgen" showempty="true">
				<SetVar name="gender" value="m" />
				<if condition="@SEX=='F'">
					<SetVar name="gender" value="f" />
				</if>
				<if condition="$generation!=@generation">
					<if condition="$empty_name=='t'" >
						<TextBox width="50" height="20">
							<SetVar name="empty_end_value" value="$num-1" />
							<Text style="text"><var var="empty_start_value" />-<var var="empty_end_value" />.</Text>
						</TextBox>
						<TextBox width="475" height="12" newline="1" >
							<Text style="text"><br /></Text>
						</TextBox>
						<TextBox width="25" height="20" newline="1">
							<Text style="text"><br /></Text>
						</TextBox>
						<SetVar name="empty_start_value" value="$num" />
					</if>
					<Cell align="center" height="30" newline="1" style="subheader"><var var="i18n::translate('Generation ')" /><Generation /></Cell>
					<SetVar name="generation" value="@generation" />
				</if>
				<SetVar name="indiname" value="@NAME" />
				<if condition="$indiname==''">
					<if condition="$empty_name=='f'">
						<SetVar name="empty_name" value="t" />
						<SetVar name="empty_start_value" value="$num" />
					</if>
				</if>
				<if condition="$indiname!=''">
					<if condition="$empty_name=='t'" >
						<TextBox width="50" height="20">
							<SetVar name="empty_end_value" value="$num-1" />
							<Text style="text"><var var="empty_start_value" />-<var var="empty_end_value" />.</Text>
						</TextBox>
						<TextBox width="475" height="12" newline="1">
							<Text style="text"><br /></Text>
						</TextBox>
						<TextBox width="25" height="20" newline="1">
							<Text style="text"><br /></Text>
						</TextBox>
						<SetVar name="empty_name" value="f" />
					</if>
					
					<!-- Generation counter -->
					<TextBox width="25" height="30">
						<Text style="text"><var var="num" />.</Text>
					</TextBox>
					
					<!-- 	Sentence 1
							Individual, name... -->
					<TextBox height="12" newline="1">
						<Text style="name"><GetPersonName id="" /> </Text>
						<if condition="$sources==1">
							<!-- Level 1 Sourcees -->
							<RepeatTag tag="SOUR">
								<Footnote>
									<Gedcom id="@SOUR">
										<GedcomValue tag="TITL" />
									</Gedcom>
									<if condition="@PAGE!=''">: </if>
									<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
								</Footnote>
								<SetVar name="source_exist" value="1"/>
							</RepeatTag>
						</if>
						<!-- Individual, birth... -->
						<Gedcom id="BIRT">
							<Text style="text">
								<if condition="$gender=='m'">
									<var var="i18n::translate_c('MALE', 'was born')" />
								</if>
								<if condition="$gender=='f'">
									<var var="i18n::translate_c('FEMALE', 'was born')" />
								</if>
							</Text>
							<if condition="$sources==1">
								<RepeatTag tag="BIRT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="PAGE" level="3"/> <GedcomValue tag="DATA:TEXT" level="3"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
							<if condition="@DATE!=''">
								<Text style="text"><var var=" " /> <GedcomValue tag="DATE" level="2" /></Text>
							</if>
							<if condition="@PLAC!=''">
								<Text style="text"><var var="i18n::translate(' in ')" /> <GedcomValue tag="PLAC" level="2" /></Text>
							</if>
							<if condition="(@desc=='Y') or (@DATE=='' and @PLAC=='')">
								<Text style="text"><var var="i18n::translate(' but the details are unknown')" /></Text>
							</if>
							<Text style="text">.</Text>
						</Gedcom>

						<!-- 	Sentence 2
								Individual, christened... -->
						<Gedcom id="CHR">
							<Text style="text"> 
								<if condition="$gender=='m'">
									<var var="i18n::translate('He was christened')" />
								</if>
								<if condition="$gender=='f'">
									<var var="i18n::translate('She was christened')" />
								</if>
							</Text>
							<if condition="$sources==1">
								<RepeatTag tag="CHR:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="PAGE" level="3"/> <GedcomValue tag="DATA:TEXT" level="3"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
							<if condition="@DATE!=''">
								<Text style="text"><var var=" " /> <GedcomValue tag="DATE" level="2" /></Text>
							</if>
							<if condition="@PLAC!=''">
								<Text style="text"><var var="i18n::translate(' in ')" /> <GedcomValue tag="PLAC" level="2" /></Text>
							</if>
							<if condition="(@desc=='Y') or (@DATE=='' and @PLAC=='')">
								<Text style="text"><var var="i18n::translate(' but the details are unknown')" /></Text>
							</if>
							<Text style="text">.</Text>
						</Gedcom>
						<SetVar name="cpid" value="@ID" />
						<if condition="$cpid!=$spid">
							<Gedcom id="@FAMS">
								<if condition="$cpid==@HUSB">
									<SetVar name="spid" value="@WIFE" />
								</if>
								<if condition="$cpid==@WIFE">
									<SetVar name="spid" value="@HUSB" />
								</if>
								<Gedcom id="MARR">
									<if condition="$spid!='' and @DATE!='' and @PLAC!=''">
										<Text style="text"><br />
											<if condition="$gender=='m'">
												<var var="i18n::translate('He married')" />
											</if>
											<if condition="$gender=='f'">
												<var var="i18n::translate('She married')" />
											</if>
										</Text>
										<if condition="$sources==1">
											<RepeatTag tag="MARR:SOUR">
												<Footnote>
													<Gedcom id="@SOUR">
														<GedcomValue tag="TITL" />
													</Gedcom>
														<if condition="@PAGE!=''">: </if>
													<GedcomValue tag="PAGE" level="3"/> <GedcomValue tag="DATA:TEXT" level="3"/>
												</Footnote>
												<SetVar name="source_exist" value="1"/>
											</RepeatTag>
										</if>
										<if condition="$spid!=''">
											<Text style="text"> <GetPersonName id="$spid" /></Text>
										</if>
										<Text style="text"> <var var=" " /></Text>								
										<if condition="@DATE!=''">
											<Text style="text"><var var=" " /> <GedcomValue tag="DATE" level="2" /><if condition="@PLAC==''"> </if></Text>
										</if>
										<if condition="@PLAC!=''">
											<Text style="text"><var var="i18n::translate(' in ')" /> <GedcomValue tag="PLAC" level="2" /></Text>
										</if>
										<if condition="((@desc=='Y') or (@DATE=='' and @PLAC=='')) and ($spid=='')">
											<Text style="text"><var var="i18n::translate(' but the details are unknown')" /></Text>
										</if>
										<Text style="text">.</Text>
									</if>
								</Gedcom>
							</Gedcom>
						</if>
						<Gedcom id="DEAT">
							<Text style="text"><br />
								<if condition="$gender=='m'">
									<var var="i18n::translate('He died')" />
								</if>
								<if condition="$gender=='f'">
									<var var="i18n::translate('She died')" />
								</if>
							</Text>
							<if condition="$sources==1">
								<RepeatTag tag="DEAT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="PAGE" level="3"/> <GedcomValue tag="DATA:TEXT" level="3"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
							<if condition="@DATE!=''">
								<Text style="text"><var var=" " /> <GedcomValue tag="DATE" level="2" /></Text>
							</if>
							<if condition="@PLAC!=''">
								<Text style="text"><var var="i18n::translate(' in ')" /> <GedcomValue tag="PLAC" level="2" /></Text>
							</if>
							<if condition="(@desc=='Y') or (@DATE=='' and @PLAC=='')">
								<Text style="text"><var var="i18n::translate(' but the details are unknown')" /></Text>
							</if>
							<Text style="text">.  </Text>
						</Gedcom>
						<Gedcom id="BURI">
							<Text style="text">
								<if condition="$gender=='m'">
									<var var="i18n::translate('He was buried')" />
								</if>
								<if condition="$gender=='f'">
									<var var="i18n::translate('She was buried')" />
								</if>
							</Text>
							<if condition="$sources==1">
								<RepeatTag tag="BURI:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="PAGE" level="3"/> <GedcomValue tag="DATA:TEXT" level="3"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
							<if condition="@DATE!=''">
								<Text style="text"><var var=" " /> <GedcomValue tag="DATE" level="2" /></Text>
							</if>
							<if condition="@PLAC!=''">
								<Text style="text"><var var="i18n::translate(' in ')" /> <GedcomValue tag="PLAC" level="2" /></Text>
							</if>
							<if condition="(@desc=='Y') or (@DATE=='' and @PLAC=='')">
								<Text style="text"><var var="i18n::translate(' but the details are unknown')" /></Text>
							</if>
							<Text style="text">.</Text>
						</Gedcom>
					</TextBox>
					<if condition="$notes==1">
						<RepeatTag tag="NOTE">
							<TextBox height="3" newline="1" padding="0"/>
							<Cell height="12" left="30" newline="1" style="note"><GedcomValue tag="NOTE"/></Cell>
						</RepeatTag>
					</if>
					<TextBox height="10" newline="1" padding="0"/>
				</if>
				<SetVar name="num" value="$num+1" />
			</Relatives>
			<!-- if the sources were on, print the source citations as footnotes -->
			<if condition="($sources==1) and ($source_exist==1)">
				<NewPage/>
				<TextBox width="$width" height="20" newline="1">
					<Text style="subheader"><var var="i18n::translate('Sources')" /><br /><br /></Text>
					<FootnoteTexts />
				</TextBox>
			</if>
		</Body>
		<Footer>
			<Cell align="rightrtl" style="date"><Now /></Cell>
		</Footer>
	</Doc>
</Report>