From 13b1a42bf93b92c08fdd863fa82745b826ea38b1 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Thu, 5 May 2005 02:52:51 +0000 Subject: [PATCH] Report queued versions as well as queued apps in the admin sidebar. Ensure that we don't count the version that is implicitly queued due to an application being queued. --- include/sidebar_admin.php | 2 +- include/util.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/sidebar_admin.php b/include/sidebar_admin.php index a2397e6..8ce2e1f 100644 --- a/include/sidebar_admin.php +++ b/include/sidebar_admin.php @@ -11,7 +11,7 @@ function global_admin_menu() { $g->add("Add Vendor", BASE."admin/addVendor.php"); $g->addmisc(" "); - $g->add("View App Queue (".getQueuedAppCount().")", BASE."admin/adminAppQueue.php"); + $g->add("View App Queue (".getQueuedAppCount()."/".getQueuedVersionCount().")", BASE."admin/adminAppQueue.php"); $g->add("View App Data Queue (".getQueuedAppDataCount().")", BASE."admin/adminAppDataQueue.php"); $g->add("View Maintainer Queue (".getQueuedMaintainerCount().")", BASE."admin/adminMaintainerQueue.php"); $g->add("View Maintainer Entries (".getMaintainerCount().")", BASE."admin/adminMaintainers.php"); diff --git a/include/util.php b/include/util.php index 28833fb..857601f 100644 --- a/include/util.php +++ b/include/util.php @@ -155,6 +155,18 @@ function getQueuedAppCount() return $ob->queued_apps; } +function getQueuedVersionCount() +{ + $qstring = "SELECT count(*) as queued_versions FROM appVersion WHERE queued='true'"; + $result = query_appdb($qstring); + $ob = mysql_fetch_object($result); + + /* we don't want to count the versions that are implicit in the applications */ + /* that are in the queue */ + return $ob->queued_versions - getQueuedAppCount(); +} + + /* get the number of queued appdata */ function getQueuedAppDataCount() {