0002286: Unselecting "use complete sentences" has no effect for the burial information in the Detailed Ancestor and Descendant reports. (contribution from James Friedmann <jfriedmannj@gmail.com>)

svn: r10901
This commit is contained in:
Brian Matherly 2008-07-22 02:57:15 +00:00
parent 380935e3e1
commit cd6d4ce454
3 changed files with 49 additions and 15 deletions

View File

@ -2,7 +2,8 @@
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 James Friedmann <jfriedmannj@gmail.com>
# #
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -553,6 +554,7 @@ buried_full_date_place = {
_("%(unknown_gender_name)s was buried on %(burial_date)s in %(burial_place)s."), _("%(unknown_gender_name)s was buried on %(burial_date)s in %(burial_place)s."),
_("This person was buried on %(burial_date)s in %(burial_place)s."), _("This person was buried on %(burial_date)s in %(burial_place)s."),
], ],
'succinct' : _("Buried %(burial_date)s in %(burial_place)s."),
} }
buried_full_date_no_place = { buried_full_date_no_place = {
@ -568,6 +570,7 @@ buried_full_date_no_place = {
_("%(unknown_gender_name)s was buried on %(burial_date)s."), _("%(unknown_gender_name)s was buried on %(burial_date)s."),
_("This person was buried on %(burial_date)s."), _("This person was buried on %(burial_date)s."),
], ],
'succinct' : _("Buried %(burial_date)s."),
} }
buried_partial_date_place = { buried_partial_date_place = {
@ -583,6 +586,7 @@ buried_partial_date_place = {
_("%(unknown_gender_name)s was buried in %(month_year)s in %(burial_place)s."), _("%(unknown_gender_name)s was buried in %(month_year)s in %(burial_place)s."),
_("This person was buried in %(month_year)s in %(burial_place)s."), _("This person was buried in %(month_year)s in %(burial_place)s."),
], ],
'succinct' : _("Buried %(month_year)s in %(burial_place)s."),
} }
buried_partial_date_no_place = { buried_partial_date_no_place = {
@ -598,6 +602,7 @@ buried_partial_date_no_place = {
_("%(unknown_gender_name)s was buried in %(month_year)s."), _("%(unknown_gender_name)s was buried in %(month_year)s."),
_("This person was buried in %(month_year)s."), _("This person was buried in %(month_year)s."),
], ],
'succinct' : _("Buried %(month_year)s."),
} }
buried_modified_date_place = { buried_modified_date_place = {
@ -613,6 +618,7 @@ buried_modified_date_place = {
_("%(unknown_gender_name)s was buried %(modified_date)s in %(burial_place)s."), _("%(unknown_gender_name)s was buried %(modified_date)s in %(burial_place)s."),
_("This person was buried %(modified_date)s in %(burial_place)s."), _("This person was buried %(modified_date)s in %(burial_place)s."),
], ],
'succinct' : _("Buried %(modified_date)s in %(burial_place)s."),
} }
buried_modified_date_no_place = { buried_modified_date_no_place = {
@ -628,6 +634,7 @@ buried_modified_date_no_place = {
_("%(unknown_gender_name)s was buried %(modified_date)s."), _("%(unknown_gender_name)s was buried %(modified_date)s."),
_("This person was buried %(modified_date)s."), _("This person was buried %(modified_date)s."),
], ],
'succinct' : _("Buried %(modified_date)s."),
} }
buried_no_date_place = { buried_no_date_place = {
@ -643,6 +650,7 @@ buried_no_date_place = {
_("%(unknown_gender_name)s was buried in %(burial_place)s."), _("%(unknown_gender_name)s was buried in %(burial_place)s."),
_("This person was buried in %(burial_place)s."), _("This person was buried in %(burial_place)s."),
], ],
'succinct' : _("Buried in %(burial_place)s."),
} }
buried_no_date_no_place = { buried_no_date_no_place = {
@ -657,7 +665,8 @@ buried_no_date_no_place = {
gen.lib.Person.UNKNOWN : [ gen.lib.Person.UNKNOWN : [
_("%(unknown_gender_name)s was buried."), _("%(unknown_gender_name)s was buried."),
_("This person was buried."), _("This person was buried."),
] ],
'succinct' : _("Buried."),
} }
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -2304,7 +2313,8 @@ def died_str(database, person, person_name=None, verbose=True,
# buried_str # buried_str
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def buried_str(database, person, person_name=None, empty_date="", empty_place=""): def buried_str(database, person, person_name=None,
empty_date="", empty_place="", verbose=True):
""" """
Check burial record. Check burial record.
Statement formats name precedes this Statement formats name precedes this
@ -2326,8 +2336,8 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place=""
text = "" text = ""
bplace = dplace = empty_place bplace = empty_place
bdate = ddate = empty_date bdate = empty_date
bdate_full = False bdate_full = False
bdate_mod = False bdate_mod = False
@ -2345,7 +2355,8 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place=""
bplace = database.get_place_from_handle(bplace_handle).get_title() bplace = database.get_place_from_handle(bplace_handle).get_title()
bdate_obj = burial.get_date_object() bdate_obj = burial.get_date_object()
bdate_full = bdate_obj and bdate_obj.get_day_valid() bdate_full = bdate_obj and bdate_obj.get_day_valid()
bdate_mod = bdate_obj and bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE bdate_mod = bdate_obj and \
bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE
else: else:
return text return text
@ -2360,25 +2371,44 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place=""
'modified_date' : bdate, 'modified_date' : bdate,
} }
if bdate and bdate_mod: if bdate and bdate_mod and verbose:
if bplace: #male, date, place if bplace: #male, date, place
text = buried_modified_date_place[gender][name_index] % values text = buried_modified_date_place[gender][name_index] % values
else: #male, date, no place else: #male, date, no place
text = buried_modified_date_no_place[gender][name_index] % values text = buried_modified_date_no_place[gender][name_index] % values
elif bdate and bdate_full: elif bdate and bdate_mod:
if bplace: #male, date, place
text = buried_modified_date_place['succinct'] % values
else: #male, date, no place
text = buried_modified_date_no_place['succinct'] % values
elif bdate and bdate_full and verbose:
if bplace: #male, date, place if bplace: #male, date, place
text = buried_full_date_place[gender][name_index] % values text = buried_full_date_place[gender][name_index] % values
else: #male, date, no place else: #male, date, no place
text = buried_full_date_no_place[gender][name_index] % values text = buried_full_date_no_place[gender][name_index] % values
elif bdate: elif bdate and bdate_full:
if bplace: #male, date, place
text = buried_full_date_place['succinct'] % values
else: #male, date, no place
text = buried_full_date_no_place['succinct'] % values
elif bdate and verbose:
if bplace: #male, month_year, place if bplace: #male, month_year, place
text = buried_partial_date_place[gender][name_index] % values text = buried_partial_date_place[gender][name_index] % values
else: #male, month_year, no place else: #male, month_year, no place
text = buried_partial_date_no_place[gender][name_index] % values text = buried_partial_date_no_place[gender][name_index] % values
elif bplace: #male, no date, place elif bdate:
if bplace: #male, month_year, place
text = buried_partial_date_place['succinct'] % values
else: #male, month_year, no place
text = buried_partial_date_no_place['succinct'] % values
elif bplace and verbose: #male, no date, place
text = buried_no_date_place[gender][name_index] % values text = buried_no_date_place[gender][name_index] % values
else: #male, no date, no place elif bplace: #male, no date, place
text = buried_no_date_place['succinct'] % values
elif verbose:
text = buried_no_date_no_place[gender][name_index] % values text = buried_no_date_no_place[gender][name_index] % values
else: #male, no date, no place
text = buried_no_date_no_place['succinct'] % values
if text: if text:
text = text + " " text = text + " "

View File

@ -4,6 +4,7 @@
# Copyright (C) 2000-2002 Bruce J. DeGrasse # Copyright (C) 2000-2002 Bruce J. DeGrasse
# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 James Friedmann <jfriedmannj@gmail.com>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -257,8 +258,9 @@ class DetAncestorReport(Report):
self.doc.write_text(text) self.doc.write_text(text)
first = 0 first = 0
text = ReportUtils.buried_str(self.database,person,first, text = ReportUtils.buried_str(self.database, person, first,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE, self.EMPTY_PLACE,
self.verbose)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)

View File

@ -5,6 +5,7 @@
# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2007 Robert Cawley <rjc@cawley.id.au> # Copyright (C) 2007 Robert Cawley <rjc@cawley.id.au>
# Copyright (C) 2008 James Friedmann <jfriedmannj@gmail.com>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -505,8 +506,9 @@ class DetDescendantReport(Report):
self.doc.write_text(text) self.doc.write_text(text)
first = 0 first = 0
text = ReportUtils.buried_str(self.database,person,first, text = ReportUtils.buried_str(self.database, person, first,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE, self.EMPTY_PLACE,
self.verbose)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)