Add monitor when the user create an issu
Posted: 31 Oct 2024, 12:21
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.
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.