diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm
index fb263841462..5abd6f165f3 100644
--- a/code/controllers/subsystem/jobs.dm
+++ b/code/controllers/subsystem/jobs.dm
@@ -8,6 +8,8 @@ SUBSYSTEM_DEF(jobs)
var/list/name_occupations = list() //Dict of all jobs, keys are titles
var/list/type_occupations = list() //Dict of all jobs, keys are types
var/list/prioritized_jobs = list() // List of jobs set to priority by HoP/Captain
+ var/list/id_change_records = list() // List of all job transfer records
+ var/list/id_change_counter = 1
//Players who need jobs
var/list/unassigned = list()
//Debug info
@@ -615,4 +617,61 @@ SUBSYSTEM_DEF(jobs)
jobs_to_formats[job.title] = "linkEncourage" // jobs with nobody doing them at all are encouraged
else if(job.total_positions >= 0 && job.current_positions >= job.total_positions)
jobs_to_formats[job.title] = "linkDiscourage" // jobs that are full (no free positions) are discouraged
- return jobs_to_formats
\ No newline at end of file
+ return jobs_to_formats
+
+
+/datum/controller/subsystem/jobs/proc/log_job_transfer(transferee, oldvalue, newvalue, whodidit)
+ id_change_records["[id_change_counter]"] = list("transferee" = transferee, "oldvalue" = oldvalue, "newvalue" = newvalue, "whodidit" = whodidit, "timestamp" = station_time_timestamp())
+ id_change_counter++
+
+/datum/controller/subsystem/jobs/proc/fetch_transfer_record_html(var/centcom)
+ var/record_html = "
"
+
+ var/table_headers = list("Crewman", "Old Rank", "New Rank", "Authorized By", "Time")
+ var/hidden_fields = list("deletedby")
+ if(centcom)
+ table_headers += "Deleted By"
+ record_html += ""
+ for(var/thisheader in table_headers)
+ record_html += "| [thisheader] | "
+ record_html += "
"
+
+ var/visible_record_count = 0
+ for(var/thisid in id_change_records)
+ var/thisrecord = id_change_records[thisid]
+
+ if(thisrecord["deletedby"] && !centcom)
+ continue
+
+ record_html += ""
+ for(var/lkey in thisrecord)
+ if(lkey in hidden_fields)
+ if(centcom)
+ record_html += "| [thisrecord[lkey]] | "
+ else
+ continue
+ else
+ record_html += "[thisrecord[lkey]] | "
+ record_html += "
"
+ visible_record_count++
+
+ record_html += "
"
+
+ if(!visible_record_count)
+ return "No records on file yet."
+ return record_html
+
+/datum/controller/subsystem/jobs/proc/delete_log_records(sourceuser, delete_all)
+ . = 0
+ if(!sourceuser)
+ return
+ var/list/new_id_change_records = list()
+ for(var/thisid in id_change_records)
+ var/thisrecord = id_change_records[thisid]
+ if(!thisrecord["deletedby"])
+ if(delete_all || thisrecord["whodidit"] == sourceuser)
+ thisrecord["deletedby"] = sourceuser
+ .++
+ new_id_change_records["[id_change_counter]"] = thisrecord
+ id_change_counter++
+ id_change_records = new_id_change_records
\ No newline at end of file
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index f67fa2ca901..60d11cc1e30 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -243,6 +243,7 @@ var/time_last_changed_position = 0
data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----"
data["target_rank"] = get_target_rank()
data["scan_name"] = scan ? scan.name : "-----"
+ data["scan_owner"] = scan && scan.registered_name ? scan.registered_name : null
data["authenticated"] = is_authenticated(user)
data["has_modify"] = !!modify
data["account_number"] = modify ? modify.associated_account_number : null
@@ -273,6 +274,9 @@ var/time_last_changed_position = 0
data["cooldown_mins"] = mins
data["cooldown_secs"] = (seconds < 10) ? "0[seconds]" : seconds
+ if(mode == 3 && is_authenticated(user))
+ data["id_change_html"] = SSjobs.fetch_transfer_record_html(is_centcom())
+
if(modify)
data["current_skin"] = modify.icon_state
@@ -378,11 +382,12 @@ var/time_last_changed_position = 0
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t && modify)
+ SSjobs.log_job_transfer(modify.registered_name, modify.getRankAndAssignment(), temp_t, scan.registered_name)
modify.assignment = temp_t
log_game("[key_name(usr)] has given \"[modify.registered_name]\" the custom job title \"[temp_t]\".")
else
var/list/access = list()
- if(is_centcom())
+ if(is_centcom() && islist(get_centcom_access(t1)))
access = get_centcom_access(t1)
else
var/datum/job/jobdatum
@@ -402,6 +407,8 @@ var/time_last_changed_position = 0
if(t1 == "Civilian")
message_admins("[key_name_admin(usr)] has reassigned \"[modify.registered_name]\" from \"[jobnamedata]\" to \"[t1]\".")
+ SSjobs.log_job_transfer(modify.registered_name, jobnamedata, t1, scan.registered_name)
+
var/mob/living/carbon/human/H = modify.getPlayer()
if(istype(H))
if(jobban_isbanned(H, t1))
@@ -409,6 +416,7 @@ var/time_last_changed_position = 0
if(H.mind)
H.mind.playtime_role = t1
+
modify.access = access
modify.rank = t1
modify.assignment = t1
@@ -438,6 +446,20 @@ var/time_last_changed_position = 0
if("mode")
mode = text2num(href_list["mode_target"])
+ if("wipe_my_logs")
+ if(is_authenticated(usr))
+ var/delcount = SSjobs.delete_log_records(scan.registered_name, FALSE)
+ if(delcount)
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ SSnanoui.update_uis(src)
+
+ if("wipe_all_logs")
+ if(is_authenticated(usr) && !target_dept)
+ var/delcount = SSjobs.delete_log_records(scan.registered_name, TRUE)
+ if(delcount)
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ SSnanoui.update_uis(src)
+
if("print")
if(!printing && !target_dept)
printing = 1
@@ -476,6 +498,7 @@ var/time_last_changed_position = 0
var/jobnamedata = modify.getRankAndAssignment()
log_game("[key_name(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
message_admins("[key_name_admin(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
+ SSjobs.log_job_transfer(modify.registered_name, jobnamedata, "Terminated", scan.registered_name)
modify.assignment = "Terminated"
modify.access = list()
callHook("terminate_employee", list(modify))
@@ -496,6 +519,7 @@ var/time_last_changed_position = 0
var/jobnamedata = modify.getRankAndAssignment()
log_game("[key_name(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Demoted)\".")
message_admins("[key_name_admin(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Demoted)\".")
+ SSjobs.log_job_transfer(modify.registered_name, jobnamedata, "Demoted", scan.registered_name)
modify.access = access
modify.rank = "Civilian"
diff --git a/code/modules/modular_computers/file_system/programs/command/card.dm b/code/modules/modular_computers/file_system/programs/command/card.dm
index 00b2e4d9056..82abf75d36f 100644
--- a/code/modules/modular_computers/file_system/programs/command/card.dm
+++ b/code/modules/modular_computers/file_system/programs/command/card.dm
@@ -224,11 +224,12 @@
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t && modify)
+ SSjobs.log_job_transfer(modify.registered_name, modify.getRankAndAssignment(), temp_t, scan.registered_name)
modify.assignment = temp_t
log_game("[key_name(usr)] has given \"[modify.registered_name]\" the custom job title \"[temp_t]\".")
else
var/list/access = list()
- if(is_centcom)
+ if(is_centcom && islist(get_centcom_access(t1)))
access = get_centcom_access(t1)
else
var/datum/job/jobdatum
@@ -248,6 +249,7 @@
if(t1 == "Civilian")
message_admins("[key_name_admin(usr)] has reassigned \"[modify.registered_name]\" from \"[jobnamedata]\" to \"[t1]\".")
+ SSjobs.log_job_transfer(modify.registered_name, jobnamedata, t1, scan.registered_name)
var/mob/living/carbon/human/H = modify.getPlayer()
if(istype(H))
if(jobban_isbanned(H, t1))
@@ -277,6 +279,18 @@
if("PRG_mode")
mode = text2num(href_list["mode_target"])
+ if("PRG_wipe_my_logs")
+ if(is_authenticated(usr))
+ var/delcount = SSjobs.delete_log_records(scan.registered_name, FALSE)
+ if(delcount)
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
+ if("PRG_wipe_all_logs")
+ if(is_authenticated(usr))
+ var/delcount = SSjobs.delete_log_records(scan.registered_name, TRUE)
+ if(delcount)
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
if("PRG_print")
if(!printing && computer)
printing = 1
@@ -318,6 +332,7 @@
var/jobnamedata = modify.getRankAndAssignment()
log_game("[key_name(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
message_admins("[key_name_admin(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
+ SSjobs.log_job_transfer(modify.registered_name, jobnamedata, "Terminated", scan.registered_name)
modify.assignment = "Terminated"
modify.access = list()
callHook("terminate_employee", list(modify))
@@ -404,6 +419,7 @@
data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----"
data["target_rank"] = get_target_rank()
data["scan_name"] = scan ? scan.name : "-----"
+ data["scan_owner"] = scan && scan.registered_name ? scan.registered_name : null
data["authenticated"] = is_authenticated(user)
data["has_modify"] = !!modify
data["account_number"] = modify ? modify.associated_account_number : null
@@ -432,6 +448,9 @@
data["cooldown_mins"] = mins
data["cooldown_secs"] = (seconds < 10) ? "0[seconds]" : seconds
+ if(mode == 3 && is_authenticated(user))
+ data["id_change_html"] = SSjobs.fetch_transfer_record_html(is_centcom)
+
if(modify)
data["current_skin"] = modify.icon_state
diff --git a/nano/templates/card_prog.tmpl b/nano/templates/card_prog.tmpl
index 46263ffbba9..a22c2a3434c 100644
--- a/nano/templates/card_prog.tmpl
+++ b/nano/templates/card_prog.tmpl
@@ -11,6 +11,7 @@
{{:helper.link('Job Management', 'gear', {'action' : 'PRG_mode', 'mode_target' : 1}, data.mode == 1 ? 'disabled' : null)}}
{{:helper.link('Crew Manifest', 'folder-open', {'action' : 'PRG_mode', 'mode_target' : 2}, data.mode == 2 ? 'disabled' : null)}}
{{:helper.link('Print', 'print', {'action' : 'PRG_print'}, data.printer && (data.mode == 2 || data.has_modify && !data.mode) ? null : 'disabled')}}
+ {{:helper.link('Records', 'file', {'action' : 'PRG_mode', 'mode_target' : 3}, (data.mode == 3) ? 'disabled' : null)}}
{{if data.mode == 1}}
@@ -52,6 +53,29 @@
{{:data.manifest}}
+ {{else data.mode == 3}}
+
+
Records
+
+
+
+ Authorized Identity:
+
+
+ {{:helper.link(data.scan_name, 'eject', {'action' : 'scan'})}}
+
+
+
+ {{if data.authenticated}}
+ {{:data.id_change_html}}
+ {{:helper.link('Delete Records By: ' + data.scan_owner, null, {'action' : 'PRG_wipe_my_logs'}, null, 'linkDanger')}}
+ {{if !data.target_dept}}
+ {{:helper.link('Delete ALL Records', null, {'action' : 'PRG_wipe_all_logs'}, null, 'linkDanger')}}
+ {{/if}}
+ {{else}}
+ Please insert an authorized ID into the terminal to proceed.
+ {{/if}}
+
{{else}}
Access Modification
@@ -152,7 +176,7 @@
{{if data.target_rank == "Terminated"}}
{{:data.target_owner}} has already been terminated!
{{else}}
- {{:helper.link('Terminate ' + data.target_owner, 'gear', {'choice' : 'terminate'}, data.target_rank == "Terminated" ? 'disabled' : null, data.target_rank == "Terminated" ? 'disabled' : 'linkDanger')}}
+ {{:helper.link('Terminate ' + data.target_owner, 'gear', {'action' : 'PRG_terminate'}, data.target_rank == "Terminated" ? 'disabled' : null, data.target_rank == "Terminated" ? 'disabled' : 'linkDanger')}}
{{/if}}
@@ -173,7 +197,7 @@
Special |
{{for data.top_jobs}}
- {{:helper.link(value.display_name, '', {'choice' : 'assign', 'assign_target' : value.job}, value.jlinkformat == 'disabled' ? 'disabled' : null, value.jlinkformat ? value.jlinkformat : null)}}
+ {{:helper.link(value.display_name, '', {'action' : 'PRG_assign', 'assign_target' : value.job}, value.jlinkformat == 'disabled' ? 'disabled' : null, value.jlinkformat ? value.jlinkformat : null)}}
{{/for}}
|
diff --git a/nano/templates/identification_computer.tmpl b/nano/templates/identification_computer.tmpl
index e7d29d67c0d..2eabe537128 100644
--- a/nano/templates/identification_computer.tmpl
+++ b/nano/templates/identification_computer.tmpl
@@ -11,7 +11,8 @@
{{if !data.target_dept}}{{:helper.link('Job Management', 'gear', {'choice' : 'mode', 'mode_target' : 1}, data.mode == 1 ? 'disabled' : null)}}{{/if}}
{{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 2}, data.mode == 2 ? 'disabled' : null)}}
{{if !data.target_dept}}{{:helper.link('Print', 'print', {'choice' : 'print'}, (data.mode == 2 || data.has_modify && !data.mode) ? null : 'disabled')}}{{/if}}
-
+ {{:helper.link('Records', 'file', {'choice' : 'mode', 'mode_target' : 3}, (data.mode == 3) ? 'disabled' : null)}}
+
{{if data.mode == 1 && !data.target_dept}}
Job Management
@@ -52,6 +53,29 @@
{{:data.manifest}}
+ {{else data.mode == 3}}
+
+
Records
+
+
+
+ Authorized Identity:
+
+
+ {{:helper.link(data.scan_name, 'eject', {'choice' : 'scan'})}}
+
+
+
+ {{if data.authenticated}}
+ {{:data.id_change_html}}
+ {{:helper.link('Delete Records By: ' + data.scan_owner, null, {'choice' : 'wipe_my_logs'}, null, 'linkDanger')}}
+ {{if !data.target_dept}}
+ {{:helper.link('Delete ALL Records', null, {'choice' : 'wipe_all_logs'}, null, 'linkDanger')}}
+ {{/if}}
+ {{else}}
+ Please insert an authorized ID into the terminal to proceed.
+ {{/if}}
+
{{else}}
Access Modification