[git] web/qa.git branch master updated. 9cde414
| From: | odoucet@php.net | Date: | Sat, 03 Mar 2012 11:31:14 +0000 |
| Subject: | [git] web/qa.git branch master updated. 9cde414 | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66120@lists.php.net to get a copy of this message | ||
The branch, master on web/qa.git has been updated
via 9cde414d4023ea036c1ecf61bd85d585b2d9589b (commit)
from a6e253fcfde3b31df55bb2bffe1b9b07f619c9b3 (commit)
http://git.php.net/?p=web/qa.git;a=log;h=9cde414d4023ea036c1ecf61bd85d585b2d9589b;hp=a6e253fcfde3b31df55bb2bffe1b9b07f619c9b3
Summary of changes:
reports/index.php | 25 +++++--------------------
reports/reportsfunctions.php | 25 +++++++++++++++++++++++++
reports/viewreports.php | 3 ++-
3 files changed, 32 insertions(+), 21 deletions(-)
-- Log ----------------------------------------
commit 9cde414d4023ea036c1ecf61bd85d585b2d9589b
Author: Olivier Doucet <odoucet@php.net>
Date: Sat Mar 3 12:00:00 2012 +0100
show nice date on QA report interface.
diff --git a/reports/index.php b/reports/index.php
index 2f5f7d6..37bd579 100644
--- a/reports/index.php
+++ b/reports/index.php
@@ -109,24 +109,7 @@ foreach ($reportsPerVersion as $version => $line) {
echo '<td
align="right">'.$line['nbFailingTests'].'</td>';
echo '<td
align="right">'.$line['nbFailures'].'</td>';
echo '<td nowrap align="right"
sorttable_customkey="'.strtotime($line['lastReport']).'">';
-
- $lastReport = time()-strtotime($line['lastReport']);
-
- if ($lastReport < 3600) {
- $tmpValue = round($lastReport/60);
- echo "$tmpValue ", ($tmpValue == 1) ? 'minute' : 'minutes';
- } elseif ($lastReport < 3600*24) {
- $tmpValue = round($lastReport/3600);
- echo "$tmpValue ", ($tmpValue == 1) ? 'hour' : 'hours';
- } elseif ($lastReport < 3600*24*60) {
- $tmpValue = round($lastReport/3600/24);
- echo "$tmpValue ", ($tmpValue == 1) ? 'day' : 'days';
- } else {
- $tmpValue = floor($lastReport/3600/24/30);
- echo "$tmpValue ", ($tmpValue == 1) ? 'month' : 'months';
- }
- unset($tmpValue);
- echo " ago";
+ echo format_readable_date(strtotime($line['lastReport']));
echo '</td>';
echo '</tr>'."\n";
}
@@ -149,7 +132,7 @@ foreach ($reportsPerVersion as $version => $line) {
<th>Test name</th>
<th>Count</th>
<th>Variations</th>
- <th>Last reported date</th>
+ <th>Last report date</th>
<th> </th>
</tr>
</thead>
@@ -162,7 +145,9 @@ foreach ($reportsPerVersion as $version => $line) {
echo '><td>'.$line['test_name'].'</td>';
echo '<td
align="right">'.$line['cpt'].'</td>';
echo '<td
align="right">'.$line['variations'].'</td>';
- echo '<td
align="right">'.$line['date'].'</td>';
+ echo '<td align="right"
sorttable_customkey="'.strtotime($line['date']).'">';
+ echo format_readable_date(strtotime($line['date']));
+ echo '</td>';
echo '<td><a
href="viewreports.php?version='.$getVersion.'&test='.urlencode($line['test_name']).'">
<img src="report.png" title="View reports" border="0"
/></a></td>';
echo '</tr>'."\n";
diff --git a/reports/reportsfunctions.php b/reports/reportsfunctions.php
index c1f3048..6511276 100644
--- a/reports/reportsfunctions.php
+++ b/reports/reportsfunctions.php
@@ -157,3 +157,28 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL)
}
return $data;
}
+
+
+/**
+ * Format date as we want
+ * @param unix timestamp
+ * @return string
+ */
+function format_readable_date($date) {
+ $lastReport = time()-$date;
+ $return = '';
+ if ($lastReport < 3600) {
+ $tmpValue = round($lastReport/60);
+ $return = "$tmpValue ", ($tmpValue == 1) ? 'minute' :
'minutes';
+ } elseif ($lastReport < 3600*24) {
+ $tmpValue = round($lastReport/3600);
+ $return = "$tmpValue ", ($tmpValue == 1) ? 'hour' : 'hours';
+ } elseif ($lastReport < 3600*24*60) {
+ $tmpValue = round($lastReport/3600/24);
+ $return = "$tmpValue ", ($tmpValue == 1) ? 'day' : 'days';
+ } else {
+ $tmpValue = floor($lastReport/3600/24/30);
+ $return = "$tmpValue ", ($tmpValue == 1) ? 'month' :
'months';
+ }
+ return $return." ago";
+}
diff --git a/reports/viewreports.php b/reports/viewreports.php
index e60b843..aeaff66 100644
--- a/reports/viewreports.php
+++ b/reports/viewreports.php
@@ -225,5 +225,6 @@ foreach ($allDiffArray as $diff) {
</table>
</div>
<?php
-$siteUpdate .= " Generated in ".round((microtime(true)-$startTime)*1000)." ms";
+$SITE_UPDATE .= date('D M d H:i:s Y T', filemtime($dbFile))."<br />".
+ " Generated in ".round((microtime(true)-$startTime)*1000)."
ms";
common_footer();
Thank you for your contribution.