forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/datum/admin_help | ||
/// Who is handling this admin help? | ||
var/handler | ||
|
||
/datum/admin_help/ClosureLinks(ref_src) | ||
. = ..() | ||
. += " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=handle_issue'>HANDLE</A>)" | ||
|
||
// Let the initiator know their ahelp is being handled | ||
/datum/admin_help/proc/handle_issue(key_name = key_name_admin(usr)) | ||
if(state != AHELP_ACTIVE) | ||
return FALSE | ||
|
||
if(handler && handler == usr.ckey) // No need to handle it twice as the same person ;) | ||
return TRUE | ||
|
||
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 FALSE | ||
|
||
var/msg = span_adminhelp("Your ticket is now being handled by [key_name]! Please wait while they type their response and/or gather relevant information.") | ||
|
||
if(initiator) | ||
to_chat(initiator, msg) | ||
|
||
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "handling") | ||
msg = "Ticket [TicketHref("#[id]")] is being handled by [key_name]" | ||
message_admins(msg) | ||
log_admin_private(msg) | ||
AddInteraction("Being handled by [key_name]", "Being handled by [key_name_admin(usr, FALSE)]") | ||
|
||
handler = "[usr.ckey]" | ||
return TRUE | ||
|
||
/* | ||
/// Confirm that the admin trying to take over the handling of a ticket really wants to do that | ||
/datum/admin_help/proc/confirm_takeover() | ||
if(!handler || handler != usr.ckey) | ||
return FALSE | ||
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 == "Yes") | ||
return TRUE | ||
return FALSE | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters