From bdd2c23393de7b369d6a2302b67abc10a3063477 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Sat, 3 Nov 2007 22:08:34 +0000 Subject: [PATCH] 2007-11-03 Gary Burton * src/plugins/DetDescendantReport.py * src/plugins/DetAncestralReport.py Added functionality to print event and event reference notes. issue #1335 svn: r9292 --- ChangeLog | 5 +++++ src/plugins/DetAncestralReport.py | 17 ++++++++++++++++- src/plugins/DetDescendantReport.py | 22 ++++++++++++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ef1e5146..5812ab7d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-03 Gary Burton + * src/plugins/DetDescendantReport.py + * src/plugins/DetAncestralReport.py + Added functionality to print event and event reference notes. issue #1335 + 2007-11-02 Stéphane Charette * src/plugins/NarrativeWeb.py: issue #1340, do not display mime-types in NarrativeWeb for image/* diff --git a/src/plugins/DetAncestralReport.py b/src/plugins/DetAncestralReport.py index a6e8f36b6..193e29d19 100644 --- a/src/plugins/DetAncestralReport.py +++ b/src/plugins/DetAncestralReport.py @@ -393,16 +393,31 @@ class DetAncestorReport(Report): if self.includeAttrs: text = "" - for attr in event.get_attribute_list(): + attr_list = event.get_attribute_list() + attr_list.extend(event_ref.get_attribute_list()) + for attr in attr_list: if text: text += "; " text += _("%(type)s: %(value)s%(endnotes)s") % { 'type' : attr.get_type(), 'value' : attr.get_value(), 'endnotes' : self.endnotes(attr) } + text = " " + text self.doc.write_text(text) self.doc.end_paragraph() + + if self.includeNotes: + # if the event or event reference has a note attached to it, + # get the text and format it correctly + notelist = event.get_note_list() + notelist.extend(event_ref.get_note_list()) + for notehandle in notelist: + note = self.database.get_note_from_handle(notehandle) + self.doc.start_paragraph('DAR-MoreDetails') + self.doc.write_text("test") + self.doc.write_text(note.get()) + self.doc.end_paragraph() def write_parents(self, person, firstName): family_handle = person.get_main_parents_family_handle() diff --git a/src/plugins/DetDescendantReport.py b/src/plugins/DetDescendantReport.py index 30c4b34ff..46541748a 100644 --- a/src/plugins/DetDescendantReport.py +++ b/src/plugins/DetDescendantReport.py @@ -298,24 +298,38 @@ class DetDescendantReport(Report): if text and (date or place): text += ". " text += event.get_description() - + text += "%s. " % self.endnotes(event) - + self.doc.write_text(text) if self.includeAttrs: text = "" - for attr in event.get_attribute_list(): + attr_list = event.get_attribute_list() + attr_list.extend(event_ref.get_attribute_list()) + for attr in attr_list: if text: text += "; " text += _("%(type)s: %(value)s%(endnotes)s") % { 'type' : attr.get_type(), 'value' : attr.get_value(), 'endnotes' : self.endnotes(attr) } + text = " " + text self.doc.write_text(text) - + self.doc.end_paragraph() + if self.includeNotes: + # if the event or event reference has a note attached to it, + # get the text and format it correctly + notelist = event.get_note_list() + notelist.extend(event_ref.get_note_list()) + for notehandle in notelist: + note = self.database.get_note_from_handle(notehandle) + self.doc.start_paragraph('DDR-MoreDetails') + self.doc.write_text(note.get()) + self.doc.end_paragraph() + def write_parents(self, person, firstName): family_handle = person.get_main_parents_family_handle() if family_handle: