* Refactor the bug block view.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
$app->loadLang('bug');
|
||||
|
||||
$config->block->bug = new stdclass();
|
||||
$config->block->bug->dtable = new stdclass();
|
||||
$config->block->bug->dtable->fieldList = array();
|
||||
$config->block->bug->dtable->fieldList['id']['name'] = 'id';
|
||||
$config->block->bug->dtable->fieldList['id']['title'] = $lang->idAB;
|
||||
$config->block->bug->dtable->fieldList['id']['type'] = 'id';
|
||||
$config->block->bug->dtable->fieldList['id']['fixed'] = false;
|
||||
|
||||
$config->block->bug->dtable->fieldList['title']['name'] = 'title';
|
||||
$config->block->bug->dtable->fieldList['title']['title'] = $lang->bug->title;
|
||||
$config->block->bug->dtable->fieldList['title']['type'] = 'title';
|
||||
$config->block->bug->dtable->fieldList['title']['fixed'] = false;
|
||||
|
||||
$config->block->bug->dtable->fieldList['severity']['name'] = 'severity';
|
||||
$config->block->bug->dtable->fieldList['severity']['title'] = $lang->bug->abbr->severity;
|
||||
$config->block->bug->dtable->fieldList['severity']['type'] = 'severity';
|
||||
|
||||
$config->block->bug->dtable->fieldList['pri']['name'] = 'pri';
|
||||
$config->block->bug->dtable->fieldList['pri']['title'] = $lang->priAB;
|
||||
$config->block->bug->dtable->fieldList['pri']['type'] = 'pri';
|
||||
|
||||
$config->block->bug->dtable->fieldList['status']['name'] = 'status';
|
||||
$config->block->bug->dtable->fieldList['status']['title'] = $lang->bug->abbr->status;
|
||||
$config->block->bug->dtable->fieldList['status']['type'] = 'status';
|
||||
$config->block->bug->dtable->fieldList['status']['statusMap'] = $lang->bug->statusList;
|
||||
|
||||
$config->block->bug->dtable->fieldList['confirmed']['name'] = 'confirmed';
|
||||
$config->block->bug->dtable->fieldList['confirmed']['title'] = $lang->bug->abbr->confirmed;
|
||||
$config->block->bug->dtable->fieldList['confirmed']['type'] = 'category';
|
||||
$config->block->bug->dtable->fieldList['confirmed']['map'] = $lang->bug->confirmedList;
|
||||
|
||||
$config->block->bug->dtable->fieldList['deadline']['name'] = 'deadline';
|
||||
$config->block->bug->dtable->fieldList['deadline']['title'] = $lang->bug->deadline;
|
||||
$config->block->bug->dtable->fieldList['deadline']['type'] = 'date';
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user