Change custom field values display

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
dmarechal
Posts: 7
Joined: 23 Nov 2016, 15:30
Location: France

Change custom field values display

Post by dmarechal »

I want to change how my custom field values are displayed in the View Issue Details page.

The custom field type is multiselection. I want to change from this actual display:
Image
to bullet points.

What I tried to do:
I opened bug_view_inc.php where the html code is generated.

Code: Select all

foreach( $t_related_custom_field_ids as $t_id ) {
	if( !custom_field_has_read_access( $t_id, $f_bug_id ) ) {
		continue;
	} # has read access

	$t_custom_fields_found = true;
	$t_def = custom_field_get_definition( $t_id );

	echo '<tr>';
	echo '<th class="bug-custom-field category">', string_display( lang_get_defaulted( $t_def['name'] ) ), '</th>';
	echo '<td class="bug-custom-field" colspan="5">';
	print_custom_field_value( $t_def, $t_id, $f_bug_id );
	echo '</td></tr>';
}
That lead me to the print_custom_field_value and string_custom_field_value functions in custom_field_api.php and that is where I start to be lost.

Questions:
Is it possible, for a specific custom field, to change the custom field values display?
Am I digging in the right place? if so, which function do I have to customize/override?

Thank you
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Change custom field values display

Post by atrol »

custom_function_override_print_column_value
http://www.mantisbt.org/docs/master-1.3 ... ustomfuncs
Please use Search before posting and read the Manual
dmarechal
Posts: 7
Joined: 23 Nov 2016, 15:30
Location: France

Re: Change custom field values display

Post by dmarechal »

Thank you Atrol!
Post Reply