Merge branch dev/story-75502 of zentao/zentaopms (#11749)
This commit is contained in:
@@ -92,3 +92,6 @@ ALTER TABLE `zt_reviewissue` ADD `assignedDate` datetime NULL AFTER `assignedTo`
|
||||
REPLACE INTO `zt_grouppriv`(`group`, `module`, `method`) SELECT `group`, `module`, 'active' as `method` FROM `zt_grouppriv` WHERE `module` = 'reviewissue' AND `method` = 'updateStatus';
|
||||
REPLACE INTO `zt_grouppriv`(`group`, `module`, `method`) SELECT `group`, `module`, 'close' as `method` FROM `zt_grouppriv` WHERE `module` = 'reviewissue' AND `method` = 'updateStatus';
|
||||
DELETE FROM `zt_grouppriv` WHERE `module` = 'reviewissue' AND `method` = 'updateStatus';
|
||||
|
||||
INSERT INTO `zt_metric` (`purpose`, `scope`, `object`, `stage`, `type`, `name`, `alias`, `code`, `unit`, `desc`, `definition`, `when`, `createdBy`, `createdDate`, `builtin`, `deleted`, `dateType`) VALUES
|
||||
('scale', 'user', 'reviewissue', 'released', 'php', '按人员统计的被指派的评审意见数 ', '被指派的评审意见数', 'count_of_assigned_reviewissue_in_user', 'count', '按人员统计的被指派的评审意见数表示每个人被指派的评审意见数量之和,反映了每个人员需要处理的评审意见数量的规模。该数值越大,说明需要投入越多的时间处理评审意见。', '所有评审意见个数求和\r\n指派给为某人\r\n过滤已删除的评审意见\r\n过滤已关闭的评审意见\r\n过滤已删除项目的评审意见', '', 'system', '2024-05-07 08:00:00', '1', '0', 'nodate');
|
||||
|
||||
@@ -4145,6 +4145,19 @@ $config->bi->builtin->metrics[] = array
|
||||
'definition' => "所有风险个数求和\n指派给为某人\n过滤已删除的风险\n过滤已关闭的风险\n过滤已删除项目的风险"
|
||||
);
|
||||
|
||||
$reviewissueMetrics = array();
|
||||
$reviewissueMetrics['name'] = '按人员统计的被指派的评审意见数';
|
||||
$reviewissueMetrics['alias'] = '被指派的评审意见数';
|
||||
$reviewissueMetrics['code'] = 'count_of_assigned_reviewissue_in_user';
|
||||
$reviewissueMetrics['purpose'] = 'scale';
|
||||
$reviewissueMetrics['scope'] = 'user';
|
||||
$reviewissueMetrics['object'] = 'reviewissue';
|
||||
$reviewissueMetrics['unit'] = 'count';
|
||||
$reviewissueMetrics['dateType'] = 'nodate';
|
||||
$reviewissueMetrics['desc'] = '按人员统计的被指派的评审意见数表示每个人被指派的评审意见数量之和,反映了每个人员需要处理的评审意见数量的规模。该数值越大,说明需要投入越多的时间处理评审意见';
|
||||
$reviewissueMetrics['definition'] = "所有评审意见个数求和\n指派给为某人\n过滤已删除的评审意见\n过滤已关闭的评审意见\n过滤已删除项目的评审意见";
|
||||
$config->bi->builtin->metrics[] = $reviewissueMetrics;
|
||||
|
||||
$config->bi->builtin->metrics[] = array
|
||||
(
|
||||
'name' => '按人员统计的被指派的问题数',
|
||||
|
||||
@@ -7,12 +7,12 @@ if(in_array($config->edition, array('max', 'biz', 'ipd')))
|
||||
$config->block->feedback = new stdclass();
|
||||
$config->block->feedback->dtable = new stdclass();
|
||||
$config->block->feedback->dtable->fieldList = array();
|
||||
$config->block->feedback->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->feedback->dtable->fieldList['title'] = array('name' => 'title', 'title' => $lang->feedback->title, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'feedback', 'method' => $config->vision == 'lite' ? 'view' : 'adminView', 'params' => 'feedbackID={id}'));
|
||||
$config->block->feedback->dtable->fieldList['product'] = array('name' => 'product', 'title' => $lang->feedback->product, 'type' => 'category', 'sort' => true);
|
||||
$config->block->feedback->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => $lang->feedback->pri, 'type' => 'pri', 'sort' => true);
|
||||
$config->block->feedback->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->feedback->status, 'type' => 'status', 'sort' => true, 'statusMap' => $lang->feedback->statusList);
|
||||
$config->block->feedback->dtable->fieldList['type'] = array('name' => 'type', 'title' => $lang->feedback->type, 'type' => 'category', 'sort' => true, 'map' => $lang->feedback->typeList);
|
||||
$config->block->feedback->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->feedback->dtable->fieldList['title'] = array('name' => 'title', 'title' => zget($lang->feedback, 'title'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'feedback', 'method' => $config->vision == 'lite' ? 'view' : 'adminView', 'params' => 'feedbackID={id}'));
|
||||
$config->block->feedback->dtable->fieldList['product'] = array('name' => 'product', 'title' => zget($lang->feedback, 'product'), 'type' => 'category', 'sort' => true);
|
||||
$config->block->feedback->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => zget($lang->feedback, 'pri'), 'type' => 'pri', 'sort' => true);
|
||||
$config->block->feedback->dtable->fieldList['status'] = array('name' => 'status', 'title' => zget($lang->feedback, 'status'), 'type' => 'status', 'sort' => true, 'statusMap' => zget($lang->feedback, 'statusList', array()));
|
||||
$config->block->feedback->dtable->fieldList['type'] = array('name' => 'type', 'title' => zget($lang->feedback, 'type'), 'type' => 'category', 'sort' => true, 'map' => zget($lang->feedback, 'typeList', array()));
|
||||
|
||||
$config->block->feedback->dtable->short = new stdclass();
|
||||
$config->block->feedback->dtable->short->fieldList['id'] = $config->block->feedback->dtable->fieldList['id'];
|
||||
|
||||
@@ -7,13 +7,13 @@ if(in_array($config->edition, array('max', 'ipd')))
|
||||
$config->block->issue = new stdclass();
|
||||
$config->block->issue->dtable = new stdclass();
|
||||
$config->block->issue->dtable->fieldList = array();
|
||||
$config->block->issue->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->issue->dtable->fieldList['title'] = array('name' => 'title', 'title' => $lang->issue->title, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'issue', 'method' => 'view', 'params' => 'issueID={id}'));
|
||||
$config->block->issue->dtable->fieldList['type'] = array('name' => 'type', 'title' => $lang->issue->type, 'type' => 'category', 'sort' => true, 'map' => $lang->issue->typeList);
|
||||
$config->block->issue->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => $lang->issue->priAB, 'type' => 'pri', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['severity'] = array('name' => 'severity', 'title' => $lang->issue->severity, 'type' => 'severity', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['owner'] = array('name' => 'owner', 'title' => $lang->issue->owner, 'type' => 'user', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->issue->status, 'type' => 'status', 'sort' => true, 'statusMap' => $lang->issue->statusList);
|
||||
$config->block->issue->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->issue->dtable->fieldList['title'] = array('name' => 'title', 'title' => zget($lang->issue, 'title'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'issue', 'method' => 'view', 'params' => 'issueID={id}'));
|
||||
$config->block->issue->dtable->fieldList['type'] = array('name' => 'type', 'title' => zget($lang->issue, 'type'), 'type' => 'category', 'sort' => true, 'map' => zget($lang->issue, 'typeList', array()));
|
||||
$config->block->issue->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => zget($lang->issue, 'priAB'), 'type' => 'pri', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['severity'] = array('name' => 'severity', 'title' => zget($lang->issue, 'severity'), 'type' => 'severity', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['owner'] = array('name' => 'owner', 'title' => zget($lang->issue, 'owner'), 'type' => 'user', 'sort' => true);
|
||||
$config->block->issue->dtable->fieldList['status'] = array('name' => 'status', 'title' => zget($lang->issue, 'status'), 'type' => 'status', 'sort' => true, 'statusMap' => zget($lang->issue, 'statusList', array()));
|
||||
|
||||
$config->block->issue->dtable->short = new stdclass();
|
||||
$config->block->issue->dtable->short->fieldList['id'] = $config->block->issue->dtable->fieldList['id'];
|
||||
|
||||
@@ -7,12 +7,12 @@ if(in_array($config->edition, array('max', 'ipd')))
|
||||
$config->block->meeting = new stdclass();
|
||||
$config->block->meeting->dtable = new stdclass();
|
||||
$config->block->meeting->dtable->fieldList = array();
|
||||
$config->block->meeting->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->meeting->dtable->fieldList['name'] = array('name' => 'name', 'title' => $lang->meeting->name, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'meeting', 'method' => 'view', 'params' => 'meetingID={id}'));
|
||||
$config->block->meeting->dtable->fieldList['mode'] = array('name' => 'mode', 'title' => $lang->meeting->mode, 'type' => 'category', 'sort' => true, 'map' => $lang->meeting->modeList);
|
||||
$config->block->meeting->dtable->fieldList['dept'] = array('name' => 'dept', 'title' => $lang->meeting->dept, 'type' => 'category', 'sort' => true);
|
||||
$config->block->meeting->dtable->fieldList['date'] = array('name' => 'date', 'title' => $lang->meeting->date, 'type' => 'date', 'sort' => true);
|
||||
$config->block->meeting->dtable->fieldList['host'] = array('name' => 'host', 'title' => $lang->meeting->host, 'type' => 'user', 'sort' => true);
|
||||
$config->block->meeting->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->meeting->dtable->fieldList['name'] = array('name' => 'name', 'title' => zget($lang->meeting, 'name'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'meeting', 'method' => 'view', 'params' => 'meetingID={id}'));
|
||||
$config->block->meeting->dtable->fieldList['mode'] = array('name' => 'mode', 'title' => zget($lang->meeting, 'mode'), 'type' => 'category', 'sort' => true, 'map' => zget($lang->meeting, 'modeList', array()));
|
||||
$config->block->meeting->dtable->fieldList['dept'] = array('name' => 'dept', 'title' => zget($lang->meeting, 'dept'), 'type' => 'category', 'sort' => true);
|
||||
$config->block->meeting->dtable->fieldList['date'] = array('name' => 'date', 'title' => zget($lang->meeting, 'date'), 'type' => 'date', 'sort' => true);
|
||||
$config->block->meeting->dtable->fieldList['host'] = array('name' => 'host', 'title' => zget($lang->meeting, 'host'), 'type' => 'user', 'sort' => true);
|
||||
|
||||
$config->block->meeting->dtable->short = new stdclass();
|
||||
$config->block->meeting->dtable->short->fieldList['id'] = $config->block->meeting->dtable->fieldList['id'];
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if(in_array($config->edition, array('max', 'ipd')))
|
||||
{
|
||||
global $lang, $app;
|
||||
$app->loadLang('reviewissue');
|
||||
|
||||
$config->block->reviewissue = new stdclass();
|
||||
$config->block->reviewissue->dtable = new stdclass();
|
||||
$config->block->reviewissue->dtable->fieldList = array();
|
||||
$config->block->reviewissue->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->reviewissue->dtable->fieldList['name'] = array('name' => 'title', 'title' => zget($lang->reviewissue, 'title'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'reviewissue', 'method' => 'view', 'params' => 'reviewissueID={id}'));
|
||||
$config->block->reviewissue->dtable->fieldList['opinion'] = array('name' => 'opinion', 'title' => zget($lang->reviewissue, 'opinion'), 'type' => 'text', 'sort' => true);
|
||||
$config->block->reviewissue->dtable->fieldList['type'] = array('name' => 'type', 'title' => zget($lang->reviewissue, 'type'), 'type' => 'category', 'map' => zget($lang->reviewissue, 'issueType', array()), 'sort' => true);
|
||||
$config->block->reviewissue->dtable->fieldList['status'] = array('name' => 'status', 'title' => zget($lang->reviewissue, 'status'), 'type' => 'status', 'statusMap' => zget($lang->reviewissue, 'statusList', array()), 'sort' => true);
|
||||
|
||||
$config->block->reviewissue->dtable->short = new stdclass();
|
||||
$config->block->reviewissue->dtable->short->fieldList['id'] = $config->block->reviewissue->dtable->fieldList['id'];
|
||||
$config->block->reviewissue->dtable->short->fieldList['name'] = $config->block->reviewissue->dtable->fieldList['name'];
|
||||
$config->block->reviewissue->dtable->short->fieldList['status'] = $config->block->reviewissue->dtable->fieldList['status'];
|
||||
}
|
||||
@@ -7,12 +7,12 @@ if(in_array($config->edition, array('max', 'ipd')))
|
||||
$config->block->risk = new stdclass();
|
||||
$config->block->risk->dtable = new stdclass();
|
||||
$config->block->risk->dtable->fieldList = array();
|
||||
$config->block->risk->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->risk->dtable->fieldList['name'] = array('name' => 'name', 'title' => $lang->risk->name, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'risk', 'method' => 'view', 'params' => 'riskID={id}'));
|
||||
$config->block->risk->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => $lang->risk->priAB, 'type' => 'status', 'statusMap' => $lang->risk->priList, 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['rate'] = array('name' => 'rate', 'title' => $lang->risk->rate, 'type' => 'number', 'width' => '100px', 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->risk->status, 'type' => 'status', 'statusMap' => $lang->risk->statusList, 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['strategy'] = array('name' => 'strategy', 'title' => $lang->risk->strategy, 'type' => 'status', 'statusMap' => $lang->risk->strategyList, 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->risk->dtable->fieldList['name'] = array('name' => 'name', 'title' => zget($lang->risk, 'name'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'risk', 'method' => 'view', 'params' => 'riskID={id}'));
|
||||
$config->block->risk->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => zget($lang->risk, 'priAB'), 'type' => 'status', 'statusMap' => zget($lang->risk, 'priList', array()), 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['rate'] = array('name' => 'rate', 'title' => zget($lang->risk, 'rate'), 'type' => 'number', 'width' => '100px', 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['status'] = array('name' => 'status', 'title' => zget($lang->risk, 'status'), 'type' => 'status', 'statusMap' => zget($lang->risk, 'statusList', array()), 'sort' => true);
|
||||
$config->block->risk->dtable->fieldList['strategy'] = array('name' => 'strategy', 'title' => zget($lang->risk, 'strategy'), 'type' => 'status', 'statusMap' => zget($lang->risk, 'strategyList', array()), 'sort' => true);
|
||||
|
||||
$config->block->risk->dtable->short = new stdclass();
|
||||
$config->block->risk->dtable->short->fieldList['id'] = $config->block->risk->dtable->fieldList['id'];
|
||||
|
||||
@@ -7,12 +7,12 @@ if(in_array($config->edition, array('max', 'biz', 'ipd')))
|
||||
$config->block->ticket = new stdclass();
|
||||
$config->block->ticket->dtable = new stdclass();
|
||||
$config->block->ticket->dtable->fieldList = array();
|
||||
$config->block->ticket->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->ticket->dtable->fieldList['title'] = array('name' => 'title', 'title' => $lang->ticket->title, 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'ticket', 'method' => 'view', 'params' => 'ticketID={id}'));
|
||||
$config->block->ticket->dtable->fieldList['product'] = array('name' => 'product', 'title' => $lang->ticket->product, 'type' => 'category', 'sort' => true);
|
||||
$config->block->ticket->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => $lang->ticket->priAB, 'type' => 'pri', 'sort' => true);
|
||||
$config->block->ticket->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->ticket->status, 'type' => 'status', 'sort' => true, 'statusMap' => $lang->ticket->statusList);
|
||||
$config->block->ticket->dtable->fieldList['type'] = array('name' => 'type', 'title' => $lang->ticket->type, 'type' => 'category', 'sort' => true, 'map' => $lang->ticket->typeList);
|
||||
$config->block->ticket->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id' , 'sort' => 'number');
|
||||
$config->block->ticket->dtable->fieldList['title'] = array('name' => 'title', 'title' => zget($lang->ticket, 'title'), 'type' => 'title', 'sort' => true, 'flex' => 1, 'link' => array('module' => 'ticket', 'method' => 'view', 'params' => 'ticketID={id}'));
|
||||
$config->block->ticket->dtable->fieldList['product'] = array('name' => 'product', 'title' => zget($lang->ticket, 'product'), 'type' => 'category', 'sort' => true);
|
||||
$config->block->ticket->dtable->fieldList['pri'] = array('name' => 'pri', 'title' => zget($lang->ticket, 'priAB'), 'type' => 'pri', 'sort' => true);
|
||||
$config->block->ticket->dtable->fieldList['status'] = array('name' => 'status', 'title' => zget($lang->ticket, 'status'), 'type' => 'status', 'sort' => true, 'statusMap' => zget($lang->ticket, 'statusList', array()));
|
||||
$config->block->ticket->dtable->fieldList['type'] = array('name' => 'type', 'title' => zget($lang->ticket, 'type'), 'type' => 'category', 'sort' => true, 'map' => zget($lang->ticket, 'typeList', array()));
|
||||
|
||||
$config->block->ticket->dtable->short = new stdclass();
|
||||
$config->block->ticket->dtable->short->fieldList['id'] = $config->block->ticket->dtable->fieldList['id'];
|
||||
|
||||
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
|
||||
$lang->block->availableBlocks['testcase'] = 'Testcase';
|
||||
$lang->block->availableBlocks['testtask'] = 'Testtask';
|
||||
$lang->block->availableBlocks['risk'] = 'Risks';
|
||||
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
|
||||
$lang->block->availableBlocks['issue'] = 'Issues';
|
||||
$lang->block->availableBlocks['meeting'] = 'Meetings';
|
||||
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
|
||||
|
||||
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
|
||||
$lang->block->availableBlocks['testcase'] = 'Testcase';
|
||||
$lang->block->availableBlocks['testtask'] = 'Testtask';
|
||||
$lang->block->availableBlocks['risk'] = 'Risks';
|
||||
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
|
||||
$lang->block->availableBlocks['issue'] = 'Issues';
|
||||
$lang->block->availableBlocks['meeting'] = 'Meetings';
|
||||
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
|
||||
|
||||
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = 'Builds';
|
||||
$lang->block->availableBlocks['testcase'] = 'Testcase';
|
||||
$lang->block->availableBlocks['testtask'] = 'Testtask';
|
||||
$lang->block->availableBlocks['risk'] = 'Risks';
|
||||
$lang->block->availableBlocks['reviewissue'] = 'Review Issue';
|
||||
$lang->block->availableBlocks['issue'] = 'Issues';
|
||||
$lang->block->availableBlocks['meeting'] = 'Meetings';
|
||||
$lang->block->availableBlocks['feedback'] = 'Feedbacks';
|
||||
|
||||
@@ -234,6 +234,7 @@ $lang->block->availableBlocks['build'] = '构建列表';
|
||||
$lang->block->availableBlocks['testcase'] = '用例';
|
||||
$lang->block->availableBlocks['testtask'] = '测试单';
|
||||
$lang->block->availableBlocks['risk'] = '风险';
|
||||
$lang->block->availableBlocks['reviewissue'] = '评审意见';
|
||||
$lang->block->availableBlocks['issue'] = '问题';
|
||||
$lang->block->availableBlocks['meeting'] = '会议';
|
||||
$lang->block->availableBlocks['feedback'] = '反馈';
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=测试 blockZen::printAssignToMeBlock();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 执行$count @12
|
||||
- 执行$count['review'] @5
|
||||
- 执行$count['todo'] @1
|
||||
- 执行$count['task'] @0
|
||||
- 执行$count['bug'] @10
|
||||
- 执行$count['story'] @3
|
||||
- 执行$count['requirement'] @3
|
||||
- 执行$count['risk'] @1
|
||||
- 执行$count['issue'] @0
|
||||
- 执行$count['feedback'] @0
|
||||
- 执行$count['ticket'] @0
|
||||
- 执行$count['reviewissue'] @0
|
||||
- 执行$count['meeting'] @0
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
|
||||
zenData('task')->gen(10);
|
||||
$story = zenData('story');
|
||||
$story->type->range('story,requirement,epic');
|
||||
$story->gen(30);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('case')->gen(10);
|
||||
zenData('testtask')->gen(10);
|
||||
zenData('risk')->gen(10);
|
||||
$reviewissue = zenData('reviewissue');
|
||||
$reviewissue->project->range('1');
|
||||
$reviewissue->review->range('1-5');
|
||||
$reviewissue->type->range('review');
|
||||
$reviewissue->opinionDate->range('`2025-01-01`');
|
||||
$reviewissue->resolutionDate->range('`2025-01-01`');
|
||||
$reviewissue->createdDate->range('`2025-01-01`');
|
||||
$reviewissue->gen(5);
|
||||
zenData('nc')->gen(0);
|
||||
zenData('review')->gen(10);
|
||||
zenData('auditplan')->gen(10);
|
||||
zenData('meeting')->gen(10);
|
||||
zenData('feedback')->gen(10);
|
||||
zenData('ticket')->gen(10);
|
||||
zenData('demand')->gen(10);
|
||||
zenData('todo')->gen(10);
|
||||
zenData('approval')->gen(10);
|
||||
su('admin');
|
||||
|
||||
global $config, $tester;
|
||||
$config->URAndSR = 1;
|
||||
$config->enableER = 1;
|
||||
$config->edition = 'ipd';
|
||||
|
||||
$block = new stdclass();
|
||||
$block->params = json_decode('{"todoCount":"20","taskCount":"20","bugCount":"20","riskCount":"20","issueCount":"20","storyCount":"20","reviewCount":"20","meetingCount":"20","feedbackCount":"20"}');
|
||||
|
||||
$tester->app->setModuleName('block');
|
||||
$tester->app->rawModule = 'block';
|
||||
$tester->app->rawMethod = 'printBlock';
|
||||
|
||||
$zenTest = initReference('block');
|
||||
$method = $zenTest->getMethod('printAssignToMeBlock');
|
||||
$method->setAccessible(true);
|
||||
$count = $method->invokeArgs($zenTest->newInstance(), array($block));
|
||||
r(count($count)) && p() && e('12');
|
||||
r($count['review']) && p() && e('5');
|
||||
r($count['todo']) && p() && e('1');
|
||||
r($count['task']) && p() && e('0');
|
||||
r($count['bug']) && p() && e('10');
|
||||
r($count['story']) && p() && e('3');
|
||||
r($count['requirement']) && p() && e('3');
|
||||
r($count['risk']) && p() && e('1');
|
||||
r($count['issue']) && p() && e('0');
|
||||
r($count['feedback']) && p() && e('0');
|
||||
r($count['ticket']) && p() && e('0');
|
||||
r($count['reviewissue']) && p() && e('0');
|
||||
r($count['meeting']) && p() && e('0');
|
||||
+18
-15
@@ -2058,9 +2058,9 @@ class blockZen extends block
|
||||
*
|
||||
* @param object $block
|
||||
* @access protected
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
protected function printAssignToMeBlock(object $block): void
|
||||
protected function printAssignToMeBlock(object $block): array
|
||||
{
|
||||
$hasIssue = helper::hasFeature('issue');
|
||||
$hasRisk = helper::hasFeature('risk');
|
||||
@@ -2098,13 +2098,14 @@ class blockZen extends block
|
||||
if((common::hasPriv('task', 'view') && $this->config->vision == 'rnd') || (common::hasPriv('researchtask', 'view') && $this->config->vision == 'or')) $hasViewPriv['task'] = true;
|
||||
if(common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['story'] = true;
|
||||
if($this->config->URAndSR && common::hasPriv('story', 'view') && $this->config->vision != 'lite') $hasViewPriv['requirement'] = true;
|
||||
if(common::hasPriv('bug', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['bug'] = true;
|
||||
if(common::hasPriv('testcase', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testcase'] = true;
|
||||
if(common::hasPriv('testtask', 'cases') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testtask'] = true;
|
||||
if(common::hasPriv('risk', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['risk'] = true;
|
||||
if(common::hasPriv('issue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasIssue) $hasViewPriv['issue'] = true;
|
||||
if(common::hasPriv('meeting', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasMeeting) $hasViewPriv['meeting'] = true;
|
||||
if((common::hasPriv('feedback', 'view') || common::hasPriv('feedback', 'adminView')) && in_array($this->config->edition, array('max', 'biz', 'ipd'))) $hasViewPriv['feedback'] = true;
|
||||
if(common::hasPriv('bug', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['bug'] = true;
|
||||
if(common::hasPriv('testcase', 'view') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testcase'] = true;
|
||||
if(common::hasPriv('testtask', 'cases') && !in_array($this->config->vision, array('lite', 'or'))) $hasViewPriv['testtask'] = true;
|
||||
if(common::hasPriv('risk', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['risk'] = true;
|
||||
if(common::hasPriv('reviewissue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasRisk) $hasViewPriv['reviewissue'] = true;
|
||||
if(common::hasPriv('issue', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasIssue) $hasViewPriv['issue'] = true;
|
||||
if(common::hasPriv('meeting', 'view') && in_array($this->config->edition, array('max', 'ipd')) && !in_array($this->config->vision, array('lite', 'or')) && $hasMeeting) $hasViewPriv['meeting'] = true;
|
||||
if((common::hasPriv('feedback', 'view') || common::hasPriv('feedback', 'adminView')) && in_array($this->config->edition, array('max', 'biz', 'ipd'))) $hasViewPriv['feedback'] = true;
|
||||
if(common::hasPriv('ticket', 'view') && in_array($this->config->edition, array('max', 'biz', 'ipd')) && $this->config->vision != 'or') $hasViewPriv['ticket'] = true;
|
||||
|
||||
$objectList = array('todo' => 'todos', 'task' => 'tasks', 'bug' => 'bugs', 'story' => 'stories', 'requirement' => 'requirements');
|
||||
@@ -2112,7 +2113,7 @@ class blockZen extends block
|
||||
{
|
||||
if($hasRisk) $objectList += array('risk' => 'risks');
|
||||
if($hasIssue) $objectList += array('issue' => 'issues');
|
||||
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets');
|
||||
$objectList += array('feedback' => 'feedbacks', 'ticket' => 'tickets', 'reviewissue' => 'reviewissues');
|
||||
if($this->config->edition == 'ipd' && $this->config->vision == 'or') $objectList += array('demand' => 'demands');
|
||||
}
|
||||
|
||||
@@ -2129,7 +2130,7 @@ class blockZen extends block
|
||||
->beginIF($objectType == 'story' || $objectType == 'requirement')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'bug')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')->fi()
|
||||
->beginIF($objectType == 'task')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.execution=t2.id')->fi()
|
||||
->beginIF($objectType == 'issue' || $objectType == 'risk')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')->fi()
|
||||
->beginIF(in_array($objectType, array('issue', 'risk', 'reviewissue')))->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')->fi()
|
||||
->beginIF($objectType == 'ticket')->leftJoin(TABLE_USER)->alias('t2')->on('t1.openedBy = t2.account')->fi()
|
||||
->beginIF($objectType == 'demand')->leftJoin(TABLE_DEMANDPOOL)->alias('t2')->on('t1.pool = t2.id')->fi()
|
||||
->where('t1.deleted')->eq(0)
|
||||
@@ -2141,7 +2142,7 @@ class blockZen extends block
|
||||
->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi()
|
||||
->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi()
|
||||
->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi()
|
||||
->beginIF($objectType == 'issue' || $objectType == 'risk')->andWhere('t2.deleted')->eq(0)->fi()
|
||||
->beginIF(in_array($objectType, array('issue', 'risk', 'reviewissue')))->andWhere('t2.deleted')->eq(0)->fi()
|
||||
->beginIF($objectType == 'ticket')->andWhere('t1.status')->in('wait,doing,done')->fi()
|
||||
->beginIF($objectType == 'demand')->andWhere('t2.deleted')->eq(0)->fi()
|
||||
->orderBy($orderBy)
|
||||
@@ -2196,9 +2197,10 @@ class blockZen extends block
|
||||
}
|
||||
}
|
||||
|
||||
if($objectType == 'bug') $this->app->loadLang('bug');
|
||||
if($objectType == 'risk') $this->app->loadLang('risk');
|
||||
if($objectType == 'issue') $this->app->loadLang('issue');
|
||||
if($objectType == 'bug') $this->app->loadLang('bug');
|
||||
if($objectType == 'risk') $this->app->loadLang('risk');
|
||||
if($objectType == 'reviewissue') $this->app->loadLang('reviewissue');
|
||||
if($objectType == 'issue') $this->app->loadLang('issue');
|
||||
|
||||
if($objectType == 'feedback' || $objectType == 'ticket')
|
||||
{
|
||||
@@ -2247,6 +2249,7 @@ class blockZen extends block
|
||||
$this->view->products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->fetchPairs('id', 'name');
|
||||
$this->view->projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('deleted')->eq('0')->fetchPairs('id', 'name');
|
||||
$this->view->count = $count;
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* 按人员统计的待处理评审意见数
|
||||
* Count of assignedTo reviewissue in user.
|
||||
*
|
||||
* 范围:user
|
||||
* 对象:reviewissue
|
||||
* 目的:scale
|
||||
* 度量名称:按人员统计的待处理评审意见数
|
||||
* 单位:个
|
||||
* 描述:按人员统计的待处理用户评审意见数表示每个人待处理的用户评审意见数量之和。反映了每个人员需要处理的用户评审意见数量的规模。该数值越大,说明需要投入越多的时间处理用户评审意见。
|
||||
* 定义:所有评审意见个数求和 指派给为某人 过滤已删除的评审意见 过滤已删除项目的评审意见
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @author zhouxin <zhouxin@easycorp.ltd>
|
||||
* @package
|
||||
* @uses func
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @Link https://www.zentao.net
|
||||
*/
|
||||
class count_of_assigned_reviewissue_in_user extends baseCalc
|
||||
{
|
||||
public $dataset = 'getReviewissues';
|
||||
|
||||
public $fieldList = array('t1.status', 't1.assignedTo');
|
||||
|
||||
public $result = array();
|
||||
|
||||
public function calculate($row)
|
||||
{
|
||||
$assignedTo = $row->assignedTo;
|
||||
|
||||
if(empty($assignedTo) || $assignedTo == 'closed' || $row->status == 'closed') return false;
|
||||
|
||||
if(!isset($this->result[$assignedTo])) $this->result[$assignedTo] = 0;
|
||||
$this->result[$assignedTo] += 1;
|
||||
}
|
||||
|
||||
public function getResult($options = array())
|
||||
{
|
||||
$records = $this->getRecords(array('user', 'value'));
|
||||
return $this->filterByOptions($records, $options);
|
||||
}
|
||||
}
|
||||
@@ -971,6 +971,25 @@ class dataset
|
||||
return $this->defaultWhere($stmt, 't2');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评审意见数据。
|
||||
* Get reviewissues.
|
||||
*
|
||||
* @param string $fieldList
|
||||
* @access public
|
||||
* @return PDOStatement
|
||||
*/
|
||||
public function getReviewissues($fieldList)
|
||||
{
|
||||
$stmt = $this->dao->select($fieldList)->from(TABLE_REVIEWISSUE)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
|
||||
->where('t1.deleted')->eq('0')
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->andWhere('t2.type')->eq('project');
|
||||
|
||||
return $this->defaultWhere($stmt, 't2');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取问题数据。
|
||||
* Get issues.
|
||||
|
||||
+56
-1
@@ -111,7 +111,7 @@ class my extends control
|
||||
*/
|
||||
public function contribute(string $mode = 'task', string $type = 'openedBy', int $param = 0, string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1)
|
||||
{
|
||||
if(($mode == 'issue' || $mode == 'risk') && $type == 'openedBy') $type = 'createdBy';
|
||||
if((in_array($mode, array('issue', 'risk', 'reviewissue'))) && $type == 'openedBy') $type = 'createdBy';
|
||||
if($mode == 'testtask' && $type == 'openedBy') $type = 'done';
|
||||
if(($mode == 'doc' || $mode == 'testcase') && $type == 'openedBy') $type = 'openedbyme';
|
||||
$this->lang->my->featureBar[$this->app->rawMethod] = $this->lang->my->featureBar[$this->app->rawMethod][strtolower($mode)];
|
||||
@@ -878,6 +878,61 @@ class my extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 评审意见列表。
|
||||
* My reviewissues.
|
||||
*
|
||||
* @param string $type
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function reviewissue(string $type = 'assignedTo', int $param = 0, string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1)
|
||||
{
|
||||
$this->loadModel('reviewissue');
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Build the search form. */
|
||||
$currentMethod = $this->app->rawMethod;
|
||||
$queryID = $type == 'bysearch' ? (int)$param : 0;
|
||||
$actionURL = $this->createLink('my', $currentMethod, "mode=reviewissue&type=bysearch¶m=myQueryID");
|
||||
$this->my->buildReviewissueSearchForm($queryID, $actionURL, $currentMethod);
|
||||
|
||||
/* Get reviewissues by type*/
|
||||
if($type == 'assignedBy')
|
||||
{
|
||||
$reviewissues = $this->my->getAssignedByMe($this->app->user->account, $pager, $orderBy, 'reviewissue');
|
||||
}
|
||||
elseif($type == 'bysearch')
|
||||
{
|
||||
$reviewissues = $this->my->getReviewissuesBySearch($queryID, $currentMethod, $orderBy, $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$reviewissues = $this->reviewissue->getUserReviewissues($type, $this->app->user->account, $orderBy, $pager);
|
||||
}
|
||||
|
||||
$this->myZen->showWorkCount($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->my->reviewissue;
|
||||
$this->view->reviewissues = $reviewissues;
|
||||
$this->view->users = $this->user->getPairs('noclosed|noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->type = $type;
|
||||
$this->view->param = $param;
|
||||
$this->view->mode = 'reviewissue';
|
||||
$this->view->projectList = array(0 => '') + $this->loadModel('project')->getPairsByProgram();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 评审列表。
|
||||
* My audits.
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->my->execution = "My {$lang->execution->common}s";
|
||||
$lang->my->audit = 'Review';
|
||||
$lang->my->issue = 'My Issues';
|
||||
$lang->my->risk = 'My Risks';
|
||||
$lang->my->reviewissue = 'My Review Issue';
|
||||
$lang->my->profile = 'My Profile';
|
||||
$lang->my->dynamic = 'My Dynamics';
|
||||
$lang->my->team = 'My Team';
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->my->execution = "My {$lang->execution->common}s";
|
||||
$lang->my->audit = 'Review';
|
||||
$lang->my->issue = 'My Issues';
|
||||
$lang->my->risk = 'My Risks';
|
||||
$lang->my->reviewissue = 'My Review Issue';
|
||||
$lang->my->profile = 'My Profile';
|
||||
$lang->my->dynamic = 'My Dynamics';
|
||||
$lang->my->team = 'My Team';
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->my->execution = "My {$lang->execution->common}s";
|
||||
$lang->my->audit = 'Review';
|
||||
$lang->my->issue = 'My Issues';
|
||||
$lang->my->risk = 'My Risks';
|
||||
$lang->my->reviewissue = 'My Review Issue';
|
||||
$lang->my->profile = 'My Profile';
|
||||
$lang->my->dynamic = 'My Dynamics';
|
||||
$lang->my->team = 'My Team';
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->my->execution = "我的{$lang->execution->common}";
|
||||
$lang->my->audit = '审批';
|
||||
$lang->my->issue = '我的问题';
|
||||
$lang->my->risk = '我的风险';
|
||||
$lang->my->reviewissue = '我的评审意见';
|
||||
$lang->my->profile = '我的档案';
|
||||
$lang->my->dynamic = '我的动态';
|
||||
$lang->my->team = '团队';
|
||||
|
||||
+34
-2
@@ -274,7 +274,7 @@ class myModel extends model
|
||||
|
||||
if($objectType == 'task') return $this->getTaskAssignedByMe($pager, $orderBy, $objectIdList);
|
||||
if($objectType == 'requirement' || $objectType == 'story' || $objectType == 'bug') return $this->myTao->getProductRelatedAssignedByMe($objectIdList, $objectType, $module, $orderBy, $pager);
|
||||
if($objectType == 'risk' || $objectType == 'issue' || $objectType == 'nc')
|
||||
if(in_array($objectType, array('risk', 'issue', 'nc')))
|
||||
{
|
||||
return $this->dao->select('t1.*')->from($this->config->objectTables[$module])->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
@@ -588,7 +588,6 @@ class myModel extends model
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @param string $type risk|contribute
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -617,6 +616,39 @@ class myModel extends model
|
||||
$this->loadModel('search')->setSearchParams($this->config->risk->search);
|
||||
}
|
||||
|
||||
/*
|
||||
* 构建评审意见搜索表单。
|
||||
* Build reviewissue search form.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildReviewissueSearchForm(int $queryID, string $actionURL): void
|
||||
{
|
||||
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('project')
|
||||
->andWhere('deleted')->eq('0')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->andWhere('model')->ne('kanban')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->orderBy('order_asc')
|
||||
->fetchPairs();
|
||||
$queryName = $this->app->rawMethod . 'Reviewissue';
|
||||
|
||||
$this->app->loadConfig('reviewissue');
|
||||
$this->config->reviewissue->search['module'] = $queryName;
|
||||
$this->config->reviewissue->search['actionURL'] = $actionURL;
|
||||
$this->config->reviewissue->search['queryID'] = $queryID;
|
||||
|
||||
$this->config->reviewissue->search['params']['project']['values'] = array('') + $projects;
|
||||
|
||||
if(!isset($this->config->reviewissue->search['fields'])) $this->config->reviewissue->search['fields'] = array();
|
||||
unset($this->config->reviewissue->search['fields']['module']);
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->reviewissue->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过搜索获取风险。
|
||||
* Get risks by search.
|
||||
|
||||
@@ -317,6 +317,24 @@ class myTest
|
||||
return $tester->config->risk->search;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试构建评审意见搜索表单。
|
||||
* Test build reviewissue search form.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function buildReviewissueSearchFormTest(int $queryID, string $actionURL): array
|
||||
{
|
||||
$this->objectModel->buildReviewissueSearchForm($queryID, $actionURL);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
global $tester;
|
||||
return $tester->config->reviewissue->search;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过搜索获取风险。
|
||||
* Get risks by search.
|
||||
@@ -336,6 +354,25 @@ class myTest
|
||||
return array_keys($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过搜索获取评审意见。
|
||||
* Get reviewissues by search.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getReviewissuesBySearchTest(int $queryID, string $type, string $orderBy): array
|
||||
{
|
||||
$objects = $this->objectModel->getReviewissuesBySearch($queryID, $type, $orderBy , null);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return array_keys($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试构建需求搜索表单。
|
||||
* Test build story search form.
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
class myZenTest
|
||||
{
|
||||
public $myZenTest;
|
||||
public $tester;
|
||||
function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->tester = $tester;
|
||||
$tester->app->setModuleName('my');
|
||||
$this->objectModel = $tester->loadModel('my');
|
||||
|
||||
$this->myZenTest = initReference('my');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待处理各项数据。
|
||||
* Get work count.
|
||||
*
|
||||
* @param int $recTotal
|
||||
* @param string $recPerPage
|
||||
* @param string $pageID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function showWorkCountTest(int $recTotal = 0, int $recPerPage = 20, int $pageID = 1): array
|
||||
{
|
||||
global $tester;
|
||||
$tester->app->rawModule = 'my';
|
||||
$tester->app->rawMethod = 'work';
|
||||
|
||||
$method = $this->myZenTest->getMethod('showWorkCount');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$count = $method->invokeArgs($this->myZenTest->newInstance(), [$recTotal, $recPerPage, $pageID]);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收费版待处理各项数据。
|
||||
* Get work count not in open edition.
|
||||
*
|
||||
* @param int $recTotal
|
||||
* @param string $recPerPage
|
||||
* @param string $pageID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function showWorkCountNotInOpenTest(object $pager): array
|
||||
{
|
||||
global $tester;
|
||||
$tester->app->rawModule = 'my';
|
||||
$tester->app->rawMethod = 'work';
|
||||
|
||||
$method = $this->myZenTest->getMethod('showWorkCountNotInOpen');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$count = $method->invokeArgs($this->myZenTest->newInstance(), [array(), $pager]);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/my.unittest.class.php';
|
||||
|
||||
zenData('user')->gen('1');
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->buildReviewIssueSearchForm();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 测试获取queryID 1 actionURL actionURL1 的搜索表单
|
||||
- 属性module @Reviewissue
|
||||
- 属性queryID @0
|
||||
- 属性actionURL @actionURL1
|
||||
- 测试获取queryID 0 actionURL actionURL2 的搜索表单
|
||||
- 属性module @Reviewissue
|
||||
- 属性queryID @1
|
||||
- 属性actionURL @actionURL2
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
|
||||
$queryID = array(0, 1);
|
||||
$actionURL = array('actionURL1', 'actionURL2');
|
||||
$config1 = $my->buildReviewissueSearchFormTest($queryID[0], $actionURL[0]);
|
||||
$config2 = $my->buildReviewissueSearchFormTest($queryID[1], $actionURL[1]);
|
||||
r($config1) && p('module,queryID,actionURL') && e('Reviewissue,0,actionURL1'); // 测试获取queryID 1 actionURL actionURL1 的搜索表单
|
||||
r($config2) && p('module,queryID,actionURL') && e('Reviewissue,1,actionURL2'); // 测试获取queryID 0 actionURL actionURL2 的搜索表单
|
||||
@@ -9,7 +9,7 @@ zenData('bug')->gen('10');
|
||||
zenData('task')->gen('10');
|
||||
zenData('story')->gen('10');
|
||||
zenData('user')->gen('1');
|
||||
zenData('project')->gen('0');
|
||||
zenData('project')->gen('10');
|
||||
zenData('product')->gen('10');
|
||||
|
||||
su('admin');
|
||||
@@ -23,6 +23,9 @@ cid=1
|
||||
- 当插入一条action为admin指派了task的动态时,查询结果为1条数据 @0
|
||||
- 当插入一条action为admin指派了bug的动态时,查询结果为1条数据 @4
|
||||
- 当插入一条action为admin指派了需求的动态时,查询结果为0条数据 @0
|
||||
- 当插入一条action为user1指派了task的动态时,查询结果为1条数据 @0
|
||||
- 当插入一条action为user1指派了bug的动态时,查询结果为1条数据 @4
|
||||
- 当插入一条action为user1指派了需求的动态时,查询结果为0条数据 @0
|
||||
|
||||
*/
|
||||
|
||||
@@ -33,4 +36,13 @@ $story = array('admin', 'id_desc', 'story');
|
||||
|
||||
r($my->getAssignedByMeTest($task[0], $task[1], $task[2])) && p() && e('0'); // 当插入一条action为admin指派了task的动态时,查询结果为1条数据
|
||||
r($my->getAssignedByMeTest($bug[0], $bug[1], $bug[2])) && p() && e('4'); // 当插入一条action为admin指派了bug的动态时,查询结果为1条数据
|
||||
r($my->getAssignedByMeTest($story[0], $story[1], $story[2])) && p() && e('0'); // 当插入一条action为admin指派了需求的动态时,查询结果为0条数据
|
||||
r($my->getAssignedByMeTest($story[0], $story[1], $story[2])) && p() && e('0'); // 当插入一条action为admin指派了需求的动态时,查询结果为0条数据
|
||||
|
||||
$task = array('user1', 'id_desc', 'task');
|
||||
$bug = array('user1', 'id_desc', 'bug');
|
||||
$story = array('user1', 'id_desc', 'story');
|
||||
|
||||
r($my->getAssignedByMeTest($task[0], $task[1], $task[2])) && p() && e('0'); // 当插入一条action为admin指派了task的动态时,查询结果为1条数据
|
||||
r($my->getAssignedByMeTest($bug[0], $bug[1], $bug[2])) && p() && e('4'); // 当插入一条action为admin指派了bug的动态时,查询结果为1条数据
|
||||
r($my->getAssignedByMeTest($story[0], $story[1], $story[2])) && p() && e('0'); // 当插入一条action为admin指派了需求的动态时,查询结果为0条数据
|
||||
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/my.unittest.class.php';
|
||||
|
||||
$reviewissue = zenData('reviewissue');
|
||||
$reviewissue->project->range('1');
|
||||
$reviewissue->review->range('1-5');
|
||||
$reviewissue->type->range('review');
|
||||
$reviewissue->opinionDate->range('`2025-01-01`');
|
||||
$reviewissue->resolutionDate->range('`2025-01-01`');
|
||||
$reviewissue->createdDate->range('`2025-01-01`');
|
||||
$reviewissue->assignedTo->range('admin,user1,user2');
|
||||
$reviewissue->gen(20);
|
||||
zenData('userquery')->loadYaml('userquery')->gen('1');
|
||||
zenData('user')->gen('1');
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 myModel->getReviewissuesBySearch();
|
||||
cid=1
|
||||
|
||||
- 测试通过搜索获取 query id 0 类型 work id_desc 评审意见id @19,16,13,10,7,4,1
|
||||
- 测试通过搜索获取 query id 0 类型 work id_desc 评审意见数量 @7
|
||||
- 测试通过搜索获取 query id 0 类型 work id_asc 评审意见id @1,4,7,10,13,16,19
|
||||
- 测试通过搜索获取 query id 0 类型 work id_asc 评审意见数量 @7
|
||||
- 测试通过搜索获取 query id 0 类型 contribute id_desc 评审意见id @1
|
||||
- 测试通过搜索获取 query id 0 类型 contribute id_desc 评审意见数量 @1
|
||||
- 测试通过搜索获取 query id 0 类型 contribute id_asc 评审意见id @1
|
||||
- 测试通过搜索获取 query id 0 类型 contribute id_asc 评审意见数量 @1
|
||||
- 测试通过搜索获取 query id 5 类型 work id_desc 评审意见id @19,16,13,10,7,4,1
|
||||
- 测试通过搜索获取 query id 5 类型 work id_desc 评审意见数量 @7
|
||||
- 测试通过搜索获取 query id 5 类型 work id_asc 评审意见id @1,4,7,10,13,16,19
|
||||
- 测试通过搜索获取 query id 5 类型 work id_asc 评审意见数量 @7
|
||||
- 测试通过搜索获取 query id 5 类型 contribute id_desc 评审意见id @1
|
||||
- 测试通过搜索获取 query id 5 类型 contribute id_desc 评审意见数量 @1
|
||||
- 测试通过搜索获取 query id 5 类型 contribute id_asc 评审意见id @1
|
||||
- 测试通过搜索获取 query id 5 类型 contribute id_asc 评审意见数量 @1
|
||||
|
||||
*/
|
||||
|
||||
$my = new myTest();
|
||||
$queryID = array(0, 1);
|
||||
$type = array('work', 'contribute');
|
||||
$orderBy = array('id_desc', 'id_asc');
|
||||
|
||||
global $tester;
|
||||
$tester->session->set('workReviewissueQuery', "`title` like '%问题%'");
|
||||
$tester->session->set('contributeReviewissueQuery', "`title` like '%问题%'");
|
||||
|
||||
$tasks1 = $my->getReviewissuesBySearchTest($queryID[0], $type[0], $orderBy[0]);
|
||||
$tasks2 = $my->getReviewissuesBySearchTest($queryID[0], $type[0], $orderBy[1]);
|
||||
$tasks3 = $my->getReviewissuesBySearchTest($queryID[0], $type[1], $orderBy[0]);
|
||||
$tasks4 = $my->getReviewissuesBySearchTest($queryID[0], $type[1], $orderBy[1]);
|
||||
$tasks5 = $my->getReviewissuesBySearchTest($queryID[1], $type[0], $orderBy[0]);
|
||||
$tasks6 = $my->getReviewissuesBySearchTest($queryID[1], $type[0], $orderBy[1]);
|
||||
$tasks7 = $my->getReviewissuesBySearchTest($queryID[1], $type[1], $orderBy[0]);
|
||||
$tasks8 = $my->getReviewissuesBySearchTest($queryID[1], $type[1], $orderBy[1]);
|
||||
|
||||
r(implode(',', $tasks1)) && p() && e('19,16,13,10,7,4,1'); // 测试通过搜索获取 query id 0 类型 work id_desc 评审意见id
|
||||
r(count($tasks1)) && p() && e('7'); // 测试通过搜索获取 query id 0 类型 work id_desc 评审意见数量
|
||||
r(implode(',', $tasks2)) && p() && e('1,4,7,10,13,16,19'); // 测试通过搜索获取 query id 0 类型 work id_asc 评审意见id
|
||||
r(count($tasks2)) && p() && e('7'); // 测试通过搜索获取 query id 0 类型 work id_asc 评审意见数量
|
||||
r(implode(',', $tasks3)) && p() && e('1'); // 测试通过搜索获取 query id 0 类型 contribute id_desc 评审意见id
|
||||
r(count($tasks3)) && p() && e('1'); // 测试通过搜索获取 query id 0 类型 contribute id_desc 评审意见数量
|
||||
r(implode(',', $tasks4)) && p() && e('1'); // 测试通过搜索获取 query id 0 类型 contribute id_asc 评审意见id
|
||||
r(count($tasks4)) && p() && e('1'); // 测试通过搜索获取 query id 0 类型 contribute id_asc 评审意见数量
|
||||
r(implode(',', $tasks5)) && p() && e('19,16,13,10,7,4,1'); // 测试通过搜索获取 query id 5 类型 work id_desc 评审意见id
|
||||
r(count($tasks5)) && p() && e('7'); // 测试通过搜索获取 query id 5 类型 work id_desc 评审意见数量
|
||||
r(implode(',', $tasks6)) && p() && e('1,4,7,10,13,16,19'); // 测试通过搜索获取 query id 5 类型 work id_asc 评审意见id
|
||||
r(count($tasks6)) && p() && e('7'); // 测试通过搜索获取 query id 5 类型 work id_asc 评审意见数量
|
||||
r(implode(',', $tasks7)) && p() && e('1'); // 测试通过搜索获取 query id 5 类型 contribute id_desc 评审意见id
|
||||
r(count($tasks7)) && p() && e('1'); // 测试通过搜索获取 query id 5 类型 contribute id_desc 评审意见数量
|
||||
r(implode(',', $tasks8)) && p() && e('1'); // 测试通过搜索获取 query id 5 类型 contribute id_asc 评审意见id
|
||||
r(count($tasks8)) && p() && e('1'); // 测试通过搜索获取 query id 5 类型 contribute id_asc 评审意见数量
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=测试 myZen::showWorkCount();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 执行$count @14
|
||||
- 执行$count['task'] @0
|
||||
- 执行$count['story'] @2
|
||||
- 执行$count['bug'] @10
|
||||
- 执行$count['case'] @3
|
||||
- 执行$count['testtask'] @0
|
||||
- 执行$count['requirement'] @2
|
||||
- 执行$count['epic'] @1
|
||||
- 执行$count['issue'] @0
|
||||
- 执行$count['risk'] @2
|
||||
- 执行$count['reviewissue'] @0
|
||||
- 执行$count['qa'] @0
|
||||
- 执行$count['meeting'] @0
|
||||
- 执行$count['ticket'] @0
|
||||
- 执行$count['feedback'] @0
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/myzen.unittest.class.php';
|
||||
|
||||
zenData('task')->gen(10);
|
||||
$story = zenData('story');
|
||||
$story->type->range('story,requirement,epic');
|
||||
$story->gen(30);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('case')->gen(10);
|
||||
zenData('testtask')->gen(10);
|
||||
zenData('risk')->gen(10);
|
||||
$reviewissue = zenData('reviewissue');
|
||||
$reviewissue->project->range('1');
|
||||
$reviewissue->review->range('1-5');
|
||||
$reviewissue->type->range('review');
|
||||
$reviewissue->opinionDate->range('`2025-01-01`');
|
||||
$reviewissue->resolutionDate->range('`2025-01-01`');
|
||||
$reviewissue->createdDate->range('`2025-01-01`');
|
||||
$reviewissue->gen(5);
|
||||
zenData('nc')->gen(0);
|
||||
zenData('auditplan')->gen(10);
|
||||
zenData('meeting')->gen(10);
|
||||
zenData('feedback')->gen(10);
|
||||
zenData('ticket')->gen(10);
|
||||
zenData('demand')->gen(10);
|
||||
su('admin');
|
||||
|
||||
global $config;
|
||||
$config->URAndSR = 1;
|
||||
$config->enableER = 1;
|
||||
$config->edition = 'ipd';
|
||||
|
||||
$myTester = new myZenTest();
|
||||
$count = $myTester->showWorkCountTest(0, 20, 1);
|
||||
r(count($count)) && p() && e('14');
|
||||
r($count['task']) && p() && e('0');
|
||||
r($count['story']) && p() && e('2');
|
||||
r($count['bug']) && p() && e('10');
|
||||
r($count['case']) && p() && e('3');
|
||||
r($count['testtask']) && p() && e('0');
|
||||
r($count['requirement']) && p() && e('2');
|
||||
r($count['epic']) && p() && e('1');
|
||||
r($count['issue']) && p() && e('0');
|
||||
r($count['risk']) && p() && e('2');
|
||||
r($count['reviewissue']) && p() && e('0');
|
||||
r($count['qa']) && p() && e('0');
|
||||
r($count['meeting']) && p() && e('0');
|
||||
r($count['ticket']) && p() && e('0');
|
||||
r($count['feedback']) && p() && e('0');
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=测试 myZen::showWorkCount();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 执行$count @14
|
||||
- 执行$count['task'] @0
|
||||
- 执行$count['story'] @2
|
||||
- 执行$count['bug'] @10
|
||||
- 执行$count['case'] @3
|
||||
- 执行$count['testtask'] @0
|
||||
- 执行$count['requirement'] @2
|
||||
- 执行$count['epic'] @1
|
||||
- 执行$count['issue'] @0
|
||||
- 执行$count['risk'] @2
|
||||
- 执行$count['reviewissue'] @0
|
||||
- 执行$count['qa'] @0
|
||||
- 执行$count['meeting'] @0
|
||||
- 执行$count['ticket'] @0
|
||||
- 执行$count['feedback'] @0
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/lib/myzen.unittest.class.php';
|
||||
|
||||
zenData('task')->gen(10);
|
||||
$story = zenData('story');
|
||||
$story->type->range('story,requirement,epic');
|
||||
$story->gen(30);
|
||||
zenData('bug')->gen(10);
|
||||
zenData('case')->gen(10);
|
||||
zenData('testtask')->gen(10);
|
||||
zenData('risk')->gen(10);
|
||||
$reviewissue = zenData('reviewissue');
|
||||
$reviewissue->project->range('1');
|
||||
$reviewissue->review->range('1-5');
|
||||
$reviewissue->type->range('review');
|
||||
$reviewissue->opinionDate->range('`2025-01-01`');
|
||||
$reviewissue->resolutionDate->range('`2025-01-01`');
|
||||
$reviewissue->createdDate->range('`2025-01-01`');
|
||||
$reviewissue->gen(5);
|
||||
zenData('nc')->gen(0);
|
||||
zenData('auditplan')->gen(10);
|
||||
zenData('meeting')->gen(10);
|
||||
zenData('feedback')->gen(10);
|
||||
zenData('ticket')->gen(10);
|
||||
zenData('demand')->gen(10);
|
||||
su('admin');
|
||||
|
||||
global $config, $tester;
|
||||
$config->URAndSR = 1;
|
||||
$config->enableER = 1;
|
||||
$config->edition = 'ipd';
|
||||
|
||||
$tester->app->rawModule = 'my';
|
||||
$tester->app->rawMethod = 'work';
|
||||
$tester->app->loadClass('pager', true);
|
||||
$pager = pager::init(0, 10, 1);
|
||||
|
||||
$myTester = new myZenTest();
|
||||
$count = $myTester->showWorkCountNotInOpenTest($pager);
|
||||
r(count($count)) && p() && e('7');
|
||||
r($count['issue']) && p() && e('0');
|
||||
r($count['risk']) && p() && e('1');
|
||||
r($count['reviewissue']) && p() && e('0');
|
||||
r($count['qa']) && p() && e('0');
|
||||
r($count['meeting']) && p() && e('0');
|
||||
r($count['ticket']) && p() && e('0');
|
||||
r($count['feedback']) && p() && e('0');
|
||||
+9
-3
@@ -162,16 +162,16 @@ class myZen extends my
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function showWorkCount(int $recTotal = 0, int $recPerPage = 20, int $pageID = 1): void
|
||||
public function showWorkCount(int $recTotal = 0, int $recPerPage = 20, int $pageID = 1): array
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', true);
|
||||
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$count = array('task' => 0, 'story' => 0, 'bug' => 0, 'case' => 0, 'testtask' => 0, 'requirement' => 0, 'issue' => 0, 'risk' => 0, 'qa' => 0, 'meeting' => 0, 'ticket' => 0, 'feedback' => 0);
|
||||
$count = array('task' => 0, 'story' => 0, 'bug' => 0, 'case' => 0, 'testtask' => 0, 'requirement' => 0, 'epic' => 0, 'issue' => 0, 'risk' => 0, 'reviewissue' => 0, 'qa' => 0, 'meeting' => 0, 'ticket' => 0, 'feedback' => 0);
|
||||
|
||||
/* Get the number of tasks assigned to me. */
|
||||
$this->loadModel('task')->getUserTasks($this->app->user->account, 'assignedTo', 0, $pager);
|
||||
@@ -233,6 +233,7 @@ class myZen extends my
|
||||
|
||||
$this->view->todoCount = $count;
|
||||
$this->view->isOpenedURAndSR = $isOpenedURAndSR;
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,6 +276,11 @@ class myZen extends my
|
||||
$this->loadModel('risk')->getUserRisks('assignedTo', $this->app->user->account, 'id_desc', $pager);
|
||||
$count['risk'] = $pager->recTotal;
|
||||
|
||||
/* Get the number of reviewissues assigned to me. */
|
||||
$pager->recTotal = 0;
|
||||
$this->loadModel('reviewissue')->getUserReviewissues('assignedTo', $this->app->user->account, 'id_desc', $pager);
|
||||
$count['reviewissue'] = $pager->recTotal;
|
||||
|
||||
/* Get the number of nc assigned to me. */
|
||||
$pager->recTotal = 0;
|
||||
$this->my->getNcList('assignedToMe', 'id_desc', $pager, 'active');
|
||||
|
||||
Reference in New Issue
Block a user