* Finish task#4252

This commit is contained in:
滔哥
2018-05-25 11:33:46 +08:00
parent 4a12f37828
commit fdb74ef7ec
4 changed files with 131 additions and 123 deletions
+65 -65
View File
@@ -12,8 +12,8 @@
class block extends control
{
/**
* construct.
*
* construct.
*
* @access public
* @return void
*/
@@ -26,10 +26,10 @@ class block extends control
}
/**
* Block admin.
*
* @param int $id
* @param string $module
* Block admin.
*
* @param int $id
* @param string $module
* @access public
* @return void
*/
@@ -78,13 +78,13 @@ class block extends control
$this->display();
}
/**
* Set params when type is rss or html.
*
* @param int $id
* @param string $type
* @access public
* @return void
/**
* Set params when type is rss or html.
*
* @param int $id
* @param string $type
* @access public
* @return void
*/
public function set($id, $type, $source = '')
{
@@ -92,7 +92,7 @@ class block extends control
{
$source = isset($this->lang->block->moduleList[$source]) ? $source : '';
$this->block->save($id, $source, $type, $this->session->blockModule);
if(dao::isError()) die(js::error(dao::geterror()));
if(dao::isError()) die(js::error(dao::geterror()));
die(js::reload('parent'));
}
@@ -115,26 +115,26 @@ class block extends control
$this->view->type = $type;
$this->view->id = $id;
$this->view->block = ($block) ? $block : array();
$this->display();
$this->display();
}
/**
* Delete block
*
* @param int $id
* @param string $sys
* @param string $type
* Delete block
*
* @param int $id
* @param string $sys
* @param string $type
* @access public
* @return void
*/
public function delete($id, $module = 'my', $type = 'delete')
{
{
if($type == 'hidden')
{
{
$this->dao->update(TABLE_BLOCK)->set('hidden')->eq(1)->where('`id`')->eq($id)->andWhere('account')->eq($this->app->user->account)->andWhere('module')->eq($module)->exec();
}
else
{
{
$this->dao->delete()->from(TABLE_BLOCK)->where('`id`')->eq($id)->andWhere('account')->eq($this->app->user->account)->andWhere('module')->eq($module)->exec();
}
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
@@ -144,10 +144,10 @@ class block extends control
/**
* Sort block.
*
* @param string $oldOrder
* @param string $newOrder
* @param string $module
*
* @param string $oldOrder
* @param string $newOrder
* @param string $module
* @access public
* @return void
*/
@@ -155,7 +155,7 @@ class block extends control
{
$orders = explode(',', $orders);
$blockList = $this->block->getBlockList($module);
foreach ($orders as $order => $blockID)
{
$block = $blockList[$blockID];
@@ -199,8 +199,8 @@ class block extends control
/**
* Display dashboard for app.
*
* @param string $module
*
* @param string $module
* @access public
* @return void
*/
@@ -272,7 +272,7 @@ class block extends control
/**
* latest dynamic.
*
*
* @access public
* @return void
*/
@@ -285,7 +285,7 @@ class block extends control
/**
* Welcome block.
*
*
* @access public
* @return void
*/
@@ -317,9 +317,9 @@ class block extends control
}
/**
* Print block.
*
* @param int $id
* Print block.
*
* @param int $id
* @access public
* @return void
*/
@@ -361,13 +361,13 @@ class block extends control
{
$html = $this->fetch('block', 'welcome');
}
echo $html;
}
/**
* Main function.
*
*
* @access public
* @return void
*/
@@ -383,7 +383,7 @@ class block extends control
$mode = strtolower($this->get->mode);
if($mode == 'getblocklist')
{
{
$blocks = $this->block->getAvailableBlocks($module);
if(!$this->selfCall)
{
@@ -401,13 +401,13 @@ class block extends control
echo '<div class="col-sm-7">';
echo html::select('moduleBlock', $blockPairs, ($block and $block->source != '') ? $block->block : '', "class='form-control chosen'");
echo '</div></div>';
}
}
elseif($mode == 'getblockform')
{
{
$code = strtolower($this->get->blockid);
$func = 'get' . ucfirst($code) . 'Params';
echo $this->block->$func($module);
}
}
elseif($mode == 'getblockdata')
{
$code = strtolower($this->get->blockid);
@@ -417,7 +417,7 @@ class block extends control
if(!$this->selfCall)
{
$this->app->user = $this->dao->select('*')->from(TABLE_USER)->where('ranzhi')->eq($params->account)->fetch();
if(empty($this->app->user))
if(empty($this->app->user))
{
$this->app->user = new stdclass();
$this->app->user->account = 'guest';
@@ -475,7 +475,7 @@ class block extends control
/**
* Print List block.
*
*
* @access public
* @return void
*/
@@ -489,7 +489,7 @@ class block extends control
/**
* Print todo block.
*
*
* @access public
* @return void
*/
@@ -504,7 +504,7 @@ class block extends control
/**
* Print task block.
*
*
* @access public
* @return void
*/
@@ -518,7 +518,7 @@ class block extends control
/**
* Print bug block.
*
*
* @access public
* @return void
*/
@@ -531,7 +531,7 @@ class block extends control
/**
* Print case block.
*
*
* @access public
* @return void
*/
@@ -569,7 +569,7 @@ class block extends control
/**
* Print testtask block.
*
*
* @access public
* @return void
*/
@@ -595,7 +595,7 @@ class block extends control
/**
* Print story block.
*
*
* @access public
* @return void
*/
@@ -613,7 +613,7 @@ class block extends control
/**
* Print plan block.
*
*
* @access public
* @return void
*/
@@ -674,7 +674,7 @@ class block extends control
/**
* Print product block.
*
*
* @access public
* @return void
*/
@@ -701,8 +701,8 @@ class block extends control
/**
* Print statistic block.
*
* @param string $module
*
* @param string $module
* @access public
* @return void
*/
@@ -849,7 +849,7 @@ class block extends control
/**
* Print project statistic block.
*
*
* @access public
* @return void
*/
@@ -1013,7 +1013,7 @@ class block extends control
foreach($build->bugs as $bugID) $bugIDList[$bugID] = $bugID;
}
}
foreach($openedBugs as $buildBugs)
foreach($openedBugs as $buildBugs)
{
foreach($buildBugs as $bugID => $bug) $bugIDList[$bugID] = $bugID;
}
@@ -1047,7 +1047,7 @@ class block extends control
foreach($build->bugs as $key => $bugID)
{
if(!isset($bugs[$bugID])) continue;
$bug = $bugs[$bugID];
if($bug->assignedTo = $this->app->user->account) $build->assignedToMe++;
@@ -1056,7 +1056,7 @@ class block extends control
{
$build->unclosed++;
if($bug->status != 'resoloved')
if($bug->status != 'resoloved')
{
$build->unresolved++;
@@ -1069,7 +1069,7 @@ class block extends control
if(isset($confirmedBugs[$bugID])) $yesterdayConfirmed++;
$build->total++;
}
}
$build->assignedRate = $build->total ? round($build->assignedToMe / $build->total * 100, 2) : 0;
$build->unresolvedRate = $build->total ? round($build->unresolved / $build->total * 100, 2) : 0;
@@ -1098,7 +1098,7 @@ class block extends control
/**
* Print product overview block.
*
*
* @access public
* @return void
*/
@@ -1123,7 +1123,7 @@ class block extends control
/**
* Print project overview block.
*
*
* @access public
* @return void
*/
@@ -1183,7 +1183,7 @@ class block extends control
/**
* Print project block.
*
*
* @access public
* @return void
*/
@@ -1199,7 +1199,7 @@ class block extends control
/**
* Print assign to me block.
*
*
* @access public
* @return void
*/
@@ -1277,9 +1277,9 @@ class block extends control
}
/**
* Close block forever.
*
* @param int $blockID
* Close block forever.
*
* @param int $blockID
* @access public
* @return void
*/
+10 -10
View File
@@ -45,7 +45,7 @@
<?php endforeach;?>
</select>
<div class="input-group-cell">
<span class="text-muted small">开发已提交测试申请,<a href="<?php echo $this->createLink('testtask', 'browse', "productID={$product->id}");?>" class="text-primary">现在去测试 <i class="icon icon-right-circle icon-sm"></i></a></span>
<span class="text-muted small"><?php echo $lang->bug->hasSubmittedTest;?><a href="<?php echo $this->createLink('testtask', 'browse', "productID={$product->id}");?>" class="text-primary"><?php echo $lang->bug->nowToTest;?> <i class="icon icon-right-circle icon-sm"></i></a></span>
</div>
<?php endif;?>
</div>
@@ -55,25 +55,25 @@
<div class="progress-pie inline-block space progress-pie-100" data-value="<?php echo $build->assignedRate;?>" data-doughnut-size="80">
<canvas width="100" height="100" style="width: 100px; height: 100px;"></canvas>
<div class="progress-info">
<small>全部Bug</small>
<small><?php echo $lang->bug->allBugs . ' Bug';?></small>
<strong><span class="progress-value"><?php echo $build->total;?></span></strong>
</div>
</div>
<div class="text-center small with-padding">
<span class="label label-dot label-primary"></span> &nbsp; 指派给我 &nbsp; <strong><?php echo $build->assignedToMe;?></strong>
<span class="label label-dot label-primary"></span> &nbsp; <?php echo $lang->bug->assignToMe;?> &nbsp; <strong><?php echo $build->assignedToMe;?></strong>
</div>
</div>
<div class="col-7">
<div class="product-info">
<?php if($build->yesterdayResolved):?>
<div class="progress-info"><i class="icon icon-check-circle text-success icon-sm"></i> <span class="text-muted">昨日解决</span> <strong><?php echo $build->yesterdayResolved;?></strong></div>
<div class="progress-info"><i class="icon icon-check-circle text-success icon-sm"></i> <span class="text-muted"><?php echo $lang->bug->yesterdayResolved;?></span> <strong><?php echo $build->yesterdayResolved;?></strong></div>
<?php endif;?>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $build->unresovedRate;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $build->unresovedRate;?>%"></div>
</div>
<div class="type-info">
<div class="type-label">
<span>未解决</span>
<span><?php echo $lang->bug->unResolved;?></span>
</div>
<div class="type-value">
<strong><?php echo $build->unresolved;?></strong>
@@ -82,14 +82,14 @@
</div>
<div class="product-info">
<?php if($build->yesterdayConfirmed):?>
<div class="progress-info"><i class="icon icon-exclamation-sign text-danger icon-sm"></i> <span class="text-muted">昨日确认</span> <strong><?php echo $build->yesterdayConfirmed;?></strong></div>
<div class="progress-info"><i class="icon icon-exclamation-sign text-danger icon-sm"></i> <span class="text-muted"><?php echo $lang->bug->yesterdayConfirmed;?></span> <strong><?php echo $build->yesterdayConfirmed;?></strong></div>
<?php endif;?>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $build->unconfirmedRate;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $build->unconfirmedRate;?>%"></div>
</div>
<div class="type-info">
<div class="type-label">
<span>未确认</span>
<span><?php echo $lang->bug->unconfirmed;?></span>
</div>
<div class="type-value">
<strong><?php echo $build->unconfirmed;?></strong>
@@ -98,14 +98,14 @@
</div>
<div class="product-info">
<?php if($build->yesterdayClosed):?>
<div class="progress-info"><i class="icon icon-check-circle text-success icon-sm"></i> <span class="text-muted">昨日关闭</span> <strong><?php echo $build->yesterdayClosed;?></strong></div>
<div class="progress-info"><i class="icon icon-check-circle text-success icon-sm"></i> <span class="text-muted"><?php echo $lang->bug->yesterdayClosed;?></span> <strong><?php echo $build->yesterdayClosed;?></strong></div>
<?php endif;?>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $build->unclosedRate;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $build->unclosedRate;?>%"></div>
</div>
<div class="type-info">
<div class="type-label">
<span>未关闭</span>
<span><?php echo $lang->bug->unclosed;?></span>
</div>
<div class="type-value">
<strong><?php echo $build->unclosed;?></strong>
@@ -123,7 +123,7 @@
<ul class="nav nav-stacked nav-secondary">
<?php $index = 1;?>
<?php foreach($products as $product):?>
<li class="<?php if($index == 1) echo 'active';?>"><a href="###" data-target="#tabContent<?php echo $product->id;?>" data-toggle="tab"><?php echo $product->name;?></a></li>
<li class="<?php if($index == 1) echo 'active';?>"><a data-target="#tabContent<?php echo $product->id;?>" data-toggle="tab"><?php echo $product->name;?></a></li>
<?php $index++;?>
<?php endforeach;?>
</ul>
+28 -24
View File
@@ -103,24 +103,26 @@ $lang->bug->copy = 'Copy';
$lang->bug->search = 'Search';
/* 查询条件列表。*/
$lang->bug->assignToMe = 'AssignedToMe';
$lang->bug->openedByMe = 'CreatedByMe';
$lang->bug->resolvedByMe = 'ResolvedByMe';
$lang->bug->closedByMe = 'ClosedByMe';
$lang->bug->assignToNull = 'Unassigned';
$lang->bug->unResolved = 'Unresolved';
$lang->bug->toClosed = 'ToBeClosed';
$lang->bug->unclosed = 'Active';
$lang->bug->unconfirmed = 'UnConfirmed';
$lang->bug->longLifeBugs = 'Pending';
$lang->bug->postponedBugs = 'Postponed';
$lang->bug->overdueBugs = 'Overdue';
$lang->bug->allBugs = 'All';
$lang->bug->byQuery = 'Search';
$lang->bug->needConfirm = 'StoryChanged';
$lang->bug->allProduct = 'All' . $lang->productCommon;
$lang->bug->my = 'My';
$lang->bug->yesterdayResolved = 'Resolved Yesterday ';
$lang->bug->assignToMe = 'AssignedToMe';
$lang->bug->openedByMe = 'CreatedByMe';
$lang->bug->resolvedByMe = 'ResolvedByMe';
$lang->bug->closedByMe = 'ClosedByMe';
$lang->bug->assignToNull = 'Unassigned';
$lang->bug->unResolved = 'Unresolved';
$lang->bug->toClosed = 'ToBeClosed';
$lang->bug->unclosed = 'Active';
$lang->bug->unconfirmed = 'UnConfirmed';
$lang->bug->longLifeBugs = 'Pending';
$lang->bug->postponedBugs = 'Postponed';
$lang->bug->overdueBugs = 'Overdue';
$lang->bug->allBugs = 'All';
$lang->bug->byQuery = 'Search';
$lang->bug->needConfirm = 'StoryChanged';
$lang->bug->allProduct = 'All' . $lang->productCommon;
$lang->bug->my = 'My';
$lang->bug->yesterdayResolved = 'Resolved Yesterday ';
$lang->bug->yesterdayConfirmed = 'Confirmed Yesterday ';
$lang->bug->yesterdayClosed = 'Closed Yesterday ';
$lang->bug->assignToMeAB = 'Assigned To Me';
$lang->bug->openedByMeAB = 'Created By Me';
@@ -165,6 +167,8 @@ $lang->bug->remindTask = 'This Bug has been converted to Task. Do you
$lang->bug->skipClose = 'Bug %s is not resolved. You cannot close it.';
$lang->bug->applyTemplate = 'Template';
$lang->bug->confirmDeleteTemplate = 'Do you want to delete this template?';
$lang->bug->hasSubmittedTest = 'Development has submitted test application,';
$lang->bug->nowToTest = 'Now to test';
/* 模板。*/
$lang->bug->tplStep = "<p>[Steps]</p>\n";
@@ -334,18 +338,18 @@ $lang->bug->report->bugsPerProject->graph->xAxisName = $lang->projectCommon;
$lang->bug->report->bugsPerBuild->graph->xAxisName = 'Build';
$lang->bug->report->bugsPerModule->graph->xAxisName = 'Module';
$lang->bug->report->openedBugsPerDay->type = 'bar';
$lang->bug->report->openedBugsPerDay->type = 'bar';
$lang->bug->report->openedBugsPerDay->graph->xAxisName = 'Date';
$lang->bug->report->resolvedBugsPerDay->type = 'bar';
$lang->bug->report->resolvedBugsPerDay->type = 'bar';
$lang->bug->report->resolvedBugsPerDay->graph->xAxisName = 'Date';
$lang->bug->report->closedBugsPerDay->type = 'bar';
$lang->bug->report->closedBugsPerDay->type = 'bar';
$lang->bug->report->closedBugsPerDay->graph->xAxisName = 'Date';
$lang->bug->report->openedBugsPerUser->graph->xAxisName = 'User';
$lang->bug->report->resolvedBugsPerUser->graph->xAxisName= 'User';
$lang->bug->report->closedBugsPerUser->graph->xAxisName = 'User';
$lang->bug->report->openedBugsPerUser->graph->xAxisName = 'User';
$lang->bug->report->resolvedBugsPerUser->graph->xAxisName = 'User';
$lang->bug->report->closedBugsPerUser->graph->xAxisName = 'User';
$lang->bug->report->bugsPerSeverity->graph->xAxisName = 'Priority';
$lang->bug->report->bugsPerResolution->graph->xAxisName = 'Solution';
+28 -24
View File
@@ -103,24 +103,26 @@ $lang->bug->copy = '复制Bug';
$lang->bug->search = '搜索';
/* 查询条件列表。*/
$lang->bug->assignToMe = '指派给我';
$lang->bug->openedByMe = '由我创建';
$lang->bug->resolvedByMe = '由我解决';
$lang->bug->closedByMe = '由我关闭';
$lang->bug->assignToNull = '未指派';
$lang->bug->unResolved = '未解决';
$lang->bug->toClosed = '待关闭';
$lang->bug->unclosed = '未关闭';
$lang->bug->unconfirmed = '未确认';
$lang->bug->longLifeBugs = '久未处理';
$lang->bug->postponedBugs = '被延期';
$lang->bug->overdueBugs = '过期Bug';
$lang->bug->allBugs = '所有';
$lang->bug->byQuery = '搜索';
$lang->bug->needConfirm = '需求变动';
$lang->bug->allProduct = '所有' . $lang->productCommon;
$lang->bug->my = '我的';
$lang->bug->yesterdayResolved = '昨天解决';
$lang->bug->assignToMe = '指派给我';
$lang->bug->openedByMe = '由我创建';
$lang->bug->resolvedByMe = '由我解决';
$lang->bug->closedByMe = '由我关闭';
$lang->bug->assignToNull = '未指派';
$lang->bug->unResolved = '未解决';
$lang->bug->toClosed = '待关闭';
$lang->bug->unclosed = '未关闭';
$lang->bug->unconfirmed = '未确认';
$lang->bug->longLifeBugs = '久未处理';
$lang->bug->postponedBugs = '被延期';
$lang->bug->overdueBugs = '过期Bug';
$lang->bug->allBugs = '所有';
$lang->bug->byQuery = '搜索';
$lang->bug->needConfirm = '需求变动';
$lang->bug->allProduct = '所有' . $lang->productCommon;
$lang->bug->my = '我的';
$lang->bug->yesterdayResolved = '昨天解决';
$lang->bug->yesterdayConfirmed = '昨天确认';
$lang->bug->yesterdayClosed = '昨天关闭';
$lang->bug->assignToMeAB = '指派给我';
$lang->bug->openedByMeAB = '由我创建';
@@ -165,6 +167,8 @@ $lang->bug->remindTask = '该Bug已经转化为任务,是否更新
$lang->bug->skipClose = 'Bug %s 不是已解决状态,不能关闭。';
$lang->bug->applyTemplate = '应用模板';
$lang->bug->confirmDeleteTemplate = '您确认要删除该模板吗?';
$lang->bug->hasSubmittedTest = '开发已提交测试申请,';
$lang->bug->nowToTest = '现在去测试';
/* 模板。*/
$lang->bug->tplStep = "<p>[步骤]</p>";
@@ -334,18 +338,18 @@ $lang->bug->report->bugsPerProject->graph->xAxisName = $lang->projectCommon;
$lang->bug->report->bugsPerBuild->graph->xAxisName = '版本';
$lang->bug->report->bugsPerModule->graph->xAxisName = '模块';
$lang->bug->report->openedBugsPerDay->type = 'bar';
$lang->bug->report->openedBugsPerDay->type = 'bar';
$lang->bug->report->openedBugsPerDay->graph->xAxisName = '日期';
$lang->bug->report->resolvedBugsPerDay->type = 'bar';
$lang->bug->report->resolvedBugsPerDay->type = 'bar';
$lang->bug->report->resolvedBugsPerDay->graph->xAxisName = '日期';
$lang->bug->report->closedBugsPerDay->type = 'bar';
$lang->bug->report->closedBugsPerDay->type = 'bar';
$lang->bug->report->closedBugsPerDay->graph->xAxisName = '日期';
$lang->bug->report->openedBugsPerUser->graph->xAxisName = '用户';
$lang->bug->report->resolvedBugsPerUser->graph->xAxisName= '用户';
$lang->bug->report->closedBugsPerUser->graph->xAxisName = '用户';
$lang->bug->report->openedBugsPerUser->graph->xAxisName = '用户';
$lang->bug->report->resolvedBugsPerUser->graph->xAxisName = '用户';
$lang->bug->report->closedBugsPerUser->graph->xAxisName = '用户';
$lang->bug->report->bugsPerSeverity->graph->xAxisName = '严重程度';
$lang->bug->report->bugsPerResolution->graph->xAxisName = '解决方案';