Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ __Setup__

Changelog
---------
__New features in version 1.2.1.:__
* Show only used status in the workflow for each project.
* Bold the summary for issue modified with 24 hours.
* Show project name in each card for combined view for "All projects".
* Using the default gravtar setting in config_inc.php.

__New features in version 1.2.:__
* make use of the default states
* filter directly in the kanban view
Expand Down
11 changes: 11 additions & 0 deletions files/kanban.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ div.card a.bugLink.right {
margin-right:5px;
}

div.card a.bugLinkRecent {
font: bold 16px Tahoma, sans-serif;
line-height: 20px;
color: black;
}

div.card a.bugLinkRecent.right {
float:right;
margin-right:5px;
}

div.card div.summary {
font: 10px Arial, sans-serif;
line-height: 1.5em;
Expand Down
31 changes: 31 additions & 0 deletions lang/strings_chinese_traditional.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

$s_plugin_MantisKanban_main_menu_kanban = "看板";
$s_plugin_MantisKanban_kanban_link = "看板";

$s_view_attachments_for_issue = '檢視附件';

$s_projectdisplay = '專案顯示';
$s_project_nogroups = '合併';
$s_project_groups = '獨立';

$s_sort_date_modified = '更新日期';
$s_sort_priority_link = '優先序';

$s_header_column_1 = 'Not assigned';
$s_header_column_2 = 'On hold';
$s_header_column_3 = 'WIP';
$s_header_column_4 = 'Feedback';
$s_header_column_5 = 'Test';
$s_header_column_6 = 'Done';
$s_header_column_7 = '';
$s_header_column_8 = '';

$s_confirm_change_status = '確定要更新狀態?';

$s_plugin_kanban_title = '看板';
$s_plugin_kanban_config = '設定';
$s_plugin_kanban_columns = '欄位設定';
$s_plugin_kanban_simple_columns = '各狀態使用獨立欄位';
$s_plugin_kanban_combined_columns = '使用整合欄位';

65 changes: 56 additions & 9 deletions pages/kanban_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require_once( 'string_api.php' );
require_once( 'date_api.php' );
require_once( 'icon_api.php' );
require_once( 'html_api.php' );
/**
* Plugin includes
*/
Expand Down Expand Up @@ -69,6 +70,21 @@
$wip_limit = 0;
}
$columns[kanban_get_status_text($num)] = array('status' => array($num), 'wip_limit' => $wip_limit, 'color' => get_status_color( $num ) );


//show only status in the workflow for current project
if ( helper_get_current_project() <> 0 )
{
$t_workflow = config_get( 'status_enum_workflow', null, null, $curr_project_id );
if ( !empty($t_workflow) )
{
if ( !isset( $t_workflow[$num] ) )
{
unset( $columns[kanban_get_status_text($num)] );
}
}
}

}
}
}
Expand Down Expand Up @@ -188,12 +204,16 @@
);
$rowcounts[$title] = count($rows);
if(!$rows) {
?><td valign="top"
<?php if( isset( $column['color'] ) ) { ?>style="border-color:<?php echo $column['color'];?>"<?php } ?>
id="<?php echo $column['status'][0];?>"
class="kanbanColumn kanbanColumn<?php echo $column['status'][0];?>">
<h2 <?php if( isset( $column['color'] ) ) { ?>style="background-color:<?php echo $column['color'];?>"<?php } ?>><?php echo $title;?></h2>
</td><?php
# read through the list and show only used status for the selected project
$t_workflow = config_get( 'status_enum_workflow', null, null, $curr_project_id );
if( empty( $t_workflow ) || isset( $t_workflow[$column['status'][0]] ) || 0 == $curr_project_id ) {
?><td valign="top"
<?php if( isset( $column['color'] ) ) { ?>style="border-color:<?php echo $column['color'];?>"<?php } ?>
id="<?php echo $column['status'][0];?>"
class="kanbanColumn kanbanColumn<?php echo $column['status'][0];?>">
<h2 <?php if( isset( $column['color'] ) ) { ?>style="background-color:<?php echo $column['color'];?>"<?php } ?>><?php echo $title;?></h2>
</td><?php
}
continue;
}

Expand All @@ -216,9 +236,18 @@ class="<?php if($column['wip_limit'] > 0 && $rowcounts[$title] > $column['wip_li
{
$t_bug = $row;
echo '<div data-userid="' . $t_current_user_id . '" data-ticketid="' . $t_bug->id . '" data-projectid="' . $t_bug->project_id . '" class="card '. ($i%2==1 ? 'cardOdd' : 'cardEven') . ' card'. category_full_name( $t_bug->category_id, false ) .'">';
if ( 'combined' == $pdisplay && 0 == $curr_project_id )
{
echo '<div align="center">[' . project_get_name( $t_bug->project_id ) . ']</div>';
}
echo icon_get_status_icon($t_bug->priority);
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLink">' . string_display_line_links( $t_bug->summary ) . '</a>';
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLink right"> #'. $t_bug->id .'</a>';
if ( time() < $t_bug->last_updated + 24*60*60 ){
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLinkRecent">' . string_display_line_links( $t_bug->summary ) . '</a>';
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLinkRecent right"> #'. $t_bug->id .'</a>';
}else{
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLink">' . string_display_line_links( $t_bug->summary ) . '</a>';
echo ' <a href="' . string_get_bug_view_url( $t_bug->id) . '" class="bugLink right"> #'. $t_bug->id .'</a>';
}

$priority = get_enum_element( 'priority', $t_bug->priority );
/*
Expand Down Expand Up @@ -261,7 +290,17 @@ class="<?php if($column['wip_limit'] > 0 && $rowcounts[$title] > $column['wip_li
if(( ON == config_get( 'show_assigned_names' ) ) && ( $t_bug->handler_id > 0 ) && user_exists($t_bug->handler_id) && ( access_has_project_level( config_get( 'view_handler_threshold' ), $t_bug->project_id ) ) ) {
$emailHash = md5( strtolower( trim( user_get_email($t_bug->handler_id) ) ) );
echo '<div class="owner">';
echo '<div class="img-wrap"><img src="http://www.gravatar.com/avatar/'. $emailHash .'?s=28&d=monsterid" width="28" height="28" /></div>';
// Using the default avatar set in config_inc.php
if ( '404' == config_get('show_avatar') ||
'mm' == config_get('show_avatar') ||
'identicon' == config_get('show_avatar') ||
'monsterid' == config_get('show_avatar') ||
'wavatar' == config_get('show_avatar') ||
'retro' == config_get('show_avatar') ||
'blank' == config_get('show_avatar') )
echo '<div class="img-wrap"><img src="http://www.gravatar.com/avatar/'. $emailHash .'?s=28&d=' . config_get('show_avatar') . '" width="28" height="28" /></div>';
else
echo '<div class="img-wrap"><img src="http://www.gravatar.com/avatar/'. $emailHash .'?s=28&d=monsterid" width="28" height="28" /></div>';

echo user_get_realname( $t_bug->handler_id );
echo '</div>';
Expand All @@ -284,6 +323,11 @@ class="<?php if($column['wip_limit'] > 0 && $rowcounts[$title] > $column['wip_li
}
?>
</tr>
<?php
//Disable summary for splitted view in "All projects"
if( helper_get_current_project() != 0 || $pdisplay != "splitted" )
{
?>
<tr class="totalNums">
<?php
foreach($columns as $title => $column){
Expand All @@ -303,6 +347,9 @@ class="<?php if($column['wip_limit'] > 0 && $rowcounts[$title] > $column['wip_li
}
?>
</tr>
<?php
}
?>
</table>
</div>

Expand Down