From 659f1843c145bbf9490bcf1eb0a6c2c7d9e37e68 Mon Sep 17 00:00:00 2001
From: tf-4 <8881105+tf-4@users.noreply.github.com>
Date: Mon, 21 Oct 2024 22:00:36 +0100
Subject: [PATCH] pip install github-copilot
---
code/modules/admin/verbs/adminhelp.dm | 45 +++++++++++++++++++++++--
code/modules/admin/verbs/adminpm.dm | 8 ++++-
modular_doppler/ticket_handler/admin.dm | 45 +++++++++++++++++++++++++
tgstation.dme | 1 +
4 files changed, 95 insertions(+), 4 deletions(-)
create mode 100644 modular_doppler/ticket_handler/admin.dm
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index 0ba144caa1cb9..7ebb87447273b 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -210,13 +210,18 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
* * msg_raw - The first message of this admin_help: used for the initial title of the ticket
* * is_bwoink - Boolean operator, TRUE if this ticket was started by an admin PM
*/
-/datum/admin_help/New(msg_raw, client/C, is_bwoink, urgent = FALSE)
+/datum/admin_help/New(msg_raw, client/C, is_bwoink, client/admin_C, urgent = FALSE) // DOPPLER EDIT - Add admin_C
//clean the input msg
var/msg = sanitize(copytext_char(msg_raw, 1, MAX_MESSAGE_LEN))
if(!msg || !C || !C.mob)
qdel(src)
return
+ // DOPPLER EDIT ADDITION BEGIN
+ if(admin_C && is_bwoink)
+ handler = "[admin_C.ckey]"
+ // DOPPLER EDIT END
+
id = ++ticket_counter
opened_at = world.time
@@ -482,6 +487,12 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/datum/admin_help/proc/Close(key_name = key_name_admin(usr), silent = FALSE)
if(state != AHELP_ACTIVE)
return
+ // DOPPLER EDIT ADDITION BEGIN - Ticket handling
+ if(handler && handler != usr.ckey)
+ var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
+ if(!response || response == "No")
+ return
+ // DOPPLER EDIT ADDITION END
RemoveActive()
state = AHELP_CLOSED
GLOB.ahelp_tickets.ListInsert(src)
@@ -497,6 +508,12 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/datum/admin_help/proc/Resolve(key_name = key_name_admin(usr), silent = FALSE)
if(state != AHELP_ACTIVE)
return
+ // DOPPLER EDIT ADDITION BEGIN - Ticket handling
+ if(handler && handler != usr.ckey)
+ var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
+ if(!response || response == "No")
+ return
+ // DOPPLER EDIT ADDITION END
RemoveActive()
state = AHELP_RESOLVED
GLOB.ahelp_tickets.ListInsert(src)
@@ -517,6 +534,13 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state != AHELP_ACTIVE)
return
+ // DOPPLER EDIT ADDITION BEGIN - Ticket handling
+ if(handler && handler != usr.ckey)
+ var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
+ if(!response || response == "No")
+ return
+ // DOPPLER EDIT ADDITION END
+
if(initiator)
initiator.giveadminhelpverb()
@@ -539,6 +563,13 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state != AHELP_ACTIVE)
return
+ // DOPPLER EDIT ADDITION BEGIN - Ticket handling
+ if(handler && handler != usr.ckey)
+ var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
+ if(!response || response == "No")
+ return
+ // DOPPLER EDIT ADDITION END
+
var/msg = "- AdminHelp marked as IC issue! -
"
msg += "Your issue has been determined by an administrator to be an in character issue and does NOT require administrator intervention at this time. For further resolution you should pursue options that are in character."
@@ -638,7 +669,11 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if("reject")
Reject()
if("reply")
- usr.client.cmd_ahelp_reply(initiator)
+ // DOPPLER EDIT START - ADMIN HANDLE
+ //usr.client.cmd_ahelp_reply(initiator) ORIGINAL
+ if(handle_issue())
+ usr.client.cmd_ahelp_reply(initiator)
+ // DOPPLER EDIT END
if("icissue")
ICIssue()
if("close")
@@ -647,6 +682,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
Resolve()
if("reopen")
Reopen()
+ // DOPPLER EDIT ADDITION START
+ if("handle_issue")
+ handle_issue()
+ // DOPPLER EDIT ADDITION END
/datum/admin_help/proc/player_ticket_panel()
var/list/dat = list("