Bug fix for first time in leads
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Aug 2016 16:02:23 +0000 (12:02 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 1 Aug 2016 16:02:23 +0000 (12:02 -0400)
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.

index.php
models/admin/leads/index.php

index 65587d6..11763ba 100644 (file)
--- 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 <cscott@gaslightmedia.com>
  * @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.
index c6fc35f..b0beda4 100644 (file)
@@ -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' => '',