From 111d836912f403caf82abe6f2ff6c0fee9f3f6b3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 4 Jul 2014 12:28:12 +0200 Subject: Display number of pending requests in actions box For packages with pending package requests, display the number of requests above the "File Request" link. Signed-off-by: Lukas Fleischer --- web/lib/pkgbasefuncs.inc.php | 5 ++++- web/lib/pkgfuncs.inc.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index fed46c86..b357dff3 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -187,7 +187,10 @@ function pkgbase_get_details($base_id) { $q.= "PackageBases.OutOfDateTS, PackageBases.SubmittedTS, "; $q.= "PackageBases.ModifiedTS, PackageBases.SubmitterUID, "; $q.= "PackageBases.MaintainerUID, PackageBases.PackagerUID, "; - $q.= "PackageCategories.Category "; + $q.= "PackageCategories.Category, "; + $q.= "(SELECT COUNT(*) FROM PackageRequests "; + $q.= " WHERE PackageRequests.PackageBaseID = PackageBases.ID "; + $q.= " AND PackageRequests.Status = 0) AS RequestCount "; $q.= "FROM PackageBases, PackageCategories "; $q.= "WHERE PackageBases.CategoryID = PackageCategories.ID "; $q.= "AND PackageBases.ID = " . intval($base_id); diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 7e65d091..a2b8a0d2 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -401,7 +401,10 @@ function pkg_get_details($id=0) { $q.= "PackageBases.NumVotes, PackageBases.OutOfDateTS, "; $q.= "PackageBases.SubmittedTS, PackageBases.ModifiedTS, "; $q.= "PackageBases.SubmitterUID, PackageBases.MaintainerUID, "; - $q.= "PackageBases.PackagerUID, PackageCategories.Category "; + $q.= "PackageBases.PackagerUID, PackageCategories.Category, "; + $q.= "(SELECT COUNT(*) FROM PackageRequests "; + $q.= " WHERE PackageRequests.PackageBaseID = Packages.PackageBaseID "; + $q.= " AND PackageRequests.Status = 0) AS RequestCount "; $q.= "FROM Packages, PackageBases, PackageCategories "; $q.= "WHERE PackageBases.ID = Packages.PackageBaseID "; $q.= "AND PackageBases.CategoryID = PackageCategories.ID "; -- cgit v1.2.3-24-g4f1b