how to override status flow

Post about your customizations to share with others.

Moderators: Developer, Contributor

how to override status flow

Postby ghas » Apr 10, 2012 3:44 am

hi,

I have defined a set of statuses and a status flow. Everything works as expected - I can change statuses only according to the flow. However in some cases I would like the administrator to be able to change statuses differently, than defined in the flow.

Example: when someone changed a status by mistake, I'd like the administrator to undo this change and go back to previous status, but the status flow doesn't allow to do that.

I know admin can change statuses directly in database, but I'd like to avoid that.

Thanks for any ideas how to solve this.

Best regards :)
ghas
 
Posts: 2
Joined: Apr 10, 2012 3:35 am

Re: how to override status flow

Postby ghas » May 10, 2012 11:04 am

I managed to find a solution on my own:

I modified get_status_option_list function in print_api.php file. I changed the line

if( count( $t_enum_workflow ) < 1)

to

if( count( $t_enum_workflow ) < 1 || $p_user_auth == 90)

where "90" corresponds to administrator in my mantis instance. In your instance, this number may be different.
ghas
 
Posts: 2
Joined: Apr 10, 2012 3:35 am

Re: how to override status flow

Postby Lapinkiller » May 11, 2012 8:19 am

you should use constant and not "90" ;)
Lapinkiller,
French PHP developer
New look for your mantis : viewtopic.php?f=4&t=20055
Lapinkiller
 
Posts: 273
Joined: Jan 28, 2011 1:47 pm
Location: France


Return to Customizations

Who is online

Users browsing this forum: No registered users and 1 guest

cron