cvs: bugtracker /htdocs/elements/js lineno.js /includes template.php /includes/cache php_version.php /template/generic/bug index.php

From: Date: Tue, 05 Aug 2008 11:50:54 +0000
Subject: cvs: bugtracker /htdocs/elements/js lineno.js /includes template.php /includes/cache php_version.php /template/generic/bug index.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2309@lists.php.net to get a copy of this message
bcarlyon Tue Aug 5 11:50:54 2008 UTC Modified files: /bugtracker/htdocs/elements/js lineno.js /bugtracker/includes template.php /bugtracker/includes/cache php_version.php /bugtracker/template/generic/bug index.php Log: Changed temlate engine to support unix timestamp correct processing, for user preference Finished redoing the bug display pages, back to comment engine now

http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/elements/js/lineno.js?r1=1.1&r2=1.2&diff_format=u Index: bugtracker/htdocs/elements/js/lineno.js diff -u bugtracker/htdocs/elements/js/lineno.js:1.1 bugtracker/htdocs/elements/js/lineno.js:1.2 --- bugtracker/htdocs/elements/js/lineno.js:1.1 Wed Jul 9 13:07:21 2008 +++ bugtracker/htdocs/elements/js/lineno.js Tue Aug 5 11:50:54 2008 @@ -7,13 +7,14 @@ el.appendChild(ta); el.className='textAreaWithLines'; - el.style.width = (ta.offsetWidth + 30) + 'px'; +// el.style.width = (ta.offsetWidth + 30) + 'px'; ta.style.position = 'absolute'; ta.style.left = '30px'; el.style.height = (ta.offsetHeight + 2) + 'px'; el.style.overflow='hidden'; el.style.position = 'relative'; - el.style.width = (ta.offsetWidth + 30) + 'px'; +// el.style.width = (ta.offsetWidth + 30) + 'px'; + el.style.width = (ta.offsetWidth) + 'px'; var lineObj = document.createElement('DIV'); lineObj.style.position = 'absolute'; lineObj.style.top = lineObjOffsetTop + 'px'; @@ -24,9 +25,11 @@ lineObj.className='lineObj'; var string = ''; for(var no=1;no<200;no++){ - if(string.length>0)string = string + '<br>'; - string = string + no; -} + if(string.length>0)string = string + '<br>'; + string = string + no; + } + + ta.style.width = (parseInt(ta.style.width) - 30) + 'px'; ta.onkeydown = function() { positionLineObj(lineObj,ta); }; ta.onmousedown = function() { positionLineObj(lineObj,ta); }; http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.3&r2=1.4&diff_format=u Index: bugtracker/includes/template.php diff -u bugtracker/includes/template.php:1.3 bugtracker/includes/template.php:1.4 --- bugtracker/includes/template.php:1.3 Fri Aug 1 15:57:56 2008 +++ bugtracker/includes/template.php Tue Aug 5 11:50:54 2008 @@ -179,9 +179,13 @@ if (is_array($data)) { foreach ($data as $nref => $ndata) { + $ndata = $this->sanitize($ndata); + $ndata = $this->time_check($nref, $ndata, $data); $html = $this->swap('DSP_' . $nref, $ndata, $html); } } else { + $data = $this->sanitize($data); + $data = $this->time_check($ref, $data, $loop_data); $html = $this->swap('DSP_' . $ref, $data, $html); } } @@ -192,10 +196,27 @@ function sanitize($in) { $out = $in; - + if (strlen($in) > 4) + { + $out = htmlentities($in, ENT_QUOTES, 'UTF-8'); + } return $out; } + function time_check($ref, $data, $source) + { + global $user; + + $time_pref = (!empty($user->time_pref)) ? $user->time_pref : 'r'; + if (isset($source['UNIX_TIMESTAMP(' . $ref . ')'])) + { + trace('Timetsmap found, hacking it ' .$ref); + $data = date($time_pref, $source['UNIX_TIMESTAMP(' . $ref . ')']); + } + + return $data; + } + function determine_template() { $base_directory = $_SERVER['DOCUMENT_ROOT'] . '../template/'; $base_this = $base_directory . $this->template_dir . '/'; http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache/php_version.php?r1=1.7&r2=1.8&diff_format=u Index: bugtracker/includes/cache/php_version.php diff -u bugtracker/includes/cache/php_version.php:1.7 bugtracker/includes/cache/php_version.php:1.8 --- bugtracker/includes/cache/php_version.php:1.7 Thu Jul 31 12:34:21 2008 +++ bugtracker/includes/cache/php_version.php Tue Aug 5 11:50:54 2008 @@ -1,5 +1,7 @@ <?php + $php_version[0] = "Irrelevant"; + $cacher['php_version'][0] = "Irrelevant"; $php_version[1] = "5.2.6"; $cacher['php_version'][1] = "5.2.6"; $php_version[2] = "4.4.8"; http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.18&r2=1.19&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.18 bugtracker/template/generic/bug/index.php:1.19 --- bugtracker/template/generic/bug/index.php:1.18 Fri Aug 1 15:57:56 2008 +++ bugtracker/template/generic/bug/index.php Tue Aug 5 11:50:54 2008 @@ -9,7 +9,7 @@ $this->page_title .= 'Bug #' . $bug_id; $this->content_title = 'Bug #' . $bug_id; - $query = "SELECT *,UNIX_TIMESTAMP(reported_on),UNIX_TIMESTAMP(assigned_on),UNIX_TIMESTAMP(updated) FROM bug WHERE bug_id = '{$bug_id}'"; + $query = "SELECT *,UNIX_TIMESTAMP(reported_on),UNIX_TIMESTAMP(assigned_on),UNIX_TIMESTAMP(updated),UNIX_TIMESTAMP(closed_on) FROM bug WHERE bug_id = '{$bug_id}'"; $db->get_data($query); if (!$db->total_rows) @@ -17,9 +17,18 @@ //invalid bug $this->page_title .= ' - Invalid'; $this->content_title .= ' - Invalid'; + $content = 'There is no bug with the ID you requested (' . $bug_id . ')'; } else { + $this->javascript = '<script type="text/javascript" src="/elements/js/lineno.js" ></script>'; + $this->javascript .= '<script type="text/javascript"> +function onload() +{ + createTextAreaWithLines(\'reproduce\'); +} +</script>'; + $row = $db->fetch_row(); $bug->bug_id = $bug_id; @@ -44,6 +53,68 @@ //first some nice html //we are going to pass it to the loop function! I know! Shock Horror + $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;">&nbsp;</td> <td style="width: 120px;">&nbsp;</td> <td style="width: 240px;">&nbsp;</td> <td style="width: 150px;">&nbsp;</td> </tr> +<tr> <td>Bug: #{DSP_BUG_ID}</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} +<tr> <td>&nbsp;</td> <td>Assigned:</td> <td>{DSP_ASSIGNED_ON}</td> <td>{DSP_ASSIGNED_TO}</td> </tr> +{DSP_END_ASSIGNED} +{DSP_SHOW_UPDATED} +<tr> <td>&nbsp;</td> <td>Last Updated:</td> <td colspan="2">{DSP_UPDATED}</td> </tr> +{DSP_END_UPDATED}{DSP_SHOW_CLOSED} +<tr> <td>&nbsp;</td> <td>Closed:</td> <td>{DSP_CLOSED_ON}</td> <td>{DSP_CLOSED_BY}</td> </tr> +{DSP_END_CLOSED} +<tr> <td>&nbsp;</td> <td colspan="2" style="text-align: right;">Version:</td> <td>{DSP_PHP_VERSION}</td> </tr> +<tr> <td>&nbsp;</td> <td colspan="2" style="text-align: right;">Type:</td> <td>{DSP_BUG_TYPE}</td> </tr> +<tr> <td>&nbsp;</td> <td colspan="2" style="text-align: right;">Os:</td> <td>{DSP_OS_VERSION}</td> </tr> +<tr> <td>&nbsp;</td> <td colspan="3" id="description">{DSP_DESCRIPTION}</td> </tr> +{DSP_SHOW_REPRODUCE} +<tr> <td>&nbsp;</td> <td colspan="3" id="reproduce_link" style="display: none;"><a href="javascript:handleClick(\'reproduce_code\');handleClick(\'reproduce_link\');">Show Reproduce Code and Results</a><br /></td></tr> +<tr> <td>&nbsp;</td> <td colspan="3" id="reproduce_code"> + +<div style="width: 425px;"> + +<br /><h5>Reproduce Code</h5> +<a href="javascript:handleClick(\'reproduce_code\');handleClick(\'reproduce_link\');" class="lineno">Hide Code and Results</a> +<a href="javascript:selectText(\'reproduce\');" title="Select Code" class="textselect">Select Code</a> +<a href="/bug/download/{DSP_BUG_ID}/" title="Download Code" class="textselect">Download</a> +<br /><br /> +<textarea id="reproduce" rows="7" cols="55" style="width: 420px;">{DSP_REPRODUCE}</textarea> +<hr /><br /> +<h5>Expected Result</h5> +<textarea id="expected" rows="7" cols="55" style="width: 420px;">{DSP_EXPECTED}</textarea> +<br /> +<a href="javascript:createTextAreaWithLines(\'expected\');handleClick(\'expected_add\');" id="expected_add" class="lineno">Add Line Numbers</a> +<hr /> +<h5>Actaul Result</h5> +<textarea id="actual" rows="7" cols="55" style="width: 420px;">{DSP_ACTUAL}</textarea> +<br /><a href="javascript:createTextAreaWithLines(\'actual\');handleClick(\'actual_add\');" id="actual_add" class="lineno">Add Line Numbers</a> + +</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')) + { + $bug_row['show_updated'] = $bug_row['end_updated'] = ''; + } + if ($bug_row['UNIX_TIMESTAMP(closed_on)'] != '0') + { + $bug_row['show_closed'] = $bug_row['end_closed'] = ''; + } + if (isset($bug_row['reproduce'])) + { + $bug_row['show_reproduce'] = $bug_row['end_reproduce'] = ''; + } + + $content .= $this->loop(array($bug_row), $html); } } else if ($bug_id)
« previous php.webmaster (#2309) next »