Column created in 1.1.x don't work in 1.2.x
Posted: 04 Feb 2013, 15:42
Hello, I builded a column in the view_all_bug_page.php that shows the total time per bug, thast works great in every version of 1.1.x but in 1.2.x not, this is the code of my column working on 1.1.x but I don't know why in the new mantis don't work, please help me
In config_inc.php:
In lang/strings_spanish.txt:
In core/columns_api.php:
In core/bug_api.php:
In config_inc.php:
Code: Select all
$g_view_issues_page_columns = array ( 'selection', 'edit', 'priority', 'id', 'sponsorship_total', 'bugnotes_count',
'custom_Horas Estimadas', 'bugnotes_tracking', 'attachment', 'category', 'severity', 'status', 'last_updated',
'summary' );
$g_print_issues_page_columns = array ( 'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count',
'custom_Horas Estimadas', 'bugnotes_tracking', 'attachment', 'category', 'severity', 'status', 'last_updated',
'summary' );
Code: Select all
$s_bugnotes_tracking ="TT";
Code: Select all
function print_column_bugnotes_tracking( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
global $t_filter;
$total_time_per_bug = bug_get_bugnote_tracking( $p_row['id'] );
if (empty($total_time_per_bug)){ $total_time_per_bug = "0.0000"; }
$total_time_per_bug = db_minutes_to_hhmm( $total_time_per_bug );
echo '<td class="center">';
echo $total_time_per_bug;
echo '</td>';
}
function print_column_title_bugnotes_tracking( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE
) {
if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
echo '<td> TT </td>';
} else {
echo 'TT';
}
}
Code: Select all
function bug_get_bugnote_tracking( $p_bug_id ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$t_project_id = bug_get_field( $p_bug_id, 'project_id' );
if ( !access_has_project_level( config_get( 'private_bugnote_threshold' ), $t_project_id
) ) {
$t_restriction = 'AND view_state=' . VS_PUBLIC;
} else {
$t_restriction = '';
}
$t_bugnote_table = config_get( 'mantis_bugnote_table' );
$query = "SELECT sum(time_tracking)
FROM $t_bugnote_table
WHERE bug_id ='$c_bug_id' $t_restriction";
$result = db_query( $query );
return db_result( $result );
}