cvs: bugtracker /includes comment.php functions.php /template/generic/bug index.php
| From: | Barry Carlyon | Date: | Thu, 07 Aug 2008 09:59:42 +0000 |
| Subject: | cvs: bugtracker /includes comment.php functions.php /template/generic/bug index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2332@lists.php.net to get a copy of this message | ||
bcarlyon Thu Aug 7 09:59:42 2008 UTC
Modified files:
/bugtracker/includes comment.php functions.php
/bugtracker/template/generic/bug index.php
Log:
Tidying up
http://cvs.php.net/viewvc.cgi/bugtracker/includes/comment.php?r1=1.8&r2=1.9&diff_format=u
Index: bugtracker/includes/comment.php
diff -u bugtracker/includes/comment.php:1.8 bugtracker/includes/comment.php:1.9
--- bugtracker/includes/comment.php:1.8 Sat Jul 26 02:33:43 2008
+++ bugtracker/includes/comment.php Thu Aug 7 09:59:42 2008
@@ -31,37 +31,13 @@
function delete_comment() {
}
function spawn_form() {
- global $user,$content,$bug,$form_data;
+ global $user,$content,$bug;
//generate a comment form
-
- //generate template, but reload if needed
- $form_data['bug_id'] = isset($form_data['bug_id']) ?
$form_data['bug_id'] : '';
- $form_data['comment_text'] = isset($form_data['comment_text']) ?
$form_data['comment_text'] : '';
- $form_data['comment_type'] = isset($form_data['comment_type']) ?
$form_data['comment_type'] : '';
- $form_data['handle'] = isset($form_data['handle']) ?
$form_data['handle'] : '';
-
- if (!isset($bug->bug_id) && $form_data['bug_id'])
- {
- //spawn me a bug
- trace('bounce from comment form, need to spawn a bug display');
- $bug->bug_id = $form_data['bug_id'];
- }
- else if (!isset($bug->bug_id))
- {
- trace('buggered');
- //arg!!!
- echo 'fooked';
- exit;
- }
- else
- {
- trace('bug->bug_id is set');
- }
+ //this generates a basic form without all the refill feilds
$form_content = '
<tr> <td style="text-align: center; border-top: 1px solid
#000;"> Add Comment</td> <td colspan="3" style="border-top:
1px solid #000;"></td> </tr>
<tr> <td></td> <td colspan="3">
-{FORM_ERROR}
<form action="/bug/comment/" method="post" name="commentform"
id="commentform" >
<input type="hidden" name="bug_id" value="' . $bug->bug_id .
' " />
';
@@ -73,7 +49,7 @@
$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="{HANDLE}" /><br /><br
/>
+ <label for="handle">Handle/Email:</label> <input type="text"
name="handle" id="handle" value="" /><br /><br />
<label for="password">Password:</label> <input type="password"
name="password" id="password" /><br /><br />
</div>
';
@@ -81,15 +57,23 @@
$form_content .= '
<label for="comment_text">Comment</label>
- <textarea name="comment_text" id="comment_text" rows="7"
cols="55" >{COMMENT_TEXT}</textarea>
+ <textarea name="comment_text" id="comment_text" rows="7"
cols="55" ></textarea>
<div class="blocker" ></div>
<input type="button" value="Submit Comment"
onclick="document.getElementById(\'commentform\').submit()" />
</form>
</td></tr>
';
- $content .= tpl_process($form_content, FALSE);
- //dont want to process everything just the form_content
+ if (!isset($bug->bug_id))
+ {
+ trace('buggered no bug id for comment form');
+ trigger_error('The comment form would spawn but no Bug ID is defined to comment on',
E_USER_ERROR);
+ }
+ else
+ {
+ $content .= $form_content;
+ }
+
return;
}
}
http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.19&r2=1.20&diff_format=u
Index: bugtracker/includes/functions.php
diff -u bugtracker/includes/functions.php:1.19 bugtracker/includes/functions.php:1.20
--- bugtracker/includes/functions.php:1.19 Thu Aug 7 09:25:44 2008
+++ bugtracker/includes/functions.php Thu Aug 7 09:59:42 2008
@@ -31,6 +31,7 @@
}
//function tpl_process($file, $text, $jsscripts = FALSE, $meta_refresh = FALSE) {
+/*
include($_SERVER['DOCUMENT_ROOT'] . '../includes/sanitize.php');
function tpl_process($file, $jsscripts = FALSE, $meta_refresh = FALSE) {
$ext = explode(".",$file);
@@ -141,9 +142,10 @@
$meta = '<meta http-equiv="refresh" content="' .
$meta_refresh['time'] . ';' . $meta_refresh['url'] .'"
/>';
$html = str_replace('</head>',$meta . "\n" .
'</head>',$html);
}
-*/
+*_/
return $html;
}
+*/
function loadvar($var,$default = '') {
//used to do _post the _get in a nest
@@ -174,21 +176,11 @@
$fail = '';
switch ($errno) {
case E_USER_ERROR:
- echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
- echo " Fatal error on line $errline in file $errfile";
- echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
- echo "Aborting...<br />\n";
- exit(1);
- break;
- case E_USER_WARNING:
- $fail = "<b>My WARNING</b> [$errno] $errstr<br />\n";
- break;
- case E_USER_NOTICE:
- $fail = "<b>My NOTICE</b> [$errno] $errstr<br />\n";
+ $fail = $errstr;
+ $backtrace = '<strong>' . $fail . '</strong>';
break;
-
case E_NOTICE:
- $fail = "<b>Notice:</b> $errstr - $errfile, $errline<br />\n";
+ $fail = "<b>Notice:</b> $errstr in $errfile on line $errline<br
/>\n";
$backtrace = '<strong>' . $fail . '</strong>';
break;
case E_WARNING:
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.22&r2=1.23&diff_format=u
Index: bugtracker/template/generic/bug/index.php
diff -u bugtracker/template/generic/bug/index.php:1.22
bugtracker/template/generic/bug/index.php:1.23
--- bugtracker/template/generic/bug/index.php:1.22 Thu Aug 7 09:25:44 2008
+++ bugtracker/template/generic/bug/index.php Thu Aug 7 09:59:42 2008
@@ -61,7 +61,7 @@
$html = '
<a href="/bug/" title="Back to Bug Listing" style="display: block;
text-align: right;">Back to Bug Listing</a>
<table>
-<tr> <td style="width: 100px;"> </td> <td
style="width: 120px;"> </td> <td style="width:
240px;"> </td> <td style="width:
150px;"> </td> </tr>
+<tr> <td style="width: 100px;"> </td> <td
style="width: 100px;"> </td> <td style="width:
260px;"> </td> <td style="width:
150px;"> </td> </tr>
<tr> <td><h4>Bug: #{DSP_BUG_ID}</h4></td> <td
colspan="3" style="width:
220px;">{DSP_SUMMARY}</td> </tr>
<tr>
<td><h4>{DSP_STATUS}</h4></td> <td>Opened:</td> <td>{DSP_REPORTED_ON}</td> <td>{DSP_REPORTED_BY}</td> </tr>
{DSP_SHOW_ASSIGNED}
@@ -101,9 +101,7 @@
</div>
</td> </tr>
{DSP_END_REPRODUCE}
-
-</table>';
-
+';
$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'] = '-->';
if (($bug_row['UNIX_TIMESTAMP(updated)'] !=
$bug_row['UNIX_TIMESTAMP(reported_on)']) &&
($bug_row['UNIX_TIMESTAMP(closed_on)'] != '0'))
@@ -120,6 +118,10 @@
}
$content .= $template->loop(array($bug_row), $html);
+
+ $comment->spawn_form();
+
+ $content .= '</table>';
}
}
else if ($bug_id)