remove duplicate birth and death events in reports (fixes bug #235)

svn: r6971
This commit is contained in:
Brian Matherly 2006-06-28 04:01:14 +00:00
parent 4234d0133f
commit 236c976093
6 changed files with 28 additions and 15 deletions

View File

@ -1,5 +1,10 @@
2006-06-27 Brian Matherly <brian@gramps-project.org>
* src/GampsLogger/_ErrorReportAssistant.py: fix error message in Windows
* src/plugins/DetDescendantReport.py: remove duplicate birth events
* src/plugins/IndivComplete.py: remove duplicate birth events
* src/plugins/NarrativeWeb.py: remove duplicate birth events (bug #235)
* src/plugins/DetAncestralReport.py: remove duplicate birth events
* src/plugins/FamilyGroup.py: remove duplicate birth events
2006-06-26 Don Allingham <don@gramps-project.org>
* src/ReportBase/_ReportDialog.py (report): catch IOError

View File

@ -291,7 +291,11 @@ class DetAncestorReport(Report):
self.doc.end_paragraph()
if self.includeEvents:
birth_ref = person.get_birth_ref()
death_ref = person.get_death_ref()
for event_ref in person.get_event_ref_list():
if event_ref == birth_ref or event_ref == death_ref:
continue
event = self.database.get_event_from_handle(event_ref.ref)
date = DateHandler.get_date(event)
ph = event.get_place_handle()

View File

@ -321,7 +321,11 @@ class DetDescendantReport(Report):
self.doc.end_paragraph()
if self.includeEvents:
birth_ref = person.get_birth_ref()
death_ref = person.get_death_ref()
for event_ref in person.get_event_ref_list():
if event_ref == birth_ref or event_ref == death_ref:
continue
event = self.database.get_event_from_handle(event_ref.ref)
date = DateHandler.get_date(event)
ename = str( event.get_type() )

View File

@ -333,10 +333,11 @@ class FamilyGroup(Report):
if self.incParEvents:
for event_ref in person.get_event_ref_list():
event = self.database.get_event_from_handle(event_ref.ref)
evtType = event.get_type()
name = str( evtType )
self.dump_parent_event(name,event)
if event_ref != birth_ref and event_ref != death_ref:
event = self.database.get_event_from_handle(event_ref.ref)
evtType = event.get_type()
name = str( evtType )
self.dump_parent_event(name,event)
if self.incParAddr:
addrlist = person.get_address_list()[:]

View File

@ -377,9 +377,7 @@ class IndivCompleteReport(Report):
self.doc.end_cell()
self.doc.end_row()
event_ref_list = [ self.start_person.get_birth_ref(), \
self.start_person.get_death_ref() ] + \
self.start_person.get_event_ref_list()
event_ref_list = self.start_person.get_event_ref_list()
for event_ref in event_ref_list:
if event_ref:
event = self.database.get_event_from_handle(event_ref.ref)

View File

@ -1665,14 +1665,15 @@ class IndividualPage(BasePage):
of.write('</tr>\n')
for event_ref in evt_ref_list:
event = self.db.get_event_from_handle(event_ref.ref)
if event:
evt_name = str(event.get_type())
of.write('<tr><td class="field">%s</td>\n' % evt_name)
of.write('<td class="data">\n')
of.write(self.format_event(event))
of.write('</td>\n')
of.write('</tr>\n')
if event_ref != birth_ref and event_ref != death_ref:
event = self.db.get_event_from_handle(event_ref.ref)
if event:
evt_name = str(event.get_type())
of.write('<tr><td class="field">%s</td>\n' % evt_name)
of.write('<td class="data">\n')
of.write(self.format_event(event))
of.write('</td>\n')
of.write('</tr>\n')
of.write('</table>\n')
of.write('</div>\n')