Allow sec hud to add comment to sec record

Add a direct [Add comment] link in the examine text
Add a comment in the record comment list, signed with the current
authentication of the HUD wearer

Add a [View comments log] link in the security record view from the
Security Hud
This list all the comments as on the security record computer
This commit is contained in:
jupotter
2013-04-08 14:13:58 +02:00
parent 4b9d14b564
commit 12c7cfc88a
2 changed files with 60 additions and 2 deletions

View File

@@ -413,7 +413,7 @@
msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=`'>\[View\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=`'>\[View\]</a> <a href='?src=\ref[src];secrecordadd=`'>\[Add comment\]</a>\n"
//msg += "\[Set Hostile Identification\]\n"
if(istype(usr, /mob/living/carbon/human))
@@ -439,7 +439,6 @@
msg += "<span class = 'deptradio'>Physical status:</span> <a href='?src=\ref[src];medical=1'>\[[medical]\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a> <a href='?src=\ref[src];medrecordadd=`'>\[Add comment\]</a>\n"

View File

@@ -568,11 +568,70 @@
usr << "<b>Major Crimes:</b> [R.fields["ma_crim"]]"
usr << "<b>Details:</b> [R.fields["ma_crim_d"]]"
usr << "<b>Notes:</b> [R.fields["notes"]]"
usr << "<a href='?src=\ref[src];secrecordComment=`'>\[View Comment Log\]</a>"
read = 1
if(!read)
usr << "\red Unable to locate a data core entry for this person."
if (href_list["secrecordComment"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/weapon/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for (var/datum/data/record/E in data_core.general)
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
usr << text("[]", R.fields[text("com_[]", counter)])
counter++
if (counter == 1)
usr << "No comment found"
usr << "<a href='?src=\ref[src];secrecordadd=`'>\[Add comment\]</a>"
if(!read)
usr << "\red Unable to locate a data core entry for this person."
if (href_list["secrecordadd"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
var/perpname = "wot"
if(wear_id)
if(istype(wear_id,/obj/item/weapon/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for (var/datum/data/record/E in data_core.general)
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))
var/t1 = copytext(sanitize(input("Add Comment:", "Sec. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || src.stat || src.restrained() || !(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.glasses, /obj/item/clothing/glasses/sunglasses/sechud))))
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
R.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]",H.get_authentification_name(), H.get_assignment(), time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
if (href_list["medical"])
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr