From 1bde8ef22a5e0b6aa7aa00ed873c42d521154d64 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 20 May 2005 02:45:55 +0000 Subject: [PATCH] When processing a new version, display a list of the applications existing versions so its easy to determine if the version submission is a duplicate or is covered by a group entry such as '1.X'. --- admin/adminAppQueue.php | 5 +++++ appview.php | 44 ----------------------------------------- include/util.php | 44 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php index 91e78a2..8aa9b42 100644 --- a/admin/adminAppQueue.php +++ b/admin/adminAppQueue.php @@ -56,6 +56,11 @@ if ($_REQUEST['sub']) if ($oVersion) //app version { + echo html_frame_start("Potential duplicate versions in the database","90%","",0); + $oApp = new Application($oVersion->iAppId); + display_versions($oApp->iAppId, $oApp->aVersionsIds); + echo html_frame_end(" "); + //help echo "
\n\n"; echo "

This is the full view of the application version waiting to be approved. \n"; diff --git a/appview.php b/appview.php index 684beff..5dae7e4 100644 --- a/appview.php +++ b/appview.php @@ -119,50 +119,6 @@ function show_note($sType,$oData){ return $s; } -/** - * display the versions - */ -function display_versions($iAppId, $aVersionsIds) -{ - if ($aVersionsIds) - { - echo html_frame_start("","98%","",0); - echo "\n\n"; - - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n\n"; - - $c = 0; - foreach($aVersionsIds as $iVersionId) - { - $oVersion = new Version($iVersionId); - - // set row color - $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; - - //display row - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n\n"; - - $c++; - - } - echo "
VersionDescriptionRatingWine versionComments
".$oVersion->sName."".trim_description($oVersion->sDescription)."".$oVersion->sTestedRating."".$oVersion->sTestedRelease."".sizeof($oVersion->aCommentsIds)."
\n"; - echo html_frame_end("Click the Version Name to view the details of that Version"); - } -} - - if(!is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId'])) { errorpage("Something went wrong with the application or version id"); diff --git a/include/util.php b/include/util.php index c35dbc7..e306a86 100644 --- a/include/util.php +++ b/include/util.php @@ -363,4 +363,48 @@ function outputSearchTableForhResult($search_words, $hResult) } } +/** + * display the versions + * Used in appview.php and adminAppQueue.php + */ +function display_versions($iAppId, $aVersionsIds) +{ + if ($aVersionsIds) + { + echo html_frame_start("","98%","",0); + echo "\n\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + + $c = 0; + foreach($aVersionsIds as $iVersionId) + { + $oVersion = new Version($iVersionId); + + // set row color + $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; + + //display row + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + + $c++; + + } + echo "
VersionDescriptionRatingWine versionComments
".$oVersion->sName."".trim_description($oVersion->sDescription)."".$oVersion->sTestedRating."".$oVersion->sTestedRelease."".sizeof($oVersion->aCommentsIds)."
\n"; + echo html_frame_end("Click the Version Name to view the details of that Version"); + } +} + ?> \ No newline at end of file