diff --git a/module/execution/control.php b/module/execution/control.php index 6c0e162839..cba5cc75a9 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3831,7 +3831,7 @@ class execution extends control 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, $searchValue); + $kanbanGroup = $from == 'execution' ? $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType, $groupBy, $searchValue) : $this->loadModel('kanban')->getRDKanban($executionID, $browseType, 'id_asc', 0, $groupBy, $searchValue); return print(json_encode($kanbanGroup)); } } diff --git a/module/execution/css/taskkanban.css b/module/execution/css/taskkanban.css index 166278d2f0..9cdad7095c 100644 --- a/module/execution/css/taskkanban.css +++ b/module/execution/css/taskkanban.css @@ -62,3 +62,8 @@ .createButton {margin-right: 5px;} .headerTop {top: 0px !important;} .kanban-header-col>.actions>a {padding: 0px !important;} + +#taskKanbanSearch.input-group {float: left; width: min-content;} +#teskKanbanSearchInput {width: 150px;} +#searchBox {display: none; width: 150px;} +.btn-link.querybox-toggle {background-color: rgba(0,0,0,0);} diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 500a765daa..f3623a3d62 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1562,14 +1562,9 @@ function calcColHeight(col, lane, colCards, colHeight, kanban) */ function resetRegionHeight(fold) { - var laneCount = 0; - $('.kanban-lane').each(function() - { - laneCount ++; - if(laneCount > 1) return; - }); + var laneCount = $('.kanban-lane').length; - if(laneCount > 1) return; + if(laneCount > 1 || $('.region').length > 0) return; var regionHeaderHeight = $('.region-header').outerHeight(); if(fold == 'open') @@ -1602,16 +1597,11 @@ function resetRegionHeight(fold) */ function toggleRDSearchBox() { - rdSearchValue = ''; $('#rdSearchBox').toggle(); - if($('#rdSearchBox').css('display') == 'block') - { - $(".querybox-toggle").css("color", "#0c64eb"); - } - else - { - $(".querybox-toggle").css("color", ""); - } + + rdSearchValue = ''; + var color = $('#rdSearchBox').css('display') == 'block' ? "#0c64eb" : "#3c495c"; + $(".querybox-toggle").css("color", color); } /** diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index f59eac1f7b..3515ab4bdf 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -1,3 +1,10 @@ +/** + * Change view. + * + * @param string $view + * @access public + * @return void + */ function changeView(view) { var link = createLink('execution', 'taskKanban', "executionID=" + executionID + '&type=' + view); @@ -94,7 +101,8 @@ function renderStoryItem(item, $item, col) .attr('href', $.createLink('story', 'view', 'storyID=' + item.id, '', true)); $title.appendTo($item); } - $title.attr('title', item.title).find('.text').text(item.title); + var title = searchValue != '' ? "" + item.title.replaceAll(searchValue, "" + searchValue + "") + "": "" + item.title + ""; + $title.attr('title', item.title).find('.text').replaceWith(title); } if(scaleSize <= 2) @@ -157,7 +165,8 @@ function renderBugItem(item, $item, col) .attr('href', $.createLink('bug', 'view', 'bugID=' + item.id, '', true)); $title.appendTo($item); } - $title.attr('title', item.title).find('.text').text(item.title); + var title = searchValue != '' ? "" + item.title.replaceAll(searchValue, "" + searchValue + "") + "": "" + item.title + ""; + $title.attr('title', item.title).find('.text').replaceWith(title); } if(scaleSize <= 2) @@ -222,7 +231,8 @@ function renderTaskItem(item, $item, col) .attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)); $title.appendTo($item); } - $title.attr('title', item.name).find('.text').text(item.name); + var name = searchValue != '' ? "" + item.name.replaceAll(searchValue, "" + searchValue + "") + "": "" + item.name + ""; + $title.attr('title', item.name).find('.text').replaceWith(name); } if(scaleSize <= 2) @@ -372,6 +382,18 @@ function updateKanban(kanbanID, data) var $kanban = $('#kanban-' + kanbanID); if(!$kanban.length) return; + if(data == null) + { + $("#kanbans").hide(); + $("#emptyBox").removeClass('hidden'); + return false; + } + else + { + $("#kanbans").show(); + $("#emptyBox").addClass('hidden'); + } + $kanban.data('zui.kanban').render(data); resetKanbanHeight(); } @@ -1245,12 +1267,7 @@ $('.panel-body').scroll(function() */ function resetKanbanHeight() { - var laneCount = 0; - $('.kanban-lane').each(function() - { - laneCount ++; - if(laneCount > 1) return; - }); + var laneCount = $('.kanban-lane').length; if(laneCount > 1) return; @@ -1270,3 +1287,50 @@ $(document).on('click', '.dropdown-menu', function() { $.zui.ContextMenu.hide(); }); + +/** + * Toggle kanban search box. + * + * @access public + * @return void + */ +function toggleSearchBox() +{ + $('#searchBox').toggle(); + + searchValue = ''; + var color = $('#searchBox').css('display') == 'block' ? "#0c64eb" : "#3c495c"; + $(".querybox-toggle").css("color", color); +} + +/** + * Search kanban cards. + * + * @param string value + * @access public + * @return void + */ +function searchCards(value) +{ + searchValue = value; + $.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=0&browseType=" + browseType + "&groupBy=" + groupBy + '&from=execution&searchValue=' + value), function(data) + { + var kanbanData = $.parseJSON(data); + if(groupBy == 'default') + { + var kanbanLane = ''; + for(var i in kanbanList) + { + if(kanbanList[i] == 'story') kanbanLane = kanbanData.story; + if(kanbanList[i] == 'bug') kanbanLane = kanbanData.bug; + if(kanbanList[i] == 'task') kanbanLane = kanbanData.task; + + if(browseType == kanbanList[i] || browseType == 'all') updateKanban(kanbanList[i], kanbanLane); + } + } + else + { + updateKanban(browseType, kanbanGroup[groupBy]); + } + }); +} diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 7ec69b0041..a1dfe8d0c2 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -33,7 +33,13 @@
+
+ +
" . $lang->searchAB, '', "class='btn btn-link querybox-toggle'"); $link = $this->createLink('task', 'export', "execution=$executionID&orderBy=$orderBy&type=unclosed"); if(common::hasPriv('task', 'export')) echo html::a($link, " " . $lang->export, '', "class='btn btn-link iframe export' data-width='700'"); ?> @@ -123,6 +129,9 @@
+
@@ -166,6 +175,7 @@ +