cvs: bugtracker /htdocs/elements screen.css /includes comment.php /template/generic/bug comment.php index.php
| From: | Barry Carlyon | Date: | Thu, 07 Aug 2008 14:27:24 +0000 |
| Subject: | cvs: bugtracker /htdocs/elements screen.css /includes comment.php /template/generic/bug comment.php index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2336@lists.php.net to get a copy of this message | ||
bcarlyon Thu Aug 7 14:27:24 2008 UTC
Modified files:
/bugtracker/htdocs/elements screen.css
/bugtracker/includes comment.php
/bugtracker/template/generic/bug comment.php index.php
Log:
Running comment engine, hurrah! It doesnt do any authentication yet
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/screen.css?r1=1.8&r2=1.9&diff_format=u
Index: bugtracker/htdocs/elements/screen.css
diff -u bugtracker/htdocs/elements/screen.css:1.8 bugtracker/htdocs/elements/screen.css:1.9
--- bugtracker/htdocs/elements/screen.css:1.8 Sat Jul 26 02:33:43 2008
+++ bugtracker/htdocs/elements/screen.css Thu Aug 7 14:27:20 2008
@@ -154,10 +154,13 @@
border-right: 15px solid #EFEFEF;
border-bottom: 15px solid #EFEFEF;
}
-#description {
+#description, .comment {
border-top: 1px solid #000;
padding: 5px 2px;
}
+.comment {
+ background: #EFEFEF;
+}
.textAreaWithLines {
font-family: courier;
http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.10&r2=1.11&diff_format=u
Index: bugtracker/includes/comment.php
diff -u bugtracker/includes/comment.php:1.10 bugtracker/includes/comment.php:1.11
--- bugtracker/includes/comment.php:1.10 Thu Aug 7 13:31:55 2008
+++ bugtracker/includes/comment.php Thu Aug 7 14:27:23 2008
@@ -48,6 +48,7 @@
<input type="hidden" name="bug_id" value="' . $bug->bug_id .
' " />
{FORM_FORM_ERROR}
';
+$form_data['form_error'] = isset($form_data['form_error']) ?
$form_data['form_error'] : '';
if (!$user->logged_in)
{
@@ -56,14 +57,14 @@
$form_content .= '
<p>If you hold a temporary account the password is that of the last bug you
posted</p><br />
<div class="slim">
- <label for="handle">Handle/Email:</label> <input type="text"
name="handle" id="handle" value="{FORM_HANDLE}" /><br
/><br />
+ <label for="handle">Handle/Email:</label> {ERROR_HANDLE}<input
type="text" name="handle" id="handle" value="{FORM_HANDLE}"
/><br /><br />
<label for="password">Password:</label> <input type="password"
name="password" id="password" /><br /><br />
</div>
';
}
$form_content .= '
- <label for="comment_text">Comment</label>
+ <label for="comment_text">Comment</label> {ERROR_COMMENT_TEXT}
<textarea name="comment_text" id="comment_text" rows="7"
cols="55" >{FORM_COMMENT_TEXT}</textarea>
<div class="blocker" ></div>
<input type="button" value="Submit Comment"
onclick="document.getElementById(\'commentform\').submit()" />
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/comment.php?r1=1.3&r2=1.4&diff_format=u
Index: bugtracker/template/generic/bug/comment.php
diff -u bugtracker/template/generic/bug/comment.php:1.3
bugtracker/template/generic/bug/comment.php:1.4
--- bugtracker/template/generic/bug/comment.php:1.3 Thu Aug 7 13:31:55 2008
+++ bugtracker/template/generic/bug/comment.php Thu Aug 7 14:27:23 2008
@@ -9,11 +9,12 @@
$password = loadvar('password','');
+$form_data = $error_data = array();
+
$form_data['bug_id'] = loadvar('bug_id','');
$form_data['handle'] = loadvar('handle',$user->handle);
$form_data['comment_type'] = $form_data['bug_id'] ? BUG_COMMENT : '';
-$form_data['comment_text'] = loadvar('comment','');
-$form_data['form_error'] = 'Please Correct the Errors Shown';
+$form_data['comment_text'] = loadvar('comment_text','');
foreach ($form_data as $ref => $data)
{
@@ -22,6 +23,16 @@
$error_data[$ref] = TRUE;
}
}
+$form_data['form_error'] = '';
+foreach ($error_data as $ref => $empty)
+{
+ if ($empty)
+ {
+ if (strlen($empty) == 1)
+ $error_data[$ref] = '* Required';
+ $form_data['form_error'] = 'Please Correct the Errors Shown';
+ }
+}
if (!$form_data['comment_type']) {
trigger_error('Unable to determine what kinda comment you are making', E_USER_ERROR);
@@ -48,9 +59,9 @@
}
}
-if (!$form_data['form_error'])
+if (empty($form_data['form_error']))
{
- $comment->add_comment($comment_type, $bug_id, $comment_text, $handle);
+ $comment->add_comment($form_data['comment_type'], $form_data['bug_id'],
$form_data['comment_text'], $form_data['handle']);
if ($db->insert_id) {
$content .= '<div id="success">Your comment has been added
successfully</div>';
} else {
@@ -63,7 +74,7 @@
}
elseif (!$content)
{
- trigger_error('<br />Fatal Drop through the comment engine', E_USER_ERROR);
+ trigger_error('<br />Fatal Drop through the comment engine ', E_USER_ERROR);
}
trace($form_data['form_error']);
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.23&r2=1.24&diff_format=u
Index: bugtracker/template/generic/bug/index.php
diff -u bugtracker/template/generic/bug/index.php:1.23
bugtracker/template/generic/bug/index.php:1.24
--- bugtracker/template/generic/bug/index.php:1.23 Thu Aug 7 09:59:42 2008
+++ bugtracker/template/generic/bug/index.php Thu Aug 7 14:27:23 2008
@@ -51,6 +51,18 @@
$bug_row['password'] = '';
$bug_row = array_merge($bug_row, $comments);
+ //now lets get the normal people comments
+
+ $query = "SELECT handle,comment,updated,UNIX_TIMESTAMP(updated) FROM bug_comment WHERE
bug_id = '{$bug_id}' AND comment_type = " . BUG_COMMENT;
+ $db->get_data($query);
+ $comments = array();
+ //lets push the user comments into an array
+ while ($entry = $db->fetch_row())
+ {
+// $comments[] = array('handle' => $entry['handle'], 'comment'
=> $entry['comment'], 'added' =>
$entry['UNIX_TIMESTAMP(updated)']);
+ $comments[] = $entry;
+ }
+
$template->page_title .= ' ' . $bug_row['summary'];
$template->content_title .= ' ' . $bug_row['summary'];
@@ -101,6 +113,7 @@
</div>
</td> </tr>
{DSP_END_REPRODUCE}
+
';
$bug_row['show_assigned'] = $bug_row['show_updated'] =
$bug_row['show_reproduce'] = $bug_row['show_closed'] = '<!--';
$bug_row['end_assigned'] = $bug_row['end_updated'] =
$bug_row['end_reproduce'] = $bug_row['end_closed'] = '-->';
@@ -119,6 +132,10 @@
$content .= $template->loop(array($bug_row), $html);
+ $comment_html = '<tr><td></td><td colspan="3"
class="comment">{DSP_HANDLE} commented<br
/> {DSP_COMMENT}<br /><div style="text-align: right;
float: right;">@ {DSP_UPDATED}</div></td></tr>';
+
+ $content .= $template->loop($comments, $comment_html);
+
$comment->spawn_form();
$content .= '</table>';