View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007682 | mantisbt | roadmap | public | 2006-12-22 08:11 | 2007-12-21 23:16 |
| Reporter | seiji | Assigned To | vboctor | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.1.0a2 | ||||
| Target Version | 1.1.0 | Fixed in Version | 1.1.0a3 | ||
| Summary | 0007682: Add progress bar to Roadmap | ||||
| Description | Roadmap is very useful function, but I would like to add progress bar like trac. | ||||
| Additional Information | It is necessary to improve stylesheet. | ||||
| Tags | No tags attached. | ||||
| Attached Files | progress_bar.diff (3,681 bytes)
Index: css/default.css
===================================================================
--- css/default.css (リビジョン 29)
+++ css/default.css (リビジョン 34)
@@ -106,3 +106,6 @@
.underline-small { text-decoration: underline; font-size: 8pt; }
.strike { text-decoration: line-through; }
.strike-small { text-decoration: line-through; font-size: 8pt; }
+
+.graph { position: relative; width: 400px; border: 1px solid #d7d7d7; margin-top: 1em; margin-bottom: 1em; padding: 1px; }
+.graph .bar { display: block; position: relative; background: #6bba70; text-align: center; font-weight: normal; color: #333; height: 2em; line-height: 2em; }
Index: core/custom_function_api.php
===================================================================
--- core/custom_function_api.php (リビジョン 29)
+++ core/custom_function_api.php (リビジョン 34)
@@ -52,25 +52,27 @@
}
# --------------------
- # Prints one entry in the roadmap.
- function custom_function_default_roadmap_print_issue( $p_issue_id ) {
- $t_bug = bug_get( $p_issue_id );
-
- if ( bug_is_resolved( $p_issue_id ) ) {
- $t_strike_start = '<strike>';
- $t_strike_end = '</strike>';
- } else {
- $t_strike_start = $t_strike_end = '';
- }
-
- $t_category = is_blank( $t_bug->category ) ? '' : '<b>[' . $t_bug->category . ']</b> ';
- echo '- ', $t_strike_start, string_get_bug_view_link( $p_issue_id ), ': ', $t_category, string_attribute( $t_bug->summary );
+ # Prints one entries in the roadmap.
+ function custom_function_default_roadmap_print_issue( $p_issue_ids ) {
+ foreach ( $p_issue_ids as $t_issue_id ) {
+ $t_bug = bug_get( $t_issue_id );
+ if ( bug_is_resolved( $t_issue_id ) ) {
+ $t_strike_start = '<strike>';
+ $t_strike_end = '</strike>';
+ } else {
+ $t_strike_start = $t_strike_end = '';
+ }
- if ( $t_bug->handler_id != 0 ) {
- echo ' (', prepare_user_name( $t_bug->handler_id ), ')';
+ $t_category = is_blank( $t_bug->category ) ? '' : '<b>[' . $t_bug->category . ']</b> ';
+ echo '- ', $t_strike_start, string_get_bug_view_link( $t_issue_id ), ': ', $t_category, string_attribute( $t_bug->summary );
+
+ if ( $t_bug->handler_id != 0 ) {
+ echo ' (', prepare_user_name( $t_bug->handler_id ), ')';
+ }
+
+ echo ' - ', get_enum_element( 'status', $t_bug->status ), $t_strike_end, '.<br />';
+
}
-
- echo ' - ', get_enum_element( 'status', $t_bug->status ), $t_strike_end, '.<br />';
}
# --------------------
Index: roadmap_page.php
===================================================================
--- roadmap_page.php (リビジョン 29)
+++ roadmap_page.php (リビジョン 34)
@@ -119,6 +119,7 @@
$t_first_entry = true;
$t_result = db_query( $query );
+ $t_issues_id = array();
while ( $t_row = db_fetch_array( $t_result ) ) {
# hide private bugs if user doesn't have access to view them.
@@ -164,11 +165,20 @@
$t_first_entry = false;
}
- helper_call_custom_function( 'roadmap_print_issue', array( $t_issue_id ) );
+ $t_issues_id[] = $t_issue_id;
}
$i++;
+ $t_progress = ( $t_issues_planned == 0 ) ? 0 : (int)( $t_issues_resolved * 100 / $t_issues_planned );
+ // show progress bar
+ echo '<div class="graph">';
+ echo ' <span class="bar" style="width: ' . $t_progress . '%;">' . $t_progress . '%</span>';
+ echo '</div>';
+
+ // issue list
+ helper_call_custom_function( 'roadmap_print_issue', array( $t_issues_id ) );
+
if ( $t_issues_planned > 0 ) {
echo '<br />';
echo sprintf( lang_get( 'resolved_progress' ), $t_issues_resolved, $t_issues_planned, $t_issues_resolved * 100 / $t_issues_planned );
| ||||