From 3fb42571abe4fc805f6ca30a0ec4435cca8a7be3 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Thu, 9 Apr 2020 22:24:37 -0700 Subject: [PATCH] Employment records use comments like medical records (#6976) --- code/game/machinery/computer/skills.dm | 54 ++++++++++++++----- .../atermonera_employment_comments.yml | 4 ++ 2 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 html/changelogs/atermonera_employment_comments.yml diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 50ccdb47d85..1a64db73893 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -91,19 +91,28 @@ var/icon/side = active1.fields["photo_side"] user << browse_rsc(front, "front.png") user << browse_rsc(side, "side.png") - dat += text(" \ -
\ - Name: [active1.fields["name"]]
\ - ID: [active1.fields["id"]]
\n \ - Entity Classification: [active1.fields["brain_type"]]
\n \ - Sex: [active1.fields["sex"]]
\n \ - Age: [active1.fields["age"]]
\n \ - Rank: [active1.fields["rank"]]
\n \ - Fingerprint: [active1.fields["fingerprint"]]
\n \ - Physical Status: [active1.fields["p_stat"]]
\n \ - Mental Status: [active1.fields["m_stat"]]

\n \ - Employment/skills summary:
[decode(active1.fields["notes"])]
Photo:
\ -
") + dat += "" + + dat += "
" + dat += "Name: [active1.fields["name"]]
" + dat += "ID: [active1.fields["id"]]
\n" + dat += "Entity Classification: [active1.fields["brain_type"]]
\n" + dat += "Sex: [active1.fields["sex"]]
\n" + dat += "Age: [active1.fields["age"]]
\n" + dat += "Rank: [active1.fields["rank"]]
\n" + dat += "Fingerprint: [active1.fields["fingerprint"]]
\n" + dat += "Physical Status: [active1.fields["p_stat"]]
\n" + dat += "Mental Status: [active1.fields["m_stat"]]

\n" + + dat += "Employment/skills summary:
" + dat += decode(active1.fields["notes"]) + dat += "


" + var/counter = 1 + while(src.active1.fields[text("com_[]", counter)]) + dat += text("[]
Delete Entry

", src.active1.fields[text("com_[]", counter)], src, counter) + counter++ + dat += "Add Entry

Photo:
" + dat += "
" else dat += "General Record Lost!
" dat += text("\nDelete Record (ALL)

\nPrint Record
\nBack
", src, src, src) @@ -285,6 +294,25 @@ What a mess.*/ P.name = "Employment Record (Unknown/Invald Entry)" log_debug("[usr] ([usr.ckey]) attempted to print a null employee record, this should be investigated.") printing = null +// Add comment + if ("add_c") + if (!( istype(src.active1, /datum/data/record) )) + return + var/a1 = src.active1 + var/t1 = sanitize(input("Add Comment:", "Emp. records", null, null) as message) + if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1)) + return + var/counter = 1 + while(src.active1.fields[text("com_[]", counter)]) + counter++ + src.active1.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]
[t1]") +// Delete comment + if ("del_c") + var/target = href_list["del_c"] + if (istype(src.active1, /datum/data/record) && src.active1.fields["com_[target]"]) + src.active1.fields["com_[target]"] = "Deleted" + + //RECORD DELETE if ("Delete All Records") temp = "" diff --git a/html/changelogs/atermonera_employment_comments.yml b/html/changelogs/atermonera_employment_comments.yml new file mode 100644 index 00000000000..9070a680541 --- /dev/null +++ b/html/changelogs/atermonera_employment_comments.yml @@ -0,0 +1,4 @@ +author: Atermonera +delete-after: True +changes: + - tweak: "Employment records can have comments similar to medical records."