Flyspray - The bug killer!

“If debugging is the process of removing bugs, then programming must be the process of putting them in.” – Edsger Dijkstra

This is the Bug Tracking System for the Flyspray project. This is not a demo! Before opening a new task, please read the guidelines!

Do not issue bugs reports against versions earlier than 0.9.9.5

Security problem? Check the security section.

Tasklist

FS#1330 - Categories tasklist column

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

Details

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 are:
includes/modify.inc.php – actual kludge: precalc the string
// after case 'update_category'
// 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 max(rgt)
$phil_temp_l = 0;
$phil_parent = array();
$phil_temp_c = ‘‘; 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 below
// and then modify the $update string below accordingly to add one new column
includes/class.backend.php – bookkeeping: load the precalced string in get_task_list
// 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 func
scripts/index.php – add to $indexes in tpl_draw_cell()
templates/pm.prefs.tpl – add to $columnnames other files possibly needing modify:
includes/modify.inc.php – to further integrate it into “add a new category” code
?/setup.php* – to implement the database change into setup/migrate/etc script

This task depends upon

Closed by  Florian Schmitz (Floele)
Tuesday, 21 August 2007, 19:55 GMT+1
Reason for closing:  Will Not Implement
Comment by Phil (phil) - Tuesday, 14 August 2007, 20:04 GMT+1

Pooh, the formatting got screwed up a little bit

Comment by Florian Schmitz (Floele) - Tuesday, 21 August 2007, 19:54 GMT+1

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...