Added models and views for registrations dashboard and event list;
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 2 Feb 2017 21:47:28 +0000 (16:47 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 2 Feb 2017 21:47:28 +0000 (16:47 -0500)
Minor fixes to create_database script and adding indexes.

models/admin/registrations/index.php
models/admin/registrations/list.php [new file with mode: 0644]
setup/databaseScripts/create_database_V0.0.1.sql
views/admin/registrations/list.html [new file with mode: 0644]

index 571c4f4..658cd58 100644 (file)
@@ -96,7 +96,7 @@ class GlmMembersAdmin_registrations_index // extends GlmDataRegistrations
         return array(
             'status'        => true,
             'modelRedirect' => false,
-            'view'          => 'admin/registratrions/index.html',
+            'view'          => 'admin/registrations/index.html',
             'data'          => $templateData
         );
 
diff --git a/models/admin/registrations/list.php b/models/admin/registrations/list.php
new file mode 100644 (file)
index 0000000..e47ea7f
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations Dashboard
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+// Load Registrations data abstract
+// require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegistrations.php';
+
+class GlmMembersAdmin_registrations_list // extends GlmDataRegistrations
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Registrations Event ID
+     *
+     * @var $eventID
+     * @access public
+     */
+    public $regEventID = false;
+
+    /**
+     * 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 the REgistrations data class
+         *
+         * Note, the third parameter is a flag that indicates to the Contacts
+         * data class that it should flag a group of fields as 'view_only'.
+         */
+//        parent::__construct(false, false, true);
+
+    }
+
+    public function modelAction($actionData = false)
+    {
+
+
+        // Compile template data
+        $templateData = array(
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'admin/registrations/list.html',
+            'data'          => $templateData
+        );
+
+    }
+
+
+}
index 03e0b48..5eda4a9 100644 (file)
@@ -21,9 +21,9 @@
  *          --> Submission, Event Registration, Rate Class selected, Account, Registrant 
  *      mf_temp_file - Temporary file meta-data
  * 
- * added_info - Additional fields
- *      added_info - Submitted additional field data 
- *          --> added_info
+ * added_info_fields - Additional fields
+ *      added_info_data - Submitted additional field data 
+ *          --> added_info_fields
  * 
  * payment codes - Promotional payment codes - Used with various things
  *      --> Event, Submission, Event Registration, Event Registrant, Account or global
@@ -131,10 +131,12 @@ CREATE TABLE {prefix}management (
 
 ----
 
--- Additional fields for collecting information at checkout
+-- Additional fields for collecting information for various things - submission, event registration, or registrant
 -- Related to the registration submission or specific event registration
-CREATE TABLE {prefix}added_info (
+CREATE TABLE {prefix}added_info_fields (
     id INT NOT NULL AUTO_INCREMENT,
+    ref_type TINYINT NULL,                                      -- See data_ref_type table in plugin.ini 
+    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
     name TINYTEXT NULL,                                         -- Displayed field prompt - also used on retrieval of data
     description TINYTEXT NULL,                                  -- Description of field - possibly to display to user
     PRIMARY KEY (id)
@@ -142,12 +144,10 @@ CREATE TABLE {prefix}added_info (
 
 ----
 
--- Additional field data for a specific submission, event registration, or registrant
-CREATE TABLE {prefix}added_info (
+-- Additional field data for various specific things
+CREATE TABLE {prefix}added_info_data (
     id INT NOT NULL AUTO_INCREMENT,
-    added_field INT NULL,                                       -- Pointer to added_info_field table
-    ref_type TINYINT NULL,                                      -- See data_ref_type table in plugin.ini 
-    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
+    added_info_field INT NULL,                                  -- Pointer to added_info_field table
     field_value TINYTEXT NULL,
     PRIMARY KEY (id)
 );
diff --git a/views/admin/registrations/list.html b/views/admin/registrations/list.html
new file mode 100644 (file)
index 0000000..dffe41a
--- /dev/null
@@ -0,0 +1,6 @@
+{include file='admin/registrations/header.html'}
+    
+<h3>Registrations List Page</h3>
+    
+{include file='admin/footer.html'}
+