diff --git a/distributionView.php b/distributionView.php index ed7084b..f7a7d00 100644 --- a/distributionView.php +++ b/distributionView.php @@ -43,7 +43,7 @@ if(!$oDistribution->iDistributionId) { $oDistribution = distribution::ObjectGetInstanceFromRow($oRow); - $oDistribution->display(($c % 2) ? "color0" : "color1"); + $oDistribution->objectOutputTableRow(($c % 2) ? "color0" : "color1"); } echo "\n\n"; echo html_frame_end(" "); @@ -57,78 +57,7 @@ else apidb_header("View Distribution"); echo html_frame_start("Distribution Information",500); - echo "Distribution Name:"; - - if($oDistribution->sUrl) - echo ""; - - echo $oDistribution->sName; - - if ($oDistribution->sUrl) - { - echo " (".$oDistribution->sUrl.")"; - echo "
\n"; - } else - { - echo "
\n"; - } - - if($oDistribution->aTestingIds) - { - echo '

Testing Results for '.$oDistribution->sName.'
',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - foreach($oDistribution->aTestingIds as $iTestingId) - { - $oTest = new testData($iTestingId); - $oVersion = new Version($oTest->iVersionId); - $oApp = new Application($oVersion->iAppId); - $oSubmitter = new User($oTest->iSubmitterId); - $bgcolor = $oTest->sTestedRating; - - /* make sure the user can view the versions we list in the table */ - /* otherwise skip over displaying the entries in this table */ - if(!$_SESSION[current]->canViewApplication($oApp)) - continue; - if(!$_SESSION[current]->canViewVersion($oVersion)) - continue; - - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - if ($_SESSION['current']->hasAppVersionModifyPermission($oVersion)) - { - echo '',"\n"; - } - echo '',"\n"; - } - echo '
Application VersionSubmitterDate SubmittedWine versionInstalls?Runs?Rating
',"\n"; - echo $oApp->sName.' '.$oVersion->sName.'',"\n"; - if($_SESSION['current']->isLoggedIn()) - { - echo $oSubmitter->sEmail ? "sEmail."\">":""; - echo $oSubmitter->sRealname; - echo $oSubmitter->sEmail ? "":""; - } - else - echo $oSubmitter->sRealname; - echo ''.date("M d Y", mysqltimestamp_to_unixtimestamp($oTest->sSubmitTime)).''.$oTest->sTestedRelease.' '.$oTest->sInstalls.' '.$oTest->sRuns.' '.$oTest->sTestedRating.' ',"\n"; - echo 'Edit
',"\n"; - } + $oDistribution->display(); echo html_frame_end(); echo html_back_link(1); diff --git a/include/distribution.php b/include/distribution.php index aef3510..8668158 100644 --- a/include/distribution.php +++ b/include/distribution.php @@ -464,7 +464,7 @@ class distribution { return new distribution($oRow->distributionId); } - function display($sClass = "") + function objectOutputTableRow($sClass = "") { $aCells = array( "sUrl) + echo ""; + + echo $this->sName; + + if ($this->sUrl) + { + echo " (".$this->sUrl.")"; + echo "
\n"; + } else + { + echo "
\n"; + } + + if($this->aTestingIds) + { + echo '

Testing Results for '.$this->sName.'
',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + foreach($this->aTestingIds as $iTestingId) + { + $oTest = new testData($iTestingId); + $oVersion = new Version($oTest->iVersionId); + $oApp = new Application($oVersion->iAppId); + $oSubmitter = new User($oTest->iSubmitterId); + $bgcolor = $oTest->sTestedRating; + + /* make sure the user can view the versions we list in the table */ + /* otherwise skip over displaying the entries in this table */ + if(!$_SESSION[current]->canViewApplication($oApp)) + continue; + if(!$_SESSION[current]->canViewVersion($oVersion)) + continue; + + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + if ($_SESSION['current']->hasAppVersionModifyPermission($oVersion)) + { + echo '',"\n"; + } + echo '',"\n"; + } + echo '
Application VersionSubmitterDate SubmittedWine versionInstalls?Runs?Rating
',"\n"; + echo $oApp->sName.' '.$oVersion->sName.'',"\n"; + if($_SESSION['current']->isLoggedIn()) + { + echo $oSubmitter->sEmail ? "sEmail."\">":""; + echo $oSubmitter->sRealname; + echo $oSubmitter->sEmail ? "":""; + } + else + echo $oSubmitter->sRealname; + echo ''.date("M d Y", mysqltimestamp_to_unixtimestamp($oTest->sSubmitTime)).''.$oTest->sTestedRelease.' '.$oTest->sInstalls.' '.$oTest->sRuns.' '.$oTest->sTestedRating.' ',"\n"; + echo 'Edit
',"\n"; + } + } } ?>