Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.0
-
Fix Version/s: 4.1.0
-
Component/s: CiviReport
-
Labels:None
Description
We get asked fairly frequently to add contact ids to reports (as available fields). It seems a bit awkward because the field is displayed buty hidden & seems to take up more time that it deserves. I just used this patch to add the field to the 3 detail reports - I can commit if this is OK.
http://forum.civicrm.org/index.php/topic,22079.0.html
Index: CRM/Report/Form/Contribute/Detail.php
===================================================================
— CRM/Report/Form/Contribute/Detail.php (revision 37702)
+++ CRM/Report/Form/Contribute/Detail.php (working copy)
@@ -49,7 +49,8 @@
protected $_summary = null;
protected $_customGroupExtends = array( 'Contribution' );
-
+ protected $_exposeContactID = true;
+
function __construct( ) {
$this->_columns =
array( 'civicrm_contact' =>
Index: CRM/Report/Form/Member/Detail.php
===================================================================
— CRM/Report/Form/Member/Detail.php (revision 37702)
+++ CRM/Report/Form/Member/Detail.php (working copy)
@@ -49,6 +49,8 @@
protected $_customGroupExtends = array( 'Membership' );
protected $_customGroupGroupBy = false;
+ protected $_exposeContactID = true;
+
function __construct( ) {
$this->_columns =
array( 'civicrm_contact' =>
Index: CRM/Report/Form/Pledge/Detail.php
===================================================================
— CRM/Report/Form/Pledge/Detail.php (revision 37733)
+++ CRM/Report/Form/Pledge/Detail.php (working copy)
@@ -41,7 +41,7 @@
protected $_summary = null;
protected $_totalPaid = false;
protected $_customGroupExtends = array( 'Pledge' , 'Individual');
-
+ protected $_exposeContactID = true;
function __construct( ) {
$this->_columns =
Index: CRM/Report/Form.php
===================================================================
— CRM/Report/Form.php (revision 37702)
+++ CRM/Report/Form.php (working copy)
@@ -98,7 +98,11 @@
protected $_options = array( );
protected $_defaults = array( );
-
+ /*
+ * By default most reports hide contact id.
+ * Setting this to true makes it available
+ */
+ protected $_exposeContactID = false;
/**
- Set of statistic fields
*
@@ -223,7 +227,11 @@
if ( $this->_tagFilter ) { $this->buildTagFilter( ); }
+ if ($this->_exposeContactID)
{ + $this->_columns['civicrm_contact']['fields']['exposed_id'] = array( 'name' => 'id', + 'title' => 'Contact ID', + 'no_repeat' => true); + }if( $this->_groupFilter)
{ $this->buildGroupFilter(); }