From ed504cbe2033d1daee5b6fa6ff68f921c2b325ef Mon Sep 17 00:00:00 2001 From: Werner Date: Sun, 29 Apr 2018 16:35:06 +0200 Subject: [PATCH] Add a approval step to cargo_items (#4639) Expands the cargo table to require the approval of items before they are displayed on the server, enabling the creation of a module in the web interface. --- SQL/migrate/V025__cargo_approval.sql | 9 +++++++++ code/controllers/subsystems/supply.dm | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 SQL/migrate/V025__cargo_approval.sql diff --git a/SQL/migrate/V025__cargo_approval.sql b/SQL/migrate/V025__cargo_approval.sql new file mode 100644 index 00000000000..b82e219982c --- /dev/null +++ b/SQL/migrate/V025__cargo_approval.sql @@ -0,0 +1,9 @@ +-- +-- Combines the ss13_admin and ss13_player table +-- +ALTER TABLE `ss13_cargo_items` + ADD COLUMN `created_by` VARCHAR(50) NULL DEFAULT NULL AFTER `order_by`, + ADD COLUMN `approved_by` VARCHAR(50) NULL DEFAULT NULL AFTER `created_by`, + ADD COLUMN `approved_at` DATETIME NULL DEFAULT NULL AFTER `created_at`; + +UPDATE ss13_cargo_items SET approved_at = NOW() \ No newline at end of file diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index a7fcbc7f270..af7dac1f4e5 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -182,7 +182,7 @@ var/datum/controller/subsystem/cargo/SScargo catch(var/exception/es) log_debug("SScargo: Error when loading supplier: [es]") //Load the items - var/DBQuery/item_query = dbcon.NewQuery("SELECT id, name, supplier, description, categories, price, items, access, container_type, groupable, item_mul FROM ss13_cargo_items WHERE deleted_at is NULL AND supplier IS NOT NULL ORDER BY order_by ASC, name ASC, supplier ASC") + var/DBQuery/item_query = dbcon.NewQuery("SELECT id, name, supplier, description, categories, price, items, access, container_type, groupable, item_mul FROM ss13_cargo_items WHERE deleted_at IS NULL AND approved_at IS NOT NULL AND supplier IS NOT NULL ORDER BY order_by ASC, name ASC, supplier ASC") item_query.Execute() while(item_query.NextRow()) CHECK_TICK