summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php26
-rw-r--r--web/lib/routing.inc.php6
2 files changed, 30 insertions, 2 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 505bb51..a039f83 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -975,10 +975,12 @@ function pkgbase_request_list() {
$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.= "Users.Username AS User, PackageRequests.RequestTS, ";
+ $q.= "PackageRequests.Status ";
$q.= "FROM PackageRequests INNER JOIN RequestTypes ON ";
$q.= "RequestTypes.ID = PackageRequests.ReqTypeID ";
- $q.= "INNER JOIN Users ON Users.ID = PackageRequests.UsersID";
+ $q.= "INNER JOIN Users ON Users.ID = PackageRequests.UsersID ";
+ $q.= "ORDER BY Status ASC, RequestTS DESC";
return $dbh->query($q)->fetchAll();
}
@@ -1070,3 +1072,23 @@ function pkgbase_file_request($ids, $type, $comments) {
return array(true, __("Added request successfully."));
}
+
+/**
+ * Close a deletion/orphan request
+ *
+ * @param int $id The package request to close
+ *
+ * @return void
+ */
+function pkgbase_close_request($id) {
+ $dbh = DB::connect();
+
+ if (!check_user_privileges()) {
+ return array(false, __("Only TUs and developers can close requests."));
+ }
+
+ $q = "UPDATE PackageRequests SET Status = 1 WHERE ID = " . intval($id);
+ $dbh->exec($q);
+
+ return array(true, __("Request closed successfully."));
+}
diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php
index 5836a13..2fa3e1f 100644
--- a/web/lib/routing.inc.php
+++ b/web/lib/routing.inc.php
@@ -21,6 +21,7 @@ $ROUTES = array(
$PKG_PATH = '/packages';
$PKGBASE_PATH = '/pkgbase';
+$PKGREQ_PATH = '/requests';
$USER_PATH = '/account';
function get_route($path) {
@@ -55,6 +56,11 @@ function get_pkgbase_route() {
return $PKGBASE_PATH;
}
+function get_pkgreq_route() {
+ global $PKGREQ_PATH;
+ return $PKGREQ_PATH;
+}
+
function get_pkg_uri($pkgname) {
global $USE_VIRTUAL_URLS;
global $PKG_PATH;