From: Steve Sutton Date: Mon, 1 Aug 2016 13:41:10 +0000 (-0400) Subject: Update for the csv download file. X-Git-Tag: v1.0.1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=c90d74f3b57d40657d3fe9a26032a3b92de96df5;p=WP-Plugins%2Fglm-member-db-leads.git Update for the csv download file. Need to get email and the source name because these are reference ids. --- diff --git a/index.php b/index.php index b0f992d..65587d6 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Leads * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.0.0 + * Version: 1.0.1 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabaseLeadsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.0.0 + * @version 1.0.1 */ /* @@ -37,7 +37,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '1.0.0'); +define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '1.0.1'); define('GLM_MEMBERS_LEADS_PLUGIN_DB_VERSION', '0.0.7'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/admin/leads/index.php b/models/admin/leads/index.php index a221772..c6fc35f 100644 --- a/models/admin/leads/index.php +++ b/models/admin/leads/index.php @@ -324,9 +324,11 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry switch ( $option ) { case 'csv': $sql = " - SELECT T.* - FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T + SELECT T.*,L.email + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T, + " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads L WHERE $where + AND T.lead_id = L.id ORDER BY $order"; $leads = $this->wpdb->get_results( $sql, ARRAY_A ); break; @@ -406,10 +408,18 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry if ( isset( $leads ) && is_array( $leads ) && !empty( $leads ) ) { $lead_counter = 0; foreach ( $leads as $entry_id => $lead ) { + $source_name = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT title + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "sources + WHERE id = %d", + $lead['source_id'] + ) + ); $out = array( 'fname' => $lead['fname'], 'lname' => $lead['lname'], - 'email' => $lead['lead_id']['name'], + 'email' => $lead['email'], 'addr1' => $lead['addr1'], 'addr2' => $lead['addr2'], 'city' => $lead['city'], @@ -420,7 +430,7 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry 'phone2' => $lead['phone2'], 'fax' => $lead['fax'], 'date_submitted' => $lead['date_submitted'], - 'source' => $lead['source_id']['name'], + 'source' => $source_name, ); // Add fields for group names if ( $groups ) {