From a084ec499165433375f52a573c67add2ba7cbf3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?=
iUserId}&sTitle=Maintained+Apps\">Maintained apps"; + } + echo "
E-mail $sRecipientText.
"; $oTable = new Table(); diff --git a/include/maintainer.php b/include/maintainer.php index 66e1f6b..1851f91 100644 --- a/include/maintainer.php +++ b/include/maintainer.php @@ -825,7 +825,10 @@ class maintainer echo "\n"; // Show which other apps the user maintains - echo 'You do not maintain any apps
'; + else + echo "{$oUser->sRealname} does not maintain any apps
"; + return; + } + + if($this->bViewingSelf) + echo 'Viewing your maintained apps
'; + else + echo "Viewing {$oUser->sRealname}'s maintained apps
"; + + $oTable = new Table(); + $oTableRow = new TableRow(); + $oTableRow->setClass('color4'); + $oTable->setCellSpacing(0); + $oTable->setCellPadding(3); + $oTableRow->AddTextCell('Application'); + $oTableRow->AddTextCell('Version'); + $oTableRow->AddTextCell('Current Rating'); + $oTableRow->AddTextCell('Current Version'); + $oTableRow->AddTextCell($this->bViewingSelf ? 'Your Rating' : "User's Rating"); + $oTableRow->AddTextCell($this->bViewingSelf ? 'Your Version' : "User's Version"); + $oTable->AddRow($oTableRow); + + $i = 1; + while(list($iIndex, list($iAppId, $iVersionId, $bSuperMaintainer)) = each($aMaintainedApps)) + { + $oApp = new application($iAppId); + $aVersions = array(); + + $oTableRow = new TableRow(); + $oTableRow->AddTextCell($oApp->objectMakeLink()); + + $oTableRow->SetClass(($i % 2) ? 'color0' : 'color1'); + $i++; + + if($iVersionId) + { + $oVersion = new version($iVersionId); + $oTableRow = maintainerView::addVersionRatingInfo($oTableRow, $oVersion); + $oTable->AddRow($oTableRow); + } else + { + $aVersions = $oApp->getVersions(true); + $oTableRow->AddTextCell('*'); + $oTableRow->AddTextCell(''); + $oTableRow->AddTextCell(''); + $oTableRow->AddTextCell(''); + $oTableRow->AddTextCell(''); + $oTable->AddRow($oTableRow); + } + + foreach($aVersions as $oVersion) + { + $oTableRow = new TableRow($oTableRow); + $oTableRow->AddTextCell(''); + $oTableRow = maintainerView::addVersionRatingInfo($oTableRow, $oVersion); + + $oTableRow->SetClass(($i % 2) ? 'color0' : 'color1'); + $i++; + + $oTable->AddRow($oTableRow); + } + } + echo $oTable->GetString(); + } +} + +?> diff --git a/include/sidebar_login.php b/include/sidebar_login.php index 536ad71..719647a 100644 --- a/include/sidebar_login.php +++ b/include/sidebar_login.php @@ -23,8 +23,12 @@ function global_sidebar_login() { $apps_user_maintains = Maintainer::getAppsMaintained($_SESSION['current']); if($apps_user_maintains) { + $g->add('Maintainership Overview', BASE.'objectManager.php?sClass=maintainerView&iId='. + $_SESSION['current']->iUserId.'&sTitle=Your+Maintained+Apps'); + $g->addmisc(""); $g->addmisc("You maintain:\n"); + while(list($index, list($appId, $versionId, $superMaintainer)) = each($apps_user_maintains)) { $oApp = new application($appId); diff --git a/include/testData.php b/include/testData.php index c749c53..0183040 100644 --- a/include/testData.php +++ b/include/testData.php @@ -1074,6 +1074,27 @@ class testData{ echo "\n"; } + function getTestResultsForUser($iUserId, $iVersionId) + { + $hResult = query_parameters("SELECT * FROM testResults WHERE + submitterId = '?' + AND versionId = '?' + ORDER BY testingId DESC", $iUserId, $iVersionId); + + if(!$hResult) + return null; + + $aRet = array(); + + if(!mysql_num_rows($hResult)) + return $aRet; + + while(($oRow = mysql_fetch_object($hResult))) + $aRet[] = new testData(0, $oRow); + + return $aRet; + } + /* List test data submitted by a given user. Ignore test results for queued applications/versions */ function listSubmittedBy($iUserId, $bQueued = true) { diff --git a/objectManager.php b/objectManager.php index 30ad2f3..7cf3180 100644 --- a/objectManager.php +++ b/objectManager.php @@ -24,6 +24,7 @@ require_once(BASE.'include/version_queue.php'); require_once(BASE.'include/testData_queue.php'); require_once(BASE.'include/bugs.php'); require_once(BASE.'include/db_filter_ui.php'); +require_once(BASE.'include/maintainerView.php'); /* if we have no valid class name we should abort */ if(!isset($aClean['sClass']))