summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-04 17:27:41 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-22 17:48:18 +0200
commitd41e40d9d6598d13ac35c7301316e4dba481be4a (patch)
tree6066d62ddb43fb88abd5b25e387086c8f0b81d3a /web/lib
parent64bfa6e8282744ee14b0bde4bb8caacb43400562 (diff)
downloadaurweb-d41e40d9d6598d13ac35c7301316e4dba481be4a.tar.xz
Add a vote type to the TU proposal form
There are only four valid reasons for starting a TU vote, so instead of letting the user choose a vote length, let her pick a reason and set vote length and quorum based on that selection. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 738c7b2..31cdd79 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -615,7 +615,7 @@ function open_user_proposals($user) {
*
* @return void
*/
-function add_tu_proposal($agenda, $user, $votelength, $submitteruid) {
+function add_tu_proposal($agenda, $user, $votelength, $quorum, $submitteruid) {
$dbh = DB::connect();
$q = "SELECT COUNT(*) FROM Users WHERE AccountTypeID = 2";
@@ -623,11 +623,12 @@ function add_tu_proposal($agenda, $user, $votelength, $submitteruid) {
$row = $result->fetch(PDO::FETCH_NUM);
$active_tus = $row[0];
- $q = "INSERT INTO TU_VoteInfo (Agenda, User, Submitted, End, ";
+ $q = "INSERT INTO TU_VoteInfo (Agenda, User, Submitted, End, Quorum, ";
$q.= "SubmitterID, ActiveTUs) VALUES ";
$q.= "(" . $dbh->quote($agenda) . ", " . $dbh->quote($user) . ", ";
$q.= "UNIX_TIMESTAMP(), UNIX_TIMESTAMP() + " . $dbh->quote($votelength);
- $q.= ", " . $submitteruid . ", " . $active_tus . ")";
+ $q.= ", " . $dbh->quote($quorum) . ", " . $submitteruid . ", ";
+ $q.= $active_tus . ")";
$result = $dbh->exec($q);
}