diff -Naur orig/admin/schema.php mantisbt/admin/schema.php --- orig/admin/schema.php 2008-03-31 14:05:21.000000000 +0200 +++ mantisbt/admin/schema.php 2008-03-31 15:27:04.000000000 +0200 @@ -383,6 +383,8 @@ $upgrade[] = Array( 'InsertData', Array( db_get_table( 'mantis_category_table' ), " ( project_id, user_id, name, status ) VALUES ( '0', '0', 'General', '0' ) " ) ); + + $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_bug_table' ), "category_id I UNSIGNED NOTNULL DEFAULT '1'" ) ); $upgrade[] = Array( 'UpdateFunction', "category_migrate" ); $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'mantis_bug_table' ), "category" ) ); @@ -405,3 +407,5 @@ $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_project_version_table' ), " obsolete L NOTNULL DEFAULT \" '0' \"" ) ); +$upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_bug_table' ), " + due_date T NOTNULL DEFAULT '1970-01-01 00:00:01' " ) ); diff -Naur orig/bug_change_status_page.php mantisbt/bug_change_status_page.php --- orig/bug_change_status_page.php 2008-03-31 13:45:26.000000000 +0200 +++ mantisbt/bug_change_status_page.php 2008-04-03 11:07:19.000000000 +0200 @@ -52,7 +52,7 @@ ) ) { access_denied(); } - + $t_can_set_due_date = access_has_bug_level( config_get( 'due_date_set_threshold' ), $f_bug_id ); # 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' ) ); @@ -161,6 +161,35 @@ + += 5.0, Mozilla >= 1.0, Safari >=1.2, ...) + if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){ + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + } + $t_icon_path = config_get( 'icon_path' ); + $cal_icon = $t_icon_path ."calendar-img.gif"; + $t_date_to_display = ''; + if ( ! date_is_null( $t_bug->due_date ) ) { + $t_date_to_display = date( config_get( 'short_date_format' ), $t_bug->due_date ); +?> +> + + + + + "; + ?> + + + + + + + +
description = gpc_get_string( 'description' ); $t_bug_data->steps_to_reproduce = gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) ); $t_bug_data->additional_information = gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) ); + $t_bug_data->due_date = gpc_get_string( 'due_date', ''); + if ( is_blank ( $t_bug_data->due_date ) ) { + $t_bug_data->due_date = date_get_null(); + } $f_file = gpc_get_file( 'file', null ); #@@@ (thraxisp) Note that this always returns a structure # size = 0, if no file @@ -188,6 +192,7 @@ +

diff -Naur orig/bug_report_advanced_page.php mantisbt/bug_report_advanced_page.php --- orig/bug_report_advanced_page.php 2008-03-31 13:45:26.000000000 +0200 +++ mantisbt/bug_report_advanced_page.php 2008-03-31 15:10:51.000000000 +0200 @@ -44,6 +44,8 @@ print_header_redirect ( 'bug_report_page.php' . ( 0 == $f_master_bug_id ) ? '' : '?m_id=' . $f_master_bug_id ); } + + $t_can_set_due_date = access_has_bug_level( config_get( 'due_date_set_threshold' ), $f_master_bug_id ); if( $f_master_bug_id > 0 ) { # master bug exists... @@ -114,6 +116,7 @@ $f_steps_to_reproduce = gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) ); $f_additional_info = gpc_get_string( 'additional_info', config_get ( 'default_bug_additional_info' ) ); $f_view_state = gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) ); + $f_due_date =gpc_get_string( 'due_date', ''); $t_project_id = helper_get_current_project(); @@ -209,6 +212,31 @@ + += 5.0, Mozilla >= 1.0, Safari >=1.2, ...) + if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){ + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + } + $t_icon_path = config_get( 'icon_path' ); + $cal_icon = $t_icon_path ."calendar-img.gif"; +?> +> + + + + + due_date)."\">"; + ?> + + + + @@ -554,6 +582,22 @@ window.document.report_bug_form.category_id.focus(); --> + + diff -Naur orig/bug_update.php mantisbt/bug_update.php --- orig/bug_update.php 2008-03-31 13:45:27.000000000 +0200 +++ mantisbt/bug_update.php 2008-03-31 16:03:04.000000000 +0200 @@ -77,7 +77,11 @@ $t_bug_data->target_version = gpc_get_string( 'target_version', $t_bug_data->target_version ); $t_bug_data->view_state = gpc_get_int( 'view_state', $t_bug_data->view_state ); $t_bug_data->summary = gpc_get_string( 'summary', $t_bug_data->summary ); - + $t_bug_data->due_date = gpc_get_string( 'due_date', $t_bug_data->due_date); + if ( is_blank ( $t_bug_data->due_date ) ) { + $t_bug_data->due_date = date_get_null( ); + } + $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 ); diff -Naur orig/bug_update_advanced_page.php mantisbt/bug_update_advanced_page.php --- orig/bug_update_advanced_page.php 2008-03-31 13:45:27.000000000 +0200 +++ mantisbt/bug_update_advanced_page.php 2008-03-31 15:55:30.000000000 +0200 @@ -35,7 +35,7 @@ $f_bug_id = gpc_get_int( 'bug_id' ); $t_bug = bug_prepare_edit( bug_get( $f_bug_id, true ) ); - + if( $t_bug->project_id != helper_get_current_project() ) { # in case the current project is not the same project of the bug we are viewing... # ... override the current project. This to avoid problems with categories and handlers lists etc. @@ -48,13 +48,13 @@ if ( SIMPLE_ONLY == config_get( 'show_update' ) ) { print_header_redirect ( 'bug_update_page.php?bug_id=' . $f_bug_id ); } - + if ( bug_is_readonly( $f_bug_id ) ) { error_parameters( $f_bug_id ); trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR ); } - access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id ); + $t_can_set_due_date = access_has_bug_level( config_get( 'due_date_set_threshold' ), $f_bug_id ); html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); html_page_top2(); @@ -189,8 +189,44 @@ ?> - -   + + + + + + "; + } else { + print ""; + } + if ( $t_can_set_due_date ) { +# @@@ (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 ""; + echo "\n"; + echo "\n"; + echo "\n"; + } + $t_icon_path = config_get( 'icon_path' ); + $cal_icon = $t_icon_path ."calendar-img.gif"; + $t_date_to_display = ''; + if ( ! date_is_null( $t_bug->due_date ) ) { + $t_date_to_display = date( config_get( 'short_date_format' ), $t_bug->due_date ); + } + print ""; + ?> + + + due_date != $t_null_date ) print_date( config_get( 'short_date_format' ), $t_bug->due_date ); }?> + + + +   + + @@ -595,6 +631,25 @@ + + + + +  '; } ?> view_state ) ?> - -   + + + + + + "; + } else { + print ""; + } + ?> + due_date ) ) { + print_date( config_get( 'short_date_format' ), $t_bug->due_date ); } + ?> + + + +   + diff -Naur orig/config_defaults_inc.php mantisbt/config_defaults_inc.php --- orig/config_defaults_inc.php 2008-03-31 13:45:27.000000000 +0200 +++ mantisbt/config_defaults_inc.php 2008-04-04 10:50:51.000000000 +0200 @@ -1995,4 +1995,14 @@ # Enables or disables the mind mapping features including ability to export Freemind files and # in browser view of generated mindmaps. $g_mindmap_enabled = ON; -?> \ No newline at end of file + + ############################# + # Due Date + ############################# + + # threshold to set due date_submitted + $g_due_date_set_threshold = DEVELOPER; + + $g_due_date_see_threshold = REPORTER; + +?> diff -Naur orig/core/bug_api.php mantisbt/core/bug_api.php --- orig/core/bug_api.php 2008-03-31 13:45:23.000000000 +0200 +++ mantisbt/core/bug_api.php 2008-04-04 10:16:14.000000000 +0200 @@ -79,6 +79,9 @@ #internal helper objects var $_stats = null; + + #due date + var $due_date = ''; } #=================================== @@ -105,6 +108,8 @@ $p_bug_database_result['date_submitted'] = db_unixtimestamp( $p_bug_database_result['date_submitted']['date_submitted'] ); if( !is_int( $p_bug_database_result['last_updated'] ) ) $p_bug_database_result['last_updated'] = db_unixtimestamp( $p_bug_database_result['last_updated'] ); + if( !is_int( $p_bug_datebase_result['due_date'] ) ) + $p_bug_datebase_result['due_date'] = db_unixtimestamp( $p_bug_datebase_result['due_date'] ); $g_cache_bug[ $p_bug_database_result['id'] ] = $p_bug_database_result; if( !is_null( $p_stats ) ) { $g_cache_bug[ $p_bug_database_result['id'] ]['_stats'] = $p_stats; @@ -145,6 +150,8 @@ $row = db_fetch_array( $result ); $row['date_submitted'] = db_unixtimestamp( $row['date_submitted'] ); $row['last_updated'] = db_unixtimestamp( $row['last_updated'] ); + $row['due_date'] = db_unixtimestamp( $row['due_date'] ); + $g_cache_bug[$c_bug_id] = $row; return $row; @@ -335,6 +342,23 @@ } # -------------------- + # Check if the bug is overdue + function bug_is_overdue( $p_bug_id ) { + $t_bug_row = bug_cache_row( $p_bug_id ); + $t_due_date = $t_bug_row[ 'due_date' ]; + if ( ! date_is_null( $t_due_date) ) { + $t_now = db_unixtimestamp(); + if ( $t_now > $t_due_date ) { + if ( $t_bug_row[ 'status' ] < config_get( 'bug_resolved_status_threshold' ) ) { + return true; + } + } + } + return false; + } + + + # -------------------- # Validate workflow state to see if bug can be moved to requested state function bug_check_workflow( $p_bug_status, $p_wanted_status ) { $t_status_enum_workflow = config_get( 'status_enum_workflow' ); @@ -393,6 +417,8 @@ $c_additional_info = $p_bug_data->additional_information; $c_sponsorship_total = 0; $c_sticky = 0; + $c_due_date = $p_bug_data->due_date; + # Summary cannot be blank if ( is_blank( $c_summary ) ) { @@ -419,6 +445,17 @@ $c_target_version = ''; } + #check due_date format + if ( is_blank( $c_due_date ) ) { + $c_due_date = date_get_null(); + } + + + if ( !is_int( $c_due_date ) ) { + $t_format = strtotime( $c_due_date); + $c_due_date = date ( 'Y-m-d 00:00:01', $t_format ); + } + $t_bug_table = db_get_table( 'mantis_bug_table' ); $t_bug_text_table = db_get_table( 'mantis_bug_text_table' ); $t_category_table = db_get_table( 'mantis_category_table' ); @@ -474,7 +511,7 @@ platform, version, build, profile_id, summary, view_state, sponsorship_total, sticky, fixed_in_version, - target_version + target_version, due_date ) VALUES ( " . db_param(0) . ", @@ -503,10 +540,11 @@ " . db_param(23) . ", " . db_param(24) . ", " . db_param(25) . ", - " . db_param(26) . ")"; + " . db_param(26) . ", + " . db_param(27) . ")"; db_query_bound( $query, Array( $c_project_id, $c_reporter_id, $c_handler_id, 0, $c_priority, $c_severity, $c_reproducibility, $t_status, $t_resolution, 10, $c_category_id, db_now(), db_now(), 10, $t_text_id, $c_os, $c_os_build, $c_platform, $c_version,$c_build, - $c_profile_id, $c_summary, $c_view_state, $c_sponsorship_total, $c_sticky, '', $c_target_version ) ); + $c_profile_id, $c_summary, $c_view_state, $c_sponsorship_total, $c_sticky, '', $c_target_version, $c_due_date) ); $t_bug_id = db_insert_id($t_bug_table); @@ -569,6 +607,7 @@ 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, 'due_date', $t_bug_data->due_date ); # COPY CUSTOM FIELDS if ( $p_copy_custom_fields ) { @@ -898,6 +937,16 @@ $t_fields[] = $c_bug_id; db_query_bound( $query, $t_fields ); + + if ( !is_blank( $p_bug_data->due_date ) ) { + if ( !is_int( $p_bug_data->due_date ) ) { + $t_format = strtotime( $p_bug_data->due_date); + $p_bug_data->due_date = date ( 'Y-m-d H:i:s', $t_format ); + } else { + $p_bug_data->due_date = date ( 'Y-m-d H:i:s', $p_bug_data->due_date ); + } + bug_set_field( $p_bug_id, 'due_date', $p_bug_data->due_date); + } bug_clear_cache( $p_bug_id ); @@ -1190,12 +1239,27 @@ $c_status = $p_status; #generic, unknown type $h_status = bug_get_field( $p_bug_id, $p_field_name ); + + if ( $p_field_name == 'due_date' ) { + if ( !date_is_null( $h_status ) ) + $h_status = date( config_get ( 'short_date_format' ), $h_status ); + else + $h_status = ''; + $t_tmp = $p_status; + if ( !is_int( $p_status ) ) { + $t_tmp = strtotime( $p_status ); + } + if ( !date_is_null( $t_tmp ) ) + $p_status = date( config_get ( 'short_date_format' ), $t_tmp ); + else + $p_status = ''; + $p_field_name = lang_get( 'due_date' ); + } # return if status is already set if ( $c_status == $h_status ) { return true; } - $t_bug_table = db_get_table( 'mantis_bug_table' ); # Update fields @@ -1497,6 +1561,7 @@ $p_bug_data->summary = string_attribute( $p_bug_data->summary ); $p_bug_data->sponsorship_total = string_attribute( $p_bug_data->sponsorship_total ); $p_bug_data->sticky = string_attribute( $p_bug_data->sticky ); + $p_bug_data->due_date = string_attribute( $p_bug_data->due_date ); $p_bug_data->description = string_textarea( $p_bug_data->description ); $p_bug_data->steps_to_reproduce = string_textarea( $p_bug_data->steps_to_reproduce ); @@ -1522,6 +1587,7 @@ $p_bug_data->summary = string_display_line_links( $p_bug_data->summary ); $p_bug_data->sponsorship_total = string_display_line( $p_bug_data->sponsorship_total ); $p_bug_data->sticky = string_display_line( $p_bug_data->sticky ); + $p_bug_data->due_date = string_display_line( $p_bug_data->due_date ); $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 ); diff -Naur orig/core/columns_api.php mantisbt/core/columns_api.php --- orig/core/columns_api.php 2008-03-31 13:45:24.000000000 +0200 +++ mantisbt/core/columns_api.php 2008-03-31 15:59:07.000000000 +0200 @@ -501,8 +501,12 @@ # $p_columns_target: see COLUMNS_TARGET_* in constant_inc.php function print_column_edit( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) { global $t_icon_path, $t_update_bug_threshold; - - echo ''; + + if ( bug_is_overdue( $p_row['id'] ) && access_has_bug_level( config_get( 'due_date_see_threshold' ), $p_row['id'] )) { + print ""; + } else { + echo ''; + } if ( !bug_is_readonly( $p_row['id'] ) && access_has_bug_level( $t_update_bug_threshold, $p_row['id'] ) ) { echo ''; @@ -512,6 +516,20 @@ } else { echo ' '; } + if ( bug_is_overdue( $p_row['id'] ) && access_has_bug_level( config_get( 'due_date_see_threshold' ), $p_row['id'] ) ) { + echo ''; + echo '' . lang_get( 'overdue' ) . ''; + } else if ( ! date_is_null( $p_row[ 'due_date' ] ) && access_has_bug_level( config_get( 'due_date_see_threshold' ), $p_row['id'] )) { + echo ''; + echo '' . lang_get( 'due_date' ) . ''; + } else { + echo ' '; + } + echo ''; } diff -Naur orig/core/date_api.php mantisbt/core/date_api.php --- orig/core/date_api.php 2008-03-31 13:45:23.000000000 +0200 +++ mantisbt/core/date_api.php 2008-04-04 10:22:43.000000000 +0200 @@ -22,6 +22,20 @@ # -------------------------------------------------------- ### Date API ### + # -------------------- + # checks if date is null + function date_is_null ( $p_date ) { + if ( $p_date <= date_get_null( ) ) { + return true; + } + return false; + } + + # -------------------- + # gets null date + function date_get_null ( ) { + return db_unixtimestamp( '1970-01-01 00:00:01' ); + } # -------------------- # prints the date given the formating string diff -Naur orig/core/filter_api.php mantisbt/core/filter_api.php --- orig/core/filter_api.php 2008-03-31 13:45:23.000000000 +0200 +++ mantisbt/core/filter_api.php 2008-03-31 14:06:38.000000000 +0200 @@ -1539,6 +1539,7 @@ $row['date_submitted'] = db_unixtimestamp ( $row['date_submitted'] ); $row['last_updated'] = db_unixtimestamp ( $row['last_updated'] ); + $row['due_date'] = db_unixtimestamp( $row['due_date'] ); array_push( $rows, $row ); } diff -Naur orig/core/version_api.php mantisbt/core/version_api.php --- orig/core/version_api.php 2008-03-31 13:45:23.000000000 +0200 +++ mantisbt/core/version_api.php 2008-03-31 14:56:16.000000000 +0200 @@ -326,8 +326,9 @@ $t_obsolete_where = ''; } else { $c_obsolete = db_prepare_bool( $p_obsolete ); - $t_obsolete_where = "AND ( obsolete = $c_obsolete )"; + $t_obsolete_where = "AND ( obsolete = ". db_param(0)." )"; } + $t_project_version_table = db_get_table( 'mantis_project_version_table' ); @@ -335,7 +336,7 @@ FROM $t_project_version_table WHERE $t_project_where $t_released_where $t_obsolete_where ORDER BY date_order DESC"; - $result = db_query( $query ); + $result = db_query_bound( $query, Array( $c_obsolete ) ); $count = db_num_rows( $result ); $rows = array(); for ( $i = 0 ; $i < $count ; $i++ ) { diff -Naur orig/css/default.css mantisbt/css/default.css --- orig/css/default.css 2008-03-31 13:44:50.000000000 +0200 +++ mantisbt/css/default.css 2008-03-31 14:06:38.000000000 +0200 @@ -49,6 +49,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.overdue { background-color: #ff0000; color: #000000; font-weight: bold; } td.col-1 { background-color: #d8d8d8; color: #000000; } td.col-2 { background-color: #e8e8e8; color: #000000; } diff -Naur orig/images/clock.png mantisbt/images/clock.png --- orig/images/clock.png 1970-01-01 01:00:00.000000000 +0100 +++ mantisbt/images/clock.png 2008-03-31 14:06:38.000000000 +0200 @@ -0,0 +1,8 @@ +PNG + + IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDAT8]kHSq}}( +EAAЇnAXVdYդtvl6׌t7 M}پ 7EF܏&MszJf-KS0\u I!}ًf>Ʌ]zd&."^õJ,.4 2I3(PdEى zG˅מ=M'QH;ePQxt5/ހG0/ vT\}`gDhc8 /jRTp +ex+JP/)T;ƥ0o8ާx^+e/<6iFہ ~G +[app@NyY&^tRE]"taC +T%}N+BŨyY&^xrk᪾6W݇$+Ϊ U0L`#ZyÙZ}ā6"92qC33~[rKk'E}G6M~1I HM-=(h'[RǍ6 VPmzEN^%1FitKz{^fs |E&ߑΌ%]}S]r_9]eӕ3&ܵ5d+! :jPy{!6'Xm7|D#McW0FCK~P͐JŻq(`gvې]xĵ.d'dEռ|)(ݍ/BhX/sd +b +8RG=8 gXž,X/sVz.n˵AoGRH?Ndd ǀ=` H>_{ }a%޹hFT<$Jx9}z3tn1^"B-,~HC0RL D`xd5#%[ic=dڇpPDejt\ i2uؿw* =WH, )J;ӬMd8s&ОѣX$Ӊ7f/qW.f6`^4M\mSed&&*:\RRCnEiGxBo3 4ћo(PPPE=ĴesԨ:6bHM_5ӡIENDB` \ No newline at end of file diff -Naur orig/lang/strings_english.txt mantisbt/lang/strings_english.txt --- orig/lang/strings_english.txt 2008-03-31 13:44:41.000000000 +0200 +++ mantisbt/lang/strings_english.txt 2008-03-31 14:06:38.000000000 +0200 @@ -1511,4 +1511,9 @@ # mind mapping $s_mindmap = 'Mindmap'; $s_freemind_export = 'Freemind Export'; + +# due date +$s_due_date = "Due Date"; +$s_overdue = "Overdue"; + ?> \ No newline at end of file diff -Naur orig/lang/strings_polish.txt mantisbt/lang/strings_polish.txt --- orig/lang/strings_polish.txt 2008-03-31 13:44:41.000000000 +0200 +++ mantisbt/lang/strings_polish.txt 2008-03-31 14:06:38.000000000 +0200 @@ -1336,4 +1336,7 @@ # wiki related strings $s_wiki = 'Wiki'; +$s_due_date = "Termin realizacji"; +$s_overdue = "Przeterminowane"; + ?> diff -Naur orig/lang/strings_polish_8859-2.txt mantisbt/lang/strings_polish_8859-2.txt --- orig/lang/strings_polish_8859-2.txt 2008-03-31 13:44:40.000000000 +0200 +++ mantisbt/lang/strings_polish_8859-2.txt 2008-03-31 14:06:38.000000000 +0200 @@ -1336,4 +1336,7 @@ # wiki related strings $s_wiki = 'Wiki'; +$s_due_date = "Termin realizacji"; +$s_overdue = "Przeterminowane"; + ?>