From d41e40d9d6598d13ac35c7301316e4dba481be4a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 4 Aug 2013 17:27:41 +0200 Subject: 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 --- web/lib/acctfuncs.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web/lib') 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); } -- cgit v1.2.3-70-g09d2