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.
This commit is contained in:
Alexander Nicolaysen Sørnes
2006-12-27 03:26:16 +00:00
committed by WineHQ
parent eb9e649d3d
commit 18acb017cd
5 changed files with 131 additions and 2 deletions

View File

@@ -786,6 +786,35 @@ class Application {
echo "</table>\n\n";
echo html_frame_end("&nbsp;");
}
/* 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;
}
}
?>

View File

@@ -253,6 +253,42 @@ 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;
}
}

View File

@@ -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
{

View File

@@ -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;
}
}
?>

View File

@@ -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;
}
}
?>