sorting custom fields for view_all_bug_ page

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
xsintill

sorting custom fields for view_all_bug_ page

Post by xsintill »

i'm trying to include a custom field of a date type into the view_all_bug_page but i'm wondering how this should be done.
xsintill

Post by xsintill »

i should add that the problem is how i should use sorting for a custom field not printing a value for a bug
Léo
Posts: 2
Joined: 12 Apr 2005, 10:06

Post by Léo »

You must modify the filter_get_bug_rows function by adding, the custom field.
Two solutions:
- You add only one custom field so you can make a join on the mantis_custom_field_string_table with an order by.
- You add many custom fields so you can create a new query and use the array functions included in PHP.

for example :
$t_temp = result of the normal query
$rows =result of the custom field query

if( is_array($rows) && count($rows)!= 0 ) {
foreach ($rows as $key => $row) {
$t_temp[$key] = $row['Version corrective'];
}

if ( 'DESC' == $t_filter['dir'] ) {
$c_dir = SORT_DESC ;
} else {
$c_dir = SORT_ASC;
}
array_multisort($t_temp, $c_dir, SORT_STRING, $rows);
}
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

Filtering and sorting by custom fields is included in 1.0.0a1.
Post Reply