From: Steve Sutton Date: Mon, 1 Aug 2016 16:02:23 +0000 (-0400) Subject: Bug fix for first time in leads X-Git-Tag: v1.0.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=1df735c15a7bb827ac146f880ba33ea3490053a8;p=WP-Plugins%2Fglm-member-db-leads.git Bug fix for first time in leads Bug Fix for #0000023 When you first get to leads it was showing only the member contact view. This is now fixed and it will now show the proper screen when going to leads for first time. --- diff --git a/index.php b/index.php index 65587d6..11763ba 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.1 + * Version: 1.0.2 * 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.1 + * @version 1.0.2 */ /* @@ -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.1'); +define('GLM_MEMBERS_LEADS_PLUGIN_VERSION', '1.0.2'); 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 c6fc35f..b0beda4 100644 --- a/models/admin/leads/index.php +++ b/models/admin/leads/index.php @@ -155,6 +155,9 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry $search_params = unserialize( $result['search'] ); } } + if ( isset( $this->config['loggedInUser']['contactUser'] ) && empty( $this->config['loggedInUser']['contactUser'] ) ) { + $user_can_edit_leads = true; + } if ( ( isset( $search ) && $search ) || isset( $search_params ) && $search_params ) { if ( isset( $search ) && $search ) { @@ -238,7 +241,7 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads WHERE mail_ok = $mail_ok)"; } - if ( $this->config['loggedInUser']['contactUser'] ) { + if ( isset( $this->config['loggedInUser']['contactUser'] ) && !empty( $this->config['loggedInUser']['contactUser'] ) ) { $where_parts[] = "T.lead_id IN ( SELECT id FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads @@ -376,6 +379,8 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry } else { $leads = ''; $search_params = array( + 'mail_ok' => 0, + 'member_ok' => 0, 'company' => '', 'contact' => '', 'from_date' => '',