Update DetAncestralReport, DetDescendantReport, IndivComplete and endnotes for citations.
svn: r18513
This commit is contained in:
parent
78050489d2
commit
a48553ed90
@ -5,6 +5,7 @@
|
||||
# Copyright (C) 2010 Peter Landgren
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
# Copyright (C) 2011 Adam Stein <adam@csh.rit.edu>
|
||||
# Copyright (C) 2011 Tim G Lyons
|
||||
#
|
||||
# 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
|
||||
@ -76,7 +77,7 @@ def add_endnote_styles(style_sheet):
|
||||
para.set_description(_('The basic style used for the endnotes reference notes display.'))
|
||||
style_sheet.add_paragraph_style("Endnotes-Ref-Notes", para)
|
||||
|
||||
def cite_source(bibliography, obj):
|
||||
def cite_source(bibliography, database, obj):
|
||||
"""
|
||||
Cite any sources for the object and add them to the bibliography.
|
||||
|
||||
@ -86,14 +87,15 @@ def cite_source(bibliography, obj):
|
||||
@type obj: L{gen.lib.srcbase}
|
||||
"""
|
||||
txt = ""
|
||||
slist = obj.get_source_references()
|
||||
slist = obj.get_citation_list()
|
||||
if slist:
|
||||
first = 1
|
||||
for ref in slist:
|
||||
if not first:
|
||||
txt += ', '
|
||||
first = 0
|
||||
(cindex, key) = bibliography.add_reference(ref)
|
||||
citation = database.get_citation_from_handle(ref)
|
||||
(cindex, key) = bibliography.add_reference(citation)
|
||||
txt += "%d" % (cindex + 1)
|
||||
if key is not None:
|
||||
txt += key
|
||||
|
@ -8,6 +8,7 @@
|
||||
# Copyright (C) 2009 Benny Malengier <benny.malengier@gramps-project.org>
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
# Copyright (C) 2010 Vlada Peri\u0107
|
||||
# Copyright (C) 2011 Tim G Lyons
|
||||
#
|
||||
# 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
|
||||
@ -696,7 +697,7 @@ class DetAncestorReport(Report):
|
||||
if not obj or not self.inc_sources:
|
||||
return ""
|
||||
|
||||
txt = endnotes.cite_source(self.bibli, obj)
|
||||
txt = endnotes.cite_source(self.bibli, self.database, obj)
|
||||
if txt:
|
||||
txt = '<super>' + txt + '</super>'
|
||||
return txt
|
||||
|
@ -10,6 +10,7 @@
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
# Copyright (C) 2010 Vlada Peri\u0107
|
||||
# Copyright (C) 2011 Matt Keenan <matt.keenan@gmail.com>
|
||||
# Copyright (C) 2011 Tim G Lyons
|
||||
#
|
||||
# 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
|
||||
@ -858,7 +859,7 @@ class DetDescendantReport(Report):
|
||||
if not obj or not self.inc_sources:
|
||||
return ""
|
||||
|
||||
txt = endnotes.cite_source(self.bibli, obj)
|
||||
txt = endnotes.cite_source(self.bibli, self.database, obj)
|
||||
if txt:
|
||||
txt = '<super>' + txt + '</super>'
|
||||
return txt
|
||||
|
@ -6,6 +6,7 @@
|
||||
# Copyright (C) 2009 Nick Hall
|
||||
# Copyright (C) 2009 Benny Malengier
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
# Copyright (C) 2011 Tim G Lyons
|
||||
#
|
||||
# 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
|
||||
@ -219,7 +220,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
endnotes = ""
|
||||
if self.use_srcs:
|
||||
endnotes = Endnotes.cite_source(self.bibli, event)
|
||||
endnotes = Endnotes.cite_source(self.bibli, self.database, event)
|
||||
|
||||
self.doc.start_row()
|
||||
self.normal_cell(column_1)
|
||||
@ -359,7 +360,7 @@ class IndivCompleteReport(Report):
|
||||
text = self._name_display.display_name(name)
|
||||
endnotes = ""
|
||||
if self.use_srcs:
|
||||
endnotes = Endnotes.cite_source(self.bibli, name)
|
||||
endnotes = Endnotes.cite_source(self.bibli, self.database, name)
|
||||
self.normal_cell(text, endnotes)
|
||||
self.doc.end_row()
|
||||
self.doc.end_table()
|
||||
@ -387,7 +388,7 @@ class IndivCompleteReport(Report):
|
||||
date = DateHandler.get_date(addr)
|
||||
endnotes = ""
|
||||
if self.use_srcs:
|
||||
endnotes = Endnotes.cite_source(self.bibli, addr)
|
||||
endnotes = Endnotes.cite_source(self.bibli, self.database, addr)
|
||||
self.doc.start_row()
|
||||
self.normal_cell(date)
|
||||
self.normal_cell(text, endnotes)
|
||||
@ -579,7 +580,7 @@ class IndivCompleteReport(Report):
|
||||
mark = ReportUtils.get_person_mark(self.database, self.person)
|
||||
endnotes = ""
|
||||
if self.use_srcs:
|
||||
endnotes = Endnotes.cite_source(self.bibli, name)
|
||||
endnotes = Endnotes.cite_source(self.bibli, self.database, name)
|
||||
self.normal_cell(text, endnotes, mark)
|
||||
self.doc.end_row()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user