Flyspray - The bug killer!

  • Status Closed
  • Percent Complete
    100%
  • Task Type Feature Request
  • Category Backend/Core
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Normal
  • Reported Version 0.9.9.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: Flyspray - The bug killer!
Opened by Phil (phil) - 2007-08-14
Last edited by Florian Schmitz (Floele) - 2007-08-21

FS#1330 - Categories tasklist column

I’ve kludged (in 0.9.9.1) a change that allows categories to be seen in the tasklist. Right now we can see category, but we do not see its possible parent categories. This can be highly useful, depending on the situation.

The approach is to pre-calculate the categories string into a new column in the list_category table during the update of a category in pm.cat (this means that a “dumb” update must be forced after adding a new category)

Another approach might be somehow generating such a categories string on the fly in class.backend.php in the get_task_list() function, but my brain exploded when I attempted to concoct the SQL :p

The files I kludged
– actual kludge: precalc the
after case
after $listowners

$phil_kludge = $db→FetchAllArray(

                      $db->Query('SELECT * FROM {list_category} WHERE project_id = ? order by lft', $proj->id)
                      );

$phil_temp_r = $phil_temp_pr = 9999; should be
=
=
= ‘‘; foreach ($phil_kludge as $phil_i ⇒ $phil_row) if ($phil_i > 0)
skip root

                      {
                      if ($phil_temp_r > $phil_row['rgt'])
                              {
                              if ($phil_temp_c) $phil_parent[] = $phil_temp_c;
                              $phil_temp_pr = $phil_temp_r;
                              }
                      else if ($phil_temp_pr < $phil_row['rgt'])
                              array_pop($phil_parent);
                      // this if clause should be simplified
                      if (count($phil_parent) > 0) $listfullname[$phil_row['category_id']] =
                              implode(' - ',$phil_parent).' - '.$phil_row['category_name'];
                      else $listfullname[$phil_row['category_id']] =
                              $phil_row['category_name'];
                      $phil_temp_r = $phil_row['rgt'];
                      $phil_temp_c = $phil_row['category_name'];
                      }

END THIS KLUDGE, more
and then modify the $update string below accordingly to add one new
– bookkeeping: load the precalced string in
the ‘allcat’ is probably superfluous, as the old category search is inclusive? if (array_get($args, ‘allcat’) || in_array(’categories’, $visible)) { $from .= ' LEFT JOIN {list_category} lc2 ON t.product_category = lc2.category_id ‘; $select .= ' lc2.category_full_name AS category_full_name, ‘; $groupby .= ‘lc2.category_full_name, ‘;
dont forget to add to $order_keys later in the
– add to $indexes in
– add to $columnnames other files possibly needing
– to further integrate it into “add a new category”
– to implement the database change into setup/migrate/etc script

This task does not depend on any other tasks.

Closed by  Florian Schmitz (Floele)
Tuesday, 21 August 2007, 17:55 GMT
Reason for closing:  Will Not Implement
Phil (phil)
Tuesday, 14 August 2007, 18:04 GMT

Pooh, the formatting got screwed up a little bit

Florian Schmitz (Floele)
Tuesday, 21 August 2007, 17:54 GMT

That uses too much width in the task list column I'd say. For 1.0 there will be a somewhat more useful sorting though, so that tasks are sorted keeping the hierarchy.

 -         -              v
ID 1    Summary 1    Root Category 1
ID 2    Summary 2    Sub Category 1
ID 3    Summary 3    Sub Category 2
ID 4    Summary 4    Root Category 2
ID 5    Summary 5    Sub Category 1

Loading...