Keep reports up with RelLib changes
svn: r6417
This commit is contained in:
parent
cc1a0275e9
commit
acde4393f8
@ -1,3 +1,7 @@
|
|||||||
|
2006-04-21 Brian Matherly <pez4brian@users.sourceforge.net>
|
||||||
|
* src/PluginUtils/_ReportUtils.py: keep up with RelLib changes
|
||||||
|
* src/plugins/NavWebPage.py: keep up with RelLib changes
|
||||||
|
|
||||||
2006-04-22 Don Allingham <don@gramps-project.org>
|
2006-04-22 Don Allingham <don@gramps-project.org>
|
||||||
* src/GrampsDb/_ReadXML.py: fix Type str_from_xml calls
|
* src/GrampsDb/_ReadXML.py: fix Type str_from_xml calls
|
||||||
* src/DataViews/_MediaView.py: Shorten tab name
|
* src/DataViews/_MediaView.py: Shorten tab name
|
||||||
|
@ -1120,7 +1120,7 @@ def sanitize_person(db,person):
|
|||||||
|
|
||||||
# copy Family reference list
|
# copy Family reference list
|
||||||
for item in person.get_parent_family_handle_list():
|
for item in person.get_parent_family_handle_list():
|
||||||
new_person.add_parent_family_handle(item[0],item[1],item[2])
|
new_person.add_parent_family_handle(item)
|
||||||
|
|
||||||
if person.get_privacy():
|
if person.get_privacy():
|
||||||
return new_person
|
return new_person
|
||||||
@ -1179,17 +1179,13 @@ def sanitize_person(db,person):
|
|||||||
new_person.add_media_reference(RelLib.MediaRef(obj))
|
new_person.add_media_reference(RelLib.MediaRef(obj))
|
||||||
|
|
||||||
# LDS ordinances
|
# LDS ordinances
|
||||||
ordinance = person.get_lds_baptism()
|
for lds_ord in person.get_lds_ord_list():
|
||||||
if ordinance:
|
lds_type = lds_ord.get_type()
|
||||||
new_person.set_lds_baptism(ordinance)
|
if lds_type == RelLib.LdsOrd.BAPTISM or \
|
||||||
|
lds_type == RelLib.LdsOrd.ENDOWMENT or \
|
||||||
ordinance = person.get_lds_endowment()
|
lds_type == RelLib.LdsOrd.SEAL_TO_PARENTS or \
|
||||||
if ordinance:
|
lds_type == RelLib.LdsOrd.SEAL_TO_SPOUSE :
|
||||||
new_person.set_lds_endowment(ordinance)
|
new_person.add_lds_ord( lds_ord )
|
||||||
|
|
||||||
ordinance = person.get_lds_sealing()
|
|
||||||
if ordinance:
|
|
||||||
new_person.set_lds_sealing(ordinance)
|
|
||||||
|
|
||||||
new_person.set_note(person.get_note())
|
new_person.set_note(person.get_note())
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ class BasePage:
|
|||||||
of.write('<table class="infolist">\n')
|
of.write('<table class="infolist">\n')
|
||||||
|
|
||||||
for attr in attrlist:
|
for attr in attrlist:
|
||||||
atType = Utils.format_personal_attribute( attr.get_type() )
|
atType = str( attr.get_type() )
|
||||||
of.write('<tr><td class="field">%s</td>' % atType)
|
of.write('<tr><td class="field">%s</td>' % atType)
|
||||||
of.write('<td class="data">%s</td></tr>\n' % attr.get_value())
|
of.write('<td class="data">%s</td></tr>\n' % attr.get_value())
|
||||||
of.write('</table>\n')
|
of.write('</table>\n')
|
||||||
@ -1563,7 +1563,9 @@ class IndividualPage(BasePage):
|
|||||||
index = 1
|
index = 1
|
||||||
for sref in sreflist:
|
for sref in sreflist:
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_name, self.page_title, self.gid)
|
||||||
shandle = sref.get_base_handle()
|
shandle = sref.get_reference_handle()
|
||||||
|
if not shandle:
|
||||||
|
continue
|
||||||
if self.src_list.has_key(shandle):
|
if self.src_list.has_key(shandle):
|
||||||
if lnk not in self.src_list[shandle]:
|
if lnk not in self.src_list[shandle]:
|
||||||
self.src_list[shandle].append(lnk)
|
self.src_list[shandle].append(lnk)
|
||||||
@ -1593,7 +1595,7 @@ class IndividualPage(BasePage):
|
|||||||
|
|
||||||
parent_handle_list = self.person.get_parent_family_handle_list()
|
parent_handle_list = self.person.get_parent_family_handle_list()
|
||||||
if parent_handle_list:
|
if parent_handle_list:
|
||||||
(parent_handle, mrel,frel) = parent_handle_list[0]
|
parent_handle = parent_handle_list[0]
|
||||||
family = self.db.get_family_from_handle(parent_handle)
|
family = self.db.get_family_from_handle(parent_handle)
|
||||||
father_id = family.get_father_handle()
|
father_id = family.get_father_handle()
|
||||||
mother_id = family.get_mother_handle()
|
mother_id = family.get_mother_handle()
|
||||||
@ -1619,7 +1621,8 @@ class IndividualPage(BasePage):
|
|||||||
self.pedigree_person(of,mother,True)
|
self.pedigree_person(of,mother,True)
|
||||||
of.write('<div class="pedigreegen">\n')
|
of.write('<div class="pedigreegen">\n')
|
||||||
if family:
|
if family:
|
||||||
for child_handle in family.get_child_handle_list():
|
for child_ref in family.get_child_ref_list():
|
||||||
|
child_handle = child_ref.ref
|
||||||
if child_handle == self.person.handle:
|
if child_handle == self.person.handle:
|
||||||
of.write('<span class="thisperson">%s</span><br />\n' % self.name)
|
of.write('<span class="thisperson">%s</span><br />\n' % self.name)
|
||||||
self.pedigree_family(of)
|
self.pedigree_family(of)
|
||||||
@ -1656,7 +1659,7 @@ class IndividualPage(BasePage):
|
|||||||
# Names [and their sources]
|
# Names [and their sources]
|
||||||
for name in [self.person.get_primary_name(),]+self.person.get_alternate_names():
|
for name in [self.person.get_primary_name(),]+self.person.get_alternate_names():
|
||||||
pname = name_nameof(name,self.exclude_private)
|
pname = name_nameof(name,self.exclude_private)
|
||||||
type = Utils.format_name_type( name.get_type() )
|
type = str( name.get_type() )
|
||||||
of.write('<tr><td class="field">%s</td>\n' % _(type))
|
of.write('<tr><td class="field">%s</td>\n' % _(type))
|
||||||
of.write('<td class="data">%s' % pname)
|
of.write('<td class="data">%s' % pname)
|
||||||
if not self.restrict:
|
if not self.restrict:
|
||||||
@ -1725,7 +1728,7 @@ class IndividualPage(BasePage):
|
|||||||
for event_ref in evt_ref_list:
|
for event_ref in evt_ref_list:
|
||||||
event = self.db.get_event_from_handle(event_ref.ref)
|
event = self.db.get_event_from_handle(event_ref.ref)
|
||||||
if event:
|
if event:
|
||||||
evt_name = Utils.format_event(event.get_type())
|
evt_name = str(event.get_type())
|
||||||
of.write('<tr><td class="field">%s</td>\n' % evt_name)
|
of.write('<tr><td class="field">%s</td>\n' % evt_name)
|
||||||
of.write('<td class="data">\n')
|
of.write('<td class="data">\n')
|
||||||
of.write(self.format_event(event))
|
of.write(self.format_event(event))
|
||||||
@ -1765,7 +1768,7 @@ class IndividualPage(BasePage):
|
|||||||
else:
|
else:
|
||||||
of.write(nameof(person,self.exclude_private))
|
of.write(nameof(person,self.exclude_private))
|
||||||
if rel != RelLib.ChildRefType.BIRTH:
|
if rel != RelLib.ChildRefType.BIRTH:
|
||||||
of.write(' (%s)' % Utils.format_child_relation(rel))
|
of.write(' (%s)' % str(rel))
|
||||||
of.write('</td>\n')
|
of.write('</td>\n')
|
||||||
|
|
||||||
def display_ind_parents(self,of):
|
def display_ind_parents(self,of):
|
||||||
@ -1780,9 +1783,19 @@ class IndividualPage(BasePage):
|
|||||||
|
|
||||||
first = True
|
first = True
|
||||||
if parent_list:
|
if parent_list:
|
||||||
for (family_handle,mrel,frel) in parent_list:
|
for family_handle in parent_list:
|
||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
|
|
||||||
|
# Get the mother and father relationships
|
||||||
|
frel = ""
|
||||||
|
mrel = ""
|
||||||
|
child_handle = self.person.get_handle()
|
||||||
|
child_ref_list = family.get_child_ref_list()
|
||||||
|
for child_ref in child_ref_list:
|
||||||
|
if child_ref.ref == child_handle:
|
||||||
|
frel = str(child_ref.get_father_relation())
|
||||||
|
mrel = str(child_ref.get_mother_relation())
|
||||||
|
|
||||||
if not first:
|
if not first:
|
||||||
of.write('<tr><td colspan="2"> </td></tr>\n')
|
of.write('<tr><td colspan="2"> </td></tr>\n')
|
||||||
else:
|
else:
|
||||||
@ -1799,12 +1812,13 @@ class IndividualPage(BasePage):
|
|||||||
self.display_parent(of,mother_handle,_('Mother'),mrel)
|
self.display_parent(of,mother_handle,_('Mother'),mrel)
|
||||||
of.write('</tr>\n')
|
of.write('</tr>\n')
|
||||||
first = False
|
first = False
|
||||||
childlist = family.get_child_handle_list()
|
childlist = family.get_child_ref_list()
|
||||||
if len(childlist) > 1:
|
if len(childlist) > 1:
|
||||||
of.write('<tr>\n')
|
of.write('<tr>\n')
|
||||||
of.write('<td class="field">%s</td>\n' % _("Siblings"))
|
of.write('<td class="field">%s</td>\n' % _("Siblings"))
|
||||||
of.write('<td class="data">\n')
|
of.write('<td class="data">\n')
|
||||||
for child_handle in childlist:
|
for child_ref in childlist:
|
||||||
|
child_handle = child_ref.ref
|
||||||
if child_handle != self.person.handle:
|
if child_handle != self.person.handle:
|
||||||
self.display_child_link(of,child_handle)
|
self.display_child_link(of,child_handle)
|
||||||
of.write('</td>\n</tr>\n')
|
of.write('</td>\n</tr>\n')
|
||||||
@ -1826,13 +1840,13 @@ class IndividualPage(BasePage):
|
|||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
self.display_spouse(of,family,first)
|
self.display_spouse(of,family,first)
|
||||||
first = False
|
first = False
|
||||||
childlist = family.get_child_handle_list()
|
childlist = family.get_child_ref_list()
|
||||||
if childlist:
|
if childlist:
|
||||||
of.write('<tr><td> </td>\n')
|
of.write('<tr><td> </td>\n')
|
||||||
of.write('<td class="field">%s</td>\n' % _("Children"))
|
of.write('<td class="field">%s</td>\n' % _("Children"))
|
||||||
of.write('<td class="data">\n')
|
of.write('<td class="data">\n')
|
||||||
for child_handle in childlist:
|
for child_ref in childlist:
|
||||||
self.display_child_link(of,child_handle)
|
self.display_child_link(of,child_ref.ref)
|
||||||
of.write('</td>\n</tr>\n')
|
of.write('</td>\n</tr>\n')
|
||||||
of.write('</table>\n')
|
of.write('</table>\n')
|
||||||
of.write('</div>\n')
|
of.write('</div>\n')
|
||||||
@ -1841,7 +1855,7 @@ class IndividualPage(BasePage):
|
|||||||
gender = self.person.get_gender()
|
gender = self.person.get_gender()
|
||||||
reltype = family.get_relationship()
|
reltype = family.get_relationship()
|
||||||
|
|
||||||
if reltype[0] == RelLib.Family.MARRIED:
|
if reltype == RelLib.FamilyRelType.MARRIED:
|
||||||
if gender == RelLib.Person.FEMALE:
|
if gender == RelLib.Person.FEMALE:
|
||||||
relstr = _("Husband")
|
relstr = _("Husband")
|
||||||
elif gender == RelLib.Person.MALE:
|
elif gender == RelLib.Person.MALE:
|
||||||
@ -1861,7 +1875,7 @@ class IndividualPage(BasePage):
|
|||||||
name = _("unknown")
|
name = _("unknown")
|
||||||
if not first:
|
if not first:
|
||||||
of.write('<tr><td colspan="3"> </td></tr>\n')
|
of.write('<tr><td colspan="3"> </td></tr>\n')
|
||||||
rtype = Utils.format_family_relation(family.get_relationship())
|
rtype = str(family.get_relationship())
|
||||||
of.write('<tr><td class="category">%s</td>\n' % rtype)
|
of.write('<tr><td class="category">%s</td>\n' % rtype)
|
||||||
of.write('<td class="field">%s</td>\n' % relstr)
|
of.write('<td class="field">%s</td>\n' % relstr)
|
||||||
of.write('<td class="data">')
|
of.write('<td class="data">')
|
||||||
@ -1885,7 +1899,7 @@ class IndividualPage(BasePage):
|
|||||||
if self.exclude_private and event.private:
|
if self.exclude_private and event.private:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
evtType = Utils.format_event(event.get_type())
|
evtType = str(event.get_type())
|
||||||
of.write('<tr><td> </td>\n')
|
of.write('<tr><td> </td>\n')
|
||||||
of.write('<td class="field">%s</td>\n' % evtType)
|
of.write('<td class="field">%s</td>\n' % evtType)
|
||||||
of.write('<td class="data">\n')
|
of.write('<td class="data">\n')
|
||||||
@ -1894,7 +1908,7 @@ class IndividualPage(BasePage):
|
|||||||
for attr in family.get_attribute_list():
|
for attr in family.get_attribute_list():
|
||||||
if self.exclude_private and attr.private:
|
if self.exclude_private and attr.private:
|
||||||
continue
|
continue
|
||||||
attrType = Utils.format_family_attribute(attr.get_type())
|
attrType = str(attr.get_type())
|
||||||
of.write('<tr><td> </td>\n')
|
of.write('<tr><td> </td>\n')
|
||||||
of.write('<td class="field">%s</td>' % attrType)
|
of.write('<td class="field">%s</td>' % attrType)
|
||||||
of.write('<td class="data">%s</td>\n</tr>\n' % attr.get_value())
|
of.write('<td class="data">%s</td>\n</tr>\n' % attr.get_value())
|
||||||
@ -1936,11 +1950,11 @@ class IndividualPage(BasePage):
|
|||||||
if self.exclude_private:
|
if self.exclude_private:
|
||||||
spouse = ReportUtils.sanitize_person( self.db, spouse)
|
spouse = ReportUtils.sanitize_person( self.db, spouse)
|
||||||
self.pedigree_person(of,spouse,True)
|
self.pedigree_person(of,spouse,True)
|
||||||
childlist = rel_family.get_child_handle_list()
|
childlist = rel_family.get_child_ref_list()
|
||||||
if childlist:
|
if childlist:
|
||||||
of.write('<div class="pedigreegen">\n')
|
of.write('<div class="pedigreegen">\n')
|
||||||
for child_handle in childlist:
|
for child_ref in childlist:
|
||||||
child = self.db.get_person_from_handle(child_handle)
|
child = self.db.get_person_from_handle(child_ref.ref)
|
||||||
if self.exclude_private:
|
if self.exclude_private:
|
||||||
child = ReportUtils.sanitize_person( self.db, child)
|
child = ReportUtils.sanitize_person( self.db, child)
|
||||||
self.pedigree_person(of,child)
|
self.pedigree_person(of,child)
|
||||||
|
Loading…
Reference in New Issue
Block a user