Skip to content

Commit

Permalink
Removed get_project_name() function. Replaced with a more general get…
Browse files Browse the repository at this point in the history
…_project_field().

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@652 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Jan 16, 2002
1 parent eaf8365 commit fc95fbc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config_inc.php
Expand Up @@ -371,7 +371,7 @@

# --- limit reporters -------------
# Set to 1 if you wish to limit reporters to only viewing bugs that they report.
$g_limit_reporters = ON;
$g_limit_reporters = OFF;

# --- close immediately -----------
# Allow developers and above to close bugs immediately when resolving bugs
Expand Down
2 changes: 1 addition & 1 deletion core_email_API.php
Expand Up @@ -582,7 +582,7 @@ function get_bug_summary( $p_bug_id ) {
# we include the project name, bug id, and summary.
function email_build_subject( $p_bug_id ) {
# grab the project name
$p_project_name = get_project_name( get_bug_project_id( $p_bug_id ) );
$p_project_name = get_project_field( ( get_bug_project_id( $p_bug_id ) ), "name" );

# grab the subject (summary)
$p_subject = string_email( get_bug_summary( $p_bug_id ) );
Expand Down
6 changes: 3 additions & 3 deletions core_helper_API.php
Expand Up @@ -316,11 +316,11 @@ function get_bugnote_count( $p_id ) {
return db_result( $result, 0 );
}
# --------------------
# Returns the name of the project
function get_project_name( $p_project_id ) {
# Returns the specified field of the project
function get_project_field( $p_project_id, $p_field_name ) {
global $g_mantis_project_table;

$query = "SELECT name
$query = "SELECT $p_field_name
FROM $g_mantis_project_table
WHERE id='$p_project_id'";
$result = db_query( $query );
Expand Down
8 changes: 4 additions & 4 deletions core_html_API.php
Expand Up @@ -72,15 +72,15 @@ function print_title( $p_title ) {
$g_project_cookie_val;

if ( 1 == $g_show_project_in_title ) {
$t_project_name = get_project_name($g_project_cookie_val);
$t_project_name = get_project_field( $g_project_cookie_val, "name" );

if ( empty( $t_project_name ) ) {
PRINT "<title>$p_title</title>";
} else {
PRINT "<title>$p_title - $t_project_name</title>";
}
} else if ( 2 == $g_show_project_in_title ) {
$t_project_name = get_project_name($g_project_cookie_val);
$t_project_name = get_project_field( $g_project_cookie_val, "name" );

PRINT "<title>$t_project_name</title>";
} else {
Expand Down Expand Up @@ -125,14 +125,14 @@ function print_header( $p_title="Mantis" ) {

$t_title = "";
switch ( $g_show_project_in_title ) {
case 1: $t_project_name = get_project_name( $g_project_cookie_val );
case 1: $t_project_name = get_project_field( $g_project_cookie_val, "name" );
if ( empty( $t_project_name ) ) {
$t_title = $p_title;
} else {
$t_title = $p_title." - ".$t_project_name;
}
break;
case 2: $t_title = get_project_name( $g_project_cookie_val );
case 2: $t_title = get_project_field( $g_project_cookie_val, "name" );
break;
default:$t_title = $p_title;
break;
Expand Down
16 changes: 12 additions & 4 deletions core_user_API.php
Expand Up @@ -290,14 +290,22 @@ function check_access( $p_access_level ) {
function project_access_check( $p_bug_id, $p_project_id="0" ) {
global $g_logout_page, $g_mantis_project_user_list_table,
$g_mantis_project_table, $g_mantis_bug_table,
$g_login_select_proj_page,
$g_project_cookie_val;

project_check( $p_bug_id );

# access_level check
$t_project_id = get_bug_field( "project_id", $p_bug_id );
$t_user_id = get_current_user_field( "id" );
$t_project_user_access_level = get_project_access_level( $t_project_id );
if ( -1 != $t_project_user_access_level ) {
return;
$t_project_access_level = get_project_access_level( $t_project_id );
$t_access_level = get_current_user_field( "access_level" );
if ( -1 != $t_project_access_level ) {
if ( 0 ) {
print_header_redirect( $g_login_select_proj_page );
} else {
return;
}
} else {
return;
#print_header_redirect( $g_logout_page );
Expand Down Expand Up @@ -336,7 +344,7 @@ function get_project_access_level( $p_project_id=0 ) {
WHERE user_id='$t_user_id' AND project_id='$p_project_id'";
}
$result = db_query( $query );
if ( db_num_rows( $result )>0 ) {
if ( db_num_rows( $result ) > 0 ) {
return db_result( $result, 0, 0 );
} else {
return -1;
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -37,6 +37,7 @@ Mantis
* Removed menu_inc.php file and related variable. Moved this into print_menu().
* Removed print_mantis_version(). Moved it into print_foooter().
* Removed some unused code.
* Removed get_project_name() function. Replaced with a more general get_project_field().
* Renamed g_store_file_to to g_file_upload_method.
* Renamed files to .php
* Removed admin_cookiecheck.php3
Expand Down

0 comments on commit fc95fbc

Please sign in to comment.