View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008942 | mantisbt | time tracking | public | 2008-03-05 09:34 | 2012-08-08 15:30 |
| Reporter | smig1o | Assigned To | atrol | ||
| Priority | normal | Severity | tweak | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 1.2.0 | ||||
| Summary | 0008942: due date feature | ||||
| Description | I have implemented stage 1 onf due date feature (according to http://www.mantisbt.org/wiki/doku.php/mantisbt:due_date_requirements) There is an icon that MUST be replaced with something more >mantisable<. This time I've double checked the patch | ||||
| Tags | patch | ||||
| Attached Files | duedate_stage1_final2.diff (28,076 bytes)
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-03-31 15:39:29.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,32 @@
</tr>
<?php } ?>
+<!-- Due date -->
+<?php 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 "<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( 'due_date' ) ?> <?php print_documentation_link( 'due_date' ) ?>
+ </td>
+ <td>
+ <?php
+ print "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".date( config_get( 'short_date_format' ), $t_bug->due_date)."\">";
+ ?>
+ <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
# @@@ thraxisp - I undid part of the change for #5068 for #5527
@@ -320,6 +346,23 @@
</form>
</div>
+<?php
+if ( $t_can_set_due_date ) {
+ $t_format = config_get( 'short_date_format' );
+ $t_new_format = str_replace( '-', '-%', $t_format );
+ $t_format = "%".$t_new_format;
+
+?>
+ <script type="text/javascript">
+ Calendar.setup (
+ {
+ inputField : "due_date",
+ ifFormat : "<?php print $t_format?>",
+ button : "trigger"
+ }
+ );
+ </script>
+<?php } ?>
<br />
<?php
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bug_view_inc.php' );
diff -Naur orig/bug_report.php mantisbt/bug_report.php
--- orig/bug_report.php 2008-03-31 13:45:27.000000000 +0200
+++ mantisbt/bug_report.php 2008-03-31 16:02:24.000000000 +0200
@@ -54,6 +54,10 @@
$t_bug_data->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 @@
<input type="hidden" name="build" value="<?php echo $t_bug_data->build ?>" />
<input type="hidden" name="report_stay" value="1" />
<input type="hidden" name="view_state" value="<?php echo $t_bug_data->view_state ?>" />
+ <input type="hidden" name="due_date" value="<?php echo $t_bug_data->due_date ?>" />
<input type="submit" class="button" value="<?php echo lang_get( 'report_more_bugs' ) ?>" />
</form>
</p>
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 @@
</tr>
<?php } ?>
+<!-- Due date -->
+<?php 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 "<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( 'due_date' ) ?> <?php print_documentation_link( 'due_date' ) ?>
+ </td>
+ <td>
+ <?php
+ print "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".print_date( config_get( 'short_date_format' ), $t_bug->due_date)."\">";
+ ?>
+ <input type="image" class="button" id="trigger" SRC="
+ <?php print $cal_icon;?> " onClick="return showCalendar ('sel1', '%Y-%m-%d', 24, true)" />
+ </td>
+</tr>
+<?php } ?>
<!-- spacer -->
<tr class="spacer">
@@ -554,6 +582,22 @@
window.document.report_bug_form.category_id.focus();
-->
</script>
+<?php }
+if ( $t_can_set_due_date ) {
+ $t_format = config_get( 'short_date_format' );
+ $t_new_format = str_replace( '-', '-%', $t_format );
+ $t_format = "%".$t_new_format;
+
+?>
+ <script type="text/javascript">
+ Calendar.setup (
+ {
+ inputField : "due_date",
+ ifFormat : "<?php print $t_format?>",
+ button : "trigger"
+ }
+ );
+ </script>
<?php } ?>
<?php html_page_bottom1( __FILE__ ) ?>
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 @@
?>
</td>
- <!-- spacer -->
- <td colspan="2"> </td>
+<?php if ( access_has_bug_level( config_get( 'due_date_see_threshold' ), $f_bug_id ) ) { ?>
+ <!-- Due Date -->
+ <td class="category">
+ <?php echo lang_get( 'due_date' ) ?>
+ </td>
+ <?php
+ if ( bug_is_overdue( $f_bug_id ) ) {
+ print "<td class=\"overdue\">";
+ } else {
+ print "<td>";
+ }
+ 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 "<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";
+ $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 "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".$t_date_to_display."\">";
+ ?>
+ <input type="image" class="button" id="trigger" SRC="
+ <?php print $cal_icon;?> " onClick="return showCalendar ('sel1', '%Y-%m-%d', 24, true)" />
+ </td>
+ <?php } else {
+ if ( $t_bug->due_date != $t_null_date ) print_date( config_get( 'short_date_format' ), $t_bug->due_date ); }?>
+ </td>
+<?php } else { ?>
+ <!-- spacer -->
+ <td colspan="2"> </td>
+<?php } ?>
+
</tr>
@@ -595,6 +631,25 @@
</form>
<?php
+if ( $t_can_set_due_date ) {
+ $t_format = config_get( 'short_date_format' );
+ $t_new_format = str_replace( '-', '-%', $t_format );
+ $t_format = "%".$t_new_format;
+
+?>
+ <script type="text/javascript">
+ Calendar.setup (
+ {
+ inputField : "due_date",
+ ifFormat : "<?php print $t_format?>",
+ button : "trigger"
+ }
+ );
+ </script>
+<?php }?>
+
+
+<?php
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bugnote_view_inc.php' );
html_page_bottom1( __FILE__ );
diff -Naur orig/bug_update_page.php mantisbt/bug_update_page.php
--- orig/bug_update_page.php 2008-03-31 13:45:27.000000000 +0200
+++ mantisbt/bug_update_page.php 2008-03-31 14:06:38.000000000 +0200
@@ -280,6 +280,9 @@
</tr>
<?php
+ } else {
+ # spacer
+ echo '<td colspan="2"> </td>';
}
?>
<?php /*
diff -Naur orig/bug_view_advanced_page.php mantisbt/bug_view_advanced_page.php
--- orig/bug_view_advanced_page.php 2008-03-31 13:45:26.000000000 +0200
+++ mantisbt/bug_view_advanced_page.php 2008-03-31 15:52:27.000000000 +0200
@@ -217,8 +217,29 @@
<?php echo get_enum_element( 'project_view_state', $t_bug->view_state ) ?>
</td>
- <!-- spacer -->
- <td colspan="2"> </td>
+ <!-- Due Date -->
+ <?php if ( access_has_bug_level( config_get( 'due_date_see_threshold' ), $f_bug_id ) ) { ?>
+ <td class="category">
+ <?php echo lang_get( 'due_date' ) ?>
+ </td>
+ <?php
+ if ( bug_is_overdue( $f_bug_id ) ) {
+ print "<td class=\"overdue\">";
+ } else {
+ print "<td>";
+ }
+ ?>
+ <?php
+ if ( !date_is_null( $t_bug->due_date ) ) {
+ print_date( config_get( 'short_date_format' ), $t_bug->due_date ); }
+ ?>
+ </td>
+ <?php } else { ?>
+ <!-- spacer -->
+ <td colspan="2"> </td>
+ <?php
+ }
+ ?>
</tr>
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-03-31 15:51:33.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 = REPORTER;
+
+ $g_due_date_see_threshold = MANAGER;
+
+?>
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-03-31 15:46:39.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,14 @@
$c_target_version = '';
}
+ #check due_date format
+ if ( is_blank( $c_due_date ) ) {
+ $c_due_date = date_get_null();
+ }
+
+ $t_format = strtotime( $c_due_date);
+ $c_due_date = date ( 'Y-m-d', $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 +508,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 +537,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 +604,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 +934,11 @@
$t_fields[] = $c_bug_id;
db_query_bound( $query, $t_fields );
+ if ( !is_blank( $c_bug_data->due_date ) ) {
+ $t_format = strtotime( $c_bug_data->due_date);
+ $c_bug_data->due_date = date ( 'Y-m-d', $t_format );
+ bug_set_field( $c_bug_id, 'due_date', $c_bug_data->due_date);
+ }
bug_clear_cache( $p_bug_id );
@@ -1190,12 +1231,24 @@
$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_new_time = strtotime( $p_status );
+ if ( ! date_is_null( $t_new_time ) )
+ $p_status = date( config_get ( 'short_date_format' ), $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 +1550,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 +1576,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 '<td>';
+
+ if ( bug_is_overdue( $p_row['id'] ) && access_has_bug_level( config_get( 'due_date_see_threshold' ), $p_row['id'] )) {
+ print "<td class=\"overdue\">";
+ } else {
+ echo '<td>';
+ }
if ( !bug_is_readonly( $p_row['id'] )
&& access_has_bug_level( $t_update_bug_threshold, $p_row['id'] ) ) {
echo '<a href="' . string_get_bug_update_url( $p_row['id'] ) . '">';
@@ -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 '<a href="' . string_get_bug_update_url( $p_row['id'] ) . '">';
+ echo '<img border="0" width="16" height="16" src="' . $t_icon_path . 'overdued.png';
+ echo '" alt="' . lang_get( 'overdue' ) . '"';
+ echo ' title="' . lang_get( 'overdue' ) . '" /></a>';
+ } else if ( ! date_is_null( $p_row[ 'due_date' ] ) && access_has_bug_level( config_get( 'due_date_see_threshold' ), $p_row['id'] )) {
+ echo '<a href="' . string_get_bug_update_url( $p_row['id'] ) . '">';
+ echo '<img border="0" width="16" height="16" src="' . $t_icon_path . 'clock.png';
+ echo '" alt="' . lang_get( 'due_date' ) . '"';
+ echo ' title="' . lang_get( 'due_date' ) . '" /></a>';
+ } else {
+ echo ' ';
+ }
+
echo '</td>';
}
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-03-31 15:28:41.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
+
+
IHDR �a gAMA ��7�� tEXtSoftware Adobe ImageReadyq�e< | ||||