Sources should only get ones with enabled as true.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 25 Jul 2016 12:34:21 +0000 (08:34 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 25 Jul 2016 12:34:21 +0000 (08:34 -0400)
If the form is not enabled then don't show it in the list.

models/admin/leads/index.php

index 17cf5b7..ee705fb 100644 (file)
@@ -772,7 +772,10 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry
 
         // Fetch the sources
         $sources = $this->wpdb->get_results(
-            "SELECT * FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "sources ORDER BY title",
+              "SELECT *
+                 FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "sources
+                WHERE enabled = true
+             ORDER BY title",
             ARRAY_A
         );
 
@@ -817,10 +820,10 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry
 
         // Return status, any suggested view, and any data to controller
         return array(
-                'status'        => true,
-                'modelRedirect' => false,
-                'view'          => 'admin/leads/' . $view,
-                'data'          => $templateData
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'admin/leads/' . $view,
+            'data'          => $templateData
         );
 
     }