View Issue Details

IDProjectCategoryView StatusLast Update
0010695mantisbtcustomizationpublic2019-09-25 19:08
Reportermantistestor Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Summary0010695: new Status on summary_page.php
Description

I would have the Column for "confirmed" in the summary. I have a littlebit modified Summarypage. With try and error i dont get the results. please can someone help?. thx

Steps To Reproduce

<?php

Mantis - a php based bugtracking system

Mantis 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.

#

Mantis 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 Mantis. If not, see <http://www.gnu.org/licenses/>.

/**
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
 * @copyright Copyright (C) 2002 - 2009  Mantis Team   - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
 /**
  * Mantis Core API's
  */
require_once( 'core.php' );

$t_core_path = config_get( 'core_path' );

require_once( $t_core_path.'summary_api.php' );

access_ensure_project_level( config_get( 'view_summary_threshold' ) );

$f_project_id = gpc_get_int( 'project_id', helper_get_current_project() );

# Override the current page to make sure we get the appropriate project-specific configuration
$g_project_override = $f_project_id;

$t_user_id = auth_get_current_user_id();

# @@@ giallu: this block of code is duplicated from helper_project_specific_where
# the only diff is the commented line below: can we do better than this ?
if ( ALL_PROJECTS == $f_project_id ) {
    $t_topprojects = $t_project_ids = user_get_accessible_projects( $t_user_id );
    foreach ( $t_topprojects as $t_project ) {
        $t_project_ids = array_merge( $t_project_ids, user_get_all_accessible_subprojects( $t_user_id, $t_project ) );
    }

    $t_project_ids = array_unique( $t_project_ids );
} else {
    # access_ensure_project_level( VIEWER, $p_project_id );
    $t_project_ids = user_get_all_accessible_subprojects( $t_user_id, $f_project_id );
    array_unshift( $t_project_ids, $f_project_id );
}

$t_project_ids = array_map( 'db_prepare_int', $t_project_ids );

if ( 0 == count( $t_project_ids ) ) {
    $specific_where = ' 1 &lt;> 1';
} elseif ( 1 == count( $t_project_ids ) ) {
    $specific_where = ' project_id=' . $t_project_ids[0];
} else {
    $specific_where = ' project_id IN (' . join( ',', $t_project_ids ) . ')';
}
# end @@@ block

$t_bug_table = db_get_table( 'mantis_bug_table' );
$t_history_table = db_get_table( 'mantis_bug_history_table' );

$t_resolved = config_get( 'bug_resolved_status_threshold' );
# the issue may have passed through the status we consider resolved
#  (e.g., bug is CLOSED, not RESOLVED). The linkage to the history field
#  will look up the most recent 'resolved' status change and return it as well
$query = &quot;SELECT b.id, b.date_submitted, b.last_updated, MAX(h.date_modified) as hist_update, b.status 
    FROM $t_bug_table b LEFT JOIN $t_history_table h 
        ON b.id = h.bug_id  AND h.type=0 AND h.field_name='status' AND h.new_value='$t_resolved'  
        WHERE b.status >='$t_resolved' AND $specific_where
        GROUP BY b.id, b.status, b.date_submitted, b.last_updated 
        ORDER BY b.id ASC&quot;;
$result = db_query( $query );
$bug_count = db_num_rows( $result );

$t_bug_id       = 0;
$t_largest_diff = 0;
$t_total_time   = 0;
for ($i=0;$i&lt;$bug_count;$i++) {
    $row = db_fetch_array( $result );
    $t_date_submitted = db_unixtimestamp( $row['date_submitted'] );     
    $t_id = $row['id'];
    $t_status = $row['status'];
    if ( $row['hist_update'] !== NULL ) {
        $t_last_updated   = db_unixtimestamp( $row['hist_update'] );
    } else {
        $t_last_updated   = db_unixtimestamp( $row['last_updated'] );
    }

    if ($t_last_updated &lt; $t_date_submitted) {
        $t_last_updated   = 0;
        $t_date_submitted = 0;
    }

    $t_diff = $t_last_updated - $t_date_submitted;
    $t_total_time = $t_total_time + $t_diff;
    if ( $t_diff > $t_largest_diff ) {
        $t_largest_diff = $t_diff;
        $t_bug_id = $row['id'];
    }
}
if ( $bug_count &lt; 1 ) {
    $bug_count = 1;
}
$t_average_time     = $t_total_time / $bug_count;

$t_largest_diff     = number_format( $t_largest_diff / 86400, 2 );
$t_total_time       = number_format( $t_total_time / 86400, 2 );
$t_average_time     = number_format( $t_average_time / 86400, 2 );

$t_orct_arr = preg_split( '/[\)\/\(]/', lang_get( 'orct' ), -1, PREG_SPLIT_NO_EMPTY );

$t_orcttab = &quot;&quot;;
foreach ( $t_orct_arr as $t_orct_s ) {
    $t_orcttab .= '&lt;td class=&quot;right&quot;>';
    $t_orcttab .= $t_orct_s;
    $t_orcttab .= '&lt;/td>';
}

?>
<?php html_page_top1( lang_get( 'summary_link' ) ) ?>
<?php html_page_top2() ?>
<br />
<table class="width100" cellspacing="1">
<tr valign="top">
<td width="50%">

<?php # DEVELOPER # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'developer_stats' ) ?>
</td>
<?php echo $t_orcttab ?>
</tr>
<?php summary_print_by_developer() ?>
</td>
</table>

<td width="50%">

    &lt;?php # REPORTER # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>

<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'reporter_stats' ) ?>
</td>
<?php echo $t_orcttab ?>
</tr>
<?php summary_print_by_reporter() ?>
</table>
</tr>
</table>

<!-- ***
<br />
<?php print_summary_menu( 'summary_page.php' ) ?>

<?php print_menu_graph() ?>
<br />
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<?php echo lang_get( 'summary_title' ) ?>
</td>
</tr>

-->

<br />
<br />
<br />
<br />
<br />
<br />
Detailinformationen:
<p />
<table class="width100" cellspacing="1">
<tr valign="top">
<td width="50%">
<?php # PROJECT # ?>
<?php if ( 1 < count( $t_project_ids ) ) { ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'by_project' ) ?>
</td>
<?php echo $t_orcttab ?>
</tr>
<?php summary_print_by_project(); ?>
</table>

    <br />
    &lt;?php } ?>

    &lt;?php # STATUS # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;1&quot;>
            &lt;?php echo lang_get( 'by_status' ) ?>
        &lt;/td>
        &lt;?php echo $t_orcttab ?>
    &lt;/tr>
    &lt;?php summary_print_by_enum( config_get( 'status_enum_string' ), 'status' ) ?>
    &lt;/table>

    <br />

    &lt;?php # SEVERITY # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;1&quot;>
            &lt;?php echo lang_get( 'by_severity' ) ?>
        &lt;/td>
        &lt;?php echo $t_orcttab ?>
    &lt;/tr>
    &lt;?php summary_print_by_enum( config_get( 'severity_enum_string' ), 'severity' ) ?>
    &lt;/table>

    <br />

    &lt;?php # CATEGORY # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;1&quot;>
            &lt;?php echo lang_get( 'by_category' ) ?>
        &lt;/td>
        &lt;?php echo $t_orcttab ?>
    &lt;/tr>
    &lt;?php summary_print_by_category() ?>
    &lt;/table>

    <br />

    &lt;?php # MISCELLANEOUS # ?>
    &lt;table class=&quot;width100&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;5&quot;>
            &lt;?php echo lang_get( 'time_stats' ) ?>
        &lt;/td>
    &lt;/tr>
    &lt;tr class=&quot;row-1&quot;>
        &lt;td width=&quot;50%&quot;>
            &lt;?php echo lang_get( 'longest_open_bug' ) ?>
        &lt;/td>
        &lt;td width=&quot;50%&quot;>
            &lt;?php
                if ($t_bug_id>0) {
                    print_bug_link( $t_bug_id );
                }
            ?>
        &lt;/td>
    &lt;/tr>
    &lt;tr class=&quot;row-2&quot;>
        &lt;td>
            &lt;?php echo lang_get( 'longest_open' ) ?>
        &lt;/td>
        &lt;td>
            &lt;?php echo $t_largest_diff ?>
        &lt;/td>
    &lt;/tr>
    &lt;tr class=&quot;row-1&quot;>
        &lt;td>
            &lt;?php echo lang_get( 'average_time' ) ?>
        &lt;/td>
        &lt;td>
            &lt;?php echo $t_average_time ?>
        &lt;/td>
    &lt;/tr>
    &lt;tr class=&quot;row-2&quot;>
        &lt;td>
            &lt;?php echo lang_get( 'total_time' ) ?>
        &lt;/td>
        &lt;td>
            &lt;?php echo $t_total_time ?>
        &lt;/td>
    &lt;/tr>
    &lt;/table>

    <br />

<!-- ***
<?php # DEVELOPER # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'developer_stats' ) ?>
</td>
<?php echo $t_orcttab ?>
</tr>
<?php summary_print_by_developer() ?>
</table>
</td>

-->

&lt;td width=&quot;50%&quot;>
    &lt;?php # DATE # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot;>&lt;?php echo lang_get( 'by_date' ); ?>&lt;/td>
        &lt;td class=&quot;right&quot;>&lt;?php echo lang_get( 'legend_opened' ); ?>&lt;/td>
        &lt;td class=&quot;right&quot;>&lt;?php echo lang_get( 'legend_resolved' ); ?>&lt;/td>
        &lt;td class=&quot;right&quot;>&lt;?php echo lang_get( 'balance' ); ?>&lt;/td>
    &lt;/tr>
    &lt;?php summary_print_by_date( config_get( 'date_partitions' ) ) ?>
    &lt;/table>

    <br />

    &lt;?php # ACTIVITY # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; width=&quot;86%&quot;>&lt;?php echo lang_get( 'most_active' ); ?>&lt;/td>
        &lt;td class=&quot;right&quot; width=&quot;14%&quot;>&lt;?php echo lang_get( 'score' ); ?>&lt;/td>
    &lt;/tr>
    &lt;?php summary_print_by_activity() ?>
    &lt;/table>

    <br />

    &lt;?php # LONGEST OPEN # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; width=&quot;86%&quot;>&lt;?php echo lang_get( 'longest_open' ); ?>&lt;/td>
        &lt;td class=&quot;right&quot; width=&quot;14%&quot;>&lt;?php echo lang_get( 'days' ); ?>&lt;/td>
    &lt;/tr>
    &lt;?php summary_print_by_age() ?>
    &lt;/table>

    <br />

    &lt;?php # RESOLUTION # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;1&quot;>
            &lt;?php echo lang_get( 'by_resolution' ) ?>
        &lt;/td>
        &lt;?php echo $t_orcttab ?>
    &lt;/tr>
    &lt;?php summary_print_by_enum( config_get( 'resolution_enum_string' ), 'resolution' ) ?>
    &lt;/table>

    <br />

    &lt;?php # PRIORITY # ?>
    &lt;table class=&quot;width100&quot; cellspacing=&quot;1&quot;>
    &lt;tr>
        &lt;td class=&quot;form-title&quot; colspan=&quot;1&quot;>
            &lt;?php echo lang_get( 'by_priority' ) ?>
        &lt;/td>
        &lt;?php echo $t_orcttab ?>
    &lt;/tr>
    &lt;?php summary_print_by_enum( config_get( 'priority_enum_string' ), 'priority' ) ?>
    &lt;/table>

    <br />

<!-- ***
<?php # REPORTER # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'reporter_stats' ) ?>
</td>
<?php echo $t_orcttab ?>
</tr>
<?php summary_print_by_reporter() ?>
</table>

    <br />

-->
<?php # REPORTER EFFECTIVENESS # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'reporter_effectiveness' ) ?>
</td>
<td>
<?php echo lang_get( 'severity' ) ?>
</td>
<td>
<?php echo lang_get( 'errors' ) ?>
</td>
<td>
<?php echo lang_get( 'total' ) ?>
</td>
</tr>
<?php summary_print_reporter_effectiveness( config_get( 'severity_enum_string' ), config_get( 'resolution_enum_string' ) ) ?>
</table>
</td>
<!-- </tr> -->

<tr valign="top">
<td colspan="2">
<?php # REPORTER / RESOLUTION # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'reporter_by_resolution' ) ?>
</td>
<?php
$t_resolutions = MantisEnum::getValues( config_get( 'resolution_enum_string' ) );

        foreach ( $t_resolutions as $t_resolution ) {
            echo '&lt;td>', get_enum_element( 'resolution', $t_resolution ), '&lt;/td>';
        }

        echo '&lt;td>', lang_get( 'percentage_errors' ), '&lt;/td>';
        ?>
    &lt;/tr>
    &lt;?php summary_print_reporter_resolution( config_get( 'resolution_enum_string' ) ) ?>
    &lt;/table>
&lt;/td>

</tr>

<tr valign="top">
<td colspan="2">
<?php # DEVELOPER / RESOLUTION # ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title" colspan="1">
<?php echo lang_get( 'developer_by_resolution' ) ?>
</td>
<?php
$t_resolutions = MantisEnum::getValues( config_get( 'resolution_enum_string' ) );

        foreach ( $t_resolutions as $t_resolution ) {
            echo '&lt;td>', get_enum_element( 'resolution', $t_resolution ), '&lt;/td>';
        }

        echo '&lt;td>', lang_get( 'percentage_fixed' ), '&lt;/td>';
        ?>
    &lt;/tr>
    &lt;?php summary_print_developer_resolution( config_get( 'resolution_enum_string' ) ) ?>
    &lt;/table>
&lt;/td>

</tr>
</table>

<?php html_page_bottom1( FILE ) ?>

TagsNo tags attached.

Activities

mantistestor

mantistestor

2009-07-07 10:46

reporter  

07.07.png (5,308 bytes)   
07.07.png (5,308 bytes)   
dhx

dhx

2009-07-09 08:17

reporter   ~0022462

Are you using Mantis 1.2.0rc1 or more recent? If not, please upgrade, as it should be fixed in 1.2.x :)

mantistestor

mantistestor

2009-07-10 04:05

reporter   ~0022471

Mantis 1.2.0a3, i think it is not really a failure. i would have in the summarypage; "Developer Stats" and "Reporter Stats"
all of the status; feedback, acknowledged, confirmed, assigned, resolved, closed

mantistestor

mantistestor

2010-09-30 04:03

reporter   ~0026919

In Mantis mantisbt-1.2.3 this Issue it is not fixed.

dregad

dregad

2019-09-13 18:16

developer   ~0062797

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue.

[1] http://www.mantisbt.org/download.php

Issue History

Date Modified Username Field Change
2009-07-07 10:30 mantistestor New Issue
2009-07-07 10:46 mantistestor File Added: 07.07.png
2009-07-09 08:17 dhx Note Added: 0022462
2009-07-10 04:05 mantistestor Note Added: 0022471
2010-09-30 04:03 mantistestor Note Added: 0026919
2019-09-13 18:16 dregad Assigned To => dregad
2019-09-13 18:16 dregad Status new => resolved
2019-09-13 18:16 dregad Resolution open => no change required
2019-09-13 18:16 dregad Note Added: 0062797
2019-09-25 19:08 atrol Status resolved => closed