From 208093f3ca08e542bf8109ecfb55ffca3af18e71 Mon Sep 17 00:00:00 2001 From: LarsDW223 Date: Mon, 28 Aug 2017 19:32:17 +0200 Subject: [PATCH] Added two new optional columns for the priority in the task overview: - set flag 'prioritytxt' to display a text based priority column - set flag 'priorityimg' to display a image based priority column This change requires changes in the pagelist plugin. --- helper.php | 18 ++++++++++++++++-- images/prio_critical.png | Bin 0 -> 688 bytes images/prio_high.png | Bin 0 -> 614 bytes images/prio_medium.png | Bin 0 -> 617 bytes style.css | 27 +++++++++++++++++++++++++++ syntax/tasks.php | 24 +++++++++++++++++++----- 6 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 images/prio_critical.png create mode 100644 images/prio_high.png create mode 100644 images/prio_medium.png 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 0000000000000000000000000000000000000000..605c926b8aee64ae7b80fbc4741687706099b376 GIT binary patch literal 688 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl47&8KVLR|m<{|^)a;syqWX$%bW z7#Nl^Ff=hRbTcq4VPI%sVwwzQEMsEoU}o-NX6|EVUdhbd2_~DFnP)OE%w%L-1k}aI zxPqCvk%?(81H*DArX~FR%lP?cadFM!<69;!zEV|72n*lw^}SP5b5}&7B*7|<3aL4LsujEqV^ z5EBzq0R(%2;J|^?U~ul-xlf-y1Hl&v`1^D?W=l#USaTb^>bP0 Hl+XkKowE+y literal 0 HcmV?d00001 diff --git a/images/prio_high.png b/images/prio_high.png new file mode 100644 index 0000000000000000000000000000000000000000..b0c4483959614f1d030ff4c9081f476a130bafff GIT binary patch literal 614 zcmV-s0-61ZP)Hy_WAiV{Rp%A~_^G}2pemAQj!Tk9 z*5j%hmHE})F9DKw-Xq%VZl*f33zxleuKy>1)D{X`J_c;rD5web6vdUA{2hQO zi|k+M3R^J_&JC_`uC+p2Jk*rE^Bnyvz#Dh!uVl25*~$qpPS1jIJOga$C@4t{Tx^nh_J z8FuRw*ez3F9EycDvooGX)|BpBXy{J?_s3D*TaE%RrSvvniwD8Hx(H!@Rz&#QU|v}S zHoq6%q%_AZYn~@prc$mS09VG7?}NaKvYOlo#(`k)i!(7R-W78a-9$bM#vWg&iS=;L zr<8Pc0@=R-oEuF=FHXw+=1oLJXtUaZpH2inn~I%ty|8bQugKHDPbEN0ZHQMs1#o^W zy}B}(3VsHh97PE?9EDURtOWF(7Vu+X!Xm(rhJYUq06*vjzTXx4nt_l#2-hZ&d};(m zz6Tr}Or;JFC;63EE}>8xe6QuBSwTeajqkI)ulb(oP~*zur7Pj^Fp`fBq2jc6FwMI> zft-R2eML9uTSvm!HX6qEvADZ*h_Im|ANRi2Mc=us)B7*PjV5kq($4;L`+d>^uPY>%_&y zEno%m0VhypoJbFHBBkd=YJiidV(iE9KlA@8CJ15)D^e}RrTIhs1AXn|<73rRQ&U+3 zgZ-%uO|@y6IZ{0WHsU;!08XNPs%t97v|7zrYkRAAb#2ADqN1G5O-;2sIy+mBba!{Y z&B~QZQ4=rI0Fmk$8|@sK?su&lAB+xB6oo+kMs$*mlM!$Aqb~|On&Tr-Ub`6ptT0Bmga|p`%r*(M|-Y6@44bJ%(WbMU9RM z^b@Y?#(KY3Xo6}p0Qya4j$GWBpptY2MY)hhCPNC50IBH-YJy7f#&N5FpfLXlDU$=WS_M@#<$xzhN{xrW z5WfkV0CtX_qrTXEgprY9sH`f3bUFpFZRhYg$|iuldoc .= $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();