From af7deee26bca06a9937394bd44d74e161877cbbb Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 2 Jul 2024 14:21:28 -0500 Subject: [PATCH] fix: link to CORE when viewing profile member tab --- tailbone_corepos/views/people.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tailbone_corepos/views/people.py b/tailbone_corepos/views/people.py index 8f85001..091a2e8 100644 --- a/tailbone_corepos/views/people.py +++ b/tailbone_corepos/views/people.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2023 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -68,6 +68,18 @@ class PersonViewSupplement(ViewSupplement): 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): buttons = OrderedDict() app = self.get_rattail_app()