ChangeSet ID: 30825 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2006/12/26 21:26:16
Modified files: include : application.php bugs.php sidebar_login.php testData.php version.php
Log message: Alexander Nicolaysen Sørnes alex@thehandofagony.com Add a page showing a user's queued submissions to the AppDB. This should be quite useful for a user, and should also reduce the number of duplicate submissions, as many users seem to think their submissions have been lost if they are not accepted within a few hours.
Patch: http://cvs.winehq.org/patch.py?id=30825
Old revision New revision Changes Path 1.79 1.80 +29 -0 appdb/include/application.php 1.17 1.18 +38 -2 appdb/include/bugs.php 1.18 1.19 +8 -0 appdb/include/sidebar_login.php 1.13 1.14 +29 -0 appdb/include/testData.php 1.88 1.89 +27 -0 appdb/include/version.php
Index: appdb/include/application.php diff -u -p appdb/include/application.php:1.79 appdb/include/application.php:1.80 --- appdb/include/application.php:1.79 27 Dec 2006 3:26:16 -0000 +++ appdb/include/application.php 27 Dec 2006 3:26:16 -0000 @@ -786,6 +786,35 @@ class Application { echo "</table>\n\n"; echo html_frame_end(" "); } + + /* List applications submitted by a given user */ + function listSubmittedBy($iUserId, $bQueued = true) + { + $hResult = query_parameters("SELECT appId, appName, appFamily.vendorId, description, submitTime, vendorName FROM appFamily, vendor WHERE appFamily.vendorId = vendor.vendorId AND submitterId = '?' AND queued = '?' ORDER BY appId", $iUserId, $bQueued ? "true" : "false"); + + if(!$hResult || !mysql_num_rows($hResult)) + return false; + + $sResult = html_table_begin("width="100%" align="center""); + $sResult .= html_tr(array( + "Application", + "Description", + "Vendor", + "Submission Date"), + "color4"); + + for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + $sResult .= html_tr(array( + "<a href="".BASE."appview.php?iAppId=$oRow->appId">$oRow->appName</a>", + $oRow->description, + "<a href="".BASE."vendorview.php?iVendorId=$oRow->vendorId">$oRow->vendorName</a>", + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + ($i % 2) ? "color0" : "color1"); + + $sResult .= html_table_end(); + + return $sResult; + } }
?> Index: appdb/include/bugs.php diff -u -p appdb/include/bugs.php:1.17 appdb/include/bugs.php:1.18 --- appdb/include/bugs.php:1.17 27 Dec 2006 3:26:16 -0000 +++ appdb/include/bugs.php 27 Dec 2006 3:26:16 -0000 @@ -252,7 +252,43 @@ class Bug { { mail_appdb($sEmail, $sSubject ,$sMsg); } - } + } + + /* Get a list of bugs submitted by a given user */ + function listSubmittedBy($iUserId, $bQueued = true) + { + $hResult = query_parameters("SELECT appFamily.appName, buglinks.versionId, appVersion.versionName, buglinks.submitTime, buglinks.bug_id FROM buglinks, appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.queued = '?' AND buglinks.submitterId = '?' ORDER BY buglinks.versionId", $bQueued ? "true" : "false", $iUserId); + + if(!$hResult || !mysql_num_rows($hResult)) + return FALSE; + + $sReturn = html_table_begin("width="100%" align="center""); + $sReturn .= html_tr(array( + "Version", + array("Bug #", 'width="50"'), + array("Status", 'width="80"'), + array("Resolution", 'width="110"'), + "Description", + "Submit time"), + "color4"); + + for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + { + $oBug = new Bug($oRow->bug_id); + $sReturn .= html_tr(array( + "<a href="".BASE."appview.php?iVersionId=".$oRow->versionId."">".$oRow->appName.": ".$oRow->versionName."</a>", + "<a href="".BUGZILLA_ROOT."show_bug.cgi?id=".$oRow->bug_id."">".$oRow->bug_id."</a>", + $oBug->sBug_status, + $oBug->sResolution, + $oBug->sShort_desc, + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + ($i % 2) ? "color0" : "color1"); + } + + $sReturn .= html_table_end(); + + return $sReturn; + } }
@@ -342,6 +378,6 @@ function view_version_bugs($iVersionId = } echo '</table>',"\n"; echo html_frame_end(); -} +}
?> Index: appdb/include/sidebar_login.php diff -u -p appdb/include/sidebar_login.php:1.18 appdb/include/sidebar_login.php:1.19 --- appdb/include/sidebar_login.php:1.18 27 Dec 2006 3:26:16 -0000 +++ appdb/include/sidebar_login.php 27 Dec 2006 3:26:16 -0000 @@ -47,6 +47,14 @@ function global_sidebar_login() { $g->addmisc("<a href="".BASE."appview.php?iVersionId=$iVersionId">".Application::lookup_name($iAppId)." ".Version::lookup_name($iVersionId)."</a>","center"); }
+ /* Display a link to the user's queued items, + but not for admins, as theirs are auto-accepted */ + if(!$_SESSION['current']->hasPriv("admin")) + { + $g->addmisc(""); + $g->addmisc("<a href="".BASE."queueditems.php">Your queued items</a>"); + } + } else { Index: appdb/include/testData.php diff -u -p appdb/include/testData.php:1.13 appdb/include/testData.php:1.14 --- appdb/include/testData.php:1.13 27 Dec 2006 3:26:16 -0000 +++ appdb/include/testData.php 27 Dec 2006 3:26:16 -0000 @@ -740,6 +740,35 @@ class testData{ } echo "</select>\n"; } + + /* List test data submitted by a given user. Ignore test results for queued applications/versions */ + function listSubmittedBy($iUserId, $bQueued = true) + { + $hResult = query_parameters("SELECT testResults.versionId, testResults.testedDate, testResults.testedRelease, testResults.testedRating, testResults.submitTime, appFamily.appName, appVersion.versionName from testResults, appFamily, appVersion WHERE testResults.versionId = appVersion.versionId AND appVersion.appId = appFamily.appId AND (appFamily.queued = '?' OR appVersion.queued = '?') AND testResults.submitterId = '?' AND testResults.queued = '?' ORDER BY testResults.testingId", "false", "false", $iUserId, $bQueued ? "true" : "false"); + + if(!$hResult || !mysql_num_rows($hResult)) + return false; + + $sReturn = html_table_begin("width="100%" align="center""); + $sReturn .= html_tr(array( + "Version", + "Rating", + "Wine version", + "Submission Date"), + "color4"); + + for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + $sReturn .= html_tr(array( + "<a href="".BASE."appview.php?iVersionId=$oRow->versionId">$oRow->appName: $oRow->versionName</a>", + $oRow->testedRating, + $oRow->testedRelease, + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + $oRow->testedRating); + + $sReturn .= html_table_end(); + + return $sReturn; + } }
?> Index: appdb/include/version.php diff -u -p appdb/include/version.php:1.88 appdb/include/version.php:1.89 --- appdb/include/version.php:1.88 27 Dec 2006 3:26:16 -0000 +++ appdb/include/version.php 27 Dec 2006 3:26:16 -0000 @@ -969,6 +969,33 @@ class Version {
return $aMaintainers; } + + /* List the versions submitted by a user. Ignore versions for queued applications */ + function listSubmittedBy($iUserId, $bQueued = true) + { + $hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false"); + + if(!$hResult || !mysql_num_rows($hResult)) + return false; + + $sResult = html_table_begin("width="100%" align="center""); + $sResult .= html_tr(array( + "Name", + "Description", + "Submission Date"), + "color4"); + + for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + $sResult .= html_tr(array( + "<a href="".BASE."appview.php?iVersionId=$oRow->versionId">$oRow->appName: $oRow->versionName</a>", + $oRow->description, + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + ($i % 2) ? "color0" : "color1"); + + $sResult .= html_table_end(); + + return $sResult; + } }
?>