diff --git a/helper.php b/helper.php index 240a1a1..6fdf948 100644 --- a/helper.php +++ b/helper.php @@ -57,15 +57,29 @@ function getMethods() { /** * Returns the column header for the Pagelist Plugin */ - function th() { + function th($column=NULL, &$class=NULL) { + if ($column == 'prioritytxt' || $column == 'priorityimg') { + $class .= 'priority priority'.$task['priority']; + return $this->getLang('priority'); + } return $this->getLang('status'); } /** * Returns the status of the task */ - function td($id) { + function td($id, $column=NULL, &$class=NULL) { $task = $this->readTask($id); + if ($column == 'prioritytxt' || $column == 'priorityimg') { + $content = ''; + $class .= 'priority priority'.$task['priority']; + if ($column == 'prioritytxt') { + $content = $this->priorityLabel($task['priority']); + } else if ($column == 'priorityimg') { + $class .= ' image'; + } + return $content; + } return $this->statusLabel($task['status']); } diff --git a/images/prio_critical.png b/images/prio_critical.png new file mode 100644 index 0000000..605c926 Binary files /dev/null and b/images/prio_critical.png differ diff --git a/images/prio_high.png b/images/prio_high.png new file mode 100644 index 0000000..b0c4483 Binary files /dev/null and b/images/prio_high.png differ diff --git a/images/prio_medium.png b/images/prio_medium.png new file mode 100644 index 0000000..52442d0 Binary files /dev/null and b/images/prio_medium.png differ diff --git a/style.css b/style.css index 829ec65..97a7f5f 100644 --- a/style.css +++ b/style.css @@ -79,8 +79,35 @@ div.dokuwiki form#task__changeview_form input.button { margin: 0; } +div.dokuwiki th.priority, +div.dokuwiki td.priority, div.dokuwiki th.status, div.dokuwiki td.status { color: __text_neu__; font-size: 80%; } + +div.dokuwiki td.priority.image { + background-repeat: no-repeat; + background-position: 50% 50%; +} +div.dokuwiki td.priority3 { + color: #ff0000; + font-weight: bold; +} +div.dokuwiki td.priority2 { + color: #FFD700; + font-weight: bold; +} +div.dokuwiki td.priority1 { + font-weight: bold; +} +div.dokuwiki td.priority3.image { + background-image: url(images/prio_critical.png); +} +div.dokuwiki td.priority2.image { + background-image: url(images/prio_high.png); +} +div.dokuwiki td.priority1.image { + background-image: url(images/prio_medium.png); +} diff --git a/syntax/tasks.php b/syntax/tasks.php index 9b6a7f6..555f70a 100644 --- a/syntax/tasks.php +++ b/syntax/tasks.php @@ -115,13 +115,27 @@ function render($mode, Doku_Renderer $renderer, $data) { if ($select) $renderer->doc .= $this->_viewMenu($filter); // prepare pagelist columns - $pagelist->header['page'] = $this->getLang('task'); - $pagelist->header['date'] = str_replace(' ', ' ', $this->getLang('date')); - $pagelist->header['user'] = str_replace(' ', ' ', $this->getLang('user')); - $pagelist->column['date'] = $this->getConf('datefield'); - $pagelist->column['user'] = true; + if (method_exists ($pagelist, 'setHeaderTitle')) { + $pagelist->setHeaderTitle('page', $this->getLang('task')); + $pagelist->setHeaderTitle('date', str_replace(' ', ' ', $this->getLang('date'))); + $pagelist->setHeaderTitle('user', str_replace(' ', ' ', $this->getLang('user'))); + $pagelist->setColumn('date', $this->getConf('datefield')); + $pagelist->setColumn('user', true); + } else { + $pagelist->header['page'] = $this->getLang('task'); + $pagelist->header['date'] = str_replace(' ', ' ', $this->getLang('date')); + $pagelist->header['user'] = str_replace(' ', ' ', $this->getLang('user')); + $pagelist->column['date'] = $this->getConf('datefield'); + $pagelist->column['user'] = true; + } $pagelist->setFlags($flags); $pagelist->addColumn('task', 'status'); + if(in_array('prioritytxt', $flags)) { + $pagelist->addColumn('task', 'prioritytxt'); + } + if(in_array('priorityimg', $flags)) { + $pagelist->addColumn('task', 'priorityimg'); + } // output list $pagelist->startList();