adding required field checkbox option in the mgmt view file when adding custom fields.
adjusted the index file, db versions, update and create db scripts
'required' => true,
'use' => 'a'
),
-
+ // required field
+ 'required' => array(
+ 'field' => 'required',
+ 'type' => 'checkbox',
+ 'default' => false,
+ 'use' => 'a'
+ ),
// admin_search flag
'admin_search' => array (
'field' => 'admin_search',
* version from this plugin.
*/
define('GLM_MEMBERS_FIELDS_PLUGIN_VERSION', '1.0.3');
-define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.3');
+define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.4');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
define('GLM_MEMBERS_FIELDS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
+++ /dev/null
--- Gaslight Media Members Database - Fields Add-On
--- File Created: 2017-03-27
--- Database Version: 0.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,
- field_name TINYTEXT NOT NULL DEFAULT '', -- Field Name
- field_type TINYTEXT NOT NULL DEFAULT '', -- Field Type
- field_order SMALLINT NOT NULL DEFAULT 0, -- Order for Field
- admin_search BOOLEAN NOT NULL DEFAULT '0', -- If the field is added to member list filters.
- PRIMARY KEY (id),
- INDEX(field_name(20))
-);
-
-----
-
--- Data Table
-CREATE TABLE {prefix}custom_field_data (
- id INT NOT NULL AUTO_INCREMENT,
- field_id INT NOT NULL DEFAULT 0, -- Field Id
- ref_dest INT NOT NULL DEFAULT 0, -- Member Info Id
- field_data TEXT NOT NULL DEFAULT '', -- Data for the field
- PRIMARY KEY (id),
- INDEX(field_id),
- INDEX(ref_dest)
-);
--- /dev/null
+-- Gaslight Media Members Database - Fields Add-On
+-- File Created: 2017-03-27
+-- Database Version: 0.0.4
+-- 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,
+ field_name TINYTEXT NOT NULL DEFAULT '', -- Field Name
+ field_type TINYTEXT NOT NULL DEFAULT '', -- Field Type
+ field_order SMALLINT NOT NULL DEFAULT 0, -- Order for Field
+ admin_search BOOLEAN NOT NULL DEFAULT '0', -- If the field is added to member list filters.
+ required BOOLEAN NOT NULL DEFAULT '0', -- If the field is arequired.
+ PRIMARY KEY (id),
+ INDEX(field_name(20))
+);
+
+----
+
+-- Data Table
+CREATE TABLE {prefix}custom_field_data (
+ id INT NOT NULL AUTO_INCREMENT,
+ field_id INT NOT NULL DEFAULT 0, -- Field Id
+ ref_dest INT NOT NULL DEFAULT 0, -- Member Info Id
+ field_data TEXT NOT NULL DEFAULT '', -- Data for the field
+ PRIMARY KEY (id),
+ INDEX(field_id),
+ INDEX(ref_dest)
+);
'0.0.1' => array('version' => '0.0.1', 'tables' => 2, 'date' => '03/27/2017'),
'0.0.2' => array('version' => '0.0.2', 'tables' => 2, 'date' => '04/14/2017'),
'0.0.3' => array('version' => '0.0.3', 'tables' => 2, 'date' => '04/24/2017'),
+ '0.0.4' => array('version' => '0.0.4', 'tables' => 2, 'date' => '10/18/2017'),
);
--- /dev/null
+-- Gaslit Media Members Database
+-- File Created: 2017-04-14
+-- Database Version: 0.0.4
+-- 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 required BOOLEAN DEFAULT '0';
(text or checkbox only)
</td>
</tr>
+ <tr>
+ <th>Required?</th>
+ <td>
+ <input type="hidden" name="required" value="0" />
+ <input type="checkbox" name="required" value="1" />
+ </td>
+ </tr>
</table>
<p><span class="glm-required">*</span> Required</p>
<a id="newFieldCancel" class="button button-primary glm-right">Cancel</a>