* Code for task#41781.
This commit is contained in:
@@ -305,7 +305,6 @@ class project extends control
|
||||
$this->view->title = $this->lang->project->kanban;
|
||||
$this->view->kanbanGroup = $kanbanGroup;
|
||||
$this->view->latestExecutions = $latestExecutions;
|
||||
$this->view->statusCount = $statusCount;
|
||||
$this->view->programPairs = array(0 => $this->lang->project->noProgram) + $this->loadModel('program')->getPairs(true);
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -5,15 +5,13 @@
|
||||
.board-item:hover {border-color: #ccc;}
|
||||
.board-project .board-item + .board-item {margin-top: 10px;}
|
||||
|
||||
.board-project {padding: 10px;}
|
||||
.board-wait, .board-closed {vertical-align: top !important;}
|
||||
.board-project {padding: 0 10px 10px 10px;}
|
||||
.board-project .board-item:first-child {margin-top: 10px;}
|
||||
|
||||
.board-doing {padding: 0px !important; vertical-align: top !important;}
|
||||
.board-doing, .board-wait, .board-closed {padding: 0px !important; vertical-align: top !important;}
|
||||
.board-doing .board-doing-project,.board-doing .board-doing-execution {padding: 10px;}
|
||||
.board-doing .board-doing-project:not(:last-child),
|
||||
.board-doing .board-doing-execution:not(:last-child) {padding: 10px; border-bottom: 2px solid #fff;}
|
||||
|
||||
.board-doing .board-doing-project:last-child,
|
||||
.board-doing .board-doing-execution:last-child {padding: 10px;}
|
||||
.board-doing .board-doing-execution:not(:last-child) {border-bottom: 2px solid #fff;}
|
||||
|
||||
.board-doing-project .table-row .table-col:last-child, .c-progress {width: 30px;}
|
||||
.board-doing-execution .table-row .table-col:last-child, .c-progress {width: 30px;}
|
||||
|
||||
27
module/project/js/kanban.js
Normal file
27
module/project/js/kanban.js
Normal file
@@ -0,0 +1,27 @@
|
||||
$(function()
|
||||
{
|
||||
$("div[class^='board-doing-']").height($('.board-doing-project').height());
|
||||
|
||||
$('.board-program').each(function()
|
||||
{
|
||||
var boardWaitCount = $(this).find('.board-wait .board-item').length;
|
||||
var boardClosedCount = $(this).find('.board-closed .board-item').length;
|
||||
var boardDoingCount = $(this).find('.board-doing .board-item').length;
|
||||
|
||||
if((boardWaitCount > 5 || boardClosedCount > 5) && (boardWaitCount > boardDoingCount || boardClosedCount > boardDoingCount))
|
||||
{
|
||||
var boardHeight = 0;
|
||||
if(boardDoingCount > 5)
|
||||
{
|
||||
boardHeight = $('.board-doing-project').outerHeight(true) * boardDoingCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
var boardHeight = $(this).find('.board-project .board-item').outerHeight(true) * 5;
|
||||
}
|
||||
|
||||
$(this).find('.board-project').css("height", boardHeight);
|
||||
$(this).find('.board-project').css("overflow", 'auto');
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -1798,7 +1798,6 @@ class projectModel extends model
|
||||
|
||||
$myProjects = array();
|
||||
$otherProjects = array();
|
||||
$statusCount = array();
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if(strpos('wait,doing,closed', $project->status) === false) continue;
|
||||
@@ -1809,17 +1808,15 @@ class projectModel extends model
|
||||
if($project->PM == $this->app->user->account)
|
||||
{
|
||||
$myProjects[$topProgram][$project->status][$project->id] = $project;
|
||||
$statusCount['my'][$topProgram][$project->status] = count($myProjects[$topProgram][$project->status]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$otherProjects[$topProgram][$project->status][$project->id] = $project;
|
||||
$statusCount['other'][$topProgram][$project->status] = count($otherProjects[$topProgram][$project->status]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return array('kanbanGroup' => array('my' => $myProjects, 'other' => $otherProjects), 'latestExecutions' => $latestExecutions, 'statusCount' => $statusCount);
|
||||
return array('kanbanGroup' => array('my' => $myProjects, 'other' => $otherProjects), 'latestExecutions' => $latestExecutions);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php $colorIndex = 0;?>
|
||||
|
||||
<?php if(empty($kanbanGroup)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->project->empty;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
|
||||
<?php foreach($kanbanGroup as $type => $projectGroup):?>
|
||||
<?php if(empty($projectGroup)) continue;?>
|
||||
<div id="kanban" class="main-table fade auto-fade-in" data-ride="table" data-checkable="false" data-group="true">
|
||||
@@ -39,7 +37,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($projectGroup as $programID => $statusList):?>
|
||||
<tr>
|
||||
<tr class='board-program'>
|
||||
<td class='text-center' style='background: <?php echo $lang->project->laneColorList[$colorIndex];?>; color: #fff; padding-left: 2px; writing-mode: vertical-lr;'><?php echo zget($programPairs, $programID);?></td>
|
||||
<?php foreach(array('wait','doing','closed') as $status):?>
|
||||
<?php if($status == 'doing'):?>
|
||||
@@ -110,7 +108,7 @@
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td class='board-<?php echo $status;?>'>
|
||||
<div class='board-project' <?php if(isset($statusCount[$type][$programID][$status]) and isset($statusCount[$type][$programID]['doing']) and ($statusCount[$type][$programID][$status] > $statusCount[$type][$programID]['doing'])) echo "style='max-height: 273px; overflow: auto;'";?>>
|
||||
<div class='board-project'>
|
||||
<?php if(isset($statusList[$status])):?>
|
||||
<?php foreach($statusList[$status] as $project):?>
|
||||
<div class='board-item' <?php echo "style='border-left: 3px solid " . $lang->execution->statusColorList[$status] . "'";?>>
|
||||
@@ -143,11 +141,4 @@
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$("div[class^='board-doing-']").height($('.board-doing-project').height());
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user