diff --git a/ChangeLog b/ChangeLog index 470b41bfa..d253bb5b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-09-28 Gary Burton + * src/plugins/NarrativeWeb.py: provide fallback dates on Narrative Web pages + Issue #0001258 + 2007-09-27 Zsolt Foldvari * src/docgen/GtkPrint.py (paperstyle_to_pagesetup): Fix paper name and custom size conversion. diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index eb535b5c6..0b218ad61 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -3,6 +3,7 @@ # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Johan Gonqvist +# Copyright (C) 2007 Gary Burton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pubilc License as published by @@ -726,19 +727,27 @@ class IndividualListPage(BasePage): # birth column if self.showbirth: of.write('') - birth_ref = person.get_birth_ref() - if birth_ref: - birth = db.get_event_from_handle(birth_ref.ref) - of.write(_dd.display(birth.get_date_object())) + birth = ReportUtils.get_birth_or_fallback(db, person) + if birth: + if birth.get_type() == RelLib.EventType.BIRTH: + of.write(_dd.display(birth.get_date_object())) + else: + of.write('') + of.write(_dd.display(birth.get_date_object())) + of.write('') of.write('') # death column if self.showdeath: of.write('') - death_ref = person.get_death_ref() - if death_ref: - death = db.get_event_from_handle(death_ref.ref) - of.write(_dd.display(death.get_date_object())) + death = ReportUtils.get_death_or_fallback(db, person) + if death: + if death.get_type() == RelLib.EventType.DEATH: + of.write(_dd.display(death.get_date_object())) + else: + of.write('') + of.write(_dd.display(death.get_date_object())) + of.write('') of.write('') # spouse (partner) column @@ -840,19 +849,27 @@ class SurnamePage(BasePage): # birth column if self.showbirth: of.write('') - birth_ref = person.get_birth_ref() - if birth_ref: - birth = db.get_event_from_handle(birth_ref.ref) - of.write(_dd.display(birth.get_date_object())) + birth = ReportUtils.get_birth_or_fallback(db, person) + if birth: + if birth.get_type() == RelLib.EventType.BIRTH: + of.write(_dd.display(birth.get_date_object())) + else: + of.write('') + of.write(_dd.display(birth.get_date_object())) + of.write('') of.write('') # death column if self.showdeath: of.write('') - death_ref = person.get_death_ref() - if death_ref: - death = db.get_event_from_handle(death_ref.ref) - of.write(_dd.display(death.get_date_object())) + death = ReportUtils.get_death_or_fallback(db, person) + if death: + if death.get_type() == RelLib.EventType.DEATH: + of.write(_dd.display(death.get_date_object())) + else: + of.write('') + of.write(_dd.display(death.get_date_object())) + of.write('') of.write('') # spouse (partner) column