Skip to content

Commit

Permalink
0004737: [bugtracker] Summary page gives #401 error when no projects …
Browse files Browse the repository at this point in the history
…have been created.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@3067 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
narcissus committed Oct 20, 2004
1 parent 373272d commit 975f802
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 12 deletions.
56 changes: 46 additions & 10 deletions core/summary_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: summary_api.php,v 1.32 2004-09-23 18:19:37 bpfennigschmidt Exp $
# $Id: summary_api.php,v 1.33 2004-10-20 01:11:01 narcissus Exp $
# --------------------------------------------------------

### Summary printing API ###
Expand Down Expand Up @@ -39,7 +39,11 @@ function summary_print_by_enum( $p_enum_string, $p_enum ) {
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$t_project_filter = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$t_project_filter = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$t_project_filter = '1=1';
}
} else {
$t_project_filter = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -170,7 +174,11 @@ function summary_bug_count_by_date( $p_time_length=1 ) {
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -213,7 +221,11 @@ function summary_print_by_developer() {
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -308,7 +320,11 @@ function summary_print_by_reporter() {
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -386,7 +402,11 @@ function summary_print_by_category() {
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -510,7 +530,11 @@ function summary_print_by_project() {

# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}

$query = "SELECT project_id, status
FROM $t_mantis_bug_table
Expand Down Expand Up @@ -592,7 +616,11 @@ function summary_print_developer_resolution( $p_resolution_enum_string ) {
if ( 0 == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -701,7 +729,11 @@ function summary_print_reporter_resolution( $p_resolution_enum_string ) {
if ( 0 == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down Expand Up @@ -839,7 +871,11 @@ function summary_print_reporter_effectiveness( $p_severity_enum_string, $p_resol
if ( 0 == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down
8 changes: 6 additions & 2 deletions summary_page.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: summary_page.php,v 1.41 2004-09-23 18:19:11 bpfennigschmidt Exp $
# $Id: summary_page.php,v 1.42 2004-10-20 01:11:02 narcissus Exp $
# --------------------------------------------------------
?>
<?php
Expand All @@ -26,7 +26,11 @@
if ( ALL_PROJECTS == $t_project_id ) {
# Only projects to which the user have access
$t_accessible_projects_array = user_get_accessible_projects( $t_user_id );
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
if ( count( $t_accessible_projects_array ) > 0 ) {
$specific_where = ' (project_id='. implode( ' OR project_id=', $t_accessible_projects_array ).')';
} else {
$specific_where = '1=1';
}
} else {
$specific_where = " project_id='$t_project_id'";
}
Expand Down

0 comments on commit 975f802

Please sign in to comment.