Merge pull request #331 from prculley/bug9886

bug 9886; fix citation tree view quick report right click
This commit is contained in:
Sam Manzi 2017-01-20 17:33:04 +11:00 committed by GitHub
commit 88e98fcd92
2 changed files with 6 additions and 8 deletions

View File

@ -257,14 +257,12 @@ def run_report(dbstate, uistate, category, handle, pdata, container=None,
elif category == CATEGORY_QR_CITATION : elif category == CATEGORY_QR_CITATION :
obj = dbstate.db.get_citation_from_handle(handle) obj = dbstate.db.get_citation_from_handle(handle)
elif category == CATEGORY_QR_SOURCE_OR_CITATION : elif category == CATEGORY_QR_SOURCE_OR_CITATION :
source = dbstate.db.get_source_from_handle(handle) if dbstate.db.has_source_handle(handle):
citation = dbstate.db.get_citation_from_handle(handle) obj = dbstate.db.get_source_from_handle(handle)
if (not source and not citation) or (source and citation): elif dbstate.db.has_citation_handle(handle):
raise ValueError("selection must be either source or citation") obj = dbstate.db.get_citation_from_handle(handle)
if citation:
obj = citation
else: else:
obj = source raise ValueError("selection must be either source or citation")
elif category == CATEGORY_QR_PLACE : elif category == CATEGORY_QR_PLACE :
obj = dbstate.db.get_place_from_handle(handle) obj = dbstate.db.get_place_from_handle(handle)
elif category == CATEGORY_QR_MEDIA : elif category == CATEGORY_QR_MEDIA :

View File

@ -207,7 +207,7 @@ refitems = [(CATEGORY_QR_PERSON, 'person', _("Person")),
(CATEGORY_QR_MEDIA, 'media', _("Media")), (CATEGORY_QR_MEDIA, 'media', _("Media")),
(CATEGORY_QR_NOTE, 'note', _("Note")), (CATEGORY_QR_NOTE, 'note', _("Note")),
(CATEGORY_QR_CITATION, 'citation', _("Citation")), (CATEGORY_QR_CITATION, 'citation', _("Citation")),
(CATEGORY_QR_SOURCE_OR_CITATION, 'source or citation', (CATEGORY_QR_SOURCE_OR_CITATION, 'source_or_citation',
_("Source or Citation")) _("Source or Citation"))
] ]