Skip to content

Commit

Permalink
remove every instance of f_id, p_id, and c_id and replace them with m…
Browse files Browse the repository at this point in the history
…ore meaningful names

This will break old URLs, of course, but I think the tradeoff is worth it since we're changing so much in this release anyway.  It makes reading the code *so* much easier.  If anyone has huge complaints we can revert it - but speak up quickly! :)


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1581 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Julian Fitzell committed Oct 20, 2002
1 parent cc87f78 commit cdf9686
Show file tree
Hide file tree
Showing 56 changed files with 330 additions and 331 deletions.
4 changes: 2 additions & 2 deletions admin/css/view_inc.php
Expand Up @@ -42,7 +42,7 @@
<a href="">Logout</a>
</td>
<td class="right">
<input class="small" type="input" name="f_id" size="6"><input class="small" type="submit" value="Jump">
<input class="small" type="input" name="f_bug_id" size="6"><input class="small" type="submit" value="Jump">
</td>
</tr>
</table>
Expand Down Expand Up @@ -80,7 +80,7 @@
<a href="">Logout</a>
</div>
<div class="menu-right">
&nbsp;<input class="small" type="input" name="f_id" size="6"><input class="small" type="submit" value="Jump">
&nbsp;<input class="small" type="input" name="f_bug_id" size="6"><input class="small" type="submit" value="Jump">
</div>

<!-- News -->
Expand Down
16 changes: 8 additions & 8 deletions bug_assign.php
Expand Up @@ -10,26 +10,26 @@
# Copyright (C) 2001 Steve Davies - steved@ihug.co.nz

# --------------------------------------------------------
# $Revision: 1.22 $
# $Revision: 1.23 $
# $Author: jfitzell $
# $Date: 2002-09-21 10:17:13 $
# $Date: 2002-10-20 23:59:48 $
#
# $Id: bug_assign.php,v 1.22 2002-09-21 10:17:13 jfitzell Exp $
# $Id: bug_assign.php,v 1.23 2002-10-20 23:59:48 jfitzell Exp $
# --------------------------------------------------------

# Assign bug to user then redirect to viewing page
?>
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
$f_id = gpc_get_int( 'f_id' );
$f_bug_id = gpc_get_int( 'f_bug_id' );

project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( config_get( 'handle_bug_threshold' ) );

bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );

bug_assign( $f_id, auth_get_current_user_id() );
bug_assign( $f_bug_id, auth_get_current_user_id() );

print_header_redirect_view( $f_id );
print_header_redirect_view( $f_bug_id );
?>
12 changes: 6 additions & 6 deletions bug_close.php
Expand Up @@ -6,11 +6,11 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Revision: 1.24 $
# $Revision: 1.25 $
# $Author: jfitzell $
# $Date: 2002-08-30 08:36:50 $
# $Date: 2002-10-20 23:59:48 $
#
# $Id: bug_close.php,v 1.24 2002-08-30 08:36:50 jfitzell Exp $
# $Id: bug_close.php,v 1.25 2002-10-20 23:59:48 jfitzell Exp $
# --------------------------------------------------------
?>
<?php
Expand All @@ -20,14 +20,14 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_close_bug_threshold );
bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );

# check variables
check_varset( $f_bugnote_text, '' );

$result = bug_close( $f_id, $f_bugnote_text );
$result = bug_close( $f_bug_id, $f_bugnote_text );
if ( $result ) {
print_header_redirect( 'view_all_bug_page.php' );
} else {
Expand Down
6 changes: 3 additions & 3 deletions bug_close_page.php
Expand Up @@ -8,9 +8,9 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_close_bug_threshold );
bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
Expand All @@ -22,7 +22,7 @@
<table class="width75" cellspacing="1">
<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="f_id" value="<?php echo $f_id ?>" />
<input type="hidden" name="f_bug_id" value="<?php echo $f_bug_id ?>" />
<?php echo $s_close_bug_title ?>
</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions bug_delete.php
Expand Up @@ -11,11 +11,11 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_allow_bug_delete_access_level );
bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );

if ( bug_delete( $f_id ) ) {
if ( bug_delete( $f_bug_id ) ) {
print_header_redirect( 'view_all_bug_page.php' );
} else {
print_mantis_error( ERROR_GENERIC );
Expand Down
6 changes: 3 additions & 3 deletions bug_delete_page.php
Expand Up @@ -12,9 +12,9 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_allow_bug_delete_access_level );
bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
Expand All @@ -25,7 +25,7 @@
<?php echo $s_delete_bug_sure_msg ?>

<form method="post" action="bug_delete.php">
<input type="hidden" name="f_id" value="<?php echo $f_id ?>" />
<input type="hidden" name="f_bug_id" value="<?php echo $f_bug_id ?>" />
<input type="submit" value="<?php echo $s_delete_bug_button ?>" />
</form>

Expand Down
16 changes: 8 additions & 8 deletions bug_file_add.php
Expand Up @@ -11,10 +11,10 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( REPORTER );

$c_id = (integer)$f_id;
$c_bug_id = (integer)$f_bug_id;
$c_file_type = addslashes($f_file_type);

$result = 0;
Expand All @@ -39,7 +39,7 @@
$t_file_path = project_get_field( helper_get_current_project(), 'file_path' );

# prepare variables for insertion
$f_file_name = $f_id.'-'.$f_file_name;
$f_file_name = $f_bug_id.'-'.$f_file_name;
$t_file_size = filesize( $f_file );

switch ( $g_file_upload_method ) {
Expand All @@ -57,7 +57,7 @@
$query = "INSERT INTO $g_mantis_bug_file_table
(id, bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content)
VALUES
(null, $c_id, '', '', '$t_file_path$f_file_name', '$f_file_name', '$t_file_path', $t_file_size, '$c_file_type', NOW(), '')";
(null, $c_bug_id, '', '', '$t_file_path$f_file_name', '$f_file_name', '$t_file_path', $t_file_size, '$c_file_type', NOW(), '')";
} else {
print_mantis_error( ERROR_DUPLICATE_FILE );
}
Expand All @@ -67,20 +67,20 @@
$query = "INSERT INTO $g_mantis_bug_file_table
(id, bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content)
VALUES
(null, $c_id, '', '', '$t_file_path$f_file_name', '$f_file_name', '$t_file_path', $t_file_size, '$c_file_type', NOW(), '$t_content')";
(null, $c_bug_id, '', '', '$t_file_path$f_file_name', '$f_file_name', '$t_file_path', $t_file_size, '$c_file_type', NOW(), '$t_content')";
break;
}
$result = db_query( $query );

# updated the last_updated date
$result = bug_update_date( $f_id );
$result = bug_update_date( $f_bug_id );

# log new file
history_log_event_special( $f_id, FILE_ADDED, file_get_display_name( $f_file_name ) );
history_log_event_special( $f_bug_id, FILE_ADDED, file_get_display_name( $f_file_name ) );
}

# Determine which view page to redirect back to.
$t_redirect_url = string_get_bug_view_url( $f_id );
$t_redirect_url = string_get_bug_view_url( $f_bug_id );
if ( $result ) {
print_header_redirect( $t_redirect_url );
}
Expand Down
6 changes: 3 additions & 3 deletions bug_file_delete.php
Expand Up @@ -11,7 +11,7 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_handle_bug_threshold );

$c_file_id = (integer)$f_file_id;
Expand Down Expand Up @@ -43,10 +43,10 @@
$result = db_query( $query );

# log file deletion
history_log_event_special( $f_id, FILE_DELETED, file_get_display_name ( $t_file_name ) );
history_log_event_special( $f_bug_id, FILE_DELETED, file_get_display_name ( $t_file_name ) );

# Determine which view page to redirect back to.
$t_redirect_url = string_get_bug_view_url( $f_id );
$t_redirect_url = string_get_bug_view_url( $f_bug_id );
if ( $result ) {
print_header_redirect( $t_redirect_url );
} else {
Expand Down
2 changes: 1 addition & 1 deletion bug_file_upload_inc.php
Expand Up @@ -31,7 +31,7 @@
<?php echo "($s_max_file_size: " . number_format( $g_max_file_size/1000 ) . "k)"?>
</td>
<td width="85%">
<input type="hidden" name="f_id" value="<?php echo $f_id ?>" />
<input type="hidden" name="f_bug_id" value="<?php echo $f_bug_id ?>" />
<input type="hidden" name="max_file_size" value="<?php echo $g_max_file_size ?>" />
<input name="f_file" type="file" size="60" />
<input type="submit" value="<?php echo $s_upload_file_button ?>" />
Expand Down
26 changes: 13 additions & 13 deletions bug_monitor.php
Expand Up @@ -6,11 +6,11 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Revision: 1.14 $
# $Revision: 1.15 $
# $Author: jfitzell $
# $Date: 2002-09-21 10:17:13 $
# $Date: 2002-10-20 23:59:48 $
#
# $Id: bug_monitor.php,v 1.14 2002-09-21 10:17:13 jfitzell Exp $
# $Id: bug_monitor.php,v 1.15 2002-10-20 23:59:48 jfitzell Exp $
# --------------------------------------------------------
?>
<?php
Expand All @@ -20,10 +20,10 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
bug_ensure_exists( $f_id );
project_access_check( $f_bug_id );
bug_ensure_exists( $f_bug_id );

$t_view_state = bug_get_field( $f_id, 'view_state' );
$t_view_state = bug_get_field( $f_bug_id, 'view_state' );

$t_threshold = $g_monitor_bug_threshold;
if ( ( PRIVATE == $t_view_state ) && ( $g_private_bug_threshold > $t_threshold ) ) {
Expand All @@ -32,7 +32,7 @@

check_access( $t_threshold );

$c_id = (integer)$f_id;
$c_bug_id = (integer)$f_bug_id;

# get user information
$u_id = current_user_get_field( 'id' );
Expand All @@ -41,7 +41,7 @@
# Make sure we aren't already monitoring this bug
$query ="SELECT bug_id ".
"FROM $g_mantis_bug_monitor_table ".
"WHERE bug_id='$c_id' AND user_id='$u_id' ".
"WHERE bug_id='$c_bug_id' AND user_id='$u_id' ".
"LIMIT 1";
$result = db_query( $query );
$t_num_rows = db_num_rows( $result );
Expand All @@ -52,25 +52,25 @@
"INTO $g_mantis_bug_monitor_table ".
"( user_id, bug_id ) ".
"VALUES ".
"( '$u_id', '$c_id' )";
"( '$u_id', '$c_bug_id' )";
$result = db_query($query);

# log new monitoring action
history_log_event_special( $f_id, BUG_MONITOR, $u_id );
history_log_event_special( $f_bug_id, BUG_MONITOR, $u_id );
}
} elseif ( 'delete' == $f_action ) {
# Delete monitoring record
$query ="DELETE ".
"FROM $g_mantis_bug_monitor_table ".
"WHERE user_id = '$u_id' AND bug_id = '$c_id'";
"WHERE user_id = '$u_id' AND bug_id = '$c_bug_id'";
$result = db_query($query);

# log new un-monitor action
history_log_event_special( $f_id, BUG_UNMONITOR, $u_id );
history_log_event_special( $f_bug_id, BUG_UNMONITOR, $u_id );
}

# Determine which view page to redirect back to.
$t_redirect_url = string_get_bug_view_url( $f_id );
$t_redirect_url = string_get_bug_view_url( $f_bug_id );
if ( $result ) {
print_header_redirect( $t_redirect_url );
} else {
Expand Down
28 changes: 14 additions & 14 deletions bug_reopen.php
Expand Up @@ -6,11 +6,11 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Revision: 1.20 $
# $Revision: 1.21 $
# $Author: jfitzell $
# $Date: 2002-09-21 10:17:13 $
# $Date: 2002-10-20 23:59:48 $
#
# $Id: bug_reopen.php,v 1.20 2002-09-21 10:17:13 jfitzell Exp $
# $Id: bug_reopen.php,v 1.21 2002-10-20 23:59:48 jfitzell Exp $
# --------------------------------------------------------
?>
<?php
Expand All @@ -20,44 +20,44 @@
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
project_access_check( $f_id );
project_access_check( $f_bug_id );
check_access( $g_reopen_bug_threshold );
bug_ensure_exists( $f_id );
bug_ensure_exists( $f_bug_id );

#check variables
check_varset( $f_bugnote_text, '' );

#clean variables
$c_id = (integer)$f_id;
$c_bug_id = (integer)$f_bug_id;

$h_status = bug_get_field( $f_id, 'status' );
$h_resolution = bug_get_field( $f_id, 'resolution' );
$h_status = bug_get_field( $f_bug_id, 'status' );
$h_resolution = bug_get_field( $f_bug_id, 'resolution' );

# Update fields
$t_status_val = FEEDBACK;
$t_resolution = REOPENED;
$query = "UPDATE $g_mantis_bug_table
SET status='$t_status_val',
resolution='$t_resolution'
WHERE id='$c_id'";
WHERE id='$c_bug_id'";
$result = db_query($query);

# log changes
history_log_event( $f_id, 'status', $h_status );
history_log_event( $f_id, 'resolution', $h_resolution );
history_log_event( $f_bug_id, 'status', $h_status );
history_log_event( $f_bug_id, 'resolution', $h_resolution );

$f_bugnote_text = trim( $f_bugnote_text );
# check for blank bugnote
if ( !empty( $f_bugnote_text ) ) {
# insert bugnote text
$result = bugnote_add( $f_id, $f_bugnote_text );
$result = bugnote_add( $f_bug_id, $f_bugnote_text );

# notify reporter and handler
email_reopen( $f_id );
email_reopen( $f_bug_id );
}

# Determine which view page to redirect back to.
$t_redirect_url = string_get_bug_view_url( $f_id );
$t_redirect_url = string_get_bug_view_url( $f_bug_id );
if ( $result ) {
print_header_redirect( $t_redirect_url );
} else {
Expand Down

0 comments on commit cdf9686

Please sign in to comment.