From f9ba2ed01e308e09587c11e6d381836259a90d2f Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 21 Nov 2017 10:57:19 -0500 Subject: [PATCH] updating database for status values for pending adding pending and approved values in the config array and updating the database --- classes/data/dataForSale.php | 8 ++++++++ config/plugin.ini | 5 ++++- index.php | 2 +- ...database_V0.0.1.sql => create_database_V0.0.2.sql} | 3 ++- setup/databaseScripts/dbVersions.php | 1 + setup/databaseScripts/update_database_V0.0.2.sql | 11 +++++++++++ 6 files changed, 27 insertions(+), 3 deletions(-) rename setup/databaseScripts/{create_database_V0.0.1.sql => create_database_V0.0.2.sql} (96%) create mode 100644 setup/databaseScripts/update_database_V0.0.2.sql diff --git a/classes/data/dataForSale.php b/classes/data/dataForSale.php index ab5b1ac..ff679c1 100644 --- a/classes/data/dataForSale.php +++ b/classes/data/dataForSale.php @@ -149,6 +149,14 @@ class GlmDataForSale extends GlmDataAbstract 'force_list' => true, 'use' => 'a' ), + 'status' => array ( + 'field' => 'status', + 'type' => 'list', + 'list' => $this->config['status'], + 'default' => 'Pending', + 'force_list' => true, + 'use' => 'a' + ), 'title' => array ( 'field' => 'title', 'type' => 'text', diff --git a/config/plugin.ini b/config/plugin.ini index f543a57..afe05ea 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -11,4 +11,7 @@ item_expiration[90] = '90 Days' item_expiration[120] = '120 Days' topics[1] = 'For Sale' -topics[2] = 'Buy' \ No newline at end of file +topics[2] = 'Buy' + +status[10] = 'Pending' +status[20] = 'Approved' \ No newline at end of file diff --git a/index.php b/index.php index f64144f..a3b8b11 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION', '0.0.1'); +define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION', '0.0.2'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0'); diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.2.sql similarity index 96% rename from setup/databaseScripts/create_database_V0.0.1.sql rename to setup/databaseScripts/create_database_V0.0.2.sql index 0707a52..77adc14 100644 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ b/setup/databaseScripts/create_database_V0.0.2.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database - For Sale -- File Created: 12/02/15 15:27:15 --- Database Version: 0.0.1 +-- Database Version: 0.0.2 -- Database Creation Script -- -- This file is called to create a new set of tables for this @@ -33,6 +33,7 @@ CREATE TABLE {prefix}items ( image_3 TINYTEXT NULL , member INT NULL, repost BOOL null, + status TINYINT null, PRIMARY KEY (id) ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 373e2ef..92bf5c1 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -35,4 +35,5 @@ $glmMembersForSaleDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 1, 'date' => '09/15/2017'), + '0.0.2' => array('version' => '0.0.2', 'tables' => 1, 'date' => '11/15/2017'), ); diff --git a/setup/databaseScripts/update_database_V0.0.2.sql b/setup/databaseScripts/update_database_V0.0.2.sql new file mode 100644 index 0000000..b8d6da7 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.2.sql @@ -0,0 +1,11 @@ +-- Gaslight Media Members Database - For Sale Add-On +-- File Created: 11/09/17 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 Status +ALTER TABLE {prefix}items ADD COLUMN status TINYINT; \ No newline at end of file -- 2.17.1