When t3oodle is successfully installed, you just need to place a plugin on any page you want:
In plugin settings of t3oodle you need to define where to store new polls and votings.
If it is empty, they are stored on pid=0 (root).
Now, in fronend you should get this output:
Creating new polls
There are two types of polls:
simple and
scheduled
Both are absolute identically, the only difference is the new action, which provides a date picker
for scheduled polls.
General
Here you can define general information about the poll. A title, a description and a "more info" link.
In show action of a single poll, it looks like this:
The visibility controls if the poll is shown in list action or not. The author of the poll, still can see his/her
own poll.
Also, when visibility is set to "Hide in lists", the slug generated for this poll, is not based on the entered title
anymore.
Author
Here, every visitor of your website can enter his/her name and mail address. Both are mandatory fields.
Important
Each visitor which creates a new poll or votes for an exiting poll, get a cookie (tx_t3oodle_userIdent) set.
Cookie lifetime is set to 365 days.
The cookie is only used, to identify an author of a poll and participants, which voted for a poll.
Note
When an author deletes cookies, admin access to poll is impossible. When participants delete the cookie, they can
vote several times on same poll.
Alternatively, you can disable creation of new polls and voting for polls, using TypoScript.
Then, only logged in frontend users (fe_users) can interact with t3oodle.
Guests (non-logged in visitors) can still see the polls.
Once the user has entered name and mail address, it get stored in local storage.
Note
When userIdent cookie is set, the name and mail input fields are disabled!
Options
Here you can define the options for your poll.
Simple poll
Scheduled poll
alt
Add new options to a simple poll
width
99%
alt
Add new options to a scheduled poll
width
99%
The date picker for scheduled polls only appear in new action. The text format which is being saved is:
2020-12-24 - 16:00-18:00
Copied!
When you keep this syntax, t3oodle is able to treat the text content as DateTime, which is very useful for further
features like ICS export (for e.g. Outlook support).
The time is optional. You can also use any text here.
Tip
There is not limit of options you can add, but at some point it doesn't make fun anymore to vote for the poll.
Note
The required translations of date picker are only passed to view, when the poll classname contains the string
schedule.
Suggestion mode
Since t3oodle 0.8 you can enable the suggestion mode, which allows your participants to submit own options,
before voting.
Note
You can not disable the suggestion mode (when editing poll), after the poll is published.
When it's enabled, and the poll author did not finish the suggestion mode yet, the poll looks like this:
The poll author can finish the suggestion mode in the administration box:
After the suggestion mode is finished, the voting begins.
Settings
Every poll have various settings, the poll author can change:
Yes, No, Maybe
Description
When this option is enabled, participants can choose between three options, instead of two (yes/no).
Secret Participants
Description
When this option is enabled, name and mail of each participant is not displayed.
Caution
The poll author and system administrators can see the hidden information.
Secret Votings
Description
When this option is enabled, the votings and totals are not displayed.
Caution
The poll author and system administrators can see the hidden information.
Super Secret Mode
Description
When this option is enabled, the options Secret Participants and Secret Votings are also enabled.
Additionally, nobody (not even the poll author or admins) can see participant names and votings. Also,
in TYPO3 backend, the votes get hidden when this setting is enabled.
Limit amount of votes per participant
Description
Each participant can only select as much options as defined. But one option can get selected by multiple participants.
Minimum amount of votes per participant
Description
Each participant must select at least as much options as defined.
Limit amount of votes per option
Description
First comes, first serves. When the configured limit is reached, the option get disabled in further votings.
Expiration date
Description
Allows votings only until the given date and time.
Also, the author can not finish the poll, until the expiration date is reached.
Publish
By default a poll is directly published. You can uncheck this box, then the poll is created but not publicly available.
You can make changes, before publishing the poll.
Accept terms
By default this option is disabled. You can enable it in TypoScript and define a page, external URL or file to display
when clicking the link.
When this option is enabled, the author of a new poll needs to accept the linked terms, before the poll is created.
Poll administration
As author of a poll (or administrator) you can edit or finish the poll and you can reset all existing votes.
Below the voting table, authors see an additional box:
Here you can edit, delete or finish the poll (voting process).
Note
Once the first participant placed its vote, the poll can not get deleted anymore.
Instead you can reset all existing votes, until the poll status is "closed":
With enabled suggestion mode
When the suggestion mode has been enabled and is not finished yet, you can finish the suggest mode:
Editing published polls
When you've already published a poll and edit its options or change an option related setting (like Yes, No, Maybe),
all existing votes get removed!
The affected settings and the options section got a "Caution!" label set.
Finish voting
The poll author can finish a poll anytime he/she want, after the poll has been published, unless an expiration date
has been set, in settings of the poll. Then, the finish action can only get triggered, when the expiration date is
reached.
When finishing the poll, you need to select a final option.
Once a poll has been finished, the show action displays the final option, selected by poll author.
Poll status
A poll have a status which is calculated dynamically based on several indicators.
The following status exist:
Draft
Description
Then the poll has been created but is not published yet, it got the status "draft".
Finished
Description
A poll is finished, when the poll author selected a final option.
Opened for suggestions
Description
This mode is only available, when the suggestion mode has been enabled and the poll author did not finished
the suggestion mode, yet. During this period participants can submit own option suggestions. The poll author can
edit them, before finishing the suggestion mode.
Opened
Description
The poll is open for new votings!
Closed
Description
The poll is closed. No new votings allowed! There are several reasons, why a poll may get closed:
set expire date is reached
no available options left (when they are limited)
voting has been disabled, in general
Lifecycle of polls
Lifecycle of polls in t3oodle
1. Poll author creates poll
The first step in lifecycle of a poll is the form which allows frontend users to create new polls.
Here the user can decide to publish the poll directly or keep it as draft.
When the user does not publish the poll, s/he (as poll author) and administrators only see the poll in list action:
2. Publishing the poll
Once the poll author is satisfied with his inputs, s/he can publish the poll. Then it becomes public and participants
can vote for it.
If a poll appears in list view is also depending on the visibility setting, each poll has.
When visibility set to hide in list the poll will not get displayed in list action, even when published.
Same as for draft polls, only the poll author and administrators can see the poll in list.
Note
When poll visibility set to hide in list also the slug (used in URL) is not based on the entered poll title
anymore. The slug is generated randomly then.
Caution
Currently there is no invite mechanism existing. You need to send the link to participants manually.
The publish date is recorded in poll record.
3a. Open for suggestions
During this phase, the participants can submit own option suggestions.
When the poll author finished the suggestion mode or the mode has not been enabled, the voting begins.
3b. Voting for the poll
Once a poll is published, participants can see poll details and vote for it.
During the poll (status) is opened or closed, participants can
edit or delete their own vote.
Also, the poll author is able to reset all votes from poll. And votes get deleted, when the poll author makes changes
to options or option related settings.
4. Editing the poll
Poll authors and administrators can edit their poll all the time, until the poll is finished.
When editing the poll after it has been published, you should know two things about:
When you update options or option related settings, all existing votes for this poll are getting removed!
In edit form you get reminders for that.
When you change the visibility setting of the poll or its title, the slug gets updated!
Then, you need to send the updated link to your participants manually.
Note
Polls with exiting votes and finished polls can not get deleted.
5. Finishing the poll
The poll author can finish the poll at any time, unless the poll's expiration date is set.
S/he have to select a final option for that.
Defines the field in fe_users table to use for the author's/participant's name.
frontendUserMailField
Property
frontendUserMailField
Data type
string
Default
email
Description
Defines the field in fe_users table to use for the author's/participant's mail address.
outputAuthorMails
Property
outputAuthorMails
Data type
bool
Default
1
Description
When enabled, outputs name of author and adds a mailto link, if mail is given. Just output name if disabled.
outputParticipantMails
Property
outputParticipantMails
Data type
bool
Default
1
Description
Same like outputAuthorMails setting, just for participants who voted on a poll.
outputGuestNotice
Property
outputGuestNotice
Data type
bool
Default
0
Description
When enabled, poll authors and participants without fe_users session are marked as "guest"
adminUserUids
Property
adminUserUids
Data type
string
Description
Comma separated list of fe_users uids, which should act as administrators.
Admins have the same access to polls, like its author. Admins can edit or finish all polls.
adminUserGroupUids
Property
adminUserGroupUids
Data type
string
Description
Same as adminUserGroupUids setting, just addressing fe_groups, instead of fe_users.
countMaybeVotes
Property
countMaybeVotes
Data type
bool
Default
0
Description
When enabled, a "maybe" vote does count like a regular vote. Disabled by default.
allowNewSimplePolls
Property
allowNewSimplePolls
Data type
bool
Default
1
Description
Enables/disables creation of new simple polls.
allowNewSchedulePolls
Property
allowNewSchedulePolls
Data type
bool
Default
1
Description
Enables/disables creation of new scheduled polls.
allowSuggestionMode
Property
allowSuggestionMode
Data type
bool
Default
1
Description
Enables/disables suggestion mode setting, when creating new polls.
requireAcceptedTerms
Property
requireAcceptedTerms
Data type
bool
Default
1
Description
When true, authors of new polls need to accept the terms.
termsToAccept
Property
termsToAccept
Data type
string
Description
When set "the terms" is linked with given Typolink parameter, e.g. t3://page?uid=3 or https://www.domain.com.
allowNewVotes
Property
allowNewVotes
Data type
bool
Default
1
Description
Enables/disables new votings (on polls).
enableFlashMessages
Property
enableFlashMessages
Data type
bool
Default
1
Description
Enables/disables flash messages being send from controllers (like "Poll successfully created").
The method you define as slot requires all arguments, passed by dispatcher.
To identify the correct arguments, search in t3oodle code for ->dispatch(__CLASS__.
For example the arguments passed to vote action slot are:
Also, the slot needs to return the arguments in same order, with keys prefixed!
Continue argument
Some signals pass a continue argument, which is set to true by default.
When you set this value to false in your slot, the original code following, is not executed anymore.
You can use this to prevent flash messages and redirects.
PollPermission
t3oodle has got a central class controlling poll permission logic.
Existing permissions are:
isViewingInGeneralAllowed($poll)
isViewingAllowed($poll)
isShowAllowed($poll)
isNewAllowed()
isNewSimplePollAllowed()
isNewSchedulePollAllowed()
isEditAllowed($poll)
isDeleteAllowed($poll)
isPublishAllowed($poll)
isFinishAllowed($poll)
isFinishSuggestionModeAllowed($poll)
isSuggestNewOptionsAllowed($poll)
isVotingAllowed($poll)
isSeeParticipantsDuringVotingAllowed($poll)
isSeeVotesDuringVotingAllowed($poll)
isAdministrationAllowed($poll)
isResetVotesAllowed($poll)
isDeleteOwnVoteAllowed($vote)!!!
They are used in controller actions, as well as in Fluid templates.
Permission ViewHelper
<f:if condition="{t3oodle:permission(action:'newSimplePoll')}">
// show new button
</f:if>
Copied!
The action is passed without trailing is and Allowed.
When a permission requires poll or vote argument, you can call it like this:
<f:if condition="{poll -> t3oodle:permission(action:'delete')}">
// show delete button, for this poll
</f:if>
Copied!
Modifying permissions
Every permission can get changed programmatically, by using Signal/Slots.
is based on entered title (when listing is allowed)
is randomly created (when listing is disallowed)
Good to know
When listing setting of poll gets updated during edit, also the slug gets updated.
t3oodle uses a slot for this, registered with createAfter and updateBefore signal of PollController.
See Signal/Slots for further info.
When a slug wouldn't be unique, the poll uid is appended.
Templates & Partials
t3oodle output is structured to several templates and partials (using sections).
Templates
List Displays a list of polls.
Show Displays details of a single poll. Here, participants can vote.
New Form to create a new poll.
Edit Form to update an existing poll.
Finish Displays form to select final option, to finish poll.
NewSuggestion Displays form to submit new suggestion.
EditSuggestion Displays form to edit suggestion.
All other actions (create, update, delete) redirect to list or show action, by default.
Partials
FormFieldErrors.html Inline validation/error messages for form inputs.
Poll/
New/, Edit/ and Finish/ Each action has dedicated partials.
Header.html
Form.html
Show/
Header.html
Info.html
NoticeExpireDate.html
NoticeSecretVoting.html
Administration.html Box with poll actions. Just visible for the poll author and administrators.
Buttons.html
LabelPublishStatus.html
NoticeVotingDisabled.html
WhoYouAre.html
AuthorInfo.html Username/Mail of poll author.
FormFields.html All form fields a poll has.
FormFields/ All form fields a poll has.
General.html
Author.html
Settings.html
Options/
Header.html Used in both types.
Type/
Simple.html Options section for simple poll.
Schedule.html Options section (with date picker) for scheduled poll.
SuggestionMode/
Overview.html Displayed in show action of poll, when suggest mode is active.
Form/
Creator.html
Suggestion.html The actual suggestion (supporting date picker for scheduled polls)
List/
Header.html
Totals.html
Table.html
Row.html
NewButton.html
Voting.html Voting entrance point. Contains poll notes, the vote form and table.
Voting/
Box.html A single checkbox in voting row.
ParticipantInfo.html Username/Mail of participant.
Row.html A single row in voting table.
Summary.html Shows submit button for voting or displays final option, when poll is finished.
PollFinished.html
PollNotFinished.html
Table.html
Head.html
YourVote.html
Assets
t3oodle ships all required CSS and JavaScript code. The markup in templates is based on Bootstrap CSS Framework in
version 4.5.
The provided JavaScript is written in vanilla JS. No bootstrap JS or any other library required.
Stylesheets
All custom styles are located in Resources/Public/Stylesheets/t3oodle.css. This file get included in TypoScript
setup of t3oodle.
Also you can include an optional TypoScript template, which includes a custom build of Bootstrap itself. You don't
need to include this optional styles, when you already use Bootstrap in your frontend.
JavaScripts
All JavaScript provided by t3oodle are based on vanilla JS. The used date picker is flatpickr,
which is also written in vanilla JS. No frameworks are required.
If frameworks are in use, they do not affect t3oodle's functionality.
Asynchronous loading
Main entry point for t3oodle's JavaScript functionality is the file Resources/Public/JavaScript/t3oodle.js.
Here, all other scripts are loaded dynamically, when requested (determined by query selectors on page).
Update Wizards
t3oodle ships several update wizards, to make it easier to apply structural changes.
Migrate old "One option only" setting
In t3oodle 0.6 the poll setting "oneOptionOnly" has been changed to "maxVotesPerParticipant".
This update wizard checks "tx_t3oodle_domain_model_poll" table for old setting set and migrates it to new option.
Migrate old poll types
Since t3oodle 0.9 the poll types are using Single Table Inheritance. In order to make this pattern to work in Extbase,
the type field must contain the FQCN of the entity model to be used. This migration, converts "simple" and "schedule" to
corresponding class names.
Single Table Inheritance for polls
Since v0.9 t3oodle provides single table inheritance for polls. This allows you to provide own poll types in extensions, easier.
Extbase models t3oodle provide:
\FGTCLB\T3oodle\Domain\Model\BasePoll (abstract)
\FGTCLB\T3oodle\Domain\Model\SimplePoll (final)
\FGTCLB\T3oodle\Domain\Model\SchedulePoll (final)
How to provide new poll type?
Create a new Extbase model extending from \FGTCLB\T3oodle\Domain\Model\BasePoll
Overwrite the property protected $typeName = 'Whatever'; with an UpperCamelCase identifier (used in templates and localization identifiers)
Create new TCA override (EXT:your_ext/Configuration/TCA/Overrides/tx_t3oodle_domain_model_poll.php);
This example is for TYPO3 v9, written in TypoScript. In v10 you should use PHP syntax instead.
When you use Routing Enhancer, you need to add the new poll type, to routing aspect poll-type map and localeMap
Add a partial for the new typeName e.g. EXT:your_ext/Resources/Private/Partials/Poll/FormFields/Options/Type/Whatever.html,
keep in mind that you also need to register the partial path in t3oodle's TypoScript
There are also several translation keys (in locallang.xlf), which have the typeName appended:
header.new.
header.edit.
header.show.
poll.type.
To provide validation for your new poll object, you just need to provide an Extbase validator matching this naming convention:
\Vendor\YourExt\Domain\Model\WhateverPoll <- when this is your poll entity
\Vendor\YourExt\Domain\Validator\WhateverPollValidator <- this is the validator to be expected
Important
If the validator is not existing, validation for this poll entity is disabled!
Support
Issues
If you experienced issues with this extension or if you have a feature request, please visit the issue tracker on
Github: https://github.com/fgtclb/t3oodle/issues
Versions
0.10.0
[TASK] Make t3oodle compatible with TYPO3 v11
[TASK] remove old setup scripts
[TASK] add rector
[TASK] remove slots and add events
0.9.2
[BUGFIX] Always use string comparison to identify "simple" and "schedule" polls
0.9.1
[BUGFIX] Do not check for FQCN when including _calendarLocale
0.9.0
[BUGFIX] Check for vote argument, before using a non-existing one
[TASK] Provide new signal, to modify "findPolls" query constraints