From d5f420f8a6c729b95db04a1e515142a042efebec Mon Sep 17 00:00:00 2001 From: generalredneck Date: Tue, 10 Jul 2012 21:47:50 -0400 Subject: [PATCH] Issue #1678396 by generalredneck, rszrama: add a Views relationship from the uid column of the commerce_payment_transaction table to the users table. --- .../includes/views/commerce_payment.views.inc | 31 ++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/modules/payment/includes/views/commerce_payment.views.inc b/modules/payment/includes/views/commerce_payment.views.inc index d367794..0fd5ce0 100644 --- a/modules/payment/includes/views/commerce_payment.views.inc +++ b/modules/payment/includes/views/commerce_payment.views.inc @@ -39,6 +39,37 @@ function commerce_payment_views_data() { ), ); + + // Expose the creator uid. + $data['commerce_payment_transaction']['uid'] = array( + 'title' => t('Uid'), + 'help' => t("The creator's user ID."), + 'field' => array( + 'handler' => 'views_handler_field_user', + 'click sortable' => TRUE, + ), + 'argument' => array( + 'handler' => 'views_handler_argument_user_uid', + 'name field' => 'name', // display this field in the summary + ), + 'filter' => array( + 'title' => t('Name'), + 'handler' => 'views_handler_filter_user_name', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'relationship' => array( + 'title' => t('Creator'), + 'help' => t("Relate this payment transaction to its creator's user account"), + 'handler' => 'views_handler_relationship', + 'base' => 'users', + 'base field' => 'uid', + 'field' => 'uid', + 'label' => t('Payment transaction creator'), + ), + ); + // Expose the order ID. $data['commerce_payment_transaction']['order_id'] = array( 'title' => t('Order ID', array(), array('context' => 'a drupal commerce order')), -- 1.7.4.1