Mantis 1.1.2-add custom field to view & csv export

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
mantis_user
Posts: 5
Joined: 27 Jun 2008, 10:21

Mantis 1.1.2-add custom field to view & csv export

Post by mantis_user »

In Mantis 1.1.2, is it possible to add a custom field as an additional column to the online "View Issues" and also to "CSV Export" without having to modify source codes ? If codes have to be modifiedto achieve this, please help to indicate which pgms.

Under the administrator's "manage" function, I can "manage custom fields", but this is limited to only creating the custom field but not to add it to the "view issues" and "csv export".
vzw614
Posts: 143
Joined: 15 May 2008, 14:59

Re: Mantis 1.1.2-add custom field to view & csv export

Post by vzw614 »

Yep, you sure can. It doesn't require an actual coding changes but you do need to make a couple of changes to your config files.

Here are the steps...

1) Add your custom fields in Mantis using Manage -> Manage Custom Fields
2) Go to the directory Mantis is installed in and open config_defaults_inc.php
3) Find $g_view_issues_page_columns and copy that entire line
4) Open config_inc.php (if you don't have that file copy and rename config_inc.php.sample to config_inc.php) and copy $g_view_issues_page_columns into it
5) Add your custom fields in the order you want them to appear. You MUST prepend custom_ to the name of your custom fields. Here is an example..

Code: Select all

$g_view_issues_page_columns = array ( 'selection', 'edit', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment', 'category', 'severity', 'status', 'custom_Developer(s)', 'custom_Prod Move Date', 'last_updated', 'summary' );
6. Copy and paste the line $g_csv_columns from config_defaults_inc.php to config_inc.php and add your custom fields to it also. (NOTE that I have not tested this step)
7. Save config_inc.php

NOTES about custom fields...
A) In Mantis when you create a custom field you may want to provide a list of possible values. To do this seperate each value with a | character. You do not use quotes around strings.
B) While you are adding the cutom field be sure to "link" it to all of the projects you want it to appear in.

Good luck!
Curtis
mantis_user
Posts: 5
Joined: 27 Jun 2008, 10:21

Re: Mantis 1.1.2-add custom field to view & csv export

Post by mantis_user »

I copy all three lines for $g_view_issues_page_columns, $g_print_issues_page_columns and $g_csv_columns into the config_inc.php file, and insert the custom_xxxx field accordingly.

It works. Many Thanks !
ezraw@yahoo.com
Posts: 1
Joined: 16 Dec 2009, 18:57

Re: Mantis 1.1.2-add custom field to view & csv export

Post by ezraw@yahoo.com »

Tested it with the CVS export and it works.

Any ideas on how to do this and make it project-specific?
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 1.1.2-add custom field to view & csv export

Post by atrol »

Try the same way I explained at the following link for viewing issues
Replace "view_issues_page_columns" by "csv_columns"

http://www.mantisbt.org/forums/viewtopic.php?f=4&t=8621

This should work project and/or user specific
Please use Search before posting and read the Manual
Post Reply