• Status Closed
  • Percent Complete
  • Task Type Feature Request
  • Category User Interface
  • Assigned To
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 0.9.6
  • Due in Version 0.9.6
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray
Opened by jonoxer - 16.07.2004
Last edited by Anonymous Submitter - 27.07.2004

FS#309 - Addition of project to list columns and highlighting sort column [patch]

I've added a "Project" column to the task list, and set the column header for the current sort order to be highlighted by setting its class to "severity3" (I couldn't find a general-purpose highlight class so I just used a severity class).

Sorting by project is a bit dodgy at the moment because it's ordering by the 'attached_to_project' column: the result is sorting by order projects were created, not alpha-sorting based on the actual title. I'll look at fixing this by doing a join on the flyspray_projects table, but for now at least it allows tasks to be grouped by project even if the sort order isn't self-evident.

— regexp.php (revision 96)
+++ regexp.php (working copy)
@@ -23,7 +23,7 @@
if ($_GET['order']) {

   // Yes. Now check its' regex format for safety -- Limited range

- if (preg_match ("/^(id|type|date|sev|cat|status|prog|due)$/", $_GET['order'])) {
+ if (preg_match ("/^(id|project_title|type|date|sev|cat|status|prog|due)$/", $_GET['order'])) {


— lang/en/index.php (revision 96)
+++ lang/en/index.php (working copy)
@@ -14,6 +14,7 @@
'sortthiscolumn' ⇒ 'Sort by this column',
'id' ⇒ 'ID',
'tasktype' ⇒ 'Task Type',
+'project' ⇒ 'Project',
'severity' ⇒ 'Severity',
'summary' ⇒ 'Summary',
'dateopened' ⇒ 'Date Opened',

— scripts/index.php (revision 96)
+++ scripts/index.php (working copy)
@@ -7,6 +7,8 @@
switch ($_GET['order']) {

 case "id": $orderby = 'flyspray_tasks.task_id';

+ case "project_title": $orderby = 'attached_to_project';
+ break;

 case "type": $orderby = 'task_type';
 case "date": $orderby = 'date_opened';

@@ -293,26 +295,29 @@
<table id="tasklist">


- <th class="taskid">
+ <th <?php if($_GET['order'] == "id") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>" href="?order=id<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "id") { echo "asc"; } else { echo "desc";};?>"><?php e

cho $index_text['id'];?></a>


- <th>
+ <th <?php if($_GET['order'] == "project_title") echo "class=\"severity3\""; ?» + <a title="<?php echo $index_text['sortthiscolumn'];?>" href="?order=project_title<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "project_title") { echo "asc"; } else { ech
o "desc";};?>"><?php echo $index_text['project'];?></a>
+ </th>
+ <th <?php if($_GET['order'] == "type") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>" href="?order=type<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "type") { echo "asc"; } else { echo "desc";};?>"><?p

hp echo $index_text['tasktype'];?></a>


- <th>
+ <th <?php if($_GET['order'] == "sev") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>" href="?order=sev<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "sev") { echo "asc"; } else { echo "desc";};?>"><?php

echo $index_text['severity'];?></a>

 <th><?php echo $index_text['summary'];?></th>

- <th>
+ <th <?php if($_GET['order'] == "date") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>" href="?order=date<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "date") { echo "asc"; } else { echo "desc";};?>"><?p

hp echo $index_text['dateopened'];?></a>


- <th>
+ <th <?php if($_GET['order'] == "status") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>"  href="?order=status<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "status") { echo "asc"; } else { echo "desc";};?>

"><?php echo $index_text['status'];?></a>


- <th>
+ <th <?php if($_GET['order'] == "due") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>"  href="?order=due<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "due") { echo "asc"; } else { echo "desc";};?>"><?ph

p echo $index_text['dueversion'];?></a>


- <th>
+ <th <?php if($_GET['order'] == "prog") echo "class=\"severity3\""; ?»

 <a title="<?php echo $index_text['sortthiscolumn'];?>"  href="?order=prog<?php echo $get;?>&amp;sort=<?php if ($_GET['sort'] == "desc" && $_GET['order'] == "prog") { echo "asc"; } else { echo "desc";};?>"><?

php echo $index_text['progress'];?></a>


@@ -355,6 +360,10 @@

 while ($task_details = $fs->dbFetchArray($getsummary)) {

+ Get the full project title
+ $get_project_title = $fs→dbQuery("SELECT project_title FROM flyspray_projects WHERE project_id=?", array($task_details['project']));
+ $project = $fs→dbFetchArray($get_project_title);
Get the full tasktype name

   $get_tasktype_name = $fs->dbQuery("SELECT tasktype_name FROM flyspray_list_tasktype WHERE tasktype_id=?", array($task_details['task_type']));
   $tasktype_info = $fs->dbFetchArray($get_tasktype_name);

@@ -384,10 +393,13 @@

   onmouseout=\"this.className = 'severity{$task_details['task_severity']}'; = 'default'\">\\n";


   echo "<td class=\"taskid\">\\n";
   echo "<a href=\"?do=details&amp;id={$task_details['task_id']}\">{$task_details['task_id']}</a>\\n</td>\\n";

+ $project_title = str_replace(" ", "&nbsp;", $task_details['project_title']);
+ echo "<td class=\"project_title\">$project_title\\n";
+ echo "\\n</td>\\n";

   $tasktype_info = str_replace(" ", "&nbsp;", $tasktype_info['tasktype_name']);
   echo "<td class=\"tasktype\">$tasktype_info\\n";
   echo "\\n</td>\\n";
Closed by  Anonymous Submitter
28.07.2004 11:13
Reason for closing:  Implemented in devel
Additional comments about closing:  

The core task is implemented. The extra stuff is covered in other tasks.

Probably best not to apply this just yet: I want to take it a step further and add admin options so it’s possible to turn display of ‘project’ and ‘category’ columns on and off since extra columns take up a lot of space and many people won’t want them if they only have one project and not many categories. I’ll submit a new patch once I’ve done that.

Warning: Invalid argument supplied for foreach() in / on line 64

By the way, I know that’s a lot of stuff to patch so if you want to try it out first I can give you admin access to my test system which has all those changes in it.

Cheers :-)


Anonymous Submitter commented on 20.07.2004 07:52

Jonathan, remove the spam proofing to email me about this:

myfirstname at

Anonymous Submitter commented on 23.07.2004 00:27

Just a thought - it would make sense to show the “Project” column only when you are viewing tasks from all projects. It doesn’t really make sense to see it when all tasks shown are from the same project.

Diff against index.php rev 101 to allow column display option

   index.php.diff (9 KiB)

Diff against scripts/admin.php rev 101 to allow column display options

   admin.php.diff (1.2 KiB)

Diff against scripts/modify.php rev 101 to allow column display options

   modify.php.diff (1 KiB)

Good point about project column display, Tony. I haven’t allowed for that in this revision, but once these patches are in the devel tree I’ll look at hiding the projects column when not required.


Available keyboard shortcuts


Task Details

Task Editing