2 /*=====================================================================*\
3 || ################################################################### ||
4 || # [#]app[#] [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./global.php');
15 if (!($bugsys->userinfo
['permissions'] & CANPOSTCOMMENTS
))
21 // ###################################################################
23 if (empty($_REQUEST['do']))
25 $_REQUEST['do'] = 'add';
28 // ###################################################################
30 if ($_POST['do'] == 'insert')
32 sanitize(array('bugid' => INT, 'comment' => STR
));
34 if (!$bugsys->options
['allowhtml'])
36 $vars['comment'] = htmlspecialcharslike($vars['comment']);
40 INSERT INTO " . TABLE_PREFIX
. "comment
41 (bugid, userid, dateline, comment)
43 ($vars[bugid], " . $bugsys->userinfo
['userid'] . ",
44 " . time() . ", '" . addslasheslike($vars['comment']) . "'
48 echo 'comment inserted';
51 // ###################################################################
53 if ($_REQUEST['do'] == 'add')
55 sanitize(array('bugid' => INT));
59 echo 'alert: bad bug';
63 $bug = $DB_sql->query_first("SELECT bug.*, comment.comment FROM " . TABLE_PREFIX
. "bug LEFT JOIN " . TABLE_PREFIX
. "comment AS comment ON (bug.bugid = comment.bugid) WHERE bug.bugid = $vars[bugid]");
66 echo 'alert: bad bug';
70 echo "<div><strong>New comment for:</strong> <em>$bug[summary]</em></div>";
71 echo '<form name="newcomment" method="post" action="newcomment.php"><input type="hidden" name="do" value="insert" /><input type="hidden" name="bugid" value="' . $bug['bugid'] . '" />';
72 echo '<div><strong>Comment:</strong></div><textarea name="comment" cols="100" rows="35"></textarea>';
73 echo '<div><input type="submit" name="submit" value="Add Comment" /></form>';
75 echo '<br /><br /><table border="1" cellspacing="2" cellpadding="4" width="100%"><tr style="background-color:#EEEEEE"><td><strong>Summary Report:</strong> ' . $bug['summary'] . '</td></tr>';
76 echo '<tr><td>' . $bug['comment'] . '</td></tr></table>';
79 /*=====================================================================*\
80 || ###################################################################
83 || ###################################################################
84 \*=====================================================================*/