* Finish task #56469.
This commit is contained in:
@@ -2205,6 +2205,7 @@ class execution extends control
|
||||
if(empty($groupBy)) $groupBy = 'default';
|
||||
|
||||
/* Save to session. */
|
||||
$this->session->set('taskSearchValue', '');
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->app->session->set('taskList', $uri, 'execution');
|
||||
$this->app->session->set('bugList', $uri, 'qa');
|
||||
@@ -3831,6 +3832,7 @@ class execution extends control
|
||||
|
||||
if($lastEditedTime > $enterTime or $groupBy != 'default' or !empty($searchValue))
|
||||
{
|
||||
if($from == 'execution') $this->session->set('taskSearchValue', $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));
|
||||
}
|
||||
|
||||
@@ -384,18 +384,14 @@ function updateKanban(kanbanID, data)
|
||||
|
||||
if(data == null)
|
||||
{
|
||||
$("#kanbans").hide();
|
||||
$("#emptyBox").removeClass('hidden');
|
||||
$kanban.hide();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#kanbans").show();
|
||||
$("#emptyBox").addClass('hidden');
|
||||
}
|
||||
$kanban.show();
|
||||
|
||||
$kanban.data('zui.kanban').render(data);
|
||||
resetKanbanHeight();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1185,7 +1181,7 @@ $(function()
|
||||
var lastUpdateData;
|
||||
setInterval(function()
|
||||
{
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy), function(data)
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy + '&from=execution&searchValue=' + searchValue), function(data)
|
||||
{
|
||||
if(data && lastUpdateData !== data)
|
||||
{
|
||||
@@ -1315,7 +1311,9 @@ function searchCards(value)
|
||||
searchValue = value;
|
||||
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=0&browseType=" + browseType + "&groupBy=" + groupBy + '&from=execution&searchValue=' + value), function(data)
|
||||
{
|
||||
lastUpdateData = data;
|
||||
var kanbanData = $.parseJSON(data);
|
||||
var hideAll = true;
|
||||
if(groupBy == 'default')
|
||||
{
|
||||
var kanbanLane = '';
|
||||
@@ -1325,12 +1323,21 @@ function searchCards(value)
|
||||
if(kanbanList[i] == 'bug') kanbanLane = kanbanData.bug;
|
||||
if(kanbanList[i] == 'task') kanbanLane = kanbanData.task;
|
||||
|
||||
if(browseType == kanbanList[i] || browseType == 'all') updateKanban(kanbanList[i], kanbanLane);
|
||||
if(browseType == kanbanList[i] || browseType == 'all') hideAll = !updateKanban(kanbanList[i], kanbanLane) && hideAll;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updateKanban(browseType, kanbanGroup[groupBy]);
|
||||
hideAll = !updateKanban(browseType, kanbanData[groupBy]) && hideAll;
|
||||
}
|
||||
|
||||
if(hideAll)
|
||||
{
|
||||
$("#emptyBox").removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#emptyBox").addClass('hidden');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1764,7 +1764,8 @@ class kanban extends control
|
||||
$this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($toColumn->type)->where('story')->eq($cardID)->exec();
|
||||
}
|
||||
|
||||
$kanbanGroup = $regionID == 0 ? $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy) : $this->kanban->getRDKanban($executionID, $browseType, $orderBy, $regionID, $groupBy);
|
||||
$taskSearchValue = $this->session->taskSearchValue ? $this->session->taskSearchValue : '';
|
||||
$kanbanGroup = $regionID == 0 ? $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy, $taskSearchValue) : $this->kanban->getRDKanban($executionID, $browseType, $orderBy, $regionID, $groupBy);
|
||||
echo json_encode($kanbanGroup);
|
||||
}
|
||||
|
||||
|
||||
+11
-9
@@ -1327,12 +1327,13 @@ class kanbanModel extends model
|
||||
* @param int $executionID
|
||||
* @param string $browseType all|story|bug|task
|
||||
* @param string $groupBy
|
||||
* @param string $searchValue
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default')
|
||||
public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default', $searchValue = '')
|
||||
{
|
||||
if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy);
|
||||
if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy, $searchValue);
|
||||
|
||||
$lanes = $this->dao->select('*')->from(TABLE_KANBANLANE)
|
||||
->where('execution')->eq($executionID)
|
||||
@@ -1414,14 +1415,14 @@ class kanbanModel extends model
|
||||
|
||||
if($lane->type == 'task')
|
||||
{
|
||||
if(!empty($searchValue) and strpos($object->name, $searchValue) === false) continue;
|
||||
if($searchValue != '' and strpos($object->name, $searchValue) === false) continue;
|
||||
$cardData['name'] = $object->name;
|
||||
$cardData['status'] = $object->status;
|
||||
$cardData['left'] = $object->left;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($searchValue) and strpos($object->title, $searchValue) === false) continue;
|
||||
if($searchValue != '' and strpos($object->title, $searchValue) === false) continue;
|
||||
$cardData['title'] = $object->title;
|
||||
}
|
||||
|
||||
@@ -1432,9 +1433,10 @@ class kanbanModel extends model
|
||||
$laneData['cards'][$column->type][] = $cardData;
|
||||
$cardOrder ++;
|
||||
}
|
||||
if(!isset($laneData['cards'][$column->type])) $laneData['cards'][$column->type] = array();
|
||||
if($searchValue == '' and !isset($laneData['cards'][$column->type])) $laneData['cards'][$column->type] = array();
|
||||
}
|
||||
|
||||
if($searchValue != '' and empty($laneData['cards'])) continue;
|
||||
$kanbanGroup[$lane->type]['id'] = $laneID;
|
||||
$kanbanGroup[$lane->type]['columns'] = array_values($columnData);
|
||||
$kanbanGroup[$lane->type]['lanes'][] = $laneData;
|
||||
@@ -1563,24 +1565,24 @@ class kanbanModel extends model
|
||||
|
||||
if($browseType == 'task')
|
||||
{
|
||||
if(!empty($searchValue) and strpos($object->name, $searchValue) === false) continue;
|
||||
if($searchValue != '' and strpos($object->name, $searchValue) === false) continue;
|
||||
$cardData['name'] = $object->name;
|
||||
$cardData['status'] = $object->status;
|
||||
$cardData['left'] = $object->left;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($searchValue) and strpos($object->title, $searchValue) === false) continue;
|
||||
if($searchValue != '' and strpos($object->title, $searchValue) === false) continue;
|
||||
$cardData['title'] = $object->title;
|
||||
}
|
||||
|
||||
$laneData['cards'][$column->columnType][] = $cardData;
|
||||
$cardOrder ++;
|
||||
}
|
||||
if(empty($searchValue) and !isset($laneData['cards'][$column->columnType])) $laneData['cards'][$column->columnType] = array();
|
||||
if($searchValue == '' and !isset($laneData['cards'][$column->columnType])) $laneData['cards'][$column->columnType] = array();
|
||||
}
|
||||
|
||||
if(!empty($searchValue) and empty($laneData['cards'])) continue;;
|
||||
if($searchValue != '' and empty($laneData['cards'])) continue;
|
||||
$kanbanGroup[$groupBy]['id'] = $groupBy . $laneID;
|
||||
$kanbanGroup[$groupBy]['columns'] = array_values($columnData);
|
||||
$kanbanGroup[$groupBy]['lanes'][] = $laneData;
|
||||
|
||||
Reference in New Issue
Block a user