Skip to content

Commit 4b7d3d7

Browse files
author
Matthias Rabe
committed
book: add more types to cv report
Signed-off-by: Matthias Rabe <[email protected]>
1 parent f826595 commit 4b7d3d7

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

lib/ged_parse.inc.rb

+11
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ def get_details(tag, details= @details, i= 0, list= [])
108108
return list
109109
end
110110

111+
def get_details_for_tags(tag)
112+
list= []
113+
details.each do |detail|
114+
if tag.include?(detail[:field])
115+
list << detail
116+
end
117+
end
118+
119+
return list
120+
end
121+
111122
def get_cached_detail(sym, tag)
112123
if @cached_details[sym].nil?
113124
t= get_detail(tag)

reports/book.inc.rb

+20-15
Original file line numberDiff line numberDiff line change
@@ -312,31 +312,36 @@ def t2(f)
312312
end
313313

314314
def report_person_print_cv(ged, indi)
315-
es= indi.get_details("EVEN")
315+
es= indi.get_details_for_tags(["CHR", "BLES", "CONF", "EVEN", "EDUC", "OCCU"])
316316
if es.length > 0
317-
$params[:ofile].insertSubSubSection("Lebenslauf")
318-
$params[:ofile].print "\\ThinHRule \\vspace{2mm}\n"
319-
320-
def t1(a, b, c, d= nil, e= nil, f= nil, g= nil, src_ids= [])
321-
s= []
322-
s += ["\\mbox{", b, h(c), "}"] if c.to_s != ""
323-
s += ["\\mbox{", d, h(e), "}"] if e.to_s != ""
324-
s += ["\\mbox{", f, h(g), "}"] if g.to_s != ""
325-
326-
end
317+
$params[:ofile].insertSubSubSection("Werdegang")
318+
$params[:ofile].print "\\ThinHRule \\vspace{2mm}\n\n"
327319

328320
$params[:ofile].print "\\begin{tabular}{p{6em} p{11em} p{\\textwidth-21em}}\n"
329321

330-
es.each {|e|
322+
es.each_with_index {|e, i|
331323
date, type, text = "", "", e[:value].to_s
324+
325+
if i>0 && i%3 == 0
326+
$params[:ofile].print "\\end{tabular}\n\n"
327+
$params[:ofile].print "\\begin{tabular}{p{6em} p{11em} p{\\textwidth-21em}}\n"
328+
end
329+
332330
e[:children].each {|c|
333331
case c[:field]
334-
when "EVEN_DATE" then date = c[:value]
335-
when "EVEN_TYPE" then type = c[:value]
336-
when "EVEN_PLAC" then text += " in #{c[:value]}"
332+
when "#{e[:field]}_DATE" then date = c[:value]
333+
when "#{e[:field]}_TYPE" then type = c[:value]
334+
when "#{e[:field]}_PLAC" then text += " in #{c[:value]}"
337335
end
338336
}
339337

338+
if ["CHR", "BLES", "CONF"].include? e[:field]
339+
text = type + " " + text if type != ""
340+
type = "Taufe" if e[:field] == "CHR"
341+
type = "Segnung" if e[:field] == "BLES"
342+
type = "Konfirmation" if e[:field] == "CONF"
343+
end
344+
340345
$params[:ofile].print "#{h(date)} & #{h(type)} & #{h(text)} \\\\\n"
341346
}
342347

0 commit comments

Comments
 (0)