Page 1 of 1

customising print view

Posted: 16 Oct 2007, 11:08
by minnu
I am using mantis 1.0.0rc2.From print reports,we can have word view and excel view of bugs.I want to customize this.For that i did the following.
1.Added a file (custom_function_inc.php) in mantis root folder where there is config_inc.php
2.The content of file is as below

Code: Select all

function custom_function_override_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) { 
$t_columns = array(); 

if ( $p_columns_target == COLUMNS_TARGET_PRINT_PAGE ) { 
$t_columns[] = 'id'; // localized: 'id', 
$t_columns[] = 'project_id'; // 'email_project' 
$t_columns[] = 'reporter_id'; // 'reporter' 
$t_columns[] = 'handler_id'; // 'assigned_to' 
$t_columns[] = 'priority'; // 'priority' 
$t_columns[] = 'severity'; // 'severity' 
$t_columns[] = 'reproducibility'; // 'reproducibility' 
$t_columns[] = 'version'; // 'version' 
$t_columns[] = 'projection'; // 'projection' 
$t_columns[] = 'category'; // 'category' 
$t_columns[] = 'date_submitted'; // 'date_submitted' 
#$t_columns[] = 'eta'; 
#$t_columns[] = 'os'; // 'os' 
#$t_columns[] = 'os_build'; // 'os_version' 
$t_columns[] = 'platform'; // 'platform' 
$t_columns[] = 'view_state'; // 'view_status' 
$t_columns[] = 'last_updated'; // 'last_update' 
$t_columns[] = 'summary'; // 'summary' 
$t_columns[] = 'status'; // 'status' 
$t_columns[] = 'resolution'; // 'resolution' 
$t_columns[] = 'fixed_in_version'; // 'fixed_in_version'; 


# if viewing only one Project, Add all custom fields linked to this project 
if ( helper_get_current_project() != ALL_PROJECTS ) { 
$t_custom_fields = custom_field_get_ids(helper_get_current_project()); 

foreach( $t_custom_fields as $t_field_id ) { 
$t_desc = custom_field_get_definition( $t_field_id ); 

$t_columns[] = 'custom_' . $t_desc['name']; 
} 
} 


if ( OFF == config_get( 'enable_relationship' ) ) { 
$t_columns[] = 'duplicate_id'; // 'duplicate_id' 
} 
} else { 
$t_columns[] = 'selection'; 

if ( $p_columns_target == COLUMNS_TARGET_VIEW_PAGE ) { 
$t_columns[] = 'edit'; 
} 

$t_columns[] = 'priority'; 
$t_columns[] = 'id'; 

$t_enable_sponsorship = config_get( 'enable_sponsorship' ); 
if ( ON == $t_enable_sponsorship ) { 
$t_columns[] = 'sponsorship'; 
} 

$t_columns[] = 'bugnotes_count'; 

$t_show_attachments = config_get( 'show_attachment_indicator' ); 
if ( ON == $t_show_attachments ) { 
$t_columns[] = 'attachment'; 
} 

$t_columns[] = 'reporter_id'; 

$t_columns[] = 'category'; 
$t_columns[] = 'severity'; 
$t_columns[] = 'status'; 
$t_columns[] = 'last_updated'; 
$t_columns[] = 'summary'; 
} 

return $t_columns; 
But in all print views i am getting eta,os,os build ,which i don't do.


What to do more?Or my understanding wrong?Please help

Re: customising print view

Posted: 17 Oct 2007, 06:37
by deboutv
minnu wrote:I am using mantis 1.0.0rc2.From print reports,we can have word view and excel view of bugs.I want to customize this.For that i did the following.
1.Added a file (custom_function_inc.php) in mantis root folder where there is config_inc.php

But in all print views i am getting eta,os,os build ,which i don't do.


What to do more?Or my understanding wrong?Please help
The file name must be custom_functions_inc.php (with a 's' at function).

Re:customising print view

Posted: 17 Oct 2007, 06:50
by minnu
Thanks for reply.

I changed the file name from custom_function_inc.php to custom_functions_inc.php.But then too its not working.

Posted: 17 Oct 2007, 07:20
by deboutv
The word and excel exports are not customizable. Follow the link in my signature and you'll find a plugin to do what you want.

Re:customising print view

Posted: 17 Oct 2007, 08:47
by minnu
Thanks.
The required plugin is available.But we ported mantis in windows xp.So how can apply that plugins.

Posted: 17 Oct 2007, 10:06
by deboutv
Plugins work on Windows too.