'type' => 'integer',
'view_only' => true,
'use' => 'a'
- ),
-
- // Active flag
- 'active' => array (
- 'field' => 'active',
- 'type' => 'checkbox',
- 'default' => true,
- 'use' => 'a'
)
+/* MORE STUFF GOES HERE */
+
);
}
--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Leads Management
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package GLM Member-DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataEvents.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataLeadsManagement class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmDataLeadsManagement extends GlmDataAbstract
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Data Table Name
+ *
+ * @var $table
+ * @access public
+ */
+ public $table;
+ /**
+ * Field definitions
+ *
+ * 'type' is type of field as defined by the application
+ * text Regular text field
+ * pointer Pointer to an entry in another table
+ * 'filters' is the filter name for a particular filter ID in PHP filter
+ * functions
+ * See PHP filter_id()
+ *
+ * 'use' is when to use the field
+ * l = List
+ * g = Get
+ * n = New
+ * i = Insert
+ * e = Edit
+ * u = Update
+ * d = Delete
+ * a = All
+ *
+ * @var $ini
+ * @access public
+ */
+ public $fields = false;
+
+ /**
+ * Constructor
+ *
+ * @param object $d database connection
+ * @param array $config Configuration array
+ * @param bool $limitedEdit Flag to say indicate limited edit requested
+ *
+ * @return void
+ * @access public
+ */
+ public function __construct($wpdb, $config, $limitedEdit = false)
+ {
+
+ // If this class is not being extended along with existing $wpdb and $config
+ if (!$this->wpdb) {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
+ /*
+ * Table Name
+ */
+ $this->table = GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'management';
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a'
+ )
+
+/* STUFF TO ADD HERE */
+
+ );
+
+ }
+
+ /*
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * In this case we're using it to append an array of category
+ * data to each member result and also sort by member name.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing($r, $a)
+ {
+ return $r;
+ }
+
+}
+
+?>
// Load Leads data abstract
require_once(GLM_MEMBERS_LEADS_PLUGIN_CLASS_PATH.'/data/dataLeads.php');
-class GlmMembersAdmin_members_leads extends GlmDataLeads
+class GlmMembersAdmin_leads_index extends GlmDataLeads
{
/**
// Compile template data
$templateData = array(
- 'displayData' => $displayData
);
// Return status, any suggested view, and any data to controller
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members DB - Leads Add-on - Management Events Tab
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release leadss.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+/**
+ * GlmMembersAdmin_management_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_management_leads // extends GlmDataLeadsManagement
+{
+
+ /**
+ * 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/management/leads.html',
+ 'data' => $templateData
+ );
+
+
+ }
+
+}
*
*/
+// Add Leads sub-menu for GLM Associate menu
+add_submenu_page(
+ 'glm-members-admin-menu-members',
+ 'Leads',
+ 'Leads',
+ 'glm_members_members',
+ 'glm-members-admin-menu-leads-index',
+ function() {$this->controller('leads');}
+);
*
*/
+
+// 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(
+ array(
+ 'text' => 'Leads',
+ 'menu' => 'management',
+ 'action' => 'leads'
+ )
+ );
+ $addOnTabs = array_merge($addOnTabs, $newTabs);
+ return $addOnTabs;
+ }
+ );
+ }
+}
member_ok BOOLEAN NULL, -- OK to have members contact lead
created DATETIME NULL, -- Timestamp lead was first added
PRIMARY KEY (id),
- INDEX (email)
+ INDEX (email(20))
);
----
title TINYTEXT NULL, -- Title/Name of source for reference
code TINYTEXT NULL, -- Code supplied by form to indicate source
PRIMARY KEY (id),
- INDEX (code)
+ INDEX (code(20))
);
----
PRIMARY KEY (id),
INDEX (source_id),
INDEX (lead_id),
- INDEX (fname),
- INDEX (lname),
+ INDEX (fname(20)),
+ INDEX (lname(20)),
INDEX (visit_date),
INDEX (date_submitted)
);
CREATE TABLE {prefix}interest_groups (
id INT NOT NULL AUTO_INCREMENT,
title TINYTEXT NULL, -- Group name
- PRIMARY KEY (id),
- INDEX (interest_id),
- INDEX (lead_entry_id)
+ PRIMARY KEY (id)
);
----
CREATE TABLE {prefix}lead_interests (
id INT NOT NULL AUTO_INCREMENT,
interest_id SMALLINT NULL, -- Pointer to Interest table
- lead_entry_id INTERGER NULL, -- Pointer to lead_entry table
+ lead_entry_id INTEGER NULL, -- Pointer to lead_entry table
PRIMARY KEY (id),
INDEX (interest_id),
INDEX (lead_entry_id)
stat_week DATE NULL, -- First date of week for which these stats are accumulated
leads_count INTEGER NULL, -- Number of leads
PRIMARY KEY (id),
- INDEX (state_week)
+ INDEX (stat_week)
);
+----
+
-- Lead Stats Month Data - Totals of lead stats for 1 month - Preserved indefinately - (generated daily?)
CREATE TABLE {prefix}lead_stats_month (
id INT NOT NULL AUTO_INCREMENT,
* @link http://dev.gaslightmedia.com/
*/
-$glmMembersSampleDbVersions = array(
- '0.0.1' => array('version' => '0.0.1', 'tables' => 1, 'date' => '6/8/2016')
+$glmMembersLeadsDbVersions = array(
+ '0.0.1' => array('version' => '0.0.1', 'tables' => 11, 'date' => '6/8/2016')
);
*
* *** Also note that parameters will be in the context of the main front controller constructor. ***
*/
+
+// Inject things into gravity forms fields - This intercepts all GravityForms before displaying them
+add_filter( 'gform_pre_render', function($form) {
+
+/*
+
+ // for each field in the form
+ foreach ( $form['fields'] as $k => $v ) {
+
+ // Check for a specific input field - in this case contact interests
+ // This must be the same field name for all forms that need this data
+ if ($v['inputName'] == 'contact_interest_options') {
+
+ // Inject sample options - *** THIS SHOULD BE FROM THE DATABASE TABLE OF LEADS INTERESTS ***
+ $form['fields'][$k]['choices'] = array(
+ 0 => array(
+ 'text' => 'Skiing',
+ 'value' => '1',
+ 'isSelected' => false,
+ 'price' => false
+ ),
+ 1 => array(
+ 'text' => 'Boating',
+ 'value' => '2',
+ 'isSelected' => false,
+ 'price' => false
+ ),
+ 2 => array(
+ 'text' => 'Hiking',
+ 'value' => '3',
+ 'isSelected' => false,
+ 'price' => false
+ )
+ );
+ }
+
+ }
+
+*/
+
+
+ return $form;
+});
+
+// Check all GravityForm submissions to see if they are a form that supplies leads
+add_filter( 'gform_pre_render', function($form) {
+
+ // Check for some key field (perhaps hidden) that indicates that the form contains lead information
+
+ // Collect the leads data and store it using a data class
+
+});
*/
$glmMembersLeadsAddOnValidActions = array(
+ 'adminActions' => array(
+ 'leads' => array(
+ 'index' => GLM_MEMBERS_LEADS_PLUGIN_SLUG
+ ),
+ 'management' => array(
+ 'leads' => GLM_MEMBERS_LEADS_PLUGIN_SLUG
+ )
+ ),
);
?>
\ No newline at end of file
--- /dev/null
+<div class="wrap">
+ <h2>All Leads</h2>
+ <h2 class="nav-tab-wrapper">
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">Dashboard</a>
+ </h2>
+ <div id="glm-admin-content-container">
+
+
\ No newline at end of file
--- /dev/null
+{include file='admin/leads/header.html'}
+
+<H1>ADMIN LEADS VIEW STUFF GOES HERE</H1>
+
+
+{include file='admin/footer.html'}
\ No newline at end of file
--- /dev/null
+{include file='admin/management/header.html'}
+
+<H1>ADMIN LEADS MANAGEMENT VIEW STUFF GOES HERE</H1>
\ No newline at end of file