* Check batch actions permission.

This commit is contained in:
daitingting
2023-06-12 08:58:36 +00:00
parent 3f0dd5d61e
commit 29f031e7a4
+15 -3
View File
@@ -10,10 +10,11 @@ declare(strict_types=1);
*/
namespace zin;
$linkParams = "projectID={$project->id}&productID={$productID}&branch=$branchID&orderBy=status,id_desc&build=$buildID&type={key}" . ($type == 'bysearch' ? '' : "&param=$param");
featureBar
(
set::current($type),
set::linkParams("project={$project->id}&product={$productID}&branch={$branchID}&orderBy=status,id_desc&build={$buildID}&type={key}&param={$param}"),
set::linkParams($linkParams),
li(searchToggle())
);
@@ -47,7 +48,7 @@ sidebar
)))
);
$this->bug->buildOperateMenu(null, 'browse');
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
$config->bug->dtable->fieldList['module']['map'] = $modulePairs;
$config->bug->dtable->fieldList['product']['map'] = $products;
@@ -58,6 +59,15 @@ $config->bug->dtable->fieldList['branch']['map'] = $branchTagOption;
$config->bug->dtable->fieldList['project']['map'] = $projectPairs;
$config->bug->dtable->fieldList['execution']['map'] = $executions;
foreach($config->bug->dtable->fieldList as $fieldCode => $fieldInfo)
{
if(!$project->hasProduct && (($project->model != 'scrum' && $fieldCode == 'plan') || $fieldCode == 'branch')) unset($config->bug->dtable->fieldList[$fieldCode]);
}
if(!$canBatchAssignTo) $config->bug->dtable->fieldList['id']['type'] = 'id';
foreach($bugs as $bug) $bug->canBeChanged = common::canBeChanged('bug', $bug);
$bugs = initTableData($bugs, $config->bug->dtable->fieldList, $this->bug);
$data = array_values($bugs);
@@ -82,8 +92,10 @@ dtable
set::data($data),
set::userMap($users),
set::customCols(true),
set::checkable(true),
set::footToolbar($footToolbar),
set::checkable($canBatchAssignTo ? true : false),
set::canRowCheckable(jsRaw('function(rowID){return this.getRowInfo(rowID).data.canBeChanged;}')),
$canBatchAssignedTo ? set::footToolbar($footToolbar) : null,
set::footPager(usePager()),
);