* src/plugins/NarrativeWeb.py:

* src/ReportBase/_ReportUtils.py:
Fix 0000956: Event order within GRAMPS not replicated in web report

svn: r8277
This commit is contained in:
Brian Matherly 2007-03-07 03:11:41 +00:00
parent c8ff7f4374
commit e699cf10e8
3 changed files with 33 additions and 35 deletions

View File

@ -1,3 +1,8 @@
2007-03-06 Brian Matherly <brian@gramps-project.org>
* src/plugins/NarrativeWeb.py:
* src/ReportBase/_ReportUtils.py:
Fix 0000956: Event order within GRAMPS not replicated in web report
2007-03-05 Brian Matherly <brian@gramps-project.org> 2007-03-05 Brian Matherly <brian@gramps-project.org>
* src/plugins/NarrativeWeb.py: Fix 0000954: e-mail address causes Narrative * src/plugins/NarrativeWeb.py: Fix 0000954: e-mail address causes Narrative
Web plugin to generate bad links Web plugin to generate bad links

View File

@ -1162,6 +1162,14 @@ def sanitize_person(db,person):
# set complete flag # set complete flag
new_person.set_marker(person.get_marker()) new_person.set_marker(person.get_marker())
# copy event list
for event_ref in person.get_event_ref_list():
if event_ref and event_ref.get_privacy() == False:
event = db.get_event_from_handle(event_ref.ref)
if not event.get_privacy():
new_person.add_event_ref(event_ref)
# Copy birth and death after event list to maintain the order.
# copy birth event # copy birth event
event_ref = person.get_birth_ref() event_ref = person.get_birth_ref()
if event_ref and event_ref.get_privacy() == False: if event_ref and event_ref.get_privacy() == False:
@ -1176,13 +1184,6 @@ def sanitize_person(db,person):
if not event.get_privacy(): if not event.get_privacy():
new_person.set_death_ref(event_ref) new_person.set_death_ref(event_ref)
# copy event list
for event_ref in person.get_event_ref_list():
if event_ref and event_ref.get_privacy() == False:
event = db.get_event_from_handle(event_ref.ref)
if not event.get_privacy():
new_person.add_event_ref(event_ref)
# copy address list # copy address list
for address in person.get_address_list(): for address in person.get_address_list():
if not address.get_privacy(): if not address.get_privacy():

View File

@ -1159,6 +1159,15 @@ class SourcesPage(BasePage):
self.display_header(of, db, _('Sources'), author) self.display_header(of, db, _('Sources'), author)
handle_list = list(handle_set) handle_list = list(handle_set)
source_dict = {}
#Sort the sources
for handle in handle_list:
source = db.get_source_from_handle(handle)
key = source.get_title() + str(source.get_gramps_id())
source_dict[key] = (source, handle)
keys = source_dict.keys()
keys.sort(strcoll_case_sensitive)
msg = _("This page contains an index of all the sources in the " msg = _("This page contains an index of all the sources in the "
"database, sorted by their title. Clicking on a source's " "database, sorted by their title. Clicking on a source's "
@ -1169,8 +1178,8 @@ class SourcesPage(BasePage):
of.write('</p>\n<table class="infolist">\n') of.write('</p>\n<table class="infolist">\n')
index = 1 index = 1
for handle in handle_list: for key in keys:
source = db.get_source_from_handle(handle) (source, handle) = source_dict[key]
of.write('<tr><td class="category">%d.</td>\n' % index) of.write('<tr><td class="category">%d.</td>\n' % index)
of.write('<td class="data">') of.write('<td class="data">')
self.source_link(of,handle,source.get_title(),source.gramps_id) self.source_link(of,handle,source.get_title(),source.gramps_id)
@ -1687,11 +1696,9 @@ class IndividualPage(BasePage):
of.write('</tr>\n</table>\n</div>\n') of.write('</tr>\n</table>\n</div>\n')
def display_ind_events(self,of): def display_ind_events(self,of):
birth_ref = self.person.get_birth_ref()
death_ref = self.person.get_death_ref()
evt_ref_list = self.person.get_primary_event_ref_list() evt_ref_list = self.person.get_primary_event_ref_list()
if not birth_ref and not death_ref and not evt_ref_list: if not evt_ref_list:
return return
if self.restrict: if self.restrict:
return return
@ -1700,30 +1707,15 @@ class IndividualPage(BasePage):
of.write('<h4>%s</h4>\n' % _('Events')) of.write('<h4>%s</h4>\n' % _('Events'))
of.write('<table class="infolist">\n') of.write('<table class="infolist">\n')
# Birth
if birth_ref:
event = self.db.get_event_from_handle(birth_ref.ref)
of.write('<tr><td class="field">%s</td>\n' % _('Birth'))
of.write('<td class="data">%s</td>\n' % self.format_event(event))
of.write('</tr>\n')
# Death
if death_ref:
event = self.db.get_event_from_handle(death_ref.ref)
of.write('<tr><td class="field">%s</td>\n' % _('Death'))
of.write('<td class="data">%s</td>\n' % self.format_event(event))
of.write('</tr>\n')
for event_ref in evt_ref_list: for event_ref in evt_ref_list:
if event_ref != birth_ref and event_ref != death_ref: 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 = str(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)) of.write('</td>\n')
of.write('</td>\n') of.write('</tr>\n')
of.write('</tr>\n')
of.write('</table>\n') of.write('</table>\n')
of.write('</div>\n') of.write('</div>\n')