Commit 12f93483 authored by Jonny Bradley's avatar Jonny Bradley

[ENH] trackers: Use category's relativePathString instead of recalculating it

parent 1efb1b7a
......@@ -119,19 +119,11 @@ class Tracker_Field_Category extends Tracker_Field_Abstract implements Tracker_F
$selected_categories = $this->getConfiguration('selected_categories');
$categories = $this->getConfiguration('list');
$ret = array();
if ($this->getOption('descendants') == 2) {
$parentId = $this->getOption('parentId');
$parent_offset = 0;
if ($parentId > 0) {
$parent_offset = strlen(TikiLib::lib('categ')->get_category_name($parentId)) + 2;
}
}
foreach ($selected_categories as $categId) {
foreach ($categories as $category) {
if ($category['categId'] == $categId) {
if ($this->getOption('descendants') == 2) {
$ret[] = substr($category['categpath'], $parent_offset);
$ret[] = $category['relativePathString'];
} else {
$ret[] = $category['name'];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment