Extension talk:Tasks Extension

Difficulty
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)
 * Seconded.
 * 71.67.100.211 04:32, 13 December 2005 (UTC)
 * This is now fixed Iubito 16:03, 10 February 2006 (UTC)

--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.

A Couple of Things
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)

How to get this working with MediaWiki 1.5.6?
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)

How assigned a task ?
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)

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

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

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

How do I put a tag in a template?
I'd like to create a template that creates tasks but it does not work. []  Thanks! -David

Compatibility with Calendar Extension:
Nice extension, Iubito! I added a little code to savetasks, specifically:

...	# Rebuild the $tasks_buffer array (in case we're on a 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
--68.186.119.215 08:51, 3 April 2006 (UTC)

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 [ ] Regular task (Owner User) [1] High priority task. [2] Medium priority task. [3] Low priority task (Owner User) [!] Urgent task. [x] Closed task. 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
Could you show me an example of how you were able to fix that?

Error
When i include Tasks i got an error message

UNIQ63....

All my are replaced by this error

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

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

extensions/Tasks.php ---# 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.'" /> ';
 * 1) Purpose   : HTML format a task.

if ($owner) { $summary .= ' ('.$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.' ';

return $output; }

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

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 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
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)

A local parser
It's not a good idea the local parser, because it has not the other extension registered (my summary contain 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)

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

[x] foo == foo == * [1] bar * [2] foo === bar === [x] foo [1] foo [2] foo [3] foo

Someone could please help me?
 * Ponsfrilus 13:49, 10 July 2006 (UTC)
 * 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)
 * 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)

where to find older versions
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)

screenshot request
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
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)

Works for MediaWiki 1.7.1 - with a couple mods
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 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
I would like to use lists of tasks as a template:

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

Could not make it work with version 1.67
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
I ran into an small bug where a page with multiple tasks would have task duplication.

The following code [ ] a [ ] b

[ ] c [ ] d [ ] e 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)

Hidden Attribute ignored
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
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)
 * 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)


 * 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)

"My Tasks"-link in personal toolbar
Just wanted to throw in that we have edited ./includes/SkinTemplate.php ~ line 523 on our wiki, like this: $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)
 * 1) "My Tasks"

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