Show death/burial information only if person is proabably dead

This commit is contained in:
Alois Poettker 2018-04-17 13:09:02 +02:00 committed by Nick Hall
parent 03a89c73e3
commit a592f7b2fd
2 changed files with 36 additions and 24 deletions

View File

@ -48,6 +48,7 @@ _ = glocale.translation.gettext
from gramps.gen.errors import ReportError from gramps.gen.errors import ReportError
from gramps.gen.lib import (EventType, FamilyRelType, Person, NoteType, from gramps.gen.lib import (EventType, FamilyRelType, Person, NoteType,
EventRoleType) EventRoleType)
from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.db import get_participant_from_event from gramps.gen.utils.db import get_participant_from_event
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
FONT_SANS_SERIF, FONT_SERIF, FONT_SANS_SERIF, FONT_SERIF,
@ -333,6 +334,8 @@ class DetAncestorReport(Report):
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)
# Write Death and/or Burial text only if not probably alive
if not probably_alive(person, self.database):
text = self.__narrator.get_died_string(self.calcageflag) text = self.__narrator.get_died_string(self.calcageflag)
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)
@ -629,6 +632,8 @@ class DetAncestorReport(Report):
self.__narrator.get_born_string() or self.__narrator.get_born_string() or
self.__narrator.get_christened_string() or self.__narrator.get_christened_string() or
self.__narrator.get_baptised_string()) self.__narrator.get_baptised_string())
# Write Death and/or Burial text only if not probably alive
if not probably_alive(child, self.database):
self.doc.write_text_citation( self.doc.write_text_citation(
self.__narrator.get_died_string() or self.__narrator.get_died_string() or
self.__narrator.get_buried_string()) self.__narrator.get_buried_string())
@ -767,6 +772,8 @@ class DetAncestorReport(Report):
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)
# Write Death and/or Burial text only if not probably alive
if not probably_alive(ind, self.database):
text = self.__narrator.get_died_string(self.calcageflag) text = self.__narrator.get_died_string(self.calcageflag)
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)

View File

@ -50,6 +50,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
from gramps.gen.errors import ReportError from gramps.gen.errors import ReportError
from gramps.gen.lib import FamilyRelType, Person, NoteType from gramps.gen.lib import FamilyRelType, Person, NoteType
from gramps.gen.utils.alive import probably_alive
from gramps.gen.plug.menu import (BooleanOption, NumberOption, PersonOption, from gramps.gen.plug.menu import (BooleanOption, NumberOption, PersonOption,
EnumeratedListOption) EnumeratedListOption)
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
@ -725,6 +726,8 @@ class DetDescendantReport(Report):
self.__narrator.get_born_string() or self.__narrator.get_born_string() or
self.__narrator.get_christened_string() or self.__narrator.get_christened_string() or
self.__narrator.get_baptised_string()) self.__narrator.get_baptised_string())
# Write Death and/or Burial text only if not probably alive
if not probably_alive(child, self.database):
self.doc.write_text_citation( self.doc.write_text_citation(
self.__narrator.get_died_string() or self.__narrator.get_died_string() or
self.__narrator.get_buried_string()) self.__narrator.get_buried_string())
@ -856,6 +859,8 @@ class DetDescendantReport(Report):
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)
# Write Death and/or Burial text only if not probably alive
if not probably_alive(person, self.database):
text = self.__narrator.get_died_string(self.calcageflag) text = self.__narrator.get_died_string(self.calcageflag)
if text: if text:
self.doc.write_text_citation(text) self.doc.write_text_citation(text)