Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions conf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
/**
* Options for the Task Plugin
*/
$conf['datefield'] = 1; // entry field for due date in form
$conf['tasks_formposition'] = 'bottom'; // position of new task form
$conf['tasks_newestfirst'] = 0; // show newest tasks first in tasks list
$conf['datefield'] = 1; // entry field for due date in form
$conf['tasks_formposition'] = 'bottom'; // position of new task form
$conf['tasks_newestfirst'] = 0; // show newest tasks first in tasks list
$conf['layout'] = 'built-in'; // use standard layout/colors

//Setup VIM: ex: et ts=2 enc=utf-8 :
4 changes: 4 additions & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
'_choices' => array('none', 'top', 'bottom')
);
$meta['tasks_newestfirst'] = array('onoff');
$meta['layout'] = array(
'multichoice',
'_choices' => array('built-in', 'template')
);

//Setup VIM: ex: et ts=2 enc=utf-8 :
8 changes: 8 additions & 0 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ function getTasks($ns, $num = NULL, $filter = '', $user = NULL) {
elseif (($date + 86400 > time()) && ($filter == 'overdue')) continue;
}

if ($this->getConf('layout') == 'template') {
$class = 'template_priority'.$task['priority'];
} else {
// let pagelist plugin set the class, will be 'priority'
$class = NULL;
}

$result[$task['key']] = array(
'id' => $id,
'date' => $date,
Expand All @@ -143,6 +150,7 @@ function getTasks($ns, $num = NULL, $filter = '', $user = NULL) {
'perm' => $perm,
'file' => $task['file'],
'exists' => true,
'class' => $class,
);
}

Expand Down
4 changes: 3 additions & 1 deletion lang/de/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
$lang['tasks_formposition_o_top'] = 'oben';
$lang['tasks_formposition_o_bottom'] = 'unten';

//Setup VIM: ex: et ts=2 enc=utf-8 :
$lang['layout'] = 'Welches Layout/Farben sollen benutzt werden?';

//Setup VIM: ex: et ts=2 enc=utf-8 :
2 changes: 2 additions & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@

$lang['tasks_newewstfirst'] = 'show newewst tasks first in tasks list';

$lang['layout'] = 'which layout/colors shall be used?';

//Setup VIM: ex: et ts=2 enc=utf-8 :
8 changes: 8 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ div.dokuwiki div.vcalendar table.blind th {
background-color: transparent;
}

div.dokuwiki div.page table.plugin_task_tasklist {
width: __plugin_task_tasklist_width__;
}

div.dokuwiki div.newtask_form table.blind td,
div.dokuwiki div.vcalendar table.blind td {
width: 50%;
Expand All @@ -59,6 +63,10 @@ div.dokuwiki tr.priority1 { background-color: #fff7e8; }
div.dokuwiki tr.priority2 { background-color: #fff1d9; }
div.dokuwiki tr.priority3 { background-color: #ffe9c2; }

div.dokuwiki tr.template_priority1 { background-color: __plugin_task_priority1_color__; }
div.dokuwiki tr.template_priority2 { background-color: __plugin_task_priority2_color__; }
div.dokuwiki tr.template_priority3 { background-color: __plugin_task_priority3_color__; }

div.dokuwiki div.vcalendar fieldset.due { border: 1px solid #ffa200; }
div.dokuwiki div.vcalendar fieldset.overdue { border: 1px solid #ff0040; }

Expand Down
10 changes: 9 additions & 1 deletion syntax/task.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ function render($mode, Doku_Renderer $renderer, $data) {
}

$class = ' class="vtodo';
if ($priority) $class .= ' priority' . $priority;
if ($priority) {
if ($this->getConf('layout') == 'template') {
// Take layout from DokuWiki template
$class .= ' template_priority' . $priority;
} else {
// Use built-in layout
$class .= ' priority' . $priority;
}
}
if ($due) {
$class .= ' '.$due;
$due = ' class="'.$due.'"';
Expand Down
6 changes: 5 additions & 1 deletion syntax/tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ function render($mode, Doku_Renderer $renderer, $data) {
$pagelist->addColumn('task', 'status');

// output list
$pagelist->startList();
$class = NULL;
if ($this->getConf('layout') == 'template') {
$class = 'plugin_task_tasklist';
}
$pagelist->startList($class);
if($this->getConf('tasks_newestfirst')) {
$pages = array_reverse($pages);
}
Expand Down