FEATURE OVERVIEW
====================

All MANTIS usual access level threshold or feature defined with config_defaults_inc.php and config_inc.php are respected, including workflow features and action groups (view_all_bug_page). The only deference is that once an issue is DRAFT, it is considered as now modifiable for everybody except the reporter or at least a manager access level (global or project). 

In addition, as long as the issue is not NEW, the reporter or manager can update SOME FIELDS and save again. But they cannot add NOTES (nor update or delete existing notes), send reminders or create childs.
The fields that can be updated are those available form the simple or detailed submission form.

IMPLEMENTATION GUIDE
====================
Once the last modifications below are done (either in standard MANTIS files or in your custom files), to activate the feature, you have to define the following in your custom_inc.php:

In 	: config_inc.php
	# Activate draft feature by setting the value to DRAFT
	$g_bug_draft_status = DRAFT; # instead of '%bug_submit_status%';

	#define workflow components if required
	$g_status_enum_workflow[DRAFT]= '10:new'; # for instance
	$g_set_status_threshold = array( 
		NEW_ => REPORTER,
		FEEDBACK => MANAGER,
		ACKNOWLEDGED => MANAGER,
		CONFIRMED => MANAGER,
		ASSIGNED => MANAGER,
		VALIDATED => REPORTER,
		RESOLVED => DEVELOPER,
		CLOSED => MANAGER );

	#finaly you may need to tune Email setting to avoid notifications as long as issue is draft
	$g_default_notify_flags	= array('reporter'	=> ON,
					'handler'	=> ON,
					'monitor'	=> ON,
					'bugnotes'	=> ON,
					'threshold_min'	=> NOBODY,
					'threshold_max' => NOBODY);

	$g_notify_flags['new']		= array('monitor'	=> OFF,
						'threshold_min'	=> MANAGER,
						'threshold_max' => MANAGER);

	$g_notify_flags['owner']	= array('reporter'	=> OFF,
						'handler'	=> OFF,
						'threshold_min'	=> MANAGER,
						'threshold_max' => MANAGER);

	$g_notify_flags['reopened']	= array('threshold_min'	=> MANAGER,
						'threshold_max' => MANAGER);

	$g_notify_flags['deleted']	= array('threshold_min'	=> MANAGER,
						'threshold_max' => MANAGER);

	$g_notify_flags['updated']	= array('reporter'	=> OFF);

	$g_notify_flags['bugnote']	= array('reporter'	=> OFF);
	
	$g_notify_flags['relation']	= array('reporter'	=> OFF);

	$g_notify_flags['draft']	= array('reporter'	=> OFF,
						'handler'	=> OFF,
						'monitor'	=> OFF,
						'bugnotes'	=> OFF,
						'threshold_min'	=> NOBODY,
						'threshold_max' => NOBODY);
	
	
In 	: custom_strings_inc.php
	Change the translation of the draft status if required 
	$s_status_enum_string  = '05:brouillon,10:nouveau,20:commentaire,30:accept,40:confirm,50:affect,80:rsolu,90:ferm';

( for actionsactions are submited to the usual threshold of MANTIS (Reporter can close, can act upon the issue (other than monitor)


LAST MODIFICATIONS TO INSERT IN MANTIS FILES TO GET THE STAF WORKING
====================================================================
Here is some additional constantes and strings I added my custom files for the moment but which should be placed in regular Mantis files

# *******************************************************************
# I placed this In 	: custom_strings_inc.php
# Should be inserted in : strings_english.txt (en translated)
# *******************************************************************

# bug_change_status_page.php
$s_draft_bug_title = 'Set bug as DRAFT';
$s_draft_bug_button = 'Set as DRAFT';

# Email Strings
$s_email_notification_title_for_status_bug_Draft = 'The following issue is now in status DRAFT';


# report_bug_page.php
$s_check_report_draft = 'check to save report as DRAFT';
$s_report_draft = 'Save as DRAFT';

# new strings:
$s_draft_bug = 'Draft issue';

# bug_actiongroup_page.php : mass treatment
$s_bug_actiongroup_draft = 'This issue is a draft. You cannot performe the requested action. Contact the reporter or a Manager';

# ERROR strings
$MANTIS_ERROR[ERROR_BUG_DRAFT_ACTION_DENIED] = 'The action cannot be performed because issue \'%d\' is a draft';

# Enum Strings
$s_status_enum_string = '05:draft,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';

# *******************************************************************
# I placed this In 	: custom_constant_inc.php
# Should be inserted in : constant_inc.php
# *******************************************************************
	# status
	define ( 'DRAFT',			05 );	# Draft

	# history constants
	define( 'DRAFT_BUG',					24 );

	# ERROR_BUG_*
	define( 'ERROR_BUG_DRAFT_ACTION_DENIED',			1104 );

# *******************************************************************
# I placed this In 	: config_inc.php
# Should be inserted in : config_defaults_inc.php for default values
# *******************************************************************
############################
# Status Settings
############################
# Status to assign to the bug when saved as draft.
# Must be lest than NEW_ to activate the feature
# else nothing changes (default is $g_bug_submit_status DRAFT feature is deactivated)
# If you want to activate it, Define a status draft in $g_status_enum_string and give it the value DRAFT
# ex: 
# $g_status_enum_string = '05:draft, 10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';
$g_bug_draft_status = '%bug_submit_status%';


