diff -Naur mantis_orig/mantisbt/admin/schema.php mantis_rd/mantisbt/admin/schema.php
--- mantis_orig/mantisbt/admin/schema.php	2008-02-29 09:38:16.000000000 +0100
+++ mantis_rd/mantisbt/admin/schema.php	2008-02-27 18:17:17.000000000 +0100
@@ -399,4 +399,8 @@
 $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_project_table' ), "inherit_global I UNSIGNED NOTNULL DEFAULT '0'" ) );
 $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_project_hierarchy_table' ), "inherit_parent I UNSIGNED NOTNULL DEFAULT '0'" ) );
 
+$upgrade[] = Array( 'AddColumnSQL', Array( db_get_Table( 'mantis_bug_file_table' ), "
+	user_id			I UNSIGNED NOTNULL DEFAULT '0',
+	patch			I NOTNULL DEFAULT '0',
+	obsolete		I NOTNULL DEFAULT '0'") );
 ?>
diff -Naur mantis_orig/mantisbt/bug_file_add.php mantis_rd/mantisbt/bug_file_add.php
--- mantis_orig/mantisbt/bug_file_add.php	2008-02-29 09:38:30.000000000 +0100
+++ mantis_rd/mantisbt/bug_file_add.php	2008-02-28 14:49:55.000000000 +0100
@@ -34,6 +34,13 @@
 <?php
 	$f_bug_id	= gpc_get_int( 'bug_id', -1 );
 	$f_file		= gpc_get_file( 'file', -1 );
+	$f_action = gpc_get_int( 'action', -1 );
+	$f_field = gpc_get_string( 'field', '');
+	$f_file_id = gpc_get_int( 'file_id', -1 );
+	$f_description = gpc_get( 'description', '' );
+	$f_patch = gpc_get_int( 'patch', 0 );
+	$f_obsolete = gpc_get_int( 'obsolete', 0 );
+	
 
 	if ( $f_bug_id == -1 && $f_file	== -1 ) {
 		# _POST/_FILES does not seem to get populated if you exceed size limit so check if bug_id is -1
@@ -46,16 +53,19 @@
 
 	access_ensure_bug_level( config_get( 'upload_bug_file_threshold' ), $f_bug_id );
 
-	$t_bug = bug_get( $f_bug_id, true );
-	if( $t_bug->project_id != helper_get_current_project() ) {
-		# in case the current project is not the same project of the bug we are viewing...
-		# ... override the current project. This to avoid problems with categories and handlers lists etc.
-		$g_project_override = $t_bug->project_id;
+	if ( $f_action == -1 || $f_file_id == -1 ) {
+		$t_bug = bug_get( $f_bug_id, true );
+		if( $t_bug->project_id != helper_get_current_project() ) {
+			# in case the current project is not the same project of the bug we are viewing...
+			# ... override the current project. This to avoid problems with categories and handlers lists etc.
+			$g_project_override = $t_bug->project_id;
+		}
+	
+		$f_file_error =  ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0;
+		file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error, '', $f_description, $f_patch, $f_obsolete );
+	} else {
+		file_mark( $f_file_id, $f_field, $f_action, $f_bug_id );
 	}
-
-    $f_file_error =  ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0;
-	file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error );
-
 	# Determine which view page to redirect back to.
 	$t_redirect_url = string_get_bug_view_url( $f_bug_id );
 
diff -Naur mantis_orig/mantisbt/bug_file_upload_inc.php mantis_rd/mantisbt/bug_file_upload_inc.php
--- mantis_orig/mantisbt/bug_file_upload_inc.php	2008-02-29 09:38:30.000000000 +0100
+++ mantis_rd/mantisbt/bug_file_upload_inc.php	2008-02-28 14:49:58.000000000 +0100
@@ -49,6 +49,26 @@
 		echo lang_get( 'upload_file' ) ?>
 	</td>
 </tr>
+
+<!-- Attachments -->
+<?php
+	$t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id );
+
+	if ( $t_show_attachments ) {
+?>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<a name="attachments" id="attachments" />
+		<?php echo lang_get( 'attached_files' ) ?>
+	</td>
+	<td colspan="5">
+		<?php print_bug_attachments_list( $f_bug_id ); ?>
+	</td>
+</tr>
+<?php
+	}
+?>
+
 <tr class="row-1">
 	<td class="category" width="15%">
 		<?php echo lang_get( 'select_file' ) ?><br />
@@ -61,6 +81,22 @@
 		<input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' ) ?>" />
 	</td>
 </tr>
+<tr class="row-2">
+	<td class="category" width="15%">
+		<?php echo lang_get( 'file_comment' ) ?>
+	</td>
+	<td with="85%">
+		<input type="text" name="description" size="80" />
+	</td>
+</tr>
+<tr class="row-1">
+	<td class="category"> 
+		<?php echo lang_get( 'file_remarks' ) ?>
+	</td>
+	<td with="85%">
+		<input type="checkbox" name="patch" value="1" ><?php echo lang_get( 'file_patch' ) ?></input>
+	</td>
+</tr>
 </table>
 </form>
 <?php
diff -Naur mantis_orig/mantisbt/bug_view_advanced_page.php mantis_rd/mantisbt/bug_view_advanced_page.php
--- mantis_orig/mantisbt/bug_view_advanced_page.php	2008-02-29 09:38:30.000000000 +0100
+++ mantis_rd/mantisbt/bug_view_advanced_page.php	2008-02-29 09:24:47.000000000 +0100
@@ -538,7 +538,7 @@
 <?php } # custom fields found ?>
 
 
-<!-- Attachments -->
+<!-- Attachments 
 <?php
 	$t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id );
 
@@ -556,7 +556,7 @@
 <?php
 	}
 ?>
-
+-->
 <!-- Buttons -->
 <tr align="center">
 	<td align="center" colspan="6">
diff -Naur mantis_orig/mantisbt/bug_view_page.php mantis_rd/mantisbt/bug_view_page.php
--- mantis_orig/mantisbt/bug_view_page.php	2008-02-29 09:38:30.000000000 +0100
+++ mantis_rd/mantisbt/bug_view_page.php	2008-02-29 09:23:54.000000000 +0100
@@ -414,7 +414,7 @@
 <?php } # custom fields found ?>
 
 
-<!-- Attachments -->
+<!-- Attachments
 <?php
 	$t_show_attachments = ( $t_bug->reporter_id == auth_get_current_user_id() ) || access_has_bug_level( config_get( 'view_attachments_threshold' ), $f_bug_id );
 
@@ -432,7 +432,7 @@
 <?php
 	}
 ?>
-
+-->
 <!-- Buttons -->
 <tr align="center">
 	<td align="center" colspan="6">
diff -Naur mantis_orig/mantisbt/config_defaults_inc.php mantis_rd/mantisbt/config_defaults_inc.php
--- mantis_orig/mantisbt/config_defaults_inc.php	2008-02-29 09:38:30.000000000 +0100
+++ mantis_rd/mantisbt/config_defaults_inc.php	2008-02-27 12:58:58.000000000 +0100
@@ -18,7 +18,7 @@
 # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
 
 	# --------------------------------------------------------
-	# $Id: config_defaults_inc.php 5056 2008-02-26 04:17:30Z vboctor $
+	# $Id: config_defaults_inc.php 5052 2008-02-25 08:06:15Z vboctor $
 	# --------------------------------------------------------
 
 
@@ -873,6 +873,15 @@
 
 	# absolute path to the default upload folder.  Requires trailing / or \
 	$g_absolute_path_default_upload_folder = '';
+	
+	
+	# access level needed to mark file obsolete
+	# reporter can always mark file as an obsolete (aka request for remove)
+	$g_allow_mark_obsolete_threshold = DEVELOPER;
+	
+	# access level needed to mark file patch
+	# reporter can always mark file as a patch
+	$g_allow_mark_patch_threshold = DEVELOPER;
 
diff -Naur mantis_orig/mantisbt/core/bug_api.php mantis_rd/mantisbt/core/bug_api.php
--- mantis_orig/mantisbt/core/bug_api.php	2008-02-29 09:38:28.000000000 +0100
+++ mantis_rd/mantisbt/core/bug_api.php	2008-02-28 14:55:58.000000000 +0100
@@ -662,7 +662,7 @@
 				}
 
 				$query = "INSERT INTO $t_mantis_bug_file_table
-						( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content )
+						( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, patch, obsolete, user_id )
 						VALUES ( " . db_param(0) . ",
 								 " . db_param(1) . ",
 								 " . db_param(2) . ",
@@ -672,8 +672,11 @@
 								 " . db_param(6) . ",
 								 " . db_param(7) . ",
 								 " . db_param(8) . ",
-								 " . db_param(9) . ");";
-				db_query_bound( $query, Array( $t_new_bug_id, $t_bug_file['title'], $t_bug_file['description'], $t_new_diskfile_name, $t_new_file_name, $t_bug_file['folder'], $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'], $t_bug_file['content'] ) );
+								 " . db_param(9) . ",
+								 " . db_param(10) . ",
+								 " . db_param(11) . ",
+								 " . db_param(12) . ");";
+				db_query_bound( $query, Array( $t_new_bug_id, $t_bug_file['title'], $t_bug_file['description'], $t_new_diskfile_name, $t_new_file_name, $t_bug_file['folder'], $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'], $t_bug_file['content'], $t_bug_file['patch'], $t_bug_file['obsolete'], $t_bug_file['user_id'] ) );
 			}
 		}
 
@@ -1165,7 +1168,7 @@
 
 		$t_bug_file_table = db_get_table( 'mantis_bug_file_table' );
 
-		$query = "SELECT id, title, diskfile, filename, filesize, file_type, date_added
+		$query = "SELECT id, title, diskfile, filename, filesize, file_type, date_added, patch, obsolete, user_id, description
 		                FROM $t_bug_file_table
 		                WHERE bug_id=" . db_param(0) . "
 		                ORDER BY date_added";
diff -Naur mantis_orig/mantisbt/core/file_api.php mantis_rd/mantisbt/core/file_api.php
--- mantis_orig/mantisbt/core/file_api.php	2008-02-29 09:38:28.000000000 +0100
+++ mantis_rd/mantisbt/core/file_api.php	2008-02-29 09:09:45.000000000 +0100
@@ -18,13 +18,14 @@
 # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
 
 	# --------------------------------------------------------
-	# $Id: file_api.php 5065 2008-02-28 21:25:08Z prichards $
+	# $Id: file_api.php 4979 2008-02-09 23:20:59Z vboctor $
 	# --------------------------------------------------------
 
 	$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
 
 	require_once( $t_core_dir . 'history_api.php' );
 	require_once( $t_core_dir . 'bug_api.php' );
+	require_once( $t_core_dir . 'authentication_api.php' );
 
 	$g_cache_file_count = array();
 
@@ -77,7 +78,7 @@
 		$query = "SELECT bug_id, COUNT(bug_id) AS attachments
 				FROM $t_bug_file_table
 				GROUP BY bug_id";
-		$result = db_query_bound( $query );
+		$result = db_query( $query );
 
 		$t_file_count = 0;
 		while( $row = db_fetch_array( $result )) {
@@ -129,15 +130,24 @@
 
 	# --------------------
 	# Check if the current user can delete attachments from the specified bug.
-	function file_can_delete_bug_attachments( $p_bug_id ) {
+	function file_can_delete_bug_attachments( $p_bug_id, $p_file_id = 0 ) {
 		if ( bug_is_readonly( $p_bug_id ) ) {
 			return false;
 		}
 
 		$t_reported_by_me	= bug_is_user_reporter( $p_bug_id, auth_get_current_user_id() );
 		$t_can_download		= access_has_bug_level( config_get( 'delete_attachments_threshold' ), $p_bug_id );
+		
+		if ( $p_file_id > 0 ) {
+			$t_owned_by_me		= file_is_user_owner( $p_file_id, auth_get_current_user_id() );
+		}
 # @@@ Fix this to be readable
-		$t_can_download		= $t_can_download || ( $t_reported_by_me && config_get( 'allow_delete_own_attachments' ) );
+		if ( $p_file_id > 0 ) {
+			$t_can_download		= $t_can_download || ( $t_owned_by_me && config_get( 'allow_delete_own_attachments' ) );
+		} else {
+			# left due to compatibility reasons. should be removed.
+			$t_can_download		= $t_can_download || ( $t_reported_by_me && config_get( 'allow_delete_own_attachments' ) );
+		}
 
 		return $t_can_download;
 	}
@@ -199,6 +209,7 @@
 			$t_attachment['date_added'] = db_unixtimestamp( $v_date_added );
 			$t_attachment['can_download'] = $t_can_download;
 			$t_attachment['diskfile'] = $v_diskfile;
+			$t_attachment['can_delete'] = file_can_delete_bug_attachments( $p_bug_id, $v_id );
 
 			if ( $t_can_download ) {
 				$t_attachment['download_url'] = "file_download.php?file_id=$v_id&amp;type=bug";
@@ -210,7 +221,6 @@
 
 			$t_attachment['exists'] = config_get( 'file_upload_method' ) != DISK || file_exists( $v_diskfile );
 			$t_attachment['icon'] = file_get_icon_url( $t_attachment['display_name'] );
-			$t_attachment['can_delete'] = $t_can_delete;
 
 			$t_attachment['preview'] = false;
 			$t_attachment['type'] = '';
@@ -302,8 +312,8 @@
 			# Delete files from disk
 			$query = "SELECT diskfile, filename
 					FROM $t_project_file_table
-					WHERE project_id=" . db_param(0);
-			$result = db_query_bound( $query, array( (int)$p_project_id ) );
+					WHERE project_id=$p_project_id";
+			$result = db_query( $query );
 
 			$file_count = db_num_rows( $result );
 
@@ -330,7 +340,7 @@
 		# Delete the corresponding db records
 		$query = "DELETE FROM $t_project_file_table
 				WHERE project_id=" . db_param(0);
-		$result = db_query_bound($query, Array( (int)$p_project_id ) );
+		$result = db_query_bound($query, Array( $p_project_id ) );
 	}
 	# --------------------
 	# Delete all cached files that are older than configured number of days.
@@ -382,14 +392,15 @@
 	# --------------------
 	# Return the specified field value
 	function file_get_field( $p_file_id, $p_field_name, $p_table = 'bug' ) {
+		$c_file_id			= db_prepare_int( $p_file_id );
 		$c_field_name		= db_prepare_string( $p_field_name );
 		$t_bug_file_table	= db_get_table( 'mantis_' . $p_table . '_file_table' );
 
 		# get info
 		$query = "SELECT $c_field_name
 				  FROM $t_bug_file_table
-				  WHERE id=" . db_param(0);
-		$result = db_query_bound( $query, Array( (int)$p_file_id ), 1 );
+				  WHERE id='$c_file_id'";
+		$result = db_query( $query, 1 );
 
 		return db_result( $result );
 	}
@@ -526,19 +537,22 @@
 	}
 
 	# --------------------
-	function file_add( $p_bug_id, $p_tmp_file, $p_file_name, $p_file_type='', $p_table = 'bug', $p_file_error = 0, $p_title = '', $p_desc = '' ) {
-	    switch ( (int) $p_file_error ) {
-	        case UPLOAD_ERR_INI_SIZE:
-	        case UPLOAD_ERR_FORM_SIZE:
-				trigger_error( ERROR_FILE_TOO_BIG, ERROR );
-				break;
-			case UPLOAD_ERR_PARTIAL:
-			case UPLOAD_ERR_NO_FILE:
-				trigger_error( ERROR_FILE_NO_UPLOAD_FAILURE, ERROR );
-				break;
-			default:
-			break;
-		}
+	function file_add( $p_bug_id, $p_tmp_file, $p_file_name, $p_file_type='', $p_table = 'bug', $p_file_error = 0, $p_title = '', $p_desc = '', $p_patch = 0, $p_obsolete = 0, $p_user_id = -1 ) {
+
+		if ( php_version_at_least( '4.2.0' ) ) {
+		    switch ( (int) $p_file_error ) {
+		        case UPLOAD_ERR_INI_SIZE:
+		        case UPLOAD_ERR_FORM_SIZE:
+                    trigger_error( ERROR_FILE_TOO_BIG, ERROR );
+                    break;
+		        case UPLOAD_ERR_PARTIAL:
+		        case UPLOAD_ERR_NO_FILE:
+                    trigger_error( ERROR_FILE_NO_UPLOAD_FAILURE, ERROR );
+                    break;
+                default:
+                    break;
+            }
+        }
 
 	    if ( ( '' == $p_tmp_file ) || ( '' == $p_file_name ) ) {
 		    trigger_error( ERROR_FILE_NO_UPLOAD_FAILURE, ERROR );
@@ -562,13 +576,21 @@
 			$t_project_id	= helper_get_current_project();
 			$t_bug_id		= 0;
 		}
-
+		
+		if ( $p_user_id == -1 )
+		{
+			$p_user_id = auth_get_current_user_id();
+		}
 		# prepare variables for insertion
 		$c_bug_id		= db_prepare_int( $p_bug_id );
 		$c_project_id		= db_prepare_int( $t_project_id );
 		$c_file_type	= db_prepare_string( $p_file_type );
 		$c_title = db_prepare_string( $p_title );
 		$c_desc = db_prepare_string( $p_desc );
+		$c_patch = db_prepare_int( $p_patch );
+		$c_obsolete = db_prepare_int( $p_obsolete );
+		$c_user_id = db_prepare_int( $p_user_id );
+		
 
 		if( $t_project_id == ALL_PROJECTS ) {
 			$t_file_path = config_get( 'absolute_path_default_upload_folder' );
@@ -632,11 +654,10 @@
 		$c_id = ( 'bug' == $p_table ) ? $c_bug_id : $c_project_id;
 					
 		$query = "INSERT INTO $t_file_table
-						(" . $p_table . "_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content)
+						(" . $p_table . "_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, patch, obsolete, user_id)
 					  VALUES
-						($c_id, '$c_title', '$c_desc', '$c_disk_file_name', '$c_new_file_name', '$c_file_path', $c_file_size, '$c_file_type', '" . db_now() ."', $c_content)";
+						($c_id, '$c_title', '$c_desc', '$c_disk_file_name', '$c_new_file_name', '$c_file_path', $c_file_size, '$c_file_type', '" . db_now() ."', $c_content, $c_patch, $c_obsolete, $c_user_id)";
 		db_query( $query );
-
 		if ( 'bug' == $p_table ) {
 			# updated the last_updated date
 			$result = bug_update_date( $p_bug_id );
@@ -748,4 +769,59 @@
 			return '';
 		}
 	}
+        # --------------------
+        # Check if the current user can mark attachment  as a patch.
+        function file_can_mark_patch( $p_bug_id, $p_file_id ) {
+                if ( bug_is_readonly( $p_bug_id ) ) {
+                        return false;
+                }
+
+                $t_submitted_by_me       = file_is_user_owner( $p_file_id, auth_get_current_user_id() );
+                $t_can_mark             = access_has_bug_level( config_get( 'allow_mark_patch_threshold' ), $p_bug_id );
+                $t_can_download         = $t_can_mark || $t_submitted_by_me;
+
+                return $t_can_download;
+        }
+
+        # --------------------
+        # Check if the current user can mark attachment as a obsolete.
+        function file_can_mark_obsolete( $p_bug_id, $p_file_id ) {
+                if ( bug_is_readonly( $p_bug_id ) ) {
+                        return false;
+                }
+
+                $t_submitted_by_me       = file_is_user_owner( $p_file_id, auth_get_current_user_id() );
+                $t_can_mark             = access_has_bug_level( config_get( 'allow_mark_obsolete_threshold' ), $p_bug_id );
+                $t_can_download         = $t_can_mark || $t_submitted_by_me;
+
+                return $t_can_download;
+        }
+
+        # --------------------
+        # Marks/unmarks file as a patch/obsolete
+        function file_mark( $p_file_id,  $p_field, $p_action, $p_bug_id ) {
+                if ( bug_is_readonly( $p_bug_id ) ) {
+                        return false;
+                }
+		$t_bug_file_table = db_get_table( 'mantis_bug_file_table' );
+		$query = "UPDATE $t_bug_file_table
+					SET $p_field = ".db_param(0)."
+					WHERE id = ".db_param(1);
+		$result = db_query_bound( $query, Array( $p_action, $p_file_id ) );
+        }
+
+		function file_is_user_owner( $p_file_id, $p_user_id ) {
+				if ( $p_user_id == file_get_field( $p_file_id, 'user_id' ) ) {
+					return true;
+				}
+                return false;		
+		}
+	# abandon files on user deletion
+	function file_user_abandon( $p_user_id ) {
+		$t_bug_file_table = db_get_table( 'mantis_bug_file_table' );
+		$query = "UPDATE $t_bug_file_table
+				SET user_id = 0
+				WHERE id = ".db_param(0);
+		$result = db_query_bound( $query, Array( $p_user_id ) );
+	}
 ?>
diff -Naur mantis_orig/mantisbt/core/print_api.php mantis_rd/mantisbt/core/print_api.php
--- mantis_orig/mantisbt/core/print_api.php	2008-02-29 09:38:28.000000000 +0100
+++ mantis_rd/mantisbt/core/print_api.php	2008-02-29 09:22:53.000000000 +0100
@@ -1750,7 +1750,6 @@
 		}
 
 		$t_can_download = file_can_download_bug_attachments( $p_bug_id );
-		$t_can_delete   = file_can_delete_bug_attachments( $p_bug_id );
 		$t_preview_text_ext = config_get( 'preview_text_extensions' );
 		$t_preview_image_ext = config_get( 'preview_image_extensions' );
 
@@ -1762,6 +1761,11 @@
 			$t_file_display_name = string_display_line( file_get_display_name( $v_filename ) );
 			$t_filesize		= number_format( $v_filesize );
 			$t_date_added	= date( config_get( 'normal_date_format' ), db_unixtimestamp( $v_date_added ) );
+			$t_description = string_display_line ( $v_description );
+			$t_can_mark_delete = file_can_mark_obsolete( $p_bug_id, $v_id );
+			$t_can_mark_patch = file_can_mark_patch( $p_bug_id, $v_id );
+			$t_can_delete   = file_can_delete_bug_attachments( $p_bug_id, $v_id );
+			
 
 			if ( $image_previewed ) {
 				$image_previewed = false;
@@ -1784,27 +1788,57 @@
 
 			if ( !$t_exists ) {
 				print_file_icon ( $t_file_display_name );
-				PRINT '&nbsp;<span class="strike">' . $t_file_display_name . '</span> (attachment missing)';
+				PRINT '&nbsp;<span class="strike">' . $t_file_display_name . '</span> (attachment missing)';				
 			} else {
+				if ( $v_patch ) {
+				    print "<B>P</B>";
+				}
 				PRINT $t_href_start;
 				print_file_icon ( $t_file_display_name );
-				PRINT $t_href_end . '&nbsp;' . $t_href_start . $t_file_display_name .
-					$t_href_end . "$t_href_clicket ($t_filesize bytes) <span class=\"italic\">$t_date_added</span>";
+				PRINT $t_href_end . '&nbsp;'; #'
+				if ( $v_obsolete ) {
+				    if ( $t_can_delete || $t_can_mark_delete) {
+		    			PRINT $t_href_start . "<span class=\"strike\">" . $t_file_display_name . "</span>" . $t_href_end . $t_href_clicket;
+				    } else {
+					PRINT "<span class=\"strike\">".$t_file_display_name."</span>";
+				    }
+				} else {
+				    PRINT $t_href_start .  $t_file_display_name . $t_href_end . $t_href_clicket;
+				}
+				
+				
+				 PRINT " (" . $t_filesize . "bytes) <span class=\"italic\">$t_date_added</span>";
 
+				# if can change patch status
+				# if can set to delete
 				if ( $t_can_delete ) {
 					PRINT " [<a class=\"small\" href=\"bug_file_delete.php?file_id=$v_id\">" . lang_get('delete_link') . '</a>]';
 				}
+				if ( $t_can_mark_patch && !$v_patch ) {
+					print " [<a class=\"small\" href=\"bug_file_add.php?field=patch&file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_patch' ) .'</a>]';
+				}
+				if ( $t_can_mark_patch && $v_patch ) {
+					print " [<a class=\"small\" href=\"bug_file_add.php?field=patch&file_id=$v_id&action=0&bug_id=$p_bug_id\">" . lang_get( 'file_unpatch' ) .'</a>]';
+				}
+				if ( $t_can_mark_delete && !$v_obsolete ) {
+					PRINT " [<a class=\"small\" href=\"bug_file_add.php?field=obsolete&file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_obsolete' ) . '</a>]';
+				}
+				if ( $t_can_mark_delete && $v_obsolete ) {
+					PRINT " [<a class=\"small\" href=\"bug_file_add.php?field=obsolete&file_id=$v_id&action=0&bug_id=$p_bug_id\">" . lang_get( 'file_unobsolete' ) . '</a>]';
+				}				
 
 				if ( ( FTP == config_get( 'file_upload_method' ) ) && file_exists ( $v_diskfile ) ) {
 					PRINT ' (' . lang_get( 'cached' ) . ')';
 				}
+				if ( strlen( $v_description ) > 0 )
+					PRINT "<BR><span> " . $v_description . "</span>"; 
 
 				if ( $t_can_download &&
 					( $v_filesize <= config_get( 'preview_attachments_inline_max_size' ) ) &&
 					( $v_filesize != 0 ) &&
 					( in_array( strtolower( file_get_extension( $t_file_display_name ) ), $t_preview_text_ext, true ) ) ) {
 					$c_id = db_prepare_int( $v_id );
-					$t_bug_file_table = db_get_table( 'mantis_bug_file_table' );
+					$t_bug_file_table = config_get( 'mantis_bug_file_table' );
 
 					echo "<script type=\"text/javascript\" language=\"JavaScript\">
 <!--
diff -Naur mantis_orig/mantisbt/core/user_api.php mantis_rd/mantisbt/core/user_api.php
--- mantis_orig/mantisbt/core/user_api.php	2008-02-29 09:38:28.000000000 +0100
+++ mantis_rd/mantisbt/core/user_api.php	2008-02-28 18:21:30.000000000 +0100
@@ -25,6 +25,7 @@
 
 	require_once( $t_core_dir . 'email_api.php' );
 	require_once( $t_core_dir . 'ldap_api.php' );
+	require_once( $t_core_dir . 'file_api.php' );
 
 	### User API ###
 
@@ -580,6 +581,9 @@
 		}
 
 		user_clear_cache( $p_user_id );
+		
+		# abandon user file
+		file_user_abandon( $p_user_id );
 
 		# Remove account
 		$query = "DELETE FROM $t_user_table
diff -Naur mantis_orig/mantisbt/lang/strings_english.txt mantis_rd/mantisbt/lang/strings_english.txt
--- mantis_orig/mantisbt/lang/strings_english.txt	2008-02-29 09:38:13.000000000 +0100
+++ mantis_rd/mantisbt/lang/strings_english.txt	2008-02-29 09:30:30.000000000 +0100
@@ -1501,4 +1501,12 @@
 $s_update_columns_for_current_project = 'Update Columns For Current Project';
 $s_update_columns_as_my_default = 'Update Columns as Default for All Projects';
 $s_reset_columns_configuration = 'Reset Columns Configuration';
+
+# print_api.php
+$s_file_comment = 'File description';
+$s_file_remarks = 'Remarks';
+$s_file_patch = 'Mark patch';
+$s_file_unpatch = 'Unmark patch';
+$s_file_obsolete = 'Obsolete';
+$s_file_unobsolete = 'Not obsolete';
 ?>
diff -Naur mantis_orig/mantisbt/lang/strings_polish.txt mantis_rd/mantisbt/lang/strings_polish.txt
--- mantis_orig/mantisbt/lang/strings_polish.txt	2008-02-29 09:38:13.000000000 +0100
+++ mantis_rd/mantisbt/lang/strings_polish.txt	2008-02-29 09:30:36.000000000 +0100
@@ -28,11 +28,11 @@
 	# Polish strings for Mantis
 	# Based on strings_english.txt rev. 1.???
 	# -------------------------------------------------
-	# $Revision: 1.105 $
+	# $Revision: 1.2 $
 	# $Author: giallu $
 	# $Date: 2007-10-24 22:31:18 $
 	#
-	# $Id: strings_polish.txt 5047 2008-02-23 20:21:13Z martinfuchs $
+	# $Id: strings_polish_8859-2.txt 5047 2008-02-23 20:21:13Z martinfuchs $
 	###########################################################################
 
 ?>
@@ -942,6 +942,15 @@
 # news_view_page.php
 $s_back_link = 'Powrt';
 
+# print_api.php
+$s_file_comment = 'Opis pliku';
+$s_file_remarks = 'Uwagi';
+$s_file_patch = 'Patch';
+$s_file_unpatch = 'Nie patch';
+$s_file_obsolete = 'Do usunicia';
+$s_file_unobsolete = 'Do pozostawienia';
+
+
 # proj_doc_add.php
 $s_file_uploaded_msg = 'Plik zosta pomylnie przesany';
 
@@ -1335,5 +1344,4 @@
 
 # wiki related strings
 $s_wiki = 'Wiki';
-
 ?>
diff -Naur mantis_orig/mantisbt/lang/strings_polish_8859-2.txt mantis_rd/mantisbt/lang/strings_polish_8859-2.txt
--- mantis_orig/mantisbt/lang/strings_polish_8859-2.txt	2008-02-29 09:38:12.000000000 +0100
+++ mantis_rd/mantisbt/lang/strings_polish_8859-2.txt	2008-02-29 09:30:36.000000000 +0100
@@ -942,6 +942,15 @@
 # news_view_page.php
 $s_back_link = 'Powrt';
 
+# print_api.php
+$s_file_comment = 'Opis pliku';
+$s_file_remarks = 'Uwagi';
+$s_file_patch = 'Patch';
+$s_file_unpatch = 'Nie patch';
+$s_file_obsolete = 'Do usunicia';
+$s_file_unobsolete = 'Do pozostawienia';
+
+
 # proj_doc_add.php
 $s_file_uploaded_msg = 'Plik zosta pomylnie przesany';
 
@@ -1335,5 +1344,4 @@
 
 # wiki related strings
 $s_wiki = 'Wiki';
-
 ?>
