Skip to content

Commit

Permalink
Merge branch 'project/ares/admin_console' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Sep 4, 2023
2 parents ea7d269 + f35b700 commit e572062
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
23 changes: 23 additions & 0 deletions code/game/machinery/ARES/AdminAres.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,29 @@
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "read_deleted"

if("claim_ticket")
var/datum/ares_ticket/ticket = locate(params["ticket"])
if(!istype(ticket))
return FALSE
var/claim = TRUE
var/assigned = ticket.ticket_assignee
if(assigned)
if(assigned == MAIN_AI_SYSTEM)
var/prompt = tgui_alert(usr, "You already claimed this ticket! Do you wish to drop your claim?", "Unclaim ticket", list("Yes", "No"))
if(prompt != "Yes")
return FALSE
/// set ticket back to pending
ticket.ticket_assignee = null
ticket.ticket_status = TICKET_PENDING
return claim
var/choice = tgui_alert(usr, "This ticket has already been claimed by [assigned]! Do you wish to override their claim?", "Claim Override", list("Yes", "No"))
if(choice != "Yes")
claim = FALSE
if(claim)
ticket.ticket_assignee = MAIN_AI_SYSTEM
ticket.ticket_status = TICKET_ASSIGNED
return claim

if("auth_access")
var/datum/ares_ticket/access/access_ticket = locate(params["ticket"])
if(!access_ticket)
Expand Down
6 changes: 2 additions & 4 deletions tgui/packages/tgui/interfaces/AresAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1691,13 +1691,11 @@ const AccessManagement = (props, context) => {
)}
{access_tickets.map((ticket, i) => {
let can_claim = 'Yes';
if (ticket.assignee === logged_in) {
can_claim = 'No';
} else if (ticket.lock_status === 'CLOSED') {
if (ticket.lock_status === 'CLOSED') {
can_claim = 'No';
}
let can_update = 'Yes';
if (ticket.assignee !== logged_in) {
if (ticket.assignee !== 'ARES v3.2') {
can_update = 'No';
} else if (ticket.lock_status === 'CLOSED') {
can_update = 'No';
Expand Down

0 comments on commit e572062

Please sign in to comment.