diff -Naur mantis-1.1.1/account_prefs_inc.php mantis/account_prefs_inc.php
--- mantis-1.1.1/account_prefs_inc.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/account_prefs_inc.php	2008-02-22 09:21:59.000000000 +0100
@@ -176,6 +176,20 @@
 </tr>
 <tr class="row-1">
 	<td class="category">
+		<?php echo lang_get( 'email_on_processed' ) ?>
+	</td>
+	<td>
+		<input type="checkbox" name="email_on_processed" <?php check_checked( $t_pref->email_on_processed, ON ); ?> />
+		<?php echo lang_get( 'with_minimum_severity' ) ?>
+		<select name="email_on_processed_min_severity">
+			<option value="<?php echo OFF ?>"><?php echo lang_get( 'any' ) ?></option>
+			<option value="<?php echo OFF ?>"></option>
+			<?php print_enum_string_option_list( 'severity', $t_pref->email_on_processed_min_severity ) ?>
+		</select>
+	</td>
+</tr>
+<tr class="row-2">
+	<td class="category">
 		<?php echo lang_get( 'email_on_resolved' ) ?>
 	</td>
 	<td>
@@ -188,7 +202,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-2">
+<tr class="row-1">
 	<td class="category">
 		<?php echo lang_get( 'email_on_closed' ) ?>
 	</td>
@@ -202,7 +216,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-1">
+<tr class="row-2">
 	<td class="category">
 		<?php echo lang_get( 'email_on_reopened' ) ?>
 	</td>
@@ -216,7 +230,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-2">
+<tr class="row-1">
 	<td class="category">
 		<?php echo lang_get( 'email_on_bugnote_added' ) ?>
 	</td>
@@ -230,7 +244,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-1">
+<tr class="row-2">
 	<td class="category">
 		<?php echo lang_get( 'email_on_status_change' ) ?>
 	</td>
@@ -244,7 +258,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-2">
+<tr class="row-1">
 	<td class="category">
 		<?php echo lang_get( 'email_on_priority_change' ) ?>
 	</td>
@@ -258,7 +272,7 @@
 		</select>
 	</td>
 </tr>
-<tr class="row-1">
+<tr class="row-2">
 	<td class="category">
 		<?php echo lang_get( 'email_bugnote_limit' ) ?>
 	</td>
@@ -286,8 +300,11 @@
 		<input type="hidden" name="email_on_status_min_severity"   value="<?php echo $t_pref->email_on_status_min_severity ?>" />
 		<input type="hidden" name="email_on_priority_min_severity" value="<?php echo $t_pref->email_on_priority_min_severity ?>" />
 		<input type="hidden" name="email_bugnote_limit" value="<?php echo $t_pref->email_bugnote_limit ?>" />
+		<input type="hidden" name="email_on_processed" value="<?php echo $t_pref->email_on_processed ?>" />
+		<input type="hidden" name="email_on_processed_min_severity" value="<?php echo $t_pref->email_on_processed_min_severity ?>" />
+
 <?php } ?>
-<tr class="row-2">
+<tr class="row-1">
 	<td class="category">
 		<?php echo lang_get( 'language' ) ?>
 	</td>
diff -Naur mantis-1.1.1/account_prefs_update.php mantis/account_prefs_update.php
--- mantis-1.1.1/account_prefs_update.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/account_prefs_update.php	2008-02-22 09:22:45.000000000 +0100
@@ -78,6 +78,8 @@
 	$t_prefs->email_on_bugnote_min_severity		= gpc_get_int( 'email_on_bugnote_min_severity' );
 	$t_prefs->email_on_status_min_severity		= gpc_get_int( 'email_on_status_min_severity' );
 	$t_prefs->email_on_priority_min_severity	= gpc_get_int( 'email_on_priority_min_severity' );
+	$t_prefs->email_on_processed_min_severity	= gpc_get_int( 'email_on_processed_min_severity' );
+	$t_prefs->email_on_processed	= gpc_get_bool( 'email_on_processed' );
 
 	$t_prefs->bugnote_order = gpc_get_string( 'bugnote_order' );
 	$t_prefs->email_bugnote_limit = gpc_get_int( 'email_bugnote_limit' );
diff -Naur mantis-1.1.1/admin/upgrades/update_tasks.sql mantis/admin/upgrades/update_tasks.sql
--- mantis-1.1.1/admin/upgrades/update_tasks.sql	1970-01-01 01:00:00.000000000 +0100
+++ mantis/admin/upgrades/update_tasks.sql	2008-02-20 15:41:41.000000000 +0100
@@ -0,0 +1,19 @@
+alter table mantis_bug_table add column task_order integer;
+alter table mantis_bug_table add column deadline date;
+alter table mantis_user_pref_table add column email_on_processed smallint;
+alter table mantis_user_pref_table add column email_on_processed_min_severiy smallint
+
+update mantis_bug_table set task_order=0;
+update mantis_user_prefs_table set email_on_processed=0;
+update mantis_user_prefs_table set email_on_processed_min_severity=0;
+
+alter table mantis_user_prefs_table alter column email_on_processed set default 0;
+alter table mantis_user_prefs_table alter column email_on_processed set not null;
+
+alter table mantis_user_prefs_table alter column email_on_processed_min_severity set default 0;
+alter table mantis_user_prefs_table alter column email_on_processed_min_severity set not null;
+
+alter table mantis_bug_table alter column task_order set default 0;
+alter table mantis_bug_table alter column task_order set not null;
+
+alter table mantis_email_table alter column email_id set default nextval( 'mantis_email_table_id_seq'::regclass);
diff -Naur mantis-1.1.1/bug_change_status_page.php mantis/bug_change_status_page.php
--- mantis-1.1.1/bug_change_status_page.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/bug_change_status_page.php	2008-02-21 08:58:40.000000000 +0100
@@ -52,6 +52,20 @@
 			) ) {
 		access_denied();
 	}
+	
+       #deal with tasks
+	$t_current_user_id = auth_get_current_user_id();
+	$t_global_level = access_get_global_level();
+	$t_local_level = project_get_local_user_access_level( $t_bug->project_id, $t_current_user_id );
+       
+        if ( $t_bug->severity == config_get( 'task_severity_threshold' ) ) {
+                if ( $t_local_level >= config_get( 'task_manager_threshold' ) || $t_global_level == ADMINISTRATOR ) {
+                } else if ( $t_bug->reporter == $t_current_user_id && $t_bug->status < config_get( 'task_aproved_threshold' ) ) {
+                } else if ( $t_bug->handler_id > 0 ) {
+                } else {
+                        trigger_error( ERROR_ACCESS_DENIED, ERROR );
+                }
+        }
 
 	# get new issue handler if set, otherwise default to original handler
 	$f_handler_id = gpc_get_int( 'handler_id', bug_get_field( $f_bug_id, 'handler_id' ) );
@@ -79,6 +93,7 @@
 
 	$t_status_label = str_replace( " ", "_", get_enum_to_string( config_get( 'status_enum_string' ), $f_new_status ) );
 	$t_resolved = config_get( 'bug_resolved_status_threshold' );
+	$t_task = config_get( 'task_severity_threshold' );
 
 	$t_bug = bug_get( $f_bug_id );
 
@@ -163,6 +178,38 @@
 	</td>
 </tr>
 <?php } ?>
+<!-- Deadline for task -->
+<?php
+if ( $t_bug->severity >= $t_task ) {
+# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)
+        if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){
+                        echo "<style type=\"text/css\">@import url(javascript/jscalendar/calendar-blue.css);</style>";
+                        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar.js\"></script>\n";
+                        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/lang/calendar-en.js\"></script>\n";
+
+                        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar-setup.js\"></script>\n";
+
+                }
+        $t_icon_path = config_get( 'icon_path' );
+        $cal_icon = $t_icon_path ."calendar-img.gif";
+
+
+
+
+?>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category">
+		<?php echo lang_get( 'deadline' ) ?>
+	</td>
+<?php
+            print "<td colspan=\"1\"><input ".helper_get_tab_index()." type=\"text\" id=\"deadline\" name=\"deadline\" size=\"20\" maxlength=\"10\" value=\"".$t_bug->deadline."\">";
+?>
+            <input type="image" class="button" id="trigger" SRC="
+            <?php print $cal_icon;?> " onClick="return showCalendar ('sel1', '%Y-%m-%d', 24, true)" />
+        </td>	
+</tr>
+<?php } ?>
+
 
 <!-- Custom Fields -->
 <?php
@@ -321,6 +368,18 @@
 
 </table>
 </form>
+<?php if ( $t_bug->severity >= $t_task ) { #'?>
+        <script type="text/javascript">
+                Calendar.setup (
+                {
+                 inputField     : "deadline",
+                 ifFormat       : "%Y-%m-%d",
+                 button         : "trigger"
+                }
+                );
+        </script>
+
+<?php } ?>
 </div>
 
 <br />
diff -Naur mantis-1.1.1/bug_process.php mantis/bug_process.php
--- mantis-1.1.1/bug_process.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis/bug_process.php	2008-02-19 11:11:38.000000000 +0100
@@ -0,0 +1,58 @@
+<?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_assign.php,v 1.42 2005/06/14 22:00:32 thraxisp Exp $
+	# --------------------------------------------------------
+?>
+<?php
+	# Process bug 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_bug_id = gpc_get_int( 'bug_id' );
+	$t_bug = bug_get( $f_bug_id );
+	
+	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_handler_id = gpc_get_int( 'handler_id', auth_get_current_user_id() );
+
+	# check that current user has rights to assign the issue
+	access_ensure_bug_level( config_get( 'update_process_threshold', config_get( 'update_bug_process_threshold' ) ), $f_bug_id );
+
+	$t_bug_sponsored = sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0;
+	if ( $t_bug_sponsored ) {
+		if ( !access_has_bug_level( config_get( 'assign_sponsored_bugs_threshold' ), $f_bug_id ) ) {
+			trigger_error( ERROR_SPONSORSHIP_ASSIGNER_ACCESS_LEVEL_TOO_LOW, ERROR );
+		}
+	}
+
+	if ( $f_handler_id != NO_USER ) {
+		# check that new handler has rights to handle the issue
+		access_ensure_bug_level( config_get( 'handle_bug_threshold' ), $f_bug_id, $f_handler_id );
+
+		if ( $t_bug_sponsored ) {
+			if ( !access_has_bug_level( config_get( 'handle_sponsored_bugs_threshold' ), $f_bug_id, $f_handler_id ) ) {
+				trigger_error( ERROR_SPONSORSHIP_HANDLER_ACCESS_LEVEL_TOO_LOW, ERROR );
+			}
+		}
+	}
+
+	bug_process( $f_bug_id, '' );
+
+	print_successful_redirect_to_bug( $f_bug_id );
+?>
diff -Naur mantis-1.1.1/bug_report.php mantis/bug_report.php
--- mantis-1.1.1/bug_report.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/bug_report.php	2008-02-21 10:45:37.000000000 +0100
@@ -31,6 +31,7 @@
 	require_once( $t_core_path.'file_api.php' );
 	require_once( $t_core_path.'bug_api.php' );
 	require_once( $t_core_path.'custom_field_api.php' );
+	require_once( $t_core_path.'task_api.php' );
 
 	access_ensure_project_level( config_get('report_bug_threshold' ) );
 
@@ -149,13 +150,20 @@
 	}
 
 	email_new_bug( $t_bug_id );
+	if ( $t_bug_data->severity == config_get( 'task_severity_threshold' ) ) {
+		task_add_task( $t_bug_id, $t_bug_data->handler_id );	
+	}
 
 	helper_call_custom_function( 'issue_create_notify', array( $t_bug_id ) );
 
 	html_page_top1();
 
 	if ( ! $f_report_stay ) {
-		html_meta_redirect( 'view_all_bug_page.php' );
+		if ( $t_bug_data->severity == config_get( 'task_severity_threshold' ) ) {
+			html_meta_redirect( 'task_list_page.php' );
+		} else {
+			html_meta_redirect( 'view_all_bug_page.php' );
+		}
 	}
 
 	html_page_top2();
@@ -165,7 +173,11 @@
 <?php
 	echo lang_get( 'operation_successful' ) . '<br />';
 	print_bracket_link( string_get_bug_view_url( $t_bug_id ), lang_get( 'view_submitted_bug_link' ) . " $t_bug_id" );
-	print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) );
+	if ( $t_bug_data->severity == config_get( 'task_severity_threshold' ) ) {	
+		print_bracket_link( 'task_list_page.php', lang_get( 'task_list_link' ) );
+	} else {
+		print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) );
+	}
 
 	if ( $f_report_stay ) {
 ?>
diff -Naur mantis-1.1.1/bug_update.php mantis/bug_update.php
--- mantis-1.1.1/bug_update.php	2007-10-26 10:52:18.000000000 +0200
+++ mantis/bug_update.php	2008-02-22 09:28:36.000000000 +0100
@@ -32,8 +32,10 @@
 	require_once( $t_core_path.'bug_api.php' );
 	require_once( $t_core_path.'bugnote_api.php' );
 	require_once( $t_core_path.'custom_field_api.php' );
+	require_once( $t_core_path.'task_api.php' );
 ?>
 <?php
+
 	$f_bug_id = gpc_get_int( 'bug_id' );
 	$f_update_mode = gpc_get_bool( 'update_mode', FALSE ); # set if called from generic update page
 	$f_new_status	= gpc_get_int( 'status', bug_get_field( $f_bug_id, 'status' ) );
@@ -54,9 +56,17 @@
 			) ) {
 		access_denied();
 	}
+	
+	
 
 	# extract current extended information
 	$t_old_bug_status = $t_bug_data->status;
+	$t_old_bug_severity = $t_bug_data->severity;
+	$t_old_bug_reporter = $t_bug_data->reporter_id;
+	$t_current_user_id = auth_get_current_user_id();
+	$t_local_level = project_get_local_user_access_level( $c_bug_data->project_id, $t_current_user_id );
+	$t_global_level = access_get_global_level($t_current_user_id);
+	
 
 	$t_bug_data->reporter_id		= gpc_get_int( 'reporter_id', $t_bug_data->reporter_id );
 	$t_bug_data->handler_id			= gpc_get_int( 'handler_id', $t_bug_data->handler_id );
@@ -82,11 +92,29 @@
 	$t_bug_data->description		= gpc_get_string( 'description', $t_bug_data->description );
 	$t_bug_data->steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', $t_bug_data->steps_to_reproduce );
 	$t_bug_data->additional_information	= gpc_get_string( 'additional_information', $t_bug_data->additional_information );
+	$t_bug_data->deadline			= gpc_get_string( 'deadline', $t_bug_data->deadline );
 
 	$f_private						= gpc_get_bool( 'private' );
 	$f_bugnote_text					= gpc_get_string( 'bugnote_text', '' );
 	$f_time_tracking			= gpc_get_string( 'time_tracking', '0:00' );
 	$f_close_now					= gpc_get_string( 'close_now', false );
+	
+
+	#deal with tasks
+	if ( ($t_old_bug_severity == config_get( 'task_severity_threshold' )
+			 && $t_bug_data->severity != config_get( 'task_severity_threshold' ) ) || 
+			($t_old_bug_severity != config_get( 'task_severity_threshold' ) && 
+			    $t_bug_data->severity == config_get( 'task_severity_threshold' ) ) ) {
+		if ( $t_local_level >= config_get( 'task_manager_threshold' ) || 
+			    $t_global_level == ADMINISTRATOR ) {
+		} else if ( $t_old_bug_reporter == $t_current_user_id && 
+		    $t_old_bug_status <= config_get( 'task_aproved_threshold' ) && 
+		    $t_bug_data->status <= config_get( 'task_aproved_threshold' ) ) {
+		} else if ( $t_bug_data->handler_id > 0 ) { 
+		} else {
+			trigger_error( ERROR_ACCESS_DENIED, ERROR );
+		}
+	}
 
 	# Handle auto-assigning
 	if ( ( NEW_ == $t_bug_data->status )
@@ -157,8 +185,15 @@
 
 				if ( $f_close_now ) {
 					bug_set_field( $f_bug_id, 'status', CLOSED );
+					$c_task = task_is_task( $p_bug_id );
+					if ( $c_task ) {
+		    			$t_user_id = bug_get_field( $p_bug_id, 'handler_id' );
+		    			task_remove_task( $p_bug_id );
+		    			history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_removed' ), user_get_realname( $t_user_id ) );
+		    			//info do historii
+					}
+					
 				}
-
 				// update bug data with fields that may be updated inside bug_resolve(), otherwise changes will be overwritten
 				// in bug_update() call below.
 				$t_bug_data->handler_id = bug_get_field( $f_bug_id, 'handler_id' );
@@ -197,6 +232,7 @@
 	# Update the bug entry, notify if we haven't done so already
 	bug_update( $f_bug_id, $t_bug_data, true, ( false == $t_notify ) );
 
+	
 	helper_call_custom_function( 'issue_update_notify', array( $f_bug_id ) );
 
 	print_successful_redirect_to_bug( $f_bug_id );
diff -Naur mantis-1.1.1/bug_update_advanced_page.php mantis/bug_update_advanced_page.php
--- mantis-1.1.1/bug_update_advanced_page.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/bug_update_advanced_page.php	2008-02-22 09:30:13.000000000 +0100
@@ -31,11 +31,24 @@
 	require_once( $t_core_path.'date_api.php' );
 	require_once( $t_core_path.'last_visited_api.php' );
 	require_once( $t_core_path.'projax_api.php' );
+	require_once( $t_core_path.'authentication_api.php' );
+	require_once( $t_core_path.'project_api.php' );
+	require_once( $t_core_path.'access_api.php' );
+	require_once( $t_core_path.'lang_api.php' );
+	
+
 ?>
 <?php
 	$f_bug_id = gpc_get_int( 'bug_id' );
-
+	
 	$t_bug = bug_prepare_edit( bug_get( $f_bug_id, true ) );
+	
+	$t_current_user_id = auth_get_current_user_id();
+	
+	$t_level = project_get_local_user_access_level ( $t_bug->project_id, $t_current_user_id );
+	
+	$t_syslevel = access_get_global_level();
+	
 
 	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...
@@ -64,7 +77,7 @@
 ?>
 
 <br />
-<form method="post" action="bug_update.php">
+<form method="post" action="bug_update.php" name="bue">
 <table class="width100" cellspacing="1">
 <tr>
 	<td class="form-title" colspan="3">
@@ -428,11 +441,41 @@
 
 <tr <?php echo helper_alternate_class() ?>>
 
-<?php
+<?php #"
 	if ( access_has_bug_level( config_get( 'roadmap_update_threshold' ), $f_bug_id ) ) {
+
+#	<!-- deadline -->
+# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)
+        if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){
+			echo "<style type=\"text/css\">@import url(javascript/jscalendar/calendar-blue.css);</style>";
+			echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar.js\"></script>\n"; 
+			echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/lang/calendar-en.js\"></script>\n"; 
+			echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar-setup.js\"></script>\n"; 	
+		}
+	$t_icon_path = config_get( 'icon_path' );
+	$cal_icon = $t_icon_path ."calendar-img.gif";
 ?>
-	<!-- spacer -->
-	<td colspan="2">&nbsp;</td>
+		
+	<td class="category"><?php print lang_get( 'deadline' ); ?></td>
+<?php
+	if ( $t_level >= config_get( 'task_manager_threshold' ) || $t_syslevel == ADMINISTRATOR ) {
+	    print "<td colspan=\"1\"><input ".helper_get_tab_index()." type=\"text\" id=\"deadline\" name=\"deadline\" size=\"20\" maxlength=\"10\" value=\"".$t_bug->deadline."\">";
+?>
+	    <input type="image" class="button" id="trigger" SRC="
+	    <?php print $cal_icon;?> " onClick="return showCalendar ('sel1', '%Y-%m-%d', 24, true)" />
+<?php	    
+	} else {
+	    if ( $t_bug->status >= config_get( 'bug_resolved_status_threshold' ) ) {
+		print "<td colspan=\"1\">";
+		print $t_bug->deadline;
+	    } else {
+		print "<td colspan=\"1\" class=\"deadline\">";
+		print $t_bug->deadline;
+	    
+	    }
+	}
+?>
+	</td>
 
 	<td class="category">
 		<?php
@@ -612,7 +655,18 @@
 </table>
 </form>
 
+<?php if ( $t_level >= config_get( 'task_manager_threshold' ) || $t_syslevel == ADMINISTRATOR ) { ?>
+	<script type="text/javascript">
+		Calendar.setup (
+		{
+		 inputField 	: "deadline",
+		 ifFormat 	: "%Y-%m-%d",
+		 button		: "trigger"
+		}
+		);
+	</script>
 <?php
+	}
 	include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' );
 	html_page_bottom1( __FILE__ );
 
diff -Naur mantis-1.1.1/bug_view_advanced_page.php mantis/bug_view_advanced_page.php
--- mantis-1.1.1/bug_view_advanced_page.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/bug_view_advanced_page.php	2008-02-20 18:46:56.000000000 +0100
@@ -427,6 +427,21 @@
 <?php
 	}
 ?>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category"><?php print lang_get( 'deadline' ); ?>
+	</td>
+	<?php
+	if ( $t_bug->status < config_get( 'bug_resolved_status_threshold' ) && !is_blank( $t_bug->deadline ) ) {
+		echo '<td class="deadline">'.$t_bug->deadline;
+	} else {
+		echo '<td>'.$t_bug->deadline;
+	}
+	?>
+	</td>
+	<td colspan="4">&nbsp;</td>
+</tr>
+
+
 
 <!-- spacer -->
 <tr class="spacer">
diff -Naur mantis-1.1.1/bug_view_page.php mantis/bug_view_page.php
--- mantis-1.1.1/bug_view_page.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/bug_view_page.php	2008-02-20 18:47:55.000000000 +0100
@@ -43,6 +43,7 @@
 	bug_ensure_exists( $f_bug_id );
 
 	access_ensure_bug_level( VIEWER, $f_bug_id );
+	
 
 	$t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) );
 
@@ -314,6 +315,19 @@
 		}
 	?>
 </tr>
+<tr <?php echo helper_alternate_class() ?>>
+	<td class="category"><?php print lang_get( 'deadline' ); ?>
+	</td>
+	<?php
+	if ( $t_bug->status < config_get( 'bug_resolved_status_threshold' ) && !is_blank( $t_bug->deadline ) ) {
+		echo '<td class="deadline">'.$t_bug->deadline;
+	} else {
+		echo '<td>'.$t_bug->deadline;
+	}
+	?>
+	</td>
+	<td colspan="4">&nbsp;</td>
+</tr>
 
 
 <!-- spacer -->
diff -Naur mantis-1.1.1/config_defaults_inc.php mantis/config_defaults_inc.php
--- mantis-1.1.1/config_defaults_inc.php	2008-01-16 23:16:24.000000000 +0100
+++ mantis/config_defaults_inc.php	2008-02-22 09:31:16.000000000 +0100
@@ -267,7 +267,7 @@
 	# You might want to do something similar so all managers are notified when a
 	# bug is closed.  If you didn't want reporters to be notified when a bug is
 	# closed (only when it is resolved) you would use:
-	#
+	#'
 	# $g_notify_flags['closed']['reporter'] = OFF;
 
 	$g_default_notify_flags	= array('reporter'	=> ON,
@@ -699,6 +699,7 @@
 	$g_default_email_on_bugnote		= ON;
 	$g_default_email_on_status		= 0; # @@@ Unused
 	$g_default_email_on_priority	= 0; # @@@ Unused
+	$g_default_email_on_processed = ON;
 	$g_default_email_on_new_minimum_severity		= OFF; # 'any'
 	$g_default_email_on_assigned_minimum_severity	= OFF; # 'any'
 	$g_default_email_on_feedback_minimum_severity	= OFF; # 'any'
@@ -708,6 +709,7 @@
 	$g_default_email_on_bugnote_minimum_severity	= OFF; # 'any'
 	$g_default_email_on_status_minimum_severity		= OFF; # 'any'
 	$g_default_email_on_priority_minimum_severity	= OFF; # @@@ Unused
+	$g_default_email_on_processed_minimum_severity = OFF;
 	$g_default_email_bugnote_limit					= 0;
 	# default_language - is set to site language
 
@@ -1280,6 +1282,7 @@
 									 'acknowledged'	=> '#ffd850', # orange
 									 'confirmed'	=> '#ffffb0', # yellow
 									 'assigned'		=> '#c8c8ff', # blue
+									 'processed'	=> '#c674fc', # magenta
 									 'resolved'		=> '#cceedd', # buish-green
 									 'closed'		=> '#e8e8e8'); # light gray
 
@@ -1386,7 +1389,7 @@
 	# --- enum strings ----------------
 	# status from $g_status_index-1 to 79 are used for the onboard customization (if enabled)
 	# directly use Mantis to edit them.
-	$g_access_levels_enum_string		= '10:viewer,25:reporter,40:updater,55:developer,70:manager,90:administrator';
+	$g_access_levels_enum_string		= '10:viewer,25:reporter,40:updater,55:developer,60:task_manager,:70:manager,90:administrator';
 	$g_project_status_enum_string		= '10:development,30:release,50:stable,70:obsolete';
 	$g_project_view_state_enum_string	= '10:public,50:private';
 	$g_view_state_enum_string			= '10:public,50:private';
@@ -1394,7 +1397,7 @@
 	$g_priority_enum_string				= '10:none,20:low,30:normal,40:high,50:urgent,60:immediate';
 	$g_severity_enum_string				= '10:feature,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block';
 	$g_reproducibility_enum_string		= '10:always,30:sometimes,50:random,70:have not tried,90:unable to duplicate,100:N/A';
-	$g_status_enum_string				= '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';
+	$g_status_enum_string				= '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:processed,80:resolved,90:closed';
 	  # @@@ for documentation, the values in this list are also used to define variables in the language files
 	  #  (e.g., $s_new_bug_title referenced in bug_change_status_page.php )
 	  # Embedded spaces are converted to underscores (e.g., "working on" references $s_working_on_bug_title).
@@ -1930,4 +1933,24 @@
 	
 	# The twitter account password.
 	$g_twitter_password = '';
+
+	#############################
+	# Task list Settings
+	#############################
+
+	# Task list config
+	# Add tasklist 
+	$g_task_enabled = OFF;
+	
+	# Minimum project level to be able to sort task list
+	$g_task_manager_threshold = TASK_MANAGER;
+	
+	# Issue severity assumed as TASK
+	$g_task_severity_threshold = FEATURE;
+	
+	# Minimum severit for approved task / below is unaproved
+	$g_task_aproved_threshold = CONFIRMED;
+		
+	# columns displayed on Task list view
+	$g_view_task_page_columns = array ( 'selection', 'id', 'eta', 'deadline', 'status', 'last_updated', 'summary' );	
 ?>
diff -Naur mantis-1.1.1/core/bug_api.php mantis/core/bug_api.php
--- mantis-1.1.1/core/bug_api.php	2008-01-19 08:43:47.000000000 +0100
+++ mantis/core/bug_api.php	2008-02-22 09:38:53.000000000 +0100
@@ -31,6 +31,7 @@
 	require_once( $t_core_dir . 'sponsorship_api.php' );
 	require_once( $t_core_dir . 'twitter_api.php' );
 	require_once( $t_core_dir . 'tag_api.php' );
+	require_once( $t_core_dir . 'task_api.php' );
 
 	# MASC RELATIONSHIP
 	require_once( $t_core_dir.'relationship_api.php' );
@@ -79,6 +80,10 @@
 		
 		#internal helper objects
 		var $_stats = null;
+		
+		#systherm
+		var $task_order = 0;
+		var $deadline = '';
 	}
 
 	#===================================
@@ -365,6 +370,8 @@
 		$c_additional_info		= db_prepare_string( $p_bug_data->additional_information );
 		$c_sponsorship_total 	= 0;
 		$c_sticky 				= 0;
+		$c_task_order			= db_prepare_int($p_bug_data->task_order);
+		$c_deadline						= db_prepare_date($p_bug_data->deadline);
 
 		# Summary cannot be blank
 		if ( is_blank( $c_summary ) ) {
@@ -377,7 +384,7 @@
 			error_parameters( lang_get( 'description' ) );
 			trigger_error( ERROR_EMPTY_FIELD, ERROR );
 		}
-
+		
 		# If category is not specified and not defaulted + project has categories defined, then error.
 		if ( is_blank( $c_category ) && ( category_get_count( $c_project_id ) > 0 ) ) {
 			error_parameters( lang_get( 'category' ) );
@@ -447,7 +454,7 @@
 				      platform, version,
 				      build,
 				      profile_id, summary, view_state, sponsorship_total, sticky, fixed_in_version,
-				      target_version 
+				      target_version, task_order, deadline
 				    )
 				  VALUES
 				    ( '$c_project_id',
@@ -462,7 +469,7 @@
 				      '$c_platform', '$c_version',
 				      '$c_build',
 				      '$c_profile_id', '$c_summary', '$c_view_state', '$c_sponsorship_total', '$c_sticky', '',
-				      '$c_target_version'
+				      '$c_target_version', '$c_task_order', null 
 				    )";
 		db_query( $query );
 
@@ -527,6 +534,8 @@
 		bug_set_field( $t_new_bug_id, 'target_version', $t_bug_data->target_version );
 		bug_set_field( $t_new_bug_id, 'sponsorship_total', 0 );
 		bug_set_field( $t_new_bug_id, 'sticky', 0 );
+		bug_set_field( $t_new_bug_id, 'task_order', 0);
+		bug_set_field( $t_new_bug_id, 'deadline', $t_bug_data->deadline );
 
 		# COPY CUSTOM FIELDS
 		if ( $p_copy_custom_fields ) {
@@ -735,10 +744,13 @@
 				  WHERE id='$t_bug_text_id'";
 		db_query( $query );
 
+		
 		# Delete the bug entry
 		$query = "DELETE FROM $t_bug_table
 				  WHERE id='$c_bug_id'";
 		db_query( $query );
+		
+		
 
 		bug_clear_cache( $p_bug_id );
 		bug_text_clear_cache( $p_bug_id );
@@ -781,6 +793,12 @@
 		$c_bug_id		= db_prepare_int( $p_bug_id );
 		$c_bug_data		= bug_prepare_db( $p_bug_data );
 
+
+		$t_current_user_id = auth_get_current_user_id();
+		$t_global_level = access_get_global_level($t_current_user_id);
+		$t_local_level = project_get_local_user_access_level( $c_bug_data->project_id, $t_current_user_id );
+
+
 		# Summary cannot be blank
 		if ( is_blank( $c_bug_data->summary ) ) {
 			error_parameters( lang_get( 'summary' ) );
@@ -794,6 +812,27 @@
 				trigger_error( ERROR_EMPTY_FIELD, ERROR );
 			}
 		}
+		
+		#check deadline format
+		if ( !is_blank( $c_bug_data->deadline ) ) {
+			$t_a = explode( '-', $c_bug_data->deadline );
+			if ( !checkdate((integer) $t_a[1], (integer)$t_a[2], (integer)$t_a[0]) ) {
+				error_parameters( lang_get( 'deadline' ) );
+				trigger_error( ERROR_WRONG_DATE_FORMAT, ERROR );
+			}
+		}
+		
+		#check if the user can set the status
+		if ( $c_bug_data->status >= config_get( 'task_aproved_threshold' ) && 
+			$c_bug_data->severity == config_get( 'task_severity_threshold' ) ) {
+			if ( $t_global_level == ADMINISTRATOR || 
+			    $t_local_level >= config_get( 'task_manager_threshold' ) || 
+				$t_current_user_id == $c_bug_data->handler_id ) {
+			} else {
+				trigger_error( ERROR_ACCESS_DENIED, ERROR );
+			}
+		}
+		
 
 		if( !is_blank( $p_bug_data->duplicate_id ) && ( $p_bug_data->duplicate_id != 0 ) && ( $p_bug_id == $p_bug_data->duplicate_id ) ) {
 			trigger_error( ERROR_BUG_DUPLICATE_SELF, ERROR );  # never returns
@@ -839,11 +878,45 @@
 					view_state='$c_bug_data->view_state',
 					summary='$c_bug_data->summary',
 					sponsorship_total='$c_bug_data->sponsorship_total',
-					sticky='$c_bug_data->sticky'
-				WHERE id='$c_bug_id'";
+					sticky='$c_bug_data->sticky',
+					task_order='$c_bug_data->task_order', ";
+		if ( is_blank( $c_bug_data->deadline ) ) {
+				$query .= "deadline=null ";
+		} else {
+				$query .= "deadline='$c_bug_data->deadline' ";
+		}
+		$query .= "WHERE id='$c_bug_id'";
 		db_query( $query );
 
+		# deal with tasks
+		if ( $c_bug_data->status < CLOSED ) {
+		if ( $t_old_data->severity == config_get( 'task_severity_threshold' ) ) {
+		  if ( $c_bug_data->severity != config_get( 'task_severity_threshold' ) ) {
+		  	task_remove_task ( $p_bug_id );
+		  }  else {
+		  	if ( $t_old_data->handler_id != $c_bug_data->handler_id ) {
+		  		task_remove_task( $p_bug_id );
+		  		task_add_task( $p_bug_id, $c_bug_data->handler_id );
+				history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_added' ), user_get_realname( $c_bug_data->handler_id) );
+		  		
+		  	}
+		  }
+		} else if ( $c_bug_data->severity == config_get( 'task_severity_threshold' ) && 
+			    $c_bug_data->status < CLOSED) {
+		  	task_add_task( $p_bug_id, $c_bug_data->handler_id );
+			history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_added' ), $c_bug_data->handler_id > 0 ? user_get_realname( $c_bug_data->handler_id):'' );
+		}
+		} else {
+			task_remove_task( $p_bug_id );
+			#history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_removed' ), user_get_realname( $c_bug_data->handler_id ) );
+		}
+		
+		
+		
+		
 		bug_clear_cache( $p_bug_id );
+		
+		 		
 
 		# log changes
 		history_log_event_direct( $p_bug_id, 'project_id', $t_old_data->project_id, $p_bug_data->project_id );
@@ -871,7 +944,8 @@
 		history_log_event_direct( $p_bug_id, 'summary', $t_old_data->summary, $p_bug_data->summary );
 		history_log_event_direct( $p_bug_id, 'sponsorship_total', $t_old_data->sponsorship_total, $p_bug_data->sponsorship_total );
 		history_log_event_direct( $p_bug_id, 'sticky', $t_old_data->sticky, $p_bug_data->sticky );
-
+		history_log_event_direct( $p_bug_id, 'deadline', $t_old_data->deadline, $p_bug_data->deadline );
+		
 		# Update extended info if requested
 		if ( $p_update_extended ) {
 			$t_bug_text_table = config_get( 'mantis_bug_text_table' );
@@ -1157,7 +1231,9 @@
 		bug_update_date( $p_bug_id );
 
 		# log changes
-		history_log_event_direct( $p_bug_id, $p_field_name, $h_status, $p_status );
+		if ( !$p_field_name === 'task_order' ) { 
+		    	history_log_event_direct( $p_bug_id, $p_field_name, $h_status, $p_status );
+		}
 
 		bug_clear_cache( $p_bug_id );
 
@@ -1169,11 +1245,12 @@
 	function bug_assign( $p_bug_id, $p_user_id, $p_bugnote_text='', $p_bugnote_private = false ) {
 		$c_bug_id	= db_prepare_int( $p_bug_id );
 		$c_user_id	= db_prepare_int( $p_user_id );
+		$c_task = task_is_task( $p_bug_id );
 
 		if ( ( $c_user_id != NO_USER ) && !access_has_bug_level( config_get( 'handle_bug_threshold' ), $p_bug_id, $p_user_id ) ) {
 		    trigger_error( ERROR_USER_DOES_NOT_HAVE_REQ_ACCESS );
 		}
-
+		
 		# extract current information into history variables
 		$h_status		= bug_get_field( $p_bug_id, 'status' );
 		$h_handler_id	= bug_get_field( $p_bug_id, 'handler_id' );
@@ -1206,11 +1283,22 @@
 
 			# updated the last_updated date
 			bug_update_date( $p_bug_id );
+			if ( $c_task ) {
+				task_add_task( $p_bug_id, $p_user_id );
+				if ( $p_user_id ) {
+					history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_added' ), user_get_realname( $p_user_id ) );
+				} else {
+					history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_added' ), '' );				
+				}
+			}
+			
+			
 
 			bug_clear_cache( $p_bug_id );
 
 			# send assigned to email
 			email_assign( $p_bug_id );
+			
 		}
 
 		return true;
@@ -1219,10 +1307,22 @@
 	# --------------------
 	# close the given bug
 	function bug_close( $p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false, $p_time_tracking = '0:00' ) {
+	
 		$p_bugnote_text = trim( $p_bugnote_text );
 
 		bug_set_field( $p_bug_id, 'status', CLOSED );
 
+		# check if bug is a task
+		$c_task = task_is_task( $p_bug_id );
+		if ( $c_task ) {
+		    $t_user_id = bug_get_field( $p_bug_id, 'handler_id' );
+		    task_close_task( $p_bug_id );
+		    history_log_event_direct( $p_bug_id, lang_get( 'task_is_task' ), lang_get( 'task_removed' ), user_get_realname( $t_user_id ) );
+		    //info do historii
+		}
+
+		
+		
 		# Add bugnote if supplied
 		if ( !is_blank( $p_bugnote_text ) ) {
 			bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private );
@@ -1235,10 +1335,31 @@
 			email_relationship_child_closed( $p_bug_id );
 		}
 		# MASC RELATIONSHIP
+							
+		return true;
+	}
+
+	# --------------------
+	# process the given bug
+	function bug_process( $p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false ) {
+		$t_status_prefix = 'email_notification_title_for_status_bug_';
+		
+		$p_bugnote_text = trim( $p_bugnote_text );
+		
+		$h_status = bug_get_field( $p_bug_id, 'status' );
+		
+		bug_set_field( $p_bug_id, 'status', PROCESSED );
 
+		# Add bugnote if supplied
+		if ( !is_blank( $p_bugnote_text ) ) {
+			bugnote_add( $p_bug_id, $p_bugnote_text, $p_bugnote_private );
+		}
+		history_log_event_direct( $p_bug_id, 'status', $h_status, PROCESSED );				
+		email_generic( $p_bug_id, 'processed', $t_status_prefix . 'processed' );
 		return true;
 	}
 
+
 	# --------------------
 	# resolve the given bug
 	function bug_resolve( $p_bug_id, $p_resolution, $p_fixed_in_version = '', $p_bugnote_text = '', $p_duplicate_id = null, $p_handler_id = null, $p_bugnote_private = false, $p_time_tracking = '0:00' ) {
@@ -1327,6 +1448,12 @@
 
 		bug_set_field( $p_bug_id, 'status', config_get( 'bug_reopen_status' ) );
 		bug_set_field( $p_bug_id, 'resolution', config_get( 'bug_reopen_resolution' ) );
+		$c_handler_id = bug_get_field( $p_bug_id, 'handler_id');
+		if ( $c_handler_id != NOUSER ) {
+		    $c_task = task_is_task( $p_bug_id );
+    		    task_add_task ( $p_bug_id, $c_handler_id );
+		}
+		
 
 		# Add bugnote if supplied
 		if ( !is_blank( $p_bugnote_text ) ) {
@@ -1448,10 +1575,13 @@
 		$t_bug_data->summary			= db_prepare_string( $p_bug_data->summary );
 		$t_bug_data->sponsorship_total	= db_prepare_int( $p_bug_data->sponsorship_total );
 		$t_bug_data->sticky				= db_prepare_int( $p_bug_data->sticky );
+		$t_bug_data->task_order			= db_prepare_int( $p_bug_data->task_order );
 
 		$t_bug_data->description		= db_prepare_string( $p_bug_data->description );
 		$t_bug_data->steps_to_reproduce	= db_prepare_string( $p_bug_data->steps_to_reproduce );
 		$t_bug_data->additional_information	= db_prepare_string( $p_bug_data->additional_information );
+		$t_bug_data->deadline			= db_prepare_date( $p_bug_data->deadline );
+		$t_bug_data->task_order			= db_prepare_int( $p_bug_data->task_order );
 
 		return $t_bug_data;
 	}
@@ -1476,6 +1606,7 @@
 		$p_bug_data->description		= string_textarea( $p_bug_data->description );
 		$p_bug_data->steps_to_reproduce	= string_textarea( $p_bug_data->steps_to_reproduce );
 		$p_bug_data->additional_information	= string_textarea( $p_bug_data->additional_information );
+		$p_bug_data->deadline 			= string_textarea( $p_bug_data->deadline );
 
 		return $p_bug_data;
 	}
@@ -1500,6 +1631,7 @@
 		$p_bug_data->description		= string_display_links( $p_bug_data->description );
 		$p_bug_data->steps_to_reproduce	= string_display_links( $p_bug_data->steps_to_reproduce );
 		$p_bug_data->additional_information	= string_display_links( $p_bug_data->additional_information );
+		$p_bug_data->deadline = 		string_display_line( $p_bug_data->deadline );
 
 		return $p_bug_data;
 	}
diff -Naur mantis-1.1.1/core/bugnote_api.php mantis/core/bugnote_api.php
--- mantis-1.1.1/core/bugnote_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/bugnote_api.php	2008-02-13 09:54:09.000000000 +0100
@@ -489,7 +489,7 @@
 
 		$t_results = array();
 
-		$query = "SELECT username, SUM(time_tracking) sum_time_tracking
+		$query = "SELECT username, SUM(time_tracking) as sum_time_tracking
 				FROM $t_user_table u, $t_bugnote_table bn
 				WHERE u.id = bn.reporter_id AND
 				bn.bug_id = '$c_bug_id'
@@ -540,7 +540,7 @@
 
 		$t_results = array();
 
-		$query = "SELECT username, summary, bn.bug_id, SUM(time_tracking) sum_time_tracking
+		$query = "SELECT username, summary, bn.bug_id, SUM(time_tracking) as sum_time_tracking
 			FROM $t_user_table u, $t_bugnote_table bn, $t_bug_table b
 			WHERE u.id = bn.reporter_id AND bn.time_tracking != 0 AND bn.bug_id = b.id
 			$t_project_where $t_from_where $t_to_where
diff -Naur mantis-1.1.1/core/columns_api.php mantis/core/columns_api.php
--- mantis-1.1.1/core/columns_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/columns_api.php	2008-02-12 11:41:55.000000000 +0100
@@ -401,7 +401,6 @@
 	function print_column_edit( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
 		if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
 			global $t_icon_path, $t_update_bug_threshold;
-
 			echo '<td>';
 			if ( !bug_is_readonly( $p_row['id'] )
 		  		&& access_has_bug_level( $t_update_bug_threshold, $p_row['id'] ) ) {
@@ -653,4 +652,18 @@
 		}
 		echo '</td>';
 	}
-?>
+
+	# --------------------
+	# $p_columns_target: see COLUMNS_TARGET_* in   constant_inc.php
+	function print_column_deadline( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
+		if ( $p_row['status'] < RESOLVED && !is_blank( $p_row['deadline']) ) {
+			echo '<td class="deadline">'.$p_row['deadline'];
+		} else if ( !is_blank( $t_row['deadline'] ) ) {
+			echo '<td>'.$t_bug->deadline;
+		} else {
+			echo '<td>';
+		}
+		echo '</td>';
+	}
+
+?> 
diff -Naur mantis-1.1.1/core/constant_inc.php mantis/core/constant_inc.php
--- mantis-1.1.1/core/constant_inc.php	2008-01-19 09:12:15.000000000 +0100
+++ mantis/core/constant_inc.php	2008-02-18 19:43:01.000000000 +0100
@@ -44,6 +44,7 @@
 	define( 'REPORTER',			25 );
 	define( 'UPDATER',			40 );
 	define( 'DEVELOPER',		55 );
+	define( 'TASK_MANAGER',		60 );
 	define( 'MANAGER',			70 );
 	define( 'ADMINISTRATOR',	90 );
 	define( 'NOBODY',			100 );
@@ -57,6 +58,7 @@
 	define( 'ACKNOWLEDGED',		30 );
 	define( 'CONFIRMED',		40 );
 	define( 'ASSIGNED',			50 );
+	define( 'PROCESSED',			60 );
 	define( 'RESOLVED',			80 );
 	define( 'CLOSED',			90 );
 
@@ -194,6 +196,8 @@
 	define( 'ERROR_FTP_CONNECT_ERROR',				16 );
 	define( 'ERROR_HANDLER_ACCESS_TOO_LOW',				17 );
 	define( 'ERROR_PAGE_REDIRECTION',				18 );
+	define( 'ERROR_WRONG_DATE_FORMAT', 				100 );
+		
 
 	# ERROR_CONFIG_*
 	define( 'ERROR_CONFIG_OPT_NOT_FOUND',			100 );
@@ -351,7 +355,8 @@
 	define( 'META_FILTER_MYSELF',	-1 );
 	define( 'META_FILTER_NONE',     -2  );
 	define( 'META_FILTER_CURRENT',	-3 );
-	define( 'META_FILTER_ANY',      0   );
+	define( 'META_FILTER_ANY',      0   ); # means all	
+	define( 'META_FILTER_BUGS',	-1  );	# bugs only
 
 	# Versions
 	define( 'VERSION_ALL',		null );
@@ -374,6 +379,7 @@
 	define( 'TOKEN_GRAPH',			2 );
 	define( 'TOKEN_LAST_VISITED',	3 );
 	define( 'TOKEN_AUTHENTICATED',	4 );
+	define( 'TOKEN_TASK_VIEW',	1001);
 	define( 'TOKEN_USER',			1000 );
 
 	# token expirations
@@ -397,7 +403,7 @@
 	define( 'CUSTOM_FIELD_DATE_ONORAFTER',	7 ) ;
 
 	# system logging
-	#  logging levels, can be OR'd together
+	#  logging levels, can be OR'd together'
 	define( 'LOG_NONE',                     0 );  # no logging
 	define( 'LOG_EMAIL',                    1 );  # all emails sent
 	define( 'LOG_EMAIL_RECIPIENT',          2 );  # details of email recipient determination
@@ -408,10 +414,19 @@
 	define( 'COLUMNS_TARGET_VIEW_PAGE',   1 );
 	define( 'COLUMNS_TARGET_PRINT_PAGE',  2 );
 	define( 'COLUMNS_TARGET_CSV_PAGE',    3 );
+	define( 'COLUMNS_TARGET_TASK_VIEW_PAGE', 10 );
 
 	# sponsorship "paid" values
 	define( 'SPONSORSHIP_UNPAID',         0 );
 	define( 'SPONSORSHIP_REQUESTED',      1 );
 	define( 'SPONSORSHIP_PAID',           2 );
+	
+	# task view pages
+	define( 'TASK_VIEW_SINGLE_USER',	1 );
+	define( 'TASK_VIEW_SINGLE_USER_ALL',	2 );
+	define( 'TASK_VIEW_PROJECT',		4 );
+	define( 'TASK_VIEW_PROJECT_ALL',	8 );
+	define( 'TASK_VIEW_GLOBAL',		16 );
+	define( 'TASK_VIEW_GLOBAL_ALL',		32 );	
 
 ?>
diff -Naur mantis-1.1.1/core/custom_function_api.php mantis/core/custom_function_api.php
--- mantis-1.1.1/core/custom_function_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/custom_function_api.php	2008-02-22 09:42:00.000000000 +0100
@@ -197,6 +197,8 @@
 			$t_columns = config_get( 'csv_columns' );
 		} else if ( $p_columns_target == COLUMNS_TARGET_VIEW_PAGE ) {
 			$t_columns = config_get( 'view_issues_page_columns' );
+		} else if ( $p_columns_target == COLUMNS_TARGET_TASK_VIEW_PAGE ) {
+			$t_columns = config_get( 'view_task_page_columns' );
 		} else {
 			$t_columns = config_get( 'print_issues_page_columns' );
 		}
@@ -210,11 +212,14 @@
 	# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
 	function custom_function_default_print_column_title( $p_column, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
 		global $t_sort, $t_dir;
-
+		$t_columns_target = $p_columns_target;
+		if ( $p_columns_target == COLUMNS_TARGET_TASK_VIEW_PAGE ) {
+		    $t_columns_target = COLUMNS_TARGET_VIEW_PAGE;
+		}
 		if ( strpos( $p_column, 'custom_' ) === 0 ) {
 			$t_custom_field = substr( $p_column, 7 );
 
-			if ( COLUMNS_TARGET_CSV_PAGE != $p_columns_target ) {
+			if ( COLUMNS_TARGET_CSV_PAGE != $t_columns_target ) {
 				echo '<td>';
 			}
 
@@ -224,25 +229,25 @@
 			} else {
 				$t_def = custom_field_get_definition( $t_field_id );
 				$t_custom_field = lang_get_defaulted( $t_def['name'] );
-
+				
 				if ( COLUMNS_TARGET_CSV_PAGE != $p_columns_target ) {
-					print_view_bug_sort_link( $t_custom_field, $p_column, $t_sort, $t_dir, $p_columns_target );
+					print_view_bug_sort_link( $t_custom_field, $p_column, $t_sort, $t_dir, $t_columns_target );
 					print_sort_icon( $t_dir, $t_sort, $p_column );
 				} else {
 					echo $t_custom_field;
 				}
 			}
 
-			if ( COLUMNS_TARGET_CSV_PAGE != $p_columns_target ) {
+			if ( COLUMNS_TARGET_CSV_PAGE != $t_columns_target ) {
 				echo '</td>';
 			}
 		} else {
 			$t_function = 'print_column_title_' . $p_column;
 			if ( function_exists( $t_function ) ) {
-				$t_function( $t_sort, $t_dir, $p_columns_target );
+				$t_function( $t_sort, $t_dir, $t_columns_target );
 			} else {
 				echo '<td>';
-				print_view_bug_sort_link( lang_get_defaulted( $p_column ), $p_column, $t_sort, $t_dir, $p_columns_target );
+				print_view_bug_sort_link( lang_get_defaulted( $p_column ), $p_column, $t_sort, $t_dir, $t_columns_target );
 				print_sort_icon( $t_dir, $t_sort, $p_column );
 				echo '</td>';
 			}
@@ -257,7 +262,11 @@
 	# $p_row: the row from the bug table that belongs to the issue that we should print the values for.
 	# $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php
 	function custom_function_default_print_column_value( $p_column, $p_issue_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
-		if ( COLUMNS_TARGET_CSV_PAGE == $p_columns_target ) {
+		$t_columns_target = $p_columns_target;
+		if ( $p_columns_target == COLUMNS_TARGET_TASK_VIEW_PAGE ) {
+			$t_columns_target = COLUMNS_TARGET_VIEW_PAGE;
+		}		
+		if ( COLUMNS_TARGET_CSV_PAGE == $t_columns_target ) {
 			$t_column_start = '';
 			$t_column_end = '';
 			$t_column_empty = '';
@@ -288,15 +297,14 @@
 			}
 			echo $t_column_end;
 		} else {
-			if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
+			if ( $t_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
 				$t_function = 'print_column_' . $p_column;
 			} else {
 				$t_function = 'csv_format_' . $p_column;
 			}
-
 			if ( function_exists( $t_function ) ) {
-				if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
-					$t_function( $p_issue_row, $p_columns_target );
+				if ( $t_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
+					$t_function( $p_issue_row, $t_columns_target );
 				} else {
 					$t_function( $p_issue_row[$p_column] );
 				}
diff -Naur mantis-1.1.1/core/database_api.php mantis/core/database_api.php
--- mantis-1.1.1/core/database_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/database_api.php	2008-02-17 00:13:34.000000000 +0100
@@ -516,9 +516,7 @@
 		}
 
 		// Format
-		$t_formatted = $t_a[0] . '-';
-		$t_formatted .= ($t_a[1] < 10 ? "0" . $t_a[1] : $t_a[1]) . '-';
-		$t_formatted .= ($t_a[2] < 10 ? "0" . $t_a[2] : $t_a[2]);
+		$t_formatted = sprintf('%04d-%02d-%02d', $t_a[0], $t_a[1], $t_a[2]);
 
 		return $t_formatted;
 	}
diff -Naur mantis-1.1.1/core/email_api.php mantis/core/email_api.php
--- mantis-1.1.1/core/email_api.php	2008-01-19 08:43:47.000000000 +0100
+++ mantis/core/email_api.php	2008-02-22 09:45:20.000000000 +0100
@@ -34,6 +34,7 @@
 	require_once( $t_core_dir . 'relationship_api.php' );
 	require_once( $t_core_dir . 'disposable' . DIRECTORY_SEPARATOR . 'disposable.php' );
 	require_once( PHPMAILER_PATH . 'class.phpmailer.php' );
+	require_once( $t_core_dir . 'task_api.php' );
 
 	# reusable object of class SMTP
 	$g_phpMailer_smtp = null;
@@ -292,6 +293,7 @@
 		unset( $t_status_change[FEEDBACK] );
 		unset( $t_status_change[RESOLVED] );
 		unset( $t_status_change[CLOSED] );
+		unset( $t_status_change[PROCESSED] );
 
 		if ( 'owner' == $p_notify_type ) {
 			$t_pref_field = 'email_on_assigned';
@@ -337,7 +339,6 @@
 					$t_min_sev_pref_field = $t_pref_field . '_min_severity';
 					$t_min_sev_notify     = user_pref_get_pref( $t_id, $t_min_sev_pref_field );
 					$t_bug_severity       = bug_get_field( $p_bug_id, 'severity' );
-
 					if ( $t_bug_severity < $t_min_sev_notify ) {
 						log_event( LOG_EMAIL_RECIPIENT, "bug=$p_bug_id, drop $t_id (pref threshold)" );
 						continue;
@@ -839,9 +840,14 @@
 		$p_subject = bug_get_field( $p_bug_id, 'summary' );
 
 		# padd the bug id with zeros
+		if ( bug_get_field( $p_bug_id, 'severity' ) == config_get( 'task_severity_threshold' ) ) {
+			$t_title = lang_get( 'email_subject_task' );
+		} else {
+			$t_title = lang_get( 'email_subject_bug' );
+		}
 		$p_bug_id = bug_format_id( $p_bug_id );
 
-		return '['.$p_project_name.' '.$p_bug_id.']: '.$p_subject;
+		return '['.$p_project_name.' '.$t_title.']: '.$p_subject;
 	}
 	# --------------------
 	# clean up LF to CRLF
diff -Naur mantis-1.1.1/core/filter_api.php mantis/core/filter_api.php
--- mantis-1.1.1/core/filter_api.php	2008-01-05 07:58:22.000000000 +0100
+++ mantis/core/filter_api.php	2008-02-22 09:48:28.000000000 +0100
@@ -362,7 +362,7 @@
 
 		$t_filter = array(
 			'show_category'		=> Array ( '0' => META_FILTER_ANY ),
-			'show_severity'		=> Array ( '0' => META_FILTER_ANY ),
+			'show_severity'		=> Array ( '0' => META_FILTER_BUGS ),
 			'show_status'		=> Array ( '0' => META_FILTER_ANY ),
 			'highlight_changed'	=> $t_default_show_changed,
 			'reporter_id'		=> Array ( '0' => META_FILTER_ANY ),
@@ -448,7 +448,7 @@
 		} else {
 			$t_filter = $p_custom_filter;
 		}
-
+		
 		$t_filter = filter_ensure_valid_filter( $t_filter );
 
 		if ( false === $t_filter ) {
@@ -713,9 +713,13 @@
 
 		# severity
 		$t_any_found = false;
+		$t_bugs = false;
 		foreach( $t_filter['show_severity'] as $t_filter_member ) {
 			if ( ( META_FILTER_ANY == $t_filter_member ) || ( 0 === $t_filter_member ) ) {
 				$t_any_found = true;
+			} else if ( META_FILTER_BUGS == $t_filter_member ) {
+				$t_any_found = true;
+				$t_bugs = true;
 			}
 		}
 		if ( count( $t_filter['show_severity'] ) == 0 ) {
@@ -734,6 +738,10 @@
 				array_push( $t_where_clauses, "( $t_bug_table.severity=$t_clauses[0] )" );
 			}
 		}
+		if ( $t_bugs ) {
+			$t_feature = config_get( 'task_severity_threshold' );
+			array_push( $t_where_clauses, "( $t_bug_table.severity > $t_feature )" ); 
+		}
 
 		# show / hide status
 		# take a list of all available statuses then remove the ones that we want hidden, then make sure
@@ -1813,7 +1821,8 @@
 								$t_output = '';
 								$t_any_found = false;
 								if ( count( $t_filter['show_severity'] ) == 0 ) {
-									PRINT lang_get( 'any' );
+									#PRINT lang_get( 'any' );
+									PRINT lang_get( 'view_bugs_link' );
 								} else {
 									$t_first_flag = true;
 									foreach( $t_filter['show_severity'] as $t_current ) {
@@ -1821,7 +1830,7 @@
 										<input type="hidden" name="show_severity[]" value="<?php echo $t_current;?>" />
 										<?php
 										$t_this_string = '';
-										if ( ( $t_current === META_FILTER_ANY ) || ( is_blank( $t_current ) ) || ( $t_current == 0 ) ) {
+										if ( ( $t_current === META_FILTER_ANY ) || ( $t_current === META_FILTER_BUGS ) || ( is_blank( $t_current ) ) || ( $t_current == 0 ) ) {
 											$t_any_found = true;
 										} else {
 											$t_this_string = get_enum_element( 'severity', $t_current );
@@ -1834,7 +1843,8 @@
 										$t_output = $t_output . $t_this_string;
 									}
 									if ( true == $t_any_found ) {
-										PRINT lang_get( 'any' );
+										#PRINT lang_get( 'any' );
+										PRINT lang_get( 'view_bugs_link' );
 									} else {
 										PRINT $t_output;
 									}
@@ -3123,6 +3133,9 @@
 		if ( !isset( $p_filter_arr['tag_select'] ) ) {
 			$p_filter_arr['tag_select'] = gpc_get_string( 'tag_select', '' );
 		}
+		if ( !isset( $p_filter_arr['show_severity'] ) ) {
+			$p_filter_arr['show_severity'] = META_FILTER_BUGS;
+		}
 
 		$t_custom_fields 		= custom_field_get_ids(); # @@@ (thraxisp) This should really be the linked ids, but we don't know the project
 		$f_custom_fields_data 	= array();
@@ -3400,7 +3413,8 @@
 		global $t_select_modifier, $t_filter;
 		?><!-- Severity -->
 			<select <?php PRINT $t_select_modifier;?> name="show_severity[]">
-				<option value="<?php echo META_FILTER_ANY ?>" <?php check_selected( $t_filter['show_severity'], META_FILTER_ANY ); ?>>[<?php echo lang_get( 'any' ) ?>]</option>
+				<option value="<?php echo META_FILTER_ANY ?>">[<?php echo lang_get( 'any' ) ?>]</option>
+				<option value="<?php echo META_FILTER_BUGS ?>" <?php check_selected( $t_filter['show_severity'], META_FILTER_BUGS ); ?>>[<?php echo lang_get( 'view_bugs_link' ) ?>]</option>
 				<?php print_enum_string_option_list( 'severity', $t_filter['show_severity'] ) ?>
 			</select>
 		<?php
diff -Naur mantis-1.1.1/core/history_api.php mantis/core/history_api.php
--- mantis-1.1.1/core/history_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/history_api.php	2008-02-13 11:10:42.000000000 +0100
@@ -33,19 +33,21 @@
 				$p_user_id	= auth_get_current_user_id();
 			}
 
-			$c_field_name	= db_prepare_string( $p_field_name );
-			$c_old_value	= db_prepare_string( $p_old_value );
-			$c_new_value	= db_prepare_string( $p_new_value );
-			$c_bug_id		= db_prepare_int( $p_bug_id );
-			$c_user_id		= db_prepare_int( $p_user_id );
+			if ( $c_field_name != 'task_order' ) {
+			    $c_field_name	= db_prepare_string( $p_field_name );
+			    $c_old_value	= db_prepare_string( $p_old_value );
+			    $c_new_value	= db_prepare_string( $p_new_value );
+			    $c_bug_id		= db_prepare_int( $p_bug_id );
+			    $c_user_id		= db_prepare_int( $p_user_id );
 
-			$t_mantis_bug_history_table = config_get( 'mantis_bug_history_table' );
+			    $t_mantis_bug_history_table = config_get( 'mantis_bug_history_table' );
 
-			$query = "INSERT INTO $t_mantis_bug_history_table
+			    $query = "INSERT INTO $t_mantis_bug_history_table
 						( user_id, bug_id, date_modified, field_name, old_value, new_value )
 					VALUES
 						( '$c_user_id', '$c_bug_id', " . db_now() . ", '$c_field_name', '$c_old_value', '$c_new_value' )";
-			$result = db_query( $query );
+			    $result = db_query( $query );
+			}
 		}
 	}
 	# --------------------
diff -Naur mantis-1.1.1/core/html_api.php mantis/core/html_api.php
--- mantis-1.1.1/core/html_api.php	2008-01-19 09:14:32.000000000 +0100
+++ mantis/core/html_api.php	2008-02-22 09:51:55.000000000 +0100
@@ -529,6 +529,9 @@
 				if ( access_has_project_level( config_get( 'report_bug_threshold' ) ) ) {
 					$t_menu_options[] = string_get_bug_report_link();
 				}
+    
+				# Task List
+				$t_menu_options[] = '<a href="task_list_page.php">' . lang_get( 'task_list_link' ) . '</a>';
 
 				# Changelog Page
 				if ( access_has_project_level( config_get( 'view_changelog_threshold' ) ) ) {
@@ -954,17 +957,41 @@
 	}
 
 	# --------------------
+	# Print a button to update the given bug
+	function html_button_process_update( $p_bug_id ) {
+		$t_bug_current_state = bug_get_field( $p_bug_id, 'status' );
+		$t_bug_current_handler = bug_get_field( $p_bug_id, 'handler_id' );
+		$t_current_user_id = auth_get_current_user_id();		
+		if ( ($t_bug_current_state != 60) && 
+			$t_bug_current_handler == $t_current_user_id &&
+			access_has_bug_level( config_get( 'update_process_threshold' ), $p_bug_id ) ) {
+		    echo "<form method=\"post\" action=\"bug_process.php\">";
+		    $t_button_text = lang_get( 'bug_process_button' );
+		    echo "<input type=\"submit\" class=\"button\" value=\"$t_button_text\" />";
+		    $t_bug_id = string_attribute( $p_bug_id );
+		    echo "<input type=\"hidden\" name=\"bug_id\" value=\"$t_bug_id\" />\n";
+		    echo "</form>\n";
+		}
+	}
+
+
+	# --------------------
 	# Print Change Status to: button
 	#  This code is similar to print_status_option_list except
 	#   there is no masking, except for the current state
 	function html_button_bug_change_status( $p_bug_id ) {
 		$t_bug_project_id = bug_get_field( $p_bug_id, 'project_id' );
 		$t_bug_current_state = bug_get_field( $p_bug_id, 'status' );
+		$t_bug_current_severity = bug_get_field( $p_bug_id, 'severity' );
 		$t_current_access = access_get_project_level( $t_bug_project_id );
 
 		$t_enum_list = get_status_option_list( $t_current_access, $t_bug_current_state, false,
 				( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() && ( ON == config_get( 'allow_reporter_close' ) ) ) );
-
+		if ( ($t_bug_current_state <= $g_bug_assigned_status ) &&
+			( $t_current_access >= config_get( 'task_manager_threshold' ) ) && 
+			( $t_bug_current_severity == config_get( 'task_severity_threshold' ) ) )
+			$t_enum_list[CLOSED] = get_enum_element( 'status', CLOSED );
+		
 		if ( count( $t_enum_list ) > 0 ) {
 			# resort the list into ascending order after noting the key from the first element (the default)
 			$t_default_arr = each( $t_enum_list );
@@ -1175,6 +1202,11 @@
 			echo '<td class="center">';
 			html_button_bug_update( $p_bug_id );
 			echo '</td>';
+			
+			# PROCESS button
+			echo '<td class="center">';
+			html_button_process_update( $p_bug_id );
+			echo '</td>';
 
 			# ASSIGN button
 			echo '<td class="center">';
diff -Naur mantis-1.1.1/core/print_api.php mantis/core/print_api.php
--- mantis-1.1.1/core/print_api.php	2008-01-16 23:16:24.000000000 +0100
+++ mantis/core/print_api.php	2008-02-21 09:31:17.000000000 +0100
@@ -1055,6 +1055,66 @@
 			PRINT "<option value=\"".$key."\">".$val."</option>";
 		}
 	}
+	
+	# --------------------
+	# @@@ preliminary support for multiple task actions.
+	function print_all_task_action_option_list() {
+		$commands = array(  
+							'CLOSE' => lang_get('actiongroup_menu_close'),
+							'UP_CATEGORY' => lang_get('actiongroup_menu_update_category'),
+							'EXT_ADD_NOTE' => lang_get( 'actiongroup_menu_add_note' ),
+							'EXT_ATTACH_TAGS' => lang_get( 'actiongroup_menu_attach_tags' ),
+					);
+
+		$t_project_id = helper_get_current_project();
+
+		if ( ALL_PROJECTS != $t_project_id ) {
+			$t_user_id = auth_get_current_user_id();
+
+			if ( access_has_project_level( config_get( 'update_bug_threshold' ), $t_project_id ) ) {
+				$commands['UP_FIXED_IN_VERSION'] = lang_get( 'actiongroup_menu_update_fixed_in_version' );
+			}
+
+			if ( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_project_id ) ) {
+				$commands['UP_TARGET_VERSION'] = lang_get( 'actiongroup_menu_update_target_version' );
+			}
+			if ( current_user_get_access_level() >= config_get( 'task_manager_threshold' ) ){
+				$commands['UP_DEADLINE'] = lang_get( 'actiongroup_menu_update_deadline' );
+			}
+
+			$t_custom_field_ids = custom_field_get_linked_ids( $t_project_id );
+
+			foreach( $t_custom_field_ids as $t_custom_field_id ) {
+				# if user has not access right to modify the field, then there is no
+				# point in showing it.
+				if ( !custom_field_has_write_access_to_project( $t_custom_field_id, $t_project_id, $t_user_id ) ) {
+					continue;
+				}
+
+				$t_custom_field_def = custom_field_get_definition( $t_custom_field_id );
+				$t_command_id = 'custom_field_' . $t_custom_field_id;
+				$t_command_caption = sprintf( lang_get( 'actiongroup_menu_update_field' ), lang_get_defaulted( $t_custom_field_def['name'] ) );
+				$commands[$t_command_id] = string_display( $t_command_caption );
+			}
+		}
+
+		$t_custom_group_actions = config_get( 'custom_group_actions' );
+
+		foreach( $t_custom_group_actions as $t_custom_group_action ) {
+			# use label if provided to get the localized text, otherwise fallback to action name.
+			if ( isset( $t_custom_group_action['label'] ) ) {
+				$commands[$t_custom_group_action['action']] = lang_get_defaulted( $t_custom_group_action['label'] );
+			} else {
+				$commands[$t_custom_group_action['action']] = lang_get_defaulted( $t_custom_group_action['action'] );
+			}
+		}
+
+		while (list ($key,$val) = each ($commands)) {
+			PRINT "<option value=\"".$key."\">".$val."</option>";
+		}
+	}
+	
+	
 	# --------------------
 	# list of users that are NOT in the specified project and that are enabled
 	# if no project is specified use the current project
diff -Naur mantis-1.1.1/core/task_api.php mantis/core/task_api.php
--- mantis-1.1.1/core/task_api.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis/core/task_api.php	2008-02-22 09:54:35.000000000 +0100
@@ -0,0 +1,234 @@
+<?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/>.
+
+	# --------------------------------------------------------
+	# $Id: bug_api.php,v 1.111.2.1 2007-10-13 22:35:13 giallu Exp $
+	# --------------------------------------------------------
+
+	$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
+
+	require_once( $t_core_dir . 'bug_api.php' );
+	
+	function task_get_users ( $p_project_id ) {
+		$c_project_id = db_prepare_int( $p_project_id );
+		$t_user_table = config_get ( 'mantis_user_table' );
+		$t_users_in_project_table = config_get( 'mantis_project_user_list_table' ); 
+
+		$query = "SELECT distinct(user_id) as id, username
+			    FROM $t_user_table u, $t_users_in_project_table p
+			    WHERE u.id = p.user_id
+			    AND p.access_level >=".DEVELOPER;
+		if ( $p_project_id ) {
+		    $query .= " AND p.project_id = ".$c_project_id;
+		}
+		$query .= " ORDER BY u.username";
+		$db_result = db_query( $query );
+		$num_users = db_num_rows( $db_result );
+		$t_result = array();
+		for ( $i = 0; $i < $num_users; $i++ ) {
+			$t_row[] = db_fetch_array( $db_result );
+			array_push( $t_result, $t_row[$i]['id']);
+		}
+		return $t_result;
+	}
+	
+	# --------------------------
+	# Add a bug as a new task to the user
+	function task_add_task ( $p_bug_id, $p_user_id = null ) {
+		$t_bug_id = db_prepare_int ( $p_bug_id );
+		$t_current_project_id = bug_get_field( $p_bug_id, 'project_id' );
+
+		if ( $p_user_id ) {
+			//get next order number
+			$t_next_order = task_get_next_task_order( $p_user_id, $t_current_project_id );
+			$t_next_order = (integer)$t_next_order + 1; 
+		} else {
+			$t_severity = bug_get_field( $p_bug_id, 'severity' );
+			$t_next_order = task_get_next_task_order( null, $t_current_project_id, $t_severity );
+			$t_next_order = (integer)$t_next_order + 1; 
+		}
+		$temp = db_prepare_int( $t_next_order );
+		bug_set_field( $p_bug_id, 'task_order', $temp );	
+	}
+	
+	# --------------------------
+	# Removes task from a task list
+	function task_remove_task ( $p_bug_id ) {
+		bug_set_field( $p_bug_id, 'task_order', 0 );	    
+	}
+	
+
+	function task_get_next_task_order ( $p_user_id, $p_project_id, $p_status = NEW_ ) {
+		$t_status = db_prepare_int ( $p_sstatus );
+		$t_project_id = db_prepare_int ( $p_project_id );
+		$t_closed = CLOSED;
+		$t_bug_table = config_get( 'mantis_bug_table' );
+		if ( $p_user_id ) {
+			$query = "SELECT max(task_order) as next_order
+							FROM $t_bug_table
+							WHERE handler_id = $p_user_id
+							AND status < $t_closed";
+		} else {
+			$query = "SELECT max(task_order) as next_order
+							FROM $t_bug_table
+							WHERE project_id = $p_project_id
+							AND handler_id = 0
+							AND status"; 
+			# if task had status above new -> it was approved 
+			if ( $p_status >= config_get( 'task_aproved_threshold' ) ) {
+				$t_status = config_get( 'task_severity_threshold' );
+				$query .=" >= $t_status AND status < $t_closed";
+			} else {
+				$query .=" = $p_status";
+			}
+		}
+		$db_result = db_query( $query );
+		$t_result = array();
+		$t_row[] = db_fetch_array( $db_result );
+		return $t_row[0]['next_order'];
+	}
+	
+	function task_get_user_tasks( $p_user_id, $p_status = NEW_ ) {
+		$t_status = db_prepare_int ( $p_status );
+		$t_user_id = db_prepare_int ( $p_user_id );
+		$t_closed = CLOSED;
+		$t_severity = config_get( 'task_severity_threshold' );
+		$t_bug_table = config_get( 'mantis_bug_table' );
+		if ( $t_user_id ) {
+			$query = "SELECT id 
+							FROM $t_bug_table
+							WHERE handler_id = $t_user_id
+							AND severity = $t_severity
+							AND status < $t_closed"; 
+		} else {
+			$query = "SELECT id
+							FROM $t_bug_table
+							WHERE handler_id = 0
+							AND status";
+			if ( $p_status >= config_get( 'task_aproved_threshold' ) ) {
+				$t_status = config_get( 'task_severity_threshold' );
+				$query .=" >= $t_status AND status < $t_closed";
+			} else {
+				$query .=" = $p_status";
+			}						
+		}
+		$query .= " ORDER BY task_order ASC";
+		$db_result = db_query( $query );
+		$num_users = db_num_rows( $db_result );
+		$t_result = array();
+		for ( $i = 0; $i < $num_users; $i++ ) {
+			$t_row[] = db_fetch_array( $db_result );
+			array_push( $t_result, $t_row[$i]['id']);
+		}
+		return $t_result;
+		
+		
+	}
+	
+	function task_get_all_user_task ( $p_users, $p_closed = false )
+	{
+		$t_user_id = db_prepare_int ( $p_user_id );
+		$t_closed = CLOSED;
+		$t_severity = config_get( 'task_severity_threshold' );
+		$t_bug_table = config_get( 'mantis_bug_table' );
+		$query = "SELECT count(id) as count
+			FROM $t_bug_table
+			WHERE severity = $t_severity ";
+		if ( !$p_closed ) {
+			$query .= " AND status < $t_closed ";
+		}
+		$query .= "AND handler_id in ( ".implode( ',', $p_users ).")";
+		$db_result = db_query( $query );
+		$t_result = array();
+		$t_row[] = db_fetch_array( $db_result );
+		return $t_row[0]['count'];
+		
+	
+	}
+	
+	function task_get_unassigned_tasks( $p_project_id, $p_closed = false )
+	{
+		$t_bug_table = config_get( 'mantis_bug_table' );
+		$t_project_id = db_prepare_int( $p_project_id );
+		$t_closed = CLOSED;
+		$t_confirmed = config_get( 'task_aproved_threshold' );
+		$t_feature = config_get( 'task_severity_threshold' );
+		$query = "SELECT id
+						FROM $t_bug_table
+						WHERE project_id = $t_project_id
+						AND handler_id = 0
+						AND severity = $t_feature ";  
+		if ( $p_closed ) {
+				$query .= "AND status = $t_closed 
+								ORDER BY last_updated desc ";
+		} else {
+				$query .= "AND status >= $t_confirmed 
+								AND status < $t_closed 
+								ORDER BY task_order ASC";
+		}
+		$db_result = db_query( $query );
+		$num_users = db_num_rows( $db_result );
+		$t_result = array();
+		for ( $i = 0; $i < $num_users; $i++ ) {
+			$t_row[] = db_fetch_array( $db_result );
+			array_push( $t_result, $t_row[$i]['id']);
+		}
+		return $t_result;
+		
+	}
+
+	function task_get_unconfirmed_tasks( $p_project_id, $p_closed = false )
+	{
+		$t_bug_table = config_get( 'mantis_bug_table' );
+		$t_project_id = db_prepare_int( $p_project_id );
+		$t_closed = CLOSED;
+		$t_confirmed = config_get( 'task_aproved_threshold' );
+		$t_feature = config_get( 'task_severity_threshold' );
+		$query = "SELECT id
+						FROM $t_bug_table
+						WHERE project_id = $t_project_id
+						AND handler_id = 0
+						AND severity = $t_feature ";  
+		if ( $p_closed ) {
+				$query .= "AND status = $t_closed 
+								ORDER BY last_updated desc ";
+		} else {
+				$query .= "AND status < $t_confirmed 
+								AND status < $t_closed 
+								ORDER BY task_order ASC";
+		}
+		$db_result = db_query( $query );
+		$num_users = db_num_rows( $db_result );
+		$t_result = array();
+		for ( $i = 0; $i < $num_users; $i++ ) {
+			$t_row[] = db_fetch_array( $db_result );
+			array_push( $t_result, $t_row[$i]['id']);
+		}
+		return $t_result;
+		
+	}	
+	
+	function task_is_task ( $p_bug_id ) {
+		 $t_is_task = bug_get_field( $p_bug_id, 'severity' );
+		 if ( $t_is_task == config_get( 'task_severity_threshold' ) )
+		 	return true;
+		 else
+		   return false;
+	}
+?>
diff -Naur mantis-1.1.1/core/user_pref_api.php mantis/core/user_pref_api.php
--- mantis-1.1.1/core/user_pref_api.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/core/user_pref_api.php	2008-02-19 10:46:43.000000000 +0100
@@ -50,7 +50,9 @@
 		'email_on_status_min_severity' => 'default_email_on_status_minimum_severity',
 		'email_on_priority_min_severity' => 'default_email_on_priority_minimum_severity',
 		'email_bugnote_limit' => 'default_email_bugnote_limit',
-		'language' => 'default_language'
+		'language' => 'default_language',
+		'email_on_processed'	=> 'default_email_on_processed',
+		'email_on_processed_min_severity' => 'default_email_on_processed_minimum_severity'
 		);
 
 	#===================================
@@ -85,6 +87,8 @@
 		var $email_on_priority_min_severity = NULL;
 		var $email_bugnote_limit = NULL;
 		var $language = NULL;
+		var $email_on_processed = NULL;
+		var $email_on_processed_min_severity = NULL;
 
 		function UserPreferences() {
 			$this->default_profile                   	= 0;
diff -Naur mantis-1.1.1/css/default.css mantis/css/default.css
--- mantis-1.1.1/css/default.css	2007-08-24 21:04:44.000000000 +0200
+++ mantis/css/default.css	2008-02-14 10:00:20.000000000 +0100
@@ -44,6 +44,7 @@
 td.left				{ text-align: left; }
 td.right			{ text-align: right; }
 td.category			{ background-color: #c8c8e8; color: #000000; font-weight: bold; vertical-align : top; }
+td.deadline		{ background-color: #ff0000; color: #000000; font-weight: bold; text-align: center; }
 
 td.col-1			{ background-color: #d8d8d8; color: #000000; }
 td.col-2			{ background-color: #e8e8e8; color: #000000; }
@@ -59,7 +60,7 @@
 tr.spacer			{ background-color: #ffffff; color: #000000; height: 5px; }
 tr.row-1			{ background-color: #d8d8d8; color: #000000; }
 tr.row-2			{ background-color: #e8e8e8; color: #000000; }
-tr.row-category		{ background-color: #c8c8e8; color: #000000; font-weight: bold;}
+tr.row-category		{ background-color: #dadaef; color: #000000; font-weight: bold;}
 tr.row-category td  {  text-align:center; }
 tr.row-category2	{ background-color: #c8c8e8; color: #000000; }
 tr.row-category-history { background-color: #c8c8e8; color: #000000; font-weight: bold;}
diff -Naur mantis-1.1.1/images/accept.png mantis/images/accept.png
--- mantis-1.1.1/images/accept.png	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/accept.png	2008-02-07 09:19:55.000000000 +0100
@@ -0,0 +1,6 @@
+PNG
+
+   
IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˥KSa;vvl	dD!P{$;
ż,Kݽ6cL2r^H)-jsNm֔2qQB̽BatoL#z{q 'r=)La8,u%2Rg>ݾW ϛJ<!GA\lF$THC;
+تtxR~^^i2XCLd&3IM	_ؔ=\B@N2Ʋ9USPLB1U T!k0xpܞ#HBb1l5؄
+_1O,$O>߸Pd
makD|=G	Vn6[Įd 桚(Pm.0Q`'Fb#&ܧ6aP׏Q12[+zi; ]C17оpI9̾jD}?7ayze,hXAK^3*bk@+wQ=!}uXzq:g쯺n=:d+_GTA;ՐJƣ.!P)5!H:epր"݂"Kyw|{H2!i~3z_X;okBZK*
+^R:O(jF*^ȰS诿_gЬyc    IENDB`
\ No newline at end of file
diff -Naur mantis-1.1.1/images/arrow_down.gif mantis/images/arrow_down.gif
--- mantis-1.1.1/images/arrow_down.gif	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/arrow_down.gif	2008-02-07 11:30:07.000000000 +0100
@@ -0,0 +1,5 @@
+GIF89a       ssssstuuuuuvvvwxxxxxyyyz                                                                                                                                                      !  M ,       M()*+,-M$$4BJJE;.,@KE?@FLG/*<L89;==?,'(K579:>;&6C56:<=>GE(E8?#M	B73?"=AJ)
0A24!;<FD%!I135?Np
+
+
+b,w"$6@F!<$$bA,`a
+, ;
\ No newline at end of file
diff -Naur mantis-1.1.1/images/arrow_first.gif mantis/images/arrow_first.gif
--- mantis-1.1.1/images/arrow_first.gif	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/arrow_first.gif	2008-02-07 11:31:49.000000000 +0100
@@ -0,0 +1,2 @@
+GIF89a    sssssttttttuuuuuuvvvvvvwwwwyyyzzz                                                                                                                           !  V ,       V$!V+%9GQM:*-,NUMBAKR;/.JIHHGFR:1AUD

%2MOE FJ9V4SJFEC?><@KV5SKFF&
+I>=AN6NPG'	L?7TI@|PqqAP 9GDT"6z+'T Q!'S@15fȀb ;
\ No newline at end of file
diff -Naur mantis-1.1.1/images/arrow_last.gif mantis/images/arrow_last.gif
--- mantis-1.1.1/images/arrow_last.gif	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/arrow_last.gif	2008-02-07 11:31:59.000000000 +0100
@@ -0,0 +1,2 @@
+GIF89a    sssssttttttuuuuuuvvvvvvwwwwyyyzzz                                                                                                                           !  V ,       V+.023568V#(=KSSND7 "ITNHIOUPEUABDFFHV.TH	)U?L>I'GPN6NA=
+&5K@<>?CEFJS49JF EOM2%RF
8x&w(%Ux1(RjEB,$ʑ%V@`C
BDP  ;
\ No newline at end of file
diff -Naur mantis-1.1.1/images/arrow_up.gif mantis/images/arrow_up.gif
--- mantis-1.1.1/images/arrow_up.gif	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/arrow_up.gif	2008-02-07 11:32:08.000000000 +0100
@@ -0,0 +1,3 @@
+GIF89a    ssssstuuuuuvvvwxxxxxyyyz                                                                                                                                                         !  L ,       LL /=GC0"!DKC87AH1	%$5431J0
+'7K:88#>420H(CE;:>@/L*I@<26AL+IA >7D,DF=<;94B5
-:K>tسAC	\0]vP0H!"?|QB
+uI2n\X	  , ;
\ No newline at end of file
diff -Naur mantis-1.1.1/images/cancel.png mantis/images/cancel.png
--- mantis-1.1.1/images/cancel.png	1970-01-01 01:00:00.000000000 +0100
+++ mantis/images/cancel.png	2008-02-07 09:26:18.000000000 +0100
@@ -0,0 +1,7 @@
+PNG
+
+   
IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˥kkAkH !)4^cƘ4eJKi(̇\ ĕή;OgV7U/þϙ3`
+
+Fe`
݇[:WnF{2 28dA2I>w&B;6Y$
+ZŽ=DUemӁfZ/Rm	Cz/
+tB ̛NJ	a;rdN,XX' >Kry88 x__Y7ͫʹZȋ==tajD_RA#(Uxf84ݹ9n2$b'C{M9Hj9,=ݫR,2Z˾u0(fԘycRݵt#]畸ݿ    IENDB`
\ No newline at end of file
diff -Naur mantis-1.1.1/javascript/shifttasklist.js mantis/javascript/shifttasklist.js
--- mantis-1.1.1/javascript/shifttasklist.js	1970-01-01 01:00:00.000000000 +0100
+++ mantis/javascript/shifttasklist.js	2008-02-14 09:13:51.000000000 +0100
@@ -0,0 +1,168 @@
+
+function moveUp(e)
+{
+  var o;
+  if (window.event)
+  {
+    //alert("IE event");
+    o = event.srcElement;
+  }
+  else
+  {
+    //alert("DOM event " + arguments.length + " " + e);
+    o = e;
+  }
+
+  var currentRow = o.parentNode.parentNode;
+  var previousRow = currentRow.previousSibling;
+  var currentTable = currentRow.parentNode;
+
+  while ( previousRow ) {  
+    if ( previousRow.nodeName == "TR" ) {
+     if ( previousRow.className != "row-category" && previousRow.className != "task-row" ) {
+	currentTable.insertBefore( currentRow, previousRow );
+	return;
+     }
+     else
+        return;
+    }
+    previousRow = previousRow.previousSibling;
+  }	       
+}
+
+function moveFirst(e)
+{
+  var o;
+  if (window.event)
+  {
+    //alert("IE event");
+    o = event.srcElement;
+  }
+  else
+  {
+    //alert("DOM event " + arguments.length + " " + e);
+    o = e;
+  }
+    
+  var currentRow = o.parentNode.parentNode;
+  var movingRow = o.parentNode.parentNode;
+  var currentTable = currentRow.parentNode;
+  
+  
+  while ( currentRow ) {
+    if ( currentRow.nodeName == "TR" ) {
+     if ( currentRow.className == "row-category" ) {
+		currentTable.insertBefore( movingRow, currentRow.nextSibling );
+		return;
+     }
+    }
+    currentRow = currentRow.previousSibling;
+  }
+}
+
+
+function moveDn(e)
+{
+  var o;
+  if (window.event)
+  {
+    //alert("IE event");
+    o = event.srcElement;
+  }
+  else
+  {
+    //alert("DOM event " + arguments.length + " " + e);
+    o = e;
+  }
+
+  var currentRow = o.parentNode.parentNode;
+  var nextRow = currentRow.nextSibling;
+  var currentTable = currentRow.parentNode;
+
+
+  while ( nextRow ){
+    if ( nextRow.nodeName == "TR" ) {
+	if ( nextRow.className != "row-category" && nextRow.className != "task-row" ) {
+	    currentTable.insertBefore( nextRow, currentRow );
+	    return;
+	} else
+	    return;
+	
+    } 
+    nextRow = nextRow.nextSibling;
+  }
+}
+
+
+function moveLast(e)
+{
+  var o;
+  if (window.event)
+  {
+    //alert("IE event");
+    o = event.srcElement;
+  }
+  else
+  {
+    //alert("DOM event " + arguments.length + " " + e);
+    o = e;
+  }
+  
+  var currentRow = o.parentNode.parentNode;
+  var movingRow = o.parentNode.parentNode;
+  var currentTable = currentRow.parentNode;
+
+ while ( currentRow ) {
+     if ( currentRow.className == "row-category" || currentRow.className == "task-row" || !currentRow.nextSibling ) {
+		currentTable.insertBefore( movingRow, currentRow);
+		return;
+     }
+    currentRow = currentRow.nextSibling;
+  }
+ 
+ //currentTable.insertBefore( movingRow, currentRow.previousSibling );
+  
+}
+
+
+function updateIt(e)
+{
+  var o;
+  if (window.event)
+  {
+    //alert("IE event");
+    o = event.srcElement;
+  }
+  else
+  {
+    //alert("DOM event " + arguments.length + " " + e);
+    o = e;
+  }
+  
+  var currentRow = o.parentNode.parentNode;
+  var currentTable = currentRow.parentNode;
+  
+  var hidden = document.getElementById("ids");
+  
+  currentRow = document.getElementById(o.name).parentNode.parentNode.nextSibling;
+  
+  var lancuch = o.name;
+  while ( currentRow ) {
+    if ( currentRow.nodeName == "TR" ) {
+     if ( currentRow.className == "row-category" || currentRow.className == "task-row" ) {
+        break;
+     } else {
+     	if ( currentRow.childNodes[1].firstChild.nodeName != "#text" ) {
+     		lancuch += "#" + currentRow.childNodes[1].firstChild.firstChild.nodeValue;
+     	} else {
+     		break;
+     	}
+     }
+    }
+    currentRow = currentRow.nextSibling;  
+  }
+ hidden.value = lancuch;
+}
+
+
+
diff -Naur mantis-1.1.1/lang/custom_strings_english.inc.txt mantis/lang/custom_strings_english.inc.txt
--- mantis-1.1.1/lang/custom_strings_english.inc.txt	1970-01-01 01:00:00.000000000 +0100
+++ mantis/lang/custom_strings_english.inc.txt	2008-02-21 21:10:48.000000000 +0100
@@ -0,0 +1,91 @@
+<?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 Task List extension
+	# Based on strings_polish_8859-2.inc.txt rev. 1.???
+	# -------------------------------------------------
+	# $Revision: 1.1.2.1 $
+	# $Author: smig1o $
+	# $Date: 2008-02-20 $
+	#
+	# $Id: custom_strings_polish_english.inc.txt,v 1.0 2008-02-20 smig1o Exp $
+	###########################################################################
+
+?>
+
+<?php
+
+$MANTIS_ERROR[ERRPR_WRONG_DATE_FORMAT] = 'Bad date format';
+$s_access_levels_enum_string = '10:viewer,25:reporter,40:updater,55:developer,60:task_manager,70:manager,90:administrator';
+$s_severity_enum_string = '10:task,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block';
+$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:processed,80:resolved,90:closed';
+
+
+$s_email_notification_title_for_status_bug_processed = 'The following issue has started PROCESSED.'; 
+
+$s_email_subject_bug = 'Bug';
+$s_email_subject_task = 'Task';
+$s_task_manager = 'Task manager';
+$s_email_on_processed = 'Email on PROCESSED';
+$s_processed_bug_title = 'Start working on this issue';
+$s_processed_bug_button = 'Start';
+$s_deadline = 'Deadline';
+$s_view_bugs_link = 'Bugs';
+$s_task_list_link = 'Tasks';
+
+$s_my_view_title_opened = 'Opened';
+$s_my_view_title_idea = 'Tasks';
+
+#task_view_page.php
+$s_task_is_task = 'Task';
+$s_task_move = 'Move';
+$s_task_removed = 'Removed from task list';
+$s_task_added = 'Added to task list';
+$s_task_shifted = 'Task moved: ';
+$s_task_moveUp = 'Move one up';
+$s_task_moveDown = 'Move one down';
+$s_task_moveTop = 'Move on top';
+$s_task_moveBottom = 'Mov on bottom';
+$s_task_view_all = 'All tasks';
+$s_task_view_active = 'Active tasks';
+$s_task_view_user = 'User tasks';
+$s_task_view_project = 'Project tasks';
+$s_task_view_global = 'All tasks';
+$s_task_view_header_user = 'User active tasks';
+$s_task_view_header_user_all = 'All user tasks';
+$s_task_view_header_project = 'Active project tasks';
+$s_task_view_header_project_all = 'All project tasks';
+$s_task_view_header_global = 'Active system tasks';
+$s_task_view_header_global_all = 'All tasks';
+$s_task_view_unassigned = 'Not assigned';
+$s_task_view_unconfirmed = 'Not approved';
+ 
+$s_bug_process_button = 'In process...';
+$s_deadline_task_conf_msg = 'Pick new deadline';
+$s_actiongroup_menu_update_deadline = 'Update deadline';
+
+?>
diff -Naur mantis-1.1.1/lang/custom_strings_polish_8859-2.inc.txt mantis/lang/custom_strings_polish_8859-2.inc.txt
--- mantis-1.1.1/lang/custom_strings_polish_8859-2.inc.txt	1970-01-01 01:00:00.000000000 +0100
+++ mantis/lang/custom_strings_polish_8859-2.inc.txt	2008-02-21 10:24:38.000000000 +0100
@@ -0,0 +1,102 @@
+<?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 Task List extension
+	# Based on strings_polish_8859-2.txt rev. 1.???
+	# -------------------------------------------------
+	# $Revision: 1.1.2.1 $
+	# $Author: smig1o $
+	# $Date: 2008-02-20 $
+	#
+	# $Id: custom_strings_polish_8859-2.inc.txt,v 1.0 2008-02-20 smig1o Exp $
+	###########################################################################
+
+?>
+<?php
+$s_actiongroup_menu_update_target_version = 'Aktualizuj Wersja docelowa';
+$s_actiongroup_menu_update_fixed_in_version = 'Aktualizuj Poprawiono w wersji';
+$s_actiongroup_menu_add_note = 'Dodaj not';
+$s_actiongroup_menu_attach_tags = 'Docz tag';
+$s_actiongroup_menu_update_deadline = 'Aktualizuj Termin realizacji';
+$s_fixed_in_version_bugs_conf_msg = 'Wybierz Poprawione w Wersji';
+$s_target_version_bugs_conf_msg = 'Wybierz wersj docelow';
+$s_fixed_in_version_group_bugs_button = 'Aktualizuj Poprawione w Wersji';
+$s_target_version_group_bugs_button = 'Aktualizuj wersj docelow';
+$s_deadline_task_conf_msg = 'Wybierz nowy termin realizacji';
+
+$MANTIS_ERROR[ERRPR_WRONG_DATE_FORMAT] = 'Bdny format daty';
+$s_access_levels_enum_string      = '10:obserwator,25:zgaszajcy,40:aktualizujcy,55:wykonawca,60:zarzdca zada,70:zarzdca,90:administrator';
+$s_severity_enum_string           = '10:zadanie,20:bahy,30:tekst,40:poprawka,50:drobny,60:wany,70:upadek';
+
+$s_status_enum_string             = '10:nowy,20:zwrcony,30:uznany,40:potwierdzony,50:przypisany,60:w trakcie realizacji,80:rozwizany,90:zamknity';
+
+$s_eta_enum_string                = '10:nieokrelona,11: 1 godzina,15: 2 godziny,19: 3 godziny,21: 4 godziny,24: 1 dzie,26: 2 dni,30: 3 dni,34: 4 dni,40: 1 tydzie,44: 10 dni,48: 2 tygodnie,52: 3 tygodnie,56: 1 miesic,60: 5 tygodni,54: 6 tygodni,58: 7 tygodni,72: 2 miesice,76: 9 tygodni,80: 10 tygodni,84: 3 miesice,88: 4 miesice,92: 5 miesicy,96: p roku';
+$s_eta = 'Pracochonno';
+
+$s_email_notification_title_for_status_bug_processed = 'Nastpujce zagadnienie zaczto PRZETWARZA.'; 
+$s_email_target_version = 'Wersja docelowa';
+
+$s_email_subject_bug = 'Bd';
+$s_email_subject_task = 'Zadanie';
+$s_task_manager = 'Zarzdca zada:';
+$s_email_on_processed = 'List gdy REALIZOWANE';
+$s_processed_bug_title = 'Zacznij prac nad zagadnieniem';
+$s_processed_bug_button = 'Zacznij';
+$s_target_version = 'Wersja docelowa';
+$s_deadline = 'Termin realizacji';
+$s_view_bugs_link = 'Bdy';
+$s_task_list_link = 'Zadania';
+
+$s_my_view_title_opened = 'Otwarte';
+$s_my_view_title_idea = 'Zadania';
+
+#task_view_page.php
+$s_task_is_task = 'Zadanie';
+$s_task_move = 'Przesu';
+$s_task_removed = 'Usunito z listy zada';
+$s_task_added = 'Dodano do listy zada';
+$s_task_shifted = 'Przesunito zadanie: ';
+$s_task_moveUp = 'Przesu zadanie o jedn pozycj do gry';
+$s_task_moveDown = 'Przesu zadanie o jedn pozycj na d';
+$s_task_moveTop = 'Zadanie na pocztek';
+$s_task_moveBottom = 'Zadanie na koniec';
+$s_task_view_all = 'Wszystkie zadania';
+$s_task_view_active = 'Aktywne zadania';
+$s_task_view_user = 'Uzytkownika';
+$s_task_view_project = 'Projektu';
+$s_task_view_global = 'Wszystkie';
+$s_task_view_header_user = 'Aktywne zadania uzytkownika';
+$s_task_view_header_user_all = 'Wszystkie zadania uzytkownika';
+$s_task_view_header_project = 'Aktywne zadania w projekcie';
+$s_task_view_header_project_all = 'Wszystkie zadania w projekcie';
+$s_task_view_header_global = 'Aktywne zadania w systemie';
+$s_task_view_header_global_all = 'Wszystkie zadania w systemie';
+$s_task_view_unassigned = 'Nieprzypisane';
+$s_task_view_unconfirmed = 'Niezatwierdzone';
+ 
+$s_bug_process_button = 'W trakcie realizacji...';
+?>
diff -Naur mantis-1.1.1/lang/custom_strings_polish_utf-8.inc.txt mantis/lang/custom_strings_polish_utf-8.inc.txt
--- mantis-1.1.1/lang/custom_strings_polish_utf-8.inc.txt	1970-01-01 01:00:00.000000000 +0100
+++ mantis/lang/custom_strings_polish_utf-8.inc.txt	2008-02-21 10:24:17.000000000 +0100
@@ -0,0 +1,103 @@
+<?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 Task List extension
+	# Based on strings_polish_8859-2.txt rev. 1.???
+	# -------------------------------------------------
+	# $Revision: 1.1.2.1 $
+	# $Author: smig1o $
+	# $Date: 2008-02-20 $
+	#
+	# $Id: custom_strings_polish_utf-8.inc.txt,v 1.0 2008-02-20 smig1o Exp $
+	###########################################################################
+
+?>
+<?php
+$s_actiongroup_menu_update_target_version = 'Aktualizuj Wersja docelowa';
+$s_actiongroup_menu_update_fixed_in_version = 'Aktualizuj Poprawiono w wersji';
+$s_actiongroup_menu_add_note = 'Dodaj notę';
+$s_actiongroup_menu_attach_tags = 'Dołącz tag';
+$s_actiongroup_menu_update_deadline = 'Aktualizuj Termin realizacji';
+$s_fixed_in_version_bugs_conf_msg = 'Wybierz Poprawione w Wersji';
+$s_target_version_bugs_conf_msg = 'Wybierz wersję docelową';
+$s_fixed_in_version_group_bugs_button = 'Aktualizuj Poprawione w Wersji';
+$s_target_version_group_bugs_button = 'Aktualizuj wersję docelową';
+$s_deadline_task_conf_msg = 'Wybierz nowy Termin realizacji';
+$s_deadline_group_task_button = 'Aktualizuj Termin realizacji';
+
+$MANTIS_ERROR[ERRPR_WRONG_DATE_FORMAT] = 'Błędny format daty';
+$s_access_levels_enum_string      = '10:obserwator,25:zgłaszający,40:aktualizujący,55:wykonawca,60:zarządca zadań,70:zarządca,90:administrator';
+$s_severity_enum_string           = '10:zadanie,20:błahy,30:tekst,40:poprawka,50:drobny,60:ważny,70:upadek';
+
+$s_status_enum_string             = '10:nowy,20:zwrócony,30:uznany,40:potwierdzony,50:przypisany,60:w trakcie realizacji,80:rozwiązany,90:zamknięty';
+
+$s_eta_enum_string                = '10:nieokreślona,11: 1 godzina,15: 2 godziny,19: 3 godziny,21: 4 godziny,24: 1 dzień,26: 2 dni,30: 3 dni,34: 4 dni,40: 1 tydzień,44: 10 dni,48: 2 tygodnie,52: 3 tygodnie,56: 1 miesiąc,60: 5 tygodni,54: 6 tygodni,58: 7 tygodni,72: 2 miesiące,76: 9 tygodni,80: 10 tygodni,84: 3 miesiące,88: 4 miesiące,92: 5 miesięcy,96: pół roku';
+$s_eta = 'Pracochłonność';
+
+$s_email_notification_title_for_status_bug_processed = 'Następujące zagadnienie zaczęto PRZETWARZAĆ.'; 
+$s_email_target_version = 'Wersja docelowa';
+
+$s_email_subject_bug = 'Błąd';
+$s_email_subject_task = 'Zadanie';
+$s_task_manager = 'Zarządca zadań:';
+$s_email_on_processed = 'List gdy REALIZOWANE';
+$s_processed_bug_title = 'Zacznij pracę nad zagadnieniem';
+$s_processed_bug_button = 'Zacznij';
+$s_target_version = 'Wersja docelowa';
+$s_deadline = 'Termin realizacji';
+$s_view_bugs_link = 'Błędy';
+$s_task_list_link = 'Zadania';
+
+$s_my_view_title_opened = 'Otwarte';
+$s_my_view_title_idea = 'Zadania';
+
+#task_view_page.php
+$s_task_is_task = 'Zadanie';
+$s_task_move = 'Przesuń';
+$s_task_removed = 'Usunięto z listy zadań';
+$s_task_added = 'Dodano do listy zadań';
+$s_task_shifted = 'Przesunięto zadanie: ';
+$s_task_moveUp = 'Przesuń zadanie o jedną pozycję do góry';
+$s_task_moveDown = 'Przesuń zadanie o jedną pozycję na dół';
+$s_task_moveTop = 'Zadanie na początek';
+$s_task_moveBottom = 'Zadanie na koniec';
+$s_task_view_all = 'Wszystkie zadania';
+$s_task_view_active = 'Aktywne zadania';
+$s_task_view_user = 'Uzytkownika';
+$s_task_view_project = 'Projektu';
+$s_task_view_global = 'Wszystkie';
+$s_task_view_header_user = 'Aktywne zadania uzytkownika';
+$s_task_view_header_user_all = 'Wszystkie zadania uzytkownika';
+$s_task_view_header_project = 'Aktywne zadania w projekcie';
+$s_task_view_header_project_all = 'Wszystkie zadania w projekcie';
+$s_task_view_header_global = 'Aktywne zadania w systemie';
+$s_task_view_header_global_all = 'Wszystkie zadania w systemie';
+$s_task_view_unassigned = 'Nieprzypisane';
+$s_task_view_unconfirmed = 'Niezatwierdzone';
+ 
+$s_bug_process_button = 'W trakcie realizacji...';
+?>
diff -Naur mantis-1.1.1/lang/strings_polish.txt mantis/lang/strings_polish.txt
--- mantis-1.1.1/lang/strings_polish.txt	2007-12-04 12:24:34.000000000 +0100
+++ mantis/lang/strings_polish.txt	2008-02-21 10:00:31.000000000 +0100
@@ -1328,4 +1328,7 @@
 
 # wiki related strings
 $s_wiki = 'Wiki';
+
+include ('custom_strings_polish_utf-8.inc.txt');
+
 ?>
diff -Naur mantis-1.1.1/lang/strings_polish_8859-2.txt mantis/lang/strings_polish_8859-2.txt
--- mantis-1.1.1/lang/strings_polish_8859-2.txt	2007-10-14 00:36:41.000000000 +0200
+++ mantis/lang/strings_polish_8859-2.txt	2008-02-21 10:00:52.000000000 +0100
@@ -53,8 +53,13 @@
 $s_actiongroup_menu_update_category = 'Aktualizuj kategori';
 $s_actiongroup_menu_set_sticky = 'Przyklej/odklej';
 $s_actiongroup_menu_update_field = 'Aktualizuj %s';
+$s_actiongroup_menu_update_target_version = 'Aktualizuj Wersja docelowa';
+$s_actiongroup_menu_update_fixed_in_version = 'Aktualizuj Poprawiono w wersji';
+$s_actiongroup_menu_add_note = 'Dodaj not';
+$s_actiongroup_menu_attach_tags = 'Doacz tag';
 $s_actiongroup_bugs = 'Wybrane zagadnienia';
 
+
 # new strings:
 $s_all_projects = 'Wszystkie projekty';
 $s_move_bugs = 'Przenie zagadnienia';
@@ -1328,4 +1333,6 @@
 
 # wiki related strings
 $s_wiki = 'Wiki';
+
+include ('custom_strings_polish_8859-2.inc.txt');
 ?>
diff -Naur mantis-1.1.1/manage_config_email_page.php mantis/manage_config_email_page.php
--- mantis-1.1.1/manage_config_email_page.php	2007-10-14 00:36:41.000000000 +0200
+++ mantis/manage_config_email_page.php	2008-02-19 10:38:23.000000000 +0100
@@ -258,6 +258,7 @@
 		get_capability_row_for_email( lang_get( 'email_on_reopened' ), 'reopened' );
 		get_capability_row_for_email( lang_get( 'email_on_deleted' ), 'deleted' );
 		get_capability_row_for_email( lang_get( 'email_on_bugnote_added' ), 'bugnote' );
+		get_capability_row_for_email( lang_get( 'email_on_processed' ), 'processed' );
 		if( config_get( 'enable_sponsorship' ) == ON ) {
 			get_capability_row_for_email( lang_get( 'email_on_sponsorship_changed' ), 'sponsor' );
 		}
diff -Naur mantis-1.1.1/task_actiongroup.php mantis/task_actiongroup.php
--- mantis-1.1.1/task_actiongroup.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis/task_actiongroup.php	2008-02-21 10:18:37.000000000 +0100
@@ -0,0 +1,315 @@
+<?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/>.
+
+	# --------------------------------------------------------
+	# $Id: bug_actiongroup.php,v 1.52.2.1 2007-10-13 22:32:30 giallu Exp $
+	# --------------------------------------------------------
+?>
+<?php
+	# This page allows actions to be performed an an array of bugs
+?>
+<?php
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path.'bug_api.php' );
+?>
+<?php auth_ensure_user_authenticated() ?>
+<?php
+	helper_begin_long_process();
+	
+	$f_action	= gpc_get_string( 'action' );
+	$f_custom_field_id = gpc_get_int( 'custom_field_id', 0 );
+	$f_bug_arr	= gpc_get_int_array( 'bug_arr', array() );
+
+	$t_custom_group_actions = config_get( 'custom_group_actions' );
+
+	foreach( $t_custom_group_actions as $t_custom_group_action ) {
+		if ( $f_action == $t_custom_group_action['action'] ) {
+			require_once( $t_custom_group_action['action_page'] );
+			exit;
+		}
+	}
+
+	$t_failed_ids = array();
+
+	if ( 0 != $f_custom_field_id ) {
+		$t_custom_field_def = custom_field_get_definition( $f_custom_field_id );
+	}
+
+	foreach( $f_bug_arr as $t_bug_id ) {
+		bug_ensure_exists( $t_bug_id );
+		$t_bug = bug_get( $t_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;
+			# @@@ (thraxisp) the next line goes away if the cache was smarter and used project
+			config_flush_cache(); # flush the config cache so that configs are refetched
+		}
+
+		$t_status = $t_bug->status;
+
+		switch ( $f_action ) {
+
+		case 'CLOSE':
+			if ( access_can_close_bug( $t_bug_id ) &&
+					( $t_status < CLOSED ) &&
+					bug_check_workflow($t_status, CLOSED) ) {
+
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $f_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_close( $t_bug_id );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				if ( ! access_can_close_bug( $t_bug_id ) ) {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+				} else {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' );
+				}
+			}
+			break;
+
+		case 'DELETE':
+			if ( access_has_bug_level( config_get( 'delete_bug_threshold' ), $t_bug_id ) ) {
+				bug_delete( $t_bug_id );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'MOVE':
+			if ( access_has_bug_level( config_get( 'move_bug_threshold' ), $t_bug_id ) ) {
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				$f_project_id = gpc_get_int( 'project_id' );
+				bug_set_field( $t_bug_id, 'project_id', $f_project_id );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'COPY':
+			$f_project_id = gpc_get_int( 'project_id' );
+
+			if ( access_has_project_level( config_get( 'report_bug_threshold' ), $f_project_id ) ) {
+				bug_copy( $t_bug_id, $f_project_id, true, true, true, true, true, true );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'ASSIGN':
+			$f_assign = gpc_get_int( 'assign' );
+			if ( ON == config_get( 'auto_set_status_to_assigned' ) ) {
+				$t_assign_status = config_get( 'bug_assigned_status' );
+			} else {
+				$t_assign_status = $t_status;
+			}
+			# check that new handler has rights to handle the issue, and
+			#  that current user has rights to assign the issue
+			$t_threshold = access_get_status_threshold( $t_assign_status, bug_get_field( $t_bug_id, 'project_id' ) );
+			if ( access_has_bug_level( $t_threshold , $t_bug_id, $f_assign ) &&
+				 access_has_bug_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ), $t_bug_id ) &&
+					bug_check_workflow($t_status, $t_assign_status )	) {
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_assign( $t_bug_id, $f_assign );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				if ( bug_check_workflow($t_status, $t_assign_status ) ) {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+				} else {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' );
+				}
+			}
+			break;
+
+		case 'RESOLVE':
+			$t_resolved_status = config_get( 'bug_resolved_status_threshold' );
+			if ( access_has_bug_level( access_get_status_threshold( $t_resolved_status, bug_get_field( $t_bug_id, 'project_id' ) ), $t_bug_id ) &&
+				 		( $t_status < $t_resolved_status ) &&
+						bug_check_workflow($t_status, $t_resolved_status ) ) {
+				$f_resolution = gpc_get_int( 'resolution' );
+				$f_fixed_in_version = gpc_get_string( 'fixed_in_version', '' );
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_resolve( $t_bug_id, $f_resolution, $f_fixed_in_version );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				if ( ( $t_status < $t_resolved_status ) &&
+						bug_check_workflow($t_status, $t_resolved_status ) ) {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+				} else {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' );
+				}
+			}
+			break;
+
+		case 'UP_PRIOR':
+			if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) ) {
+				$f_priority = gpc_get_int( 'priority' );
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_set_field( $t_bug_id, 'priority', $f_priority );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'UP_STATUS':
+			$f_status = gpc_get_int( 'status' );
+			$t_project = bug_get_field( $t_bug_id, 'project_id' );
+			if ( access_has_bug_level( access_get_status_threshold( $f_status, $t_project ), $t_bug_id ) ) {
+				if ( TRUE == bug_check_workflow($t_status, $f_status ) ) {
+					# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+					bug_set_field( $t_bug_id, 'status', $f_status );
+					helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+				} else {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_status' );
+				}
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'UP_CATEGORY':
+			$f_category = gpc_get_string( 'category' );
+			$t_project = bug_get_field( $t_bug_id, 'project_id' );
+			if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) ) {
+				if ( category_exists( $t_project, $f_category ) ) {
+					# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+					bug_set_field( $t_bug_id, 'category', $f_category );
+					helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+				} else {
+					$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_category' );
+				}
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+		
+		case 'UP_FIXED_IN_VERSION':
+			$f_fixed_in_version = gpc_get_string( 'fixed_in_version' );
+			$t_project_id = bug_get_field( $t_bug_id, 'project_id' );
+			$t_success = false;
+
+			if ( access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id ) ) {
+				if ( version_get_id( $f_fixed_in_version, $t_project_id ) !== false ) {
+					# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+					bug_set_field( $t_bug_id, 'fixed_in_version', $f_fixed_in_version );
+					helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+					$t_success = true;
+				}
+			}
+
+			if ( !$t_success ) {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'UP_TARGET_VERSION':
+			$f_target_version = gpc_get_string( 'target_version' );
+			$t_project_id = bug_get_field( $t_bug_id, 'project_id' );
+			$t_success = false;
+
+			if ( access_has_bug_level( config_get( 'roadmap_update_threshold' ), $t_bug_id ) ) {
+				if ( version_get_id( $f_target_version, $t_project_id ) !== false ) {
+					# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+					bug_set_field( $t_bug_id, 'target_version', $f_target_version );
+					helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+					$t_success = true;
+				}
+			}
+
+			if ( !$t_success ) {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'VIEW_STATUS':
+			if ( access_has_bug_level( config_get( 'change_view_status_threshold' ), $t_bug_id ) ) {
+				$f_view_status = gpc_get_int( 'view_status' );
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_set_field( $t_bug_id, 'view_state', $f_view_status );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'SET_STICKY':
+			if ( access_has_bug_level( config_get( 'set_bug_sticky_threshold' ), $t_bug_id ) ) {
+				$f_sticky = bug_get_field( $t_bug_id, 'sticky' );
+				// The new value is the inverted old value
+				# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+				bug_set_field( $t_bug_id, 'sticky', intval( !$f_sticky ) );
+				helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			} else {
+				$t_failed_ids[$t_bug_id] = lang_get( 'bug_actiongroup_access' );
+			}
+			break;
+
+		case 'UP_DEADLINE':
+			$f_deadline = gpc_get_string( 'deadline' );
+			if ( !is_blank( $_deadline ) ) {
+			    $t_a = explode( '-', $f_deadline );
+			    if ( !chekckdate((integer) $t_a[1], (integer) $t_a[2], (integer) $t_a[0] ) ) {
+				error_parameters( lang_get( 'deadline' ) );
+				trigger_error( ERROR_WRONG_DATE_FORMAT, ERROR );
+			    }
+			}
+			bug_set_field( $t_bug_id, 'deadline', $f_deadline );
+			break;
+		case 'CUSTOM':
+			if ( 0 === $f_custom_field_id ) {
+				trigger_error( ERROR_GENERIC, ERROR );
+			}
+
+			# @@@ we need to issue a helper_call_custom_function( 'issue_update_validate', array( $t_bug_id, $t_bug_data, $f_bugnote_text ) );
+			$t_form_var = "custom_field_$f_custom_field_id";
+			$t_custom_field_value = gpc_get_custom_field( $t_form_var, $t_custom_field_def['type'], null );
+			custom_field_set_value( $f_custom_field_id, $t_bug_id, $t_custom_field_value );
+			helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
+			break;
+
+		default:
+			trigger_error( ERROR_GENERIC, ERROR );
+		}
+	}
+
+	$t_redirect_url = 'task_list_page.php';
+
+	if ( count( $t_failed_ids ) > 0 ) {
+		html_page_top1();
+		html_page_top2();
+
+		echo '<div align="center"><br />';
+		echo '<table class="width75">';
+		foreach( $t_failed_ids as $t_id => $t_reason ) {
+			printf( "<tr><td width=\"50%%\">%s: %s</td><td>%s</td></tr>\n", string_get_bug_view_link( $t_id ), bug_get_field( $t_id, 'summary' ), $t_reason );
+		}
+		echo '</table><br />';
+		print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
+		echo '</div>';
+
+		html_page_bottom1( __FILE__ );
+	} else {
+		print_header_redirect( $t_redirect_url );
+	}
+?>
diff -Naur mantis-1.1.1/task_actiongroup_page.php mantis/task_actiongroup_page.php
--- mantis-1.1.1/task_actiongroup_page.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis/task_actiongroup_page.php	2008-02-21 10:13:12.000000000 +0100
@@ -0,0 +1,379 @@
+<?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/>.
+
+	# --------------------------------------------------------
+	# $Id: bug_actiongroup_page.php,v 1.55.2.1 2007-10-13 22:32:34 giallu Exp $
+	# --------------------------------------------------------
+?>
+<?php
+	# This page allows actions to be performed on an array of bugs
+
+	require_once( 'core.php' );
+
+	require_once( $t_core_path.'bug_group_action_api.php' );
+
+	auth_ensure_user_authenticated();
+
+	$f_action = gpc_get_string( 'action', '' );
+	$f_bug_arr = gpc_get_int_array( 'bug_arr', array() );
+	$f_ids = gpc_get_string ( 'ids', '' );
+	$f_task_view_type = gpc_get_int( 'task_view_type' );
+	$t_current_user_id = auth_get_current_user_id();
+	
+	# redirects to all_bug_page if nothing is selected
+	if ( (is_blank( $f_action ) || ( 0 == sizeof( $f_bug_arr ) ) ) && is_blank( $f_ids ) ) {
+		$t_link = 'task_list_page.php?task_view_type='.token_get_value( TOKEN_TASK_VIEW, $t_current_user_id );
+		print_header_redirect( $t_link );
+	}
+
+	if ( !is_blank( $f_ids ) ) {
+	    $t_ids_arr = array();
+	    $t_tasks_arr = array();
+	    $t_ids_arr = split( '#', $f_ids );
+	    $t_user_id = $t_ids_arr[0];
+	    if ( is_blank( $t_user_id ) )
+	    	$t_user_id = 0;
+	    $t_tasks_arr = array_slice ( $t_ids_arr, 1 );
+	    # task_remove_all_from_user( $t_user_id );
+	    $t_order = 1;
+	    foreach ( $t_tasks_arr as $t_task_id ) {
+	    	$t_old_order = bug_get_field( $t_task_id, 'task_order' );
+	    	bug_set_field( $t_task_id, 'task_order', $t_order );
+			$t_order++;
+			$t_info = lang_get( 'task_shifted' ).$t_old_order;
+			history_log_event_direct( $p_task_id, lang_get( 'task_is_task' ), $t_info, $t_order );
+	    }
+	    $t_link = 'task_list_page.php?task_view_type='.token_get_value( TOKEN_TASK_VIEW, $t_current_user_id );
+	    print_successful_redirect( $t_link );
+	} else {
+
+	# run through the issues to see if they are all from one project
+	$t_project_id = ALL_PROJECTS;
+	$t_multiple_projects = false;
+	foreach( $f_bug_arr as $t_bug_id ) {
+		$t_bug = bug_get( $t_bug_id );
+		if ( $t_project_id != $t_bug->project_id ) {
+			if ( ( $t_project_id != ALL_PROJECTS ) && !$t_multiple_projects ) {
+				$t_multiple_projects = true;
+			} else {
+				$t_project_id = $t_bug->project_id;
+			}
+		}
+	}
+	if ( $t_multiple_projects ) {
+		$t_project_id = ALL_PROJECTS;
+	}
+	# override the project if necessary
+	if( $t_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_project_id;
+	}
+
+	$t_finished = false;
+	$t_request = '';
+
+	$t_external_action_prefix = 'EXT_';
+	if ( strpos( $f_action, $t_external_action_prefix ) === 0 ) {
+		$t_form_page = 'bug_actiongroup_ext_page.php';
+		require_once( $t_form_page );
+		exit;
+	}
+
+	$t_custom_group_actions = config_get( 'custom_group_actions' );
+	
+	foreach( $t_custom_group_actions as $t_custom_group_action ) {
+		if ( $f_action == $t_custom_group_action['action'] ) {
+			require_once( $t_custom_group_action['form_page'] );
+			exit;
+		}
+	}
+
+	# Check if user selected to update a custom field.
+	$t_custom_fields_prefix = 'custom_field_';
+	if ( strpos( $f_action, $t_custom_fields_prefix ) === 0 ) {
+		$t_custom_field_id = (int)substr( $f_action, strlen( $t_custom_fields_prefix ) );
+		$f_action = 'CUSTOM';
+	}
+
+	switch ( $f_action )  {
+		# Use a simple confirmation page, if close or delete...
+		case 'CLOSE' :
+			$t_finished 			= true;
+			$t_question_title 		= lang_get( 'close_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'close_group_bugs_button' );
+			break;
+
+		case 'DELETE' :
+			$t_finished 			= true;
+			$t_question_title		= lang_get( 'delete_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'delete_group_bugs_button' );
+			break;
+
+		case 'SET_STICKY' :
+			$t_finished 			= true;
+			$t_question_title		= lang_get( 'set_sticky_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'set_sticky_group_bugs_button' );
+			break;
+
+		# ...else we define the variables used in the form
+		case 'MOVE' :
+			$t_question_title 		= lang_get( 'move_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'move_group_bugs_button' );
+			$t_form					= 'project_id';
+			break;
+
+		case 'COPY' :
+			$t_question_title 		= lang_get( 'copy_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'copy_group_bugs_button' );
+			$t_form					= 'project_id';
+			break;
+
+		case 'ASSIGN' :
+			$t_question_title 		= lang_get( 'assign_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'assign_group_bugs_button' );
+			$t_form 				= 'assign';
+			break;
+
+		case 'RESOLVE' :
+			$t_question_title 		= lang_get( 'resolve_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'resolve_group_bugs_button' );
+			$t_form 				= 'resolution';
+			$t_request 				= 'resolution'; # the "request" vars allow to display the adequate list
+			if ( ALL_PROJECTS != $t_project_id ) {
+				$t_question_title2 = lang_get( 'fixed_in_version' );
+				$t_form2 = 'fixed_in_version';
+			}
+			break;
+
+		case 'UP_PRIOR' :
+			$t_question_title 		= lang_get( 'priority_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'priority_group_bugs_button' );
+			$t_form 				= 'priority';
+			$t_request 				= 'priority';
+			break;
+
+		case 'UP_STATUS' :
+			$t_question_title 		= lang_get( 'status_bugs_conf_msg' );
+			$t_button_title 		= lang_get( 'status_group_bugs_button' );
+			$t_form 				= 'status';
+			$t_request 				= 'status';
+			break;
+
+		case 'UP_CATEGORY' :
+			$t_question_title		= lang_get( 'category_bugs_conf_msg' );
+			$t_button_title			= lang_get( 'category_group_bugs_button' );
+			$t_form					= 'category';
+			$t_request				= 'category';
+			break;
+
+		case 'VIEW_STATUS' :
+			$t_question_title		= lang_get( 'view_status_bugs_conf_msg' );
+			$t_button_title			= lang_get( 'view_status_group_bugs_button' );
+			$t_form				= 'view_status';
+			$t_request			= 'view_status';
+			break;
+		
+		case 'UP_FIXED_IN_VERSION':
+			$t_question_title		= lang_get( 'fixed_in_version_bugs_conf_msg' );
+			$t_button_title			= lang_get( 'fixed_in_version_group_bugs_button' );
+			$t_form					= 'fixed_in_version';
+			$t_request				= 'fixed_in_version';
+			break;
+
+		case 'UP_TARGET_VERSION':
+			$t_question_title		= lang_get( 'target_version_bugs_conf_msg' );
+			$t_button_title			= lang_get( 'target_version_group_bugs_button' );
+			$t_form					= 'target_version';
+			$t_request				= 'target_version';
+			break;
+		
+		case 'UP_DEADLINE':
+			$t_question_title		= lang_get( 'deadline_task_conf_msg' );
+			$t_button_title			= lang_get( 'deadline_group_task_button' );
+			$t_form				= 'deadline';
+			$t_request			= 'deadline';
+			break;
+			
+		case 'CUSTOM' :
+			$t_custom_field_def = custom_field_get_definition( $t_custom_field_id );
+			$t_question_title = sprintf( lang_get( 'actiongroup_menu_update_field' ), lang_get_defaulted( $t_custom_field_def['name'] ) );
+			$t_button_title = $t_question_title;
+			$t_form = "custom_field_$t_custom_field_id";
+			break;
+
+		default:
+			trigger_error( ERROR_GENERIC, ERROR );
+	}
+
+	bug_group_action_print_top();
+	
+	if ( $t_multiple_projects ) {
+		echo '<p class="bold">' . lang_get( 'multiple_projects' ) . '</p>';
+	}
+?>
+
+<br />
+
+<div align="center">
+<form method="post" action="task_actiongroup.php">
+<input type="hidden" name="action" value="<?php echo string_attribute( $f_action ) ?>" />
+<?php
+	bug_group_action_print_hidden_fields( $f_bug_arr );
+
+	if ( $f_action === 'CUSTOM' ) {
+		echo "<input type=\"hidden\" name=\"custom_field_id\" value=\"$t_custom_field_id\" />";
+	}
+?>
+<table class="width75" cellspacing="1">
+<?php
+if ( !$t_finished ) {
+?>
+<tr class="row-1">
+	<td class="category">
+		<?php echo $t_question_title ?>
+	</td>
+	<td>
+	<?php
+		if ( $f_action === 'CUSTOM' ) {
+			$t_custom_field_def = custom_field_get_definition( $t_custom_field_id );
+
+			$t_bug_id = null;
+
+			# if there is only one issue, use its current value as default, otherwise,
+			# use the default value specified in custom field definition.
+			if ( sizeof( $f_bug_arr ) == 1 ) {
+				$t_bug_id = $f_bug_arr[0];
+			}
+
+			print_custom_field_input( $t_custom_field_def, $t_bug_id );
+		} else if ( $f_action === 'UP_DEADLINE' ) {
+		
+		# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)
+    		    if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){
+	                echo "<style type=\"text/css\">@import url(javascript/jscalendar/calendar-blue.css);</style>";
+		        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar.js\"></script>\n";
+		        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/lang/calendar-en.js\"></script>\n";
+		        echo "<script type=\"text/javascript\" src=\"javascript/jscalendar/calendar-setup.js\"></script>\n";
+		    }
+		    $t_icon_path = config_get( 'icon_path' );
+		    $cal_icon = $t_icon_path ."calendar-img.gif";
+		    print "<input ".helper_get_tab_index()." type=\"text\" id=\"deadline\" name=\"deadline\" size=\"20\" maxlength=\"10\" value=\"".$t_bug->deadline."\">";
+		    ?><input type="image" class="button" id="trigger" SRC="
+        		<?php print $cal_icon;?> " onClick="return showCalendar ('sel1', '%Y-%m-%d', 24, true)" /><?php
+		} else {
+			echo "<select name=\"$t_form\">";
+
+			switch ( $f_action ) {
+				case 'COPY':
+				case 'MOVE':
+					print_project_option_list( null, false );
+					break;
+				case 'ASSIGN':
+					print_assign_to_option_list( 0, $t_project_id );
+					break;
+				case 'VIEW_STATUS':
+					print_enum_string_option_list( 'view_state', config_get( 'default_bug_view_status' ) );
+					break;
+				case 'UP_CATEGORY':
+					print_category_option_list();
+					break;
+				case 'UP_TARGET_VERSION':
+				case 'UP_FIXED_IN_VERSION':
+					print_version_option_list( '', $t_project_id, VERSION_ALL );
+					break;
+			}
+
+			# other forms use the same function to display the list
+			if ( $t_request > '' ) {
+				print_enum_string_option_list( $t_request, FIXED );
+			}
+
+			echo '</select>';
+		}
+		?>
+	</td>
+</tr>
+	<?php
+	if ( isset( $t_question_title2 ) ) {
+		switch ( $f_action ) {
+			case 'RESOLVE':
+				$t_show_version = ( ON == config_get( 'show_product_version' ) )
+					|| ( ( AUTO == config_get( 'show_product_version' ) )
+								&& ( count( version_get_all_rows( $t_project_id ) ) > 0 ) );
+				if ( $t_show_version ) {
+	?>
+		<tr class="row-2">
+			<td class="category">
+				<?php echo $t_question_title2 ?>
+			</td>
+			<td>
+				<select name="<?php echo $t_form2 ?>">
+					<?php print_version_option_list( '', null, VERSION_ALL );?>
+				</select>
+			</td>
+		</tr>
+	<?php
+				}
+				break;
+		}
+	}
+	?>
+<?php
+} else {
+?>
+
+<tr class="row-1">
+	<td class="category" colspan="2">
+		<?php echo $t_question_title; ?>
+	</td>
+</tr>
+<?php
+}
+?>
+
+<tr>
+	<td class="center" colspan="2">
+		<input type="submit" class="button" value="<?php echo $t_button_title ?>" />
+	</td>
+</tr>
+</table>
+<br />
+
+<?php
+	bug_group_action_print_bug_list( $f_bug_arr );
+?>
+</form>
+<?php if ( $f_action === 'UP_DEADLINE' ) { ?>
+        <script type="text/javascript">
+    	    Calendar.setup (
+                {
+                    inputField     : "deadline",
+            	    ifFormat       : "%Y-%m-%d",
+            	    button         : "trigger"
+               }
+	   );
+       </script>
+<?php } ?>
+</div>
+
+<?php
+	bug_group_action_print_bottom();
+}
+?>
diff -Naur mantis-1.1.1/task_list_page.php mantis/task_list_page.php
--- mantis-1.1.1/task_list_page.php	1970-01-01 01:00:00.000000000 +0100
+++ mantis/task_list_page.php	2008-02-21 10:35:52.000000000 +0100
@@ -0,0 +1,528 @@
+<?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/>.
+
+	# --------------------------------------------------------
+	# $Revision: 1.62.2.1 $
+	# $Author: giallu $
+	# $Date: 2007-10-13 22:34:48 $
+	#
+	# $Id: view_all_bug_page.php,v 1.62.2.1 2007-10-13 22:34:48 giallu Exp $
+	# --------------------------------------------------------
+
+
+# sys manager	project manager can
+# 0 0 see own(all) tasks | see project(all) tasks | dont see global tasks
+# 0 1 dont see own tasks | modify project(all) task | see global tasks
+# 1 0 dont see own tasks | see project(all) tasks | see global tasks
+
+# default view for manager see project tasks, non manager see own tasks
+
+?>
+<?php
+	require_once( 'core.php' );
+
+	$t_core_path = config_get( 'core_path' );
+
+	require_once( $t_core_path.'compress_api.php' );
+	require_once( $t_core_path.'task_api.php' );
+	require_once( $t_core_path.'user_api.php' );
+	require_once( $t_core_path.'last_visited_api.php' );
+	require_once( $t_core_path.'icon_api.php' );
+	require_once( $t_core_path.'columns_api.php' );
+        require_once( $t_core_path.'current_user_api.php' );
+        require_once( $t_core_path.'bug_api.php' );
+        require_once( $t_core_path.'string_api.php' );
+        require_once( $t_core_path.'date_api.php' );
+        require_once( $t_core_path.'tokens_api.php' );
+        require_once( $t_core_path.'helper_api.php' );
+						
+
+    auth_ensure_user_authenticated();
+
+	global $t_icon_path;
+	$f_page_number		= gpc_get_int( 'page_number', 1 );
+	# 1 means active
+	# 2 means full
+	$t_view_type		= gpc_get_int( 'task_view_type', 1);
+	$t_per_page = null;
+	$t_bug_count = null;
+	$t_page_count = null;
+
+	$t_icon_path = config_get( 'icon_path' );
+        $t_update_bug_threshold = config_get( 'update_bug_threshold' );
+	
+	$t_icon_Up = $t_icon_path . 'arrow_up.gif';
+	$t_icon_Dn = $t_icon_path . 'arrow_down.gif';
+	$t_icon_Ft = $t_icon_path . 'arrow_first.gif';
+	$t_icon_Lt = $t_icon_path . 'arrow_last.gif';
+	$t_icon_Ok = $t_icon_path . 'accept.png';
+	$t_icon_Cn = $t_icon_path . 'cancel.png';
+	
+	$t_current_user_id = auth_get_current_user_id();
+	$t_current_project_id = helper_get_current_project();
+	
+
+	$t_system_level = access_get_global_level();
+	
+	$t_token = gpc_get_int ( 'task_view_type', 0 );
+   
+
+	if ( !$t_token )
+		$t_token = token_get_value ( TOKEN_TASK_VIEW, $t_current_user_id );
+	
+	if ( $t_current_project_id > 0 )
+	    $t_current_project_level = project_get_local_user_access_level( $t_current_project_id, $t_current_user_id );
+	else {
+	    $t_project_level = ANYBODY;
+	    if ( $t_token <= TASK_VIEW_PROJECT_ALL ) {
+			$t_token = TASK_VIEW_PROJECT;
+	    } else if ( $t_token >= TASK_VIEW_PROJECT ) {
+			$t_token = TASK_VIEW_SINGLE_USER;
+		 }
+	    token_set( TOKEN_TASK_VIEW, TASK_VIEW_GLOBAL, TOKEN_EXPIRY, $t_current_user_id );
+	}
+
+	if ( $t_system_level == ADMINISTRATOR )
+	    $t_current_project_level = ADMINISTRATOR;
+	    
+	if ( $t_current_project_level >= config_get( 'task_manager_threshold' ) ) {
+	    $t_can_reorder = true;
+	}
+	else
+	    $t_can_reorder = false;
+
+
+
+	if ( $t_token == 0 ) {
+	# setting default view 
+	    $t_token = TASK_VIEW_SINGLE_USER;
+	    if ( $t_current_project_level >= config_get( 'task_manager_threshold' ) || 
+		$t_system_level >= config_get( 'task_manager_threshold' ) ){
+		$t_token = TASK_VIEW_PROJECT;
+	    }	    
+	}
+
+	token_set( TOKEN_TASK_VIEW, $t_token, TOKEN_EXPIRY, $t_current_user_id );	
+	compress_enable();
+
+	html_page_top1( lang_get( 'view_bugs_link' ) );
+
+	if ( current_user_get_pref( 'refresh_delay' ) > 0 ) {
+		html_meta_redirect( 'view_all_bug_page.php?page_number='.$f_page_number, current_user_get_pref( 'refresh_delay' )*60 );
+	}
+
+	html_page_top2();
+
+	print_recently_visited();
+	
+	
+	$t_link_text = '';
+
+
+	#global / project list link
+	if ( ( $t_token & TASK_VIEW_SINGLE_USER ) || ( $t_token & TASK_VIEW_PROJECT  ) ||
+	    ( $t_token & TASK_VIEW_GLOBAL ) ) {
+	    $t_switch_token = $t_token << 1;
+	    $t_link_text = lang_get( 'task_view_all' );
+	    $t_all_view = false;
+
+	} else {
+	    $t_link_text = lang_get( 'task_view_active' );
+	    $t_switch_token = $t_token >> 1;
+	    $t_all_view = true;
+	}
+	print "<table style=\"width:100%\"><tr>";
+	$t_link_file = 'task_list_page.php?task_view_type='.$t_switch_token;
+	$t_link = "<a href=\"";
+	$t_link .= config_get( 'path' );
+	$t_link .= $t_link_file;
+	$t_link .= "\">[ ".$t_link_text." ]</a>";
+	print "<td colspan=2 style=\"text-align:right\">".$t_link."</td></tr>";	
+//zrobic linki dla usera / projektu / globalne
+	
+	if ( $t_current_project_level >= config_get( 'task_manager_threshold' ) || 
+		$t_system_level >= config_get( 'task_manager_threshold' ) ){
+	    if ( $t_all_view ) {
+		$t_left_link = TASK_VIEW_GLOBAL_ALL;
+		$t_left_link_text = lang_get( 'task_view_global' );
+		$t_right_link = TASK_VIEW_PROJECT_ALL;
+		$t_right_link_text = lang_get( 'task_view_project' );
+	    } else {
+		$t_left_link = TASK_VIEW_GLOBAL;
+		$t_left_link_text = lang_get( 'task_view_global' );
+		$t_right_link = TASK_VIEW_PROJECT;
+		$t_right_link_text = lang_get( 'task_view_project' );
+	    }
+	} else {
+	    if ( $t_all_view ) {
+		$t_right_link = TASK_VIEW_SINGLE_USER_ALL;
+		$t_right_link_text = lang_get( 'task_view_user' );
+		$t_left_link = TASK_VIEW_PROJECT_ALL;
+		$t_left_link_text = lang_get( 'task_view_project' );
+	    } else {
+		$t_right_link = TASK_VIEW_SINGLE_USER;
+		$t_right_link_text = lang_get( 'task_view_user' );
+		$t_left_link = TASK_VIEW_PROJECT;
+		$t_left_link_text = lang_get( 'task_view_project' );
+	    }
+	}
+	print "<tr>";
+	if  ( $t_token == TASK_VIEW_SINGLE_USER ) {
+		$t_header = lang_get( 'task_view_header_user' );
+	} else if ( $t_token == TASK_VIEW_SINGLE_USER_ALL ) {
+		$t_header = lang_get( 'task_view_header_user_all' );
+	} else if ( $t_token == TASK_VIEW_PROJECT ) {
+		$t_header = lang_get( 'task_view_header_project' );
+	} else if ( $t_token == TASK_VIEW_PROJECT_ALL ) {
+		$t_header = lang_get( 'task_view_header_project_all' );
+	} else if ( $t_token == TASK_VIEW_GLOBAL ) {
+		$t_header = lang_get( 'task_view_header_global' );
+	} else {
+		$t_header = lang_get( 'task_view_header_global_all' );
+	}
+	print "<th style=\"text-align:left\">".$t_header."</td>";
+	$t_link_file = 'task_list_page.php?task_view_type='.$t_left_link;
+	$t_link = "[ <a href=\"";
+	$t_link .= config_get( 'path' );
+	$t_link .= $t_link_file;
+	$t_link .= "\">".$t_left_link_text."</a> ]";
+	
+	$t_link_file = 'task_list_page.php?task_view_type='.$t_right_link;
+	$t_link .= "[ <a href=\"";
+	$t_link .= config_get( 'path' );
+	$t_link .= $t_link_file;
+	$t_link .= "\">".$t_right_link_text."</a> ]";	
+	print "<td style=\"text-align:right\">".$t_link."</td></tr></table>";
+	print "</div>";
+	
+	if ( $t_token <= TASK_VIEW_SINGLE_USER_ALL ) {
+	    $users[0] = $t_current_user_id;
+	} else if ( $t_token == TASK_VIEW_PROJECT || $t_token == TASK_VIEW_PROJECT_ALL ) {
+	    $users = task_get_users( $t_current_project_id );
+	} else {
+	    $users = task_get_users(null);
+	}
+	$t_users_count = sizeof( $users );
+
+# ======================================
+# counting tasks
+# ======================================
+	
+	$t_user_task_count = task_get_all_user_task( $users, $t_all_view );
+	$t_unassigned_rows = task_get_unassigned_tasks( $t_current_project_id );
+	$t_unconfirmed_rows = task_get_unconfirmed_tasks( $t_current_project_id );
+	$t_opened_count = $t_user_task_count + sizeof( $t_unassigned_rows ) + sizeof( $t_unconfirmed_rows );
+	$t_closed_count = 0;
+	if ( $t_all_view ) {
+	    $t_unassigned_closed_rows = task_get_unassigned_tasks( $t_current_project_id, true );
+	    $t_unconfirmed_closed_rows = task_get_unconfirmed_tasks( $t_current_project_id, true );
+	    $t_closed_count = sizeof( $t_unassigned_closed_rows ) + sizeof( $t_unconfirmed_closed_rows );			
+	}
+
+
+	 $t_status_legend_position = config_get( 'status_legend_position' );
+
+
+ 
+         if ( $t_status_legend_position == STATUS_LEGEND_POSITION_TOP || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {
+                 html_status_legend();
+         }
+				 
+        mark_time( 'begin loop' );
+
+# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)
+        if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){
+                ?>
+                <script type="text/javascript" language="JavaScript" src="javascript/shifttasklist.js"></script>
+                <?php
+	}
+
+
+?>
+    <form name="bug_action" method="get" action="task_actiongroup_page.php">
+    <input type="hidden" name="ids" id="ids" value="">
+    <input type="hidden" name="task_view_type" value="<?php print $t_view_type;?>">
+    <table id="buglist" class="width100" cellspacing="1">
+<?php # -- Bug list column header row -- ?>
+<tr class="row-category">
+<?php
+	$t_columns = helper_get_columns_to_view( COLUMNS_TARGET_TASK_VIEW_PAGE );
+	
+	$col_count = sizeof( $t_columns );
+
+            foreach( $t_columns as $t_column ) {
+                    $t_title_function = 'print_column_title';
+                    helper_call_custom_function( $t_title_function, array( $t_column ) );
+                }
+		
+	if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) { 
+	    #print "<td align=\"center\">".lang_get( 'task_move' )."</td>";
+	    print "<td></td>";
+	}
+	
+?>
+
+</tr>
+										
+
+<?php
+
+	
+	for ( $i=0; $i < $t_users_count; $i++) {
+		$t_user_name = user_get_realname( $users[$i] );
+
+
+?>
+<tr class="row-category">
+<td colspan=" <?php print $col_count ?> ">
+<?php
+	 $rows = task_get_user_tasks( $users[$i] );
+    print $t_user_name." (".sizeof($rows).")</td>"; 
+    
+    if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {?>
+     <td> <input type="hidden" id="<?php print $users[$i] ?>">
+     <input type="image" class="button" SRC="<?php print $t_icon_Ok;?>" value="Uaktualnij"  name="<?php print $users[$i] ?>" onClick="updateIt(this)" >
+     <input type="image" class="button" SRC="<?php print $t_icon_Cn;?>" value="Uaktualnij"  name="<?php print $users[$i] ?>" onClick="window.location.reload( false ); return false;" ></td>
+<?php #"
+    }
+    print "</tr>\n";
+
+
+		for ( $j=0; $j < sizeof($rows); $j++ )
+		{
+		    $t_bug_id = $rows[$j];
+		    $t_bug_row = bug_cache_row( $t_bug_id );
+                    # choose color based on status
+                    $status_color = get_status_color( $t_bug_row['status'] );
+                    echo '<tr bgcolor="', $status_color, '" border="1">';
+		    write_bug_row ($t_bug_row, false);
+		    if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {
+?>
+		<td align="center">
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveTop'  );?>" SRC="<?php print $t_icon_Ft; ?>"value="UP" onClick="moveFirst(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveUp'  );?>" SRC="<?php print $t_icon_Up; ?>"value="UP" onClick="moveUp(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveDown'  );?>" SRC="<?php print $t_icon_Dn;?>" value="DOWN" onClick="moveDn(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveBottom'  );?>" SRC="<?php print $t_icon_Lt;?>" value="DOWN" onClick="moveLast(this); return false;"/>
+		</td>
+<?php #"
+		    }
+		    print "</tr>\n";
+		}
+		
+    if ( $t_all_view ) {
+	$t_full_filter = array(
+    	    'show_category'         => Array ( '0' => META_FILTER_ANY ),
+    	    'show_severity'         => Array ( '0' => config_get( 'task_severity_threshold' ) ),
+    	    'show_status'           => Array ( '0' => $g_hide_status_default ),
+    	    'highlight_changed'     => Array ( '0' => META_FILTER_ANY ),
+    	    'reporter_id'           => Array ( '0' => META_FILTER_ANY ),
+    	    'handler_id'            => Array ( '0' => $users[$i] ),
+    	    'show_resolution'       => Array ( '0' => META_FILTER_ANY ),
+    	    'show_build'            => Array ( '0' => META_FILTER_ANY ),
+    	    'show_version'          => Array ( '0' => META_FILTER_ANY ),
+    	    'hide_status'           => Array ( '0' => META_FILTER_ANY ),
+    	    'user_monitor'          => Array ( '0' => META_FILTER_ANY ),
+    	    'sort'		    => Array ( '0' => 'task_order', '1' => 'last_updated' ),
+    	    'dir'		    => Array ( '0' => 'ASC', '1' => 'DESC' )
+	);
+	
+	$f_page_number = 1;
+	$t_per_page = null;
+	$t_bug_count = null;
+	$t_page_count = null;
+	$t_rows = filter_get_bug_rows( $f_page_number, $t_per_page, $t_page_count, $t_bug_count, $t_full_filter, null, null, false);
+	
+	for ( $j=0; $j < count ($t_rows); $j++ ) {
+            # choose color based on status
+            $status_color = get_status_color( $t_rows[$j]['status'] );
+            echo '<tr bgcolor="', $status_color, '" border="1" class="task-row">';
+	    write_bug_row( $t_rows[$j] );
+	    if ( $t_can_reorder ) {
+		print "<td></td>";
+	    }
+	    print "</tr>\n";
+	}
+    
+    }
+ }
+?>
+<tr class="row-category">
+<td colspan=" <?php print $col_count ?> ">
+<?php
+
+print lang_get( 'task_view_unassigned' )." (".sizeof($t_unassigned_rows).")</td>";
+
+   if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {?>
+     <td> <input type="hidden" id="0">
+     <input type="image" class="button" SRC="<?php print $t_icon_Ok;?>" value="Uaktualnij"  name="0" onClick="updateIt(this)" >
+     <input type="image" class="button" SRC="<?php print $t_icon_Cn;?>" value="Uaktualnij"  name="0" onClick="window.location.reload( false ); return false;" ></td>
+<?php #"
+	}
+		
+		for ( $j=0; $j < sizeof( $t_unassigned_rows ); $j++ )
+		{
+		    $t_bug_id = $t_unassigned_rows[$j];
+		    $t_bug_row = bug_cache_row( $t_bug_id );
+                    # choose color based on status
+                    $status_color = get_status_color( $t_bug_row['status'] );
+                    echo '<tr bgcolor="', $status_color, '" border="1">';
+		    write_bug_row ($t_bug_row, false);
+		    if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {
+?>
+		<td align="center">
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveTop'  );?>" SRC="<?php print $t_icon_Ft; ?>"value="UP" onClick="moveFirst(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveUp'  );?>" SRC="<?php print $t_icon_Up; ?>"value="UP" onClick="moveUp(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveDown'  );?>" SRC="<?php print $t_icon_Dn;?>" value="DOWN" onClick="moveDn(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveBottom'  );?>" SRC="<?php print $t_icon_Lt;?>" value="DOWN" onClick="moveLast(this); return false;"/>
+		</td>
+<?php #"
+		    }
+		    print "</tr>\n";
+		}
+
+	if ( $t_all_view ) {
+		for ( $j=0; $j < count ($t_unassigned_closed_rows); $j++ ) {
+				$t_bug_row = bug_cache_row( $t_unassigned_closed_rows[$j] );
+            # choose color based on status
+            $status_color = get_status_color( $t_bug_row['status'] );
+            echo '<tr bgcolor="', $status_color, '" border="1" class="task-row">';
+	    		write_bug_row( $t_bug_row );
+	    		if ( $t_can_reorder ) {
+					print "<td></td>";
+	    		}
+	    		print "</tr>\n";
+		} # for
+	} # if 
+
+?>
+<tr class="row-category">
+<td colspan=" <?php print $col_count ?> ">
+<?php
+print lang_get( 'task_view_unconfirmed' )." (".sizeof( $t_unconfirmed_rows ).")</td>";
+
+   if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {?>
+     <td> <input type="hidden" id="-1">
+     <input type="image" class="button" SRC="<?php print $t_icon_Ok;?>" value="Uaktualnij"  name="-1" onClick="updateIt(this)" >
+     <input type="image" class="button" SRC="<?php print $t_icon_Cn;?>" value="Uaktualnij"  name="-1" onClick="window.location.reload( false ); return false;" ></td>
+<?php #"
+	}
+		
+		for ( $j=0; $j < sizeof( $t_unconfirmed_rows ); $j++ )
+		{
+		    $t_bug_id = $t_unconfirmed_rows[$j];
+		    $t_bug_row = bug_cache_row( $t_bug_id );
+                    # choose color based on status
+                    $status_color = get_status_color( $t_bug_row['status'] );
+                    echo '<tr bgcolor="', $status_color, '" border="1">';
+		    write_bug_row ($t_bug_row, false);
+		    if ( $t_can_reorder && $t_token <= TASK_VIEW_PROJECT_ALL ) {
+?>
+		<td align="center">
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveTop'  );?>" SRC="<?php print $t_icon_Ft; ?>"value="UP" onClick="moveFirst(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveUp'  );?>" SRC="<?php print $t_icon_Up; ?>"value="UP" onClick="moveUp(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveDown'  );?>" SRC="<?php print $t_icon_Dn;?>" value="DOWN" onClick="moveDn(this); return false;"/>
+		<input type="image" class="button" ALT="<?php print lang_get( 'task_moveBottom'  );?>" SRC="<?php print $t_icon_Lt;?>" value="DOWN" onClick="moveLast(this); return false;"/>
+		</td>
+<?php #"
+		    }
+		    print "</tr>\n";
+		}
+	if ( $t_all_view ) {
+		for ( $j=0; $j < count ( $t_unconfirmed_closed_rows ); $j++ ) {
+				$t_bug_row = bug_cache_row( $t_unconfirmed_closed_rows[$j] );
+            # choose color based on status
+            $status_color = get_status_color( $t_bug_row['status'] );
+            echo '<tr bgcolor="', $status_color, '" border="1" class="task-row">';
+	    		write_bug_row( $t_bug_row );
+	    		if ( $t_can_reorder ) {
+					print "<td></td>";
+	    		}
+	    		print "</tr>\n";
+		} # for
+	} # if 
+
+
+	# -- ====================== MASS BUG MANIPULATION =================== --
+?>
+	<tr>
+		<td class="left" colspan="<?php echo $col_count-2; ?>">
+<?php
+		if ( $t_checkboxes_exist && ON == config_get( 'use_javascript' ) ) {
+			echo "<input type=\"checkbox\" name=\"all_bugs\" value=\"all\" onclick=\"checkall('bug_action', this.form.all_bugs.checked)\" /><span class=\"small\">" . lang_get( 'select_all' ) . '</span>';
+		}
+
+		if ( $t_checkboxes_exist ) {
+?>
+			<select name="action">
+				<?php print_all_task_action_option_list() ?>
+			</select>
+			<input type="submit" class="button" value="<?php echo lang_get( 'ok' ); ?>" />
+<?php
+		} else {
+			echo '&nbsp;';
+		}
+?>
+
+    </table></form><br>
+    
+<?php
+
+	 $t_status_legend_position = config_get( 'status_legend_position' );
+
+ 
+         if ( $t_status_legend_position == STATUS_LEGEND_POSITION_BOTTOM || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {
+                 html_status_legend();
+         }
+
+	mark_time( 'end loop' );
+
+
+	html_page_bottom1( __FILE__ );
+?>
+
+
+
+<?php
+        function write_bug_row ( $p_row, $p_no_mass = true )
+        {
+                global $t_columns, $t_filter;
+
+					$t_print_columns = $t_columns;
+					
+                mark_time( 'begin loop' );
+
+                # -- Loop over bug rows --
+
+		{
+                        $t_row = $p_row;
+
+                        foreach( $t_print_columns as $t_column ) {
+                        		  if ( $p_no_mass && $t_column == 'selection' ) {
+                        		  	echo '<td></td>';
+                        		  } else {
+                                $t_column_value_function = 'print_column_value';
+                                helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row ) );
+                                }
+                        }
+
+#                        echo '</tr>';
+                }
+        }
+
+?>
