From 89f5992a4cb61def24ce630d1edd70ac7da2620b Mon Sep 17 00:00:00 2001
From: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Date: Tue, 6 Jun 2023 18:51:26 -0400
Subject: [PATCH] Player Ticket History - A Synopsis At A Glance (#75830)
## About The Pull Request
Adds a new front-end for viewing player ticket history stored in the
connected database.
Also adds a button to directly query for previous tickets from the
ticket panel.
## Pictures




## Why It's Good For The Game
Gives admins the ability to look at a players behaviour in-game without
the need for external tooling, (statbus)
## Changelog
:cl:
admin: Player Ticket History - view a player's ticket history without
the need to use external tooling.
/:cl:
---
code/modules/admin/admin_verbs.dm | 1 +
code/modules/admin/topic.dm | 9 +
code/modules/admin/verbs/adminhelp.dm | 4 +
.../admin/verbs/player_ticket_history.dm | 198 +++++++++++++++
tgstation.dme | 1 +
.../tgui/interfaces/PlayerTicketHistory.tsx | 237 ++++++++++++++++++
6 files changed, 450 insertions(+)
create mode 100644 code/modules/admin/verbs/player_ticket_history.dm
create mode 100644 tgui/packages/tgui/interfaces/PlayerTicketHistory.tsx
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 92d51100a5f..d686c110e6c 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -92,6 +92,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
/client/proc/toggle_view_range, /*changes how far we can see*/
/client/proc/cmd_admin_law_panel,
/client/proc/log_viewer_new,
+ /client/proc/player_ticket_history,
)
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/ban_panel, /client/proc/stickybanpanel, /client/proc/library_control))
GLOBAL_PROTECT(admin_verbs_ban)
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 6491135b5fd..d06be1d79c0 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -1122,6 +1122,15 @@
return
M.mind_initialize()
+ else if(href_list["player_ticket_history"])
+ if(!check_rights(R_ADMIN))
+ return
+ var/target_ckey = href_list["player_ticket_history"]
+ GLOB.player_ticket_history.cache_history_for_ckey(target_ckey)
+ GLOB.player_ticket_history.user_selections[usr.ckey] = target_ckey
+ GLOB.player_ticket_history.ui_interact(usr)
+ return
+
else if(href_list["create_object"])
if(!check_rights(R_SPAWN))
return
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index 5e0a5d76c81..e0f05d197f2 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -573,6 +573,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
for(var/I in ticket_interactions)
dat += "[I] "
+ // Helper for opening directly to player ticket history
+ dat += "