CustomField output now properly selected along with price on registration page.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 17:59:01 +0000 (12:59 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 17:59:01 +0000 (12:59 -0500)
Added field for priority display of a field.

classes/data/dataCustomFields.php
index.php
setup/databaseScripts/create_database_V1.0.3.sql [deleted file]
setup/databaseScripts/create_database_V1.0.4.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V1.0.4.sql [new file with mode: 0644]
views/admin/customFields/index.html
views/front/customFields/displayForm.html

index a00fd8c..10ca664 100644 (file)
@@ -169,6 +169,13 @@ class GlmDataFieldsCustomFields extends GlmDataAbstract
                 'use'       => 'a'
             ),
 
+            // Priority Display
+            'priority_display' => array(
+                'field'     => 'priority_display',
+                'type'      => 'checkbox',
+                'use'       => 'a'
+            ),
+            
             // required field
             'required' => array(
                 'field'    => 'required',
@@ -289,9 +296,9 @@ class GlmDataFieldsCustomFields extends GlmDataAbstract
                         break;
                         
                 }
-                
-                
-trigger_error('Stored Data: '.print_r($customFieldData,1), E_USER_NOTICE);                
+
+ini_set ( log_errors_max_len, 8192 );
+trigger_error('Stored Data: '.print_r($r,1), E_USER_NOTICE);                
                 
             }
         
index c790cc3..ee3bd05 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@
  *  version from this plugin.
  */
 define('GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_VERSION', '1.0.0');
-define('GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_DB_VERSION', '1.0.3');
+define('GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_DB_VERSION', '1.0.4');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
diff --git a/setup/databaseScripts/create_database_V1.0.3.sql b/setup/databaseScripts/create_database_V1.0.3.sql
deleted file mode 100644 (file)
index f458b07..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
--- Gaslight Media Members Database - Custom Fields Add-On
--- File Created: 2017-03-27
--- Database Version: 1.0.2
--- Database Creation Script
---
--- This file is called to create a new set of tables for this
--- add-on for the most recent database version for this add-on.
---
--- There should only be one such file in this directory
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
-
-
--- Field Setup Table
-CREATE TABLE {prefix}custom_fields (
-  id INT NOT NULL AUTO_INCREMENT,
-  fid TEXT NOT NULL DEFAULT '',                 -- Unique ID for this form (group of these fields)
-  field_name TINYTEXT NOT NULL DEFAULT '',      -- Field reference name
-  field_prompt TINYTEXT NOT NULL DEFAULT '',    -- Prompt to display on form to user
-  field_type TINYTEXT NOT NULL DEFAULT '',      -- Field Type
-  field_order SMALLINT NOT NULL DEFAULT 0,      -- Order for Field
-  required BOOLEAN NOT NULL DEFAULT '0',        -- If the field is required.
-  PRIMARY KEY (id),
-  INDEX (field_name(40))
-);
-
-----
-
--- Data Table
-CREATE TABLE {prefix}custom_field_data (
-  id INT NOT NULL AUTO_INCREMENT,
-  fid TEXT NOT NULL DEFAULT '',                     -- Form ID
-  field_id INT NOT NULL DEFAULT 0,                  -- Pointer to ID of field in custom_fields table
-  record_id INT NOT NULL DEFAULT 0,                 -- id for this submission of this form
-  text_data TEXT NOT NULL DEFAULT '',               -- Data for a text field
-  checkbox_data BOOLEAN NOT NULL DEFAULT false,     -- Data for a boolean field
-  integer_data INTEGER NOT NULL DEFAULT 0,          -- Data for an integer field
-  float_data FLOAT NOT NULL DEFAULT '0.00',         -- Data for a float field
-  PRIMARY KEY (id),
-  INDEX (fid(30)),
-  INDEX (field_id),
-  INDEX (record_id)
-);
-
-----
-
--- Picklist Field Options
-CREATE TABLE {prefix}custom_field_options (
-  id INT NOT NULL AUTO_INCREMENT,
-  field_id INT NOT NULL DEFAULT 0,                  -- Pointer to ID of fields in custom_fields table
-  option_text TINYTEXT NOT NULL DEFAULT '',         -- Option's Displayed text
-  option_value TINYTEXT NOT NULL DEFAULT '',        -- Option's value
-  option_cost FLOAT NOT NULL DEFAULT '0.00',        -- A cost added when this option is selected
-  option_default BOOLEAN NOT NULL DEFAULT false,    -- Flag indicating that this option is the default
-  PRIMARY KEY (id),
-  INDEX (field_id)
-);
diff --git a/setup/databaseScripts/create_database_V1.0.4.sql b/setup/databaseScripts/create_database_V1.0.4.sql
new file mode 100644 (file)
index 0000000..8fd0cf6
--- /dev/null
@@ -0,0 +1,59 @@
+-- Gaslight Media Members Database - Custom Fields Add-On
+-- File Created: 2017-03-27
+-- Database Version: 1.0.2
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most recent database version for this add-on.
+--
+-- There should only be one such file in this directory
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+
+-- Field Setup Table
+CREATE TABLE {prefix}custom_fields (
+  id INT NOT NULL AUTO_INCREMENT,
+  fid TEXT NOT NULL DEFAULT '',                     -- Unique ID for this form (group of these fields)
+  field_name TINYTEXT NOT NULL DEFAULT '',          -- Field reference name
+  field_prompt TINYTEXT NOT NULL DEFAULT '',        -- Prompt to display on form to user
+  field_type TINYTEXT NOT NULL DEFAULT '',          -- Field Type
+  field_order SMALLINT NOT NULL DEFAULT 0,          -- Order for Field
+  priority_display BOOLEAN NOT NULL DEFAULT false,  -- Flag to display field in limited results 
+  required BOOLEAN NOT NULL DEFAULT '0',            -- If the field is required.
+  PRIMARY KEY (id),
+  INDEX (field_name(40))
+);
+
+----
+
+-- Data Table
+CREATE TABLE {prefix}custom_field_data (
+  id INT NOT NULL AUTO_INCREMENT,
+  fid TEXT NOT NULL DEFAULT '',                     -- Form ID
+  field_id INT NOT NULL DEFAULT 0,                  -- Pointer to ID of field in custom_fields table
+  record_id INT NOT NULL DEFAULT 0,                 -- id for this submission of this form
+  text_data TEXT NOT NULL DEFAULT '',               -- Data for a text field
+  checkbox_data BOOLEAN NOT NULL DEFAULT false,     -- Data for a boolean field
+  integer_data INTEGER NOT NULL DEFAULT 0,          -- Data for an integer field
+  float_data FLOAT NOT NULL DEFAULT '0.00',         -- Data for a float field
+  PRIMARY KEY (id),
+  INDEX (fid(30)),
+  INDEX (field_id),
+  INDEX (record_id)
+);
+
+----
+
+-- Picklist Field Options
+CREATE TABLE {prefix}custom_field_options (
+  id INT NOT NULL AUTO_INCREMENT,
+  field_id INT NOT NULL DEFAULT 0,                  -- Pointer to ID of fields in custom_fields table
+  option_text TINYTEXT NOT NULL DEFAULT '',         -- Option's Displayed text
+  option_value TINYTEXT NOT NULL DEFAULT '',        -- Option's value
+  option_cost FLOAT NOT NULL DEFAULT '0.00',        -- A cost added when this option is selected
+  option_default BOOLEAN NOT NULL DEFAULT false,    -- Flag indicating that this option is the default
+  PRIMARY KEY (id),
+  INDEX (field_id)
+);
index 2c04b30..83882ec 100644 (file)
@@ -17,6 +17,7 @@ $glmMembersCustomFieldsDbVersions = array(
     '1.0.0' => array('version' => '1.0.0', 'tables' => 2, 'date' => '12/01/2017'),
     '1.0.1' => array('version' => '1.0.1', 'tables' => 2, 'date' => '12/05/2017'),
     '1.0.2' => array('version' => '1.0.2', 'tables' => 3, 'date' => '12/15/2017'),
-    '1.0.3' => array('version' => '1.0.3', 'tables' => 3, 'date' => '12/18/2017')
+    '1.0.3' => array('version' => '1.0.3', 'tables' => 3, 'date' => '12/18/2017'),
+    '1.0.4' => array('version' => '1.0.4', 'tables' => 3, 'date' => '12/19/2017')
 );
 
diff --git a/setup/databaseScripts/update_database_V1.0.4.sql b/setup/databaseScripts/update_database_V1.0.4.sql
new file mode 100644 (file)
index 0000000..34527a0
--- /dev/null
@@ -0,0 +1,10 @@
+-- Gaslight Media Members Database  - Custom Fields Add-On
+-- File Created: 08/30/16 09:47:15
+-- Database Version: 1.0.1
+-- Database Update From Previous Version Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+ALTER TABLE {prefix}custom_fields ADD COLUMN priority_display BOOLEAN;
+
index 1fcf1d9..a657777 100644 (file)
                 </select>
             </td>
         </tr>
+        <tr>
+            <th style="width: 20%; white-space: nowrap;">Important Field:</th>
+            <td>
+                <input id="{$fid}_NewFieldPriorityDisplay" type="checkbox" name="priority_display">
+                Display when limited output is selected.
+            </td>
+        </tr>
         <tr>
             <th style="width: 20%; white-space: nowrap;">Required:</th>
             <td><input id="{$fid}_NewFieldRequired" type="checkbox" name="required"></td>
index 1deba44..6bd2fe8 100644 (file)
@@ -30,7 +30,9 @@
                                 <select id="glmCustomFormField_{$field.id}" type="checkbox" name="glmCustomFormField_{$field.id}">
                                     <option value=""></option>
       {foreach $field.options as $option} 
-                                    <option value="{$option.option_value}" {if $option.option_value.option_defaut}selected{/if}>&nbsp;&nbsp;{$option.option_text}
+                                    <option value="{$option.option_value}" {if $option.option_default.value}selected{/if}>
+                                        {$option.option_cost}{if $option.option_cost>0}{$option.option_cost}{/if}&nbsp;&nbsp;{$option.option_text}
+                                    </option>
       {/foreach}                              
                                 </select>
                             </div>