Page 1 of 1

Custom Field in Roadmap Page

Posted: 28 Aug 2008, 10:55
by marcolino7
Hi all,
I have mantis 1.1.2 and I would like to add a Custom Field created for the project in Roadmap page.
Is possible to do this? With Parameters? Modifying codes?

Please help.

If this feature is not implemeted yet, is possible to add in future release?

Many thanks

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 07:14
by deboutv
You can override a custom function (custom_function_override_roadmap_print_issue) to display the issue as you want.

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 11:49
by marcolino7
hi,
thanks for your suggestion.
Do you have an example on how implement it?

Many Thanks in advance

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 12:27
by deboutv
Take a look at the default one (in core/custom_function_api.php).

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 12:35
by marcolino7
I can't find custom_function_override_roadmap_print_issue in custom function API, but i solved with this code:

Code: Select all

# --------------------
	# Prints one entry in the roadmap.
	function custom_function_default_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) {
		$t_bug = bug_get( $p_issue_id );
		
		if ( bug_is_resolved( $p_issue_id ) ) {
			$t_strike_start = '<strike>';
			$t_strike_end = '</strike>';
			$t_avanzamento = '';
		} else {
			$t_strike_start = $t_strike_end = '';
			$t_avanzamento = ' - '.custom_field_get_value( '3', $p_issue_id );
		}
		
		$t_category = is_blank( $t_bug->category ) ? '' : '<b>[' . $t_bug->category . ']</b> ';
		echo str_pad( '', $p_issue_level * 6, '&nbsp;' ), '- ', $t_strike_start, string_get_bug_view_link( $p_issue_id ), ': ', $t_category, string_display_line_links( $t_bug->summary );

		if ( $t_bug->handler_id != 0 ) {
			echo ' (', prepare_user_name( $t_bug->handler_id ) , $t_avanzamento , ')';
		}

		echo ' - ', get_enum_element( 'status', $t_bug->status ), $t_strike_end, '.<br />';
	}
Many thanks.

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 13:43
by autra
If the function custom_function_override_roadmap_print_issue doesn't exist, you must create it and put your modified function here. Mantis will call custom_function_override_roadmap_print_issue instead of custom_function_default_roadmap_print_issue.
It allows you not to change the default function.

Re: Custom Field in Roadmap Page

Posted: 29 Aug 2008, 14:34
by marcolino7
Thanks to all.
I customized Roadmap in according with my requirments.
Many thanks a lot to all.

Re: Custom Field in Roadmap Page

Posted: 23 Sep 2008, 12:20
by artgroup
Is there a way to strike the closed issue on mantis 1.1.2?

I'm looking in bug traker and forum but it seems fixed into 1.2.a01 only

thanks

Re: Custom Field in Roadmap Page

Posted: 23 Sep 2008, 13:00
by deboutv
It is already the case.

Re: Custom Field in Roadmap Page

Posted: 23 Sep 2008, 22:10
by artgroup
That is true on the roadmap but not on the changelog where the bug id link is not striked.
While on mantis bug tracker I see that al bug id when closed/resolved are striked (the recently visited also)

Do I need to apply some patch? I looked into the bug tracker finding nothing.

My version is Mantis 1.1.2

Re: Custom Field in Roadmap Page

Posted: 24 Sep 2008, 07:04
by deboutv
You have also a custom function to print issue on the changelog page: custom_function_override_changelog_print_issue. You can change it to look like the roadmap function.