Skip to content

Commit

Permalink
tidied up and put in a stop gap solution for bugnote addition preserv…
Browse files Browse the repository at this point in the history
…ing consistency

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@30 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Dec 6, 2000
1 parent b6a88fc commit 08c8504
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions bug_vote_add.php3
Expand Up @@ -9,6 +9,7 @@
<?
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

### increase vote count and update in table
$f_vote++;
$query = "UPDATE $g_mantis_bug_table
SET votes=$f_vote
Expand Down
4 changes: 4 additions & 0 deletions bugnote_add.php3
Expand Up @@ -28,8 +28,12 @@
$result = mysql_query( $query );

### retrieve bugnote text id number
### NOTE: this is not 100% gurrantted to be the correct one.
### It will be 99.9% of them time but it is not guarrnteed.
### Looking for an elegant workaround w/o having to edit tables
$query = "SELECT id
FROM $g_mantis_bugnote_text_table
WHERE note='$f_bugnote_text'
ORDER BY id DESC
LIMIT 1";
$result = mysql_query( $query );
Expand Down
1 change: 1 addition & 0 deletions bugnote_delete.php3
Expand Up @@ -9,6 +9,7 @@
<?
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

### Remove the bugnote
$query = "DELETE
FROM $g_mantis_bugnote_table
WHERE id='$f_bug_id'";
Expand Down
25 changes: 12 additions & 13 deletions bugnote_inc.php
Expand Up @@ -7,12 +7,7 @@
<?
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

$query = "SELECT access_level
FROM $g_mantis_user_table
WHERE cookie_string='$g_string_cookie_val'";
$result = db_mysql_query($query);
$t_access_level = mysql_result( $result, 0 );

### get the bugnote data
$query = "SELECT *
FROM $g_mantis_bugnote_table
WHERE bug_id='$f_id'";
Expand Down Expand Up @@ -42,16 +37,19 @@
</tr>
<?
for($i=0; $i < $num_notes; $i++) {
### prefix all bugnote data with v3_
$row = mysql_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, "v3" );
$v3_date_submitted = date( "m-d H:i", sql_to_unix_time( $v3_date_submitted ) );

### grab the bugnote text and prefix with v3_
$query = "SELECT note
FROM $g_mantis_bugnote_text_table
WHERE id='$v3_bugnote_text_id'";
$result2 = db_mysql_query($query);
$v4_note = mysql_result( $result2, 0);
$v3_note = mysql_result( $result2, 0);

### grab the bugnote posters username and email and prefix with v5_
$query = "SELECT username, email
FROM $g_mantis_user_table
WHERE id='$v3_reporter_id'";
Expand All @@ -76,7 +74,10 @@
<? echo $v3_date_submitted ?>
</td>
<td bgcolor=<? echo $g_primary_color_dark ?>>
<? if ( $t_access_level!="viewer" ) { ?>
<?
### check access level
if ( access_level_check_greater( "reporter" ) ) {
?>
<font size=1><a href="<? echo $g_bugnote_delete ?>?f_id=<? echo $f_id ?>&f_bug_id=<? echo $v3_id ?>">Delete</a></font>
<? } ?>
</td>
Expand All @@ -87,7 +88,7 @@
<table width=100% align=center>
<tr>
<td bgcolor=<? echo $g_primary_color_dark ?>>
<? echo string_unsafe( $v4_note ) ?>
<? echo string_unsafe( $v3_note ) ?>
</td>
</tr>
</table>
Expand All @@ -96,10 +97,8 @@
<?
}
}
if ( ( $u_access_level=="administrator" ) ||
( $u_access_level=="developer" ) ||
( $u_access_level=="updater" ) ||
( $u_access_level=="reporter" ) ) {
### check access level
if ( access_level_check_greater( "reporter" ) ) {
?>
<tr>
<form method=post action="<? echo $g_bugnote_add_page ?>">
Expand Down
4 changes: 1 addition & 3 deletions report_add.php3
Expand Up @@ -130,9 +130,7 @@
}
### OK!!!
else {
PRINT "Thank you for your submission.";
PRINT "<p>";
PRINT "You are now being transported to the Bug Viewing Page in 3 seconds ... <p>";
PRINT "Thank you for your submission.<p>";
}
?>
<p>
Expand Down

0 comments on commit 08c8504

Please sign in to comment.