From d09f78ca009b9205fc20b6d43e1b7405aa964b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Fri, 27 Apr 2007 23:45:19 +0000 Subject: [PATCH] Get rid of the distribution queue. If a testData entry is deleted and its associated distribution has not been approved and has no other testData assigned to it the distribution is now deleted. This change makes the distribution queue unnecessary as distributions are accepted along the testData --- include/sidebar_admin.php | 4 ---- include/testData_queue.php | 12 +++++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/sidebar_admin.php b/include/sidebar_admin.php index d3a57c9..db37a5c 100644 --- a/include/sidebar_admin.php +++ b/include/sidebar_admin.php @@ -25,10 +25,6 @@ function global_admin_menu() { $g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")", BASE."objectManager.php?sClass=testData_queue&bIsQueue=true&sTitle=". "Test%20Results%20Queue"); - $g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true, - false).")", - BASE."objectManager.php?sClass=distribution&bIsQueue=true&sTitle=". - "Distribution%20Queue"); $g->addmisc(" "); diff --git a/include/testData_queue.php b/include/testData_queue.php index c2c2bc3..e7352e0 100644 --- a/include/testData_queue.php +++ b/include/testData_queue.php @@ -24,7 +24,17 @@ class testData_queue function delete() { - return $this->oTestData->delete(); + $bSuccess = $this->oTestData->delete(); + + /* We delete the distribution if it has not been approved and is not associated + with any other testData. Otherwise we would have to have a distribution + queue for admins to clean up unused, queued entries */ + $this->oDistribution = new distribution($this->oDistribution->iDistributionId); + if(!sizeof($this->oDistribution->aTestingIds) && + $this->oDistribution->sQueued != "false") + $this->oDistribution->delete(); + + return $bSuccess; } function reQueue()