* Refactor the bug block view.

This commit is contained in:
daitingting
2023-07-04 02:55:03 +00:00
parent 73339bf126
commit b7f5d8df87
2 changed files with 90 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/**
* The bugblock view file of block module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Tingting Dai <daitingting@easycorp.ltd>
* @package block
* @link https://www.zentao.net
*/
namespace zin;
if(!$longBlock)
{
unset($config->block->bug->dtable->fieldList['id']);
unset($config->block->bug->dtable->fieldList['pri']);
unset($config->block->bug->dtable->fieldList['confirmed']);
unset($config->block->bug->dtable->fieldList['deadline']);
}
panel
(
set('class', 'bug-block ' . ($longBlock ? 'block-long' : 'block-sm')),
set('headingClass', 'border-b'),
to::heading
(
div
(
set('class', 'panel-title'),
span($block->title),
)
),
to::headingActions
(
a
(
set('class', 'text-gray'),
set('href', createLink('my', 'work', 'mode=bug&type=' . $block->params->type)),
$lang->more,
icon('caret-right')
)
),
dtable
(
set::className('borderless'),
set::cols(array_values($config->block->bug->dtable->fieldList)),
set::data(array_values($bugs)),
set::horzScrollbarPos('inside'),
),
);
render();