From 00be6363ead8c58ef85c96e41df85594df9bdef0 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Tue, 10 Aug 2010 23:44:21 +0000 Subject: [PATCH] Added ability to delete case notes as supervisor --- admin/supervisor.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/admin/supervisor.php b/admin/supervisor.php index bdadebe2..edae5840 100644 --- a/admin/supervisor.php +++ b/admin/supervisor.php @@ -72,6 +72,18 @@ $operator_id = get_operator_id(); $case_id = false; if (isset($_GET['case_id'])) $case_id = bigintval($_GET['case_id']); + +if (isset($_GET['case_note_id'])) +{ + $case_note_id = bigintval($_GET['case_note_id']); + + $sql = "DELETE FROM case_note + WHERE case_id = '$case_id' + AND case_note_id = '$case_note_id'"; + + $db->Execute($sql); +} + xhtml_head(T_("Supervisor functions"),true,array("../css/table.css"),array("../js/window.js")); print "

" . T_("Enter a case id or select a case from the list below:") . "

"; @@ -215,7 +227,7 @@ if ($case_id != false) } //view notes - $sql = "SELECT DATE_FORMAT(CONVERT_TZ(c.datetime,'UTC',op.Time_zone_name),'".DATE_TIME_FORMAT."') as time, op.firstName, op.lastName, c.note as note + $sql = "SELECT DATE_FORMAT(CONVERT_TZ(c.datetime,'UTC',op.Time_zone_name),'".DATE_TIME_FORMAT."') as time, op.firstName, op.lastName, c.note as note, CONCAT('". T_("Delete") . "') as link FROM `case_note` as c JOIN (operator as op) on (c.operator_id = op.operator_id) WHERE c.case_id = '$case_id' @@ -229,7 +241,7 @@ if ($case_id != false) if (empty($rs)) print "

" . T_("No notes") . "

"; else - xhtml_table($rs,array("time","firstName","note"),array(T_("Date/Time"),T_("Operator"),T_("Note"))); + xhtml_table($rs,array("time","firstName","note","link"),array(T_("Date/Time"),T_("Operator"),T_("Note"),T_("Delete"))); //add a note