Various fixes and minor updates to locations, recurrences, and calendar
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 23 Mar 2016 17:09:49 +0000 (13:09 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 23 Mar 2016 17:09:49 +0000 (13:09 -0400)
13 files changed:
classes/data/dataLocations.php
classes/data/dataRecurrences.php
classes/data/dataTimes.php
index.php
models/admin/events/list.php
setup/databaseScripts/create_database_V0.0.4.sql [deleted file]
setup/databaseScripts/create_database_V0.0.7.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.6.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.7.sql [new file with mode: 0644]
views/admin/events/edit.html
views/admin/events/editLocation.html
views/admin/events/editSchedule.html

index cd7b9e6..1b4d90d 100644 (file)
@@ -241,11 +241,13 @@ class GlmDataEventsLocations extends GlmDataAbstract
             ),
 
             // Contact Reference Placeholder if no Contacts Add-On (see below)
+/* not currently in use
             'contact_addon_id' => array(
                 'field' => 'contact_addon_id',
                 'type' => 'integer',
                 'use' => 'a'
             ),
+*/
 
             /*
              * Using first and last name for compatibility with contacts add-on data
index 048febf..718d468 100644 (file)
@@ -130,23 +130,28 @@ class GlmDataEventsRecurrences extends GlmDataAbstract
                 'use' => 'a'
             ),
 
+            // Schedule Name
+            'name' => array(
+                'field' => 'name',
+                'type' => 'text',
+                'use' => 'a'
+            ),
+
             // Start Date & Time
             'start_time' => array (
                 'field' => 'start_time',
                 'type' => 'datetime',
-                'format' => 'm/d/Y H:i',
+                'format' => 'm/d/Y h:i a',
                 'required' => true,
                 'use' => 'a'
             ),
 
             // Start Date (for all-day events)
             'start_date' => array (
-                'field' => 'start_time',
-                'as' => 'start_date',
+                'field' => 'start_date',
                 'type' => 'date',
                 'default' => time(),
-                'required' => true,
-                'use' => 'negil'
+                'use' => 'a'
             ),
 
             // Start Time Only Flag
@@ -161,7 +166,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract
             'end_time' => array (
                 'field' => 'end_time',
                 'type' => 'datetime',
-                'format' => 'm/d/Y H:i',
+                'format' => 'm/d/Y h:i a',
                 'use' => 'a'
             ),
 
index 5640df8..4748ff5 100644 (file)
@@ -130,6 +130,17 @@ class GlmDataEventsTimes extends GlmDataAbstract
                 'use' => 'glei'
             ),
 
+            // Recurrence (schedule) Name
+            'recur_name' => array (
+                'field' => 'recur_id',
+                'as' => 'recur_name',
+                'type' => 'pointer',
+                    'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'recurrences',
+                    'p_field' => 'name',
+                    'p_static' => true,
+                'use' => 'gled'
+            ),
+
             // Event Name
             'event_name' => array (
                 'field' => 'event',
index 8b6b7e9..e05fa89 100644 (file)
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@
  *  version from this plugin.
  */
 define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.5');
+define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.7');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_EVENTS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.58');
index 666095b..784cc67 100644 (file)
@@ -328,10 +328,10 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
                         // first check if the event is an all-day event
                         if (isset($_REQUEST[$recurID.'_all_day'])) {
 
-                            // Then take the event date (date only) and stick it into the start time
-                            $red = explode(' ', $_REQUEST[$recurID.'_event_date']);
+                            // Then take the start date (date only) and stick it into the start time
+                            $red = explode(' ', $_REQUEST[$recurID.'_start_date']);
                             $_REQUEST[$recurID.'_start_time'] = $red[0]." 00:00";
-                            $_REQUEST[$recurID.'_end_time'] = $$red[0]." 00:00";
+                            $_REQUEST[$recurID.'_end_time'] = $red[0]." 00:00";
 
                         }
 
diff --git a/setup/databaseScripts/create_database_V0.0.4.sql b/setup/databaseScripts/create_database_V0.0.4.sql
deleted file mode 100644 (file)
index 9c511d1..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
--- Gaslight Media Members Database - Events Add-On
--- File Created: 12/02/15 15:27:15
--- Database Version: 0.0.1
--- 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
-
--- 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
-  start_time DATETIME NULL,                             -- Start of first occurrence (date and time)
-  start_time_only BOOLEAN NULL,                            -- Use end of first occurrence flag
-  end_time DATETIME NULL,                               -- End of first occurrence (date and time)
-  from_date DATE NULL,                                  -- From Date for recurrences
-  to_date DATE NULL,                                    -- To Date for recurrences
-  all_day BOOLEAN NULL,                                 -- Flag indicating if this is an all-day event (informational only)
-  all_dates BOOLEAN NULL,                               -- Flag indicating that event recurs on all dates from from_date through to_date
-  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
-  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 contact is associated with - See config['ref_type']
-  ref_dest INT NULL,                                    -- Pointer to the specific entity of ref_type this contact 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
-  url TINYTEXT NULL,                                    -- Event URL
-  ticket_url TINYTEXT NULL,                             -- Ticket 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
-  old_event_id INT NULL,                                -- ID of event from old site for reference
-  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
-  PRIMARY KEY (id)
-);
-
-----
-
--- Set default event management entry
-INSERT INTO {prefix}management
-    ( id, canonical_event_page )
-   VALUES
-    ( 1, 'event-detail' )
-;
-
diff --git a/setup/databaseScripts/create_database_V0.0.7.sql b/setup/databaseScripts/create_database_V0.0.7.sql
new file mode 100644 (file)
index 0000000..1196594
--- /dev/null
@@ -0,0 +1,168 @@
+-- Gaslight Media Members Database - Events Add-On
+-- File Created: 12/02/15 15:27:15
+-- Database Version: 0.0.1
+-- 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
+
+-- 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 DATETIME NULL,                             -- Start of first occurrence (date and time)
+  start_time_only BOOLEAN NULL,                         -- Use end of first occurrence flag
+  end_time DATETIME NULL,                               -- End of first occurrence (date and time)
+  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
+  all_dates BOOLEAN NULL,                               -- Flag indicating that event recurs on all dates from from_date through to_date
+  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
+  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 contact is associated with - See config['ref_type']
+  ref_dest INT NULL,                                    -- Pointer to the specific entity of ref_type this contact 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
+  url TINYTEXT NULL,                                    -- Event URL
+  ticket_url TINYTEXT NULL,                             -- Ticket 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
+  old_event_id INT NULL,                                -- ID of event from old site for reference
+  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
+  PRIMARY KEY (id)
+);
+
+----
+
+-- Set default event management entry
+INSERT INTO {prefix}management
+    ( id, canonical_event_page )
+   VALUES
+    ( 1, 'event-detail' )
+;
+
index ec69524..ceb9573 100644 (file)
@@ -18,6 +18,8 @@ $glmMembersEventsDbVersions = array(
     '0.0.2' => array('version' => '0.0.2', 'tables' => 7),
     '0.0.3' => array('version' => '0.0.3', 'tables' => 7),
     '0.0.4' => array('version' => '0.0.4', 'tables' => 7),
-    '0.0.5' => array('version' => '0.0.5', 'tables' => 7)
+    '0.0.5' => array('version' => '0.0.5', 'tables' => 7),
+    '0.0.6' => array('version' => '0.0.6', 'tables' => 7),
+    '0.0.7' => array('version' => '0.0.7', 'tables' => 7)
 );
 
diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..af1cb8a
--- /dev/null
@@ -0,0 +1,12 @@
+-- Gaslight Media Members Database  - Events Add-On
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 0.0.6
+-- 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 dashses
+
+
+-- Add use end time
+ALTER TABLE {prefix}recurrences ADD COLUMN name TINYTEXT;
+
diff --git a/setup/databaseScripts/update_database_V0.0.7.sql b/setup/databaseScripts/update_database_V0.0.7.sql
new file mode 100644 (file)
index 0000000..ef060ef
--- /dev/null
@@ -0,0 +1,12 @@
+-- Gaslight Media Members Database  - Events Add-On
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 0.0.6
+-- 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 dashses
+
+
+-- Add use end time
+ALTER TABLE {prefix}recurrences ADD COLUMN start_date DATE;
+
index 075ee80..f765bee 100644 (file)
             {$sep = ''}
             {foreach $times as $t}
                             {$sep}{
+                                title : '{$t.recur_name}',
                                 start : '{$t.start_time.datetime}',
                                 end   : '{$t.end_time.datetime}',
                                 allday : {$t.all_day.value}
             // New location ID's start at 0 (have "n" for "new" appended to them in the template)
             var newLocID = 0;
 
-
+            // Get location template and clear it from HTML so it doesn't get submitted
+            locTemplate = $('#addLocationTemplate').html();
+            $('#addLocationTemplate').html('');
+            
             // When adding a new location is requested
             $("#addLocation").click( function() {
                 addNewLocationForm();
                     numbLocations++;
                 }
 
-                locTemp = locTemp + $('#addLocationTemplate').html();
+                locTemp = locTemp + locTemplate;
                 locTemp = locTemp.replace(/{ newLocID }/g, 'n' + newLocID); // Include "n" to indicate "new"
 
                 // Append the new location form to the container
             // New recurrence ID's start at 0 (have "n" for "new" appended to them in the template)
             var newRecurID = 0;
 
+            // Get recurrence template and clear it from HTML so it doesn't get submitted
+            recurTemplate = $('#addRecurrenceTemplate').html();
+            $('#addRecurrenceTemplate').html('');
+            
             function addNewRecurrenceForm() {
 
                 // Tick the new recurrence ID counter and build new HTML from the addRecurrenceTemplate
                     numbRecurrences++;
                 }
 
-                recurTemp = recurTemp + $('#addRecurrenceTemplate').html();
+                recurTemp = recurTemp + recurTemplate;
                 recurTemp = recurTemp.replace(/{ newRecurID }/g, 'n' + newRecurID); // Include "n" to indicate "new"
 
                 // Append the new recurrence form to the container
 
                 // Date / Time Pickers
                 $('.glm-datetime-input').datetimepicker({
-                    format: 'm/d/Y H:i',
+                    format: 'm/d/Y h:i a',
                     lang: 'en',
                     step: 15,
-                    closeOnWithoutClick: true
+                    closeOnWithoutClick: true,
+                    pick12HourFormat: true,
+                    formatTime:'h:i a'
                 });
 
                 // Date Only Pickers
index 60278c9..097af02 100644 (file)
                 <!-- Location forms go here. -->
 {if $locations}
     {foreach $locations as $loc}
-                <tr class="location_{$r.id}"><td colspan="2"><hr></td></tr>
-                <tr id="location_{$loc.id}" data-id="{$loc.id}" class="location_{$r.id} location-form">
+                <tr class="location_{$loc.id}"><td colspan="2"><hr></td></tr>
+                <tr id="location_{$loc.id}" data-id="{$loc.id}" class="location_{$loc.id} location-form">
                     <td>
-                        <input type="hidden" name="locID[{$r.id}]" value="{$loc.id}">
+                        <input type="hidden" name="locID[{$loc.id}]" value="{$loc.id}">
                         <input type="hidden" name="{$loc.id}_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
                         <table width="100%">
                             <tr>
index 4e18847..15068bc 100644 (file)
                         <input type="hidden" name="{$r.id}_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
                         <input id="{$r.id}_recurUpdated" type="hidden" name="recurUpdated[{$r.id}]" value="0">
                         <table>
+                            <tr>
+                                <th>Schedule Name:</th>
+                                <td>
+                                    <input data-id="{$r.id}" type="text" name="{$r.id}_name" value="{$r.name}" class="glm-form-text-input-small recurrence-input">
+                                </td>
+                            </tr>
                             <tr><th colspan="2">First occurrence for this schedule</th></tr>
                             <tr>
                                 <th>All Day Event:</th>
@@ -48,7 +54,7 @@
                             <tr class="all-day-{$r.id}{if !$r.all_day.value} glm-hidden{/if}">
                                 <th>Event Date:</th>
                                 <td>
-                                    <input data-id="{$r.id}" type="text" name="{$r.id}_event_date" value="{$r.start_date.date}" class="glm-form-text-input-small glm-date-input recurrence-input" placeholder="Click to Select Date/Time">
+                                    <input data-id="{$r.id}" type="text" name="{$r.id}_start_date" value="{$r.start_date.date}" class="glm-form-text-input-small glm-date-input recurrence-input" placeholder="Click to Select Date/Time">
                                 </td>
                             </tr>
                             <tr><td colspan="2">&nbsp;</td></tr>
             <input type="hidden" name="recurID[{ newRecurID }]" value="{ newRecurID }">
             <input type="hidden" name="{ newRecurID }_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
             <table width="100%">
+                <tr>
+                    <th>Schedule Name:</th>
+                    <td>
+                        <input data-id="{ newRecurID }" type="text" name="{ newRecurID }_name" value="" class="glm-form-text-input-small recurrence-input">
+                    </td>
+                </tr>
                 <tr>
                     <th class="glm-notice">New Schedule</th>
                     <th>First ocurrence of event</th>
                     <th>Event Date:</th>
                     <td>
                         <!-- Note that _event_date gets translated to _start_time in the model if _all_day is selected -->
-                        <input type="text" name="{ newRecurID }_event_date" value="{$newRecurrence.fieldData.start_date.date}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time">
+                        <input type="text" name="{ newRecurID }_start_date" value="{$newRecurrence.fieldData.start_date.date}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time">
                     </td>
                 </tr>
                 <tr><td colspan="2">&nbsp;</td></tr>