Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/176006

Change subject: WMF LYBUNT uses wmf_donor instead of silverpop
......................................................................

WMF LYBUNT uses wmf_donor instead of silverpop

Many of the major donors we care about in the LYBUNT report do not
have email addresses on file, so we can't depend on the silverpop
export table to filter them.  De-duping by email address is also
less necessary for these donors since their records are usually not
generated by the QC.

Change-Id: I0acdc24273a1b5339cc144e737a899a04bf176f6
---
D sites/all/modules/wmf_reports/CRM/BAO/SilverpopExport.php
M sites/all/modules/wmf_reports/CRM/BAO/WmfDonor.php
M sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php
3 files changed, 23 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/06/176006/1

diff --git a/sites/all/modules/wmf_reports/CRM/BAO/SilverpopExport.php 
b/sites/all/modules/wmf_reports/CRM/BAO/SilverpopExport.php
deleted file mode 100644
index a029313..0000000
--- a/sites/all/modules/wmf_reports/CRM/BAO/SilverpopExport.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-class CRM_BAO_SilverpopExport {
-    static function exportableFields() {
-        return array(
-            'latest_donation' => array(
-                'title' => 'Last donation',
-                'data_type' => CRM_Utils_Type::T_DATE,
-            ),
-            'latest_usd_amount' => array(
-                'title' => 'Last donation amount (USD)',
-                'data_type' => CRM_Utils_Type::T_MONEY,
-            ),
-            'lifetime_usd_total' => array(
-                'title' => 'Lifetime donations (USD)',
-                'data_type' => CRM_Utils_Type::T_MONEY,
-            ),
-        );
-    }
-}
diff --git a/sites/all/modules/wmf_reports/CRM/BAO/WmfDonor.php 
b/sites/all/modules/wmf_reports/CRM/BAO/WmfDonor.php
index 812dcfa..a0de2ae 100644
--- a/sites/all/modules/wmf_reports/CRM/BAO/WmfDonor.php
+++ b/sites/all/modules/wmf_reports/CRM/BAO/WmfDonor.php
@@ -7,6 +7,18 @@
                 'title' => 'Do not solicit',
                 'data_type' => CRM_Utils_Type::T_BOOLEAN,
             ),
+                       'last_donation_date' => array(
+                'title' => 'Last donation',
+                'data_type' => CRM_Utils_Type::T_DATE,
+            ),
+            'last_donation_usd' => array(
+                'title' => 'Last donation amount (USD)',
+                'data_type' => CRM_Utils_Type::T_MONEY,
+            ),
+            'lifetime_usd_total' => array(
+                'title' => 'Lifetime donations (USD)',
+                'data_type' => CRM_Utils_Type::T_MONEY,
+            ),
         );
     }
 }
diff --git 
a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php 
b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php
index 4fdc5ea..c526ed9 100644
--- a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php
+++ b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php
@@ -200,24 +200,19 @@
           ),
         ),
       ),
-      'silverpop.silverpop_export' => array(
-        'bao' => 'CRM_BAO_SilverpopExport',
-        'fields' => array(
-          'lifetime_usd_total' => array(
-            'default' => true,
-          ),
-          'latest_donation' => array(
-            'default' => true,
-          ),
-          'latest_usd_amount' => array(
-            'default' => true,
-          ),
-        ),
-      ),
       'wmf_donor' => array(
         'bao' => 'CRM_BAO_WmfDonor',
         'fields' => array(
           'do_not_solicit' => array(
+            'default' => true,
+          ),
+          'lifetime_usd_total' => array(
+            'default' => true,
+          ),
+          'last_donation_date' => array(
+            'default' => true,
+          ),
+          'last_donation_usd' => array(
             'default' => true,
           ),
         ),
@@ -296,8 +291,6 @@
               LEFT JOIN civicrm_country {$this->_aliases['civicrm_country']}
                       ON {$this->_aliases['civicrm_address']}.country_id = 
{$this->_aliases['civicrm_country']}.id AND
                          {$this->_aliases['civicrm_address']}.is_primary = 1
-              LEFT JOIN silverpop.silverpop_export 
{$this->_aliases['silverpop.silverpop_export']}
-                      ON 
{$this->_aliases['silverpop.silverpop_export']}.contact_id = 
{$this->_aliases['civicrm_contact']}.id
               LEFT JOIN wmf_donor {$this->_aliases['wmf_donor']}
                       ON {$this->_aliases['wmf_donor']}.entity_id = 
{$this->_aliases['civicrm_contact']}.id ";
   }
@@ -313,8 +306,8 @@
         foreach ($table['filters'] as $fieldName => $field) {
           $clause = NULL;
           if ($fieldName == 'yid') {
-            $clause = 
"{$this->_aliases['silverpop.silverpop_export']}.is_{$current_year}_donor = 0
-                           AND 
{$this->_aliases['silverpop.silverpop_export']}.is_{$previous_year}_donor = 1";
+            $clause = "{$this->_aliases['wmf_donor']}.is_{$current_year}_donor 
= 0
+                           AND 
{$this->_aliases['wmf_donor']}.is_{$previous_year}_donor = 1";
           }
           elseif (CRM_Utils_Array::value('type', $field) & 
CRM_Utils_Type::T_DATE) {
             $relative = CRM_Utils_Array::value("{$fieldName}_relative", 
$this->_params);

-- 
To view, visit https://gerrit.wikimedia.org/r/176006
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0acdc24273a1b5339cc144e737a899a04bf176f6
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to