Contained in this zip file is a patch for Mantis v1.2.0CVS, as of 10/23/2007. It has also been tested with v1.1.0rc1. It adds functionality for customized "My View" on a per user basis.

This archive contains the following files:
readme
account_my_view_add.php
account_my_view_delete.php
account_my_view_page.php
account_my_view_sequence.php
customMyView.diff


--------------------
 To Install:
--------------------

1) Back up your database and your Mantis Installation!

2) Untar/Ungzip the contents of the file in to your base Mantis install directory.

3) Apply the diff file with the following command:
		patch -p0 < customMyView.diff

4) Remove the following file as it is now depracated:
		core/my_view_inc.php

5) Run the following SQL statement:

	CREATE TABLE IF NOT EXISTS `mantis_filters_my_view_table` (
		`user_id` int(11) unsigned NOT NULL,
		`filter_id` int(10) NOT NULL,
		`sequence` tinyint(2) unsigned NOT NULL,
		PRIMARY KEY  (`user_id`,`filter_id`),
		KEY `sequence` (`sequence`)
	);


--------------------
 New Constants
--------------------
This patch adds a few new constants to Mantis. These defines map to Predefined Filters:
		FILTER_ASSIGNED
		FILTER_UNASSIGNED
		FILTER_REPORTED
		FILTER_RESOLVED
		FILTER_RECENT_MOD
		FILTER_MONITORED
		FILTER_FEEDBACK
		FILTER_VERIFY


--------------------
 New Configuration Settings
--------------------
An administrator has a few new config settings he can play with

$g_my_view_boxes

	- This allows an administrator to define the default "My View" filters. Though this existed before this patch, its use has changed a little bit. It now uses the constants described above. It also lets you define Filter IDs that you may have created with Mantis' custom filtering system. I also simplified it a bit, so you simply put the filters in the order you want them to appear. For example:
	$g_my_view_boxes = array (
			FILTER_ASSIGNED,
			FILTER_UNASSIGNED,
			FILTER_REPORTED,
			FILTER_RESOLVED
		);

$g_my_view_access_boxes

	- You can now define the default My View on a "Per Access Level" basis. This setting is an array, so to accomplish this, set the key of the first dimension to the access level, then make the value an array of filters. For example:
	$g_my_view_access_boxes = array (
			ADMINISTRATOR => array(
				FILTER_UNASSIGNED,
				FILTER_ASSIGNED
			),
			REPORTER => array(
				FILTER_REPORTED,
				FILTER_MONITORED
			)
		);

$g_custom_my_view_threshold

	- This allows you to set the threshold for who can define their own My View. For Example:
	g_custom_my_view_threshold = MANAGER;


--------------------
 Use
--------------------
This patch is based on the custom filters that a user creates on the "View Issues" page. First, they create the filters they would like to appear in "My View" as they would normally. Then, they go to "My Account", "My View" where they manager their settings. It allows them to add Public Filters, Predefined Filters and their own Private Filters. They can also remove filters and re-order them.

A few notes about how this patch interacts with the stored_query settings:
 - If they don't fall within the stored_query_use threshold, they can still add predefined filters to their "My View"
 - If they don't fall within the stored_query_create threshold, they can still add Public Filters.


Cheers!