Action Tracker Plugin
This plugin provides support for tracking actions embedded in topics. Actions captured this way can then be searched from any topic in the wiki.
Features
- Actions are embedded in topics.
- List actions using searches.
- Automatic e-mail notification of changes.
- Assign actions to individuals, or to predefined groups.
- Pop-up action editor.
- Fully configurable - add your own action attributes.
This plugin is particularly useful for
meeting minutes. As you write the minutes during the meeting, you simply enter the actions into the text, and as soon as the topic is saved, the actions "go live".
For example, at a recent meeting of the British Cabinet:
GordonBrown agreed to a zero tax rate for all self-employed software engineers, to make up for past unfair treatment.
%ACTION{who="GordonBrown" due="5th April 2008"}% Repay all unfairly levied taxes %ENDACTION%
%ACTION{who="AlistairDarling" due="25th Dec 2007"}% Contact Santa to find out who is going to pay for it %ENDACTION%
AlistairDarling observed that this might adversely impact the government hors d'ouvres budget.
But that's not the only application. The action tracker can also be used for:
- personal to-do lists
- highlighting things for attention
- reminding you of important events
Actions are nicely formatted for display, and automatic notification of actions is supported using 'cron'.
Actions are
embedded into topics so you can easily edit them, and even process them with other tools. No separate database to worry about!
Syntax Rules
Actions
Note: if you have used this plugin with TWiki you may note that the syntax of actions has changed. The plugin still recognises the old syntax, and will automatically upgrade topics when you edit them.
Write the command
%ACTION{
attributes }% ... %ENDACTION%
anywhere in a topic, where
...
represents the action description. Standard attributes are
Name |
Value |
Description |
Auto-completed |
who |
See People |
The person or team responsible for completing the action. |
current user |
due |
See Date Formats |
The due date |
|
state |
open or closed |
Set to open if the action is still open; set to closed if the action is closed. To extend the state set, see Non-standard attributes. |
open |
notify |
See People |
wikinames, or e-mail addresses, of people to notify when the action changes. See Notification for details on action notification. |
|
creator |
See People |
Who created the action. |
current user |
created |
See Date Formats |
Date the action was created. |
today |
closer |
See People |
Who closed the action. |
if (and only if) state="closed", current user |
closed |
See Date Formats |
Date the action was closed, if ever. |
if (and only if) state="closed", today |
uid |
6 digit number |
Unique ID of the action. See UIDs. |
calculated |
For example,
%ACTION{ who="WikiGuest" due="2 Jan 2004" state="open" notify="AttillaTheHun" }% An action for WikiGuest %ENDACTION%
%ACTION{ who="LittleOysters" due="2 Jan 1884" state="open" }%
The time has come, the walrus said,
To speak of many things.
Of shoes, and ships, and sealing wax,
Of cabbages and kings.
%ENDACTION%
The fields with an entry in the 'Auto-completed' column are automatically filled in, if they are missing, whenever someone saves the topic containing the action. The default values are as indicated in the table. You can override this behaviour by providing values for any of these attributes when you type the action.
Note: you must
not provide a value for the
uid
(see
UIDs) field!
Note that the
due
field is not auto-completed. If you don't specify a due date for an action, the action is treated as due on a 'to be decided' (TBD) date. TBD actions are always shown in action searches, to help encourage you to timeframe them.
Action searches
Write the command
%ACTIONSEARCH{
attributes }%
anywhere in a topic. Standard attributes are
Name |
Value |
Description |
who |
See People |
Person responsible for closing the action. |
notify |
See People |
Persons who want to be notified of a change |
state |
late , or any legal state value |
Set to late to search for late actions; set to any any legal state value to search for actions in that state. See Settings for details on how to extend the state set. You can also use a Perl regular expression, which must match the entire state name e.g. state="open|closed" will match either open or closed states, but no other states, and state="(?!closed).*" will match every state except closed . Google for perlre for help with Perl regular expressions. |
within |
a number of days |
Search for actions that are within a number of days of their due date. Usually used in conjunction with other attributes, such as state="open" . If you give it a simple number N, it will match actions that are due within N days either side of the current date. If you give N with a leading '+', this restricts the search to N days in the future. If you give N with a leading '-', it matches only actions that fell due in the last N days. |
web |
Perl regular expression |
A regular expression that matches the names of all the webs to search. If this attribute is omitted, the default is to search only the current web. Searching many webs is much slower, especially in a large installation. Webs marked NOSEARCHALL will not be searched. |
topic |
Perl regular expression |
A regular expression that matches the names of all the topics to search. If this attribute is omitted, the default is to search all the topics in the selected webs. |
due |
Absolute or relative date expression. See Date Formats |
Due date for the action. |
creator |
See People |
Who created the action. |
created |
Absolute or relative date expression. See Date Formats |
Date the action was created. |
closed |
Absolute or relative date expression. See Date Formats |
Date the action was closed, if ever. |
closer |
See People |
Who closed the action. |
uid |
6 digit number |
Unique ID of the action. |
format |
Presentation format |
See Formatting tables |
nohtml |
Presentation control |
See Formatting tables |
header |
Presentation format |
See Formatting tables |
footer |
Presentation format |
See Formatting tables |
orient |
Presentation format |
See Formatting tables |
separator |
Presentation format |
See Formatting tables |
sort |
Comma-separated list of field names |
Fields to sort the matched actions by. For example, sort="$who,$due" will sort by who first and then due. This field is optional; by default the table will be sorted by due date. Columns containing only numeric data will be sorted numerically, all other data by alphabetic order. |
For example,
%ACTIONSEARCH{ who="me" state="late" }%
%ACTIONSEARCH{ who="WikiGuest" state="open" within="7" }%
%ACTIONSEARCH{ web=".*" who="Genghis.Khan@mongol.empire.org" state="open" within="7" }%
When you are searching for fields containing dates (such as
closed
,
created
and
due
) you can prepend one of the conditions
>, <, >= and <=
to the date. For example,
closed=">1-Jan-1999"
will match all actions that have been closed at any time since 1-Jan-1999, and
created=">= 1-Jan-2000"
will match all actions created this century. You can also specify dates relative to the current date and time. See
Date Formats for details of how to specify relative dates.
For example,
%ACTIONSEARCH{ state="closed" closed="> 7 days ago"}%
will search for all actions closed in the last 7 days.
Absolute dates are required in action specifications. Date formats must be as recognised by
Time::ParseDate
.
The following absolute date formats are recognised. Dates containing spaces must be enclosed in double-quotes.
- Dow, dd Month yy
- Dow, dd Month yyyy
- Dow, dd Month
- dd Month yy
- dd Month yyyy
- Month day{st,nd,rd,th}, year
- Month dd yyyy
- yyyy/mm/dd
- yyyy/mm
- mm/dd/yy
- mm/dd/yyyy
- mm/yy
- yy/mm (only if year > 12)
- yy/mm/dd (only if year > 12 and day < 32)
You are
strongly recommended never to use the 'mm/dd/yy or mm/dd/yyyy' formats, to avoid confusing users outside of the US, Micronesia, the Phillipines and Palau (these are the
only places in the world that use mm/dd/yyyy). Note that due to limitations in the Time::Parsedate module, dates before 1970 will not work as expected.
When you are searching for fields containing dates (such as
closed
,
created
and
due
) you can specify dates relative to the current date and time. For example:
Syntax |
Example |
Notes |
Dow after next |
Tuesday after next |
|
Dow |
Tuesday |
last Tuesday |
next Dow |
next Thursday |
|
tomorrow |
tomorrow |
|
today |
today |
|
yesterday |
yesterday |
|
last dow |
last wednesday |
|
last week |
last week |
7 days ago |
now |
now |
|
now + count units |
now + 2 years |
|
now - count units |
now - 3 weeks |
|
+ count units |
+ 31 days |
|
- count units |
- 2 months |
|
count units ago |
10 days ago |
|
Valid
units are
minutes
,
hours
,
days
,
weeks
,
years
.
People
People are identified to the action tracker using a wikiname (e.g.
Main.WilliamWallace
or simply
WilliamWallace
) or an e-mail address (e.g.
a_einstein@pto.co.ch
). The e-mail address is useful if you want to notify people who aren't registered in the wiki, but bear in mind that if they are outside your firewall, they'll get action notifications but the chances are they won't be able to edit pages and close actions.
Very annoying!
E-mail addresses of people are found by the process
described below.
You can also use the shorthand
me
for the currently logged-in user (this is the guest user unless you have been prompted for a username and password). In actions, this will automatically be expanded when the topic is saved, and in searches it will match the currently logged in user.
Groups
You can assign an action to a group. Alternatively you can give a list of people as the value of the attribute. For example,
%ACTION{who=AdminGroup ...}%
%ACTION{who="KnutHaraldsen,MagnusMagnusson" ...}%
Note in general you should not use these mechanisms for assigning actions, because the actions so created are not specific. Actions should be assigned to one person only, so that it's clear who is responsible for them.
UIDs
For administrators only:
Each action is assigned a Unique Identifier (UID) when it is created. This UID is a six-digit number, and is generated when the action is first saved by incrementing a number in a special file (
pub/_work_areas/ActionTrackerPlugin/UIDRegister
under the installation). If this file is accidentally deleted, or is not writable, then you will have problems and you may get duplicate UIDs. Normally this won't matter a hoot, as UIDs only
have to be unique within a single topic, but if the file is persistantly inaccessible it could be a bit of a nuisance.
Notification
ActionTrackerPlugin comes with a notifier script, like the
mailnotify
script used for
WebNotify. This script allows you to:
- examine all the actions in all webs (except those specified NOSEARCHALL) and notify owners of the state of actions,
- find actions that have changed state, and notify people who have registered an interest in that action.
The frequency with which actions are notified depends on how you set up your cron (or equivalent) jobs on the server.
Be careful what user you use to run this script. It will write the
Foswiki log files, and if these log files are left in a state where they
can't be written to by the Foswiki server, you may break your site.
The
actionnotify
script interprets its parameters as a search expression of the same type as that used in %ACTIONSEARCH%. All actions which match that expression will be notified to their owners.
For example:
actionnotify "header=\"| Assigned to | Due ||\"" format=\"'| $who | $due | $edit |'\" state="open"
Note that the
actionnotify
script must be run from the
bin
directory. This is so it can pick up the path configuration file,
setlib.cfg
.
For example, you could set up the cron jobs as follows:
0 * * * * cd /home/foswiki/bin && ../tools/actionnotify "state=\"late\""
0 8,16 * * * cd /home/foswiki/bin && ../tools/actionnotify "state=\"open\" within=\"3\""
0 0 * * * cd /home/foswiki/bin && ../tools/actionnotify "state=\"open\" within=\"7\"
0 0 * * 1 cd /home/foswiki/bin && ../tools/actionnotify "state=\"open\" within=\"30\"
(If you don't know cron, the first 5 fields are minute, hour, day of month, month and day of week. * means 'every'). This crontab will notify actions according to the schedule:
- Actions that are late will be notified every hour, on the hour
- Actions that are still open within three days of their due date will be notified twice a day, at 8am and 4pm
- Actions that are still open within seven days of their due date will be notified once a day, at midnight.
- Actions that are still open within thirty days of their due date will be notified once a week, at midnight on monday.
A rather aggressive schedule!
Note: At Wind River they notify folks three times a week on Mon, Wed and Fri for open action items due within 8 days.
Crontab entry for geeks:
0 0 * * 1,3,5 (cd .../bin; ../tools/actionnotify state=open within=8 'web=[CEIMPSW].*' > .../logs/actionnotify.txt 2>&1)
You can configure the fields which are scanned to detect state changes; see
Settings.
Translating names to e-mail addresses
The wikiname of the user to be notified is translated to a mail address according to the following rules:
- If the user has a personal page, and that personal page contains a line or lines matching
spaces * Email: email address
or
spaces * E-mail: email address
Alternatively if the topic is a group definition (the name ends in 'Group') then the line
spaces * Set GROUP =
is used to determine the wikinames of the people in the group. These are resolved to email addresses recursively. If that fails,
- If they appear in any WebNotify in any web, in the form of a line that gives an email address, then that address is used.
- If this fails and the 'who' name is a valid e-mail address, for example person@domain.co.uk, then that name is used.
Note: If a name cannot be translated to an e-mail address using the mechanisms described above, a warning will be output to
data/warning.txt
..
The
actionnotify
script is also used to notify users who have registered an interest in being notified when an action changes. This function of the script is activated when you use the
changedsince
parameter.
changedsince
is used to specify the time period within which changed actions are interesting. Any action which has changed in the given period will be notified to all users who have registered an interest in that action using
notify
. The
changedsince
value is a relative date string, which uses the following formats
-
yesterday
-
last
dow
-
last week
-
now
- count units
-
-
count units
- count units
ago
where
units may be minutes, days, hours, weeks, months or even years.
count is just an integer.
dow is the name of a day of the week. For example:
changedsince="last monday"
changedsince="now - 3 days"
changedsince="- 36 hours"
changedsince="3 days ago"
Obviously you have to be careful to synchronise your
changedsince
expression with the activation of your cron job. The ideal is to specify the same delta as the gap between cron activations. For example,
0 0 * * * cd /home/foswiki/bin && ../tools/actionnotify 'web="News" changedsince="yesterday"'
will notify registered users of action changes that occurred in the last 24 hours. Note the use of single quotes to prevent expansion in the shell.
Notes:
- Not all action changes get notified, only changes to certain sensitive fields. You can change the set of fields that are sensitive to changes by setting the NOTIFYCHANGES parameter, as described in Settings, below.
- Unlike all other search terms,
changedsince
works as an OR term rather than an AND term. If you use a compound expression like late,changedsince=yesterday
, this will not give you all late actions that changed since yesterday. Instead, it will give you all late actions and all actions that changed since yesterday.
- If you give the parameter DEBUG to the actionnotify script, it will print out the mails that would have been sent to STDOUT. This is useful for debugging, and may be useful if you have some other processing in mind (such as piping to an alternative mail program).
-
changedsince
requires RCS, and will not work with RcsLite.
Customisation
The
header
,
footer, =format
,
separator
and
orient
parameters of
%ACTIONSEARCH{}%
support formatting of the action table using a similar syntax to that described in
FormattedSearch. For example:
%ACTIONSEARCH{ web="Directors" state="open" format="|$who|$text|$edit|" header="|*Director*|*Films*||" footer="|*Director*|*Films*|" separator="$n" orient="rows" }%
The available
$formattingtokens
are:
Name: |
Expands To: |
$who |
Who is responsible for the action |
$due |
When the action is due |
$state |
Current state of the action (see also note below) |
$notify |
Who to notify when the action state changes |
$closed |
When the action was closed, and who closed it |
$creator |
Who created the action |
$created |
When the action was created |
$edit |
A link to the action editor for this action |
$uid |
Unique identifier for the action |
$web |
Name of the web containing the action |
$topic |
Topic name containing the action |
$text |
Formatted action text |
$link |
An icon that links to tha actual action |
$n or $n() |
New line |
$nop or $nop() |
Is a "no operation". This variable gets removed. |
$quot |
Double quote (" ). |
$percnt |
Percent sign (% ) |
$dollar |
Dollar sign ($ ) |
$statebutton(name,state) |
Displays a button that will change the current state of the action to the named state. If the action is already in that state, nothing is displayed. name is the string used in the button and state is the name of the target state e.g. $statebutton(Close,closed) |
The header and format parameters can also be used with the actionnotify script.
A default format for actions and action search results can be defined in this topic or the WebPreferences topic of the current web. See
Settings for more details.
Because it is useful most of the time to format the output using HTML for links and highlighting, this is the default. If you just want a plain TML table (for example, if you are going to post-process the output) then set
nohtml="on"
.
Non-standard Attributes
As well as the standard attributes you can add non-standard attributes to actions, and use them in searches. For example:
%ACTION{ who="EmperorHadrian" due="1 Jan 0053" state="closed" legion="7th" cohort="6th" maniple="3rd" }% Build a wall to keep the Scots out of England %ENDACTION%
Non-standard attributes must be lower-case words. The following names may not be used for non-standard attributes:
closed
,
closer
,
created
,
creator
,
dollar
,
due
,
edit
,
format
,
header
,
late
,
n
,
nop
,
notify
,
percnt
,
quot
,
sort
,
state
,
text
,
topic
,
uid
,
web
,
who
,
within
.
To define non-standard attributes you need to set the value of ACTIONTRACKERPLUGIN_EXTRAS - see
Settings below. This is a wiki-table format list of attribute names, each with a
type, a
size, and optional additional data. For example, to define the non-standard attributes
plaintiffs
,
decision
, and
sentencing
, we might define
ACTIONTRACKERPLUGIN_EXTRAS
as follows:
* Set ACTIONTRACKERPLUGIN_EXTRAS = |plaintiffs,names,16|decision,text,16|sentencing,date|sentence,select,"life","5 years","community service"|
The following types are supported:
Type |
Format |
Description |
select |
select, size, "option 1", "option 2", … |
Can take one of the string values option 1, option 2,.... etc. |
names |
names, size |
One or more wikinames or e-mail addresses. |
text |
text, size |
An arbitrary text field |
date |
date, size |
A date in one of the formats described above. See Date Formats |
In the above,
size is a single number, which is the width (in characters) of the text box in the action editor for
text
,
names
and
date
, and the number of options to show in
select
..
Note that there is one exception to the "no redefinition" rule above; the
state
attribute can be extended to take extra states. However if you want the closure functionality (closed, closer, and late actions) to work, the
closed
state must be retained. To extend the set of states, simply include a definition of
state
in the ACTIONTRACKERPLUGIN_EXTRAS definition:
* Set ACTIONTRACKERPLUGIN_EXTRAS = |state,select,1,"open","fried","boiled","poached","closed"|
Searching for non-standard attributes
You can of course search for values of non-standard attributes. For example:
%ACTIONSEARCH{ sentence="life" }%
If a non-standard attribute is declared as type
text
you can use perl regular expressions in the search. Searches for values of type
names
will match any-to-any. For example,
%ACTIONSEARCH{ car="VolkswagenBeetle,MercedesCoupe" }%
will match both of the following actions:
%ACTION{ car="VolkswagenBeetle,AudiSport" … }% … %ENDACTION%
%ACTION{ car="ToyotaSupra,MercedesCoupe,ColtLancer" … }% … %ENDACTION%
ActionTrackerPlugin Settings
The following preferences control different aspects of the action tracker's behaviour.
You can override the defaults for these preferences in Main.SitePreferences, the WebPreferences topic of the current web, or in individual topics, using the standard 'Set' syntax e.g:
* Set ACTIONTRACKERPLUGIN_EDITORIENT = rows
General
Preference |
Default |
Description |
ACTIONTRACKERPLUGIN_EXTRAS |
none |
Non-standard attributes - see Non-standard attributes above. |
ACTIONTRACKERPLUGIN_NOTIFYCHANGES |
$who,$due,$state,$text |
The fields to scan to detect changes for actionnotify. Changes in other fields are ignored. |
Preference |
Default |
Description |
ACTIONTRACKERPLUGIN_TABLEHEADER |
| Assigned to | Due date | Description | State | Notify || |
The default format of an action output, unless overridden by format , header etc. The following fields can be output: web , topic , text , who , due , notify , uid , creator , state , edit , and any ACTIONTRACKERPLUGIN_EXTRAS you may have. TABLEHEADER defines the column headings, TABLEFORMAT defines the contents of the columns, and if TABLEORIENT is set to rows , action tables will be aligned as rows of values instead of the default columns of values. |
ACTIONTRACKERPLUGIN_TABLEFORMAT |
| $who | $due | $text $link | $state | $notify | $edit | |
ACTIONTRACKERPLUGIN_TABLEORIENT |
cols |
ACTIONTRACKERPLUGIN_TEXTFORMAT |
Action for $who, due $due, $state$n$text$n$link$n |
The alternative text format of an action, as seen by a mail recipient who doesn't accept HTML in mail. Used when mailing action or change notifications. |
ACTIONTRACKERPLUGIN_CSS |
%PUBURL%/%SYSTEMWEB%/ActionTrackerPlugin/styles.css |
Full URL of the CSS to use in formatting actions. This file is also called from the mail generated by the actionnotify script, so you have to use an absolute URL here, and the URL has to be visible to anyone who might receive an action notification. |
ACTIONTRACKERPLUGIN_DEFAULTDUE |
9999999999 |
If an action has no due date defined when it is created, then it is treated (for sorting etc) as if it was due at this time. This is a number of seconds since 1st Jan 1970, and should be 0 to sort actions that have no due date to the start of a list, or a very large number to sort them to the end. |
ACTIONTRACKERPLUGIN_DISABLECONTROLS |
0 |
If set to 1, the action tracker will not display any active controls (edit link, goto link, state shrotcuts etc.). Implies ACTIONTRACKERPLUGIN_ENABLESTATESHORTCUT=0 |
ACTIONTRACKERPLUGIN_ENABLESTATESHORTCUT |
1 |
If set to 1, the action tracker will show action states using a drop-down menu, to allow viewers to quickly and easily change action states. You can disable this feature by setting this to 0. |
Note that each state has an associated CSS class (e.g.
atpStateopen
) that is used to render the HTML 'select' element when
ENABLESTATESHORTCUT
is on. If you extend the range of states, you will need to add new CSS classes as well.
Preference |
Default |
Description |
ACTIONTRACKERPLUGIN_EDITHEADER |
| Assigned to | Due date | State | Notify | |
Format of the header |
ACTIONTRACKERPLUGIN_EDITFORMAT |
| $who | $due | $state | $notify | |
Format of the data |
ACTIONTRACKERPLUGIN_EDITORIENT |
cols |
Horizontal (rows) or vertical (cols) orientation |
ACTIONTRACKERPLUGIN_EDITBOXWIDTH |
70 |
Override default EDITBOXWIDTH for the action editor |
ACTIONTRACKERPLUGIN_EDITBOXHEIGHT |
22 |
Override default EDITBOXHEIGHT for the action editor |
ActionTrackerPlugin will use the extension
Foswiki:Extensions/JSCalendarContrib for displaying the calendar popup allowing for date selection when editing actions. It will format the selected date according to the settings specified for
JSCalendarContrib.
Refer to the
JSCalendarContrib documentation to learn
how to customize these settings system-wide, for a web or topic using the available date
format specifiers for this extension.
Known Limitations and Debugging
Limitations
The plugin uses the standard Foswiki save method to save the results of action edits. However it doesn't merge parallel edits made to the same action.
Debugging
Set to 1 to enable debug features, including the undocumented
%ACTIONNOTIFICATIONS{}%
and
%ACTIONTRACKERPREFS%
features.
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.
- If the plugin is installed and enabled correctly you should see a formatted action below:
%ACTION{who=WikiGuest,due="1 Jan 2003",open}% Example action %ENDACTION%
- … and the result of a formatted search below:
%ACTIONSEARCH{topic=ActionTrackerPlugin who=WikiGuest header="|Who|Due|State|Description|" format="| $who |$due|$state|$text $link|" orient="rows" }%
Note that if you want to use the
action
template shipped with the
Foswiki:Extensions.CommentPlugin to create actions, then you must put the CommentPlugin
before the ActionTrackerPlugin in the
{PluginsOrder}
configuration option.
Info
Another great Foswiki extension from the
WikiRing -
Working together to improve your wiki experience!
Thanks are due to the following sponsors, who have helped make this plugin possible: