cvs: bugtracker /htdocs/index index.php /includes functions.php /template/generic/report report.php

From: Date: Fri, 11 Jul 2008 13:47:16 +0000
Subject: cvs: bugtracker /htdocs/index index.php /includes functions.php /template/generic/report report.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2080@lists.php.net to get a copy of this message
bcarlyon Fri Jul 11 13:47:16 2008 UTC Modified files: /bugtracker/htdocs/index index.php /bugtracker/includes functions.php /bugtracker/template/generic/report report.php Log: added a meta refresh to bug added pages, and created a friendly message http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.4&r2=1.5&diff_format=u Index: bugtracker/htdocs/index/index.php diff -u bugtracker/htdocs/index/index.php:1.4 bugtracker/htdocs/index/index.php:1.5 --- bugtracker/htdocs/index/index.php:1.4 Thu Jul 10 20:56:41 2008 +++ bugtracker/htdocs/index/index.php Fri Jul 11 13:47:16 2008 @@ -88,6 +88,7 @@ $template_data['endif logged_in'] = ''; $jsscripts = array(); +$meta_refresh = array(); $content = ''; @@ -153,7 +154,7 @@ $template_data['queries'] = $db->query_count; -$content = tpl_process('generic/header.html', TRUE, $jsscripts) . $content . tpl_process('generic/footer.html'); +$content = tpl_process('generic/header.html', TRUE, $jsscripts, $meta_refresh) . $content . tpl_process('generic/footer.html'); $content = str_replace('<table','<table cellspacing="0" cellpadding="0"',$content); http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.5&r2=1.6&diff_format=u Index: bugtracker/includes/functions.php diff -u bugtracker/includes/functions.php:1.5 bugtracker/includes/functions.php:1.6 --- bugtracker/includes/functions.php:1.5 Fri Jul 11 13:14:18 2008 +++ bugtracker/includes/functions.php Fri Jul 11 13:47:16 2008 @@ -10,7 +10,7 @@ return $newstring; } -function tpl_process($file,$text = TRUE,$jsscripts = array()) { +function tpl_process($file,$text = TRUE,$jsscripts = FALSE,$meta_refresh = FALSE) { global $template_data,$form_data; if ($text) { @@ -39,9 +39,17 @@ $html = str_replace('{' . strtoupper($ref) . '}',$replace,$html); } } - foreach ($jsscripts as $jsscript) + if ($jsscripts) { - $html = str_replace('</head>','<script type="text/javascript" src="' . $jsscript . '"></script>' . "\n" . '</head>',$html); + foreach ($jsscripts as $jsscript) + { + $html = str_replace('</head>','<script type="text/javascript" src="' . $jsscript . '"></script>' . "\n" . '</head>',$html); + } + } + if ($meta_refresh) + { + $meta = '<meta http-equiv="refresh" content="' . $meta_refresh['time'] . ';' . $meta_refresh['url'] .'" />'; + $html = str_replace('</head>',$meta . "\n" . '</head>',$html); } return $html; } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/report.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/template/generic/report/report.php diff -u bugtracker/template/generic/report/report.php:1.2 bugtracker/template/generic/report/report.php:1.3 --- bugtracker/template/generic/report/report.php:1.2 Thu Jul 10 20:56:41 2008 +++ bugtracker/template/generic/report/report.php Fri Jul 11 13:47:16 2008 @@ -105,8 +105,18 @@ $comment->first_comment($comments); $template_data['page_title'] .= ': Bug Reported'; - $content .= '<p>This be where some db-ness happens</p>'; + + $meta_refresh = array(); + $meta_refresh['url'] = '/bug/' . $bug->bug_id; + $meta_refresh['time'] = 10; + + $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 .= '<p>This be where some db-ness happens</p>'; } +/* $content .= '<table>'; $content .= '<tr><td>Check auth</td><td>Based on if user logged in so working ok</td></tr>'; $content .= '<tr><td>If not loggedin create account</td><td>Temp account ok</td></tr>'; @@ -115,6 +125,6 @@ $content .= '<tr><td>Send Email to user with bug_id, est. queue, +/- password</td><td>email systems operable, via smtp</td></tr>'; $content .= '<tr><td>Send email to &#39;lists&#39;</td></tr>'; $content .= '</table>'; - +*/ $content = tpl_process($content,FALSE);

« previous php.webmaster (#2080) next »