@@ -145,14 +145,25 @@ def add_detail(level, tag, val)
145
145
super
146
146
end
147
147
148
+ def get_sources ( ged , tag )
149
+ sources = [ ]
150
+ get_details ( tag ) . each { |src_id |
151
+ sources << ged . find_by_source_gid ( src_id [ :value ] )
152
+ }
153
+ return sources
154
+ end
155
+
148
156
def idno ; return get_cached_detail ( :idno , "IDNO" ) ; end
149
157
def sex ; return get_cached_detail ( :sex , "SEX" ) ; end
150
158
def birth ; return get_cached_detail ( :birth , "BIRT_DATE" ) ; end
151
159
def birth_place ; return get_cached_detail ( :birth_place , "BIRT_PLAC" ) ; end
160
+ def birth_sources ( ged ) ; return get_sources ( ged , "BIRT_SOUR" ) ; end
152
161
def leaf ; return get_cached_detail ( :leaf , "CHR_DATE" ) ; end
153
162
def leaf_place ; return get_cached_detail ( :leaf_place , "CHR_PLAC" ) ; end
163
+ def leaf_sources ( ged ) ; return get_sources ( ged , "CHR_SOUR" ) ; end
154
164
def died ; return get_cached_detail ( :died , "DEAT_DATE" ) ; end
155
165
def died_place ; return get_cached_detail ( :died_place , "DEAT_PLAC" ) ; end
166
+ def died_sources ( ged ) ; return get_sources ( ged , "DEAT_SOUR" ) ; end
156
167
def objs ; return get_details ( "OBJE" ) ; end
157
168
158
169
def male? ; return sex == "M" ; end
@@ -220,7 +231,7 @@ def initialize(gid)
220
231
221
232
def fname ; return get_cached_detail ( :file , "FILE" ) ; end
222
233
def type ; return get_cached_detail ( :type , "FILE_FORM" ) ; end
223
- def note ; return get_cached_detail ( :title , "FILE_TITL" ) ; end
234
+ def note ; return get_cached_detail ( :title , "FILE_TITL" ) ; end
224
235
end
225
236
226
237
class Place < GedSection
@@ -243,6 +254,16 @@ def initialize(gid)
243
254
@name = gid
244
255
@type = :source
245
256
end
257
+
258
+ def title ; return get_cached_detail ( :title , "TITL" ) ; end
259
+ def author ; return get_cached_detail ( :author , "AUTH" ) ; end
260
+
261
+ def footnote
262
+ details = [ ]
263
+ details << title if title . to_s != ""
264
+ details << author if author . to_s != ""
265
+ return details . join ( "; " )
266
+ end
246
267
end
247
268
248
269
class Gedcom
@@ -345,7 +366,7 @@ def refresh
345
366
level . to_i -object_level . to_i +1 ,
346
367
tag , rest )
347
368
end
348
- next if not object_level . nil?
369
+ next if not object_section . nil?
349
370
end
350
371
351
372
if tag == "PLAC" and find_by_place ( rest ) . nil?
@@ -369,7 +390,7 @@ def refresh
369
390
level . to_i -place_level . to_i +1 ,
370
391
tag , rest )
371
392
end
372
- next if not place_level . nil?
393
+ next if not place_section . nil?
373
394
end
374
395
375
396
#add a detail to the section
@@ -428,8 +449,8 @@ def find_by_node_gid(gid)
428
449
end
429
450
430
451
def find_by_object_gid ( gid )
431
- @objects . each do |n |
432
- return n if n . gid == gid
452
+ @objects . each do |o |
453
+ return o if o . gid == gid
433
454
end
434
455
return nil
435
456
end
@@ -441,6 +462,13 @@ def find_by_place(name)
441
462
return nil
442
463
end
443
464
465
+ def find_by_source_gid ( gid )
466
+ @sources . each do |s |
467
+ return s if s . gid == gid
468
+ end
469
+ return nil
470
+ end
471
+
444
472
def getFamilyWithChild ( indi )
445
473
@families . each { |f |
446
474
f . children . each { |fc |
0 commit comments