====== doodle2 Plugin ======
---- plugin ----
description: Let users vote for given choices, e.g. to schedule a meeting. (Inspired by doodle.com)
author : Robert Rackl
email : wiki@doogie.de
type : syntax
lastupdate : 2011-01-20
compatible : Rincewind, Angua, Adora belle, Binky
depends :
conflicts : doodle
similar : doodle, vote, userpoll
tags : vote, doodle, schedule, poll
downloadurl: http://public.doogie.de/projects/dokuwiki/doodle-latest.tar.gz
bugtracker : http://getsatisfaction.com/doogie/products/doogie_doodle_dokuwiki_plugin
sourcerepo : https://github.com/Doogiemuc/Dokuwiki-Plugin-Doodle2
----
===== Description =====
{{ http://public.doogie.de/projects/dokuwiki/doodle-screenshot.png}}
With this plugin you can offer your visitors a poll, where each user can vote for one (or more) choices. This is a unification of the [[doodle]], [[vote]], and [[userpoll]] plugins. I tried to implement all their **features** into one plugin:
* duplicate votes can be prevented by IP or voting can only be allowed for logged in users
* logged in users can edit their vote afterwards
* a poll can be closed
* a poll can be moved to another page without loosing its data
* well documented code
There is a DEMO online on my [[http://wiki.doogie.de/playground/playground|private homepage]]. FIXME
It's unbelievable how active this plugin got. I get feedback posts nearly daily. I am only developing this plugin in my spare time. So please understand that I will not be able to implement all requested features. Of course you are free to upload an improved version to github. This is open source after all.
===== Download and Installation =====
Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
===== Syntax and Usage =====
* Option 1
* Option 2 **some wikimarkup** \\ is __allowed__!
* Option 3
* The ''title'' is also used as "key" for the plugin's data file under ''/data/meta''
* ''adminUsers'' and members of the ''adminGroups'' can always edit any entry
* ''voteType="single"'' shows round checkboxes where only one can be chosen
* ''voteType="multi"'' lets users check any number of square boxes
* If ''closed="true"'' is set, then users cannot vote anymore. The result of the vote will still be shown.
Only the title and at least one option are required. Do not change the options and their order, after the first vote has been casted! You may move the whole doodle to another page, whenever you want.
===== Authentication =====
By default anyone can vote, even multiple times under different name. In this mode users cannot change their vote, once they submitted it.
You can prevent multiple votes, by setting ''%%auth="IP"%%''. Then users will be authenticated by their IP address((which is **not** a very good way of authenticating users. But at least it requires no registration.)).
If you set ''%%auth="user"%%'' then only registered and logged in users are allowed to vote. This has the advantage, that users later on can edit their vote, i.e. change their mind. In this mode, the users fullname and login name are automatically set for the vote.((You have no idea how complicated this can get. But don't worry, the plugin takes care of all that. For example, let's assume someone starts an open vote, and after some votes changes this to ''%%auth="user"%%''. Now user "Peter" logs in. But someone (maybe anyone) may already have voted with the name "Peter". In this case, this becomes Peters vote, and he might change it.))
===== GitHub =====
This plugin is open source! So feel free to impove it. I imported the code to **GitHub**: https://github.com/Doogiemuc/Dokuwiki-Plugin-Doodle2
===== More Details =====
The doodle's data is saved in ''/data/meta/title_of_vote.doodle''. The filename is the (masked) title. This has the advantage that you can move your doodle to another page, without losing the data.
Each of the green success icons has a popup title, that shows when this vote has been casted.
==== Version History ====
A word about the name of this plugin. This plugin is simply named "Doodle". There is a older [[plugin:doodle|Plugin Doodle]]. Its author and me both consider this plugin as the successor of the older plugin doodle version one. I only created this page with the name "doodle2", cause I didn't want to overwrite the old one.
* 4.0: new parameter closeon. Bugfixes and new deployment file structure.
* 3.0: Multiple Plugins in one page now works, moved all JavaScript to script.js
* 2.3: old stuff
* 1.0: the old [[plugin:doodle]]
===== FAQ =====
> I am having trouble to add more than one doodle on a page. Having two and more doodles, the edit and delete function for the admin is not working (tested on different browsers using the latest dokuwiki).
This is now **fixed in version 3.0**. -- Doogie (plugin author)
----
**How to clear the Poll??**
* e.g. to restart the same poll again next time.
=> you can chose another title for your new poll, or delete the data file under ''/data/meta/title_of_vote.doodle''
----
I've found an issue on 2011-11-10 "Angua RC1" (Debian 5.0 Lenny). If you install the plugin with the Plugin Manager or manually it makes the "lib/plugins/doodle2" directory. The plugin is not working, is not able to parse the tag. But if you rename the doodle2/ dir to doodle/ it runs like a charm:
$ cd DOKUWIKI/lib/plugins/
$ mv doodle2 doodle
Don't know if it's happening only to me or there are more users that have seen this issue.
[[user>r0sk|Oscar M. Lage]] //2011/12/09 15:26//
> This is due to the [[http://doogie.in-space.de/cgi-bin/viewvc.cgi/svnrepos/dokuwiki/doodle/plugin.info.txt?view=markup|plugin.info.txt]] having the wrong "base". It should be "doodle" and not "doodle2". --- [[user>ach|Anika Henke]] //2011/12/10 00:49//
Hello Anika. Thank you very much for your answers! The [[doodle]] plugin already installs into the ''/doodle'' directory. Therefore I named my plugin "doodle2". -- Robert (plugin author) //2011/12/28//
> Yes, I'm aware of that. But your code doesn't reflect that name and therefore doesn't work in a doodle2 directory (and therefore is incompatible with the doodle plugin). The better solution to this is to rename "syntax_plugin_doodle" to "syntax_plugin_doodle2", then it would work in a "doodle2" directory (and you would get more than 0 [[:popularity]] points). You should read more on [[devel:plugins#plugin_name|plugin names]] and [[devel:plugin_file_structure|plugin file structure]]. --- [[user>ach|Anika Henke]] //2011/12/28 12:55//
Version 4.0 has now "doodle" everywhere: in the class name and in info.txt. I've testes the installation with the plugin manager and it worked. Ok I know, now I am still "incompatible" with the original "doodle" plugin. But I see this differently: My plugin is the sucessor, just like a new version. Version numbers are not reflected in plugin directory names, arn't they.
----
\\
It would be nice to have a option to be able to enter any name (as a anonymous voter) even if the contributor is logged in. -- nodens //2012/03/02 12:55//
> Update : I wrote a quick & dirty patch for doing just that. See [[https://getsatisfaction.com/doogie/topics/adapt_doodle_for_task_management|this request]] on getsatisfaction. nodens //2012/03/02 16:01//
----
\\
Some a11y would be nice. All options are empty cells (no label, id or title). If you have multiple options it is very difficult or even impossible for a blind person to use this. //2013-01-27 kvr//
----
==== Icons missing in "Binky" ====
Installing the PlugIn works ok, but on reviewing a doodle, the icons for 'edit' and 'delete' are missing.
> It appears that these were supposed to be in the dokuwiki image folder but aren't anymore:
> src="/dokuwiki/lib/images/pencil.png" and src="/dokuwiki/lib/images/del.png"
>> Solution: Have a look at the WRAP-PlugIn, which uses the famfamfam icon set from: http://www.famfamfam.com/lab/icons/silk/, I downloaded the set and put the pencil.png and the cancel.png into /dokuwiki/lib/images/, renamed //cancel// to //del//.
>> A proper fix would be to relocate the icons into the doodle internal folder.
>> --- [[user>Arthor|Arthor]] //2014/03/16 17:43//
----
==== Feature: Prefer auth=none ====
//Problem:// In my DokuWiki-installation, all users are logged in with a general 'guest' login. Every guest should be able to vote - but isn't allowed to because the login-information takes precedence over the doodle-auth='none' configuration.
> //Solution:// This can be improved without affecting any other functionality, (Using //Binky// and Version 4.0 of the PlugIn) by changing two locations inside '//syntax.php//': --- [[user>Arthor|Arthor]] //2014/03/16 18:20//
@lines 373ff:
- //do not vote twice, unless change__vote is set
- if (isset($this->doodle["$fullname"]) && !isset($_REQUEST['change__vote']) ) {
- $this->template['msg'] = $this->getLang('you_voted_already');
- return;
- }
+ //do not vote twice, unless change__vote is set or no authentication required
+ if (isset($this->doodle["$fullname"]) && ($this->params['auth'] > self::AUTH_NONE) && (!isset($_REQUEST['change__vote']))) {
+ $this->template['msg'] = $this->getLang('you_voted_already');
+ return;
+ }
@lines 488ff:
- if (isset($this->template['editEntry'])) {
- $fullname = $this->template['editEntry']['fullname'];
- $editMode = true;
- } else {
- if (isset($this->doodle["$fullname"]) ) return '';
- }
+ if (isset($this->template['editEntry'])) {
+ $fullname = $this->template['editEntry']['fullname'];
+ $editMode = true;
+ } else {
+ if ($this->params['auth'] == self::AUTH_NONE) {
+ $fullname = '';
+ } else {
+ if (isset($this->doodle["$fullname"]) ) return '';
+ }
+ }
==== Icons in Ponder Stibbons ====
If you want to show the icons you have to get it from an old version of dokuwiki: \\
the files ''delete.png'' and ''pencil.png'' have to be contained in the folder ''lib>>images''