Add attributes to Family Group Report.

svn: r8812
This commit is contained in:
Brian Matherly 2007-08-12 03:57:18 +00:00
parent d3f3b050ce
commit 61aa7a9f38
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2007-08-11 Brian Matherly <brian@gramps-project.org>
* src/plugins/FamilyGroup.py: Add attributes
2007-08-11 Brian Matherly <brian@gramps-project.org> 2007-08-11 Brian Matherly <brian@gramps-project.org>
* src/plugins/DetAncestralReport.py: Add attributes * src/plugins/DetAncestralReport.py: Add attributes

View File

@ -66,6 +66,7 @@ class FamilyGroup(Report):
that come in the options class. that come in the options class.
family_handle - Handle of the family to write report on. family_handle - Handle of the family to write report on.
includeAttrs - Whether to include attributes
""" """
Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
@ -91,6 +92,7 @@ class FamilyGroup(Report):
self.incParMar = options_class.handler.options_dict['incParMar'] self.incParMar = options_class.handler.options_dict['incParMar']
self.incRelDates = options_class.handler.options_dict['incRelDates'] self.incRelDates = options_class.handler.options_dict['incRelDates']
self.incChiMar = options_class.handler.options_dict['incChiMar'] self.incChiMar = options_class.handler.options_dict['incChiMar']
self.includeAttrs = options_class.handler.options_dict['incattrs']
def dump_parent_event(self,name,event): def dump_parent_event(self,name,event):
place = "" place = ""
@ -102,6 +104,14 @@ class FamilyGroup(Report):
place = ReportUtils.place_name(self.database,place_handle) place = ReportUtils.place_name(self.database,place_handle)
descr = event.get_description() descr = event.get_description()
if self.includeAttrs:
for attr in event.get_attribute_list():
if descr:
descr += "; "
descr += _("%(type)s: %(value)s") % {
'type' : attr.get_type(),
'value' : attr.get_value() }
self.doc.start_row() self.doc.start_row()
self.doc.start_cell("FGR-TextContents") self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal') self.doc.start_paragraph('FGR-Normal')
@ -302,6 +312,10 @@ class FamilyGroup(Report):
note = self.database.get_note_from_handle(notehandle) note = self.database.get_note_from_handle(notehandle)
self.dump_parent_line(_("Note"),note.get(False)) self.dump_parent_line(_("Note"),note.get(False))
if self.includeAttrs:
for attr in person.get_attribute_list():
self.dump_parent_line(str(attr.get_type()),attr.get_value())
if self.incParNames: if self.incParNames:
for alt_name in person.get_alternate_names(): for alt_name in person.get_alternate_names():
name_type = str( alt_name.get_type() ) name_type = str( alt_name.get_type() )
@ -621,6 +635,7 @@ class FamilyGroupOptions(ReportOptions):
'incParEvents' : 0, 'incParEvents' : 0,
'incParAddr' : 0, 'incParAddr' : 0,
'incParNotes' : 0, 'incParNotes' : 0,
'incattrs' : 0,
'incParNames' : 0, 'incParNames' : 0,
'incParMar' : 0, 'incParMar' : 0,
'incChiMar' : 1, 'incChiMar' : 1,
@ -655,6 +670,10 @@ class FamilyGroupOptions(ReportOptions):
["Do not include parental notes","Include parental notes"], ["Do not include parental notes","Include parental notes"],
True), True),
'incattrs' : ("=0/1","Whether to include attributes.",
["Do not include attributes","Include attributes"],
True),
'incParNames' : ("=0/1","Whether to include alternate names for parents.", 'incParNames' : ("=0/1","Whether to include alternate names for parents.",
["Do not include parental names","Include parental names"], ["Do not include parental names","Include parental names"],
True), True),
@ -741,6 +760,10 @@ class FamilyGroupOptions(ReportOptions):
self.include_par_notes_option = gtk.CheckButton(_("Parent Notes")) self.include_par_notes_option = gtk.CheckButton(_("Parent Notes"))
self.include_par_notes_option.set_active(self.options_dict['incParNotes']) self.include_par_notes_option.set_active(self.options_dict['incParNotes'])
# Parental Attributes
self.include_attributes_option = gtk.CheckButton(_("Parent Attributes"))
self.include_attributes_option.set_active(self.options_dict['incattrs'])
# Parental Names # Parental Names
self.include_par_names_option = gtk.CheckButton(_("Alternate Parent Names")) self.include_par_names_option = gtk.CheckButton(_("Alternate Parent Names"))
self.include_par_names_option.set_active(self.options_dict['incParNames']) self.include_par_names_option.set_active(self.options_dict['incParNames'])
@ -763,6 +786,7 @@ class FamilyGroupOptions(ReportOptions):
dialog.add_frame_option(_('Include'),'',self.include_par_events_option) dialog.add_frame_option(_('Include'),'',self.include_par_events_option)
dialog.add_frame_option(_('Include'),'',self.include_par_addr_option) dialog.add_frame_option(_('Include'),'',self.include_par_addr_option)
dialog.add_frame_option(_('Include'),'',self.include_par_notes_option) dialog.add_frame_option(_('Include'),'',self.include_par_notes_option)
dialog.add_frame_option(_('Include'),'',self.include_attributes_option)
dialog.add_frame_option(_('Include'),'',self.include_par_names_option) dialog.add_frame_option(_('Include'),'',self.include_par_names_option)
dialog.add_frame_option(_('Include'),'',self.include_par_marriage_option) dialog.add_frame_option(_('Include'),'',self.include_par_marriage_option)
dialog.add_frame_option(_('Include'),'',self.include_chi_marriage_option) dialog.add_frame_option(_('Include'),'',self.include_chi_marriage_option)
@ -784,6 +808,7 @@ class FamilyGroupOptions(ReportOptions):
self.options_dict['incParEvents'] = int(self.include_par_events_option.get_active()) self.options_dict['incParEvents'] = int(self.include_par_events_option.get_active())
self.options_dict['incParAddr'] = int(self.include_par_addr_option.get_active()) self.options_dict['incParAddr'] = int(self.include_par_addr_option.get_active())
self.options_dict['incParNotes'] = int(self.include_par_notes_option.get_active()) self.options_dict['incParNotes'] = int(self.include_par_notes_option.get_active())
self.options_dict['incattrs'] = int(self.include_attributes_option.get_active())
self.options_dict['incParNames'] = int(self.include_par_names_option.get_active()) self.options_dict['incParNames'] = int(self.include_par_names_option.get_active())
self.options_dict['incParMar'] = int(self.include_par_marriage_option.get_active()) self.options_dict['incParMar'] = int(self.include_par_marriage_option.get_active())
self.options_dict['incChiMar'] = int(self.include_chi_marriage_option.get_active()) self.options_dict['incChiMar'] = int(self.include_chi_marriage_option.get_active())