Extension:Tasks Extension

This extension provides the ability to create tasks on any page of your MediaWiki. Tasks may have severity, priority, status, and owner properties set. Also included is a highly configurable Special page for aggregateing tasks on your site by various criteria. All tasks are stored in MySQL, so the Special page is extremely fast.

Original author is Aran Deltac, but he no longer maintained it. I don't guarantee that I'll maintain this extension, but I write here all necessary to make it work, 'cause Aran Deltac only propose the archive to download. Fortunately google cache gave me instructions to make it work! --Iubito 15:54, 10 February 2006 (UTC)

News

 * 2007-05-05: Released version 0.5.4 for the specialpage, fix the problem with missing articles, fix the extension to work also in different Namespaces e.g. Templates --Ozz 12:35, 5 May 2008 (UTC)
 * 2007-03-22: Released version 0.5.3, fixed the regexp responsible for locating the user name in task text. Now the task description can contain parentheses ( and ) --User:SebM
 * 2006-10-10: Released version 0.5.2, fixed multiple tasks tags in the same page + clicking on a user show this user's tasks instead of the user personnal page --Guillaumep 18:28, 10 October 2006 (UTC)
 * Patched the 0.5.2 SpecialTasks.php to avoid "Undefined index" notices that appeared in recent MW. --Iubito 04:22, 22 February 2007 (UTC)
 * 2006-06-08: Released version 0.5.1, compatible MediaWiki 1.6.7 (parser changes), probably don't work with earlier version of MW, don't know. --Iubito 07:19, 7 July 2006 (UTC)
 * Initializing the parser in SpecialTasks
 * A function to feed the tasks_buffer array seperately from the hook
 * 2006-06-24: Released version 0.5. Affects  only. --Dangerville 22:14, 24 June 2006 (UTC)
 * Added extension credits/info visible on your
 * Added customizable message for link text on  (Tasks instead of  )
 * Added option to restrict access
 * Modified to follow guidelines/examples from Writing_a_new_special_page
 * Created subclass special page (more customizable)
 * 2006-04-03: Released version 0.4.3
 * fixed warning about hidden. Mod by James.
 * 2006-03-12: Released version 0.4.2
 * fixed bug with category links. Mod by Filo.
 * 2006-03-12: Released version 0.4.1
 * now compatible with popular Calendar extension. Mod by mhc.
 * 2006-02-10: Released version 0.4
 * compatible with MediaWiki 1.4
 * now special page list correctly task in namespaces
 * alt and title on images
 * Iubito write instructions here because Aran Deltac has changed his website.
 * 2005-11-04: Released version 0.3, fixing a bug in the display of the task images.
 * 2005-11-03: Released version 0.2 with the ability to hide tasks.
 * 2005-11-02: Released version 0.1.
 * 2005-11-01: Re-wrote the format of writing tasks and the parameters accepted.
 * 2005-10-31: First version of MediaWiki Tasks released.

Compatibility
Aran Deltac has tested it on MediaWiki 1.5.1, Iubito tested it on MediaWiki 1.4.14 (as of version 0.4). User:Smilner could not get it to work out of the box on 1.5.6. Use at your own risk.

Version 0.4.3
1. Change the SQL code that makes the tasks table as create type task_status as ENUM('!','1','2','3',' ','x'); create type yes_no as ENUM('y','n');
 * Working on 1.5.8 for James.
 * Working on v1.15.2 for Carl. I am running PostgreSQL v 8.3.12.  Several minor modifications were needed to port this from MySQL to Postgres

CREATE TABLE tasks (   page_id INT NOT NULL DEFAULT 0,    STATUS task_status NOT NULL DEFAULT ' ',    owner varCHAR(255) NOT NULL,    summary text NOT NULL,    hidden yes_no NOT NULL DEFAULT 'n' );

create index owner_idx on tasks (owner); 2. Conform 3 lines of SpecialTasks.php to convert double quotes to single quotes in where clause. Change line $where[] = 'status<="'.$args['status'].'"';

to $where[] = 'status<='. "'". $args['status']."'";

and $where[] = 'owner="'.$args['owner'].'"';

to $where[] = 'owner='. "'" . $args['owner']. "'";

and $where[] = 'hidden="n"';

to $where[] = 'hidden='. "'n'";

3. My system is case sensitive. Tasks.php code did not match the image names and I liked the image hack by tbhot3ww anyway, so I changed Tasks.php formatTask function line. You could just as easily change the image names too.

From $img = '<img src="'.$wgScriptPath.'/images/task';

to $img = '<img src="'.$wgScriptPath.'/images/Ntask';

Version 0.5

 * Working on 1.5.8 for Sider.
 * Working on 1.6.5 for Dangerville.

0.5.1

 * Not working on 1.5.8 for Sider.
 * Working on 1.6.7 and 1.9.3 for Iubito.
 * Working on 1.7.1 for [mailto:rthijssen@gmail.com Rob Thijssen]
 * Working on 1.8.2 for neverhood
 * Working on 1.14.0 for Monster (not a registered user)

0.5.2

 * Working on 1.8.2 for 69.125.35.20

0.5.3

 * Working on 1.10.0 for Qsheets
 * Working on 1.11.0 for Alvin-cs
 * Working on 1.13.3 for User:groovehunter or see for current http://florian-konnertz.de/wiki/Spezial:Version

0.5.4

 * run under 1.11
 * does not work for me under 1.17 (did work in 1.15): "Warning: Parameter 3 to tasksHook expected to be a reference, value given in ~/wiki/includes/parser/Parser.php on line 3470" --Kebap 17:24, 1 September 2011 (UTC)
 * replaced &$parser by $parser in Tasks.php and it seems to fix the previous mentioned error message -- Eric Lacroix 13:53, 12 November 2011 (UTC)
 * previously mentioned fix seems to work for 1.18 as well -- David Raher 16 January 2012
 * The version from this page's discussion page worked for me out of the box under 1.18.1 -- Opfeifer 22:18, 26 January 2012 (UTC)

Usage
Each task must be on its own line and start with [ ]. All the tasks must be grouped with a ..

[ ] Regular task (Owner User) [1] High priority task. [2] Medium priority task. [3] Low priority task (Owner User) [!] Urgent task (must be completed immediately!!!) (Owner user). [x] Closed task.

According to the regular expression, owner parsing doesn't work when there is anything, even a space character, after ')'. e.g.  [ ] Regular task (Owner User)  works fine, but  [ ] Regular task (Owner User).  (note the trailing dot) does not work right.

The tasks tag may have an optional parameter, called hidden, which hides the tasks from being viewed. To use it you would write the beginning tasks tag like.

Tasks Special Page
This page finds all tasks on all pages of your site and displays them all on one page. To view all tasks access index.php?title=Special:Tasks (or Special pages » Tasks). You can provide several arguments to limit the tasks that are returned.
 * status - Show all tasks with the specified status or higher. So, specifying "status=2" would include tasks with the status codes 2, 1, and !.
 * owner - Only tasks assigned to this user.
 * limit - Number of total tasks to list.
 * hidden - Enable the display of hidden tasks.

These arguments are specified by adding a / after and adding them as regular name/value pairs.

Installation
Copy/paste the following codes in files.

includes/SpecialTasks.php
You can restrict access to the page by replacing in the source by This will restrict the access to the users with the "onlyuser"-right. If 'onlyuser' is not a naturally available right in MediaWiki (i.e. not listed on User_rights), When you go to the SpecialPages as a user with 'onlyuser' right, the Tasks link should appear at the bottom under Restricted special pages (tested on 1.6.5). See also Preventing access to some SpecialPages. --Dangerville 22:14, 24 June 2006 (UTC)
 * 1) add 'onlyuser' to the available rights with this line in  :
 * 2) add this line in   (replace 'user' with any other defined user group you want to give the 'onlyuser' privilege):

Execute SQL
If you are using a prefix on your tables, replace PREFIX_ with your prefix. Otherwise you should create a table just named 'tasks'.

Images
Right click and save these images into your images/ folder (image names should be lowercase).



Images hack by tbhot3ww
This are another images you can use in your todo



In order to work as expected modify file Tasks.php and change this line in formatTask function

with this line

LocalSettings.php
At the end of LocalSettings.php, add : include("extensions/Tasks.php"); include("includes/SpecialTasks.php");

All done !

Online demo
Somebody please link to a working installation.
 * http://www.s23.org/wiki/Special:Tasks
 * http://www.rbose.org/wiki/Special:Tasks

License
This code is distributed under the same terms as MediaWiki itself.