cvs: bugtracker /template/generic/report index.php report.php
| From: | Barry Carlyon | Date: | Thu, 07 Aug 2008 09:33:04 +0000 |
| Subject: | cvs: bugtracker /template/generic/report index.php report.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2331@lists.php.net to get a copy of this message | ||
bcarlyon Thu Aug 7 09:33:04 2008 UTC
Modified files:
/bugtracker/template/generic/report index.php report.php
Log:
Patched templates to work with adjusted template engine
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/index.php?r1=1.12&r2=1.13&diff_format=u
Index: bugtracker/template/generic/report/index.php
diff -u bugtracker/template/generic/report/index.php:1.12
bugtracker/template/generic/report/index.php:1.13
--- bugtracker/template/generic/report/index.php:1.12 Thu Aug 7 08:59:50 2008
+++ bugtracker/template/generic/report/index.php Thu Aug 7 09:33:04 2008
@@ -2,8 +2,8 @@
require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php');
-$this->page_title .= 'Reporting a bug';
-$this->content_title = 'Reporting a bug';
+$template->page_title .= 'Reporting a bug';
+$template->content_title = 'Reporting a bug';
$form_data['form_error'] = isset($form_data['form_error']) ? '<div
id="error">' . $form_data['form_error'] . '</div>' :
'';
//form_data recovers form_data
@@ -22,7 +22,7 @@
$error_data = isset($error_data) ? $error_data : array();
-$this->prehtml = '<p>
+$template->prehtml = '<p>
Before you report a bug, make sure to search for similar bugs using the form at the top of the page
or our <a href="/search.php">advanced search page</a>.
<br /><br />
Also, read the instructions for <a href="/how-to-report.php">how to report a bug
that someone will want to help fix</a>.
@@ -42,7 +42,7 @@
//time to process
$content = '{DSP_FORM_ERROR}';
-$content = $this->swap('dsp_form_error', $form_data['form_error'],
$content);
+$content = $template->swap('dsp_form_error', $form_data['form_error'],
$content);
$content .= '
<form action="/report/report/" method="post" class="form">
@@ -67,7 +67,6 @@
<br /><br />
<!-- capthcha -->
<label for="captcha">Captcha: {ERROR_CAPTCHA}</label> <div
id="captcha">';
-global $recaptcha_key;
$content .= recaptcha_get_html($recaptcha_key,$form_data['recap_error']);
$content .= ' </div><hr />
{ENDIF LOGGED_IN}
@@ -105,7 +104,7 @@
<input type="submit" value="Send Bug Report" style="margin-right:
200px;" />
</form>';
-$content = $this->dontloop(array('form' => $form_data, 'error' =>
$error_data), $content);
+$content = $template->dontloop(array('form' => $form_data, 'error' =>
$error_data), $content);
-$this->prehtml .= $content;
+$template->prehtml .= $content;
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/report.php?r1=1.7&r2=1.8&diff_format=u
Index: bugtracker/template/generic/report/report.php
diff -u bugtracker/template/generic/report/report.php:1.7
bugtracker/template/generic/report/report.php:1.8
--- bugtracker/template/generic/report/report.php:1.7 Thu Aug 7 08:59:50 2008
+++ bugtracker/template/generic/report/report.php Thu Aug 7 09:33:04 2008
@@ -1,13 +1,5 @@
<?php
-//global $bug, $comment;
-
-$bypass = TRUE;
-
-//print_r(get_class_methods($this));
-if (!is_array(get_class_methods($this)))
-{
-
$form_data['email'] = loadvar('email');
$form_data['php_version'] = loadvar('php_version');
$form_data['bug_type'] = loadvar('bug_type');
@@ -53,15 +45,11 @@
//password if not logged in
//lets do the captcha check
-//global $user;
if (!$user->logged_in) {
//check captcha
require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php');
-//echo 'database';
-//print_r($database);
-//exit;
- global $recaptcha_prv;
+
$recap_resp =
recaptcha_check_answer($recaptcha_prv,$_SERVER['REMOTE_ADDR'],$form_data['recaptcha_challenge_field'],$form_data['recaptcha_response_field']);
if ($recap_resp->is_valid)
{
@@ -91,23 +79,6 @@
{
$form_data['form_error'] = 'Please correct the errors shown';
include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php');
-// global $template;
-
-//echo 'cookie';
-//echo $template->template_file;
-//exit;
- //restart
-
-// $template = new template();
-// $template->initialize();
-
-// $template->template_file = $_SERVER['DOCUMENT_ROOT'] .
'../template/generic/report/index.php';
-// $template->template_type = 'php';
-// $template->load_template();
-
-// $this->template_file = $_SERVER['DOCUMENT_ROOT'] .
'../template/generic/report/index.php';
-// $this->template_type = 'php';
-// $this->load_template();
}
else
{
@@ -122,36 +93,44 @@
unset($bug_data['actual'],$bug_data['expected'],$bug_data['reproduce'],$bug_data['description'],$bug_data['recaptcha_challenge_field'],$bug_data['recaptcha_response_field']);
$bug->report();
- //comment time
- $comments = array(
- 'bug_id' => $bug->bug_id,
- 'handle' => $user->handle,
- 'description' => $form_data['description'],
- 'reproduce' => $form_data['reproduce'],
- 'expected' => $form_data['expected'],
- 'actual' => $form_data['actual']
- );
- $comment->first_comment($comments);
-
- $template_data['page_title'] .= ': Bug Reported';
-
- $meta_refresh = array();
- $meta_refresh['url'] = '/bug/' . $bug->bug_id;
- $meta_refresh['time'] = 10;
-
- $template->meta_refresh($meta_refresh['url'], $meta_refresh['time']);
-
- $content = '<h2>Bug Reported</h2>';
- $content .= '<div id="success">';
- $content .= '<p>Your Bug has been added successfully.</p>';
- $content .= '<p>You should recieve an email confirming this.</p>';
- $content .= '<p>You will be redirected to your bug in ' .
$meta_refresh['time'] . ' seconds or you can <a href="' .
$meta_refresh['url'] .'">click here to go there</a>.</p>';
- $content .= '</div>';
- $template->prehtml = $content;
-}
-}
-else
-{
-//echo 'in the engine';
+ if (!$bug->bug_id)
+ {
+ //error!
+ $form_data['form_error'] = 'For some reason your bug could not be submitted,
please try again';
+ include($_SERVER['DOCUMENT_ROOT'] . '../template/generic/report/index.php');
+ }
+ else
+ {
+ //comment time
+ $comments = array(
+ 'bug_id' => $bug->bug_id,
+ 'handle' => $user->handle,
+ 'description' => $form_data['description'],
+ 'reproduce' => $form_data['reproduce'],
+ 'expected' => $form_data['expected'],
+ 'actual' => $form_data['actual']
+ );
+ $comment->first_comment($comments);
+
+ $template_data['page_title'] .= ': Bug Reported';
+
+ $meta_refresh = array();
+ $meta_refresh['url'] = '/bug/' . $bug->bug_id;
+ $meta_refresh['time'] = 10;
+
+ $template->meta_refresh($meta_refresh['url'], $meta_refresh['time']);
+
+ $template->page_title .= 'Bug Reported';
+ $template->content_title = 'Bug Reported';
+
+ $content .= '<div id="success">';
+ $content .= '<p>Your Bug has been added successfully.</p>';
+ $content .= '<p>You should recieve an email confirming this.</p>';
+ $content .= '<p>You will be redirected to your bug in ' .
$meta_refresh['time'] . ' seconds or you can <a href="' .
$meta_refresh['url'] .'">click here to go there</a>.</p>';
+ $content .= '</div>';
+
+ $template->prehtml = $content;
+ }
}
+