Now have file uploads working. Requires updates to the main plugin.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Apr 2016 15:22:41 +0000 (11:22 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Apr 2016 15:22:41 +0000 (11:22 -0400)
classes/data/dataEvents.php
index.php
setup/databaseScripts/create_database_V0.0.12.sql [deleted file]
setup/databaseScripts/create_database_V0.0.16.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/readme.txt
setup/databaseScripts/update_database_V0.0.15.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.16.sql [new file with mode: 0644]
views/admin/events/edit.html
views/admin/events/editFiles.html
views/admin/events/editSchedule.html

index 6e36e18..73d092f 100644 (file)
@@ -295,6 +295,54 @@ class GlmDataEvents extends GlmDataAbstract
                 'use' => 'a'
             ),
 
+            // Event File #1 file name
+            'file1' => array(
+                'field'    => 'file1',
+                'type'     => 'file',
+                'maxSize'  => 10000,
+                'use'      => 'a'
+            ),
+
+            // Event File #1 description
+            'file1_descr' => array(
+                'field'    => 'file1_descr',
+                'type'     => 'text',
+                'maxLength'=> 250,
+                'use'      => 'a'
+            ),
+
+            // Event File #2 file name
+            'file2' => array(
+                'field'    => 'file2',
+                'type'     => 'file',
+                'maxSize'  => 10000,
+                'use'      => 'a'
+            ),
+
+            // Event File #2 description
+            'file2_descr' => array(
+                'field'    => 'file2_descr',
+                'type'     => 'text',
+                'maxLength'=> 250,
+                'use'      => 'a'
+            ),
+
+            // Event File #3 file name
+            'file3' => array(
+                'field'    => 'file3',
+                'type'     => 'file',
+                'maxSize'  => 10000,
+                'use'      => 'a'
+            ),
+
+            // Event File #3 description
+            'file3_descr' => array(
+                'field'    => 'file3_descr',
+                'type'     => 'text',
+                'maxLength'=> 250,
+                'use'      => 'a'
+            ),
+
             // Event Image
             'image' => array(
                 'field'    => 'image',
@@ -486,7 +534,7 @@ class GlmDataEvents extends GlmDataAbstract
                 foreach ( $recurrences as $recurrence ) {
                     $r['recurrences'][] = $recurrence;
                 }
-            } 
+            }
 
         }
 
index 7bca092..b474015 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.12');
+define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.16');
 
 // 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.12.sql b/setup/databaseScripts/create_database_V0.0.12.sql
deleted file mode 100644 (file)
index 5673ee4..0000000
+++ /dev/null
@@ -1,175 +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
-  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
-  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
-  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
-  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
-  pdf_logo TINYTEXT NULL,             -- Image for the Top of the PDF
-  footer_text TINYTEXT NULL,          -- Image for the Top of the PDF
-  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.16.sql b/setup/databaseScripts/create_database_V0.0.16.sql
new file mode 100644 (file)
index 0000000..d810e2a
--- /dev/null
@@ -0,0 +1,181 @@
+-- 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 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
+  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
+  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
+  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
+  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
+  pdf_logo TINYTEXT NULL,             -- Image for the Top of the PDF
+  footer_text TINYTEXT NULL,          -- Image for the Top of the PDF
+  PRIMARY KEY (id)
+);
+
+----
+
+-- Set default event management entry
+INSERT INTO {prefix}management
+    ( id, canonical_event_page )
+   VALUES
+    ( 1, 'event-detail' )
+;
+
index 9793aa7..7b9bc2e 100644 (file)
@@ -25,6 +25,8 @@ $glmMembersEventsDbVersions = array(
     '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),
-    '0.0.12' => array('version' => '0.0.12', 'tables' => 7)
+    '0.0.12' => array('version' => '0.0.12', 'tables' => 7),
+    '0.0.15' => array('version' => '0.0.15', 'tables' => 7, 'date' => '4/11/2016'),
+    '0.0.16' => array('version' => '0.0.16', 'tables' => 7, 'date' => '4/11/2016')
 );
 
index 38ec539..141d8b5 100644 (file)
@@ -28,6 +28,8 @@ Procedure to update database
    needed to update database content. (i.e. to make changes to database content)
 
 6) Edit the "dbVersions.php" file and add a new line for the new version.
+   *** Now please be sure to add a date for each entry ***
+   i.e. '1.1.2' => array('version' => '1.1.2', 'tables' => 14, 'date' => '4/11/16')
 
 7) When this is all done, edit the index.php file for the plugin/add-on and 
    change "GLM_MEMBERS_{addon}_PLUGIN_DB_VERSION" defined parameter where
diff --git a/setup/databaseScripts/update_database_V0.0.15.sql b/setup/databaseScripts/update_database_V0.0.15.sql
new file mode 100644 (file)
index 0000000..2733594
--- /dev/null
@@ -0,0 +1,15 @@
+-- Gaslight Media Members Database  - Events Add-On
+-- Database Version: 0.0.12
+-- 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 a single file upload field
+ALTER TABLE {prefix}events ADD COLUMN file TINYTEXT;
+
+----
+
+-- Add a description for the file upload field
+ALTER TABLE {prefix}events ADD COLUMN file_descr TINYTEXT;
diff --git a/setup/databaseScripts/update_database_V0.0.16.sql b/setup/databaseScripts/update_database_V0.0.16.sql
new file mode 100644 (file)
index 0000000..f897c49
--- /dev/null
@@ -0,0 +1,35 @@
+-- Gaslight Media Members Database  - Events Add-On
+-- Database Version: 0.0.12
+-- 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
+
+
+-- Rename events file field to file1 field
+ALTER TABLE {prefix}events CHANGE file file1 TINYTEXT;
+
+----
+
+-- Rename events file_descr field to file1_descr field
+ALTER TABLE {prefix}events CHANGE file_descr file1_descr TINYTEXT;
+
+----
+
+-- Add a single file upload field
+ALTER TABLE {prefix}events ADD COLUMN file2 TINYTEXT;
+
+----
+
+-- Add a description for the file upload field
+ALTER TABLE {prefix}events ADD COLUMN file2_descr TINYTEXT;
+
+----
+
+-- Add a single file upload field
+ALTER TABLE {prefix}events ADD COLUMN file3 TINYTEXT;
+
+----
+
+-- Add a description for the file upload field
+ALTER TABLE {prefix}events ADD COLUMN file3_descr TINYTEXT;
index f1989be..7cdf87e 100644 (file)
@@ -6,13 +6,13 @@
 
 {if apply_filters('glm_members_permit_admin_members_packaging_edit_package', true)}
   {if $haveMember}
-    <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=events&member={$memberID}" class="button button-primary glm-button glm-right">Return to Events List</a>
+    <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=events&member={$memberID}" class="button button-secondary glm-button glm-right">Return to Events List</a>
   {else}
     <a href="{$thisUrl}?page={$thisPage}&glm_action=list" class="button button-secondary glm-button glm-right">Return to Events List</a>
   {/if}
 
   {if $option == 'edit'}
-    <a id="deleteEventButton" class="button button-primary glm-button glm-right">Delete this Event</a>
+    <a id="deleteEventButton" class="button button-secondary glm-button glm-right">Delete this Event</a>
     <h2>Edit Event</h2>
   {else}
     <h2>Add new Event</h2>
             // When adding a new recurrence is requested
             $("#addRecurrence").click( function() {
                 addNewRecurrenceForm();
-                $('#no-recurrence-msg').remove();
             });
 
             /*
                 startTimeOnlyInit();
 
                 // All Dates Event selection
-                $('.all-dates-checkbox').click( function() {
+                $('.recurring-checkbox').click( function() {
                     recurID = $(this).attr('data-id');
                     if ($("#recurringEvent_" + recurID)[0].checked) {
                         $("#recurringExclude_" + recurID).removeClass('glm-hidden');
                     $('#recurCalendarDialog_' + recurID).attr('title', 'Select Dates for ' + recurName);
 
                     $('#recurCalendarDialog_' + recurID).dialog({
+                        position: { my: 'top+75', of: '#recurSpecDates_' + recurID},
                         minWidth: 600
                     });
+                    // Color to change calendar cell to (in rgb so it compares to our test below)
+                    var calClickColor = 'rgb(173, 216, 230)';
                     $('#recurCalendar_' + recurID).fullCalendar({
                         header : {
                             left:   'title',
                                   start: date,
                                   title: 'New Date'
                             };
-                            if (c == 'transparent') {
-                                $(this).css('background-color', 'lightblue');
+                            if (c != calClickColor) {
+                                $(this).css('background-color', calClickColor);
                                 $('#recurSpecDates_' + recurID).append(
                                     '<span id="recurSpecDate_' + recurID + '" class="button glm-button-small"><input name="recurSpecDate_' + recurID + '" type="hidden" value="' + date.format() + '">' + date.format() + '</span>'
                                 );
index 49fddfe..d7a57f6 100644 (file)
@@ -2,40 +2,65 @@
 <!-- File Upload -->
 
     <table id="glm-table-files" class="glm-admin-table glm-event-table glm-hidden">
+        <tr><td style="width: 10%;">&nbsp;</td><td style="width: 90%;"><p>(maximum description length 250 characters)</p></td></tr>
         <tr>
-            <td>
-                <table>
-                    <tr><td>&nbsp;</td><th>Attach Files to Event</th></tr>
-<!-- 
-                    <tr>
-                        <th>Admin Contact Name:</th>
-                        <td>
-                            <input type="text" name="admin_name" value="{$event.fieldData.admin_name}" class="glm-form-text-input-medium">
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>Admin Contact Organization:</th>
-                        <td>
-                            <input type="text" name="admin_org" value="{$event.fieldData.admin_org}" class="glm-form-text-input-medium">
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>Admin Contact E-Mail:</th>
-                        <td>
-                            <input type="text" name="admin_email" value="{$event.fieldData.admin_email}" class="glm-form-text-input-medium">
-                        </td>
-                    </tr>
-                    <tr>
-                        <th>Admin Contact Phone:</th>
-                        <td>
-                            <input type="text" name="admin_phone" value="{$event.fieldData.admin_phone}" class="glm-form-text-input-medium">
-                        </td>
-                    </tr>
- -->                    
-                </table>
+            <th {if $event.fieldRequired.file1}class="glm-required"{/if}>File #1:</th>
+            <td {if $event.fieldFail.file1}class="glm-form-bad-input"{/if}>
+    {if $event.fieldData.file1}
+                <span class="glm-right">Replace this file:</b> <input type="file" name="file1_new"></span>
+                <a href="{$glmPluginMediaUrl}/files/{$event.fieldData.file1}" target="event_file">{$event.fieldData.file1}</a>&nbsp;&nbsp;&nbsp;
+                <input type="checkbox" name="file1_delete"> Delete File<br>
+    {else}
+                New file:</b> <input type="file" name="file1_new">
+    {/if}
             </td>
-            <td width="50%">
-                &nbsp;
+        </tr>
+        <tr>
+            <th {if $event.fieldRequired.file1_descr}class="glm-required"{/if}>&nbsp;&nbsp;&nbsp;Description:</th>
+            <td {if $event.fieldFail.file1_descr}class="glm-form-bad-input" data-tabid="glm-event-files"{/if}>
+                <textarea name="file1_descr" class="glm-form-textarea">{$event.fieldData.file1_descr}</textarea>
+                {if $event.fieldFail.file1_descr}<p>{$event.fieldFail.file1_descr}</p>{/if}
+            </td>
+        </tr>
+        <tr><td colspan="2">&nbsp;</td></tr>
+        <tr>
+            <th {if $event.fieldRequired.file2}class="glm-required"{/if}>File #2:</th>
+            <td {if $event.fieldFail.file2}class="glm-form-bad-input"{/if}>
+    {if $event.fieldData.file2}
+                <span class="glm-right">Replace this file:</b> <input type="file" name="file2_new"></span>
+                <a href="{$glmPluginMediaUrl}/files/{$event.fieldData.file2}" target="event_file">{$event.fieldData.file2}</a>&nbsp;&nbsp;&nbsp;
+                <input type="checkbox" name="file2_delete"> Delete File<br>
+    {else}
+                New file:</b> <input type="file" name="file2_new">
+    {/if}
+            </td>
+        </tr>
+        <tr>
+            <th {if $event.fieldRequired.file2_descr}class="glm-required"{/if}>&nbsp;&nbsp;&nbsp;Description:</th>
+            <td {if $event.fieldFail.file2_descr}class="glm-form-bad-input" data-tabid="glm-event-files"{/if}>
+                <textarea name="file2_descr" class="glm-form-textarea">{$event.fieldData.file2_descr}</textarea>
+                {if $event.fieldFail.file2_descr}<p>{$event.fieldFail.file2_descr}</p>{/if}
+            </td>
+        </tr>
+        <tr><td colspan="2">&nbsp;</td></tr>
+        <tr>
+            <th {if $event.fieldRequired.file3}class="glm-required"{/if}>File #3:</th>
+            <td {if $event.fieldFail.file3}class="glm-form-bad-input"{/if}>
+    {if $event.fieldData.file3}
+                <span class="glm-right">Replace this file:</b> <input type="file" name="file3_new"></span>
+                <a href="{$glmPluginMediaUrl}/files/{$event.fieldData.file3}" target="event_file">{$event.fieldData.file3}</a>&nbsp;&nbsp;&nbsp;
+                <input type="checkbox" name="file3_delete"> Delete File<br>
+    {else}
+                New file:</b> <input type="file" name="file3_new">
+    {/if}
+                {if $event.fieldFail.file3}<p>{$event.fieldFail.file3}</p>{/if}
+            </td>
+        </tr>
+        <tr>
+            <th {if $event.fieldRequired.file3_descr}class="glm-required"{/if}>&nbsp;&nbsp;&nbsp;Description:</th>
+            <td {if $event.fieldFail.file3_descr}class="glm-form-bad-input" data-tabid="glm-event-files"{/if}>
+                <textarea name="file3_descr" class="glm-form-textarea">{$event.fieldData.file3_descr}</textarea>
+                {if $event.fieldFail.file3_descr}<p>{$event.fieldFail.file3_descr}</p>{/if}
             </td>
         </tr>
     </table>
index a63ac4e..49915f8 100644 (file)
@@ -60,7 +60,7 @@
                             <tr>
                                 <th>Recurring Event:</th>
                                 <td width="90%">
-                                    <input id="recurringEvent_{$r.id}" data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_recurring" class="all-dates-checkbox recurrence-input" {if $r.recurring.value} checked{/if}>
+                                    <input id="recurringEvent_{$r.id}" data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_recurring" class="recurring-checkbox recurrence-input" {if $r.recurring.value} checked{/if}>
                                     Setup a detailed schedule.
                                 </td>
                             </tr>
                 <tr>
                     <th>Recurring Event:</th>
                     <td width="90%">
-                        <input id="recurringEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_recurring" class="all-dates-checkbox recurrence-input">
+                        <input id="recurringEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_recurring" class="recurring-checkbox recurrence-input">
                         Setup a detailed schedule;
                     </td>
                 </tr>
                         <a id="deleteRecurrence_{ newRecurID }" data-id="{ newRecurID }" class="button button-secondary glm-button glm-right delete-recurrence">Delete this Event Schedule</a>
                     </th>
                 </tr>
-                <tbody id="recurringEventExclude_{ newRecurID }" class="glm-hidden">
+                <tbody id="recurringExclude_{ newRecurID }" class="glm-hidden">
                     <tr>
                         <th>Months</th>
                         <td>