summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgbasefuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-06-25 11:29:17 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-06-25 11:38:02 +0200
commit91e6b5cb2f3d531ce40cd0331e2261d30766de47 (patch)
tree1b901e6000b44569123a51fd2dd2aa371d92f443 /web/lib/pkgbasefuncs.inc.php
parent959c61a77dd6a41bf82cc12b5eb873c9cfb0ffb8 (diff)
downloadaur-91e6b5cb2f3d531ce40cd0331e2261d30766de47.tar.gz
aur-91e6b5cb2f3d531ce40cd0331e2261d30766de47.tar.xz
Add support for merge requests
This adds a new "Merge" category to the list of available request types and also adds a new "Merge into" field that is hidden via JavaScript when "Deletion" or "Orphan" is selected. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r--web/lib/pkgbasefuncs.inc.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 2444674f..68dd656c 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -984,6 +984,7 @@ function pkgbase_request_list() {
$q = "SELECT PackageRequests.ID, ";
$q.= "PackageRequests.PackageBaseID AS BaseID, ";
$q.= "PackageRequests.PackageBaseName AS Name, ";
+ $q.= "PackageRequests.MergeBaseName AS MergeInto, ";
$q.= "RequestTypes.Name AS Type, PackageRequests.Comments, ";
$q.= "Users.Username AS User, PackageRequests.RequestTS, ";
$q.= "PackageRequests.Status ";
@@ -1002,11 +1003,12 @@ function pkgbase_request_list() {
* @global string $AUR_REQUEST_ML The request notification mailing list
* @param string $ids The package base IDs to file the request against
* @param string $type The type of the request
+ * @param string $merge_into The target of a merge operation
* @param string $comments The comments to be added to the request
*
* @return void
*/
-function pkgbase_file_request($ids, $type, $comments) {
+function pkgbase_file_request($ids, $type, $merge_into, $comments) {
global $AUR_LOCATION;
global $AUR_REQUEST_ML;
@@ -1030,10 +1032,11 @@ function pkgbase_file_request($ids, $type, $comments) {
}
$q = "INSERT INTO PackageRequests ";
- $q.= "(ReqTypeID, PackageBaseID, PackageBaseName, UsersID, ";
- $q.= "Comments, RequestTS) VALUES (" . $type_id . ", ";
+ $q.= "(ReqTypeID, PackageBaseID, PackageBaseName, MergeBaseName, ";
+ $q.= "UsersID, Comments, RequestTS) VALUES (" . $type_id . ", ";
$q.= intval($base_id) . ", " . $dbh->quote($pkgbase_name) . ", ";
- $q.= $uid . ", " . $dbh->quote($comments) . ", UNIX_TIMESTAMP())";
+ $q.= $dbh->quote($merge_into) . ", " . $uid . ", ";
+ $q.= $dbh->quote($comments) . ", UNIX_TIMESTAMP())";
$dbh->exec($q);
/*