From bb2c82375e656540c5919e24591e47f9555089e6 Mon Sep 17 00:00:00 2001
From: CitrusGender <31262308+CitrusGender@users.noreply.github.com>
Date: Sun, 26 Aug 2018 06:23:29 -0400
Subject: [PATCH] Add Note severity and changes UI of administrative notes
(#39808)
* Adds note_severity and updates dbconfig. New SQL stuff too.
* whoops please don't hack into my database >:^(
* UI change, changed how it's stored in the DB, removed some queries when it returns, changed stuff to key.
* Update sql_message_system.dm
* this was not defined
* random indent
* wait how did this get here
* okay enough web edits I promise
* just kidding I got u
* Update common.css
* Added buttons, changed UI again, standardized the inputs, added severity for appearance bans, fed the dog
* forgot about the banning panel
* added an asset cache
* corrects asset datum var name
---
SQL/database_changelog.txt | 13 ++-
SQL/tgstation_schema.sql | 1 +
SQL/tgstation_schema_prefixed.sql | 1 +
code/__DEFINES/subsystems.dm | 2 +-
code/modules/admin/DB_ban/functions.dm | 6 ++
code/modules/admin/NewBan.dm | 4 +-
code/modules/admin/sql_message_system.dm | 130 ++++++++++++++++-------
code/modules/admin/topic.dm | 54 ++++++----
code/modules/client/asset_cache.dm | 8 ++
code/modules/client/client_procs.dm | 2 +-
html/browser/common.css | 14 +++
html/high_button.png | Bin 0 -> 434 bytes
html/medium_button.png | Bin 0 -> 559 bytes
html/minor_button.png | Bin 0 -> 685 bytes
html/none_button.png | Bin 0 -> 663 bytes
15 files changed, 173 insertions(+), 62 deletions(-)
create mode 100644 html/high_button.png
create mode 100644 html/medium_button.png
create mode 100644 html/minor_button.png
create mode 100644 html/none_button.png
diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt
index dc05bae4431..56f05e84f10 100644
--- a/SQL/database_changelog.txt
+++ b/SQL/database_changelog.txt
@@ -1,15 +1,22 @@
Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255.
-The latest database version is 4.6; The query to update the schema revision table is:
+The latest database version is 4.7; The query to update the schema revision table is:
-INSERT INTO `schema_revision` (`major`, `minor`) VALUES (4, 6);
+INSERT INTO `schema_revision` (`major`, `minor`) VALUES (4, 7);
or
-INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (4, 6);
+INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (4, 7);
In any query remember to add a prefix to the table names if you use one.
----------------------------------------------------
+Version 4.7, 18 August 2018, by CitrusGender
+Modified table `messages`, adding column `severity` to classify notes based on their severity.
+
+ALTER TABLE `messages` ADD `severity` enum('high','medium','minor','none') DEFAULT NULL AFTER `expire_timestamp`
+
+----------------------------------------------------
+
Version 4.6, 11 August 2018, by Jordie0608
Modified table `messages`, adding column `expire_timestamp` to allow for auto-"deleting" messages.
diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql
index 18602cc52a9..dc0861220ae 100644
--- a/SQL/tgstation_schema.sql
+++ b/SQL/tgstation_schema.sql
@@ -254,6 +254,7 @@ CREATE TABLE `messages` (
`round_id` int(11) unsigned NOT NULL,
`secret` tinyint(1) unsigned NOT NULL,
`expire_timestamp` datetime DEFAULT NULL,
+ `severity` enum('high','medium','minor','none') DEFAULT NULL,
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql
index 938b293035a..5cb57a9582e 100644
--- a/SQL/tgstation_schema_prefixed.sql
+++ b/SQL/tgstation_schema_prefixed.sql
@@ -254,6 +254,7 @@ CREATE TABLE `SS13_messages` (
`round_id` int(11) unsigned NOT NULL,
`secret` tinyint(1) unsigned NOT NULL,
`expire_timestamp` datetime DEFAULT NULL,
+ `severity` enum('high','medium','minor','none') DEFAULT NULL,
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm
index 6f49344dc6b..b62febed7e2 100644
--- a/code/__DEFINES/subsystems.dm
+++ b/code/__DEFINES/subsystems.dm
@@ -1,7 +1,7 @@
//Update this whenever the db schema changes
//make sure you add an update to the schema_version stable in the db changelog
#define DB_MAJOR_VERSION 4
-#define DB_MINOR_VERSION 6
+#define DB_MINOR_VERSION 7
//Timing subsystem
//Don't run if there is an identical unique timer active
diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm
index cf5c1d26063..787866a4944 100644
--- a/code/modules/admin/DB_ban/functions.dm
+++ b/code/modules/admin/DB_ban/functions.dm
@@ -412,6 +412,12 @@
output += "