* [refac,0.1h,0h] optimize code.
This commit is contained in:
@@ -401,7 +401,7 @@ $config->project->dtable->testtask->fieldList['product']['title'] = $lang->testt
|
||||
$config->project->dtable->testtask->fieldList['product']['type'] = 'text';
|
||||
$config->project->dtable->testtask->fieldList['product']['group'] = '1';
|
||||
|
||||
$config->project->dtable->testtask->fieldList['id']['name'] = 'idAB';
|
||||
$config->project->dtable->testtask->fieldList['id']['name'] = 'idName';
|
||||
$config->project->dtable->testtask->fieldList['id']['title'] = $lang->idAB;
|
||||
$config->project->dtable->testtask->fieldList['id']['type'] = 'id';
|
||||
$config->project->dtable->testtask->fieldList['id']['checkbox'] = true;
|
||||
|
||||
@@ -32,7 +32,7 @@ window.getCellSpan = function(cell)
|
||||
{
|
||||
return {rowSpan: cell.row.data.rowspan};
|
||||
}
|
||||
if(cell.col.name == 'idAB' && cell.row.data.colspan)
|
||||
if(cell.col.name == 'idName' && cell.row.data.colspan)
|
||||
{
|
||||
return {colSpan: cell.row.data.colspan};
|
||||
}
|
||||
@@ -61,7 +61,7 @@ window.onRenderCell = function(result, {row, col})
|
||||
result.push({outer: false, style: {alignItems: 'start', 'padding-top': '8px'}})
|
||||
}
|
||||
}
|
||||
if(result && col.name == 'idAB' && row.data.hidden)
|
||||
if(result && col.name == 'idName' && row.data.hidden)
|
||||
{
|
||||
result.push({outer: false, style: {alignItems: 'center', justifyContent: 'start'}})
|
||||
}
|
||||
@@ -108,7 +108,7 @@ window.deformation = function(event)
|
||||
{
|
||||
if(data && data.product == product)
|
||||
{
|
||||
options.data[index].idAB = {html: '<span class="text-gray">' + allTasks + ' ' + '<strong>' + data.rowspan + '</strong></span>'};
|
||||
options.data[index].idName = {html: '<span class="text-gray">' + allTasks + ' ' + '<strong>' + data.rowspan + '</strong></span>'};
|
||||
options.data[index].rowspan = 1;
|
||||
options.data[index].colspan = 10;
|
||||
options.data[index].hidden = 1;
|
||||
@@ -179,14 +179,18 @@ window.setStatistics = function(element, checkedIDList)
|
||||
*
|
||||
* @param string rowID
|
||||
* @access public
|
||||
* @return object
|
||||
* @return bool
|
||||
*/
|
||||
window.canRowCheckable = function(rowID)
|
||||
{
|
||||
let checkable = true;
|
||||
$.each(this.options.data, function(index, data)
|
||||
{
|
||||
if(data.id == rowID)
|
||||
{
|
||||
if(data.id == rowID && data.hidden == 1) checkable = false;
|
||||
});
|
||||
if(data.hidden == 1) checkable = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return checkable;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ class testtaskModel extends model
|
||||
*/
|
||||
public function getProjectTasks(int $projectID, string $orderBy = 'id_desc', object $pager = null): array
|
||||
{
|
||||
$tasks = $this->dao->select('t1.*, t1.id as idAB, t5.multiple, IF(t4.shadow = 1, t5.name, t4.name) AS productName, t3.name AS executionName, t2.name AS buildName, t2.branch AS branch, t5.name AS projectName, t4.order as productOrder')
|
||||
$tasks = $this->dao->select('t1.*, t1.id as idName, t5.multiple, IF(t4.shadow = 1, t5.name, t4.name) AS productName, t3.name AS executionName, t2.name AS buildName, t2.branch AS branch, t5.name AS projectName, t4.order as productOrder')
|
||||
->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id')
|
||||
|
||||
Reference in New Issue
Block a user