diff --git a/include/application.php b/include/application.php index b5f3c4a..f451b7a 100644 --- a/include/application.php +++ b/include/application.php @@ -697,7 +697,9 @@ class Application { } if($_SESSION['current']->isLoggedIn()) { - echo '
'; } diff --git a/include/objectManager.php b/include/objectManager.php index f843006..e51730c 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -361,7 +361,12 @@ class ObjectManager function getIdFromInput($aClean) { $sId = "i".ucfirst($this->sClass)."Id"; - return $aClean[$sId]; + $iId = $aClean['sId']; + + if(!$iId) + $iId = $aClean['iId']; + + return $iId; } /* Output headers for a table */ diff --git a/include/sidebar_admin.php b/include/sidebar_admin.php index 5794040..176e637 100644 --- a/include/sidebar_admin.php +++ b/include/sidebar_admin.php @@ -13,7 +13,7 @@ function global_admin_menu() { BASE."objectManager.php?sClass=application&bIsQueue=true&sTitle=". "Application%20Queue"); $g->add("View Version Queue (".version::objectGetEntriesCount(true, false).")", - BASE."objectManager.php?sClass=version&bIsQueue=true&sTitle=". + BASE."objectManager.php?sClass=version_queue&bIsQueue=true&sTitle=". "Version%20Queue"); $g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true", false, "screenshot").")", diff --git a/include/sidebar_maintainer_admin.php b/include/sidebar_maintainer_admin.php index 41a0734..5d20ce9 100644 --- a/include/sidebar_maintainer_admin.php +++ b/include/sidebar_maintainer_admin.php @@ -8,7 +8,7 @@ function global_maintainer_admin_menu() { $g = new htmlmenu("Maintainer Admin"); $g->add("View Version Queue (".version::objectGetEntriesCount(true, false).")", - BASE."objectManager.php?sClass=version&bIsQueue=true&sTitle=". + BASE."objectManager.php?sClass=version_queue&bIsQueue=true&sTitle=". "Version%20Queue"); $g->add("View Screenshot Queue (".appData::objectGetEntriesCount("true", false, "screenshot").")", diff --git a/include/testData.php b/include/testData.php index b63968e..b746fc2 100644 --- a/include/testData.php +++ b/include/testData.php @@ -73,7 +73,7 @@ class testData{ $this->sTestedRelease, $this->sInstalls, $this->sRuns, $this->sTestedRating, $this->sComments, $_SESSION['current']->iUserId, - $this->canEdit() ? "false" : "true"); + $this->mustBeQueued() ? "false" : "true"); if($hResult) { $this->iTestingId = mysql_insert_id(); @@ -470,18 +470,19 @@ class testData{ } /* retrieve the latest test result for a given version id */ - function getNewestTestIdFromVersionId($iVersionId) + function getNewestTestIdFromVersionId($iVersionId, $bQueued = false) { $sQuery = "SELECT testingId FROM testResults WHERE versionId = '?' AND - queued = 'false' + queued = '?' ORDER BY testedDate DESC limit 1"; - $hResult = query_parameters($sQuery, $iVersionId); + $hResult = query_parameters($sQuery, $iVersionId, $bQueued ? "true" : "false"); if(!$hResult) return 0; $oRow = mysql_fetch_object($hResult); + return $oRow->testingId; } @@ -876,6 +877,21 @@ class testData{ echo "distributions, please add it in the \n"; echo "provided field.\n\n"; } + + function mustBeQueued() + { + if($_SESSION['current']->hasPriv("admin")) + return TRUE; + else if($this->iVersionId) + { + $oVersion = new version($this->iVersionId); + if($oVersion->canEdit()) + return TRUE; + else + return FALSE; + } else + return FALSE; + } } ?> diff --git a/include/version.php b/include/version.php index 53de2a4..bef0e33 100644 --- a/include/version.php +++ b/include/version.php @@ -583,7 +583,7 @@ class Version { /* if $editParentApplication is true that means we need to display fields */ /* to let the user change the parent application of this version */ /* otherwise, if $editParentAppliation is false, we leave them out */ - function outputEditor($editParentApplication, $editRatingAndRelease) + function outputEditor() { HtmlAreaLoaderScript(array("version_editor")); echo html_frame_start("Version Form", "90%", "", 0); @@ -591,7 +591,12 @@ class Version { echo ''; - if($editParentApplication) + /* Fill in appId value */ + global $aClean; + if(!$this->iAppId) + $this->iAppId = $aClean['iAppId']; + + if($this->sQueued == "false" && $this->iVersionId) { // app parent $x = new TableVE("view"); @@ -619,26 +624,11 @@ class Version { echo $this->sDescription.'',"\n"; - /* Allow the user to apply as maintainer if this is a new version. - If it is a new application as well, radio boxes will be displayed - by the application class instead. */ - if(!$this->iVersionId && $_REQUEST['iAppId']) - { - if($this->iMaintainerRequest == MAINTAINER_REQUEST) - $sRequestMaintainerChecked = 'checked="checked"'; - echo html_tr(array( - array("Become maintainer?", "class=\"color0\""), - " ". - "Check this box to request being a maintainer for this version"), - "","valign=\"top\""); - } - echo '',"\n"; echo html_frame_end(); - if($editRatingAndRelease) + if($this->sQueued == "false" && $this->iVersionId) { echo html_frame_start("Info", "90%", "", 0); echo "