diff -Naur mantis-1.1.1/admin/upgrades/file_marks.sql mantis2/admin/upgrades/file_marks.sql
--- mantis-1.1.1/admin/upgrades/file_marks.sql	1970-01-01 01:00:00.000000000 +0100
+++ mantis2/admin/upgrades/file_marks.sql	2008-02-22 11:53:06.000000000 +0100
@@ -0,0 +1,12 @@
+alter table mantis_bug_file_table add column ispatch smallint;
+alter table mantis_bug_file_table add column isobsolete smallint;
+
+alter table mantis_bug_file_table alter column ispatch set default 0;
+alter table mantis_bug_file_table alter column isobsolete set default 0;
+
+update mantis_bug_file_table set ispatch=0;
+update mantis_bug_file_table set isobsolete=0;
+
+alter table mantis_bug_file_table alter column ispatch set not null;
+alter table mantis_bug_file_table alter column isobsolete set not null;
+
diff -Naur mantis-1.1.1/bug_file_add.php mantis2/bug_file_add.php
--- mantis-1.1.1/bug_file_add.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis2/bug_file_add.php	2008-02-22 15:47:06.000000000 +0100
@@ -34,6 +34,9 @@
 <?php
 	$f_bug_id	= gpc_get_int( 'bug_id', -1 );
 	$f_file		= gpc_get_file( 'file', -1 );
+	$f_patch	= gpc_get_int( 'ispatch', 0);
+	$f_description 	= gpc_get_string( 'description', '' );
+
 
 	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
@@ -54,7 +57,7 @@
 	}
 
     $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 );
+	file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error, '', $f_description, $f_patch );
 
 	# Determine which view page to redirect back to.
 	$t_redirect_url = string_get_bug_view_url( $f_bug_id );
diff -Naur mantis-1.1.1/bug_file_mark_obsolete.php mantis2/bug_file_mark_obsolete.php
--- mantis-1.1.1/bug_file_mark_obsolete.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis2/bug_file_mark_obsolete.php	2008-02-22 16:26:33.000000000 +0100
@@ -0,0 +1,36 @@
+<?php
+	# Mantis - a php based bugtracking system
+	# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
+	# Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
+	# This program is distributed under the terms and conditions of the GPL
+	# See the README and LICENSE files for details
+
+	# --------------------------------------------------------
+	# $Id: bug_mark_obsolete.php,v 1.42 2008/02/20 22:00:32 smig1o Exp $
+	# --------------------------------------------------------
+?>
+<?php
+	# Process file then redirect to viewing page
+?>
+<?php
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path.'bug_api.php' );
+?>
+<?php
+	$f_file_id = gpc_get_int( 'file_id' );
+	$f_action = gpc_get_int( 'action' );
+	$f_bug_id = gpc_get_int( 'bug_id' );
+	
+	$t_bug_file_table = config_get( 'mantis_bug_file_table' );
+	
+	$query = "UPDATE $t_bug_file_table
+		    SET isobsolete = $f_action
+		    WHERE id = $f_file_id";
+		    
+	$result = db_query( $query );
+
+	print_successful_redirect_to_bug( $f_bug_id );
+?>
diff -Naur mantis-1.1.1/bug_file_mark_patch.php mantis2/bug_file_mark_patch.php
--- mantis-1.1.1/bug_file_mark_patch.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis2/bug_file_mark_patch.php	2008-02-22 16:27:54.000000000 +0100
@@ -0,0 +1,36 @@
+<?php
+	# Mantis - a php based bugtracking system
+	# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
+	# Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
+	# This program is distributed under the terms and conditions of the GPL
+	# See the README and LICENSE files for details
+
+	# --------------------------------------------------------
+	# $Id: bug_mark_obsolete.php,v 1.42 2008/02/20 22:00:32 smig1o Exp $
+	# --------------------------------------------------------
+?>
+<?php
+	# Process file then redirect to viewing page
+?>
+<?php
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path.'bug_api.php' );
+?>
+<?php
+	$f_file_id = gpc_get_int( 'file_id' );
+	$f_action = gpc_get_int( 'action' );
+	$f_bug_id = gpc_get_int( 'bug_id' );
+	
+	$t_bug_file_table = config_get( 'mantis_bug_file_table' );
+	
+	$query = "UPDATE $t_bug_file_table
+		    SET ispatch = $f_action
+		    WHERE id = $f_file_id";
+		    
+	$result = db_query( $query );
+
+	print_successful_redirect_to_bug( $f_bug_id );
+?>
diff -Naur mantis-1.1.1/bug_file_upload_inc.php mantis2/bug_file_upload_inc.php
--- mantis-1.1.1/bug_file_upload_inc.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis2/bug_file_upload_inc.php	2008-02-22 14:42:56.000000000 +0100
@@ -61,6 +61,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="ispatch" value="1" ><?php echo lang_get( 'file_patch' ) ?></input>
+	</td>
+</tr>
 </table>
 </form>
 <?php
diff -Naur mantis-1.1.1/config_defaults_inc.php mantis2/config_defaults_inc.php
--- mantis-1.1.1/config_defaults_inc.php	2008-01-16 23:16:24.000000000 +0100
+++ mantis2/config_defaults_inc.php	2008-02-22 16:39:58.000000000 +0100
@@ -1003,6 +1003,12 @@
 	# allow users to delete attachments uploaded by themselves even if their access
 	# level is below delete_attachments_threshold.
 	$g_allow_delete_own_attachments = OFF;
+	
+	# access level needed to mark file obsolete
+	$g_allow_mark_obsolete_threshold = DEVELOPER;
+	
+	# access level needed to mar fila patch
+	$g_allow_mark_patch_threshold = DEVELOPER;
 
 	############################
 	# Mantis Misc Settings
@@ -1930,4 +1936,6 @@
 	
 	# The twitter account password.
 	$g_twitter_password = '';
+
+
 ?>
diff -Naur mantis-1.1.1/core/bug_api.php mantis2/core/bug_api.php
--- mantis-1.1.1/core/bug_api.php	2008-01-19 08:43:47.000000000 +0100
+++ mantis2/core/bug_api.php	2008-02-22 15:49:26.000000000 +0100
@@ -1107,7 +1107,7 @@
 
 		$t_bug_file_table = config_get( '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, description, ispatch, isobsolete
 		                FROM $t_bug_file_table
 		                WHERE bug_id='$c_bug_id'
 		                ORDER BY date_added";
diff -Naur mantis-1.1.1/core/file_api.php mantis2/core/file_api.php
--- mantis-1.1.1/core/file_api.php	2007-12-20 06:46:29.000000000 +0100
+++ mantis2/core/file_api.php	2008-02-22 16:42:13.000000000 +0100
@@ -143,6 +143,34 @@
 	}
 
 	# --------------------
+	# Check if the current user can mark attachment  as a patch.
+	function file_can_mark_patch_bug_attachments( $p_bug_id ) {
+		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_mark		= access_has_bug_level( config_get( 'allow_mark_patch_threshold' ), $p_bug_id );
+		$t_can_download		= $t_can_mark || $t_reported_by_me;
+
+		return $t_can_download;
+	}
+
+	# --------------------
+	# Check if the current user can mark attachment as a obsolete.
+	function file_can_mark_obsolete_bug_attachments( $p_bug_id ) {
+		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_mark		= access_has_bug_level( config_get( 'allow_mark_obsolete_threshold' ), $p_bug_id );
+		$t_can_download		= $t_can_mark || $t_reported_by_me;
+
+		return $t_can_download;
+	}
+
+	# --------------------
 	# List the attachments belonging to the specified bug.  This is used from within
 	# bug_view_page.php and bug_view_advanced_page.php
 	function file_list_attachments( $p_bug_id ) {
@@ -155,6 +183,8 @@
 
 		$t_can_download = file_can_download_bug_attachments( $p_bug_id );
 		$t_can_delete   = file_can_delete_bug_attachments( $p_bug_id );
+		$t_can_mark_delete = file_can_mark_obsolete_bug_attachments( $p_bug_id );
+		$t_can_mark_patch = file_can_mark_patch_bug_attachments( $p_bug_id );
 		$t_preview_text_ext = config_get( 'preview_text_extensions' );
 		$t_preview_image_ext = config_get( 'preview_image_extensions' );
 
@@ -166,6 +196,8 @@
 			$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 );
+			
 
 			if ( $image_previewed ) {
 				$image_previewed = false;
@@ -188,20 +220,49 @@
 
 			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_ispatch ) {
+				    print "patch icon here";
+				}
 				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_isobsolete ) {
+				    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_ispatch ) {
+					print " [<a class=\"small\" href=\"bug_file_mark_patch.php?file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_patch' ) .'</a>]';
+				}
+				if ( $t_can_mark_patch && $v_ispatch ) {
+					print " [<a class=\"small\" href=\"bug_file_mark_patch.php?file_id=$v_id&action=0&bug_id=$p_bug_id\">" . lang_get( 'file_unpatch' ) .'</a>]';
+				}
+				if ( $t_can_mark_delete && !$v_isobsolete ) {
+					PRINT " [<a class=\"small\" href=\"bug_file_mark_obsolete.php?file_id=$v_id&action=1&bug_id=$p_bug_id\">" . lang_get( 'file_obsolete' ) . '</a>]';
+				}
+				if ( $t_can_mark_delete && $v_isobsolete ) {
+					PRINT " [<a class=\"small\" href=\"bug_file_mark_obsolete.php?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' ) . ')';
 				}
+				PRINT "<BR><span> " . $t_description . "</span>"; 
 
 				if ( $t_can_download &&
 					( $v_filesize <= config_get( 'preview_attachments_inline_max_size' ) ) &&
@@ -570,7 +631,7 @@
 	}
 
 	# --------------------
-	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 = '' ) {
+	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_ispatch = 0, $p_isobsolete = 0 ) {
 
 		if ( php_version_at_least( '4.2.0' ) ) {
 		    switch ( (int) $p_file_error ) {
@@ -616,6 +677,8 @@
 		$c_file_type	= db_prepare_string( $p_file_type );
 		$c_title = db_prepare_string( $p_title );
 		$c_desc = db_prepare_string( $p_desc );
+		$c_ispatch = db_prepare_int( $p_ispatch );
+		$c_isobsolete = db_prepare_int( $p_isobsolete );
 
 		if( $t_project_id == ALL_PROJECTS ) {
 			$t_file_path = config_get( 'absolute_path_default_upload_folder' );
@@ -679,9 +742,9 @@
 		$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, ispatch, isobsolete)
 					  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_ispatch, $c_isobsolete )";
 		db_query( $query );
 
 		if ( 'bug' == $p_table ) {
diff -Naur mantis-1.1.1/lang/strings_english.inc.txt mantis2/lang/strings_english.inc.txt
--- mantis-1.1.1/lang/strings_english.inc.txt	1970-01-01 01:00:00.000000000 +0100
+++ mantis2/lang/strings_english.inc.txt	2008-02-22 16:35:05.000000000 +0100
@@ -0,0 +1,44 @@
+<?php
+# Mantis - a php based bugtracking system
+
+# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
+# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
+
+# Mantis is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# Mantis is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
+	#
+	# English: Kenzaburo Ito, kenito@300baud.org
+	# English: various developers
+	#
+	###########################################################################
+	# English strings for Mantis (source language for translations)
+	# -------------------------------------------------
+	# $Revision: 1.316.2.2 $
+	# $Author: giallu $
+	# $Date: 2007-10-28 19:05:46 $
+	#
+	# $Id: strings_english.txt,v 1.316.2.2 2007-10-28 19:05:46 giallu Exp $
+	###########################################################################
+
+?>
+<?php
+# Charset
+$s_charset = 'utf-8';
+
+$s_file_comment ='File comment';
+$s_file_remarks ='Remarks';
+$s_file_patch = 'patch';
+$s_file_unpatch = 'unpatch';
+$s_file_obsolete = 'obsolete';
+$s_file_unobsolete = 'unobsolete';
+?>
diff -Naur mantis-1.1.1/lang/strings_polish.inc.txt mantis2/lang/strings_polish.inc.txt
--- mantis-1.1.1/lang/strings_polish.inc.txt	1970-01-01 01:00:00.000000000 +0100
+++ mantis2/lang/strings_polish.inc.txt	2008-02-22 16:15:31.000000000 +0100
@@ -0,0 +1,49 @@
+<?php
+# Mantis - a php based bugtracking system
+
+# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
+# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
+
+# Mantis is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# Mantis is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
+	#
+	# Polish: Adam Bienias <adam@fireworks.atomnet.pl>
+	# Polish: Jaroslaw Lewandowski <jotel@jotel.net>
+	# Polish: Kacper Kruszewski <kacper@netcetera.pl>
+	# Polish: Tomasz Czerniejewski <tomc at artifexmundi com> 2005/04/06
+	# Polish: Arkadiusz Hutta <hutta@poczta.onet.pl> 2005/08/10
+	# Polish: Marcin Ulanecki <marcin dot ulanecki at vm dot pl> 2005/09/17
+	#
+	###########################################################################
+	# Polish strings for Mantis
+	# Based on strings_english.txt rev. 1.???
+	# -------------------------------------------------
+	# $Revision: 1.104.2.1 $
+	# $Author: giallu $
+	# $Date: 2007-10-13 22:36:29 $
+	#
+	# $Id: strings_polish.txt,v 1.104.2.1 2007-10-13 22:36:29 giallu Exp $
+	###########################################################################
+
+?>
+<?php
+# Charset
+$s_charset = 'utf-8';
+
+$s_file_comment = 'Opis pliku';
+$s_file_remarks = 'Uwagi';
+$s_file_patch = 'patch';
+$s_file_unpatch = 'unpatch';
+$s_file_obsolete = 'Do usunicia';
+$s_file_unobsolete = 'Do pozostawienia';
+?>
diff -Naur mantis-1.1.1/lang/strings_polish.txt mantis2/lang/strings_polish.txt
--- mantis-1.1.1/lang/strings_polish.txt	2007-12-04 12:24:34.000000000 +0100
+++ mantis2/lang/strings_polish.txt	2008-02-22 14:24:56.000000000 +0100
@@ -1328,4 +1328,6 @@
 
 # wiki related strings
 $s_wiki = 'Wiki';
+
+include ('strings_polish.inc.txt');
 ?>
