Merge branch 'sprint/201' into 'master'
Sprint/201 See merge request easycorp/zentaopms!3793
This commit is contained in:
@@ -3820,17 +3820,18 @@ class execution extends control
|
||||
* @param string $browseType
|
||||
* @param string $groupBy
|
||||
* @param string $from execution|RD
|
||||
* @param string $searchValue
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function ajaxUpdateKanban($executionID = 0, $enterTime = '', $browseType = '', $groupBy = '', $from = 'execution')
|
||||
public function ajaxUpdateKanban($executionID = 0, $enterTime = '', $browseType = '', $groupBy = '', $from = 'execution', $searchValue = '')
|
||||
{
|
||||
$enterTime = date('Y-m-d H:i:s', $enterTime);
|
||||
$lastEditedTime = $this->dao->select("max(lastEditedTime) as lastEditedTime")->from(TABLE_KANBANLANE)->where('execution')->eq($executionID)->fetch('lastEditedTime');
|
||||
|
||||
if($lastEditedTime > $enterTime or $groupBy != 'default')
|
||||
if($lastEditedTime > $enterTime or $groupBy != 'default' or !empty($searchValue))
|
||||
{
|
||||
$kanbanGroup = $from == 'execution' ? $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType, $groupBy) : $this->loadModel('kanban')->getRDKanban($executionID, $browseType, 'id_asc', 0, $groupBy);
|
||||
$kanbanGroup = $from == 'execution' ? $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType, $groupBy) : $this->loadModel('kanban')->getRDKanban($executionID, $browseType, 'id_asc', 0, $groupBy, $searchValue);
|
||||
return print(json_encode($kanbanGroup));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,3 +110,7 @@
|
||||
#mainMenu .divider {margin: 10px}
|
||||
|
||||
.modal-header {padding: 15px 0;}
|
||||
#rdKanbanSearch.input-group {float: left; width: min-content;}
|
||||
#rdKanbanSearchInput {width: 150px;}
|
||||
#rdSearchBox {display: none; width: 150px;}
|
||||
.btn-link.querybox-toggle {background-color: rgba(0,0,0,0);}
|
||||
|
||||
@@ -478,7 +478,8 @@ function renderStoryItem(item, $item, col)
|
||||
.attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%');
|
||||
$title.appendTo($item);
|
||||
}
|
||||
$title.attr('title', item.title).find('.text').text(item.title);
|
||||
var title = rdSearchValue != '' ? "<span class='text'>" + item.title.replaceAll(rdSearchValue, "<span class='text-danger'>" + rdSearchValue + "</span>") + "</span>": "<span class='text'>" + item.title + "</span>";
|
||||
$title.attr('title', item.title).find('.text').replaceWith(title);
|
||||
}
|
||||
|
||||
if(scaleSize <= 2)
|
||||
@@ -542,7 +543,8 @@ function renderBugItem(item, $item, col)
|
||||
.attr('href', $.createLink('bug', 'view', 'bugID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
|
||||
$title.appendTo($item);
|
||||
}
|
||||
$title.attr('title', item.title).find('.text').text(item.title);
|
||||
var title = rdSearchValue != '' ? "<span class='text'>" + item.title.replaceAll(rdSearchValue, "<span class='text-danger'>" + rdSearchValue + "</span>") + "</span>": "<span class='text'>" + item.title + "</span>";
|
||||
$title.attr('title', item.title).find('.text').replaceWith(title);
|
||||
}
|
||||
|
||||
if(scaleSize <= 2)
|
||||
@@ -608,7 +610,8 @@ function renderTaskItem(item, $item, col)
|
||||
.attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
|
||||
$title.appendTo($item);
|
||||
}
|
||||
$title.attr('title', item.name).find('.text').text(item.name);
|
||||
var name = rdSearchValue != '' ? "<span class='text'>" + item.name.replaceAll(rdSearchValue, "<span class='text-danger'>" + rdSearchValue + "</span>") + "</span>": "<span class='text'>" + item.name + "</span>";
|
||||
$title.attr('title', item.name).find('.text').replaceWith(name);
|
||||
}
|
||||
|
||||
if(scaleSize <= 2)
|
||||
@@ -792,6 +795,16 @@ function updateRegion(regionID, regionData = [])
|
||||
if(!regionData) regionData = regions[regionID];
|
||||
|
||||
var data = groupBy == 'default' ? regionData.groups : regionData;
|
||||
if(data == null)
|
||||
{
|
||||
$("div[data-id^=" + regionID + "].region").hide();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("div[data-id^=" + regionID + "].region").show();
|
||||
}
|
||||
$region.empty();
|
||||
$region.data('zui.kanban').render(data);
|
||||
resetRegionHeight('open');
|
||||
return true;
|
||||
@@ -1504,7 +1517,7 @@ $(function()
|
||||
var lastUpdateData;
|
||||
setInterval(function()
|
||||
{
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD'), function(data)
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD&searchValue' + rdSearchValue), function(data)
|
||||
{
|
||||
if(data && lastUpdateData !== data)
|
||||
{
|
||||
@@ -1580,3 +1593,56 @@ function resetRegionHeight(fold)
|
||||
$('.region').css('height', regionHeaderHeight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle RDSearchBox.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function toggleRDSearchBox()
|
||||
{
|
||||
rdSearchValue = '';
|
||||
$('#rdSearchBox').toggle();
|
||||
if($('#rdSearchBox').css('display') == 'block')
|
||||
{
|
||||
$(".querybox-toggle").css("color", "#0c64eb");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".querybox-toggle").css("color", "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search all cards.
|
||||
*
|
||||
* @param string $value
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function searchCards(value)
|
||||
{
|
||||
rdSearchValue = value;
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=0&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD&searchValue=' + value), function(data)
|
||||
{
|
||||
var kanbanData = $.parseJSON(data);
|
||||
var hideAll = true;
|
||||
$('#kanban').children('.region').children("div[id^='kanban']").each(function()
|
||||
{
|
||||
var regionID = $(this).attr('data-id');
|
||||
if(kanbanData != null) data = groupBy == 'default' ? kanbanData[regionID] : kanbanData[groupBy];
|
||||
|
||||
hideAll = hideAll && !updateRegion(regionID, data);
|
||||
});
|
||||
|
||||
if(hideAll && rdSearchValue != '')
|
||||
{
|
||||
if($('.table-empty-tip').length == 0) $('#kanban').append('<div class="table-empty-tip"><p><span class="text-muted">' + kanbanLang.empty + '</span></p></div>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.table-empty-tip').remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -396,6 +396,7 @@ $lang->execution->projectNotEmpty = 'Project cannot be empty.';
|
||||
$lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?';
|
||||
$lang->execution->ge = "『%s』should be >= actual begin『%s』.";
|
||||
$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review";
|
||||
$lang->execution->pleaseInput = "Enter";
|
||||
|
||||
/* Statistics. */
|
||||
$lang->execution->charts = new stdclass();
|
||||
|
||||
@@ -396,6 +396,7 @@ $lang->execution->projectNotEmpty = '所属项目不能为空。';
|
||||
$lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。';
|
||||
$lang->execution->ge = "『%s』应当不小于实际开始时间『%s』。";
|
||||
$lang->execution->storyDragError = "该{$lang->SRCommon}还是草稿或已变更状态,请评审通过后再拖动";
|
||||
$lang->execution->pleaseInput = "请输入";
|
||||
|
||||
/* 统计。*/
|
||||
$lang->execution->charts = new stdclass();
|
||||
|
||||
@@ -52,6 +52,7 @@ js::set('vision', $this->config->vision);
|
||||
js::set('productCount', count($productNames));
|
||||
js::set('executionID', $execution->id);
|
||||
js::set('reviewStoryParis', $reviewStoryParis);
|
||||
js::set('rdSearchValue', '');
|
||||
|
||||
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
|
||||
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
|
||||
@@ -136,7 +137,13 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
</span>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<div class="input-group" id="rdKanbanSearch">
|
||||
<div class="input-control search-box" id="rdSearchBox">
|
||||
<input type="text" name="rdKanbanSearchInput" id="rdKanbanSearchInput" value="" class="form-control" oninput="searchCards(this.value)" placeholder="<?php echo $lang->execution->pleaseInput?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
echo html::a('javascript:toggleRDSearchBox()', "<i class='icon-search muted'></i> " . $lang->searchAB, '', "class='btn btn-link querybox-toggle'");
|
||||
echo html::a('javascript:fullScreen()', "<i class='icon-fullscreen muted'></i> " . $lang->kanban->fullScreen, '', "class='btn btn-link'");
|
||||
$actions = '';
|
||||
$printCreateRegion = (common::hasPriv('kanban', 'createRegion') and $groupBy == 'default');
|
||||
|
||||
Reference in New Issue
Block a user