summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 3e4b572..50cb47e 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -967,7 +967,8 @@ function pkgbase_get_comaintainers($base_id) {
$dbh = DB::connect();
$q = "SELECT UserName FROM PackageComaintainers ";
$q .= "INNER JOIN Users ON Users.ID = PackageComaintainers.UsersID ";
- $q .= "WHERE PackageComaintainers.PackageBaseID = " . intval($base_id);
+ $q .= "WHERE PackageComaintainers.PackageBaseID = " . intval($base_id) . " ";
+ $q .= "ORDER BY Priority ASC";
$result = $dbh->query($q);
if ($result) {
@@ -1012,9 +1013,11 @@ function pkgbase_set_comaintainers($base_id, $users) {
$q = sprintf("DELETE FROM PackageComaintainers WHERE PackageBaseID = %d", $base_id);
$dbh->exec($q);
+ $i = 1;
foreach ($uids as $uid) {
- $q = sprintf("INSERT INTO PackageComaintainers (PackageBaseID, UsersID) VALUES (%d, %d)", $base_id, $uid);
+ $q = sprintf("INSERT INTO PackageComaintainers (PackageBaseID, UsersID, Priority) VALUES (%d, %d, %d)", $base_id, $uid, $i);
$dbh->exec($q);
+ $i++;
}
return array(true, __("The package base co-maintainers have been updated."));