From 597c0cca78fbfccb92f8ae93104e5456b9f6fa16 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Wed, 6 Apr 2016 14:25:35 -0400 Subject: [PATCH] Preliminary look at Event edit updates. --- classes/data/dataRecurrences.php | 8 ++-- index.php | 2 +- ...0.0.10.sql => create_database_V0.0.11.sql} | 4 +- setup/databaseScripts/dbVersions.php | 1 + .../update_database_V0.0.11.sql | 17 +++++++ views/admin/events/edit.html | 24 +++++++++- views/admin/events/editSchedule.html | 45 ++++--------------- 7 files changed, 56 insertions(+), 45 deletions(-) rename setup/databaseScripts/{create_database_V0.0.10.sql => create_database_V0.0.11.sql} (97%) create mode 100644 setup/databaseScripts/update_database_V0.0.11.sql diff --git a/classes/data/dataRecurrences.php b/classes/data/dataRecurrences.php index 0ecf4d7..eef4ca9 100644 --- a/classes/data/dataRecurrences.php +++ b/classes/data/dataRecurrences.php @@ -140,8 +140,8 @@ class GlmDataEventsRecurrences extends GlmDataAbstract // Start Date & Time 'start_time' => array ( 'field' => 'start_time', - 'type' => 'datetime', - 'format' => 'm/d/Y h:i a', + 'type' => 'time', + 'format' => 'h:i a', 'required' => true, 'use' => 'a' ), @@ -165,8 +165,8 @@ class GlmDataEventsRecurrences extends GlmDataAbstract // End Date & Time 'end_time' => array ( 'field' => 'end_time', - 'type' => 'datetime', - 'format' => 'm/d/Y h:i a', + 'type' => 'time', + 'format' => 'h:i a', 'use' => 'a' ), diff --git a/index.php b/index.php index a123fa6..950b250 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.10'); +define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.11'); // 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/setup/databaseScripts/create_database_V0.0.10.sql b/setup/databaseScripts/create_database_V0.0.11.sql similarity index 97% rename from setup/databaseScripts/create_database_V0.0.10.sql rename to setup/databaseScripts/create_database_V0.0.11.sql index 9dde6be..462e1c9 100644 --- a/setup/databaseScripts/create_database_V0.0.10.sql +++ b/setup/databaseScripts/create_database_V0.0.11.sql @@ -40,9 +40,9 @@ 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 TIME NULL, -- Start time of day for event start_time_only BOOLEAN NULL, -- Use end of first occurrence flag - end_time DATETIME NULL, -- End of first occurrence (date and time) + 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 diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 0a9f83d..369e087 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -24,5 +24,6 @@ $glmMembersEventsDbVersions = array( '0.0.8' => array('version' => '0.0.8', 'tables' => 7), '0.0.9' => array('version' => '0.0.9', 'tables' => 7), '0.0.10' => array('version' => '0.0.10', 'tables' => 7), + '0.0.11' => array('version' => '0.0.11', 'tables' => 7) ); diff --git a/setup/databaseScripts/update_database_V0.0.11.sql b/setup/databaseScripts/update_database_V0.0.11.sql new file mode 100644 index 0000000..9107d33 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.11.sql @@ -0,0 +1,17 @@ +-- Gaslight Media Members Database - Events Add-On +-- File Created: 12/09/14 15:27:15 +-- Database Version: 0.0.11 +-- 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 new Start time field +ALTER TABLE {prefix}recurrences CHANGE start_time start_time TIME; + +---- + +-- Add new End time field +ALTER TABLE {prefix}recurrences CHANGE end_time end_time TIME; + diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index 291c964..e74fe28 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -421,6 +421,17 @@ timepicker: false }); + // Time Only Pickers + $('.glm-time-input').datetimepicker({ + format: 'h:i A', + lang: 'en', + step: 15, + closeOnWithoutClick: true, + pick12HourFormat: true, + formatTime:'h:i A', + datepicker: false + }); + // Delete a recurrence $('.delete-recurrence').on( 'click', function() { recurID = $(this).attr('data-id'); @@ -446,9 +457,10 @@ } }); - function startTimeOnlyInit() { + // Start time only checkbox operations + function startTimeOnlySetup() { // Start Time only selection - $('.start-time-only-checkbox').click( function() { + $('.start-time-only-checkbox').each( function() { recurID = $(this).attr('data-id'); if ($(this)[0].checked) { $("#endTimeRow_" + recurID).addClass('glm-hidden'); @@ -457,6 +469,13 @@ } }); } + function startTimeOnlyInit() { + // Start Time only selection + $('.start-time-only-checkbox').click( function() { + startTimeOnlySetup(); + }); + startTimeOnlySetup(); + } startTimeOnlyInit(); // All Dates Event selection @@ -902,6 +921,7 @@ $('#locationContainer').addClass('glm-hidden'); } else { $('#locationContainer').removeClass('glm-hidden'); + initLocations(); } }); diff --git a/views/admin/events/editSchedule.html b/views/admin/events/editSchedule.html index 890b44b..38fe85a 100644 --- a/views/admin/events/editSchedule.html +++ b/views/admin/events/editSchedule.html @@ -36,34 +36,14 @@ Start Time: - + Start time only End Time: - + -   Date range over which recurring event can take place

@@ -214,7 +194,7 @@ New Schedule - First ocurrence of event +   All Day Event: @@ -223,23 +203,16 @@ - Start Date & Time: + Start Time: - + + Start time only - - End Date & Time: - - - - - - - Event Date: + + End Time: - - +   -- 2.17.1