From 3594385acad5ba77af14b51b8620dd05744e97f1 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 4 Sep 2023 11:54:42 +0100 Subject: [PATCH] fixes the claim button fix mark lock --- code/game/machinery/ARES/AdminAres.dm | 25 +++++++++++++++++++++- tgui/packages/tgui/interfaces/AresAdmin.js | 6 ++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/ARES/AdminAres.dm b/code/game/machinery/ARES/AdminAres.dm index ffc3260d14bf..0b7168902325 100644 --- a/code/game/machinery/ARES/AdminAres.dm +++ b/code/game/machinery/ARES/AdminAres.dm @@ -194,7 +194,7 @@ for(var/datum/ares_ticket/access/access_ticket as anything in tickets_access) var/lock_status = TICKET_OPEN switch(access_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) + if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) lock_status = TICKET_CLOSED var/list/current_ticket = list() @@ -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) diff --git a/tgui/packages/tgui/interfaces/AresAdmin.js b/tgui/packages/tgui/interfaces/AresAdmin.js index 7328516883ee..d19329094827 100644 --- a/tgui/packages/tgui/interfaces/AresAdmin.js +++ b/tgui/packages/tgui/interfaces/AresAdmin.js @@ -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';