From a93363ac08ade0b17b342c5238efb37fc5d15741 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 6 May 2014 20:52:32 +0200 Subject: Add a packager field to packages Store the last packager in addition to storing the submitter and the maintainer of a package. This allows for checking who last updated a package, even if the package has been disowned. Signed-off-by: Lukas Fleischer --- web/lib/pkgbasefuncs.inc.php | 15 +++++++++------ web/lib/pkgfuncs.inc.php | 2 +- web/template/pkg_details.php | 19 +++++++++++++++++++ web/template/pkgbase_details.php | 19 +++++++++++++++++++ 4 files changed, 48 insertions(+), 7 deletions(-) (limited to 'web') diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 4eaa6404..4d05b945 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -182,7 +182,8 @@ function pkgbase_get_details($base_id) { $q.= "PackageBases.CategoryID, PackageBases.NumVotes, "; $q.= "PackageBases.OutOfDateTS, PackageBases.SubmittedTS, "; $q.= "PackageBases.ModifiedTS, PackageBases.SubmitterUID, "; - $q.= "PackageBases.MaintainerUID, PackageCategories.Category "; + $q.= "PackageBases.MaintainerUID, PackageBases.PackagerUID, "; + $q.= "PackageCategories.Category "; $q.= "FROM PackageBases, PackageCategories "; $q.= "WHERE PackageBases.CategoryID = PackageCategories.ID "; $q.= "AND PackageBases.ID = " . intval($base_id); @@ -917,9 +918,10 @@ function pkgbase_change_category($base_id, $atype) { function pkgbase_create($name, $category_id, $uid) { $dbh = DB::connect(); $q = sprintf("INSERT INTO PackageBases (Name, CategoryID, " . - "SubmittedTS, ModifiedTS, SubmitterUID, MaintainerUID) " . - "VALUES (%s, %d, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), %d, %d)", - $dbh->quote($name), $category_id, $uid, $uid); + "SubmittedTS, ModifiedTS, SubmitterUID, MaintainerUID, " . + "PackagerUID) VALUES (%s, %d, UNIX_TIMESTAMP(), " . + "UNIX_TIMESTAMP(), %d, %d, %d)", + $dbh->quote($name), $category_id, $uid, $uid, $uid); $dbh->exec($q); return $dbh->lastInsertId(); } @@ -937,8 +939,9 @@ function pkgbase_update($base_id, $name, $uid) { $dbh = DB::connect(); $q = sprintf("UPDATE PackageBases SET " . "Name = %s, ModifiedTS = UNIX_TIMESTAMP(), " . - "MaintainerUID = %d, OutOfDateTS = NULL WHERE ID = %d", - $dbh->quote($name), $uid, $base_id); + "MaintainerUID = %d, PackagerUID = %d, OutOfDateTS = NULL " . + "WHERE ID = %d", + $dbh->quote($name), $uid, $uid, $base_id); $dbh->exec($q); } diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index a6fa32e4..c35147fb 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -400,7 +400,7 @@ function pkg_get_details($id=0) { $q.= "PackageBases.NumVotes, PackageBases.OutOfDateTS, "; $q.= "PackageBases.SubmittedTS, PackageBases.ModifiedTS, "; $q.= "PackageBases.SubmitterUID, PackageBases.MaintainerUID, "; - $q.= "PackageCategories.Category "; + $q.= "PackageBases.PackagerUID, PackageCategories.Category "; $q.= "FROM Packages, PackageBases, PackageCategories "; $q.= "WHERE PackageBases.ID = Packages.PackageBaseID "; $q.= "AND PackageBases.CategoryID = PackageCategories.ID "; diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 791c9ee5..12aa6924 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -9,6 +9,7 @@ $catarr = pkgbase_categories(); $submitter = username_from_id($row["SubmitterUID"]); $maintainer = username_from_id($row["MaintainerUID"]); +$packager = username_from_id($row["PackagerUID"]); $votes = $row['NumVotes']; @@ -286,6 +287,24 @@ if ($row["MaintainerUID"]): + + + + + + + + + + + + + + diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index fd7bdadb..eab3a534 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -8,6 +8,7 @@ $catarr = pkgbase_categories(); $submitter = username_from_id($row["SubmitterUID"]); $maintainer = username_from_id($row["MaintainerUID"]); +$packager = username_from_id($row["PackagerUID"]); $votes = $row['NumVotes']; @@ -169,6 +170,24 @@ if ($row["MaintainerUID"]): + + + + + + + + + + + + + + -- cgit v1.2.3-24-g4f1b