* Add scrum block module.

This commit is contained in:
leiyong
2020-08-20 15:49:26 +08:00
parent 1cced1537d
commit c82fc3ff60
6 changed files with 58 additions and 23 deletions
+4 -4
View File
@@ -239,10 +239,10 @@ CREATE TABLE IF NOT EXISTS `zt_holiday` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT '',
`type` enum('holiday', 'working') NOT NULL DEFAULT 'holiday',
`desc` text NOT NULL,
`year` char(4) NOT NULL,
`begin` date NOT NULL,
`end` date NOT NULL,
`desc` text NOT NULL,
`year` char(4) NOT NULL,
`begin` date NOT NULL,
`end` date NOT NULL,
PRIMARY KEY (`id`),
KEY `year` (`year`),
KEY `name` (`name`)
+3 -4
View File
@@ -1440,18 +1440,17 @@ class block extends control
*/
public function printScrumtestBlock()
{
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$this->session->set('testtaskList', $this->app->getURI(true));
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->app->loadLang('testtask');
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1')
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project')
->where('t1.deleted')->eq('0')
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t1.product')->eq($this->session->program)->fi()
->andWhere('t1.product = t5.product')
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
->orderBy('t1.id desc')
+17 -1
View File
@@ -117,6 +117,10 @@ $lang->block->default['scrum']['program']['4']['title'] = '待测版本';
$lang->block->default['scrum']['program']['4']['block'] = 'scrumtest';
$lang->block->default['scrum']['program']['4']['grid'] = 8;
$lang->block->default['scrum']['program']['4']['params']['type'] = 'all';
$lang->block->default['scrum']['program']['4']['params']['num'] = '15';
$lang->block->default['scrum']['program']['4']['params']['orderBy'] = 'id_desc';
$lang->block->default['scrum']['program']['5']['title'] = '产品总览';
$lang->block->default['scrum']['program']['5']['block'] = 'scrumproduct';
$lang->block->default['scrum']['program']['5']['grid'] = 4;
@@ -126,7 +130,7 @@ $lang->block->default['scrum']['program']['6']['block'] = 'scrumproject';
$lang->block->default['scrum']['program']['6']['grid'] = 4;
$lang->block->default['scrum']['program']['7']['title'] = '最新动态';
$lang->block->default['scrum']['program']['7']['block'] = 'scrumoverview';
$lang->block->default['scrum']['program']['7']['block'] = 'scrumdynamic';
$lang->block->default['scrum']['program']['7']['grid'] = 4;
$lang->block->default['product']['1']['title'] = $lang->productCommon . '统计';
@@ -315,6 +319,18 @@ $lang->block->moduleList['product'] = $lang->productCommon;
$lang->block->moduleList['project'] = $lang->projectCommon;
$lang->block->moduleList['qa'] = '测试';
$lang->block->moduleList['todo'] = '待办';
$lang->block->moduleList['program'] = '项目';
$lang->block->modules['program'] = new stdclass();
$lang->block->modules['program']->availableBlocks = new stdclass();
$lang->block->modules['program']->availableBlocks->scrumoverall = '项目整体情况';
$lang->block->modules['program']->availableBlocks->scrumprogress = '进行中的迭代';
$lang->block->modules['program']->availableBlocks->scrumproject = '迭代总览';
$lang->block->modules['program']->availableBlocks->scrumproduct = '产品总览';
$lang->block->modules['program']->availableBlocks->scrumtest = '待测版本';
$lang->block->modules['program']->availableBlocks->scrumroadmap = '产品路线图';
$lang->block->modules['program']->availableBlocks->scrumdynamic = '最新动态';
$lang->block->modules['product'] = new stdclass();
$lang->block->modules['product']->availableBlocks = new stdclass();
+21
View File
@@ -661,4 +661,25 @@ class blockModel extends model
return $key == $hash;
}
/**
* Get testtask params.
*▫
* @param string $module▫
* @access public
* @return void
*/
public function getScrumtestParams($module = '')
{
$params = new stdclass();
$params->type['name'] = $this->lang->block->type;
$params->type['options'] = $this->lang->block->typeList->testtask;
$params->type['control'] = 'select';
$params->num['name'] = $this->lang->block->num;
$params->num['default'] = 20;
$params->num['control'] = 'input';
return json_encode($params);
}
}
+12 -14
View File
@@ -17,16 +17,15 @@
<table class='table table-borderless table-hover table-fixed-head tablesorter block-testtask table-fixed'>
<thead>
<tr class='text-center'>
<?php if($longBlock):?>
<th class='w-id'><?php echo $lang->idAB?></th>
<th class='text-left'><?php echo $lang->testtask->product;?></th>
<?php endif;?>
<th class='text-left'><?php echo $lang->testtask->name;?></th>
<?php if($longBlock):?>
<th class='text-left'><?php echo $lang->testtask->project . '/' . $lang->testtask->build;?></th>
<th class='text-left'><?php echo $lang->testtask->product;?></th>
<?php endif;?>
<th class='w-date'><?php echo $lang->testtask->begin;?></th>
<th class='w-date'><?php echo $lang->testtask->end;?></th>
<?php if($longBlock):?>
<th class='text-left'><?php echo $lang->testtask->project?></th>
<?php endif;?>
<th class='text-left'><?php echo $lang->testtask->build;?></th>
<th class='w-date'><?php echo $lang->testtask->status;?></th>
</tr>
</thead>
<tbody>
@@ -36,16 +35,15 @@
$viewLink = $this->createLink('testtask', 'view', "testtaskID={$testtask->id}");
?>
<tr class='text-center' data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<?php if($longBlock):?>
<td><?php echo sprintf('%03d', $testtask->id);?></td>
<td class='text-left' title='<?php echo $testtask->productName?>'><?php echo $testtask->productName?></td>
<?php endif;?>
<td class='text-left' title='<?php echo $testtask->name?>'><?php echo $testtask->name?></td>
<?php if($longBlock):?>
<td class='text-left' title='<?php echo $testtask->projectName . '/' . $testtask->buildName?>'><?php echo $testtask->projectName . '/' . $testtask->buildName?></td>
<td class='text-left' title='<?php echo $testtask->productName?>'><?php echo $testtask->productName?></td>
<?php endif;?>
<td><?php echo $testtask->begin?></td>
<td><?php echo $testtask->end?></td>
<?php if($longBlock):?>
<td class='text-left' title='<?php echo $testtask->projectName?>'><?php echo $testtask->projectName?></td>
<?php endif;?>
<td class='text-left' title='<?php echo $testtask->buildName?>'><?php echo $testtask->buildName?></td>
<td><?php echo zget($lang->testtask->statusList, $testtask->status)?></td>
</tr>
<?php endforeach;?>
</tbody>
+1
View File
@@ -81,6 +81,7 @@ class task extends control
}
$project = $this->project->getById($projectID);
$taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task");
$storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID");