Notifications issues for Custom Status

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
addnothiing
Posts: 6
Joined: 15 Jun 2015, 12:41

Notifications issues for Custom Status

Post by addnothiing »

Hello,

I’m very new in Mantis (2 weeks) and I have some troubles with the Notifications for the custom status. For all the custom status, the notification are not sent. I tried to apply solution (ref. bug viewtopic.php?f=3&t=21721) but I don’t reach to fix my problem.

I checked every step from the tuto (https://www.mantisbt.org/docs/master-1. ... IZE.STATUS) . the configuration seems ok for me. I search in the whole forum and I tested atrol’s solution about the email problems but nothing worked so here I am.

1 - This is the custom_constant_inc.php (I already tried to rename it custom_constants_inc.php but nothing change):

Code: Select all

<?php
define ( 'RECEIVED', 30 );
define ( 'DELIVERED', 555 );
define ( 'WAITING', 60 );
define ( 'CANCEL', 70 );
define ( 'REQUIREMENT',150 );
define ( 'DEVELOPMENT', 110 );
define ( 'ACCORDREAL', 241 );
define ( 'PROPOSITION', 242 );
define ( 'SAT', 244 );
?>

2 – In config_inc.php

Code: Select all

$g_status_enum_string	= '10:new,30:received,242:proposition,241:accordreal,150:requirement,110:development,555:delivered,244:SAT,60:waiting,70:cancel,90:closed';
# Status color additions
$g_status_colors['new'] = '#FF99FF';
$g_status_colors['received'] = '#FF9900';
$g_status_colors['proposition'] = '#D2B48C';
$g_status_colors['accordreal'] = '#AEEE00';
$g_status_colors['requirement'] = '#FFFF66';
$g_status_colors['development'] = '#FF6666';
$g_status_colors['delivered'] = '#33FFCC';
$g_status_colors['SAT'] = '#999999';
$g_status_colors['waiting'] = '#CC99FF';
$g_status_colors['cancel'] = '#CC0000';
$g_status_colors['closed'] = '#999999';
3 – In custom_strings_inc.php:

Code: Select all

<?php

if ( lang_get_current() == 'french' ) {
 
	$s_status_enum_string	= '10:nouveau,30:prise en charge,242:proposition envoyée,241:accord réal,150:spécifications,110:réalisation,555:livré,244:SAT,60:suspendre,70:annulé,90:cloturé';

	$s_new_bug_button = "Nouveau";
    $s_new_bug_title = "Nouveau bug";
    $s_email_notification_title_for_status_bug_new =
        htmlentities("Le bug est créé.");	
	
	$s_received_bug_button = "Prise en charge";
    $s_received_bug_title = "Prise en charge du bug";
    $s_email_notification_title_for_status_bug_received =
        htmlentities("Le bug a été pris en charge.");	 
	
	$s_proposition_bug_button = htmlentities("proposition client");
    $s_proposition_bug_title = htmlentities("Proposition envoyée au client");
    $s_email_notification_title_for_status_bug_proposition =
        htmlentities("L'offre a été envoyé au client");
	
	$s_accordreal_bug_button = htmlentities("accord réal");
    $s_accordreal_bug_title = htmlentities("Accord réal");
    $s_email_notification_title_for_status_bug_accordreal =
        htmlentities("L'accord a été donnée pour la réalisation");
		
		$s_requirement_bug_button = htmlentities("Spécification");
    $s_requirement_bug_title = htmlentities("Spécification");
    $s_email_notification_title_for_status_bug_requirement =
        htmlentities("La mise à jour des spécifications sont en cours.");
	
	$s_development_bug_button = htmlentities("Réalisation");
    $s_development_bug_title = htmlentities("Réalisation");
    $s_email_notification_title_for_status_bug_development =
        htmlentities("L'évolution est en cours de réalisation.");
		
    $s_delivered_bug_button = "Livrer";
    $s_delivered_bug_title = "Livraison du bug";
    $s_email_notification_title_for_status_bug_delivered =
        htmlentities("Le bug a été livré.");	
		
		$s_SAT_bug_button = htmlentities("recette SAT");
    $s_SAT_bug_title = htmlentities("Recette SAT");
    $s_email_notification_title_for_status_bug_SAT =
        htmlentities("Recette SAT validée");
		
	    $s_waiting_bug_button = "Suspendre";
    $s_waiting_bug_title = "Suspendre le bug";
    $s_email_notification_title_for_status_bug_waiting =
        htmlentities("Le bug a été suspendu.");
		
		$s_cancel_bug_button = "Annuler";
    $s_cancel_bug_title = "Annuler le bug";
    $s_email_notification_title_for_status_bug_cancel =
        htmlentities("Le bug a été annulé.");
		
	$s_closed_bug_button = htmlentities("Clôturer");
    $s_closed_bug_title = htmlentities("Clôture du bug");
    $s_email_notification_title_for_status_bug_closed =
        htmlentities("Le bug a été cloturé.");	

} else	 {

		 $s_status_enum_string	= '10:new,30:received,242:proposition,241:accordreal,150:requirement,110:development,555:delivered,244:SAT,60:waiting,70:cancel,90:closed';
   
		$s_new_bug_button = "New";
    $s_new_bug_title = "New bug";
    $s_email_notification_title_for_status_bug_new =
        htmlentities("Bug already created.");	
	
	$s_received_bug_button = "Received issue";
    $s_received_bug_title = "Received issue";
    $s_email_notification_title_for_status_bug_received =
        htmlentities("The following issue is received");	 
	
	$s_proposition_bug_button = htmlentities("Proposition issue");
    $s_proposition_bug_title = htmlentities("Proposition issue");
    $s_email_notification_title_for_status_bug_proposition =
        htmlentities("L'offre a été envoyé au client");
	
	$s_accordreal_bug_button = htmlentities("accord real issue");
    $s_accordreal_bug_title = htmlentities("Accord real issue");
    $s_email_notification_title_for_status_bug_accordreal =
        htmlentities("The agreement was wiven for the development");
		
		$s_requirement_bug_button = htmlentities("Requirement issue");
    $s_requirement_bug_title = htmlentities("Requirement issue");
    $s_email_notification_title_for_status_bug_requirement =
        htmlentities("Updating the requirement");
	
	$s_development_bug_button = htmlentities("Development issue");
    $s_development_bug_title = htmlentities("Development issue");
    $s_email_notification_title_for_status_bug_development =
        htmlentities("The evolution is in progress");
		
    $s_delivered_bug_button = "delivered issue";
    $s_delivered_bug_title = "delivered issue";
    $s_email_notification_title_for_status_bug_delivered =
        htmlentities("Bug was delivered");	
		
		$s_SAT_bug_button = htmlentities("SAT issue");
    $s_SAT_bug_title = htmlentities("SAT issue");
    $s_email_notification_title_for_status_bug_SAT =
        htmlentities("SAT validated");
		
	    $s_waiting_bug_button = "Waiting issue";
    $s_waiting_bug_title = "Waiting issue";
    $s_email_notification_title_for_status_bug_waiting =
        htmlentities("The bug is waiting");
		
		$s_cancel_bug_button = "Cancelled ";
    $s_cancel_bug_title = "Cancelled the bug";
    $s_email_notification_title_for_status_bug_cancel =
        htmlentities("The bug was cancelled.");
		
	$s_closed_bug_button = htmlentities("Closed");
    $s_closed_bug_title = htmlentities("Closed");
    $s_email_notification_title_for_status_bug_closed =
        htmlentities("THe bug was closed.");	
}
?>
4 - In config_inc.php (but when I create a new project a I had to do it by myself in the Manage Workflow Transitions page else it doesn’t work)

Code: Select all

$g_status_enum_workflow[NEW_]='10:new,30:received,60:waiting,70:cancel,90:closed';
	$g_status_enum_workflow[RECEIVED]='10:new,242:proposition,60:waiting,70:cancel'; 
	$g_status_enum_workflow[PROPOSITION]='10:new,241:accordreal,60:waiting,70:cancel';
	$g_status_enum_workflow[ACCORDREAL]='10:new,150:requirement,60:waiting,70:cancel';
	$g_status_enum_workflow[REQUIREMENT]='10:new,110:development,60:waiting,70:cancel';
	$g_status_enum_workflow[DEVELOPMENT]='10:new,555:delivered,60:waiting,70:cancel';
	$g_status_enum_workflow[DELIVERED]='10:new,244:SAT,60:waiting,70:cancel';
	$g_status_enum_workflow[SAT]='10:new,90:closed,60:waiting,70:cancel';
	$g_status_enum_workflow[CLOSED]='';
	$g_status_enum_workflow[WAITING]='10:new,30:received,242:proposition,241:accordreal,150:requirement,110:development,555:delivered,244:SAT,90:closed';
	$g_status_enum_workflow[CANCEL]='10:new,90:closed';
	$g_status_enum_workflow = array();
In the Notification page, I tick notifications for all user’s profile and for each status.
I noticed that mail are only sent for “standard” status (new, received and close).
Also, I had another odd behavior: each time I used the “waiting” status, the mail isn’t sent , but it is for the next one??!!
Do you have any idea of what can I do to get what I want ?

Thanks in advance,
Adrien
addnothiing
Posts: 6
Joined: 15 Jun 2015, 12:41

Re: Notifications issues for Custom Status

Post by addnothiing »

Hi all,
I finally found why it didn't work.
This start with the switch in “Email_api.php”, the case for the status was not created. This is what I have now :

Code: Select all

switch( $p_notify_type) {
		case 'new':
		case 'feedback': 
		case 'reopened':
		case 'waiting' :
		case 'proposition':
		case 'accordreal':
		case 'test_file':
		case 'update_dev_doc':
		case 'TI_execution':
		case 'ready_for_delivery':
		case 'resolved':
		case 'requirement':
		case 'development':
		case 'delivered':
		case 'TODO':
		case 'in_progress':
		case 'SAT':
		case 'analysed':
		case 'question':
		case 'forwarded_to_publisher':
		case 'cancel':
		case 'closed':
		case 'bugnote':
			$t_pref_field = 'email_on_' . $p_notify_type;
			break;
		case 'owner':
			$t_pref_field = 'email_on_assigned';
			break;
		case 'deleted':
		case 'updated':
		case 'sponsor':
		case 'relation':
		case 'monitor':
		case 'priority': 
			$t_pref_field = false;
			break;
		default:
			$t_pref_field = 'email_on_status';
			break;
	}
After that I had to create all the variable that correspond. For example, with the status "accordreal":
Account_pref_update.php :
  • $t_prefs->email_on_accordreal = gpc_get_bool( 'email_on_accordreal');
    $t_prefs-> email_on_accordreal_min_severity = gpc_get_int('email_on_accordreal_min_severity');
Config_defaults_inc.php :
  • $g_default_email_on_accordreal = ON;
    $g_default_email_on_accordreal_minimum_severity = OFF;
Config_inc.php :
  • $g_default_email_on_accordreal = ON;
    $g_default_email_on_accordreal_minimum_severity = OFF;
User_pref_api.php :
  • protected $email_on_accordreal = NULL;
    protected $email_on_accordreal_min_severity = NULL;
    'email_on_accordreal' => 'default_email_on_accordreal',
    'email_on_accordreal_min_severity'=> 'default_email_on_accordreal_minimum_severity',
String_french.txt :
  • $s_email_notification_title_for_status_bug_accordreal = 'Le bogue suivant a été en accord de realisation.'
    $s_email_on_accordreal = 'Courriel en cas daccord pour la realisation'
    $s_accordreal_bug_button = 'Accord realisation du bogue’
    $s_custom_field_display_accordreal = 'Montrer lors des accords real'
    $s_custom_field_require_accordreal = 'Nécessaire pour accord real';
After that it's working and everything was caused by the missing variables and the switch.

Addnothiing.
Post Reply