diff --git a/ChangeLog b/ChangeLog index 83ad0d4ce..99cad21ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-14 Brian Matherly + * src/plugins/NarrativeWeb.py + * src/ReportBase/_ReportUtils.py + 0001012: Private source and private child references shown in narrative + website. + 2007-04-14 Brian Matherly * src\data\main4.css * src\data\main5.css diff --git a/src/ReportBase/_ReportUtils.py b/src/ReportBase/_ReportUtils.py index 129b3dda7..c9bc2092d 100644 --- a/src/ReportBase/_ReportUtils.py +++ b/src/ReportBase/_ReportUtils.py @@ -1189,7 +1189,7 @@ def sanitize_list(obj_list,exclude_private): @rtype: list """ if exclude_private: - return [obj for obj in obj_list if not obj.private] + return [obj for obj in obj_list if not obj.get_privacy()] else: return obj_list @@ -1253,8 +1253,15 @@ def sanitize_person(db,person): new_person.add_family_handle(handle) # copy Family reference list - for item in person.get_parent_family_handle_list(): - new_person.add_parent_family_handle(item) + for handle in person.get_parent_family_handle_list(): + family = db.get_family_from_handle(handle) + child_ref_list = family.get_child_ref_list() + for child_ref in child_ref_list: + if child_ref.get_reference_handle() == person.get_handle(): + if child_ref.get_privacy() == False: + new_person.add_parent_family_handle(handle) + break + if person.get_privacy(): return new_person diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 2952a1493..1a7b2b626 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -1670,7 +1670,9 @@ class IndividualPage(BasePage): self.pedigree_person(of,mother,True) of.write('
\n') if family: - for child_ref in family.get_child_ref_list(): + childlist = ReportUtils.sanitize_list( family.get_child_ref_list(), + self.exclude_private ) + for child_ref in childlist: child_handle = child_ref.ref if child_handle == self.person.handle: of.write('%s
\n' % self.name) @@ -1848,7 +1850,8 @@ class IndividualPage(BasePage): frel = "" mrel = "" child_handle = self.person.get_handle() - child_ref_list = family.get_child_ref_list() + child_ref_list = ReportUtils.sanitize_list( family.get_child_ref_list(), + self.exclude_private ) for child_ref in child_ref_list: if child_ref.ref == child_handle: frel = str(child_ref.get_father_relation()) @@ -1870,12 +1873,11 @@ class IndividualPage(BasePage): self.display_parent(of,mother_handle,_('Mother'),mrel) of.write('\n') first = False - childlist = family.get_child_ref_list() - if len(childlist) > 1: + if len(child_ref_list) > 1: of.write('\n') of.write('%s\n' % _("Siblings")) of.write('\n') - for child_ref in childlist: + for child_ref in child_ref_list: child_handle = child_ref.ref if child_handle != self.person.handle: self.display_child_link(of,child_handle) @@ -1898,7 +1900,8 @@ class IndividualPage(BasePage): family = self.db.get_family_from_handle(family_handle) self.display_spouse(of,family,first) first = False - childlist = family.get_child_ref_list() + childlist = ReportUtils.sanitize_list( family.get_child_ref_list(), + self.exclude_private ) if childlist: of.write(' \n') of.write('%s\n' % _("Children")) @@ -2011,7 +2014,8 @@ class IndividualPage(BasePage): if self.exclude_private: spouse = ReportUtils.sanitize_person( self.db, spouse) self.pedigree_person(of,spouse,True) - childlist = rel_family.get_child_ref_list() + childlist = ReportUtils.sanitize_list( rel_family.get_child_ref_list(), + self.exclude_private ) if childlist: of.write('
\n') for child_ref in childlist: @@ -2067,6 +2071,9 @@ class IndividualPage(BasePage): if self.exclude_private and sref.private: continue handle = sref.get_reference_handle() + source = self.db.get_source_from_handle(handle) + if source.get_privacy() == True: + continue gid_list.append(sref) if self.src_list.has_key(handle): @@ -2134,7 +2141,7 @@ class WebReport(Report): self.css = options.handler.options_dict['NWEBcss'] self.restrict = options.handler.options_dict['NWEBrestrictinfo'] self.restrict_years = options.handler.options_dict['NWEBrestrictyears'] - self.exclude_private = options.handler.options_dict['NWEBincpriv'] + self.exclude_private = not options.handler.options_dict['NWEBincpriv'] self.noid = options.handler.options_dict['NWEBnoid'] self.title = options.handler.options_dict['NWEBtitle'] self.sort = Sort.Sort(self.database) @@ -2254,7 +2261,7 @@ class WebReport(Report): # if private records need to be filtered out, strip out any person # that has the private flag set. - if not self.exclude_private: + if self.exclude_private: self.progress.set_pass(_('Applying privacy filter'),len(ind_list)) ind_list = filter(self.filter_private,ind_list) @@ -2302,7 +2309,7 @@ class WebReport(Report): self.progress.step() person = self.database.get_person_from_handle(person_handle) - if not self.exclude_private: + if self.exclude_private: person = ReportUtils.sanitize_person(self.database,person) IndividualPage(