Some database adjustments and additional descriptive information
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 21 Jun 2016 16:20:40 +0000 (12:20 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 21 Jun 2016 16:20:40 +0000 (12:20 -0400)
models/admin/settings/leads.php [new file with mode: 0644]
readme.txt
setup/adminTabs.php
setup/databaseScripts/create_database_V0.0.1.sql
setup/databaseScripts/dbVersions.php
setup/validActions.php
views/admin/settings/leads.html [new file with mode: 0644]

diff --git a/models/admin/settings/leads.php b/models/admin/settings/leads.php
new file mode 100644 (file)
index 0000000..2805073
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members DB - Leads Add-on - Settings Tab
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  leads.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+/**
+ * GlmMembersAdmin_settings_leads
+ *
+ * PHP version 5
+ *
+ * @category Model
+ * @package GLM Member DB
+ * @author  Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ */
+class GlmMembersAdmin_settings_leads // extends GlmDataLeadsSettings
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * dbh Postgres database connection
+     *
+     * @var mixed
+     * @access public
+     */
+    public $dbh;
+    /**
+     * settings used for the schema and tablenames
+     *
+     * @var mixed
+     * @access public
+     */
+    public $settings = array();
+    /**
+     * categories
+     *
+     * @var bool
+     * @access public
+     */
+    public $categories = array();
+    public $oldCatMap = array();
+    /**
+     * events
+     *
+     * @var bool
+     * @access public
+     */
+    public $events = array();
+    public $image_owner;
+
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+//        parent::__construct(false, false);
+
+    }
+
+    /**
+     * modelAction
+     *
+     * @param bool $actionData
+     * @access public
+     * @return void
+     */
+    public function modelAction($actionData = false)
+    {
+
+
+        // Compile template data
+        $templateData = array(
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status'           => true,
+            'menuItemRedirect' => false,
+            'modelRedirect'    => false,
+            'view'             => 'admin/settings/leads.html',
+            'data'             => $templateData
+        );
+
+
+    }
+
+}
index c1290ca..8cd0671 100644 (file)
@@ -24,4 +24,5 @@ e.g.
 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
 1. Activate the plugin through the 'Plugins' menu in WordPress
 
+== Plugin Construction ==
 
index 68614b1..9219db6 100644 (file)
@@ -37,6 +37,7 @@
 // If user can manage all members
 if (current_user_can('glm_members_members')) {
     if (apply_filters('glm_members_permit_admin_members_leads_tab', true)) {
+
         add_filter('glm-member-db-add-tab-for-management',
             function($addOnTabs) {
                 $newTabs = array(
@@ -50,5 +51,21 @@ if (current_user_can('glm_members_members')) {
                 return $addOnTabs;
             }
         );
+
+        add_filter('glm-member-db-add-tab-for-settings',
+            function($addOnTabs) {
+                $newTabs = array(
+                    array(
+                        'text' => 'Leads',
+                        'menu' => 'settings',
+                        'action' => 'leads'
+                    ),
+
+                );
+                $addOnTabs = array_merge($addOnTabs, $newTabs);
+                return $addOnTabs;
+            }
+        );
+
     }
 }
index 46856e4..fe9cfa0 100644 (file)
@@ -100,15 +100,6 @@ CREATE TABLE {prefix}lead_interests (
 
 ----
 
--- How Heard - List of possible responses to "how did you hear about ..." - Forms use ID as value
-CREATE TABLE {prefix}how_heard (
-  id INT NOT NULL AUTO_INCREMENT,
-  title TINYTEXT NULL,                      -- Interest Title
-  PRIMARY KEY (id)
-);
-
-----
-
 -- lead_searches - Memorized search configurations
 CREATE TABLE {prefix}searches (
   id INT NOT NULL AUTO_INCREMENT,
index 0d26ab7..bf6b86f 100644 (file)
@@ -14,6 +14,6 @@
  */
 
 $glmMembersLeadsDbVersions = array(
-    '0.0.1' => array('version' => '0.0.1', 'tables' => 11, 'date' => '6/8/2016')
+    '0.0.1' => array('version' => '0.0.1', 'tables' => 10, 'date' => '6/8/2016')
 );
 
index f262677..bb4a1be 100644 (file)
@@ -37,6 +37,9 @@ $glmMembersLeadsAddOnValidActions = array(
         ),
         'management' => array(
             'leads' => GLM_MEMBERS_LEADS_PLUGIN_SLUG
+        ),
+        'settings' => array(
+            'leads' => GLM_MEMBERS_LEADS_PLUGIN_SLUG
         )
     ),
 );
diff --git a/views/admin/settings/leads.html b/views/admin/settings/leads.html
new file mode 100644 (file)
index 0000000..89fbcd4
--- /dev/null
@@ -0,0 +1,3 @@
+{include file='admin/settings/header.html'}
+
+<H1>ADMIN LEADS SETTINGS VIEW STUFF GOES HERE</H1>
\ No newline at end of file