Module: appdb
Branch: master
Commit: 058eba4b4ff88e10c54db21d2306eb0d34fbcbed
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=058eba4b4ff88e10c54db21d…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Wed Dec 19 23:01:05 2007 +0100
Display a note when viewiing old test results
---
include/testData.php | 9 +++++++++
include/version.php | 17 ++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/include/testData.php b/include/testData.php
index aafeb71..7146dd8 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -1214,6 +1214,15 @@ class testData{
return TRUE;
}
+ public function isOld()
+ {
+ /* If no id is defined that means the test report is not in the database, which means it can't be old */
+ if(!$this->iTestingId)
+ return false;
+
+ return ((mktime() - mysqltimestamp_to_unixtimestamp($this->sSubmitTime)) > (60 * 60 * 24 * 175));
+ }
+
function objectGetChildren($bIncludeDeleted = false)
{
/* We have none */
diff --git a/include/version.php b/include/version.php
index 652ae01..f2df2cf 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1038,13 +1038,15 @@ class version {
//////////////////////
// Show test data
+ $iNewestId = 0;
/* Set if the use chose to display a particular test report */
if($iTestingId)
$oTest = new testData($iTestingId);
else if($this->iVersionId) /* Let's query for the latest rest report */
{
- $iTestingId = testData::getNewestTestIdFromVersionId($this->iVersionId);
+ $iNewestId = testData::getNewestTestIdFromVersionId($this->iVersionId);
+ $iTestingId = $iNewestId;
if($iTestingId) /* We want all entries to have test data, but old versions might lack
it, or data may have been deleted */
@@ -1059,6 +1061,19 @@ class version {
if($oTest)
{
+ if($oTest->isOld())
+ {
+ if($iNewestId != $oTest->objectGetId())
+ {
+ $sWarnOldText = 'The test results you have selected are very old and may not represent the current state of Wine.';
+ } else
+ {
+ $sWarnOldText = 'The test results for this version are very old, and as such they may not represent '.
+ 'the current state of Wine. Please consider submitting a new test report.';
+ }
+ echo html_note('Old test results', $sWarnOldText);
+ }
+
echo "<div class='info_container'>\n";
echo "\t<div class='title_class'>\n";
Module: appdb
Branch: master
Commit: 587c866e163c658b2de9e0fcf70cb1a8c8df965d
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=587c866e163c658b2de9e0fc…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Sun Dec 23 16:19:07 2007 +0100
Fix previewing of versions
---
include/user.php | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/user.php b/include/user.php
index ebbb4c9..af15196 100644
--- a/include/user.php
+++ b/include/user.php
@@ -721,6 +721,10 @@ class User {
function canViewVersion($oVersion)
{
+ /* If there is no id that means data must have been generated by the user */
+ if(!$this->iVersionId)
+ return true;
+
/* if the version isn't queued */
if($oVersion->objectGetState() == 'accepted')
return true;