Extension talk:Tasks Extension

From mediawiki.org
Latest comment: 9 years ago by 192.109.190.88 in topic Is this extension useful ??
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

Difficulty[edit]

Great extension, lots of possibilities...Unfortunately, the parser removes the namespace when creating links on the task list. Is there a way to fix this so that the links work for pages in namespaces other than (main)? 154.20.86.196 05:01, 10 November 2005 (UTC)Reply

Seconded.
71.67.100.211 04:32, 13 December 2005 (UTC)Reply
This is now fixed Iubito 16:03, 10 February 2006 (UTC)Reply

--132.183.202.242 19:11, 14 February 2006 (UTC) : Great Extension, but the script doesn't extract the owner correctly, if you edit a dot (.) at the end of a task line. Can you please fix this, or provide a corrected example.Reply

A Couple of Things[edit]

Great extension. Very handy, I especially like the special page. I have two comments / requests:

  1. Call me the ugly American, but a way to change the date format to American month-day-year would be nice.
  2. Expand it a bit with due date, and then connect it with your - equally good - Events extension

Thanks

Aran Deltac no longer maintain/support his extensions :( I upgraded this one to version 0.4 for my needs. Not sure I'll need events extension... Iubito 16:03, 10 February 2006 (UTC)Reply


How to get this working with MediaWiki 1.5.6?[edit]

Is there a small Tutorial or something like that? Thanks in advance

Carsten

Thanks to google cache, I found the instructions written by Aran Deltac before he changed his website. I've just written them to Tasks Extension with some fixes. Hope this help ! Iubito 16:05, 10 February 2006 (UTC)Reply

How assigned a task ?[edit]

How to assign a task to a given user ? I've understand it's possible, but haven't understand how to do it.

It's probably basic, but i can't find the way....

(french) Comment faire pour assigner une tâche à un utilisateur. J'ai cru comprendre que cela était possible, mais je ne trouve pas la bonne façon de saisir....

Paul FABING

Add "(User)" at the end of a task line
Ajoute « (Utilisateur) » à la fin d'une ligne
--82.255.247.96 06:11, 27 February 2006 (UTC)Reply

Mais bon sang mais c'est bien sûr !! Merci 82.227.68.218 21:51, 2 March 2006 (UTC)Reply


Kudos[edit]

--Metasim 14:09, 3 March 2006 (UTC)Reply

Thanks a bunch for bringing this to MediaWiki!! Great work!

How do I put a <tasks> tag in a template?[edit]

I'd like to create a template that creates tasks but it does not work. <tasks> [{{{4}}}] {{{5}}} ({{{6}}}) </tasks> Thanks! -David

Compatibility with Calendar Extension:[edit]

Nice extension, Iubito! I added a little code to savetasks(), specifically:

...
	# Rebuild the $tasks_buffer array (in case we're on a <calendar> page)
	clearTasks();
	$content = array(); $tags = array(); $params = array();

	Parser::extractTagsAndParams( 'tasks', $text, $content, $tags, $params );
	foreach($tags as $marker => $markerVal)
		tasksHook( $content[$marker], $params[$marker] );
...

and added the $user and $text incoming parameters to saveTasks(). This was to solve a problem where the "Calendar" extension is rendering (and parsing) text from other pages (which may contain tasks). saveTasks() was then saving repeats of the tasks in the 'tasks' table, attributing them to the page that contained the "calendar" call. This modification maintains attribution to just the page being edited. martin - at - ac6rm.net

Error[edit]

--68.186.119.215 08:51, 3 April 2006 (UTC)Reply

I am getting the following error thrown at me once for each task listed on a page:


Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

So for example, if I have


<tasks>
[ ] Regular task (Owner User)
[1] High priority task.
[2] Medium priority task.
[3] Low priority task (Owner User)
[!] Urgent task.
[x] Closed task.
</tasks>

I will have the following php errors:


Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44

Notice: Undefined index: hidden in /var/www/vhosts/forgestudios.com/httpdocs/dev/extensions/Tasks.php on line 44


I am using the tabbed menu mod, but it is not in a template, nor am I using it on any page with the tasks. Other than that, it is a completely clean install. Any help would be appreciated. Thank you.

I've fixed that - I added an isset() to the Tasks.php. 88.108.59.121

Fixed with isset()[edit]

Could you show me an example of how you were able to fix that?

Error[edit]

When i include Tasks i got an error message

UNIQ63....

All my <anything></anything> are replaced by this error


I am suffering from the same thing - using this extension would 'scrap' all other extensions relying on <tags></tags> which is a shame because it is such a valuable extension 82.31.216.212 02:07, 5 July 2006 (UTC)Reply

MediaWiki 1.6.7 support[edit]

I replaced some functions with this code to make the extension work with MediaWiki 1.6.7 :

extensions/Tasks.php

-----------------------------------------------#
# Purpose   : HTML format a task.
function formatTask( $status, $summary, $owner='', $page='' ) {
        global $wgOut, $wgScriptPath;
        $imgTitle = 'Regular task'; $alt = '[ ]';
        $output = '<img src="'.$wgScriptPath.'/images/task';
        switch ($status) {
                case 'x': $output .= '_done'; $alt = '[x]'; $imgTitle = 'Closed task'; break;
                case '!': $output .= '_alert'; $alt = '[!]'; $imgTitle = 'Urgent task'; break;
                case '1': $output .= '_1'; $alt = '[1]'; $imgTitle = 'High priority task'; break;
                case '2': $output .= '_2'; $alt = '[2]'; $imgTitle = 'Medium priority task'; break;
                case '3': $output .= '_3'; $alt = '[3]'; $imgTitle = 'Low priority task'; break;
        }
        $output .= '.png" width="13" height="13" alt="'.$alt.'" title="'.$imgTitle.'" /> ';

        if ($owner) { $summary .= ' ([[User:'.$owner.'|'.$owner.']])'; }
        if ($page) { $summary = "[[:$page]]: ".$summary; }

        // parse() cannot be called recursively, so we need to create a new Parser
        global $wgTitle;
        $localParser = new Parser();
        $options = ParserOptions::newFromUser( $wgUser );
        $out = $localParser->parse($summary, $wgTitle, $options, false);
        $output .= $out->getText().'<br />';

        return $output;
}


#-----------------------------------------------#
# Purpose   : Used after a page is saved to first delete
#             all tasks and then save the new ones created
#             in the tasks buffer.
# Parameters: article, The article object.
# rev: 2006-03-12: <calendar> extension will cause double-logging of
# tasks rendered on a sub-page.  "Rebuild" section prevents this.
function saveTasks( $article, $user, $text ) {

        global $tasks_buffer;
        global $wgOut;
        $page_id = $article->getID();
        $dbr =& wfGetDB( DB_MASTER );
        # Delete all tasks for this page.
        $dbr->delete(
                'tasks',
                array( 'page_id' => $page_id )
        );

        # Rebuild the $tasks_buffer array (in case we're on a <calendar> page)
        clearTasks();
        $matches = array();
        $elements[] = 'tasks';

        $text = Parser::extractTagsAndParams( $elements, $text, $matches );
        foreach( $matches as $marker => $data ) {
                list( $element, $content, $params, $tag ) = $data;
                tasksHook( $content, $params );
        }

        # Re-insert all tasks that were created when parsing this page.
        foreach ($tasks_buffer as $task) {
                $task['page_id'] = $page_id;
                $dbr->insert(
                        'tasks',
                        $task
                );
        }
        return 1;
}

It doesn't work for me[edit]

I don't remember the error message, 'cause I've tried a lot of things, but this didn't work for me.

As it's a parser extension, there is a 3rd parameter &$parser I add to tasksHook (and then to formatTask). It work in the articles. But the special page doesn't work anymore, 'cause it doesn't know this $parser. It only knows $wgParser which doesn't have mOptions and then fails... :'(

--Iubito 21:20, 6 July 2006 (UTC)Reply

A local parser[edit]

It's not a good idea the local parser, because it has not the other extension registered (my summary contain <anotherextensiontag></anotherextensiontag> and it costs some ms each time to create it.

After a big headache and a lot of help from TimStarling on IRC, I've the solution. I update the article.

--Iubito 07:03, 7 July 2006 (UTC)Reply

Multiple tasks in one page[edit]

I got a problem when putting <tasks></tasks> in more than one place on my page. i.e:

<tasks>[x] foo</tasks>
== foo ==
* <tasks>[1] bar</tasks>
* <tasks>[2] foo</tasks>
=== bar ===
<tasks>
 [x] foo
 [1] foo
 [2] foo
 [3] foo
</tasks>

Someone could please help me?

Ponsfrilus 13:49, 10 July 2006 (UTC)Reply
What output do you get? I get the same tasks repeating below, which is not the desired output.
Same problem here. Add clearTasks(); after the global $tasks_buffer; statement in the tasksHook function.
Hackerssidekick 08:11, 19 July 2006 (UTC)Reply
I'm getting the same behavior, every time I enter a new tasks block it displays all the tasks up to that point from the whole page.--TheChin! 18:11, 4 August 2006 (UTC)Reply

where to find older versions[edit]

where can i find older versions of the script, so i can use it with older mediawiki versions?

Look at the history of the page --82.248.126.211 19:04, 16 July 2006 (UTC)Reply


screenshot request[edit]

This is better before spending time to install .... mailto:sancelot@free.fr

Yes, please post a screenshot or running demo on a wiki.

A few comments[edit]

The version numbers should be the same for Tasks.php and Special:Tasks.php, since an overall version # is listed at the top of the page.

In MW 1.6.7 the parameters don't seem to have any effect because arg_string passed to execute is empty. Try using wgRequest instead of this parameter, it's more inline with what MW does.

--Tderouin 20:51, 21 August 2006 (UTC)Reply

Works for MediaWiki 1.7.1 - with a couple mods[edit]

A few things I needed to do a few things to get it working in MediaWiki 1.7.1.

First, I followed the comments above in MediaWiki 1.6.7 support comment above. Copying and pasteing the revised functions.

Second, in extensions/Tasks.php I modified the function as below:


#-----------------------------------------------#
function saveTasks( $article, $user, $text ) {

        global $tasks_buffer;
        global $wgOut;
        $page_id = $article->getID();

        $dbr =& wfGetDB( DB_MASTER );
        # Delete all tasks for this page.
        $dbr->delete(
                'tasks',
                array( 'page_id' => $page_id )
        );

        # Rebuild the $tasks_buffer array (in case we're on a <calendar> page)
	# Updated parameter values and return values for extractTagsAndParams function. 
	# The lines below work with Wiki 1.7.1
        clearTasks();
        $matches = array(); $tags = array(); $params = array();
        $element = 'tasks';
        $text = Parser::extractTagsAndParams( $element, $text, $matches, $tags, $params );
        foreach( $matches as $marker => $data ) {
				$content = $data;
				addToTaskBuffer($content);
        }

        # Re-insert all tasks that were created when parsing this page.
        foreach ($tasks_buffer as $task) {
                $task['page_id'] = $page_id;
                $dbr->insert(
                        'tasks',
                        $task
                );
        }
        return 1;
}

As mentioned in my code comments, I am not sure at what version MediaWiki cahnged the extractTagsAndParams function. I do know that I need to update this section to get the information for saving to the database in MediaWiki 1.7.1.

Now it seems to work fine. Please comment if anyone finds a better solution. I suppose one should do a little error checking here for MediaWiki version number and return the correct value no matter what version, but who has the time. :)

Robin

Use of Special:Tasks as a template[edit]

I would like to use lists of tasks as a template:

{{Special:Task}}

But it do not work. It work for me on Newpages:

{{Special:Newpages/10}}

Could not make it work with version 1.67[edit]

I have used the latest Tasks.php and SpecialTasks.php and the versions 0.51 with MediaWiki. I cannot save the tasks. I just get usual text and no formatted out put when I try to save anything with the tasks tag. The database is not getting populated either. The special page comes out empty as a result. Any ideas?

In addition following the modifications through the history and discussions is kind of confusing. Please post separately working versions for various versions of MediaWiki.

Duplicated tasks[edit]

I ran into an small bug where a page with multiple tasks would have task duplication.

The following code

<tasks>
[ ] a
[ ] b
</tasks>

<tasks>
[ ] c
[ ] d
[ ] e
</tasks>

would produce the output

[ ] a
[ ] b

[ ] a
[ ] b
[ ] c
[ ] d
[ ] e

To fix it I clear the task buffer by inserting

$tasks_buffer = array();

to line 30 which is just before the call to addToTaskBuffer($content) in the tasksHook function.

--Superjodash 19:15, 11 January 2007 (UTC)Reply

Hidden Attribute ignored[edit]

working with MW 1.6.9, the extesnsion works except for the hidden parameter which seems to be ingnored (Aran originally put it at my request), the system doesn't seem to update the the hidden field in the database correctly, it is always 'n', if you set the value in the database to 'y' then it is ignored and the tasks still appear on the article page. (The idea was that hidden tasks don't appear on the article page but do in the special:tsks page), any help ?


Notice: Undefined offset[edit]

At the Special:Tasks page the following error is thrown in the header of the page:

Notice: Undefined offset: 1 in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 48
Notice: Undefined index: limit in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 53
Notice: Undefined index: owner in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 56
Notice: Undefined index: status in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 62
Notice: Undefined index: owner in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 65
Notice: Undefined index: hidden in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 68
Notice: Undefined index: owner in /home/httpd/vhosts/lalal.nl/httpsdocs/wiki/includes/SpecialTasks.php on line 82

I followed the instructions carefully, so I have no idea of what went wrong. Any ideas? Thnx in advance!
--83.85.174.37 13:18, 11 February 2007 (UTC)Reply

I discovered I've the problem too. I think it's due to a recent version of MW. I'll check what happen.
--Iubito 07:17, 13 February 2007 (UTC)Reply
Solved !
In SpecialTasks.php, when there is
if ($args['...'])
, replace by
if (isset($args['...']))
and also, line 44 :
	# Parse arguments.
	$args = array();
	if ($args_string != '') {
		foreach (explode('&',$args_string) as $pair) {
			$pair = explode('=',$pair);
			$args[$pair[0]] = $pair[1];
		}
	}
(I encapsulate the foreach in the if)
--Iubito 04:17, 22 February 2007 (UTC)Reply

"My Tasks"-link in personal toolbar[edit]

Just wanted to throw in that we have edited ./includes/SkinTemplate.php ~ line 523 on our wiki, like this:

# "My Tasks"
$href = self::makeSpecialUrl( 'Tasks' );
$personal_urls['mytasks'] = array(
'text' => wfMsg( 'mytasks' ),
'href' => $href."/owner=".$this->username,
'active' => ( $href == $pageurl )
);

in order to get a "My Tasks" link for every user in their personal toolbar, which links to Special:Tasks/owner=Username. I thought some of you might like that too. Mutante 10:21, 20 May 2007 (UTC)Reply

Oh, and you need to put something like "my tasks" into MediaWiki:mytasks, too.

Can't sign tasks[edit]

As we work on Customer-related pages, we'd like to sign & date each task with ~~~~ to keep track of WHO/WHEN a task was assigned... But we just get plain signature signs.

<tasks> [ ] Do something ~~~~(fredt34) </tasks>

will do nothing.

TIA, --FredT34 13:19, 25 September 2007 (UTC)Reply

Don't work with MediaWiki v1.11.0[edit]

The instructions don't parse in article... --201.52.31.55 00:27, 30 September 2007 (UTC)Reply

Should work. Made a few changes : http://www.mediawiki.org/w/index.php?title=Extension%3ATasks_Extension&diff=173913&oldid=147662
--210.212.194.165 23:10, 13 March 2008 (UTC)Reply

Hidden Attribute not effective[edit]

The 'hidden' attribute doesn't seem to hide the tasks on the article page.

Tarlachmoorhouse 12:49, 20 December 2007 (UTC)Reply

MW1.12 Saving page with task causes Fatal error in Parser.php[edit]

Hello, On my mediawiki 1.12, when I save a page with a tasks, I get this error : Fatal error: Using $this when not in object context in /home/.../includes/Parser.php on line 563

The page is saved. I didn't tried to modify the task to see if it is changed or not.

The line 563 in Parser.php :

$marker = "$uniq_prefix-$element-" . sprintf('%08X', $n++) . $this->mMarkerSuffix;

--Iubito 16:38, 26 March 2008 (UTC)Reply

Bug opened :bugzilla:13522:--Iubito 16:58, 26 March 2008 (UTC)Reply
I get this for the PageProtectionPlus extension. I changed the class definition of the extensions' Parser to extend MW's Parser class. It didn't work, but at least the error went away.
 require_once('Parser.php');
 class XXXXxxxParser extends Parser
 {

where XXXXxxxx is the name of the Extension's parser definition. --Otheus 15:44, 10 July 2008 (UTC)Reply

Using the extension on templates don't work correct[edit]

if you use <tasks> on a template, the link to the article is wrong (Namespace is ignored). --87.174.143.147 20:55, 3 May 2008 (UTC)Reply

referring a deleted article crashes the special page[edit]

If you delete an article and run rebuild all, the specialpage:tasks crashes with the following error: Call to a member function getText() on a non-object in extensions\ToDo\SpecialTasks.php on line 100 Check against tab. page. Sorry i can't fix it, but a different sql solve the problem.

select p.* from page p, tasks t
where p.page_id=t.Page_id
.....


--87.174.143.147 20:55, 3 May 2008 (UTC)Reply

image location / rewrite rules[edit]

hi, As my wiki uses short/nice urls, I use rewrite rules which only dont rewrite for urls starting with "/skins/". As i dont want to modifiy them I put the images in /skins/tasks/... I think this is generally a better place for system images. The images folder is only for wiki user uploaded stuff IMO. florian groovehunter 05:12, 1 July 2008 (UTC)Reply

MW 1.12 Error[edit]

I am using MediaWiki 1.12 and after following the install instructions I am seeing the following error: 'Cannot modify header information - headers already sent by (output started at /var/www/mediawiki-1.12.0/extensions/Tasks.php:154) in /var/www/mediawiki-1.12.0/includes/WebResponse.php on line 10'. I am also using the following extensions: BreadCrumbs,ParserFunctions (Version 1.1.1), DiscussionThreading, New User Email Notification (Version 1.5.1) and NewUserMessage (Version 1.0.1, 2008-02-10). Any help would be greatly appreciated. --Timvaverchak 13:00, 22 July 2008 (UTC)Reply

The problem is probably that you have an empty line at the end of Tasks.php ans SpecialTasks.php.
--Sébastien Grenier 16:20, 23 December 2008 (UTC)Reply

In MW 1.13.3 some tasks not show[edit]

I have a list of 15 tasks like this:

<tasks>
[ ] 1
[ ] 2
[x] 3
[x] 4
[ ] 5
...
[ ] 14
[ ] 15
</tasks>

and I have only 12 tasks that show. Any ideas?

When I move some tasks, change the order, they appear.
I use a old version of Task.php (version 0.41.2), I've updated, but I got the Warning : cannot modify header information - headers already sent by (output started at /var/www/wiki/extensions/Tasks.php:154) in /var/www/wiki/includes/WebResponse.php on line 10
Everything is fine! I have empty line at the end of Tasks.php and SpecialTasks.php that cause the warning.
--Sébastien Grenier 16:21, 23 December 2008 (UTC)Reply

To come back with my first problem, when someone type a NO-BREAK SPACE between [], like this [ ], Tasks extension will hide the line just like when you put a X like this [X]. Is there any way to avoid that? --Sébastien Grenier 18:07, 23 December 2008 (UTC)Reply

Tidy + Tasks = too many paragraph tags![edit]

I am using Tidy to to fix a different problem but not the Tasks Exctension os acting up. I get a bunch of extra paragraph tags around the task images. Anyone else have this issue? Can I get Tidy to ignore the Tasks? Can I turn off the tidy parsing inside the Tasks extension?

MW 1.11.0 Tasks 0.5.4

Thanks, Pete. --Mulciber 13:36, 19 February 2009 (UTC)Reply

Is it possible to have the tasks show on the page you're creating them on?[edit]

The extension is working perfectly - however I would like to know if it's possible to have the tasks show up on the actual page I'm putting them on in addition to the Special:Tasks page. What I'm doing now is putting a To Do section at the bottom on multiple pages, and having to duplicate my tasks like this:

Task 1

Task 2

<tasks>

[ ]Task 1

[ ]Task 2

</tasks>

so I can see them on the regular page as well as the Special:Tasks page. Any way to avoid unnecessary duplication?

Thanks! 69.113.219.231 07:20, 1 November 2009 (UTC)Reply

I am also having this issue on 1.15. (to the original poster, the extension would appear not to be working if you have to manually duplicate your tasks). Tasks are created and entered into the database fine and show on the Special page. But there is no output on the original article page. Any suggestions? I prefer this lightweight extension to the cumbersome Todo_Tasks, and would like to get it working! Seems like it might be a quick fix for someone who knows the code... 216.158.20.138 21:54, 9 December 2009 (UTC)Reply
Bump --SomaticJourney 16:03, 8 March 2010 (UTC)Reply
I have 2 MediaWiki installations. The one on Win2K3 with IIS 6, PHP 5.2.9-2, and MySQL 5.1 works fine with this extension. The install on Ubuntu 10.04LTS with MySQL 5.1.41-3ubuntu12.1 and PHP 5.3.2-lubuntu4.2 and Apache 2.2.14-5ubuntu8, installed with this guide, does not work with this extension. Tasks do not show on the page with the <tasks></tasks> tags but do show on the special tasks page. I have since upgraded both sites from MediaWiki 1.15 to 1.17alpha and get the same results. --64.102.254.33 16:41, 7 June 2010 (UTC)Reply

SQL statement is not postgres compatible[edit]

the sql statment that has to be executed does not work on a postgres based installation. it doesn't like at least the unsigned and the enum part.

Special page doesn't create link to correct wikipage[edit]

Extension seem to work nicely except that special page doesn't create links to correct wikipages. Instead of link to wikipage there is a broken link containing something like: Object #432 (page does not exist)

I checked that correct page_id is stored in database. It just doesn't seem to generate link properly.

I am using MediaWiki 1.15.3, PHP 5.1.6 (apache2handler) and MySQL 5.0.22

Any ideas?

--JuhaV 10:42, 25 May 2010 (UTC)Reply

All-in-One-Directory and a Few Tips[edit]

First thing I saw is that this extension needs many files spread all over your wiki's root directory. And also, it suggest to run a query on your database to create the table it need. With all these things in my mind, I decided to install it in my work's wiki, but, to follow my work's standarts, I touched a few things and moved it's files to one directory called Tasks inside $IP/extensions/.

These are the steps I walked:

  1. Create a directory called $IP/extensions/Tasks.
  2. Create a new file called $IP/extensions/Tasks/include.me.php using this content:
    <?php
    /*
     * Allowing to include files from $IP/includes.
     */
    set_include_path("$IP".DIRECTORY_SEPARATOR."includes".PATH_SEPARATOR.get_include_path());
    
    require_once 'GlobalFunctions.php';
    
    /*
     * Creating database table (only if it doesn't exist).
     * @{
     */
    global $wgDBtype;
    if($wgDBtype == 'mysql') {
            global  $wgDBprefix;
            global  $wgPieceOfCodeConfig;
            $dbr = &wfGetDB(DB_SLAVE);
            if(!$dbr->tableExists('tasks')) {
                    $sql =  "CREATE TABLE `{$wgDBprefix}tasks` (\n".
                            "    page_id INT UNSIGNED NOT NULL DEFAULT 0,\n".
                            "    STATUS ENUM('!','1','2','3',' ','x') NOT NULL DEFAULT ' ',\n".
                            "    owner CHAR(255) NOT NULL,\n".
                            "    summary MEDIUMTEXT NOT NULL,\n".
                            "    hidden ENUM('y','n') NOT NULL DEFAULT 'n',\n".
                            "    KEY owner_idx (owner)\n".
                            ");";
                    $error = $dbr->query($sql);
                    if($error !== true) {
                            die(__FILE__.":".__LINE__);
                    }
            }
    } else {
            die(__FILE__.":".__LINE__);
    }
    /* @} */
    
    /*
     * Including extension files.
     */
    require_once 'Tasks.php';
    require_once 'SpecialTasks.php';
    ?>
    
  3. Create a new file called $IP/extensions/Tasks/Tasks.php using the content specified for the extensioncode. Here we have to touch some lines:
    1. Find a line with this:
      function tasksHook( $content, $args = null, &$parser) {
      

      And replace it by:

      function tasksHook( $content, $args = null, $parser) {
      
      Note: Maybe this is not necessary, but I had to do it in order to make work on MediaWiki 1.17
    2. Find a line with this:
      $img = '<img src="'.$wgScriptPath.'/images/task';
      

      And replace it by:

      $img = '<img src="'.$wgScriptPath.'/extensions/Tasks/images/task';
      
      This will point every image request to a directory inside $IP/extensions/Tasks/Tasks.php.
  4. Create a new file called $IP/extensions/Tasks/SpecialTasks.php using the content specified for the extensioncode. Here we have to touch some lines too:
    1. Find a line with this:
      SpecialPage::SpecialPage('Tasks', $restriction ) ;
      

      And replace it by:

      parent::__construct('Tasks', $restriction ) ;
      

      On some versions of PHP, in order to call a super constructor, you need to do something like the second piece of code.

      Note: I hope I'm not sending fruit saying this about PHP, but it worked out for me.
  5. Create a directory called $IP/extensions/Tasks/images and download all images suggested for the extension into itimages.
  6. Last step is just add this line at the end of your LocalSettings.php:
    require_once "$IP/extensions/Tasks/include.me.php";
    

All this stuff may be a little bit strange, but now, I have this extension isolated in it's own directory, and if I need to remove it, I just remove it from LocalSettings.php and delete it from $IP/extensions.

I hope this will help any of you, and thanks for loosing your time reading this section.

--Daemonraco 01:43, 25 September 2010 (UTC)Reply

--Daemonraco 01:49, 25 September 2010 (UTC): I'm sorry if I repeated a tip already told, It wasn't my intensionReply

Working in 1.18[edit]

I've only been working with this extension for a couple of months, but I like it's simplicity. Does what I need and easy to use. When I updated to 1.18 it stopped working. After a fair bit of fiddling I was able to make it work. Instead of posting the changes to the code, I'm just going to post the code that worked for me. Fair warning; I'm an amateur developer at best, so no guarantees.

2012-02-14 Update: Added code to automatically create table if doesn't exist (credit to Daemonraco), so the last step is no longer necessary. Only limited testing has been done, so feed back is always appreciated. Should be noted this is only for MySQL.

  1. Create folder extensions/Tasks
  2. Create folder extensions/Tasks/images
  3. Copy the images from Tasks_Extension#Images to extensions/Tasks/image folder (image file names should all start with 'task_')
  4. Copy and paste the code below to their respective files to extensions/Tasks folder.
  5. Add include("extensions/Tasks/Tasks.php"); to LocalSettings.php.
  6. Create tasks Table inside your database by running the mySQL code on the Extension Page

working in 1.18.1[edit]

The above code works like a charm, out of the box. Opfeifer 22:26, 26 January 2012 (UTC)Reply

Small problem in 1.19[edit]

The code above works pretty well, though there is a problem with the link on Specialpage:specialpages. Even though it leads to correct page, it shows as &lt;tasks&gt; insted of Tasks. Could anyone find a fix for that?

1.19 working version[edit]

I've made an internationalized version of this extension, so it's easy to use it in onther languages. Also, i've added a [?] () task, as a task which has to be decided whether it is done or not. Unfortunately, the database updating script doesn't work with me so I was forced to remove it. It would be really cool if one could make an SQL table adding script for this. The internalization file also fixes the bug mentioned above. So to install the extension:

Installation[edit]

Copy/paste the following codes in files.


Execute SQL[edit]

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

create type task_status as ENUM('!','1','2','3',' ','x','?');
create type yes_no as ENUM('y','n');

CREATE TABLE PREFIX_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);

Images[edit]

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

File:Task.png File:Task 1.png File:Task 2.png File:Task 3.png File:Task alert.png

Images hack by tbhot3ww[edit]

This are another images you can use in your todo


LocalSettings.php[edit]

At the end of LocalSettings.php, add :

include("extensions/Tasks/Tasks.php");

Is this extension useful ??[edit]

As this extension is not maintained I am ready to maintain it if its really useful in production. Please add a comment here if you use it and support this. (maintaining it will also get it translated :)) --Nischayn22 (talk) 06:16, 17 July 2012 (UTC)Reply

Please, yes! Merging the contents of the talk page and the hacks into the main codebase would be nice, and while can't code I'm okay with volunteering my co's resources (AKA: server) to help. (Please note we can only handle low volume requests)
If it matters, we use this extension, along with a couple others, to implement a hybrid dedicted job and Kanban system. We are a four man team who collaborate over the internet in our spare time and use this to maintain and check off tasks on our current projects and infrastructure.
~That Guy of Dark Glass Studios
I am glad to see someone with more coding experience pick up this project too. We use it at work, and I've even taken to using it at home. It's simple and functional. --Deplicator (talk) 19:49, 23 September 2012 (UTC)Reply
Hey, everyone. While its interesting that so many people are interesting in this extension I also found some similar extensions which even might provide more functionality like Extension:Semantic Tasks and Extension:Semantic_NotifyMe--Nischayn22 (talk) 13:11, 25 October 2012 (UTC)Reply

Hello together,

I'd like to use this extension on mw 1.22.4 with MySQL. It would be very fine if anybody could upgrade this Extension)

Kind regards 192.109.190.88 09:22, 7 April 2014 (UTC)Reply