* Rewrite user testtask page.
This commit is contained in:
@@ -22,7 +22,8 @@ $config->user->resetPasswordTimeout = 3;
|
||||
/* User detail fields for API against JIHU GitLab. */
|
||||
$config->user->detailFields = 'id,account,realname,avatar';
|
||||
|
||||
$config->user->defaultFields['todo'] = array('id', 'name', 'pri', 'date', 'status', 'type', 'begin', 'end');
|
||||
$config->user->defaultFields['task'] = array('id', 'name', 'pri', 'status', 'execution', 'deadline', 'estimate', 'consumed', 'left');
|
||||
$config->user->defaultFields['story'] = array('id', 'title', 'pri', 'status', 'product', 'plan', 'openedBy', 'estimate', 'stage');
|
||||
$config->user->defaultFields['bug'] = array('id', 'title', 'severity', 'pri', 'openedBy', 'resolvedBy', 'resolution');
|
||||
$config->user->defaultFields['todo'] = array('id', 'name', 'pri', 'date', 'status', 'type', 'begin', 'end');
|
||||
$config->user->defaultFields['task'] = array('id', 'name', 'pri', 'status', 'execution', 'deadline', 'estimate', 'consumed', 'left');
|
||||
$config->user->defaultFields['story'] = array('id', 'title', 'pri', 'status', 'product', 'plan', 'openedBy', 'estimate', 'stage');
|
||||
$config->user->defaultFields['bug'] = array('id', 'title', 'severity', 'pri', 'openedBy', 'resolvedBy', 'resolution');
|
||||
$config->user->defaultFields['testtask'] = array('id', 'title', 'execution', 'build', 'begin', 'end', 'status');
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
window.renderCell = function(result, info)
|
||||
{
|
||||
const task = info.row.data;
|
||||
if(info.col.name == 'status' && result) return [task.statusLabel];
|
||||
if(info.col.name == 'buildName' && result && task.build == 'trunk') return [trunkLang];
|
||||
return result;
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The bug view file of user 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 Wang Yidong <yidong@easycorp.ltd>
|
||||
* @package user
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
include './featurebar.html.php';
|
||||
|
||||
jsVar('trunkLang', $lang->trunk);
|
||||
|
||||
$todoNavs = array();
|
||||
$that = zget($lang->user->thirdPerson, $user->gender);
|
||||
$testtaskNavs['assignedTo'] = array('text' => sprintf($lang->user->testTask2Him, $that), 'url' => inlink('testtask', "userID={$user->id}"), 'active' => true);
|
||||
|
||||
$cols = array();
|
||||
foreach($config->user->defaultFields['testtask'] as $field) $cols[$field] = $config->testtask->dtable->fieldList[$field];
|
||||
$cols['id']['checkbox'] = false;
|
||||
|
||||
$waitCount = 0;
|
||||
$testingCount = 0;
|
||||
$blockedCount = 0;
|
||||
$doneCount = 0;
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->status == 'wait') $waitCount ++;
|
||||
if($task->status == 'doing') $testingCount ++;
|
||||
if($task->status == 'blocked') $blockedCount ++;
|
||||
if($task->status == 'done') $doneCount ++;
|
||||
|
||||
$task->statusLabel = $this->processStatus('testtask', $task);
|
||||
}
|
||||
$summary = sprintf($lang->testtask->allSummary, count($tasks), $waitCount, $testingCount, $blockedCount, $doneCount);
|
||||
|
||||
panel
|
||||
(
|
||||
setClass('list'),
|
||||
set::title(null),
|
||||
set::headingActions(array(nav(set::items($testtaskNavs)))),
|
||||
dtable
|
||||
(
|
||||
set::userMap($users),
|
||||
set::bordered(true),
|
||||
set::cols($cols),
|
||||
set::data(array_values($tasks)),
|
||||
set::footPager(usePager()),
|
||||
set::onRenderCell(jsRaw('window.renderCell')),
|
||||
set::footer(array(array('html' => $summary, 'className' => "text-dark"), 'flex', 'pager')),
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user