From: Chuck Scott Date: Wed, 9 Mar 2016 20:53:44 +0000 (-0500) Subject: More admin enhancements to Events - First live data X-Git-Tag: v1.0.0^2~170^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=9fcfdc25cf7345014155a7564abe2f5ff5275151;p=WP-Plugins%2Fglm-member-db-events.git More admin enhancements to Events - First live data --- diff --git a/activate.php b/activate.php index 97ac9a9..bd0f669 100644 --- a/activate.php +++ b/activate.php @@ -84,15 +84,7 @@ class glmMembersEventsPluginActivate // Set Roles and Capabilities for this plugin require_once(GLM_MEMBERS_EVENTS_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php'); - wp_enqueue_script('jquery'); - wp_enqueue_script('jquery-style'); - wp_enqueue_script('jquery-ui-core'); - wp_enqueue_script('jquery-ui-dialog'); - wp_enqueue_script('jquery-ui-autocomplete'); - - // Jquery DatePicker - wp_enqueue_script('jquery-ui-datepicker'); - wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'); + } /* diff --git a/classes/data/dataRecurrences.php b/classes/data/dataRecurrences.php index 8fa8ff7..e3e6b22 100644 --- a/classes/data/dataRecurrences.php +++ b/classes/data/dataRecurrences.php @@ -134,6 +134,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract 'start_time' => array ( 'field' => 'start_time', 'type' => 'datetime', + 'format' => 'm/d/Y H:i', 'required' => true, 'use' => 'a' ), @@ -152,6 +153,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract 'end_time' => array ( 'field' => 'end_time', 'type' => 'datetime', + 'format' => 'm/d/Y H:i', 'use' => 'a' ), @@ -206,6 +208,14 @@ class GlmDataEventsRecurrences extends GlmDataAbstract 'use' => 'a' ), + // Select by Days of the Month Flag + 'by_day_of_month' => array ( + 'field' => 'by_day_of_month', + 'type' => 'checkbox', + 'default' => false, + 'use' => 'a' + ), + // Day of Month - multi-pick (bitmap) 'day_of_month' => array( 'field' => 'day_of_month', @@ -293,8 +303,8 @@ class GlmDataEventsRecurrences extends GlmDataAbstract if ($recurData && $recurData['event'] > 0) { $this->wpdb->query(" DELETE FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX ."events - WHERE root_event = $recurID - ;"); + WHERE root_event = ".$recurData['event']." + "); } // Otherwise don't delete times for the custom events @@ -352,41 +362,53 @@ class GlmDataEventsRecurrences extends GlmDataAbstract $fromYear = $from->format('Y'); $toYear = $to->format('Y'); + // Determine time each event starts at + $time = $start->format('H:i'); + // For each year in recurrence range for ($year = $fromYear ; $year <= $toYear ; $year++ ) { - // For each Month selected + // For each month selected foreach ($recurData['month_of_year']['names'] as $km=>$month) { - // For each week selected - foreach ($recurData['week_of_month']['names'] as $kw=>$week) { - - // For each day selected - foreach ($recurData['day_of_week']['names'] as $kd=>$day) { + // If selecting by days of the month + if ($recurData['by_day_of_month']['value']) { - $dates[] = new DateTime("$week $day of $month $year"); + // For each specified days of the month ($dom is day of month) + foreach ($recurData['day_of_month']['names'] as $kdom=>$dom) { + $t = new DateTime("$month $dom $year $time"); + $dates[$t->getTimestamp()] = $t; + } - } // Day of Week + // If last day of month is selected + if ($recurData['last_day_of_month']['value']) { + $t = new DateTime("last day of $month $year $time"); + $dates[$t->getTimestamp()] = $t; + } - } // Week of Month + } else { - // For each specifi days of the month - foreach ($recurData['day_of_month']['names'] as $kdom=>$dom) { + // For each week selected + foreach ($recurData['week_of_month']['names'] as $kw=>$week) { - $dates[] = new DateTime("$month $dom $year"); + // For each day selected + foreach ($recurData['day_of_week']['names'] as $kd=>$day) { + $t = new DateTime("$week $day of $month $year $time"); + $dates[$t->getTimestamp()] = $t; + } - } + } - // If last day of month is selected - if ($recurData['last_day_of_month']['value']) { - $dates[] = new DateTime("last day of $month $year"); } - } // Month of Year } // Year + // Check if the recurrences caught the "First Occurance" + if (!isset($dates[$start->getTimestamp()])) { + $dates[$start->getTimestamp()] = $start; + } // Create From and to timestamp for comparison $fromTime = $from->getTimestamp(); diff --git a/classes/data/dataTimes.php b/classes/data/dataTimes.php index 7298781..d8205a8 100644 --- a/classes/data/dataTimes.php +++ b/classes/data/dataTimes.php @@ -130,6 +130,17 @@ class GlmDataEventsTimes extends GlmDataAbstract 'use' => 'glei' ), + // Event Name + 'event_name' => array ( + 'field' => 'event', + 'as' => 'event_name', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'events', + 'p_field' => 'name', + 'p_static' => true, + 'use' => 'a' + ), + // Custom Event ID 'custom_event' => array( 'field' => 'custom_event', diff --git a/index.php b/index.php index 822fd64..3ed99fa 100644 --- 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.2'); +define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.3'); // 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'); diff --git a/models/admin/events/list.php b/models/admin/events/list.php index c3d3fd3..535c2e3 100644 --- a/models/admin/events/list.php +++ b/models/admin/events/list.php @@ -108,8 +108,12 @@ class GlmMembersAdmin_events_list extends GlmDataEvents $eventDeleted = false; $eventDeleteError = false; $recurrences = false; + $haveRecurrences = false; + $numbRecurrences = 0; $times = false; $haveTimes = false; + $firstTime = false; + $lastTime = false; // Get a list of categories $Categories = new GlmDataEventsCategories($this->wpdb, $this->config); @@ -133,15 +137,9 @@ class GlmMembersAdmin_events_list extends GlmDataEvents if ($this->eventID <= 0) { $this->eventID = false; - } else { - - // Get recurrences for this event - $recurrences = $Recurrences->getList("T.event = ".$this->eventID); - } - } - + } /* * PLACE TEMPORARY TEST DATA FOR CALENDARS HERE @@ -251,6 +249,67 @@ class GlmMembersAdmin_events_list extends GlmDataEvents $eventUpdateError = true; } + // Look for recurrence deletes + if (isset($_REQUEST['deleteRecur']) && count($_REQUEST['deleteRecur'] > 0)) { + foreach ($_REQUEST['deleteRecur'] as $d) { + + // If this was not a new entry that was deleted (in which case it was never added) + if ($d[0] != 'n') { + $Recurrences->deleteTimeEntriesForRecurrance($d, true); + $Recurrences->deleteEntry($d, true); + } + + } + } + + // Look for recurrence data + if (isset($_REQUEST['recurID'])) { + + // For each recurrence + foreach ($_REQUEST['recurID'] as $recurID) { + + // 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']); + $_REQUEST[$recurID.'_start_time'] = $red[0]." 00:00"; + $_REQUEST[$recurID.'_end_time'] = $$red[0]." 00:00"; + + } + + // Check if it's a new Recurrence + if ($recurID[0] == 'n') { + + // Add the new recurrence + $x = $Recurrences->insertEntry(true, $recurID.'_'); + + // And create time entries + $Recurrences->createRecurrenceTimesEntries($x['fieldData']['id'], true, true); + + // Otherwise it's an existing recurrence + } else { + $Recurrences->updateEntry($recurID, 'id', true, $recurID.'_'); + } + + } + + // Update our recurrences + $recurrences = $Recurrences->getList("T.event = ".$this->eventID); + + // Check for any updated recurrences + if (isset($_REQUEST['recurUpdated']) && count($_REQUEST['recurUpdated']) > 0) { + foreach ($_REQUEST['recurUpdated'] as $r) { + + // If we have a recurID as a value, then update this recurrence times + if ($r) { + $Recurrences->createRecurrenceTimesEntries($r, true, true); + } + } + } + + } + $haveEvent = true; $view = 'edit'; @@ -285,6 +344,34 @@ class GlmMembersAdmin_events_list extends GlmDataEvents } + // If we have an event ID + if ($this->eventID) { + + // Get recurrences for this event + $recurrences = $Recurrences->getList("T.event = ".$this->eventID); + + // Check if we have recurrences + if ($recurrences) { + $haveRecurrences = true; + $numbRecurrences = count($recurrences); + + // Get list of times + require_once(GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataTimes.php'); + $Times = new GlmDataEventsTimes($this->wpdb, $this->config); + $times = $Times->getList('T.event = '.$this->eventID, 'start_time'); + + if ($times && count($times) > 0) { + $haveTimes = true; + + // Get the first event date/time + $firstTime = current($times); + $lastTime = end($times); + + } + + } + } + $templateData = array( 'option' => $option, 'events' => $events, @@ -302,9 +389,13 @@ class GlmMembersAdmin_events_list extends GlmDataEvents 'eventDeleted' => $eventDeleted, 'eventDeleteError' => $eventDeleteError, 'recurrences' => $recurrences, + 'haveRecurrences' => $haveRecurrences, + 'numbRecurrences' => $numbRecurrences, 'newRecurrence' => $newRecurrence, 'times' => $times, 'haveTimes' => $haveTimes, + 'firstTime' => $firstTime, + 'lastTime' => $lastTime ); // Return status, any suggested view, and any data to controller diff --git a/setup/databaseScripts/create_database_V0.0.2.sql b/setup/databaseScripts/create_database_V0.0.2.sql deleted file mode 100644 index 221caf6..0000000 --- a/setup/databaseScripts/create_database_V0.0.2.sql +++ /dev/null @@ -1,155 +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 receint 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 occurance (date and time) - end_time DATETIME NULL, -- End of first occurance (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 (inforational only) - 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) - 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 recurrance entry - active BOOLEAN NULL, -- Active flag - normally set but used to temporarily dissable 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 referernced 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 abreviation - 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 - cost TINYTEXT NULL, -- Description of event cost - 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.3.sql b/setup/databaseScripts/create_database_V0.0.3.sql new file mode 100644 index 0000000..b8c6d19 --- /dev/null +++ b/setup/databaseScripts/create_database_V0.0.3.sql @@ -0,0 +1,156 @@ +-- 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 receint 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 occurance (date and time) + end_time DATETIME NULL, -- End of first occurance (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 (inforational only) + 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 recurrance entry + active BOOLEAN NULL, -- Active flag - normally set but used to temporarily dissable 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 referernced 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 abreviation + 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 + cost TINYTEXT NULL, -- Description of event cost + 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/dbVersions.php b/setup/databaseScripts/dbVersions.php index 919ea67..beeccc5 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -15,6 +15,7 @@ $glmMembersEventsDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 6), - '0.0.2' => array('version' => '0.0.2', 'tables' => 7) + '0.0.2' => array('version' => '0.0.2', 'tables' => 7), + '0.0.3' => array('version' => '0.0.3', 'tables' => 7) ); diff --git a/setup/databaseScripts/update_database_V0.0.3.sql b/setup/databaseScripts/update_database_V0.0.3.sql new file mode 100644 index 0000000..f20d3ac --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.3.sql @@ -0,0 +1,16 @@ +-- Gaslight Media Members Database - Events Add-On +-- File Created: 12/09/14 15:27:15 +-- Database Version: 0.0.2 +-- 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 by_day_of_month flag field +ALTER TABLE {prefix}recurrences ADD COLUMN by_day_of_month BOOLEAN; + + + + + diff --git a/views/admin/events/calendar.html b/views/admin/events/calendar.html index 88098d4..929bae8 100644 --- a/views/admin/events/calendar.html +++ b/views/admin/events/calendar.html @@ -6,25 +6,30 @@ --> -Place Calendar View HTML/Scripts here +
calendar goes here
-{if $haveTimes} - - {foreach $times as $v} - - Time ID: {$v.id}
- Event ID: {$v.event}
- Custom Event Data: {$v.custom_event}
- Recurrence ID: {$v.recur_id}
- Active: {$v.active}
- Start Time - timestamp: {$v.start_time.timestamp}
- Start Time - date time: {$v.start_time.datetime}
- End Time - timestamp: {$v.end_time.timestamp}
- End Time - date time: {$v.end_time.datetime}
- {$v.all_day} + \ No newline at end of file diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index 007d01e..22c78c6 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -248,21 +248,152 @@ - @@ -273,7 +404,7 @@
+ Add an Event Schedule
- - +
{if $recurrences} - {foreach $recurrences as $v} + {foreach $recurrences as $r} + + + + + + + {/foreach} + {else} + {/if} -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First occurrence of event
All Day Event: + +
Start Date & Time: + +
End Date & Time: + +
Event Date: + +

Date range over which recurring event can take place

From Date: + +
To Date: + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Delete this Event Schedule + When the event recurrs +
Months + + + {foreach $r.month_of_year.bitmap as $v} + {if $v.value==6} + + {/if} + + {/foreach} + +
{$v.name}  
+
 
Days of month: + Check to select specific days of the month. +
Week of the Month + + + {foreach $r.week_of_month.bitmap as $v} + + {/foreach} + +
{$v.name}  
+
Day of the Week + + + {foreach $r.day_of_week.bitmap as $v} + + {/foreach} + +
{$v.name}
+
Day of the Month + + + {foreach $r.day_of_month.bitmap as $v} + {if in_array($v.value, array(7, 14, 21, 28))} + + {/if} + + {/foreach} + + +
+ {$v.name} + + Last day of the month +
+
+
(Add event schedules here)
- {include file='admin/events/calendar.html'} +
@@ -317,54 +448,57 @@ - - + + + +

New Event Schedule

+
- + + - + + + + - - - + + - - - + + - - - + + - - + - - + @@ -373,7 +507,13 @@ + - + - + - + - +

First ocurrence of event

New ScheduleFirst ocurrence of event
All Day Event: - +
Start Date & Time: - - {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} +
Start Date & Time: +
End Date & Time: - - {if $newRecurrence.fieldFail.end_time}

{$newRecurrence.fieldFail.end_time}

{/if} +
End Date & Time: +
Event Date: - - {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} +
Event Date: + +

Date range over which recurring event can take place

From Date: - - {if $newRecurrence.fieldFail.from_date}

{$newRecurrence.fieldFail.from_date}

{/if} +
From Date: +
To Date: - - {if $newRecurrence.fieldFail.to_date}

{$newRecurrence.fieldFail.to_date}

{/if} +
To Date: +
- + + + + {/if} - + {/foreach}

When the event recurrs

+ Delete this Event Schedule + When the event recurrs +
Months @@ -383,43 +523,44 @@ {if $v.value==6}
{$v.name}   {$v.name}  
 
Select by:
Days of month:
Days of month: - Check to select specific days of the month. + Check to select specific days of the month.
Week of the Month {foreach $newRecurrence.fieldData.week_of_month.bitmap as $v} - + {/foreach}
{$v.name}   {$v.name}  
Day of the Week {foreach $newRecurrence.fieldData.day_of_week.bitmap as $v} - + {/foreach}
{$v.name} {$v.name}
Day of the Month @@ -429,11 +570,11 @@ {/if} {/foreach}
- {$v.name} + {$v.name} - Last day of the month + Last day of the month
@@ -443,12 +584,12 @@
- - -