From 2295fe29c395bc6b6306b2f11f187d26253ec54e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 14 Nov 2011 19:02:24 -0200 Subject: Fixing 'meus emprestimos' widget --- muamba.handlers.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/muamba.handlers.inc b/muamba.handlers.inc index 87d0dd8..def07ef 100644 --- a/muamba.handlers.inc +++ b/muamba.handlers.inc @@ -92,8 +92,20 @@ class views_handler_field_muamba_actions extends views_handler_field { } } elseif (isset($values->nid)) { - $node = node_load($values->nid); - return muamba_widget($node); + if (isset($values->users_muamba_uid)) { + $transaction = muamba_current_transactions($values->nid, $values->users_muamba_uid); + + if ($transaction['owner'] == $user->uid) { + return theme('muamba_widget_owner', array('transaction' => $transaction)); + } + elseif ($transaction['uid'] == $user->uid) { + return theme('muamba_widget_requester', array('transaction' => $transaction)); + } + } + else { + $node = node_load($values->nid); + return muamba_widget($node); + } } } } -- cgit v1.2.3