diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php index 7e79a0e..53ed83a 100644 --- a/admin/adminAppQueue.php +++ b/admin/adminAppQueue.php @@ -71,6 +71,49 @@ function outputSearchTableForDuplicateFlagging($currentAppId, $hResult) } } +function display_move_test_to_versions_table($aVersionsIds,$icurrentVersionId) +{ + 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); + if ($oVersion->sQueued == 'false') + { + // 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
".html_ahref($oVersion->sName,"adminAppQueue.php?sub=movetest&apptype=version&versionId=".$icurrentVersionId."&versionIdMergeTo=".$oVersion->iVersionId)."".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"); + } +} + + //deny access if not logged in or not a super maintainer of any applications if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isSuperMaintainer()) { @@ -172,6 +215,22 @@ if ($_REQUEST['sub']) /* redirect back to the main page */ redirect(apidb_fullurl("admin/adminAppQueue.php")); } + else if ($_REQUEST['sub'] == 'movetest') + { + if(is_numeric($_REQUEST['versionIdMergeTo'])) + { + // move this Test submission under the existing version // + $oTest->iVersionId = $_REQUEST['versionIdMergeTo']; + $oTest->update(); + + // delete the Version entry + $oVersion = new Version($_REQUEST['versionId']); + $oVersion->delete(); + } + + // redirect back to the main page + redirect(apidb_fullurl("admin/adminAppQueue.php")); + } else if ($_REQUEST['sub'] == 'Delete') { @@ -229,6 +288,10 @@ if ($_REQUEST['sub']) display_approved_versions($oAppForVersion->aVersionsIds); echo html_frame_end(" "); + echo html_frame_start("Move test to version","90%","",0); + display_move_test_to_versions_table($oAppForVersion->aVersionsIds,$oVersion->iVersionId); + echo html_frame_end(" "); + //help echo "
\n\n"; echo "

This is the full view of the application version waiting to be approved. \n";