fix: link to CORE when viewing profile member tab

This commit is contained in:
Lance Edgar 2024-07-02 14:21:28 -05:00
parent 4bb35b50f4
commit af7deee26b

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2023 Lance Edgar # Copyright © 2010-2024 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -68,6 +68,18 @@ class PersonViewSupplement(ViewSupplement):
return context return context
def get_context_for_member(self, member, context):
if member.corepos_card_number:
app = self.get_rattail_app()
corepos = app.get_corepos_handler()
url = corepos.get_office_member_url(member.corepos_card_number)
if url:
context['external_links'].append({'label': "View in CORE Office",
'url': url})
return context
def get_member_xref_buttons(self, person): def get_member_xref_buttons(self, person):
buttons = OrderedDict() buttons = OrderedDict()
app = self.get_rattail_app() app = self.get_rattail_app()