Closed (fixed)
Project:
Decisions
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
31 Oct 2006 at 07:27 UTC
Updated:
5 Dec 2006 at 18:30 UTC
Jump to comment: Most recent file
I want to be able to say, for a specific decision (or system wide): a decision is not valid until X out of Y users have voted.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | decisions-cvs_tatien_92141_4.patch | 13.19 KB | tatien |
| #7 | decisions-cvs_tatien_92141_3.patch | 6.86 KB | tatien |
| #3 | decisions-cvs_tatien_92141_2.patch | 968 bytes | tatien |
| #2 | decisions-cvs_tatien_92141_1.patch | 455 bytes | tatien |
Comments
Comment #1
tatien commentedPicking it up.
Comment #2
tatien commentedPatched the install file to add a quorum column to the decisions table.
Comment #3
tatien commentedAdded a quorum section to the form.
Comment #4
tatien commentedPlease take a note that all the patches posted here are dependent on the patches 1 to 8 that I submitted here: http://drupal.org/node/93520.
Comment #5
tatien commentedOops. Please ignore patch #1 on the .install file: column 'quorum' already existed.
Comment #6
tatien commentedWe should actually have two fields for quorum:
The first field should be a percentage field (let's call it P).
The second field should be a value field (call it V).
The minimum number of votes needed for a decision to be legitimate would then be:
P * size_of_the_electoral_list + V
This allows to set quroums such as 50%+1, that would be P = 50% and V = 1.
Comment #7
tatien commentedThis patch verifies if the quorum is met or not and prints a message in the node view regarding its validity.
I also adds a bit of general cleanup in the code.
Comment #8
anarcat commentedOk... a few things here:
1. I think I would prefer to have a single big patch for this, or "thematic patches": e.g. one for implementing the _valid() function, one for implementing the quorum itself, etc.
2. there should be a decisions_valid_hook() if modes or external module want to "validate a decision", and maybe that quorum could be completely split into a seperate module
3. the fields in the database should be named quorum_procent and quorum_abs, imho. the .install file will need to be fixed to rename the current field if this path is taken.
Until then, I wouldn't commit this patch just yet... :)
Comment #9
tatien commentedWARNING: This patch should be applied instead of patches 1-3.
The following patch adds the following features to decisions:
The _valid functions have been removed for now, because:
Comment #10
anarcat commentedOkay, I have an SQL error here after submitting a decision with N = 1 and P = 50:
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) AS num FROM users_roles ur JOIN permission p ON ur.rid = p.rid WHERE FIND_IN_' at line 1 query: _decisions_count_eligible SELECT COUNT(DISTINCT *) AS num FROM users_roles ur JOIN permission p ON ur.rid = p.rid WHERE FIND_IN_SET(' view decisions', p.perm) AND ur.uid != 0 in /var/www/drupal-cvs/core/includes/database.mysql.inc on line 167
So I won't commit the patch just yet. :)
Comment #11
anarcat commentedPatch has been applied, after fixing a few issues (the SQL error, the name of the electoral_list function, namely). A few usability issues remain.
Comment #12
(not verified) commented