Ejemplo n.º 1
0
    print_bracket_link('?bug_id=' . $t_bug_id, lang_get('all_revisions'));
}
print_bracket_link('view.php?id=' . $t_bug_id, lang_get('back_to_issue'));
?>
</td>
</tr>

<tr <?php 
echo helper_alternate_class();
?>
>
<th class="category" width="15%"><?php 
echo lang_get('summary');
?>
</th>
<td colspan="3"><?php 
echo bug_format_summary($t_bug_id, SUMMARY_FIELD);
?>
</td>
</tr>

<?php 
foreach ($t_bug_revisions as $t_rev) {
    show_revision($t_rev);
}
?>

</table>

<?php 
html_page_bottom();
Ejemplo n.º 2
0
$tpl_can_attach_tag = $tpl_show_tags && !$tpl_force_readonly && access_has_bug_level(config_get('tag_attach_threshold'), $f_bug_id);
$tpl_show_category = in_array('category_id', $t_fields);
$tpl_category = $tpl_show_category ? string_display_line(category_full_name($tpl_bug->category_id)) : '';
$tpl_show_priority = in_array('priority', $t_fields);
$tpl_priority = $tpl_show_priority ? string_display_line(get_enum_element('priority', $tpl_bug->priority)) : '';
$tpl_show_severity = in_array('severity', $t_fields);
$tpl_severity = $tpl_show_severity ? string_display_line(get_enum_element('severity', $tpl_bug->severity)) : '';
$tpl_show_reproducibility = in_array('reproducibility', $t_fields);
$tpl_reproducibility = $tpl_show_reproducibility ? string_display_line(get_enum_element('reproducibility', $tpl_bug->reproducibility)) : '';
$tpl_show_status = in_array('status', $t_fields);
$tpl_status = $tpl_show_status ? string_display_line(get_enum_element('status', $tpl_bug->status)) : '';
$tpl_show_resolution = in_array('resolution', $t_fields);
$tpl_resolution = $tpl_show_resolution ? string_display_line(get_enum_element('resolution', $tpl_bug->resolution)) : '';
$tpl_show_summary = in_array('summary', $t_fields);
$tpl_show_description = in_array('description', $t_fields);
$tpl_summary = $tpl_show_summary ? bug_format_summary($f_bug_id, SUMMARY_FIELD) : '';
$tpl_description = $tpl_show_description ? string_display_links($tpl_bug->description) : '';
$tpl_steps_to_reproduce = $tpl_show_steps_to_reproduce ? string_display_links($tpl_bug->steps_to_reproduce) : '';
$tpl_additional_information = $tpl_show_additional_information ? string_display_links($tpl_bug->additional_information) : '';
$tpl_links = event_signal('EVENT_MENU_ISSUE', $f_bug_id);
#
# Start of Template
#
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<thead><tr class="bug-nav">';
# Form Title
echo '<td class="form-title" colspan="', $t_bugslist ? '3' : '4', '">';
echo $tpl_form_title;
echo '&#160;<span class="small">';
# Jump to Bugnotes
Ejemplo n.º 3
0
$t_summary = string_display_line_links(bug_format_summary($f_bug_id, SUMMARY_FIELD));
$t_description = string_display_links($t_bug->description);
$t_steps_to_reproduce = string_display_links($t_bug->steps_to_reproduce);
$t_additional_information = string_display_links($t_bug->additional_information);
$t_view_state = $t_show_view_state ? get_enum_element('view_state', $t_bug->view_state) : '';
if ($t_show_due_date) {
    if (!date_is_null($t_bug->due_date)) {
        $t_due_date = date(config_get('normal_date_format'), $t_bug->due_date);
    } else {
        $t_due_date = '';
    }
}
$t_product_version = $t_show_product_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->version, $t_bug->project_id))) : '';
$t_target_version = $t_show_target_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->target_version, $t_bug->project_id))) : '';
$t_fixed_in_version = $t_show_fixed_in_version ? string_display_line(prepare_version_string($t_bug->project_id, version_get_id($t_bug->fixed_in_version, $t_bug->project_id))) : '';
html_page_top1(bug_format_summary($f_bug_id, SUMMARY_CAPTION));
html_head_end();
html_body_begin();
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<tr>';
echo '<td class="form-title" colspan="6">';
echo '<div class="center">', $t_window_title;
if (!is_blank($t_project_name)) {
    echo ' - ' . $t_project_name;
}
echo '</div></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="form-title" colspan="6">', lang_get('bug_view_title'), '</td>';
echo '</tr>';
Ejemplo n.º 4
0
 function format_value($bug, $field_name)
 {
     $values = array('id' => function ($bug) {
         return sprintf('%s <%s>', $bug->id, string_get_bug_view_url_with_fqdn($bug->id));
     }, 'project_id' => function ($bug) {
         return project_get_name($bug->project_id);
     }, 'reporter_id' => function ($bug) {
         return '@' . user_get_name($bug->reporter_id);
     }, 'handler_id' => function ($bug) {
         return empty($bug->handler_id) ? plugin_lang_get('no_user') : '@' . user_get_name($bug->handler_id);
     }, 'duplicate_id' => function ($bug) {
         return sprintf('%s <%s>', $bug->duplicate_id, string_get_bug_view_url_with_fqdn($bug->duplicate_id));
     }, 'priority' => function ($bug) {
         return get_enum_element('priority', $bug->priority);
     }, 'severity' => function ($bug) {
         return get_enum_element('severity', $bug->severity);
     }, 'reproducibility' => function ($bug) {
         return get_enum_element('reproducibility', $bug->reproducibility);
     }, 'status' => function ($bug) {
         return get_enum_element('status', $bug->status);
     }, 'resolution' => function ($bug) {
         return get_enum_element('resolution', $bug->resolution);
     }, 'projection' => function ($bug) {
         return get_enum_element('projection', $bug->projection);
     }, 'category_id' => function ($bug) {
         return category_full_name($bug->category_id, false);
     }, 'eta' => function ($bug) {
         return get_enum_element('eta', $bug->eta);
     }, 'view_state' => function ($bug) {
         return $bug->view_state == VS_PRIVATE ? lang_get('private') : lang_get('public');
     }, 'sponsorship_total' => function ($bug) {
         return sponsorship_format_amount($bug->sponsorship_total);
     }, 'os' => function ($bug) {
         return $bug->os;
     }, 'os_build' => function ($bug) {
         return $bug->os_build;
     }, 'platform' => function ($bug) {
         return $bug->platform;
     }, 'version' => function ($bug) {
         return $bug->version;
     }, 'fixed_in_version' => function ($bug) {
         return $bug->fixed_in_version;
     }, 'target_version' => function ($bug) {
         return $bug->target_version;
     }, 'build' => function ($bug) {
         return $bug->build;
     }, 'summary' => function ($bug) {
         return HipChatPlugin::clean_summary(bug_format_summary($bug->id, SUMMARY_FIELD));
     }, 'last_updated' => function ($bug) {
         return date(config_get('short_date_format'), $bug->last_updated);
     }, 'date_submitted' => function ($bug) {
         return date(config_get('short_date_format'), $bug->date_submitted);
     }, 'due_date' => function ($bug) {
         return date(config_get('short_date_format'), $bug->due_date);
     }, 'description' => function ($bug) {
         return string_display_links($bug->description);
     }, 'steps_to_reproduce' => function ($bug) {
         return string_display_links($bug->steps_to_reproduce);
     }, 'additional_information' => function ($bug) {
         return string_display_links($bug->additional_information);
     });
     // Discover custom fields.
     $t_related_custom_field_ids = custom_field_get_linked_ids($bug->project_id);
     foreach ($t_related_custom_field_ids as $t_id) {
         $t_def = custom_field_get_definition($t_id);
         $values['custom_' . $t_def['name']] = function ($bug) use($t_id) {
             return custom_field_get_value($t_id, $bug->id);
         };
     }
     if (isset($values[$field_name])) {
         $func = $values[$field_name];
         return $func($bug);
     } else {
         return sprintf(plugin_lang_get('unknown_field'), $field_name);
     }
 }
Ejemplo n.º 5
0
            $t_tags_failed[] = $t_tag_row;
        }
    } else {
        if (-2 == $t_tag_row['id']) {
            $t_tags_failed[] = $t_tag_row;
        } else {
            $t_tags_attach[] = $t_tag_row;
        }
    }
}
if (0 < $f_tag_select && tag_exists($f_tag_select)) {
    $t_tags_attach[] = tag_get($f_tag_select);
}
// failed to attach at least one tag
if (count($t_tags_failed) > 0) {
    html_page_top(lang_get('tag_attach_long') . ' ' . bug_format_summary($f_bug_id, SUMMARY_CAPTION));
    ?>
<br/>
<table class="width75">
	<tr class="row-category">
	<td colspan="2"><?php 
    echo lang_get('tag_attach_failed');
    ?>
</td>
	</tr>
	<tr class="spacer"><td colspan="2"></td></tr>
<?php 
    $t_tag_string = "";
    foreach ($t_tags_attach as $t_tag_row) {
        if (!is_blank($t_tag_string)) {
            $t_tag_string .= config_get('tag_separator');
Ejemplo n.º 6
0
        echo helper_alternate_class();
        ?>
>
<td class="small-caption">
<?php 
        echo $t_item['username'];
        ?>
</td>
<td class="small-caption">
<?php 
        echo date(config_get("short_date_format"), strtotime($t_item['expenditure_date']));
        ?>
</td>
<td class="small-caption">
<?php 
        echo bug_format_summary($t_item['bug_id'], SUMMARY_FIELD);
        ?>
</td>
<td class="small-caption">
<?php 
        echo number_format($t_item['hours'], 2, '.', ',');
        ?>
</td>
<td class="small-caption">
<?php 
        echo $t_item['info'];
        ?>
</td>
</tr>
<?php 
    }
Ejemplo n.º 7
0
?>

<br/>
<table class="width100" cellspacing="1">

<tr>
<td class="form-title" colspan="2"><?php echo lang_get( 'view_revisions' ), ': ', $t_title ?></td>
<td class="right" colspan="2">
<?php
if ( !$f_bug_id && !$f_bugnote_id ) { print_bracket_link( '?bug_id=' . $t_bug_id, lang_get( 'all_revisions' ) ); }
print_bracket_link( 'view.php?id=' . $t_bug_id, lang_get( 'back_to_issue' ) );
?>
</td>
</tr>

<tr <?php echo helper_alternate_class() ?>>
<th class="category" width="15%"><?php echo lang_get( 'summary' ) ?></th>
<td colspan="3"><?php echo bug_format_summary( $t_bug_id, SUMMARY_FIELD ) ?></td>
</tr>

<?php foreach( $t_bug_revisions as $t_rev ) {
	show_revision( $t_rev );
} ?>

</table>

<?php
html_page_bottom();

Ejemplo n.º 8
0
$tpl_can_attach_tag = $tpl_show_tags && !$tpl_force_readonly && access_has_bug_level(config_get('tag_attach_threshold'), $f_bug_id);
$tpl_show_category = in_array('category_id', $t_fields);
$tpl_category = $tpl_show_category ? string_display_line(category_full_name($tpl_bug->category_id)) : '';
$tpl_show_priority = in_array('priority', $t_fields);
$tpl_priority = $tpl_show_priority ? string_display_line(get_enum_element('priority', $tpl_bug->priority)) : '';
$tpl_show_severity = in_array('severity', $t_fields);
$tpl_severity = $tpl_show_severity ? string_display_line(get_enum_element('severity', $tpl_bug->severity)) : '';
$tpl_show_reproducibility = in_array('reproducibility', $t_fields);
$tpl_reproducibility = $tpl_show_reproducibility ? string_display_line(get_enum_element('reproducibility', $tpl_bug->reproducibility)) : '';
$tpl_show_status = in_array('status', $t_fields);
$tpl_status = $tpl_show_status ? string_display_line(get_enum_element('status', $tpl_bug->status)) : '';
$tpl_show_resolution = in_array('resolution', $t_fields);
$tpl_resolution = $tpl_show_resolution ? string_display_line(get_enum_element('resolution', $tpl_bug->resolution)) : '';
$tpl_show_summary = in_array('summary', $t_fields);
$tpl_show_description = in_array('description', $t_fields);
$tpl_summary = $tpl_show_summary ? string_display_line_links(bug_format_summary($f_bug_id, SUMMARY_FIELD)) : '';
$tpl_description = $tpl_show_description ? string_display_links($tpl_bug->description) : '';
$tpl_steps_to_reproduce = $tpl_show_steps_to_reproduce ? string_display_links($tpl_bug->steps_to_reproduce) : '';
$tpl_additional_information = $tpl_show_additional_information ? string_display_links($tpl_bug->additional_information) : '';
$tpl_links = event_signal('EVENT_MENU_ISSUE', $f_bug_id);
#
# Start of Template
#
echo '<br />';
echo '<table class="width100" cellspacing="1">';
echo '<thead><tr class="bug-nav">';
# Form Title
echo '<td class="form-title" colspan="', $t_bugslist ? '3' : '4', '">';
echo $tpl_form_title;
echo '&nbsp;<span class="small">';
# Jump to Bugnotes
Ejemplo n.º 9
0
function gantt_chart($p_metrics, $p_title, $p_subtitle, $p_graph_width = 300, $p_graph_height = 380)
{
    $t_graph_font = graph_get_font();
    $t_metrics = $p_metrics['metrics'];
    $t_range = $p_metrics['range'];
    // Diff in weeks of the range:
    $t_60s = 60;
    // 1 minute
    $t_60min = 60;
    // 1 hour
    $t_24h = 24;
    // 1 day
    $t_7d = 7;
    // 1 week
    $t_minute = $t_60s;
    $t_hour = $t_60min * $t_minute;
    $t_day = $t_24h * $t_hour;
    $t_week = $t_7d * $t_day;
    $t_gantt_chart_max_rows = plugin_config_get('rows_max');
    error_check(is_array($t_metrics) ? count($t_metrics) : 0, $p_title . " (" . $p_subtitle . ")");
    if (plugin_config_get('eczlibrary') == ON) {
        // DO NOTHING SINCE eczlibrary DOES NOT SUPPORT GANTT CHART
    } else {
        // A new graph with automatic size
        $graph = new GanttGraph(0, 0, "auto");
        $graph->SetShadow();
        // Add title and subtitle
        $graph->title->Set($p_title);
        $graph->title->SetFont($t_graph_font, FS_BOLD, 12);
        $graph->subtitle->Set($p_subtitle);
        // Show day, week and month scale
        $graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
        // Instead of week number show the date for the first day in the week
        // on the week scale
        $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
        // Make the week scale font smaller than the default
        $graph->scale->week->SetFont($t_graph_font, FS_NORMAL, 8);
        // Use the short name of the month together with a 2 digit year
        // on the month scale
        $graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
        $graph->scale->month->SetFontColor("white");
        $graph->scale->month->SetBackgroundColor("blue");
        // Setup a horizontal grid
        $graph->hgrid->Show();
        $graph->hgrid->SetRowFillColor('darkblue@0.9');
        // Setup a vertical grid
        //   $graph->vgrid->Show();
        //Setup the divider display
        $graph->scale->divider->SetWeight(3);
        $graph->scale->divider->SetColor("darkblue");
        $graph->scale->dividerh->SetWeight(3);
        $graph->scale->dividerh->SetColor("darkblue");
        $graph->scale->dividerh->Show();
        $graph->scale->actinfo->vgrid->SetStyle('solid');
        $graph->scale->actinfo->vgrid->SetColor('darkblue');
        $graph->scale->actinfo->vgrid->Show();
        //   // Set the column headers and font
        //   $graph->scale->actinfo->SetColTitles( array('Task','Start','End'),array(100));
        //   $graph->scale->actinfo->SetFont( $t_graph_font, FS_BOLD, 10 );
        //Adding columns:
        //The following is an example: 1st element, an array of the columns,
        //  2nd element an optional array of min width of the columns (here the min width of the 2 first columns)
        //$graph->scale->actinfo->SetColTitles(
        //  array('Note','Task','Duration','Start','Finish'),array(30,100));
        //Adding a table title
        $graph->scale->tableTitle->Set("{$p_subtitle}");
        $graph->scale->tableTitle->SetFont($t_graph_font, FS_NORMAL, 8);
        $graph->scale->SetTableTitleBackground('darkblue@0.6');
        $graph->scale->tableTitle->Show();
        //           if ( null != $t_constrain ){
        //           $t_activity->SetConstrain( $t_constrain, CONSTRAIN_ENDSTART );
        //         }
        //     if ( null != $t_constrain ){
        //       $t_activity->SetConstrain( $t_constrain['row'], $t_constrain['type'] );
        //     }
        // We first need to get the list of rows, in order to know whether to
        // display the constraint or not (in case of missing referenced row)
        $t_row_list = array();
        foreach ($t_metrics as $t_metric_row) {
            $t_row_list[] = $t_metric_row[0];
        }
        foreach ($t_metrics as $t_metric_row) {
            $t_row = $t_metric_row[0] % $t_gantt_chart_max_rows;
            $t_activity_type = $t_metric_row[1];
            $t_bug_id = $t_metric_row[2];
            $t_start_date = $t_metric_row[3];
            $t_end_date = $t_metric_row[4];
            $t_extra = " {$t_bug_id}" . $t_metric_row[5];
            $t_level = $t_metric_row[6];
            $t_constraints = $t_metric_row[7];
            if (isset($t_level)) {
                $t_row_label = utf8_str_pad('', $t_level * 2, ' ') . htmlspecialchars_decode(bug_format_summary($t_bug_id, SUMMARY_FIELD));
            } else {
                $t_row_label = htmlspecialchars_decode(bug_format_summary($t_bug_id, SUMMARY_FIELD));
            }
            // Limit the label to max defined
            $t_row_label = strlen($t_row_label) > plugin_config_get('label_max') ? substr($t_row_label, 0, plugin_config_get('label_max') - 3) . '...' : $t_row_label;
            $t_activity_arr = array('left' => null, 'main' => array('row' => $t_row, 'label' => $t_row_label, 'start' => $t_start_date, 'end' => $t_end_date, 'info' => $t_extra), 'right' => null);
            if ($t_end_date < $t_range['min']) {
                // complete left bar
                //   **  | o[ ]-[ ]o
                $t_activity_arr = array('left' => array('row' => $t_row, 'label' => $t_row_label, 'start' => $t_range['min'], 'end' => $t_range['min'], 'info' => "<- " . graph_date_format($t_start_date)), 'main' => null, 'right' => array('row' => $t_row, 'label' => "", 'start' => $t_range['min'] + $t_day, 'end' => $t_range['min'] + $t_day, 'info' => "<<- [" . graph_date_format($t_start_date) . " / " . graph_date_format($t_end_date) . "]" . $t_extra));
            } else {
                if ($t_range['max'] < $t_start_date) {
                    // complete right bar
                    //   o[ ]-[ ]o | **
                    $t_activity_arr = array('left' => array('row' => $t_row, 'label' => $t_row_label, 'start' => $t_range['max'] - $t_day, 'end' => $t_range['max'] - $t_day, 'info' => ""), 'main' => null, 'right' => array('row' => $t_row, 'label' => "", 'start' => $t_range['max'], 'end' => $t_range['max'], 'info' => "[" . graph_date_format($t_start_date) . " / " . graph_date_format($t_end_date) . "] ->>" . $t_extra));
                } else {
                    if ($t_start_date < $t_range['min']) {
                        // left bar
                        //   *  | o[ ]-[    ]
                        $t_activity_arr['left'] = array('row' => $t_row, 'label' => '', 'start' => $t_range['min'], 'end' => $t_range['min'], 'info' => "<- " . graph_date_format($t_start_date));
                        $t_activity_arr['main']['start'] = $t_range['min'] + $t_day;
                        //4 * $t_day;// @TODO: what happens if duration is less than that
                    }
                    if ($t_range['max'] < $t_end_date) {
                        // right bar
                        //  [     ]-[ ]o | *
                        $t_activity_arr['main']['end'] = $t_range['max'] - $t_day;
                        //4 * $t_day;
                        $t_activity_arr['main']['info'] = "";
                        $t_activity_arr['right'] = array('row' => $t_row, 'label' => "", 'start' => $t_range['max'], 'end' => $t_range['max'], 'info' => graph_date_format($t_end_date) . " ->" . $t_extra);
                    }
                }
            }
            switch ($t_activity_type) {
                case ACTYPE_NORMAL:
                    if (null != $t_activity_arr['left']) {
                        $t_activity_left = new GanttBar($t_activity_arr['left']['row'], $t_activity_arr['left']['label'], graph_date_format($t_activity_arr['left']['start']), graph_date_format($t_activity_arr['left']['end']), $t_activity_arr['left']['info']);
                        // Add a left marker
                        $t_activity_left->leftMark->Show();
                        $t_activity_left->leftMark->SetType(MARK_FILLEDCIRCLE);
                        $t_activity_left->leftMark->SetWidth(8);
                        //                        $t_activity_left->leftMark->SetColor( 'red' );
                        $t_activity_left->leftMark->SetFillColor('red');
                        $t_activity_left->leftMark->title->Set('');
                        $t_activity_left->leftMark->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        $t_activity_left->leftMark->title->SetColor('white');
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_left->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_left->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                    }
                    if (null != $t_activity_arr['main']) {
                        $t_activity_main = new GanttBar($t_activity_arr['main']['row'], $t_activity_arr['main']['label'], graph_date_format($t_activity_arr['main']['start']), graph_date_format($t_activity_arr['main']['end']), $t_activity_arr['main']['info']);
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_main->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_main->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                        $t_activity_main->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        // Set the constraint if any...
                        foreach ($t_constraints as $t_constraint) {
                            // ... and if possible
                            if (in_array($t_constraint['row'], $t_row_list)) {
                                $t_activity_main->SetConstrain($t_constraint['row'], $t_constraint['type']);
                            }
                        }
                        $graph->add($t_activity_main);
                    }
                    if (null != $t_activity_arr['right']) {
                        $t_activity_right = new GanttBar($t_activity_arr['right']['row'], $t_activity_arr['right']['label'], graph_date_format($t_activity_arr['right']['start']), graph_date_format($t_activity_arr['right']['end']), $t_activity_arr['right']['info']);
                        // Add a left marker
                        $t_activity_right->rightMark->Show();
                        $t_activity_right->rightMark->SetType(MARK_FILLEDCIRCLE);
                        $t_activity_right->rightMark->SetWidth(8);
                        $t_activity_right->rightMark->SetColor('red');
                        $t_activity_right->rightMark->SetFillColor('red');
                        $t_activity_right->rightMark->title->Set('');
                        $t_activity_right->rightMark->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        $t_activity_right->rightMark->title->SetColor('white');
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_right->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_right->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                    }
                    if (isset($t_activity_left)) {
                        $graph->add($t_activity_left);
                    }
                    if (isset($t_activity_right)) {
                        $graph->add($t_activity_right);
                    }
                    break;
                case ACTYPE_MILESTONE:
                    $t_size = 5;
                    if ($t_start_date < $t_range['min']) {
                        $t_extra = "(<-- " . graph_date_format($t_start_date) . ")" . $t_extra;
                        $t_start_date = $t_range['min'];
                        $t_size = 8;
                    } else {
                        if ($t_range['max'] < $t_start_date) {
                            $t_extra = "(--> " . graph_date_format($t_start_date) . ")" . $t_extra;
                            $t_start_date = $t_range['max'];
                            $t_size = 8;
                        }
                    }
                    $t_milestone = new MileStone($t_row, $t_row_label, graph_date_format($t_start_date), $t_extra);
                    $t_milestone->title->SetFont($t_graph_font, FS_NORMAL, 8);
                    $t_milestone->mark->SetType(MARK_FILLEDCIRCLE);
                    $t_milestone->mark->SetWidth($t_size);
                    if (5 != $t_size) {
                        $t_milestone->mark->SetFillColor('red');
                    }
                    //         foreach( $t_constraints as $t_constraint){
                    //           $t_milestone->SetConstrain( $t_constraint['row'], $t_constraint['type'] );
                    //         }
                    $graph->add($t_milestone);
                    break;
            }
        }
        // Setting the min and max date:
        $t_minmax = $graph->GetBarMinMax();
        $t_week_in_seconds = 7 * 24 * 3600;
        // 1 week offset min:
        if ($t_minmax[0] - $t_week_in_seconds > 0) {
            $t_graph_offset_min = $t_minmax[0] - $t_week_in_seconds;
        } else {
            $t_graph_offset_min = $t_minmax[0];
        }
        // 2 weeks offset max:
        $t_graph_offset_max = $t_minmax[1] + 3 * $t_week_in_seconds;
        $graph->SetDateRange(graph_date_format($t_graph_offset_min), graph_date_format($t_graph_offset_max));
        // Add a vertical line for today if in the range of GetBarMinMax() (retruns an arry ($min, $max) ):
        $t_minmax = $graph->GetBarMinMax();
        $t_now = date(config_get('short_date_format'));
        if ($t_now >= graph_date_format($t_graph_offset_min) && $t_now <= graph_date_format($t_graph_offset_max)) {
            $t_today = new GanttVLine($t_now, "Today", "darkred", 2, "solid");
            $t_today->SetDayOffset(0.5);
            $graph->add($t_today);
        }
        //       $t_today = new GanttVLine( "2011-03-01" , "" , "darkred", 2, "solid");//
        //       $t_today->SetDayOffset(0.5);
        //       $graph->add( $t_today );
        $t_gantt_chart_height = gantt_chart_get_height($graph);
        $t_legend = gantt_chart_legend(false);
        $t_legend_height = 60;
        // Display the Gantt chart
        //     $graph->Stroke();
        //--------------------------------------
        // Create a combined graph
        //--------------------------------------
        $mgraph = new MGraph();
        $mgraph->Add($graph, 0, 0);
        $mgraph->Add($t_legend, 0, $t_gantt_chart_height + $t_legend_height);
        $mgraph->Stroke();
    }
}
Ejemplo n.º 10
0
				<p class="bugid"></p>
				<p class="commits"><?php 
                    echo $source_count[$bug->id];
                    ?>
</p>
				<p class="category"><?php 
                    if ($bug->project_id != $current_project) {
                        $project_name = project_get_name($bug->project_id);
                        echo '<span class="project">' . $project_name . '</span> - ';
                    }
                    echo category_full_name($bug->category_id, false);
                    ?>
				</p>
				<p class="summary">
					<?php 
                    echo string_get_bug_view_link($bug->id) . ': ' . bug_format_summary($bug->id, 0);
                    ?>

				</p>
				<p class="severity"
					style="background: <?php 
                    echo $sevcolor;
                    ?>
"
					title="Severity: <?php 
                    echo get_enum_element('severity', $bug->severity);
                    ?>
">
				</p>
				<p class="resolution"
					style="background: <?php