From c165fd28c07d1d5ccc49816dbd3e03ce4d277176 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 8 May 2005 05:37:19 +0000 Subject: [PATCH] r98: Show first comment on edit bug screen --- docs/todo.txt | 1 - editreport.php | 25 +++++++++++++++++++++++++ templates/default/editreport.tpl | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/todo.txt b/docs/todo.txt index 8986469..39b579c 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -33,7 +33,6 @@ BUGTRACK 1.0 ---------------------------------------- - Attachment uploading - Custom bug fields -- Show first comment on edit bug screen - Default templates in the description field - Show selected PCV info - Help bubbles detailing each field diff --git a/editreport.php b/editreport.php index 9c8053e..e9fc9df 100644 --- a/editreport.php +++ b/editreport.php @@ -89,6 +89,29 @@ if ($_POST['do'] == 'update') WHERE bugid = $bug[bugid]" ); + if (!$bugsys->in['firstcomment']) + { + echo 'you need to enter some text in the first comment'; + exit; + } + + $bugsys->in['comment_parsed'] = $bugsys->in['firstcomment']; + + if (!$bugsys->options['allowhtml']) + { + $bugsys->in['comment_parsed'] = $bugsys->sanitize($bugsys->in['comment_parsed']); + } + + // we could pass this as a GET param, but that's unsafe + $firstcomment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline ASC LIMIT 1"); + + $db->query(" + UPDATE " . TABLE_PREFIX . "comment + SET comment = '" . $bugsys->in['firstcomment'] . "', + comment_parsed = '" . nl2br($bugsys->in['comment_parsed']) . "' + WHERE commentid = $firstcomment[commentid]" + ); + if ($bugsys->in['changeproduct']) { $_REQUEST['do'] = 'editproduct'; @@ -153,6 +176,8 @@ if ($_REQUEST['do'] == 'edit') $pcv_select = construct_pcv_select("p$bug[productid]c$bug[componentid]v$bug[versionid]"); + $firstcomment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline ASC LIMIT 1"); + eval('$template->flush("' . $template->fetch('editreport') . '");'); } diff --git a/templates/default/editreport.tpl b/templates/default/editreport.tpl index c49cd59..add408a 100644 --- a/templates/default/editreport.tpl +++ b/templates/default/editreport.tpl @@ -20,5 +20,7 @@
$pcv_select
+
First Comment:
+
\ No newline at end of file -- 2.22.5