* Optimize codes.

This commit is contained in:
daitingting
2023-06-12 11:49:38 +00:00
parent 86645174d6
commit b9e6fb1ee9
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -113,7 +113,7 @@ if(!$canBatchAction) $config->bug->dtable->fieldList['id']['type'] = 'id';
$bugs = initTableData($bugs, $config->bug->dtable->fieldList, $this->bug);
$data = array_values($bugs);
$footToolbar = array('items' => array
$footToolbar = $canBatchAction ? array('items' => array
(
array('type' => 'btn-group', 'items' => array
(
@@ -123,7 +123,7 @@ $footToolbar = array('items' => array
array('caret' => 'up', 'text' => $lang->product->branchName[$this->session->currentProductType], 'className' => ($this->session->currentProductType == 'normal' || !$canBatchChangeBranch ? 'hidden' : '') , 'url' => '#navBranch', 'data-toggle' => 'dropdown', 'data-placement' => 'top-start'),
array('caret' => 'up', 'text' => $lang->bug->abbr->module, 'className' => $canBatchChangeModule ? '' : 'hidden', 'url' => '#navModule', 'data-toggle' => 'dropdown', 'data-placement' => 'top-start'),
array('caret' => 'up', 'text' => $lang->bug->assignedTo, 'className' => ($canBatchAssignTo ? '' : 'hidden'), 'url' => '#navAssignedTo','data-toggle' => 'dropdown', 'data-placement' => 'top-start'),
), 'btnProps' => array('size' => 'sm', 'btnType' => 'secondary'));
), 'btnProps' => array('size' => 'sm', 'btnType' => 'secondary')) : null;
$resolveItems = array();
foreach($lang->bug->resolutionList as $key => $resolution)
@@ -215,8 +215,8 @@ else
set::data($data),
set::userMap($users),
set::customCols(true),
set::checkable($canBatchAction ? true : false),
$canBatchAction ? set::footToolbar($footToolbar) : null,
set::checkable($canBatchAction),
set::footToolbar($footToolbar),
set::footPager
(
usePager(),
+4 -4
View File
@@ -48,13 +48,13 @@ foreach($bugs as $bug) $bug->canBeChanged = common::canBeChanged('bug', $bug);
$bugs = initTableData($bugs, $config->my->bug->dtable->fieldList, $this->bug);
$bugs = array_values($bugs);
$footToolbar = array('items' => array
$footToolbar = $canBatchAction ? array('items' => array
(
array('text' => $lang->edit, 'className' => 'batch-btn ' . ($canBatchEdit ? '' : 'hidden'), 'data-url' => createLink('bug', 'batchEdit')),
array('text' => $lang->confirm, 'className' => 'batch-btn ajax-btn ' . ($canBatchConfirm ? '' : 'hidden'), 'data-url' => createLink('bug', 'batchConfirm')),
array('text' => $lang->close, 'className' => 'batch-btn ajax-btn ' . ($canBatchClose ? '' : 'hidden'), 'data-url' => createLink('bug', 'batchClose')),
array('text' => $lang->bug->assignedTo, 'className' => ($canBatchAssignTo ? '' : 'hidden'), 'caret' => 'up', 'url' => '#navAssignedTo','data-toggle' => 'dropdown', 'data-placement' => 'top-start'),
), 'btnProps' => array('size' => 'sm', 'btnType' => 'secondary'));
), 'btnProps' => array('size' => 'sm', 'btnType' => 'secondary')) : null;
$assignedToItems = array();
foreach ($memberPairs as $key => $value)
@@ -75,9 +75,9 @@ dtable
set::data($bugs),
set::userMap($users),
set::onRenderCell(jsRaw('window.onRenderBugNameCell')),
set::checkable($canBatchAction ? true : false),
set::checkable($canBatchAction),
set::canRowCheckable(jsRaw('function(rowID){return this.getRowInfo(rowID).data.canBeChanged;}')),
$canBatchAction ? set::footToolbar($footToolbar) : null,
set::footToolbar($footToolbar),
set::footPager(usePager()),
);
+4 -4
View File
@@ -81,10 +81,10 @@ menu
set::items($assignedToItems)
);
$footToolbar = array('items' => array
$footToolbar = $canBatchAssignedTo ? array('items' => array
(
array('caret' => 'up', 'text' => $lang->bug->assignedTo, 'btnType' => 'secondary', 'url' => '#navAssignedTo','data-toggle' => 'dropdown', 'data-placement' => 'top'),
));
)) : null;
dtable
(
@@ -93,9 +93,9 @@ dtable
set::userMap($users),
set::customCols(true),
set::footToolbar($footToolbar),
set::checkable($canBatchAssignTo ? true : false),
set::checkable($canBatchAssignTo),
set::canRowCheckable(jsRaw('function(rowID){return this.getRowInfo(rowID).data.canBeChanged;}')),
$canBatchAssignedTo ? set::footToolbar($footToolbar) : null,
set::footToolbar($footToolbar),
set::footPager(usePager()),
);