diff --git a/include/application.php b/include/application.php index d189192..622b3cd 100644 --- a/include/application.php +++ b/include/application.php @@ -786,6 +786,35 @@ class Application { echo "\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( + "appId\">$oRow->appName", + $oRow->description, + "vendorId\">$oRow->vendorName", + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + ($i % 2) ? "color0" : "color1"); + + $sResult .= html_table_end(); + + return $sResult; + } } ?> diff --git a/include/bugs.php b/include/bugs.php index dfc639b..514e93a 100644 --- a/include/bugs.php +++ b/include/bugs.php @@ -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( + "versionId."\">".$oRow->appName.": ".$oRow->versionName."", + "bug_id."\">".$oRow->bug_id."", + $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 = null, $aBuglinkIds) } echo '',"\n"; echo html_frame_end(); -} +} ?> diff --git a/include/sidebar_login.php b/include/sidebar_login.php index 8ca59bb..5072597 100644 --- a/include/sidebar_login.php +++ b/include/sidebar_login.php @@ -47,6 +47,14 @@ function global_sidebar_login() { $g->addmisc("".Application::lookup_name($iAppId)." ".Version::lookup_name($iVersionId)."","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("Your queued items"); + } + } else { diff --git a/include/testData.php b/include/testData.php index f4b2346..7e7380e 100644 --- a/include/testData.php +++ b/include/testData.php @@ -740,6 +740,35 @@ class testData{ } echo "\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( + "versionId\">$oRow->appName: $oRow->versionName", + $oRow->testedRating, + $oRow->testedRelease, + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + $oRow->testedRating); + + $sReturn .= html_table_end(); + + return $sReturn; + } } ?> diff --git a/include/version.php b/include/version.php index 642b49c..65aac44 100644 --- a/include/version.php +++ b/include/version.php @@ -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( + "versionId\">$oRow->appName: $oRow->versionName", + $oRow->description, + print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), + ($i % 2) ? "color0" : "color1"); + + $sResult .= html_table_end(); + + return $sResult; + } } ?>