Add a column in csv export

Post about your customizations to share with others.

Moderators: Developer, Contributor

Add a column in csv export

Postby tessierg » Sep 24, 2008 5:40 am

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: Sep 24, 2008 5:15 am

Re: Add a column in csv export

Postby tessierg » Sep 26, 2008 2:52 am

Someone have an idea?

Please!!! I need help!
tessierg
 
Posts: 2
Joined: Sep 24, 2008 5:15 am

Re: Add a column in csv export

Postby vboctor » Oct 14, 2008 11:09 pm

This is already supported in 1.2.x. You can download it and have a look at the code.
Are you following MantisBT on Twitter? - http://www.twitter.com/mantisbt
You can follow me too! - http://www.twitter.com/vboctor
vboctor
Site Admin
 
Posts: 1270
Joined: Feb 13, 2005 5:11 pm
Location: Redmond, Washington

Re: Add a column in csv export

Postby Mimie » Feb 24, 2011 9:15 pm

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 :)
Mimie
 
Posts: 22
Joined: Dec 21, 2010 3:54 am

Re: Add a column in csv export

Postby jkordani » Mar 03, 2011 2:03 pm

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.
jkordani
 
Posts: 8
Joined: Oct 19, 2009 1:27 pm


Return to Customizations

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron