Checklist Plugin
Description
ChecklistPlugin creates simple checklists.
It handles the tags %CLI% (CheckList Item), %CHECKLIST%, %CHECKLISTSTART%, %CHECKLISTEND%
and depends on the
Foswiki:Extensions.SmiliesPlugin.
A %CLI% tag creates a image button and a simple click on it changes the state of the image button.
The default states are 'todo' (represented by a
image button) and 'done' (represented by a
image button).
If you put a bullet list or a ordered list between %CHECKLISTSTART% and %CHECKLISTEND% every bullet/ordered list item gets a checklist item.
Every state change will be saved to a topic with name
<YourTopicName>ChecklistItemState. It is possible to
define states (default: todo and done) and matching icons. You can also put more than one checklist into a topic.
Syntax Rules
Just type a %CLI% (CheckList Item) into a topic to create a single checklist item. A simple mouse click on it will change
the state of this item. If the last state is reached the item state falls back to the first state.
If you put a bullet or ordered list between %CHECKLISTSTART% and %CHECKLISTEND% every bullet/ordered list item gets a checklist item.
To modify the states or state icons you can set it with %CHECKLISTSTART% or %CHECKLIST% tag. This tags can also be used to create "reset" buttons and state legends.
All tags can be used with attributes documented in the
Attributes section.
To create a link to the checklist item state topic you can put the following forced link on your checklist topic:
[[%TOPIC%ChecklistItemState]]
If you have installed the
Foswiki:Extensions.SpreadSheetPlugin you can find a statistics on this item state topic.
And if you have installed the
Foswiki:Extensions.EditTablePlugin you can edit the states directly on this topic.
Usage Examples
To change the state of a checklist item just click on it.
Example 1: Create a simple checklist
-
second step
icon was clicked one time
-
last step
icon was clicked two times
You type:
%CHECKLISTSTART%
1 first step
1 second step
1 last step
%CHECKLISTEND%
You get:
- first step
- second step
- last step
Example 2: Create a simple freehand checklist
-
second step
icon was clicked one time
-
last step
icon was clicked two times
You type:
1 first step %CLI%
1 second step %CLI%
1 last step %CLI%
You get:
- first step
- second step
- last step
Example 3: Create a checklist with three states and own icons
-
second step
icon was clicked one time
- and
third step
icon was clicked two times
You type:
%CHECKLISTSTART{states="todo|doing|done" stateicons=":no:|:-I|8-)"}%
1 first step
1 second step
1 third step
%CHECKLISTEND%
You get:
- first step
- second step
- third step
Example 4: Create two checklists on a topic:
every
%CHECKLIST%
and every
%CLI%
tag needs a
name
attribute
You type:
%CHECKLISTSTART{name="first checklist"}%
1 first step
1 second step
%CHECKLISTEND%
%CHECKLIST{name="second checklist"}%
1 first step %CLI{name="second checklist"}%
1 next step %CLI{name="second checklist"}%
You get:
- first step
- second step
- first step
- next step
Example 5: Create a checklist in a table
You type:
| *state* | *todo* |
| %CLI% | first step |
| %CLI% | second step |
You get:
Example 6: Create multiple lists with tables and hard linked item states to allow add/insert/remove items
The
%EDITTABLE%
and
%CHECKLISTSTART%
tag have to stay in the same line.
You type:
%EDITTABLE{changerows="on" format="|label,0,#%SERVERTIME{$year$month$day$hour$min$sec}%|text,50|"}%%CHECKLISTSTART{name="list1"}%
| *STATUS<br/>(click to change)* | *Item* |
| #2007Feb07093710 | testitem |
%CHECKLISTEND%
%EDITTABLE{changerows="on" format="|label,0,#%SERVERTIME{$year$month$day$hour$min$sec}%|text,50|"}%%CHECKLISTSTART{name="list2"}%
| *STATUS<br/>(click to change)* | *Item* |
| #2007Feb07093712 | second |
%CHECKLISTEND%
You get:
Hint: You can use multiple
%CHECKLIST%
tags to create more than one reset button or legend at any position of your checklist topic.
You type:
%CHECKLISTSTART{showlegend="on" reset=":-I Reset"}%
1 first step
1 next step
%CHECKLISTEND%
You get:
- first step
- next step
(
- todo
- done )
Reset
- the reset button was clicked
- Hint: You can use multiple
%CHECKLIST%
tags to create more than one reset button.
You type:
1 first step %CLI%
1 next step %CLI%
%CHECKLIST{reset=":ok: set all done @done"}%
You get:
- first step
- next step
set all done
Example 9: Insert new items in an existing checklist without state lost
-
first step
and second step
was clicked before new items (first new inserted item
and second new inserted item
) were added
- Hint: You can put a
<whitespace>#<ID>
instead of %CLI{id="<ID>"}%
into a bullet or ordered list item to add/insert a checklist item with own id. This works only between %CHECKLISTSTART%...%CHECKLISTEND%
.
You type:
%CHECKLISTSTART%
1 first step
1 first new inserted item #MyFirstInsertedItem
1 second step
1 second new inserted item %CLI{id="MySecondInsertedItem"}%
%CHECKLISTEND%
You get:
- first step
- first new inserted item
- next step
- second new inserted item
Attributes
Usage:
%CLI{attribute1="value1" attribute2="value2" ...}%
or
%CHECKLIST{attribute1="value1" attribute2="value2" ...}%
or
%CHECKLISTSTART{attribute1="value1" attribute2="value2" ...}%
Examples:
%CHECKLIST{showlegend="on" reset=":-I Reset checklist"}%
%CLI{id="i1"}%
Examples (if installed)
Use this examples to check your installation:
- %CLI{text="first step"}%
- %CLI{text="next step"}%
%CHECKLISTSTART{name="generated" template="patchday"}%
%CHECKLISTEND%
ChecklistPluginChecklistItemState
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%
, i.e.
%CHECKLISTPLUGIN_STATES%
- Debug plugin: (See output in
working/logs/debug.log
)
- Set CHECKLISTPLUGIN_DEBUG = 0
- Setup states and icons (defaults:
todo¦done
and :-I¦:ok:
; remove # for setup):
- Set CHECKLISTPLUGIN_STATES = todo|doing|done
- Set CHECKLISTPLUGIN_STATEICONS = :-(|:-I|:ok:
- Enables 'reset' button (default: disabled with undefined value; value is a text or icon):
- Set CHECKLISTPLUGIN_RESET = [Reset all]
- Enables/Disables state legend (default:
off
)
- Set CHECKLISTPLUGIN_SHOWLEGEND = off
- Enables/Disables link anchors (default:
on
)
- Set CHECKLISTPLUGIN_ANCHORS = on
- Set unknown parameter message (default:
%RED% Sorry, some parameters are unknown: %UNKNOWNPARAMSLIST% %ENDCOLOR% <br/> Allowed parameters are (see System.ChecklistPlugin topic for more details): %KNOWNPARAMSLIST%
)
- Set CHECKLISTPLUGIN_UNKNOWNPARAMSMSG = Following parameter(s) is/are unknown: %UNKNOWNPARAMSLIST%
- Enables/Disables mail notification (default:
off
; old bevavior: on
)
- Set CHECKLISTPLUGIN_NOTIFY = off
- Enables/Disables AJAX feature (JavaScript based item state changes):
- Set CHECKLISTPLUGIN_USEAJAX = on
- Sets the icon state tooltip:
- Set CHECKLISTPLUGIN_TOOLTIP = Click me to change my state '%STATE%' to '%NEXTSTATE%'.
- Sets offsets to fix horizontal/vertical tooltip position:
- Set CHECKLISTPLUGIN_TOOLTIPFIXLEFT = 0
- Set CHECKLISTPLUGIN_TOOLTIPFIXTOP = 0
- Enables/Disables state selection popup (default:
off
):
- Set CHECKLISTPLUGIN_STATESEL = off
Templates
Templates allows you to setup all plugin attributes bounded to a template name. Only uppercase letters are allowed for a
template name.
Syntax:
Set TEMPLATE_template name_attribute name = attribute value
Template Usage:
%CLI{template="template name"}%
(the same for
%CHECKLISTSTART%
,
%CHECKLIST%
).
Examples:
- Default
- Set TEMPLATE_DEFAULT_STATEICONS = :-I|:-)
- Set TEMPLATE_DEFAULT_STATES = todo|done
- Patchday
- Set TEMPLATE_PATCHDAY_STATEICONS = :no:|:yes:|:skull:|%Y%
- Set TEMPLATE_PATCHDAY_STATES = notpatched|patched|reboot|done
- Set TEMPLATE_PATCHDAY_CLIPOS = left
- Set TEMPLATE_PATCHDAY_TOOLTIP = Click me to change my state %STATE% %STATEICON% to %NEXTSTATE% %NEXTSTATEICON%.
There are %STATECOUNT% states (%STATES%).
%LEGEND%
Plugin Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will
not show up in the
search results.
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Change History