* Refactor the task block view.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
$app->loadLang('task');
|
||||
|
||||
$config->block->task = new stdclass();
|
||||
$config->block->task->dtable = new stdclass();
|
||||
$config->block->task->dtable->fieldList = array();
|
||||
$config->block->task->dtable->fieldList['id']['name'] = 'id';
|
||||
$config->block->task->dtable->fieldList['id']['title'] = $lang->idAB;
|
||||
$config->block->task->dtable->fieldList['id']['type'] = 'id';
|
||||
$config->block->task->dtable->fieldList['id']['fixed'] = false;
|
||||
|
||||
$config->block->task->dtable->fieldList['name']['name'] = 'name';
|
||||
$config->block->task->dtable->fieldList['name']['title'] = $lang->task->name;
|
||||
$config->block->task->dtable->fieldList['name']['type'] = 'title';
|
||||
$config->block->task->dtable->fieldList['name']['fixed'] = false;
|
||||
|
||||
$config->block->task->dtable->fieldList['pri']['name'] = 'pri';
|
||||
$config->block->task->dtable->fieldList['pri']['title'] = $lang->priAB;
|
||||
$config->block->task->dtable->fieldList['pri']['type'] = 'pri';
|
||||
|
||||
$config->block->task->dtable->fieldList['status']['name'] = 'status';
|
||||
$config->block->task->dtable->fieldList['status']['title'] = $lang->statusAB;
|
||||
$config->block->task->dtable->fieldList['status']['type'] = 'status';
|
||||
$config->block->task->dtable->fieldList['status']['statusMap'] = $lang->task->statusList;
|
||||
|
||||
$config->block->task->dtable->fieldList['deadline']['name'] = 'deadline';
|
||||
$config->block->task->dtable->fieldList['deadline']['title'] = $lang->task->deadlineAB;
|
||||
$config->block->task->dtable->fieldList['deadline']['type'] = 'date';
|
||||
|
||||
$config->block->task->dtable->fieldList['estimate']['name'] = 'estimate';
|
||||
$config->block->task->dtable->fieldList['estimate']['title'] = $lang->task->estimateAB;
|
||||
$config->block->task->dtable->fieldList['estimate']['type'] = 'number';
|
||||
|
||||
$config->block->task->dtable->fieldList['progress']['name'] = 'progress';
|
||||
$config->block->task->dtable->fieldList['progress']['title'] = $lang->task->progressAB;
|
||||
$config->block->task->dtable->fieldList['progress']['type'] = 'progress';
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The task block 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->task->dtable->fieldList['status']);
|
||||
unset($config->block->task->dtable->fieldList['deadline']);
|
||||
unset($config->block->task->dtable->fieldList['estimate']);
|
||||
}
|
||||
|
||||
panel
|
||||
(
|
||||
set::class('task-block' . $longBlock ? 'block-long' : 'block-sm'),
|
||||
set::title($block->title),
|
||||
set('headingClass', 'border-b'),
|
||||
to::headingActions
|
||||
(
|
||||
a
|
||||
(
|
||||
set('class', 'text-gray'),
|
||||
set('href', createLink('my', 'work', 'mode=task&type=' . $block->params->type)),
|
||||
$lang->more,
|
||||
icon('caret-right')
|
||||
)
|
||||
),
|
||||
dtable
|
||||
(
|
||||
set::className('borderless'),
|
||||
set::fixedLeftWidth('50%'),
|
||||
set::cols(array_values($config->block->task->dtable->fieldList)),
|
||||
set::data(array_values($tasks)),
|
||||
set::horzScrollbarPos('inside'),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user