From 8260111bcce49b73bd4973ae80296c913af2631d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 24 Jun 2014 23:22:08 +0200 Subject: Add a package request list Introduce a new navigation point "Requests" that shows a list of pending package requests. This functionality is only available to Trusted Users. Signed-off-by: Lukas Fleischer --- web/lib/pkgbasefuncs.inc.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'web/lib/pkgbasefuncs.inc.php') diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index a9fe949..505bb51 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -963,6 +963,26 @@ function pkgbase_update_category($base_id, $category_id) { $dbh->exec($q); } +/** + * Get a list of all package requests + * + * @return array List of pacakge requests with details + */ +function pkgbase_request_list() { + $dbh = DB::connect(); + + $q = "SELECT PackageRequests.ID, "; + $q.= "PackageRequests.PackageBaseID AS BaseID, "; + $q.= "PackageRequests.PackageBaseName AS Name, "; + $q.= "RequestTypes.Name AS Type, PackageRequests.Comments, "; + $q.= "Users.Username AS User, PackageRequests.RequestTS "; + $q.= "FROM PackageRequests INNER JOIN RequestTypes ON "; + $q.= "RequestTypes.ID = PackageRequests.ReqTypeID "; + $q.= "INNER JOIN Users ON Users.ID = PackageRequests.UsersID"; + + return $dbh->query($q)->fetchAll(); +} + /** * File a deletion/orphan request against a package base * -- cgit v1.2.3-70-g09d2