Mantis v2.1 custom status

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
peetervois
Posts: 7
Joined: 14 Feb 2017, 19:05

Mantis v2.1 custom status

Post by peetervois »

Hi have migrated to Mantis v2.1 from v1.3 and the custom status is kind of screwed up. I have added special steps into work flow and seems the custom_constraints_inc.php is no longer used or something else is going on instead. The statuses shown in configuration for example are shown as: ... assigned, @60@, @70@, resolved ... This is wrong and resolved is not actually resolved but must show testing instead.

It seems to me that I need to update the hardcoded configuration to match with the 2.1 version but I was unable to find "tips and tricks" for it. Please help.

My custom_constants_inc.php

Code: Select all

...
  # Custom status code
  define( 'WORKING', 60 );
  define( 'TESTING', 80 );
  define( 'RESOLVED', 70 );
...

My config_inc.php

Code: Select all

...
  # --- status codes ---
  # Revised enum string with new 'testing' status
  $g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:working,70:resolved,80:testing,90:closed';
  # Status color additions
  $g_status_colors['working'] = '#fbe04d';
  $g_status_colors['testing'] = '#ACE7AE';
...
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis v2.1 custom status

Post by atrol »

peetervois wrote:Seems the custom_constraints_inc.php is no longer used
I am not aware that MantisBT ever used such a file. You should certainly ensure that custom_strings_inc.php is copied from your 1.3 installation to your 2.1 installation.
Please use Search before posting and read the Manual
peetervois
Posts: 7
Joined: 14 Feb 2017, 19:05

Re: Mantis v2.1 custom status

Post by peetervois »

Sorry, I fixed the filename in one place of my message but forgot in another, it is custom_constants_inc.php. The custom_strings_inc.php is in place too:

Code: Select all

  # Translation for Custom Status Code: testing
switch( $g_active_language ) {
  default: # english
    $s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:working,70:resolved,80:testing,90:closed';

    $s_working_bug_title = 'Start working with issue';
    $s_working_bug_button = 'Starting to Work';

    $s_testing_bug_title = 'Mark issue Ready for Testing';
    $s_testing_bug_button = 'Ready for Testing';

    $s_email_notification_title_for_status_bug_testing = 'The following issue is ready for TESTING.';
    break;
}
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis v2.1 custom status

Post by atrol »

To be complete sure that you copied custom_strings_inc.php to the right folder, add the following line to the file

Code: Select all

die ("Hello from custom_strings_inc.php"); 
After that you should see just "Hello from custom_strings_inc.php" when opening any MantisBt page.
Please use Search before posting and read the Manual
peetervois
Posts: 7
Joined: 14 Feb 2017, 19:05

Re: Mantis v2.1 custom status

Post by peetervois »

Thanks for replying. The die() was not working. I have found from guthub, that the file must be under config/ directory now. I moved it there and now the states are OK again.

I have also found, that in the documentation the file name is with capital ..._Inc.php not ...inc.php. The inc must be written with lowercase according to the source code.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis v2.1 custom status

Post by atrol »

peetervois wrote:that the file must be under config/ directory now.
They are in config since 1.3. Maybe you used a beta version of 1.3 before.
peetervois wrote:I have also found, that in the documentation the file name is with capital ..._Inc.php not ...inc.php.
I searched, but did not find. Where did you find the capital _Inc?
Please use Search before posting and read the Manual
peetervois
Posts: 7
Joined: 14 Feb 2017, 19:05

Re: Mantis v2.1 custom status

Post by peetervois »

Is it readme.md at https://github.com/mantisbt/mantisbt where the _Inc.php is with capital I ?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis v2.1 custom status

Post by atrol »

Please use Search before posting and read the Manual
peetervois
Posts: 7
Joined: 14 Feb 2017, 19:05

Re: Mantis v2.1 custom status

Post by peetervois »

Appears you are right. I started to copy and paste the text here to realize that my web browser does render the dot on top of the i so closely htat it appears as capital. Sorry.
Attachments
Screenshot_2017-02-17_10-09-23.png
Screenshot_2017-02-17_10-09-23.png (10.39 KiB) Viewed 13195 times
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis v2.1 custom status

Post by atrol »

Thanks for the feedback.
This looks really strange and is hard to read.
Please use Search before posting and read the Manual
Post Reply