customising print view

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
minnu
Posts: 18
Joined: 16 Oct 2007, 10:45

customising print view

Post 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
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: customising print view

Post 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).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
minnu
Posts: 18
Joined: 16 Oct 2007, 10:45

Re:customising print view

Post 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.
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post 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.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
minnu
Posts: 18
Joined: 16 Oct 2007, 10:45

Re:customising print view

Post by minnu »

Thanks.
The required plugin is available.But we ported mantis in windows xp.So how can apply that plugins.
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

Plugins work on Windows too.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
Post Reply