New management option for michigan.org required fields.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 22 Oct 2018 12:35:41 +0000 (08:35 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 22 Oct 2018 12:35:41 +0000 (08:35 -0400)
Require the Contact Email and phone fields.

classes/data/dataEvents.php
classes/data/dataManagement.php
index.php
models/admin/events/list.php
setup/databaseScripts/create_database_V0.1.10.sql [new file with mode: 0644]
setup/databaseScripts/create_database_V0.1.9.sql [deleted file]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.1.10.sql [new file with mode: 0644]
views/admin/events/editStatus.html
views/admin/management/events.html

index e02d162..bd213e6 100644 (file)
@@ -353,14 +353,14 @@ class GlmDataEvents extends GlmDataAbstract
             // Contact email
             'contact_email' => array (
                 'field' => 'contact_email',
-                'type' => 'text',
+                'type' => 'email',
                 'use' => 'a'
             ),
 
             // Contact Phone
             'contact_phone' => array (
                 'field' => 'contact_phone',
-                'type' => 'text',
+                'type' => 'phone',
                 'use' => 'a'
             ),
 
@@ -458,7 +458,7 @@ class GlmDataEvents extends GlmDataAbstract
             // Admin Contact E-Mail Name
             'admin_email' => array (
                 'field' => 'admin_email',
-                'type' => 'text',
+                'type' => 'email',
                 'required' => false,
                 'use' => 'a'
             ),
index d3c8d97..2fd5ca3 100644 (file)
@@ -271,6 +271,14 @@ class GlmDataEventsManagement extends GlmDataAbstract
                 'use'     => 'a'
             ),
 
+            // Turn on required fields for Michigan.org
+            'michigan_org_requirements' => array(
+                'field'   => 'michigan_org_requirements',
+                'type'    => 'checkbox',
+                'default' => false,
+                'use'     => 'a'
+            ),
+
             // Default view file for agenda views
             'default_agenda_view' => array (
                 'field'      => 'default_agenda_view',
index f4b3975..cb9892e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@ if (!defined('ABSPATH')) {
  *  version from this plugin.
  */
 define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.7.2');
-define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.9');
+define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.10');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_EVENTS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.9.15');
index 4b77c35..63597c4 100644 (file)
@@ -152,6 +152,11 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
 
         // Check if there's a logged in user who is locked to their own entity
         $lockedToMember = apply_filters('glm_members_locked_to_member_id', false);
+        // Check config for michigan_org_requirements
+        if ( $this->config['settings']['michigan_org_requirements'] ) {
+            $this->fields['contact_phone']['required'] = true;
+            $this->fields['contact_email']['required'] = true;
+        }
         if ($lockedToMember) {
             $isModerated = apply_filters('glm_user_is_moderated', $lockedToMember);
             // Also need to check if the setting for member event moderated is on
diff --git a/setup/databaseScripts/create_database_V0.1.10.sql b/setup/databaseScripts/create_database_V0.1.10.sql
new file mode 100644 (file)
index 0000000..058bc91
--- /dev/null
@@ -0,0 +1,292 @@
+-- Gaslight Media Members Database - Events Add-On
+-- File Created: 08/18/17
+-- Database Version: 0.1.10
+-- 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
+
+
+-- Amenities
+CREATE TABLE {prefix}amenities (
+    id INT NOT NULL AUTO_INCREMENT,
+    active TINYINT(1) NULL,                   -- Amenity is active flag
+    name TINYTEXT NULL,                       -- Name of amenity
+    descr TEXT NULL,                          -- Description of amenity
+    short_descr TINYTEXT NULL,                -- Short description of amenity
+    uses_value BOOLEAN NULL,                  -- Flag indicating whether the amenity requires a quantity number
+    PRIMARY KEY (id),
+    INDEX(name(20))
+);
+
+----
+
+-- Amenity Reference - Links a specific amenity to a specific entity of type ref_type
+CREATE TABLE {prefix}amenity_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    amenity INT NULL,
+    event INT NULL,
+    PRIMARY KEY (id),
+    INDEX(event)
+);
+
+----
+
+-- groups
+CREATE TABLE {prefix}amenity_groups (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NULL,                     -- Name of the Group
+    PRIMARY KEY (id),
+    INDEX(name(20))
+);
+
+----
+
+-- Amenity Group - Links a specific amenity to groups
+CREATE TABLE {prefix}grouped_amenities (
+    id INT NOT NULL AUTO_INCREMENT,
+    group_id INT,                              -- Pointer to the group
+    amenity_id INT,                            -- Pointer to the Amenity
+    searchable BOOLEAN DEFAULT '0',         -- Flag indicating whether the amenity group will show in the search form
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Categories - Categories for events
+CREATE TABLE {prefix}categories (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NULL,                                   -- Name of event category
+    descr TINYTEXT NULL,                                  -- Description of this category
+    parent INT NULL,                                      -- Parent category, null or 0 if this is a top level category
+    PRIMARY KEY (id),
+    INDEX(parent)
+);
+
+----
+
+-- Event-Category - Categories for specific event records
+CREATE TABLE {prefix}event_categories (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                       -- Pointer to the event
+    category INT NULL,                                    -- Pointer to the category
+    PRIMARY KEY (id),
+    INDEX(event),
+    INDEX(category)
+);
+
+----
+
+-- Event Recurrence - Defines how an event recurs
+CREATE TABLE {prefix}recurrences (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INTEGER NULL,                                   -- Pointer to event
+    name TINYTEXT NULL,                                   -- Name of this recurrence schedule - used on admin calendar
+    start_time TIME NULL,                                 -- Start time of day for event
+    start_time_only BOOLEAN NULL,                         -- Use end of first occurrence flag
+    end_time TIME NULL,                                   -- End time of day for event - If less than start time, assume a date boundry
+    all_day BOOLEAN NULL,                                 -- Flag indicating if this is an all-day event (informational only)
+    start_date DATE NULL,                                 -- Starting Date (if all_day is selected) Used instead of start_time
+    from_date DATE NULL,                                  -- From Date for recurrences
+    to_date DATE NULL,                                    -- To Date for recurrences
+    recurring BOOLEAN NULL,                               -- Flag indicating that event recurs on a schedule rather than all dates
+    month_of_year SMALLINT UNSIGNED NULL,                 -- Month of year (bitmap)
+    week_of_month TINYINT UNSIGNED NULL,                  -- Week of the month (bitmap)
+    day_of_week TINYINT UNSIGNED NULL,                    -- Day of the week (bitmap)
+    by_day_of_month BOOLEAN NULL,                         -- Flag indicating if selecting by days of the month
+    day_of_month INTEGER UNSIGNED NULL,                   -- Day of the month (bitmap)
+    last_day_of_month BOOLEAN NULL,                       -- Last day of the month
+    specific_dates TEXT NULL,                             -- Serialized array of specific dates added to the recurrence
+    holiday INT NULL,                                     -- Pointer to holidays list (for future development)
+    holiday_offset TINYINT,                               -- Offset from holiday (from -128 to +127 days)
+    PRIMARY KEY (id),
+    INDEX(event)
+);
+
+----
+
+-- Times - List of actual event times for single and recurring events
+CREATE TABLE {prefix}times (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                       -- Pointer to the primary record for the event
+    custom_event INT NULL,                                -- Pointer to a customized copy of the event record (if set)
+    recur_id INT NULL,                                    -- Pointer to recurrence entry
+    active BOOLEAN NULL,                                  -- Active flag - normally set but used to temporarily disable a specific date
+    start_time DATETIME NULL,                             -- Date and time event starts
+    end_time DATETIME NULL,                               -- Date and time event ends
+    all_day BOOLEAN NULL,                                 -- All Day flag
+    PRIMARY KEY (id),
+    INDEX(event),
+    INDEX(start_time),
+    INDEX(end_time)
+);
+
+----
+
+-- Locations - Locations for event - If there's no location pointing to an event try to use the referenced entity in events table
+CREATE TABLE {prefix}locations (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                       -- Pointer to the primary or custom event record
+    name TINYTEXT NULL,                                   -- Name of location
+    address TINYTEXT NULL,                                -- Street Address
+    city INT NULL,                                        -- Pointer to city - references main plugin city table
+    state TINYTEXT NULL,                                  -- Two character state abbreviation
+    zip TINYTEXT NULL,                                    -- ZIP/Postal code
+    country TINYTEXT NULL,                                -- Country Code
+    lat FLOAT NULL,                                       -- Latitude of location
+    lon FLOAT NULL,                                       -- Longitude of location
+    region INT NULL,                                      -- Pointer to Region - references main plugin region table
+    phone TINYTEXT NULL,                                  -- Location Phone #
+    url TINYTEXT NULL,                                    -- Location URL
+    email TINYTEXT NULL,                                  -- Location E-Mail Address
+    contact_addon_id INT NULL,                            -- ID of Contact from contact add-on (optional and if available)
+    contact_fname TINYTEXT NULL,                          -- Contact first name for this location (optional)
+    contact_lname TINYTEXT NULL,                          -- Contact last name for this location (optional)
+    contact_phone TINYTEXT NULL,                          -- Contact phone for this location (optional)
+    contact_email TINYTEXT NULL,                          -- Contact E-Mail address (optional)
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Events - Base event information - May also be entries here referenced by the "times" table for a custom date.
+CREATE TABLE {prefix}events (
+    id INT NOT NULL AUTO_INCREMENT,
+    status INT NULL,                                      -- Status for this event, see config['status']
+    custom_time INT NULL,                                 -- If this is a custom record for a specific instance (date) this points to that times table entry
+    root_event INT NULL,                                  -- Root event pointer if this is a custom record for a specific instance (date) (if custom_time is set)
+    created DATETIME NULL,                                -- Date/Time event was created or date custom event record was created if custom record
+    updated DATETIME NULL,                                -- Date/Time this event record was last updated
+    approved DATETIME NULL,                               -- Date/Ttime this event record was approved
+    ref_type INT NULL,                                    -- Type of entity this event is associated with - See config['ref_type']
+    ref_dest INT NULL,                                    -- Pointer to the specific entity of ref_type this event is associated with
+    hide_address BOOLEAN NULL,                            -- Option to hide address on front-end
+    featured BOOLEAN NULL,                                -- Option to mark as featured event
+    slideshow BOOLEAN NULL,                               -- Option to mark for use in slide show
+    major BOOLEAN NULL,                                   -- Option to mark as a major event
+    name TINYTEXT NULL,                                   -- Name of this event
+    name_slug TINYTEXT NULL,                              -- Slug for this event
+    header TINYTEXT NULL,                                 -- Header text for front-end display - NOT CURRENTLY USED
+    intro TINYTEXT NULL,                                  -- Intro text for front-end display
+    descr TEXT NULL,                                      -- Full description text
+    image TINYTEXT NULL,                                  -- Image file name
+    file1 TINYTEXT NULL,                                  -- File name for a single uploaded file #1
+    file1_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #1
+    file2 TINYTEXT NULL,                                  -- File name for a single uploaded file #2
+    file2_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #2
+    file3 TINYTEXT NULL,                                  -- File name for a single uploaded file #3
+    file3_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #3
+    url TINYTEXT NULL,                                    -- Event URL
+    ticket_url TINYTEXT NULL,                             -- Ticket URL
+    registration_url TINYTEXT NULL,                       -- Registration URL
+    cost TINYTEXT NULL,                                   -- Description of event cost
+    admin_ref_type INT NULL,                              -- Type of admin contact if using a member contact
+    admin_ref_dest INT NULL,                              -- Pointer to admin contact record if using a member contact
+    admin_name TINYTEXT NULL,                             -- Admin Contact Name if not using a member contact
+    admin_org TINYTEXT NULL,                              -- Admin Contact Organization if not using a member contact
+    admin_email TINYTEXT NULL,                            -- Admin Contact E-Mail if not using a member contact
+    admin_phone TINYTEXT NULL,                            -- Admin Contact Phone if not using a member contact
+    free BOOLEAN NULL,                                    -- Event is Free
+    contact_email TINYTEXT NULL,                          -- Contact E-mail address
+    contact_name TINYTEXT NULL,                           -- Contact name
+    contact_phone TINYTEXT NULL,                          -- Event Phone
+    use_member_location BOOLEAN NULL,                     -- Use location of the member (if provided) rather than location table data
+    other_ref_dest INT NULL,                              -- Set location of the event to another member
+    old_event_id INT NULL,                                -- ID of event from old site for reference
+    ical_uid TINYTEXT NULL,                               -- The ical UID for this event.
+    notes TEXT NULL,                                      -- Internal notes for this event
+    PRIMARY KEY (id),
+    INDEX(custom_time),
+    INDEX(root_event),
+    INDEX(ref_type),
+    INDEX(ref_dest),
+    INDEX(featured),
+    INDEX(slideshow),
+    INDEX(major)
+);
+
+----
+
+-- Event Management Settings
+CREATE TABLE {prefix}management (
+    id INT NOT NULL AUTO_INCREMENT,
+    canonical_event_page TINYTEXT NULL,                   -- Canonical page slug for event detail
+    pdf_logo TINYTEXT NULL,                               -- Image for the Top of the PDF
+    footer_text TINYTEXT NULL,                            -- Image for the Top of the PDF
+    to_email TINYTEXT NULL,                               -- Email address of the recipient
+    from_email TINYTEXT NULL,                             -- Email address of the sender
+    email_notification TEXT NULL,                         -- Email notification message
+    calendar_view TINYTEXT NULL,                          -- Default calendar view
+    event_default_state TINYTEXT NULL,                    -- Default calendar view
+    term_event_amenities_singular TINYTEXT NULL,          -- Singular term to use for event amenities
+    term_event_amenities_plural TINYTEXT NULL,            -- Plural term to use for event amenities
+    use_event_amenities BOOLEAN NULL,                     -- Whether amenities are used at all for events
+    use_venue_locations BOOLEAN NULL,                     -- To use Other members as the location of event
+    member_events_allowed BOOLEAN NULL,                   -- If members are allowed to add events.
+    member_events_moderated BOOLEAN DEFAULT '0',          -- If member edits are moderated.
+    ical_feed_image_size TINYTEXT NULL,                   -- Image size to use in iCal Feed
+    event_display_member_message BOOLEAN DEFAULT '0',     -- Boolean to show member message or not
+    event_member_message TEXT NULL,                       -- Member Message
+    event_add_button_color TINYTEXT NULL,                 -- Color of the search button
+    event_add_button_hidden BOOLEAN NULL,                 -- Option to hide the add event button
+    event_back_to_search_color TINYTEXT NULL,             -- Background Color of the search
+    default_agenda_view TINYTEXT NULL,                    -- Default view file for agenda views
+    agenda_date_background_color TINYTEXT NULL,           -- Background Color of the date
+    agenda_date_text_color TINYTEXT NULL,                 -- Text Color of the date
+    agenda_title_color TINYTEXT NULL,                     -- Color of the Event Title
+    agenda_container_background_color TINYTEXT NULL,      -- Event Container Background Color
+    agenda_container_border_color TINYTEXT NULL,          -- Event Container Border Color
+    agenda_view_max_width TINYTEXT NULL,                  -- Max Width of agenda view
+    detail_ext_links_same_window BOOLEAN DEFAULT '0',     -- Turn on to keep from adding target blank to detail page url's
+    michigan_org_requirements BOOLEAN DEFAULT '0',        -- Turn on required fields for Michigan.org
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Set default event management entry
+INSERT INTO {prefix}management
+    ( id, canonical_event_page, term_event_amenities_singular, term_event_amenities_plural, member_events_allowed, ical_feed_image_size, event_display_member_message, event_member_message, default_agenda_view )
+   VALUES
+    ( 1, 'event-detail', 'Amenity', 'Amenities', 1, 'large', 0, '', 'agenda')
+;
+
+----
+
+-- Event iCal Feed imports
+CREATE TABLE {prefix}feed_import (
+    id INT NOT NULL AUTO_INCREMENT,
+    feed_url TEXT NOT NULL,            -- The ical feed url to import
+    created DATETIME NULL,             -- The date this feed was created
+    updated DATETIME NULL,             -- Last time this feed was updated
+    duration INT NULL,                 -- The time it took to fetch the feed
+    events INT NULL,                   -- The number of events last fetched
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Event Email Notifications
+CREATE TABLE {prefix}email_notifications (
+    id INT NOT NULL AUTO_INCREMENT,
+    declined_message TEXT NULL,    -- Event declined message
+    approved_message TEXT NULL,    -- Event approved message
+    to_email TINYTEXT NULL,        -- To Email Address
+    from_email TINYTEXT NULL,      -- From Email Address
+    email_notification TEXT NULL,  -- Email notification message
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Set default event email settings
+INSERT INTO {prefix}email_notifications
+    ( id, declined_message, approved_message )
+   VALUES
+    ( 1, 'The Event parameters do not comply with our event guidelines.', 'Your event has been approved.' )
+;
diff --git a/setup/databaseScripts/create_database_V0.1.9.sql b/setup/databaseScripts/create_database_V0.1.9.sql
deleted file mode 100644 (file)
index 7d9bbaa..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
--- Gaslight Media Members Database - Events Add-On
--- File Created: 08/18/17
--- Database Version: 0.1.7
--- 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
-
-
--- Amenities
-CREATE TABLE {prefix}amenities (
-    id INT NOT NULL AUTO_INCREMENT,
-    active TINYINT(1) NULL,                   -- Amenity is active flag
-    name TINYTEXT NULL,                       -- Name of amenity
-    descr TEXT NULL,                          -- Description of amenity
-    short_descr TINYTEXT NULL,                -- Short description of amenity
-    uses_value BOOLEAN NULL,                  -- Flag indicating whether the amenity requires a quantity number
-    PRIMARY KEY (id),
-    INDEX(name(20))
-);
-
-----
-
--- Amenity Reference - Links a specific amenity to a specific entity of type ref_type
-CREATE TABLE {prefix}amenity_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    amenity INT NULL,
-    event INT NULL,
-    PRIMARY KEY (id),
-    INDEX(event)
-);
-
-----
-
--- groups
-CREATE TABLE {prefix}amenity_groups (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TINYTEXT NULL,                     -- Name of the Group
-    PRIMARY KEY (id),
-    INDEX(name(20))
-);
-
-----
-
--- Amenity Group - Links a specific amenity to groups
-CREATE TABLE {prefix}grouped_amenities (
-    id INT NOT NULL AUTO_INCREMENT,
-    group_id INT,                              -- Pointer to the group
-    amenity_id INT,                            -- Pointer to the Amenity
-    searchable BOOLEAN DEFAULT '0',         -- Flag indicating whether the amenity group will show in the search form
-    PRIMARY KEY (id)
-);
-
-----
-
--- Categories - Categories for events
-CREATE TABLE {prefix}categories (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TINYTEXT NULL,                                   -- Name of event category
-    descr TINYTEXT NULL,                                  -- Description of this category
-    parent INT NULL,                                      -- Parent category, null or 0 if this is a top level category
-    PRIMARY KEY (id),
-    INDEX(parent)
-);
-
-----
-
--- Event-Category - Categories for specific event records
-CREATE TABLE {prefix}event_categories (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                       -- Pointer to the event
-    category INT NULL,                                    -- Pointer to the category
-    PRIMARY KEY (id),
-    INDEX(event),
-    INDEX(category)
-);
-
-----
-
--- Event Recurrence - Defines how an event recurs
-CREATE TABLE {prefix}recurrences (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INTEGER NULL,                                   -- Pointer to event
-    name TINYTEXT NULL,                                   -- Name of this recurrence schedule - used on admin calendar
-    start_time TIME NULL,                                 -- Start time of day for event
-    start_time_only BOOLEAN NULL,                         -- Use end of first occurrence flag
-    end_time TIME NULL,                                   -- End time of day for event - If less than start time, assume a date boundry
-    all_day BOOLEAN NULL,                                 -- Flag indicating if this is an all-day event (informational only)
-    start_date DATE NULL,                                 -- Starting Date (if all_day is selected) Used instead of start_time
-    from_date DATE NULL,                                  -- From Date for recurrences
-    to_date DATE NULL,                                    -- To Date for recurrences
-    recurring BOOLEAN NULL,                               -- Flag indicating that event recurs on a schedule rather than all dates
-    month_of_year SMALLINT UNSIGNED NULL,                 -- Month of year (bitmap)
-    week_of_month TINYINT UNSIGNED NULL,                  -- Week of the month (bitmap)
-    day_of_week TINYINT UNSIGNED NULL,                    -- Day of the week (bitmap)
-    by_day_of_month BOOLEAN NULL,                         -- Flag indicating if selecting by days of the month
-    day_of_month INTEGER UNSIGNED NULL,                   -- Day of the month (bitmap)
-    last_day_of_month BOOLEAN NULL,                       -- Last day of the month
-    specific_dates TEXT NULL,                             -- Serialized array of specific dates added to the recurrence
-    holiday INT NULL,                                     -- Pointer to holidays list (for future development)
-    holiday_offset TINYINT,                               -- Offset from holiday (from -128 to +127 days)
-    PRIMARY KEY (id),
-    INDEX(event)
-);
-
-----
-
--- Times - List of actual event times for single and recurring events
-CREATE TABLE {prefix}times (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                       -- Pointer to the primary record for the event
-    custom_event INT NULL,                                -- Pointer to a customized copy of the event record (if set)
-    recur_id INT NULL,                                    -- Pointer to recurrence entry
-    active BOOLEAN NULL,                                  -- Active flag - normally set but used to temporarily disable a specific date
-    start_time DATETIME NULL,                             -- Date and time event starts
-    end_time DATETIME NULL,                               -- Date and time event ends
-    all_day BOOLEAN NULL,                                 -- All Day flag
-    PRIMARY KEY (id),
-    INDEX(event),
-    INDEX(start_time),
-    INDEX(end_time)
-);
-
-----
-
--- Locations - Locations for event - If there's no location pointing to an event try to use the referenced entity in events table
-CREATE TABLE {prefix}locations (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                       -- Pointer to the primary or custom event record
-    name TINYTEXT NULL,                                   -- Name of location
-    address TINYTEXT NULL,                                -- Street Address
-    city INT NULL,                                        -- Pointer to city - references main plugin city table
-    state TINYTEXT NULL,                                  -- Two character state abbreviation
-    zip TINYTEXT NULL,                                    -- ZIP/Postal code
-    country TINYTEXT NULL,                                -- Country Code
-    lat FLOAT NULL,                                       -- Latitude of location
-    lon FLOAT NULL,                                       -- Longitude of location
-    region INT NULL,                                      -- Pointer to Region - references main plugin region table
-    phone TINYTEXT NULL,                                  -- Location Phone #
-    url TINYTEXT NULL,                                    -- Location URL
-    email TINYTEXT NULL,                                  -- Location E-Mail Address
-    contact_addon_id INT NULL,                            -- ID of Contact from contact add-on (optional and if available)
-    contact_fname TINYTEXT NULL,                          -- Contact first name for this location (optional)
-    contact_lname TINYTEXT NULL,                          -- Contact last name for this location (optional)
-    contact_phone TINYTEXT NULL,                          -- Contact phone for this location (optional)
-    contact_email TINYTEXT NULL,                          -- Contact E-Mail address (optional)
-    PRIMARY KEY (id)
-);
-
-----
-
--- Events - Base event information - May also be entries here referenced by the "times" table for a custom date.
-CREATE TABLE {prefix}events (
-    id INT NOT NULL AUTO_INCREMENT,
-    status INT NULL,                                      -- Status for this event, see config['status']
-    custom_time INT NULL,                                 -- If this is a custom record for a specific instance (date) this points to that times table entry
-    root_event INT NULL,                                  -- Root event pointer if this is a custom record for a specific instance (date) (if custom_time is set)
-    created DATETIME NULL,                                -- Date/Time event was created or date custom event record was created if custom record
-    updated DATETIME NULL,                                -- Date/Time this event record was last updated
-    approved DATETIME NULL,                               -- Date/Ttime this event record was approved
-    ref_type INT NULL,                                    -- Type of entity this event is associated with - See config['ref_type']
-    ref_dest INT NULL,                                    -- Pointer to the specific entity of ref_type this event is associated with
-    hide_address BOOLEAN NULL,                            -- Option to hide address on front-end
-    featured BOOLEAN NULL,                                -- Option to mark as featured event
-    slideshow BOOLEAN NULL,                               -- Option to mark for use in slide show
-    major BOOLEAN NULL,                                   -- Option to mark as a major event
-    name TINYTEXT NULL,                                   -- Name of this event
-    name_slug TINYTEXT NULL,                              -- Slug for this event
-    header TINYTEXT NULL,                                 -- Header text for front-end display - NOT CURRENTLY USED
-    intro TINYTEXT NULL,                                  -- Intro text for front-end display
-    descr TEXT NULL,                                      -- Full description text
-    image TINYTEXT NULL,                                  -- Image file name
-    file1 TINYTEXT NULL,                                  -- File name for a single uploaded file #1
-    file1_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #1
-    file2 TINYTEXT NULL,                                  -- File name for a single uploaded file #2
-    file2_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #2
-    file3 TINYTEXT NULL,                                  -- File name for a single uploaded file #3
-    file3_descr TINYTEXT NULL,                            -- Description for file uploaded in field "file" #3
-    url TINYTEXT NULL,                                    -- Event URL
-    ticket_url TINYTEXT NULL,                             -- Ticket URL
-    registration_url TINYTEXT NULL,                       -- Registration URL
-    cost TINYTEXT NULL,                                   -- Description of event cost
-    admin_ref_type INT NULL,                              -- Type of admin contact if using a member contact
-    admin_ref_dest INT NULL,                              -- Pointer to admin contact record if using a member contact
-    admin_name TINYTEXT NULL,                             -- Admin Contact Name if not using a member contact
-    admin_org TINYTEXT NULL,                              -- Admin Contact Organization if not using a member contact
-    admin_email TINYTEXT NULL,                            -- Admin Contact E-Mail if not using a member contact
-    admin_phone TINYTEXT NULL,                            -- Admin Contact Phone if not using a member contact
-    free BOOLEAN NULL,                                    -- Event is Free
-    contact_email TINYTEXT NULL,                          -- Contact E-mail address
-    contact_name TINYTEXT NULL,                           -- Contact name
-    contact_phone TINYTEXT NULL,                          -- Event Phone
-    use_member_location BOOLEAN NULL,                     -- Use location of the member (if provided) rather than location table data
-    other_ref_dest INT NULL,                              -- Set location of the event to another member
-    old_event_id INT NULL,                                -- ID of event from old site for reference
-    ical_uid TINYTEXT NULL,                               -- The ical UID for this event.
-    notes TEXT NULL,                                      -- Internal notes for this event
-    PRIMARY KEY (id),
-    INDEX(custom_time),
-    INDEX(root_event),
-    INDEX(ref_type),
-    INDEX(ref_dest),
-    INDEX(featured),
-    INDEX(slideshow),
-    INDEX(major)
-);
-
-----
-
--- Event Management Settings
-CREATE TABLE {prefix}management (
-    id INT NOT NULL AUTO_INCREMENT,
-    canonical_event_page TINYTEXT NULL,                   -- Canonical page slug for event detail
-    pdf_logo TINYTEXT NULL,                               -- Image for the Top of the PDF
-    footer_text TINYTEXT NULL,                            -- Image for the Top of the PDF
-    to_email TINYTEXT NULL,                               -- Email address of the recipient
-    from_email TINYTEXT NULL,                             -- Email address of the sender
-    email_notification TEXT NULL,                         -- Email notification message
-    calendar_view TINYTEXT NULL,                          -- Default calendar view
-    event_default_state TINYTEXT NULL,                    -- Default calendar view
-    term_event_amenities_singular TINYTEXT NULL,          -- Singular term to use for event amenities
-    term_event_amenities_plural TINYTEXT NULL,            -- Plural term to use for event amenities
-    use_event_amenities BOOLEAN NULL,                     -- Whether amenities are used at all for events
-    use_venue_locations BOOLEAN NULL,                     -- To use Other members as the location of event
-    member_events_allowed BOOLEAN NULL,                   -- If members are allowed to add events.
-    member_events_moderated BOOLEAN DEFAULT '0',          -- If member edits are moderated.
-    ical_feed_image_size TINYTEXT NULL,                   -- Image size to use in iCal Feed
-    event_display_member_message BOOLEAN DEFAULT '0',     -- Boolean to show member message or not
-    event_member_message TEXT NULL,                       -- Member Message
-    event_add_button_color TINYTEXT NULL,                 -- Color of the search button
-    event_add_button_hidden BOOLEAN NULL,                 -- Option to hide the add event button
-    event_back_to_search_color TINYTEXT NULL,             -- Background Color of the search
-    default_agenda_view TINYTEXT NULL,                    -- Default view file for agenda views
-    agenda_date_background_color TINYTEXT NULL,           -- Background Color of the date
-    agenda_date_text_color TINYTEXT NULL,                 -- Text Color of the date
-    agenda_title_color TINYTEXT NULL,                     -- Color of the Event Title
-    agenda_container_background_color TINYTEXT NULL,      -- Event Container Background Color
-    agenda_container_border_color TINYTEXT NULL,          -- Event Container Border Color
-    agenda_view_max_width TINYTEXT NULL,                  -- Max Width of agenda view
-    detail_ext_links_same_window BOOLEAN DEFAULT '0',     -- Turn on to keep from adding target blank to detail page url's
-    PRIMARY KEY (id)
-);
-
-----
-
--- Set default event management entry
-INSERT INTO {prefix}management
-    ( id, canonical_event_page, term_event_amenities_singular, term_event_amenities_plural, member_events_allowed, ical_feed_image_size, event_display_member_message, event_member_message, default_agenda_view )
-   VALUES
-    ( 1, 'event-detail', 'Amenity', 'Amenities', 1, 'large', 0, '', 'agenda')
-;
-
-----
-
--- Event iCal Feed imports
-CREATE TABLE {prefix}feed_import (
-    id INT NOT NULL AUTO_INCREMENT,
-    feed_url TEXT NOT NULL,            -- The ical feed url to import
-    created DATETIME NULL,             -- The date this feed was created
-    updated DATETIME NULL,             -- Last time this feed was updated
-    duration INT NULL,                 -- The time it took to fetch the feed
-    events INT NULL,                   -- The number of events last fetched
-    PRIMARY KEY (id)
-);
-
-----
-
--- Event Email Notifications
-CREATE TABLE {prefix}email_notifications (
-    id INT NOT NULL AUTO_INCREMENT,
-    declined_message TEXT NULL,    -- Event declined message
-    approved_message TEXT NULL,    -- Event approved message
-    to_email TINYTEXT NULL,        -- To Email Address
-    from_email TINYTEXT NULL,      -- From Email Address
-    email_notification TEXT NULL,  -- Email notification message
-    PRIMARY KEY (id)
-);
-
-----
-
--- Set default event email settings
-INSERT INTO {prefix}email_notifications
-    ( id, declined_message, approved_message )
-   VALUES
-    ( 1, 'The Event parameters do not comply with our event guidelines.', 'Your event has been approved.' )
-;
index 4273488..23aa89d 100644 (file)
@@ -45,5 +45,6 @@ $glmMembersEventsDbVersions = array(
     '0.1.7' => array('version' => '0.1.7', 'tables' => 13, 'date' => '09/14/2018'),
     '0.1.8' => array('version' => '0.1.8', 'tables' => 13, 'date' => '10/09/2018'),
     '0.1.9' => array('version' => '0.1.9', 'tables' => 13, 'date' => '10/11/2018'),
+    '0.1.10' => array('version' => '0.1.10', 'tables' => 13, 'date' => '10/19/2018'),
 );
 
diff --git a/setup/databaseScripts/update_database_V0.1.10.sql b/setup/databaseScripts/update_database_V0.1.10.sql
new file mode 100644 (file)
index 0000000..dd1fd25
--- /dev/null
@@ -0,0 +1,9 @@
+-- Gaslight Media Members Database  - Events Add-On
+-- File Created: 10/19/18
+-- Database Version: 0.1.10
+-- 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}management ADD COLUMN michigan_org_requirements BOOLEAN NULL; -- Turn on required fields for Michigan.org
index 57fd231..02ddeda 100644 (file)
@@ -1,37 +1,37 @@
+{* Status and Description *}
 
-<!-- Status and Description -->
-    {if $lockedToMember}
-    <input type="hidden" name="featured" value="{if $event.fieldData.featured.value}1{else}0{/if}">
-    <input type="hidden" name="slideshow" value="{if $event.fieldData.slideshow.value}1{else}0{/if}">
-        {if $isModerated}
-            <input type="hidden" name="status" value="20">
-        {/if}
+{if $lockedToMember}
+<input type="hidden" name="featured" value="{if $event.fieldData.featured.value}1{else}0{/if}">
+<input type="hidden" name="slideshow" value="{if $event.fieldData.slideshow.value}1{else}0{/if}">
+    {if $isModerated}
+        <input type="hidden" name="status" value="20">
     {/if}
+{/if}
 
-    <table id="glm-table-descr" class="glm-admin-table glm-event-table{if $currentTab != 'glm-table-descr'} glm-hidden{/if}">
+<table id="glm-table-descr" class="glm-admin-table glm-event-table{if $currentTab != 'glm-table-descr'} glm-hidden{/if}">
 
-        <tr>
-            <th {if $event.fieldRequired.name}class="glm-required"{/if}>Event Name:</th>
-            <td {if $event.fieldFail.name}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="name" value="{$event.fieldData.name|escape}" class="glm-form-text-input-medium" placeholder="Name of this event.">
-                {if $event.fieldFail.name}<p>{$event.fieldFail.name}</p>{/if}<br>
-            </td>
-        </tr>
+    <tr>
+        <th {if $event.fieldRequired.name}class="glm-required"{/if}>Event Name:</th>
+        <td {if $event.fieldFail.name}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+            <input type="text" name="name" value="{$event.fieldData.name|escape}" class="glm-form-text-input-medium" placeholder="Name of this event.">
+            {if $event.fieldFail.name}<p>{$event.fieldFail.name}</p>{/if}<br>
+        </td>
+    </tr>
     {if apply_filters('glm-member-db-common-members-enabled', false)}
         {if $event.fieldData.ref_dest.list|@count > 1}
             <tr>
                 <th>{$terms.term_member_cap}:</th>
                 <td>
-            {if $haveMember}
+                {if $haveMember}
                     <input type="hidden" name="ref_dest" value="{$memberData.id}">
                     {$memberData.name}
-            {else}
+                {else}
                     <select id="memberSelect" name="ref_dest">
-                            {foreach $event.fieldData.ref_dest.list as $v}
-                                <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
-                            {/foreach}
+                        {foreach $event.fieldData.ref_dest.list as $v}
+                            <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
+                        {/foreach}
                     </select>
-            {/if}
+                {/if}
                 </td>
             </tr>
         {else}
@@ -44,7 +44,7 @@
             <input type="hidden" name="ref_dest" value="0">
         {/if}
     {/if}
-{if $haveEvent}
+    {if $haveEvent}
         <tr>
             <th>Name for URLs:</th>
             <td>{$event.fieldData.name_slug}</td>
             <th>Last Approved:</th>
             <td>{$event.fieldData.approved.datetime}</td>
         </tr>
-{/if}
-        {if !$isModerated}
+    {/if}
+    {if !$isModerated}
         <tr>
             <th>Status:</th>
             <td>
                 <select name="status">
-    {foreach $event.fieldData.status.list as $v}
+                    {foreach $event.fieldData.status.list as $v}
                     <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
-    {/foreach}
+                    {/foreach}
                 </select>
                 {if $event.fieldFail.status}<p>{$event.fieldFail.status}</p>{/if}
             </td>
         </tr>
-        {/if}
-
-        {if !$lockedToMember}
-            <tr>
-                <th>Options:</th>
-                <td>
-                    <input type="checkbox" name="featured" {if $event.fieldData.featured.value} checked{/if}>&nbsp;Featured Event&nbsp;&nbsp;
-                    <input type="checkbox" name="slideshow" {if $event.fieldData.slideshow.value} checked{/if}>&nbsp;Include in Slideshow&nbsp;&nbsp;
-                    <!-- <input type="checkbox" name="major" {if $event.fieldData.major.value} checked{/if}>&nbsp;Major Event -->
-                </td>
-            </tr>
-        {/if}
+    {/if}
 
+    {if !$lockedToMember}
         <tr>
-            <th>Categories</th>
-            <td class="glm-item-container">
-                <div id="deniedReason" title="Event Declined Reason">
-                    <input id="deniedText" type="text" class="glm-form-text-input">
-                    <div style="color: red; display: none;"> Please Enter a Reason </div>
-                    <input style="margin-top: 35px;" id="deniedReasonSubmit" type="submit" value="Add Reason">
-                </div>
-                <input id="declinedMsg" type="hidden" name="deniedText">
-                <!--  Add new category dialog -->
+            <th>Options:</th>
+            <td>
+                <input type="checkbox" name="featured" {if $event.fieldData.featured.value} checked{/if}>&nbsp;Featured Event&nbsp;&nbsp;
+                <input type="checkbox" name="slideshow" {if $event.fieldData.slideshow.value} checked{/if}>&nbsp;Include in Slideshow&nbsp;&nbsp;
+                <!-- <input type="checkbox" name="major" {if $event.fieldData.major.value} checked{/if}>&nbsp;Major Event -->
+            </td>
+        </tr>
+    {/if}
+
+    <tr>
+        <th>Categories</th>
+        <td class="glm-item-container">
+            <div id="deniedReason" title="Event Declined Reason">
+                <input id="deniedText" type="text" class="glm-form-text-input">
+                <div style="color: red; display: none;"> Please Enter a Reason </div>
+                <input style="margin-top: 35px;" id="deniedReasonSubmit" type="submit" value="Add Reason">
+            </div>
+            <input id="declinedMsg" type="hidden" name="deniedText">
+            {* Add new category dialog *}
 
-                <div id="newCategoryButton" class="button button-secondary glm-right">Add a new Category</div>
-                <div id="newCategoryDialog" class="glm-dialog-box" title="Enter a New Category">
-                        <table class="glm-admin-table">
-                            <tr>
-                                <th class="glm-required">Category Name:</th>
-                                <td id="newCatNameTD">
-                                    <input id="newCatName" type="text" name="newCatName" class="glm-form-text-input">
-                                    <div id="newCatNameRequired"></div>
-                                </td>
-                            </tr>
-                            <tr>
-                                <th>Parent Category:</th>
-                                <td>
-                                    <select id="newCatParent" name="newCatParent">
-                        {if $categories}
-                                        <option value=""></option>
-                            {foreach $categories as $t}
-                                {if !$t.parent} <!-- don't show child categories -->
-                                        <option value="{$t.id}" data-parent="{$t.name}">{$t.name}</option>
+            <div id="newCategoryButton" class="button button-secondary glm-right">Add a new Category</div>
+            <div id="newCategoryDialog" class="glm-dialog-box" title="Enter a New Category">
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th class="glm-required">Category Name:</th>
+                            <td id="newCatNameTD">
+                                <input id="newCatName" type="text" name="newCatName" class="glm-form-text-input">
+                                <div id="newCatNameRequired"></div>
+                            </td>
+                        </tr>
+                        <tr>
+                            <th>Parent Category:</th>
+                            <td>
+                                <select id="newCatParent" name="newCatParent">
+                                {if $categories}
+                                    <option value=""></option>
+                                    {foreach $categories as $t}
+                                        {* don't show child categories *}
+                                        {if !$t.parent}
+                                            <option value="{$t.id}" data-parent="{$t.name}">{$t.name}</option>
+                                        {/if}
+                                    {/foreach}
                                 {/if}
-                            {/foreach}
-                        {/if}
-                                    </select>
-                                    <br>OR<br>
-                                    <input id="newCatParentName" type="text" name="newCatParentName" placeholder="Enter a new parent name.">
-                                </td>
-                            </tr>
-                        </table>
-                        <p><span class="glm-required">*</span> Required</p>
-                        <a id="newCategoryCancel" class="button button-primary glm-right">Cancel</a>
-                        <input id="newCategorySubmit" type="submit" value="Add new Category">
-                </div>
+                                </select>
+                                <br>OR<br>
+                                <input id="newCatParentName" type="text" name="newCatParentName" placeholder="Enter a new parent name.">
+                            </td>
+                        </tr>
+                    </table>
+                    <p><span class="glm-required">*</span> Required</p>
+                    <a id="newCategoryCancel" class="button button-primary glm-right">Cancel</a>
+                    <input id="newCategorySubmit" type="submit" value="Add new Category">
+            </div>
 
-                <!-- Category Selection -->
+            {* Category Selection *}
 
                 <select name="categorySelect" id="categorySelect">
                 {if $categories}
             <th>{$settings.term_event_amenities_plural}</th>
             <td class="glm-item-container">
 
-                <!--  Add new amenity dialog -->
+                {*  Add new amenity dialog *}
 
                 <div id="newAmenityButton" class="button button-secondary glm-right">Add a new {$settings.term_event_amenities_singular}</div>
                 <div id="newAmenityDialog" class="glm-dialog-box" title="Enter a New {$settings.term_event_amenities_singular}">
                     <input id="newAmenitySubmit" type="submit" value="Add new {$settings.term_event_amenities_singular}">
                 </div>
 
-                <!-- Amenity Selection -->
+                {* Amenity Selection *}
 
                 <select name="amenitySelect" id="amenitySelect">
                 {if $amenities}
             <th {if $event.fieldRequired.image}class="glm-required"{/if}>Image:</th>
             <td {if $event.fieldFail.image}class="glm-form-bad-input"{/if}>
                 <table class="glm-admin-image-edit-table">
-    {if $event.fieldData.image}
-                    <tr>
-                        <td>
-                            <div class="glm-galleryImage" data-id="image">
-                                <img src="{$glmPluginMediaUrl}/images/small/{$event.fieldData.image}">
-                            </div>
-                        </td>
-                        <td>
-                            <input type="checkbox" name="image_delete"> Delete Image<br>
-                            {$event.fieldData.image}<br>
-                        </td>
-                    </tr>
-    {/if}
+                    {if $event.fieldData.image}
+                        <tr>
+                            <td>
+                                <div class="glm-galleryImage" data-id="image">
+                                    <img src="{$glmPluginMediaUrl}/images/small/{$event.fieldData.image}">
+                                </div>
+                            </td>
+                            <td>
+                                <input type="checkbox" name="image_delete"> Delete Image<br>
+                                {$event.fieldData.image}<br>
+                            </td>
+                        </tr>
+                    {/if}
                     <tr><td colspan="2"><b>New image:</b> <input type="file" name="image_new"></td></tr>
                 </table>
                 <div id="glm-galleryImageLarger_image" class="glm-imageDialog">
                 </p>
             </td>
         </tr>
-<!--
-        <tr>
-            <th {if $event.fieldRequired.contact_phone}class="glm-required"{/if}>Event Phone #:</th>
-            <td {if $event.fieldFail.contact_phone}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="phone" value="{$event.fieldData.contact_phone}" class="glm-form-text-input-medium glm-phone-input" placeholder="ex: 123-123-1234">
-                {if $event.fieldFail.contact_phone}<p>{$event.fieldFail.contact_phone}</p>{/if}<br>
-            </td>
-        </tr>
--->
         <tr>
             <th {if $event.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
             <td {if $event.fieldFail.url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="url" value="{$event.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com">
+                <input type="url" name="url" value="{$event.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com">
                 {if $event.fieldFail.url}<p>{$event.fieldFail.url}</p>{/if}<br>
             </td>
         </tr>
         <tr>
             <th {if $event.fieldRequired.ticket_url}class="glm-required"{/if}>Ticketing Address (URL):</th>
             <td {if $event.fieldFail.ticket_url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="ticket_url" value="{$event.fieldData.ticket_url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com/ticketing/">
+                <input type="url" name="ticket_url" value="{$event.fieldData.ticket_url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com/ticketing/">
                 {if $event.fieldFail.ticket_url}<p>{$event.fieldFail.ticket_url}</p>{/if}<br>
             </td>
         </tr>
         <tr>
             <th {if $event.fieldRequired.registration_url}class="glm-required"{/if}>Registration (URL):</th>
             <td {if $event.fieldFail.registration_url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="registration_url" value="{$event.fieldData.registration_url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com/registrationing/">
+                <input type="url" name="registration_url" value="{$event.fieldData.registration_url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com/registrationing/">
                 {if $event.fieldFail.registration_url}<p>{$event.fieldFail.registration_url}</p>{/if}<br>
             </td>
         </tr>
-
-                            <tr>
-                                <th>Contact Name:</th>
-                                <td>
-                                    <input type="text" name="contact_name" value="{$event.fieldData.contact_name|escape}" class="glm-form-text-input-small">
-                                </td>
-                            </tr>
-                            <tr>
-                                <th>Contact Phone:</th>
-                                <td>
-                                    <input type="text" name="contact_phone" value="{$event.fieldData.contact_phone|escape}" class="glm-form-text-input-medium glm-phone-input">
-                                </td>
-                            </tr>
-                            <tr>
-                                <th>Contact Email:</th>
-                                <td>
-                                    <input type="text" name="contact_email" value="{$event.fieldData.contact_email|escape}" class="glm-form-text-input-medium">
-                                </td>
-                            </tr>
-
-
-
-                    <tr>
-                        <th>Free:</th>
-                        <td>
-                            <input type="checkbox" id="freeEventCheckbox" name="free" {if $event.fieldData.free.value} checked{/if}>
-                            Mark event as Free (no cost) and don't provide "Description of Cost:".
-                        </td>
-                    </tr>
-
+        {* BEGIN Event Contact Information *}
+        <tr>
+            <th {if $event.fieldRequired.contact_name}class="glm-required"{/if}>Contact Name:</th>
+            <td>
+                <input type="text" name="contact_name" value="{$event.fieldData.contact_name|escape}" class="glm-form-text-input-small">
+            </td>
+        </tr>
+        <tr>
+            <th {if $event.fieldRequired.contact_phone}class="glm-required"{/if}>Contact Phone:</th>
+            <td{if $event.fieldFail.contact_phone} class="glm-form-bad-input"{/if}>
+                <input type="text" name="contact_phone" value="{$event.fieldData.contact_phone|escape}" class="glm-form-text-input-medium glm-phone-input">
+                {if $event.fieldFail.contact_phone}<p>{$event.fieldFail.contact_phone}</p>{/if}<br>
+            </td>
+        </tr>
+        <tr>
+            <th {if $event.fieldRequired.contact_email}class="glm-required"{/if}>Contact Email:</th>
+            <td{if $event.fieldFail.contact_email} class="glm-form-bad-input"{/if}>
+                <input type="text" name="contact_email" value="{$event.fieldData.contact_email|escape}" class="glm-form-text-input-medium">
+                {if $event.fieldFail.contact_email}<p>{$event.fieldFail.contact_email}</p>{/if}<br>
+            </td>
+        </tr>
+        {* END Event Contact Information *}
+        <tr>
+            <th {if $event.fieldRequired.free}class="glm-required"{/if}>Free:</th>
+            <td>
+                <input type="checkbox" id="freeEventCheckbox" name="free" {if $event.fieldData.free.value} checked{/if}>
+                Mark event as Free (no cost) and don't provide "Description of Cost:".
+            </td>
+        </tr>
         <tr id="descriptionOfCostField" {if $event.fieldData.free.value}class="glm-hidden"{/if}>
             <th {if $event.fieldRequired.cost}class="glm-required"{/if}>Description of Cost:</th>
             <td {if $event.fieldFail.cost}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
index 0f5334d..41b7e81 100644 (file)
                                 </table>
                             </td>
                         </tr>
+                        <tr>
+                            <th>Admin Options</th>
+                            <td>
+                                <label> <input type="checkbox" name="michigan_org_requirements" {if $eventsSettings.fieldData.michigan_org_requirements.value}checked{/if}> Require Contact email and phone. (Michigan.org)</label><br><br>
+                            </td>
+                        </tr>
 
                         <tr>
                             <td> <h2> {$terms.term_member_cap} Message </h2> </td>