Add a column in csv export

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
tessierg
Posts: 2
Joined: 24 Sep 2008, 10:15

Add a column in csv export

Post by tessierg »

Hi,

I use Mantis v 1.0.8

I want to add a column in csv export, the column is "description" of "mantis_bug_text_table".

First i add in the function custom_function_default_get_columns_to_view the column description, file custom_function_api.php.

Then i have an error "function print_column_title_description don't exist in ...." so i create this function :

Code: Select all

# --------------------
	# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
	function print_column_title_description( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
		global $t_icon_path;

		$t_description = string_attribute( $p_row['description'] );

		echo 'Description ', $t_description;
	}
in columns_api.php

Then another error "function csv_format_description don't existe" so i create in cvs_api.php

Code: Select all

# --------------------
	# return the status string
	function csv_format_description( $p_description ) {
		return csv_escape_string( $p_description );
	}
Then i can have a cvs file with description title column but nothing inside ??

What i need to change, to make it work fine??

Thanks.
tessierg
Posts: 2
Joined: 24 Sep 2008, 10:15

Re: Add a column in csv export

Post by tessierg »

Someone have an idea?

Please!!! I need help!
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: Add a column in csv export

Post by vboctor »

This is already supported in 1.2.x. You can download it and have a look at the code.
Migrate your MantisBT to the MantisHub Cloud
Mimie
Posts: 22
Joined: 21 Dec 2010, 08:54

Re: Add a column in csv export

Post by Mimie »

Currently im using Mantis 1.2.x.

What if I want to add other fields from other tables such as mantis_project_table for CSV export?
This is because the bug issues is related to a certain project and might need details on them.

Would appreciate if you could give suggestion to the matters.


Thanks :)
jkordani
Posts: 8
Joined: 19 Oct 2009, 18:27

Re: Add a column in csv export

Post by jkordani »

check my thread. in 1.1.x including the description fields wasn't yet supported, so I made it happen. in 1.2.x this changes, but the method I use should work for you. You might have to put it in a different place in 1.2.x, but the idea goes that in order to dump a listing of bug data and combine that data with data from another table, the other table you want to combine must have a column that holds bug id's. The table must relate to the bug table in some way. Once you figure this out, you join the tables together (when you query for the data, see my patch) and pass the result along, and go from there.
Post Reply