* finish task #3600,3598.

This commit is contained in:
wangyidong
2018-01-31 09:41:53 +08:00
parent 894fd6310f
commit dff29fb2af
15 changed files with 2665 additions and 199 deletions
+3 -2
View File
@@ -337,7 +337,7 @@ class block extends control
}
elseif($block->block == 'assigntome')
{
$html = $this->fetch('block', 'printAssignToMeBlock');
$html = $this->fetch('block', 'printAssignToMeBlock', 'longBlock=' . $this->block->isLongBlock($block));
}
elseif($block->block == 'welcome')
{
@@ -701,7 +701,7 @@ class block extends control
* @access public
* @return void
*/
public function printAssignToMeBlock()
public function printAssignToMeBlock($longBlock = true)
{
if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true;
if(common::hasPriv('story', 'view')) $hasViewPriv['story'] = true;
@@ -771,6 +771,7 @@ class block extends control
}
$this->view->hasViewPriv = $hasViewPriv;
$this->view->longBlock = $longBlock;
$this->display();
}
+13 -13
View File
@@ -11,16 +11,16 @@
*/
?>
<div class='panel-body has-table'>
<table class='table table-borderless table-fixed table-hover block-bug'>
<table class='table table-borderless table-fixed table-hover block-bugs <?php if(!$longBlock) echo 'block-sm'?>'>
<thead>
<tr>
<th class='c-id'><?php echo $lang->idAB?></th>
<?php if($longBlock):?>
<th width='50'><?php echo $lang->idAB?></th>
<th class='c-pri'><?php echo $lang->priAB?></th>
<?php endif;?>
<th width='50'><?php echo $lang->priAB?></th>
<th> <?php echo $lang->bug->title;?></th>
<th width='50'><?php echo $lang->bug->severityAB?></th>
<th width='<?php echo $longBlock ? '90' : '60';?>'><?php echo $lang->bug->statusAB;?></th>
<th class='c-level'><?php echo $lang->bug->severityAB?></th>
<th class='c-name'><?php echo $lang->bug->title;?></th>
<th class='c-status'><?php echo $lang->bug->statusAB;?></th>
</tr>
</thead>
<?php foreach($bugs as $bug):?>
@@ -29,16 +29,16 @@
$viewLink = $this->createLink('bug', 'view', "bugID={$bug->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='c-id'><?php echo $bug->id;?></td>
<?php if($longBlock):?>
<td class='text-center'><?php echo $bug->id;?></td>
<td class='c-pri'><span class='label-pri label-pri-<?php echo $bug->pri?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
<?php endif;?>
<td class='text-center'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></td>
<td style='color: <?php echo $bug->color?>' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td class='text-center'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity)?></td>
<td class='text-left' title='<?php echo zget($lang->bug->statusList, $bug->status)?>'>
<span class="project-status-<?php echo $bug->status?>">
<td class='c-level'><span class='label-level' data-level='<?php echo zget($lang->bug->severityList, $bug->severity);?>'></span></td>
<td class='c-name' style='color: <?php echo $bug->color?>' title='<?php echo $bug->title?>'><?php echo $bug->title?></td>
<td class='c-status' title='<?php echo zget($lang->bug->statusList, $bug->status)?>'>
<span class="bug-status-<?php echo $bug->status?>">
<span class="label label-dot"></span>
<?php if($longBlock) echo zget($lang->bug->statusList, $bug->status);?>
<span class='status-text'><?php echo zget($lang->bug->statusList, $bug->status);?></span>
</span>
</td>
</tr>
+21 -19
View File
@@ -10,25 +10,27 @@
* @link http://www.ranzhi.org
*/
?>
<table class='table table-borderless table-hover table-fixed block-build'>
<table class='table table-borderless table-hover table-fixed block-builds'>
<thead>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->build->product;?></th>
<th> <?php echo $lang->build->name;?></th>
<th width='80'><?php echo $lang->build->date;?></th>
</tr>
<tr>
<th width='50'><?php echo $lang->idAB?></th>
<th> <?php echo $lang->build->product;?></th>
<th> <?php echo $lang->build->name;?></th>
<th width='80'><?php echo $lang->build->date;?></th>
</tr>
</thead>
<?php foreach($builds as $build):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('build', 'view', "buildID={$build->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $build->id;?></td>
<td title='<?php echo $build->productName?>'><?php echo $build->productName?></td>
<td title='<?php echo $build->name?>'><?php echo $build->name?></td>
<td><?php echo $build->date?></td>
</tr>
<?php endforeach;?>
<tbody>
<?php foreach($builds as $build):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('build', 'view', "buildID={$build->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-center'><?php echo $build->id;?></td>
<td title='<?php echo $build->productName?>'><?php echo $build->productName?></td>
<td title='<?php echo $build->name?>'><?php echo $build->name?></td>
<td><?php echo $build->date?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
+2 -2
View File
@@ -24,7 +24,7 @@ $useGuest = $this->app->user->account == 'guest';
<?php if(isset($config->block->closed) and strpos(",{$config->block->closed},", ",{$block->source}|{$block->block},") !== false) continue;?>
<div class='row'>
<div class='col-sm-12'>
<div class='panel block-<?php echo ($block->source == 'todo' and $block->block == 'list') ? 'todoes' : $block->block;?> <?php if(isset($block->params->color)) echo 'panel-' . $block->params->color;?>' id='block<?php echo $block->id?>' data-id='<?php echo $block->id?>' data-name='<?php echo $block->title?>'>
<div class='panel block-<?php echo $block->block;?> <?php if(isset($block->params->color)) echo 'panel-' . $block->params->color;?>' id='block<?php echo $block->id?>' data-id='<?php echo $block->id?>' data-name='<?php echo $block->title?>'>
<?php $hasHeading = ($block->block != 'welcome' and $block->block != 'flowchart');?>
<?php if($hasHeading):?>
<div class='panel-heading'>
@@ -64,7 +64,7 @@ $useGuest = $this->app->user->account == 'guest';
<?php if(isset($config->block->closed) and strpos(",{$config->block->closed},", ",{$block->source}|{$block->block},") !== false) continue;?>
<div class='row'>
<div class='col-sm-12'>
<div class='panel block-<?php echo ($block->source == 'todo' and $block->block == 'list') ? 'todoes' : $block->block;?> <?php if(isset($block->params->color)) echo 'panel-' . $block->params->color;?>' id='block<?php echo $block->id?>' data-id='<?php echo $block->id?>' data-name='<?php echo $block->title?>'>
<div class='panel block-<?php echo $block->block;?> <?php if(isset($block->params->color)) echo 'panel-' . $block->params->color;?>' id='block<?php echo $block->id?>' data-id='<?php echo $block->id?>' data-name='<?php echo $block->title?>'>
<?php $hasHeading = ($block->block != 'welcome' and $block->block != 'flowchart');?>
<?php if($hasHeading):?>
<div class='panel-heading'>
+15 -31
View File
@@ -11,50 +11,34 @@
*/
?>
<div class="panel-body has-table">
<table class='table table-borderless table-hover table-fixed block-product'>
<table class='table table-borderless table-hover table-fixed-head block-products'>
<thead>
<tr class='text-center'>
<th class='text-left'><?php echo $lang->product->name;?></th>
<?php if(!$longBlock):?>
<th width='65' title='<?php echo $lang->story->common;?>'><?php echo $lang->story->statusList['changed'];?></th>
<?php endif;?>
<tr>
<th class='c-name'><?php echo $lang->product->name;?></th>
<th class='c-plans'><?php echo $lang->product->plans;?></th>
<th class="c-publishs"><?php echo $lang->product->releases;?></th>
<?php if($longBlock):?>
<th width='65'><?php echo $lang->product->plans;?></th>
<th class="c-project"><?php echo $lang->product->currentProject;?></th>
<?php endif;?>
<th width='65'><?php echo $lang->product->releases;?></th>
<?php if($longBlock):?>
<th width='150'><?php echo $lang->product->currentProject;?></th>
<th width='65' title='<?php echo $lang->story->common;?>'><?php echo $lang->story->statusList['active'];?></th>
<?php endif;?>
<?php if(!$longBlock):?>
<th width='80' title='<?php echo $lang->bug->common;?>'><?php echo $lang->product->bugs;?></th>
<?php endif;?>
<th width='65' title='<?php echo $lang->bug->common;?>'><?php echo $lang->bug->unResolved;?></th>
<th class="c-stories" title='<?php echo $lang->story->common;?>'><?php echo $lang->story->statusList['active'];?></th>
<th class="c-bugs" title='<?php echo $lang->bug->common;?>'><?php echo $lang->bug->unResolved;?></th>
</tr>
</thead>
<tbody>
<?php foreach($productStats as $product):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'";
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : "";
$viewLink = $this->createLink('product', 'browse', 'productID=' . $product->id);
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-left' title='<?php echo $product->name?>'><?php echo $product->name?></td>
<?php if(!$longBlock):?>
<td><?php echo $product->stories['changed']?></td>
<?php endif;?>
<td class='c-name' title='<?php echo $product->name?>'><?php echo $product->name?></td>
<td class="c-plans"><?php echo $product->plans?></td>
<td class="c-publishs"><?php echo $product->releases?></td>
<?php if($longBlock):?>
<td><?php echo $product->plans?></td>
<td class='c-project'><?php echo zget($projects, $product->id, '');?></td>
<?php endif;?>
<td><?php echo $product->releases?></td>
<?php if($longBlock):?>
<td class='text-left'><?php echo zget($projects, $product->id, '');?></td>
<td><?php echo $product->stories['active']?></td>
<?php endif;?>
<?php if(!$longBlock):?>
<td><?php echo $product->bugs?></td>
<?php endif;?>
<td><?php echo $product->unResolved?></td>
<td class="c-stories"><?php echo $product->stories['active']?></td>
<td class="c-bugs"><?php echo $product->unResolved?></td>
</tr>
<?php endforeach;?>
</tbody>
+24 -18
View File
@@ -11,20 +11,20 @@
*/
?>
<div class='panel-body has-table'>
<table class='table table-borderless table-hover table-fixed-head block-stories'>
<table class='table table-borderless table-hover table-fixed-head block-stories <?php if(!$longBlock) echo 'block-sm'?>'>
<thead>
<tr>
<th class="c-id w-80px"><?php echo $lang->idAB?></th>
<th class="c-pri w-40px"><?php echo $lang->priAB?></th>
<th class="c-name"><?php echo $lang->story->title;?></th>
<?php if($longBlock):?>
<th width='50'><?php echo $lang->story->estimateAB;?></th>
<?php endif;?>
<th class="c-status w-80px"><?php echo $lang->statusAB;?></th>
<?php if($longBlock):?>
<th class='c-stage w-80px'><?php echo $lang->story->stageAB;?></th>
<?php endif;?>
</tr>
<tr>
<th class="c-id"><?php echo $lang->idAB?></th>
<th class="c-pri"><?php echo $lang->priAB?></th>
<th class="c-name"><?php echo $lang->story->title;?></th>
<?php if($longBlock):?>
<th class='c-estimate'><?php echo $lang->story->estimateAB;?></th>
<?php endif;?>
<th class="c-status"><?php echo $lang->statusAB;?></th>
<?php if($longBlock):?>
<th class='c-stage'><?php echo $lang->story->stageAB;?></th>
<?php endif;?>
</tr>
</thead>
<?php foreach($stories as $story):?>
<?php
@@ -33,17 +33,23 @@
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class="c-id"><?php echo $story->id;?></td>
<?php $pri = zget($lang->story->priList, $story->pri, $story->pri);?>
<?php $pri = zget($lang->story->priList, $story->pri, $story->pri);?>
<td class="c-pri"><span class="label-pri label-pri-<?php echo $pri?>"><?php echo $pri?></span></td>
<td class="c-name" style='color: <?php echo $story->color?>' title='<?php echo $story->title?>'><?php echo $story->title?></td>
<?php if($longBlock):?>
<td class='text-center'><?php echo $story->estimate?></td>
<td class='c-estimate'><?php echo $story->estimate?></td>
<?php endif;?>
<td class='text-left c-status' title='<?php echo zget($lang->story->statusList, $story->status)?>'>
<?php echo zget($lang->story->statusList, $story->status);?>
<td class='c-status' title='<?php echo zget($lang->story->statusList, $story->status)?>'>
<span class='story-status-<?php echo $story->status?>'>
<span class='label label-dot'></span><span class='status-text'><?php echo zget($lang->story->statusList, $story->status);?></span>
</span>
</td>
<?php if($longBlock):?>
<td class='text-center c-stage'><?php echo zget($lang->story->stageList, $story->stage, $story->stage);?></td>
<td class='c-stage'>
<span class='story-stage-<?php echo $story->stage?>'>
<?php echo zget($lang->story->stageList, $story->stage, $story->stage);?>
</span>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
+15 -19
View File
@@ -11,19 +11,17 @@
*/
?>
<div class='panel-body has-table'>
<table class='table table-borderless table-hover table-fixed block-task'>
<table class='table table-borderless table-hover table-fixed block-tasks <?php if(!$longBlock) echo 'block-sm';?>'>
<thead>
<tr>
<th class='c-id'><?php echo $lang->idAB?></th>
<th class='c-pri'><?php echo $lang->priAB?></th>
<th class='c-name'> <?php echo $lang->task->name;?></th>
<?php if($longBlock):?>
<th width='50'><?php echo $lang->idAB?></th>
<th class='c-estimate'><?php echo $lang->task->estimateAB;?></th>
<th class='c-deadline'><?php echo $lang->task->deadline;?></th>
<?php endif;?>
<th width='30'><?php echo $lang->priAB?></th>
<th> <?php echo $lang->task->name;?></th>
<th width='50'><?php echo $lang->task->estimateAB;?></th>
<?php if($longBlock):?>
<th width='75'><?php echo $lang->task->deadline;?></th>
<?php endif;?>
<th width='70'><?php echo $lang->statusAB;?></th>
<th class='c-status'><?php echo $lang->statusAB;?></th>
</tr>
</thead>
<?php foreach($tasks as $task):?>
@@ -32,19 +30,17 @@
$viewLink = $this->createLink('task', 'view', "taskID={$task->id}");
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='c-id'><?php echo $task->id;?></td>
<td class='c-pri'><span class='label-pri label-pri-<?php echo $task->pri;?>'><?php echo zget($lang->task->priList, $task->pri, $task->pri)?></span></td>
<td class='c-name' style='color: <?php echo $task->color?>' title='<?php echo $task->name?>'><?php echo $task->name?></td>
<?php if($longBlock):?>
<td class='text-center'><?php echo $task->id;?></td>
<td class='c-estimate'><?php echo $task->estimate?></td>
<td class='c-status'><?php if(substr($task->deadline, 0, 4) > 0) echo $task->deadline;?></td>
<?php endif;?>
<td class='text-center'><?php echo zget($lang->task->priList, $task->pri, $task->pri)?></td>
<td style='color: <?php echo $task->color?>' title='<?php echo $task->name?>'><?php echo $task->name?></td>
<td class='text-center'><?php echo $task->estimate?></td>
<?php if($longBlock):?>
<td class='<?php if(isset($task->delay)) echo 'delayed';?>'><?php if(substr($task->deadline, 0, 4) > 0) echo $task->deadline;?></td>
<?php endif;?>
<td class='text-center' title='<?php echo zget($lang->task->statusList, $task->status)?>'>
<span class="project-status-<?php echo $task->status?>">
<td class='c-status' title='<?php echo zget($lang->task->statusList, $task->status)?>'>
<span class="task-status-<?php echo $task->status?>">
<span class="label label-dot"></span>
<?php if($longBlock) echo zget($lang->task->statusList, $task->status);?>
<span class='status-text'><?php echo zget($lang->task->statusList, $task->status);?></span>
</span>
</td>
</tr>
+41 -39
View File
@@ -10,45 +10,47 @@
* @link http://www.ranzhi.org
*/
?>
<div class='panel-body'>
<div class="todoes-input dropdown">
<div data-toggle="dropdown"><input type="text" placeholder="<?php echo $lang->todo->lblClickCreate?>" class="form-control"></div>
<div class="dropdown-menu">
<header>
<div class="title"><?php echo $lang->todo->lblClickCreate;?></div>
</header>
<div class='block-todoes'>
<div class='panel-body'>
<div class="todoes-input dropdown">
<div data-toggle="dropdown"><input type="text" placeholder="<?php echo $lang->todo->lblClickCreate?>" class="form-control"></div>
<div class="dropdown-menu">
<header>
<div class="title"><?php echo $lang->todo->lblClickCreate;?></div>
</header>
</div>
</div>
<ul class="todoes">
<?php foreach($todos as $id => $todo):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('todo', 'view', "todoID={$todo->id}&from=my", 'html', true);
?>
<li data-id='<?php echo $todo->id?>'>
<span class="todo-check icon icon-check-circle"></span>
<a href="<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink);?>" class='iframe'>
<span class="todo-title"><?php echo $todo->name;?></span>
<span class="todo-pri todo-pri-<?php echo $todo->pri?>"><?php echo zget($lang->todo->priList, $todo->pri);?></span><span class="todo-time"><?php echo date(DT_DATE4, strtotime($todo->date)) . ' ' . $todo->begin;?></span>
</a>
</li>
<?php endforeach;?>
</ul>
</div>
<ul class="todoes">
<?php foreach($todos as $id => $todo):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn' data-id='{$this->get->entry}'" : '';
$viewLink = $this->createLink('todo', 'view', "todoID={$todo->id}&from=my");
?>
<li data-id='<?php echo $todo->id?>'>
<span class="todo-check icon icon-check-circle"></span>
<a href="<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink);?>">
<span class="todo-title"><?php echo $todo->name;?></span>
<span class="todo-pri todo-pri-<?php echo $todo->pri?>"><?php echo zget($lang->todo->priList, $todo->pri);?></span><span class="todo-time"><?php echo date(DT_DATE4, strtotime($todo->date)) . ' ' . $todo->begin;?></span>
</a>
</li>
<?php endforeach;?>
</ul>
<script>
$(function()
{
$('ul.todoes li .todo-check').click(function()
{
var $liTag = $(this).closest('li');
var isFinished = $liTag.hasClass('active');
var todoID = $liTag.data('id');
var methodName = isFinished ? 'activate' : 'finish';
$liTag.removeClass('active');
$.get(createLink('todo', methodName, "todoID=" + todoID), function()
{
if(!isFinished) $liTag.addClass('active');
});
});
});
</script>
</div>
<script>
$(function()
{
$('ul.todoes li .todo-check').click(function()
{
var $liTag = $(this).closest('li');
var isFinished = $liTag.hasClass('active');
var todoID = $liTag.data('id');
var methodName = isFinished ? 'activate' : 'finish';
$liTag.removeClass('active');
$.get(createLink('todo', methodName, "todoID=" + todoID), function()
{
if(!isFinished) $liTag.addClass('active');
});
});
});
</script>