Trying to modify my_view_page.php to use a custom filter.

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
kec161
Posts: 10
Joined: 25 Jan 2006, 16:31

Trying to modify my_view_page.php to use a custom filter.

Post by kec161 »

How would I go about creating a filter on the my_view_page.php that filters on a custom field?

I have a field called Unit Tester that contains the name of the developer that tested the code.

1. I've modified config_inc.php to add a new view box:

Code: Select all

	$g_my_view_boxes = array (
		'assigned'      => '1',
		'unassigned'    => '2',
		'reported'      => '3',
		'resolved'      => '4',
		'recent_mod'	=> '5',
		'monitored'		=> '6',
		'feedback'		=> '0',
		'verify'		=> '0',
		'ready_test'     => '7',
	);

2. I added the title text to custom_strings_inc.php

Code: Select all

$s_my_view_title_ready_test = "Waiting For Me To Unit Test";
The part I'm having trouble with is changing core/my_view_inc.php. Initially I tried

Code: Select all

	$c_filter['ready_test'] = array(
		'custom_Unit Tester' => Array('0' => $t_current_user_id),
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
		'highlight_changed'	=> $t_default_show_changed,
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY ),
	);
	$url_link_parameters['ready_test'] = 'custom_Unit Tester=' . $t_current_user_id;

I also tried substituting "Unit Tester" for "custom_Unit Tester" but it didn't work.

I saw note 225 in http://manual.mantisbt.org/manual.confi ... ttings.php and attempted:

Code: Select all

	$c_filter['ready_test'] = array(
		'custom_fields' => Array('custom_Unit Tester' => Array( '0' => $t_current_user_id)),
		'show_category'		=> Array ( '0' => META_FILTER_ANY ),
		'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
		'show_status'		=> Array ( '0' => META_FILTER_ANY ),
		'highlight_changed'	=> $t_default_show_changed,
		'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
		'handler_id'		=> Array ( '0' => META_FILTER_ANY ),
		'show_resolution'	=> Array ( '0' => META_FILTER_ANY ),
		'show_build'		=> Array ( '0' => META_FILTER_ANY ),
		'show_version'		=> Array ( '0' => META_FILTER_ANY ),
		'hide_status'		=> Array ( '0' => $t_hide_status_default ),
		'user_monitor'		=> Array ( '0' => META_FILTER_ANY ),
	);
	$url_link_parameters['ready_test'] = 'custom_unit tester=' . $t_current_user_id;

I tried substituting "Unit Tester" for "custom_Unit Tester" for this too but still no luck.

Has anyone done this before that can help me? Any help would be appreciated.

Thanks,
Kira (kira.fernandes@gmail.com)
kec161
Posts: 10
Joined: 25 Jan 2006, 16:31

Post by kec161 »

Post Reply