diff options
author | Mark Weiman <mark.weiman@markzz.com> | 2015-12-14 16:18:16 -0500 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-12-15 17:46:18 +0100 |
commit | e9fe1a9eb100b11fda80f05b5b3239ee97e3a905 (patch) | |
tree | e484f0f2dea3871d4e5b6b7c5b812f07b93259d0 /web/lib/pkgbasefuncs.inc.php | |
parent | 76a589257ef37402ad53b4b876e9383c19f8e18a (diff) | |
download | aurweb-e9fe1a9eb100b11fda80f05b5b3239ee97e3a905.tar.xz |
Add link to flag OOD comment
Implements: FS#46546
Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r-- | web/lib/pkgbasefuncs.inc.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 1abe426..2b1201d 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -445,6 +445,38 @@ function pkgbase_unflag($base_ids) { } /** + * Get package flag OOD comment + * + * @param int $base_id + * + * @return array Tuple of pkgbase ID, reason for OOD, and user who flagged + */ +function pkgbase_get_flag_comment($base_id) { + $base_id = intval($base_id); + $dbh = DB::connect(); + + $q = "SELECT FlaggerComment,OutOfDateTS,Username FROM PackageBases "; + $q.= "LEFT JOIN Users ON FlaggerUID = Users.ID "; + $q.= "WHERE PackageBases.ID = " . $base_id . " "; + $q.= "AND PackageBases.OutOfDateTS IS NOT NULL"; + $result = $dbh->query($q); + + $row = array(); + + if (!$result) { + $row['error'] = __("Error retrieving package details."); + } + else { + $row = $result->fetch(PDO::FETCH_ASSOC); + if (empty($row)) { + $row['error'] = __("Package details could not be found."); + } + } + + return $row; +} + +/** * Delete package bases * * @param array $base_ids Array of package base IDs to delete |