Adds support for action tags in topics, and automatic notification of action statuses
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
%ACTION{ who="TWikiGuest" due="2 Jan 2004" state="open" notify="AttillaTheHun" }% An action for TWikiGuest %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
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. If you want to force %ACTIONSEARCH% only searchs current web, you can setup "$TWiki::cfg{Plugins}{ActionTrackerPlugin}{SearchCurrentWebOnly} = 1" to disable searching on other webs.
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
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.
For example,
%ACTIONSEARCH{ who="me" state="late" }%
%ACTIONSEARCH{ who="me" open late }%
%ACTIONSEARCH{ who="TWikiGuest" 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.
Date formats
Absolute date formats
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.
Relative date formats
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:
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,
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
TWiki log files, and if these log files are left in a state where they
can't be written to by the TWiki 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:
(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:
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 anyWebNotify 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
lastdow
last week
now - countunits
-countunits
countunitsago
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:
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,
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.
Customization
Formatting search tables
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:
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.
User Defined 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%
User defined 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. All attributes must be given a type, which is used by the formatter, the search engine and the action editor. For example,
* Set ACTIONTRACKERPLUGIN_EXTRAS = |plaintiffs,names,16|decision,text,16|sentencing,date|sentence,select,"life","5 years","community service"|
Can take one of the string values option1, option2,.... 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,
The following preferences control different aspects of the action tracker's behaviour.
You can override the defaults for these preferences in Main.TWikiPreferences, the WebPreferences topic of the current web, or in individual topics, using the standard 'Set' syntax e.g:
* Set ACTIONTRACKERPLUGIN_EDITORIENT = rows
Formatting how actions are displayed
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.
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_TEXTFORMAT
Action for $who, due $due, $state$n$text$n
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.
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.
If you prefer the action editor to use the same browser window to edit an action, or you don't have Javascript, set this to 0. If set to 1 will edit an action in a separate browser window.
If you want the action editor to offer a 'Preview Changes' button, instead of the usual 'Save Changes', set this to 0. If this is set, and USENEWWINDOW is 1, the subwindow should close on save, but it won't because I haven't worked out how to do this safely in JavaScript.
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.
The strings used by the $button$ switch. A =$closebutton is a special
Note that if you want to use the action template shipped with the TWiki:Plugins.CommentPlugin to create actions, then you must put the CommentPlugin before the ActionTrackerPlugin in the {PluginsOrder} configuration option.
Plugin Info
Thanks are due to the following sponsors, who have helped make this plugin possible:
Improved the fix for unwanted date changes when you create or edit an action. Now it should also work for servers west of Greenwich.
03 Nov 2010
Ensure there's at least one newline at the end of the topic text after an action edit, and always one empty line between topic content and meta; otherwise attachment meta-data may get eaten
documentation improvements; add CSS classes for different table orientations; standardised entry fields as accepting GMT times only, fixed the test cases
15 May 2009
Add horizontal grid lines to separate tasks as it was too difficult to see where one task ends and the next begins. If the server was east of Greenwich the dates in ActionTrackerPlugin were displayed as one day earlier and each time you edited an action the dates would decrement by one day. ActionTrackerPlugin handles actions without uid very badly. actionnotify refered to old name space.
29 Jan 2009
Correct CSS for search results table; load CSS for ACTIONSEARCH; respect global settings for time format; finished support for header, footer etc.; added reverse; removed apparently spurious newline
7 May 2008
TWikibug:Item5607: http: was being doubled up on URLs in mail due to a core bug
13 Apr 2008
TWikibug:Item4649: merged TWiki:Main.JoaquinBuendia's fix for AJAX updates on IE. TWikibug:Item4760: fixed WYSIWYG editing of topics containing actions TWikibug:Item5531: added simple button option for state changes
TWikibug:Item4528 - Support $formfield in ACTIONSEARCH (same semantics as for formatted search) TWikibug:Item4529 - Remove link from description of action in the $text field of format. Sponsored by Goldstar Events.
13 Aug 2007
TWikibug:Item4086 - header and format parameters give more control over formatting, improved mail sent for notifications (Richard Vinke) TWikibug:Item4373 - added support for TBD action dates; in the process, changed default date store format to ISO for consistency with TWiki. (Crawford Currie) TWikibug:Item4374 - support AJAX-like state changes from the view screen (Crawford Currie) TWikibug:Item4442 - moved preference defaults out of the plugin topic, and verified correct function (Crawford Currie, sponsored by Goldstar Events)
putting styles.css file at the top of the html header so that skins have a chance to override the defaults; fixed generation of css classes; added aptOpen and aptClose; render actions correctly in twiki lists (TWiki:Main/MichaelDaum)
QBE topic made much friendlier using TWiki-4 features; minor bugfixes
10919
TWikibug:Item2606 actionnotify can now read email addresses from password manager as well as new TWiki4 style user topics. actionnotify requires TWiki-4.0.4 + hotfix-4.0.4-1
2.022 Corrected JSCalendar problems, and cleaned up lazy-loading of libraries. Added relative date specs to searches.
8 Feb 2005
2.021 Documentation fixes.
19 Nov 2004
2.020 Added conditions for date matching, and fixed config so that tests pass again.
13 Oct 2004
2.013 If a user cuts and pastes an action with a uid in it, the action editor would get confused. This update ensures all action UIDs are unique within a topic when it is saved.
16 Aug 2004
2.012 Dependency automation and Cairo readiness, further change to within behaviour (bidirectionality)
3 Feb 2004
Fixes for internationalization, name matching, QBE, within= behaviour, documentation.
21 May 2003
Non-standard (user defined) fields. Configurability of tables and action editor. Non-standard attributes. Eliminated chdir. Multi-line actions. Optimization of notifies.
30 Apr 2003
Version 2.0; Large sections rewritten to take advantage of improvements in Plugin support, eliminating two scripts in bin. Added UIDs and formattable action searches
30 Jan 2003
Query-by-example action search with notify field; notification of change emails and actions email are sent as one; notify field was added to topic view and edit; various bug fixes by TWiki:Main/PaulineCheung
26 Sep 2002
Added changedsince notify support, added support for editing in a seperate window, incorporated attribute syntax corrections contributed by PeterThoeny, sorted ACTIONSEARCH output and action notifications
14 Feb 2002
Sorted ACTIONSEARCH results by due date; Fixed bugs editaction kills form data, Actions flagged as late the day before, TWiki table and bullet formatting doesn't work within action text
11 Jan 2002
Added ACTIONSEARCH for selected webs and topics; Changed action editor to use a template; Eliminated UNIX dependencies; Fixed formatting of actions in bulleted lists