From bfcaa0011fda2a12a123b9ca8665bea001e90c65 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 11 Sep 2017 12:19:29 -0400 Subject: [PATCH] Added description fields to reg_time and reg_event tables for optional registration related descriptions. Added JSON output from get cart method in regCartSupport class. --- classes/data/dataRegEvent.php | 10 ++++- classes/regCartSupport.php | 6 ++- index.php | 2 +- ...0.0.11.sql => create_database_V0.0.12.sql} | 2 + setup/databaseScripts/dbVersions.php | 3 +- ..._V0.0.11.sql => drop_database_V0.0.12.sql} | 0 .../update_database_V0.0.12.sql | 16 +++++++ views/admin/registrations/eventEdit.html | 45 +++++++++++-------- 8 files changed, 62 insertions(+), 22 deletions(-) rename setup/databaseScripts/{create_database_V0.0.11.sql => create_database_V0.0.12.sql} (99%) rename setup/databaseScripts/{drop_database_V0.0.11.sql => drop_database_V0.0.12.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V0.0.12.sql diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index bf50fec..db6865a 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -249,6 +249,14 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'use' => 'a' ), + // Optional Description + 'descr' => array ( + 'field' => 'descr', + 'type' => 'text', + 'required' => false, + 'use' => 'a' + ), + // Terms and Conditions for registration 'terms' => array ( 'field' => 'terms', @@ -256,7 +264,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'required' => false, 'use' => 'a' ), - + // Name of a downloadable file 'reg_file' => array ( 'field' => 'reg_file', diff --git a/classes/regCartSupport.php b/classes/regCartSupport.php index c460cf3..756852d 100644 --- a/classes/regCartSupport.php +++ b/classes/regCartSupport.php @@ -102,7 +102,7 @@ class GlmRegCartSupport * @return array Array of request and all associated information or false * @access public */ - public function getRegistrationCart($requestId = false) + public function getRegistrationCart($requestId = false, $json = false) { $RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config); @@ -191,6 +191,10 @@ class GlmRegCartSupport } $this->cart['status'] = true; + + if ($json) { + return json_encode($this->cart); + } return $this->cart; diff --git a/index.php b/index.php index c8eac2e..5c0a0e8 100644 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ if (!defined('ABSPATH')) { * version from this plugin. */ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.11'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.12'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0'); diff --git a/setup/databaseScripts/create_database_V0.0.11.sql b/setup/databaseScripts/create_database_V0.0.12.sql similarity index 99% rename from setup/databaseScripts/create_database_V0.0.11.sql rename to setup/databaseScripts/create_database_V0.0.12.sql index 015fa04..7e30a9d 100644 --- a/setup/databaseScripts/create_database_V0.0.11.sql +++ b/setup/databaseScripts/create_database_V0.0.12.sql @@ -316,6 +316,7 @@ CREATE TABLE {prefix}reg_event ( registration_account_options SMALLINT NULL, -- Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini payment_methods SMALLINT NULL, -- Bitmap of payment methods available to users for this event - See payment_method in plugin.ini restricted_payment_methods SMALLINT NULL, -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method + descr TEXT NULL, -- Registrations specific description field for this event terms TEXT NULL, -- Terms and Conditions for registration reg_file TINYTEXT NULL, -- Name of a downloadable file reg_file_title TINYTEXT NULL, -- Title for downloadable file @@ -351,6 +352,7 @@ CREATE TABLE {prefix}reg_time ( total_charges DOUBLE NULL, -- Total charges (sum of all above) total_discounts DOUBLE NULL, -- Total discounts of all types (applied payment codes, etc...) total_payments DOUBLE NULL, -- Total net payments (total charges - total discounts) + descr TEXT NULL, -- Optional description field for this time entry PRIMARY KEY (id), INDEX (reg_event), INDEX (event_time), diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 7efff20..d71e653 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -24,7 +24,8 @@ $glmMembersRegistrationsDbVersions = array( '0.0.8' => array('version' => '0.0.8', 'tables' => 19, 'date' => '04/18/2017'), '0.0.9' => array('version' => '0.0.9', 'tables' => 19, 'date' => '04/24/2017'), '0.0.10' => array('version' => '0.0.10', 'tables' => 20, 'date' => '04/25/2017'), - '0.0.11' => array('version' => '0.0.11', 'tables' => 20, 'date' => '04/29/2017') + '0.0.11' => array('version' => '0.0.11', 'tables' => 20, 'date' => '04/29/2017'), + '0.0.12' => array('version' => '0.0.12', 'tables' => 20, 'date' => '09/11/2017') ); diff --git a/setup/databaseScripts/drop_database_V0.0.11.sql b/setup/databaseScripts/drop_database_V0.0.12.sql similarity index 100% rename from setup/databaseScripts/drop_database_V0.0.11.sql rename to setup/databaseScripts/drop_database_V0.0.12.sql diff --git a/setup/databaseScripts/update_database_V0.0.12.sql b/setup/databaseScripts/update_database_V0.0.12.sql new file mode 100644 index 0000000..b25df76 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.12.sql @@ -0,0 +1,16 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Created: 09/11/17 11:00:00 +-- 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 dashes + +ALTER TABLE {prefix}reg_event ADD COLUMN descr TEXT; + +---- + +ALTER TABLE {prefix}reg_time ADD COLUMN descr TEXT; + + + diff --git a/views/admin/registrations/eventEdit.html b/views/admin/registrations/eventEdit.html index 2a6d6ab..7577698 100644 --- a/views/admin/registrations/eventEdit.html +++ b/views/admin/registrations/eventEdit.html @@ -35,35 +35,35 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - +
Event NameEvent Name {if $regEvent.fieldFail.event_name}

{$regEvent.fieldFail.event_name}

{/if}
Event Registration CodeEvent Registration Code {if $regEvent.fieldFail.event_code}

{$regEvent.fieldFail.event_code}

{/if}
Notify E-Mail AddressNotify E-Mail Address {if $regEvent.fieldFail.notify_email}

{$regEvent.fieldFail.notify_email}

{/if}
Admin ActiveAdmin Active {if $regEvent.fieldFail.admin_active}

{$regEvent.fieldFail.admin_active}

{/if}
Date/Time Specific RegistrationsDate/Time Specific Registrations Check this box for events where registrations are for specific dates and times. @@ -71,21 +71,21 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Registrations ActiveRegistrations Active {if $regEvent.fieldFail.active}

{$regEvent.fieldFail.active}

{/if}
Multiple Attendees per SubmissionMultiple Attendees per Submission {if $regEvent.fieldFail.attendees}

{$regEvent.fieldFail.attendees}

{/if}
Maximum # of AttendeesMaximum # of Attendees Set to 0 to permit an unlimited number of attendees for this event.
@@ -93,7 +93,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Maximum # of Attendees Per SubmissionMaximum # of Attendees Per Submission Set to 0 for to permit a user to register an unlimited number of attendees for this event at one time.
@@ -101,7 +101,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Attendees Hold Time (minutes)Attendees Hold Time (minutes) When an attendee is added to a registration request, the system will hold that attendee "slot" for this number of minutes before releasing it for others to register. After the attendee slot is released, the slot will be requested again each @@ -112,7 +112,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Cart Hold (days)Cart Hold (days) If the user has registrations entered but has not yet checked out, their "cart" will be maintained for this number of days. After that time, the card will be deleted. If a user has established a registrations account (entered registrations or @@ -122,7 +122,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Account OptionsAccount Options {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v} {$v.name}
@@ -131,7 +131,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Payment MethodsPayment Methods Checking a payment method makes it available for use by regular users at checkout.
{foreach from=$regEvent.fieldData.payment_methods.bitmap item=v} @@ -141,7 +141,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Restricted Payment MethodsRestricted Payment Methods Restricted payment methods are those only available to logged in administrative users. For example, selecting "No Charge" here will allow administrative users to check out without having to provide any payment information.
@@ -152,7 +152,16 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
Terms and Conditions for RegistrationDescription (optional) + + {if $regEvent.fieldFail.descr} +

{$regEvent.fieldFail.descr}

+ {/if}
+
Terms and Conditions for Registration {if $regEvent.fieldFail.terms} @@ -161,7 +170,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
FileFile {if $regEvent.fieldData.reg_file} Replace this file: @@ -173,14 +182,14 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
File TitleFile Title {if $regEvent.fieldFail.reg_file_title}

{$regEvent.fieldFail.reg_file_title}

{/if}
NotesNotes {if $regEvent.fieldFail.notes} -- 2.17.1