Page 1 of 1

Creating custom statuses

Posted: 17 Nov 2008, 07:36
by micah26
I'm currently using Mantis 1.1.2 and am wondering if there is an easy way to do this. The manual shows a way to do this, but I had trouble with it. The manual page is also 3 years old. Is there a tutorial for this and/or can someone update the manual.
I'm interested in statuses like testing and ready for production.

Thank you,
Micah

Re: Creating custom statuses

Posted: 17 Nov 2008, 13:48
by jb_mantis
I was interested in this a while back and researched it some. I never implemented it, but here are the changes I think would need to be made. Hopefully someone else can confirm. The settings below are for a new status of "In progress". Replace with your status name.

add/update to custom_constant_inc.php:
<?php
define ( 'IN_PROGRESS', 70 );
?>

add/update to custom_strings_inc.php:
<?php
if ( lang_get_current() == 'english' ) {
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,70:in progress,80:resolved,90:closed';
$s_in_progress_bug_button = "Issue In Progress";
$s_in_progress_bug_title = "Set Issue In Progress";
$s_email_notification_title_for_status_bug_in_progress = "The following issue is IN PROGRESS.";
}
?>

add/update to config_inc.php:
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,70:in_progress,80:resolved,90:closed';
$g_status_colors['in progress'] = '#C7E3FF';
$g_status_enum_workflow[IN_PROGRESS] = '20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';

Re: Creating custom statuses

Posted: 18 Nov 2008, 01:02
by olegos
What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

Re: Creating custom statuses

Posted: 18 Nov 2008, 03:50
by micah26
olegos wrote:What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

I had trouble seeing the new status. I'll try the steps the last poster showed and see if it helps.

Thanks,
Micah

[Mantis 1.1.2]

Re: Creating custom statuses

Posted: 20 Nov 2008, 04:49
by micah26
micah26 wrote:
olegos wrote:What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

I had trouble seeing the new status. I'll try the steps the last poster showed and see if it helps.

Thanks,
Micah

[Mantis 1.1.2]
It worked great! Thank you!
Micah

Re: Creating custom statuses

Posted: 24 Mar 2009, 07:13
by torenware
One caveat: I just spent several hours trying to figure out why the example didn't work with the current stable download. I had updated from 0.19, and the upgrade went fine. It seemed as if Mantis was not looking in config_inc.php to pull in my new workflow entries.

After running Mantis through the debugger, it turns out that Mantis will not look at your workflow configs if there is already a setting in the mantis_config_table in the database. config_get will never go to the settings files if the database has already cached status_enum_workflow.

The workaround is to delete the item from the cache:

Code: Select all

delete from mantis_config_table where config_id = 'status_enum_workflow';
Mantis will then look at your config file for this information, and you can go into Manage pages to finish configuring the workflow.

Re: Creating custom statuses

Posted: 13 Nov 2009, 09:17
by duwil
torenware wrote:config_get will never go to the settings files if the database has already cached status_enum_workflow.

The workaround is to delete the item from the cache:

Code: Select all

delete from mantis_config_table where config_id = 'status_enum_workflow';
Mantis will then look at your config file for this information, and you can go into Manage pages to finish configuring the workflow.
I ran into a similar problem months ago and I think it's better not to use the config file at all when possible to avoid confusion, my config_inc.php has only few lines, only the ones I can't configure via web interface.

Re: Creating custom statuses

Posted: 21 Apr 2010, 20:41
by tetsunami
so i want to ask something about the states
in
my_view_page.php

how can i add to the states bar (the colored one) the new state i just add


thansk a lot for the help . :P

Re: Creating custom statuses

Posted: 21 Apr 2010, 21:34
by atrol
If you are following the given instructions how to add a new status, you don't have to do anything more.
The new status will appear in bar without any further modification.

Re: Creating custom statuses

Posted: 22 Apr 2010, 13:48
by tetsunami
tetsunami wrote:so i want to ask something about the states
in
my_view_page.php

how can i add to the states bar (the colored one) the new state i just add


thansk a lot for the help . :P
SO i only add in the gui state the right workflow and then the colores bar just update :mrgreen: my bad