Alexander Nicolaysen Sørnes : testData: Display confirmation box when changing Wine version

Chris Morgan cmorgan at winehq.org
Wed Jan 2 20:53:15 CST 2008


Module: appdb
Branch: master
Commit: 7273d4cc247a92b6bcd1ceff7f6539192b94218f
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=7273d4cc247a92b6bcd1ceff7f6539192b94218f

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Wed Jan  2 20:26:08 2008 +0100

testData: Display confirmation box when changing Wine version

---

 include/testData.php |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/include/testData.php b/include/testData.php
index f61a75c..e3a3c29 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -936,6 +936,23 @@ class testData{
         echo '<input type="hidden" name="iTestingId" value="'.$this->iTestingId.'" >';
         echo '<input type="hidden" name="iTestDataId" value="'.$this->iTestingId.'" >';
 
+        // Display confirmation box for changing the Wine version
+        $oOldTest = new testData($this->iTestingId);
+        if($this->iTestingId && $oOldTest->sTestedRelease != $this->sTestedRelease)
+        {
+            if(getInput('bConfirmTestedVersionChange', $aClean) != 'true')
+            {
+                echo '<tr><td class="color1">&nbsp;</td><td class="color0">';
+                echo 'You have changed the Wine version of the report.  Are you sure you want to do this?  Please submit a new test report for every Wine version you test; this is useful for tracking Wine&#8217;s progress.<br />';
+                echo '<input type="checkbox" name="bConfirmTestedVersionChange" value="true" /> ';
+                echo 'Yes, I want to change the Wine version';
+                echo '</td></tr>';
+            } else
+            {
+                echo '<input type="hidden" name="bConfirmTestedVersionChange" value="true" />';
+            }
+        }
+
         echo "</table>\n";
 
         echo html_frame_end();
@@ -960,6 +977,17 @@ class testData{
         if (empty($aValues['sTestedRelease']))
             $errors .= "<li>Please enter the version of Wine that you tested with.</li>\n";
 
+        // Ask for confirmation if changing the tested Wine versions, becase we want users
+        // to submit new reports instead of updating existing ones when testing new Wines
+        $oOldTest = new testData($this->iTestingId);
+        if($this->iTestingId && $oOldTest->sTestedRelease != getInput('sTestedRelease', $aValues) &&
+           getInput('bConfirmTestedVersionChange', $aValues) != 'true')
+        {
+            $errors .= '<li>Are you sure you want to change the Wine version of the report? Please submit a new '.
+                        'test report for every Wine version you test; this is useful for tracking Wine&#8217;s progress. '.
+                        'Tick the box above the submit button if you want to proceed</li>';
+        }
+
         // No Distribution entered, and nothing in the list is selected
         if (empty($aValues['sDistribution']) && !$aValues['iDistributionId'])
             $errors .= "<li>Please enter a distribution.</li>\n";




More information about the wine-cvs mailing list