Description | Scenario:
Many people do not enough attantive to Resolution. And it is not enough visible on default.
So I was needed the way to make it "on eyes".
I wished to tigh column with small icon to make possible by sight make a decision on Resolution.
Solution:
I have made some customization
see attach Resolution_png-ON.png
It is view when my column is on.
In additional information steps to make it possible (it is fully support languages).
Please look at it, may be it is possible to include it into Mantis_Install_Pack.
P.S. I'm not a painter may be some one could draw better images. Or leave it on customization for end-user. |
---|
Additional Information | 1. Сopy into /Images pictures from attach Mantis_Resolution_Images.zip
2. Add file custom_functions_inc.php, same place as config_inc.php
with next content
//in othere way change core/custom_function_api.php, and add some param to config_inc.php (as attachment indicator I propose Resolution_Indicator):
<?php
### Overrided Custom Function API ###
function custom_function_override_get_columns_to_view ( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
$t_columns = array();
if ( $p_columns_target == COLUMNS_TARGET_CSV_PAGE ) {
$t_columns[] = 'id'; // localized: 'id',
$t_columns[] = 'project_id'; // 'email_project'
$t_columns[] = 'reporter_id'; // 'reporter'
$t_columns[] = 'handler_id'; // 'assigned_to'
$t_columns[] = 'priority'; // 'priority'
$t_columns[] = 'severity'; // 'severity'
$t_columns[] = 'reproducibility'; // 'reproducibility'
$t_columns[] = 'version'; // 'version'
$t_columns[] = 'projection'; // 'projection'
$t_columns[] = 'category'; // 'category'
$t_columns[] = 'date_submitted'; // 'date_submitted'
$t_columns[] = 'eta'; // 'eta'
$t_columns[] = 'os'; // 'os'
$t_columns[] = 'os_build'; // 'os_version'
$t_columns[] = 'platform'; // 'platform'
$t_columns[] = 'view_state'; // 'view_status'
$t_columns[] = 'last_updated'; // 'last_update'
$t_columns[] = 'summary'; // 'summary'
$t_columns[] = 'status'; // 'status'
$t_columns[] = 'resolution'; // 'resolution'
$t_columns[] = 'fixed_in_version'; // 'fixed_in_version';
if ( OFF == config_get( 'enable_relationship' ) ) {
$t_columns[] = 'duplicate_id'; // 'duplicate_id'
}
} else {
$t_columns[] = 'selection';
if ( $p_columns_target == COLUMNS_TARGET_VIEW_PAGE ) {
$t_columns[] = 'edit';
}
$t_columns[] = 'priority';
$t_columns[] = 'id';
$t_enable_sponsorship = config_get( 'enable_sponsorship' );
if ( ON == $t_enable_sponsorship ) {
$t_columns[] = 'sponsorship_total';
}
$t_columns[] = 'bugnotes_count';
$t_show_attachments = config_get( 'show_attachment_indicator' );
if ( ON == $t_show_attachments ) {
$t_columns[] = 'attachment';
}
$t_columns[] = 'category';
$t_columns[] = 'severity';
$t_columns[] = 'status';
$t_columns[] = 'resolution_png'; <b>//here is the difference from default</b>
$t_columns[] = 'last_updated';
$t_columns[] = 'summary';
}
return $t_columns;
}
?>
3. Add next content to core/columns_api.php
after last function:
function print_column_title_resolution_png ( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
//global $t_icon_path;
$t_icon_path="http://192.168.5.7/mantis_dem/images/";
echo "\t<td>";
echo '<img src="' . $t_icon_path . 'resolution.png"' ;
echo ' alt="' . lang_get( 'resolution' ) . '"';
echo ' title="' . lang_get( 'resolution' ) . '"';
echo ' width=18 heigh=16 />';
echo "</td>\n";
}
}
function print_column_resolution_png ( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
//global $t_icon_path;
$t_icon_path="http://192.168.5.7/mantis_dem/images/";
$t_image_path = null;
$t_bug = bug_get( $p_row['id'] , true );
$t_resolution_show = get_enum_element( 'resolution', $t_bug->resolution );
switch($t_bug->resolution) {
//add here any different value for custom resolutions
case 10:
$t_image_path = $t_icon_path . 'open.png'; break;
case 20:
$t_image_path = $t_icon_path . 'fixed.png'; break;
case 30:
$t_image_path = $t_icon_path . 'reopen.png'; break;
case 40:
$t_image_path = $t_icon_path . 'unable_to_reproduce.png'; break;
case 50:
$t_image_path = $t_icon_path . 'not_fixable.png'; break;
case 60:
$t_image_path = $t_icon_path . 'duplicate.png'; break;
case 70:
$t_image_path = $t_icon_path . 'no_change_required.png'; break;
case 80:
$t_image_path = $t_icon_path . 'suspended.png'; break;
case 90:
$t_image_path = $t_icon_path . 'wont_fix.png'; break;
}
echo "\t<td class=\"center\">";
if ( $t_image_path != null ) {
echo '<img border="0" src="' . $t_image_path . '"';
echo ' alt="' . $t_resolution_show . '"';
echo ' title="' . $t_resolution_show . '"';
echo ' width=16 heigh=16 />';
echo ' ';
}
echo "</td>\n";
}
|
---|