Add monitor when the user create an issu

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
cath
Posts: 8
Joined: 16 Dec 2019, 17:31

Add monitor when the user create an issu

Post by cath »

hello everybody :

In my previous plaform, it is working well : the user into the bug_report_page.php can add monitors : he has a list to select one or several monitors.
In my new platform (A new environnent and version and new informatic teams) it is not working, and we don't know why.

We have compare the code of the bug_report_page.php and bug_report.php and config.php => nothing find.
Perhaps we can help us ?

*****
We have about "monitor" subject :
******
Into the bug_report_page.php
into the new plateform :

$t_show_monitors = in_array( 'monitors', $t_fields )
&& access_has_project_level( config_get( 'monitor_add_others_bug_threshold' ) );


<?php if( $t_show_monitors ) { ?>
<tr>
<th class="category">
<label for="monitors"><?php echo lang_get( 'monitored_by' ) ?></label>
</th>
<td>
<select <?php echo helper_get_tab_index() ?> id="monitors" name="monitors[]" class="input-sm" multiple>
<?php print_user_option_list( NO_USER, $t_project_id, config_get( 'monitor_bug_threshold' ) ) ?>
</select>
</td>
</tr>
<?php } ?>

****
into the previous plateform :
Into the bug_report_page.php
We have about "monitor" subject :

&& access_has_project_level( config_get( 'update_bug_assign_threshold' ) );
$t_show_monitors = in_array( 'monitors', $t_fields )
&& access_has_project_level( config_get( 'monitor_add_others_bug_threshold' ) );



<?php if( $t_show_monitors ) { ?>
<tr>
<th class="category">
<label for="monitors"><?php echo lang_get( 'monitored_by' ) ?></label>
</th>
<td>
<select <?php echo helper_get_tab_index() ?> id="monitors" name="monitors[]" class="input-sm" multiple>
<?php print_user_option_list( NO_USER, $t_project_id, config_get( 'monitor_bug_threshold' ) ) ?>
</select>
</td>
</tr>
<?php } ?>



***************************
into the bug_report.php

into the new plateform :

$t_monitors = gpc_get_int_array( 'monitors', array() );
if( $t_monitors ) {
# The API expects a list of arrays with 'id' as key
$t_list = array();
foreach( $t_monitors as $t_monitor_id ) {
$t_list[] = array( 'id' => $t_monitor_id );
}
$t_issue['monitors'] = $t_list;

into the old plateform :
$t_monitors = gpc_get_int_array( 'monitors', array() );
if( $t_monitors ) {
# The API expects a list of arrays with 'id' as key
$t_list = array();
foreach( $t_monitors as $t_monitor_id ) {
$t_list[] = array( 'id' => $t_monitor_id );
}
$t_issue['monitors'] = $t_list;


***********************

into the config_defaults_inc we have

/**
* Access level needed to monitor bugs.
* Look in the constant_inc.php file if you want to set a different value.
* @global integer $g_monitor_bug_threshold
*/
$g_monitor_bug_threshold = REPORTER;


/**
* Threshold needed to show the list of users monitoring a bug on the bug view pages.
* @global integer $g_show_monitor_list_threshold
*/
$g_show_monitor_list_threshold = DEVELOPER;


the code speak about "# The API expects a list of arrays with 'id' as key"
what is the API ? perhaps wxe need to install and addittional file ?
For your information the people had installed this function are gone


The version of the new plateform is
*******************************************************
Version de MantisBT 2.26.1
Version du schéma 210
Version de PHP 7.4.19
Pilote de la base de données pgsql
Version de la base de données, description 14.6, PostgreSQL 14.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-15), 64-bit

Thanks a lot for your help.
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Add monitor when the user create an issu

Post by cas »

did you check the thresholds in config/config_inc.php (please never make changes in config_defaults_inc.php)
cath
Posts: 8
Joined: 16 Dec 2019, 17:31

Re: Add monitor when the user create an issu

Post by cath »

**************************************
hello, thanks et lot
about the config_inc.php
I don't know why it is very litlle on the new production environnement :
copy-paste of the file is :
*****************************************


<?php
# MantisBT - A PHP based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.

/**
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/

# This sample file contains the essential files that you MUST
# configure to your specific settings. You may override settings
# from config_defaults_inc.php by uncommenting the config option
# and setting its value in this file.

# Rename this file to config_inc.php after configuration.

# In general the value OFF means the feature is disabled and ON means the
# feature is enabled. Any other cases will have an explanation.

# Look in http://www.mantisbt.org/docs/ or config_defaults_inc.php for more
# detailed comments.

require_once( __DIR__ . '/../core/constant_inc.php' );
require_once( __DIR__ . '/prologue.php' );


# --- ---
# --- configuration de base de Mantis ---
# --- ---




# --- Security ---
$g_crypto_master_salt = ''; # Random string of at least 16 chars, unique to the installation
require_once( __DIR__ . '/crypto_master_salt.php' );

# --- Anonymous Access / Signup ---
$g_allow_signup = ON;
$g_allow_anonymous_login = OFF;
$g_anonymous_account = '';


# --- ---
# --- configuration Synapse ---
# --- ---

$g_login_method = SAML_AUTH;


# --- Attachments / File Uploads ---
$g_allow_file_upload = ON;

# $g_file_upload_method = DATABASE; # or DISK
$g_file_upload_method = DISK;

# used with DISK, must contain trailing \ or /.
$g_absolute_path_default_upload_folder = $CONFIG['APPLI_FIC'] . '/upload/';

# Taille max d'une pièce jointe [octet]
$g_max_file_size = 6 * 1024 * 1024; // 6 MB

# $g_preview_attachments_inline_max_size = 256 * 1024;
# $g_allowed_files = ''; # extensions comma separated, e.g. 'php,html,java,exe,pl'
# $g_disallowed_files = ''; # extensions comma separated
$g_disallowed_files = 'php,php3,phtml,html,class,java,exe,sh,bat,cmd';

$g_html_make_links = LINKS_NEW_WINDOW; // Ouverture dans une autre fenêtre des liens HTML

$g_default_timezone = 'UTC';

# --- ---
# --- projets ---
# --- ---

# Catégorie "[Tous les projets]MRB" par défaut en cas de déplacement
$g_default_category_for_moves = 90;


# --- ---
# --- Customisation ---
# --- surcharge de la configuration ---
# --- ---

# Cette section doit être la dernière du fichier : elle permet de surcharger la
# totalité de la configuration par le MOE à partir du dossier $APPLI_DATA.

$config_custom_xxxx = $CONFIG['APPLI_CONFIG'] . '/config_inc.php';

if ( file_exists( $config_customxxxx)) {
require_once( $config_custom_xxxx );
}

# /!\ /!\
# /!\ NE RIEN ÉCRIRE SOUS CETTE LIGNE /!\
# /!\ /!\

?>


***************
END OF FILE
**************

***********************************************************************************
copy paste of the config_inc.php of the previous plateforme
************************************************************************************
<?php
/***********************************************/
/* */
/*
/* */
/* */
/***********************************************/

$g_path = isset( $t_url ) ? $t_url :

// Personnalisation de l'instance Mantis PRODUCTION
$g_window_title='Gestion de demande';

// Information de base de données (PRODUCTION)
//$g_hostname =
//$g_db_type =
//$g_database_name =
//$g_db_username =
//$g_db_password =

// #A1 : Ajouter des observateurs dès la création du ticket
$g_bug_report_page_fields = array(
'additional_info',
'attachments',
'category_id',
'due_date',
'handler',
'monitors',
'os',
'os_build',
'platform',
'priority',
'product_build',
'product_version',
'reproducibility',
'severity',
'steps_to_reproduce',
'tags',
'target_version',
'view_state',
);

// On ne loggue pas (spécifique à la PRODUCTION)
$g_log_level = LOG_NONE;

// Sécurité
$g_crypto_master_salt =

// Fonctionnement en intranet uniquement
$g_cdn_enabled = OFF;



// Configuration du serveur - #A1 : passage de MRB à RDS dans l'alias DNS
$g_cookie_time_length = 2592000; # Temps pour cookie permanent 2592000 secondes = 30 jours
$g_site_root =

// Catégorie par défaut lors d'un déplacement et pas de changement lors d'une note (22/03/2021)
$g_default_category_for_moves = 15;
$g_reassign_on_feedback = OFF;

// Configuration du mode de mail
$g_phpMailer_method='2';
$g_smtp_host='smtp.info.xxxx';

// Et configuration de l'antispam (100 mails maxi par heure)
$g_antispam_max_event_count = 100;
$g_antispam_time_window_in_seconds = 3600;

// On va d'ailleurs tracer les mails envoyés suite au bug tracé ici : viewtopic.php?t=5690 (RECETTE uniquement)
#$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
#$g_log_destination =

// Configuration des adresses email système - #A1 : passage à la boite DOSI/ITS pour le webmaster
$g_webmaster_email = '
$g_return_path_email = $g_webmaster_email;
$g_from_email='n
$g_from_name = 'Suivi d\'activité';

// Configuration des couleurs des statuts
$g_status_colors = array(
'new' => '#ef2929',
'feedback' => '#e3b7eb',
'acknowledged' => '#ffcd85',
'confirmed' => '#fff494',
'assigned' => '#c2dfff',
'resolved' => '#d2f5b0',
'closed' => '#c9ccc4');

// Configuration du langage et du format de la date
$g_default_language='french';
$g_short_date_format='d-m-Y';
$g_normal_date_format='d-m-Y H:i';
$g_complete_date_format='d-m-Y H:i';

/* En attendant la correction du bug https://www.mantisbt.org/bugs/view.php?id=22558 */
$g_datetime_picker_format='DD-MM-YYYY';


// Niveaux d'accès par défaut
$g_roadmap_view_threshold = ADMINISTRATOR;
$g_monitor_add_others_bug_threshold = REPORTER;
$g_view_changelog_threshold = ADMINISTRATOR;
$g_custom_field_link_threshold = ADMINISTRATOR; # Demande CLD du 12/12/2020


// On autorise l'enregistrement des filtres personnalisés
$g_stored_query_create_threshold = REPORTER;

// Permet d'afficher le nom réel et pas le login.
$g_show_realname = ON;

// champ priorité revu
$g_severity_enum_string = '90:text,100:feature,110:trivial,120:crash,130:block';

// Stockage des fichiers et pièces jointes
$g_allow_file_upload = ON;
$g_max_file_size = 6000000; // 6 MB
$g_file_upload_method = DISK;
$g_absolute_path_default_upload_folder = ';
$g_disallowed_files = 'php,php3,phtml,html,class,java,exe,sh,bat,cmd';
$g_html_make_links = LINKS_NEW_WINDOW; // Ouverture dans une autre fenêtre des liens HTML

// Délai souhaité
$g_due_date_update_threshold = REPORTER;
$g_due_date_view_threshold = REPORTER;

// Catégorie "[Tous les projets]MRB" par défaut en cas de déplacement
$g_default_category_for_moves = 90;

// Nouvel onglet au click aide en ligne




#############################
# Configuration du SSO xxxx#
#############################

//$g_login_method = HTTP_AUTH;

$g_reauthentication = OFF; // Pas de réauthentification pour l'Admin

$g_reauthentication_expiry = TOKEN_EXPIRY_AUTHENTICATED;


// Serveur LDAP xxxx, port par défaut 389
//$g_ldap_server = 'xxxx.infrawin.xxxx';
$g_ldap_protocol_version = 3; // 3 = Microsoft Active Directory
$g_ldap_network_timeout = 0;

// Chaînes de connexion AD et compte de service RDS
$g_ldap_follow_referrals = OFF;
$g_ldap_root_dn =
$g_ldap_bind_dn =
$g_ldap_bind_passwd =

/**
* The LDAP field for username
* Use 'sAMAccountName' for Active Directory
* @global string $g_ldap_uid_field
*/
$g_ldap_uid_field = 'cn';

/**
* The LDAP field for the user's real name (i.e. common name).
* @global string $g_ldap_realname_field
*/
$g_ldap_realname_field = 'sn';

/**
* Use the realname specified in LDAP (ON) rather than the one stored in the
* database (OFF).
* @global integer $g_use_ldap_realname
*/
$g_use_ldap_realname = OFF;

/**
* Use the email address specified in LDAP (ON) rather than the one stored
* in the database (OFF).
* @global integer $g_use_ldap_email
*/
$g_use_ldap_email = OFF;

/**
* This configuration option allows replacing the ldap server with a comma-
* delimited text file for development or testing purposes.
* The LDAP simulation file format is as follows:
* - One line per user
* - Each line has 4 comma-delimited fields
* - username,
* - realname,
* - e-mail,
* - password
* - Any extra fields are ignored
* On production systems, this option should be set to ''.
* @global integer $g_ldap_simulation_file_path
*/
$g_ldap_simulation_file_path = '';
?>

***************
END OF FILE
**************

Thanks a lot for your help
I don't see where it is the trouble.
Last edited by cath on 08 Nov 2024, 13:23, edited 1 time in total.
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Add monitor when the user create an issu

Post by cas »

Well you found the issue. Now find the settings around monitoring in the old config_inc.php and add thse to the new one.
Next you can test again.
cath
Posts: 8
Joined: 16 Dec 2019, 17:31

Re: Add monitor when the user create an issu

Post by cath »

Thank a lot, I will requet the updating and test it
after I tell you if it is working :)
cath
Posts: 8
Joined: 16 Dec 2019, 17:31

Re: Add monitor when the user create an issu

Post by cath »

It is working well :) thanks a lot.
Post Reply