* code for task#727.

This commit is contained in:
chencongzhi520@gmail.com
2012-06-29 06:08:03 +00:00
parent c605a70420
commit 29a5660d06
17 changed files with 317 additions and 188 deletions
+2
View File
@@ -11,3 +11,5 @@
.confirm1 {color:green; font-size:9px}
tfoot .f-left {color:#141414;}
table.border-sep {border-collapse:separate;}
#featurebar .f-right a {padding:2px 8px}
+3 -3
View File
@@ -39,7 +39,7 @@ function loadModuleMenu(productID)
function loadProductStories(productID)
{
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
$('#storyIdBox').load(link, function(){$('#story').chosen();});
$('#storyIdBox').load(link, function(){$('#story').chosen({no_results_text:noResultsMatch});});
}
/**
@@ -101,7 +101,7 @@ function loadProjectRelated(projectID)
function loadProjectTasks(projectID)
{
link = createLink('task', 'ajaxGetProjectTasks', 'projectID=' + projectID);
$('#taskIdBox').load(link, function(){$('#task').chosen();});
$('#taskIdBox').load(link, function(){$('#task').chosen({no_results_text:noResultsMatch});});
}
/**
@@ -115,7 +115,7 @@ function loadProjectStories(projectID)
{
productID = $('#product').get(0).value;
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + productID);
$('#storyIdBox').load(link, function(){$('#story').chosen();});
$('#storyIdBox').load(link, function(){$('#story').chosen({no_results_text:noResultsMatch});});
}
/**
+7 -7
View File
@@ -37,10 +37,10 @@ var customed = <?php echo (int)$customed;?>;
?>
</div>
<div class='f-right'>
<?php if($browseType != 'needconfirm') common::printLink('bug', 'export', "productID=$productID&orderBy=$orderBy", $lang->export, '', 'class="export"'); ?>
<?php if($browseType != 'needconfirm') common::printLink('bug', 'export', "productID=$productID&orderBy=$orderBy", '&nbsp;', '', "class='export icon-green-big-export' title='{$lang->bug->export}'"); ?>
<?php common::printLink('bug', 'customFields', '', $lang->bug->customFields, '', "class='iframe'"); ?>
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID", $lang->bug->report->common); ?>
<?php common::printLink('bug', 'create', "productID=$productID&extra=moduleID=$moduleID", $lang->bug->create); ?>
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&moduleID=$moduleID", '&nbsp;', '', "class='icon-green-big-report' title='{$lang->bug->report->common}'"); ?>
<?php common::printLink('bug', 'create', "productID=$productID&extra=moduleID=$moduleID", '&nbsp;', '', "class='icon-green-big-bug-create' title='{$lang->bug->create}'"); ?>
</div>
</div>
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
@@ -134,10 +134,10 @@ var customed = <?php echo (int)$customed;?>;
<td>
<?php
$params = "bugID=$bug->id";
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
if($this->cookie->windowWidth >= $this->config->wideSize) common::printLink('bug', 'create', "product=$bug->product&extra=bugID=$bug->id", $lang->bug->buttonCopy);
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, '&nbsp;', '', "class='icon-green-small-bug-resolve' title='{$lang->bug->resolve}'"))) echo "<span class='icon-gray-small-bug-resolve'></span>";
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, '&nbsp;', '', "class='icon-green-small-bug-close' title='{$lang->bug->close}'"))) echo "<span class='icon-gray-small-bug-close'></span>";
common::printLink('bug', 'edit', $params, '&nbsp;', '', "class='icon-green-small-edit' title='{$lang->bug->edit}'");
common::printLink('bug', 'create', "product=$bug->product&extra=bugID=$bug->id", '&nbsp;', '', "class='icon-green-small-copy' title='{$lang->copy}'");
?>
</td>
<?php endif;?>
+30 -39
View File
@@ -21,38 +21,35 @@
$convertParams = "productID=$productID&moduleID=0&from=bug&bugID=$bug->id";
if(!$bug->deleted)
{
if($bug->status == 'active' and $bug->confirmed == 0)common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm);
common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign);
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
if($bug->status == 'active') common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve);
if($bug->status == 'resolved')common::printLink('bug', 'close', $params, $lang->bug->buttonClose);
if(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory')common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate);
echo "<span class='icon-green-big-splitLine'></span>";
if($bug->status == 'active' and common::hasPriv('story', 'create'))
{
common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' ';
}
else
{
echo $lang->bug->toStory . ' ';
}
if($bug->status == 'active' and common::hasPriv('story', 'create')) common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' ';
common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase);
echo "<span class='icon-green-big-splitLine'></span>";
common::printLink('bug', 'edit', $params, '&nbsp;', '', "class='icon-edit'");
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-comment' onclick='setComment()'");
common::printLink('bug', 'edit', $params, '&nbsp;', '', "class='icon-green-big-edit' title={$lang->bug->edit}");
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' title={$lang->comment} onclick='setComment()'");
common::printLink('bug', 'create', $copyParams, '&nbsp;', '', "class='icon-copy'");
common::printLink('bug', 'create', $copyParams, '&nbsp;', '', "class='icon-green-big-copy' title={$lang->copy}");
common::printLink('bug', 'delete', $params, '&nbsp;', 'hiddenwin', "class='icon-delete'");
common::printLink('bug', 'delete', $params, '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title={$lang->delete}");
}
echo html::a($browseLink, '&nbsp;', '', "class='icon-goback'");
echo "<span class='icon-green-big-splitLine'></span>";
echo html::a($browseLink, '&nbsp;', '', "class='icon-green-big-goback' title={$lang->goback}");
if($preAndNext->pre)
{
echo "<abbr id='pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'>" . html::a($this->inLink('view', "storyID={$preAndNext->pre->id}"), '&nbsp', '', "class='icon-pre'") . "</abbr>";
echo html::a($this->inLink('view', "storyID={$preAndNext->pre->id}"), '&nbsp', '', "class='icon-green-big-pre' id='pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'");
}
if($preAndNext->next)
{
echo "<abbr id='next' title={$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}>" . html::a($this->inLink('view', "storyID={$preAndNext->next->id}"), '&nbsp;', '', "class='icon-next'") . "</abbr>";
echo html::a($this->inLink('view', "storyID={$preAndNext->next->id}"), '&nbsp;', '', "class='icon-green-big-next' id='next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}'");
}
?>
</div>
@@ -71,30 +68,24 @@
<?php
if(!$bug->deleted)
{
if($bug->status == 'active' and $bug->confirmed == 0)common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm);
common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign);
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
if($bug->status == 'active') common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve);
if($bug->status == 'resolved') common::printLink('bug', 'close', $params, $lang->bug->buttonClose);
if(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory') common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate);
echo "<span class='icon-green-big-splitLine'></span>";
if($bug->status == 'active' and common::hasPriv('bug', 'resolve'))
{
common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' ';
}
else
{
echo $lang->bug->toStory . ' ';
}
common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase);
if($bug->status == 'active' and common::hasPriv('bug', 'resolve')) common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' ';
common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase);
echo "<span class='icon-green-big-splitLine'></span>";
common::printLink('bug', 'edit', $params, '&nbsp;', '', "class='icon-edit'");
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='comment' onclick='setComment()'"). ' ';
common::printLink('bug', 'create', $copyParams, '&nbsp;', '', "class='icon-copy'");
common::printLink('bug', 'delete', $params, '&nbsp;', 'hiddenwin', "class='icon-delete'");
common::printLink('bug', 'edit', $params, '&nbsp;', '', "class='icon-green-big-edit' title={$lang->bug->edit}");
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' title={$lang->comment} onclick='setComment()'"). ' ';
common::printLink('bug', 'create', $copyParams, '&nbsp;', '', "class='icon-green-big-copy' title={$lang->copy}");
common::printLink('bug', 'delete', $params, '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title={$lang->delete}");
echo "<span class='icon-green-bigsplitLine'></span>";
}
echo html::a($browseLink, '&nbsp;', '', "class='icon-goback'");
echo html::a($browseLink, '&nbsp;', '', "class='icon-green-big-goback' title={$lang->goback}");
?>
</div>
<div id='comment' class='hidden'>
+8 -1
View File
@@ -3,4 +3,11 @@
css::import($defaultTheme . 'chosen.css');
js::import($jsRoot . 'jquery/chosen/chosen.min.js');
?>
<script> noResultsMatch = '<?php echo $lang->noResultsMatch;?>' </script>
<script>
noResultsMatch = '<?php echo $lang->noResultsMatch;?>';
$(document).ready(function()
{
$("#productID").chosen({no_results_text: noResultsMatch});
$("#projectID").chosen({no_results_text: noResultsMatch});
});
</script>
+1
View File
@@ -2,6 +2,7 @@
if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}
include 'header.lite.html.php';
include 'colorbox.html.php';
include 'chosen.html.php';
?>
<div id='header'>
<table class='cont' id='topbar'>
+4 -1
View File
@@ -102,7 +102,7 @@ class project extends control
* @access public
* @return void
*/
public function task($projectID = 0, $status = 'all', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
public function task($projectID = 0, $status = 'byproject', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
/* Set browseType, productID, moduleID and queryID. */
$browseType = strtolower($status);
@@ -132,6 +132,7 @@ class project extends control
$tasks = array();
if($browseType != "bysearch")
{
$status = $status == 'byproject' ? 'all' : $status;
$tasks = $this->loadModel('task')->getProjectTasks($projectID, $status, $orderBy, $pager);
}
else
@@ -177,6 +178,8 @@ class project extends control
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->param = $param;
$this->view->projectID = $projectID;
$this->view->treeClass = $browseType == 'byproject' ? '' : 'hidden';
$this->view->projectTree = $this->project->tree();
$this->display();
}
+3
View File
@@ -1 +1,4 @@
.bug, .task {color:gray; font-size:9px}
.cont-lt1 .side{width:220px}
+11
View File
@@ -2,3 +2,14 @@ $(function()
{
$('#' + browseType + 'Tab').addClass('active');
});
/* Browse by project. */
function browseByProject()
{
$('#treebox').removeClass('hidden');
$('.divider').removeClass('hidden');
$('#querybox').addClass('hidden');
$('#byProjectTab').addClass('active');
$('#featurebar .active').removeClass('active');
}
+5
View File
@@ -182,3 +182,8 @@ $lang->project->placeholder->code = 'Project code';
$lang->project->placeholder->end = "If scrum it should no more than 30 days";
$lang->project->placeholder->days = 'Decide by begin date and end day';
$lang->project->placeholder->team = 'Team name';
$lang->project->selectGroup->doing = '(Doing)';
$lang->project->selectGroup->done = '(Done)';
$lang->project->projectTasks = 'ProjectTasks';
+5
View File
@@ -182,3 +182,8 @@ $lang->project->placeholder->code = '作为团队内部对某一个项目的简
$lang->project->placeholder->end = '对于scrum而言,一般不宜超过30天。';
$lang->project->placeholder->days = '根据开始日期和结束日期自动计算';
$lang->project->placeholder->team = '团队内部可以自己选择自己喜欢的名称。';
$lang->project->selectGroup->doing = '(进行中)';
$lang->project->selectGroup->done = '(已结束)';
$lang->project->projectTasks = '按项目浏览';
+88 -7
View File
@@ -94,15 +94,96 @@ class projectModel extends model
*/
public function select($projects, $projectID, $currentModule, $currentMethod)
{
$projectMode = $this->cookie->projectMode ? $this->cookie->projectMode : 'all';
$products = $this->loadModel('product')->getPairs('nocode');
$productGroup = $this->getProductGroupList();
$selectGroup = array();
foreach($productGroup as $projects)
{
foreach($projects as $project)
{
if($projectMode == 'noclosed' and $project->status == 'done') continue;
$status = $project->status != 'done' ? $this->lang->project->selectGroup->doing : '';
if($project->product)
{
if(isset($products[$project->product]))
{
$selectGroup[$products[$project->product]][$project->id] = $project->name . $status;
}
}
else
{
$selectGroup[$this->lang->project->noProduct][$project->id] = $project->name . $status;
}
}
}
/* See product's model method:select. */
$switchCode = "switchProject($('#projectID').val(), '$currentModule', '$currentMethod');";
$onchange = "onchange=\"$switchCode\"";
$onkeypress = "onkeypress=\"eventKeyCode=event.keyCode; if(eventKeyCode == 13) $switchCode\"";
$onclick = "onclick=\"eventKeyCode = 13; $switchCode\"";
$selectHtml = html::select('projectID', $projects, $projectID, "tabindex=2 $onchange");
$switchCode = "switchProject($('#projectID').val(), '$currentModule', '$currentMethod');";
$onchange = "onchange=\"$switchCode\"";
$onkeypress = "onkeypress=\"eventKeyCode=event.keyCode; if(eventKeyCode == 13) $switchCode\"";
$onclick = "onclick=\"eventKeyCode = 13; $switchCode\"";
$selectHtml = html::selectGroup('projectID', $selectGroup, $projectID, "tabindex=2 $onchange $onkeypress");
return $selectHtml;
}
/**
* Get project tree menu.
*
* @access public
* @return void
*/
public function tree()
{
$products = $this->loadModel('product')->getPairs('nocode');
$productGroup = $this->getProductGroupList();
$projectTree = "<ul id='tree'>";
foreach($productGroup as $productID => $projects)
{
if(!isset($products[$productID]) and $productID != '') continue;
$productName = isset($products[$productID]) ? $products[$productID] : $this->lang->project->noProduct;
$projectTree .= "<li>$productName<ul>";
foreach($projects as $project)
{
if($project->status != 'done')
{
$projectTree .= "<li>" . html::a(inlink('task', "projectID=$project->id"), $project->name, '', "id='project$project->id'") . "</li>";
}
}
$hasDone = false;
foreach($projects as $project)
{
if($project->status == 'done')
{
$hasDone = true;
break;
}
}
if($hasDone)
{
$projectTree .= "<li>{$this->lang->project->selectGroup->done}<ul>";
foreach($projects as $project)
{
if($project->status == 'done')
{
$projectTree .= "<li>" . html::a(inlink('task', "projectID=$project->id"), $project->name, '', "id='project$project->id'") . "</li>";
}
}
$projectTree .= "</ul></li>";
}
$projectTree .= "</ul></li>";
}
$projectTree .= "</ul>";
return $projectTree;
}
/**
* Save the project id user last visited to session.
*
@@ -331,10 +412,10 @@ class projectModel extends model
*/
public function getProductGroupList()
{
$list = $this->dao->select('t1.id, t1.name, t2.product')->from(TABLE_PROJECT)->alias('t1')
$list = $this->dao->select('t1.id, t1.name,t1.status, t2.product')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
->where('t1.deleted')->eq(0)
->orderBy('t1.id')
->orderBy('t1.order')
->fetchGroup('product');
foreach($list as $id => $product)
+125 -108
View File
@@ -13,122 +13,139 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<?php include './taskheader.html.php';?>
<script language='Javascript'>
var browseType = '<?php echo $browseType;?>';
</script>
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
<form method='post' action='<?php echo $this->createLink('task', 'batchEdit', "projectID=$project->id&from=projectTask&orderBy=$orderBy");?>'>
<table class='table-1 fixed colored tablesorter datatable'>
<?php $vars = "projectID=$project->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; ?>
<thead>
<tr class='colhead'>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='w-p30'> <?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-70px'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->task->deadlineAB);?></th>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>' id='treebox'>
<div class='box-title'><?php echo $lang->project->projectTasks;?></div>
<div class='box-content'><?php echo $projectTree;?></div>
</td>
<td class='divider <?php echo $treeClass;?>'></td>
<td>
<form method='post' action='<?php echo $this->createLink('task', 'batchEdit', "projectID=$project->id&from=projectTask&orderBy=$orderBy");?>'>
<table class='table-1 fixed colored tablesorter datatable'>
<?php $vars = "projectID=$project->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; ?>
<thead>
<tr class='colhead'>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='w-p30'> <?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-70px'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->task->deadlineAB);?></th>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<th class='w-id'> <?php common::printOrderLink('openedDate',$orderBy, $vars, $lang->task->openedDateAB);?></th>
<?php endif;?>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<th class='w-id'> <?php common::printOrderLink('openedDate',$orderBy, $vars, $lang->task->openedDateAB);?></th>
<?php endif;?>
<th class='w-user'> <?php common::printOrderLink('assignedTo',$orderBy, $vars, $lang->task->assignedToAB);?></th>
<th class='w-user'> <?php common::printOrderLink('finishedBy',$orderBy, $vars, $lang->task->finishedByAB);?></th>
<th class='w-user'> <?php common::printOrderLink('assignedTo',$orderBy, $vars, $lang->task->assignedToAB);?></th>
<th class='w-user'> <?php common::printOrderLink('finishedBy',$orderBy, $vars, $lang->task->finishedByAB);?></th>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<th class='w-40px'> <?php common::printOrderLink('finishedDate',$orderBy, $vars, $lang->task->finishedDateAB);?></th>
<?php endif;?>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<th class='w-40px'> <?php common::printOrderLink('finishedDate',$orderBy, $vars, $lang->task->finishedDateAB);?></th>
<?php endif;?>
<th class='w-35px'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->task->estimateAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('consumed', $orderBy, $vars, $lang->task->consumedAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('left', $orderBy, $vars, $lang->task->leftAB);?></th>
<th><?php common::printOrderLink('story', $orderBy, $vars, $lang->task->story);?></th>
<th class='w-120px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php
$taskSum = $statusWait = $statusDone = $statusDoing = $statusClosed = $statusCancel = 0;
$totalEstimate = $totalConsumed = $totalLeft = 0.0;
?>
<tbody>
<?php foreach($tasks as $task):?>
<?php $class = $task->assignedTo == $app->user->account ? 'style=color:red' : '';?>
<?php
$totalEstimate += $task->estimate;
$totalConsumed += $task->consumed;
$totalLeft += (($task->status == 'cancel' or $task->closedReason == 'cancel') ? 0 : $task->left);
$statusVar = 'status' . ucfirst($task->status);
$$statusVar ++;
?>
<tr class='a-center'>
<td>
<input type='checkbox' name='taskIDList[]' value='<?php echo $task->id;?>'/>
<?php if(!common::printLink('task', 'view', "task=$task->id", sprintf('%03d', $task->id))) printf('%03d', $task->id);?>
</td>
<td><?php echo $lang->task->priList[$task->pri];?></td>
<td class='a-left nobr'>
<?php
if($task->fromBug != 0) echo "<span class='bug'>[BUG] </span>";
else echo "<span class='task'>[TASK] </span>";
if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;
?>
</td>
<td class=<?php echo $task->status;?> >
<?php
$storyChanged = ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion);
$storyChanged ? print("<span class='warning'>{$lang->story->changed}</span> ") : print($lang->task->statusList[$task->status]);
?>
</td>
<td class=<?php if(isset($task->delay)) echo 'delayed';?>><?php if(substr($task->deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6);?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->openedDate, 5, 6);?></th>
<?php endif;?>
<td <?php echo $class;?>><?php echo $task->assignedToRealName;?></td>
<td><?php echo $users[$task->finishedBy];?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->finishedDate, 5, 6);?></th>
<?php endif;?>
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
<td class='a-left nobr'>
<?php
$story = '';
if($task->storyID and common::hasPriv('story', 'view')) $story = html::a($this->createLink('story', 'view', "storyid=$task->storyID"), $task->storyTitle);
if($task->storyID and !common::hasPriv('story', 'view')) $story = $task->storyTitle;
echo $story;
?>
</td>
<td>
<?php
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'finish', "taskID=$task->id", $lang->task->buttonDone))) echo $lang->task->buttonDone . ' ';
if(!(($task->status == 'done' or $task->status == 'cancel') and common::printLink('task', 'close', "taskID=$task->id", $lang->task->buttonClose))) echo $lang->task->buttonClose . ' ';
if(!common::printLink('task', 'edit', "taskID=$task->id", $lang->task->buttonEdit)) echo $lang->task->buttonEdit . ' ';
if($browseType == 'needconfirm') common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php $columns = $this->cookie->windowWidth > $this->config->wideSize ? 14 : 12;?>
<td colspan='<?php echo $columns;?>'>
<div class='f-left'>
<?php
if(common::hasPriv('task', 'batchEdit') and count($tasks))echo html::selectAll() . html::selectReverse() . html::submitButton($lang->task->batchEdit);
printf($lang->project->taskSummary, count($tasks), $statusWait, $statusDoing, $totalEstimate, $totalConsumed, $totalLeft);
<th class='w-35px'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->task->estimateAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('consumed', $orderBy, $vars, $lang->task->consumedAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('left', $orderBy, $vars, $lang->task->leftAB);?></th>
<th><?php common::printOrderLink('story', $orderBy, $vars, $lang->task->story);?></th>
<th class='w-120px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php
$taskSum = $statusWait = $statusDone = $statusDoing = $statusClosed = $statusCancel = 0;
$totalEstimate = $totalConsumed = $totalLeft = 0.0;
?>
</div>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
</form>
<tbody>
<?php foreach($tasks as $task):?>
<?php $class = $task->assignedTo == $app->user->account ? 'style=color:red' : '';?>
<?php
$totalEstimate += $task->estimate;
$totalConsumed += $task->consumed;
$totalLeft += (($task->status == 'cancel' or $task->closedReason == 'cancel') ? 0 : $task->left);
$statusVar = 'status' . ucfirst($task->status);
$$statusVar ++;
?>
<tr class='a-center'>
<td>
<input type='checkbox' name='taskIDList[]' value='<?php echo $task->id;?>'/>
<?php if(!common::printLink('task', 'view', "task=$task->id", sprintf('%03d', $task->id))) printf('%03d', $task->id);?>
</td>
<td><?php echo $lang->task->priList[$task->pri];?></td>
<td class='a-left nobr'>
<?php
if($task->fromBug != 0) echo "<span class='bug'>[BUG] </span>";
else echo "<span class='task'>[TASK] </span>";
if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;
?>
</td>
<td class=<?php echo $task->status;?> >
<?php
$storyChanged = ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion);
$storyChanged ? print("<span class='warning'>{$lang->story->changed}</span> ") : print($lang->task->statusList[$task->status]);
?>
</td>
<td class=<?php if(isset($task->delay)) echo 'delayed';?>><?php if(substr($task->deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6);?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->openedDate, 5, 6);?></th>
<?php endif;?>
<td <?php echo $class;?>><?php echo $task->assignedToRealName;?></td>
<td><?php echo $users[$task->finishedBy];?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->finishedDate, 5, 6);?></th>
<?php endif;?>
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
<td class='a-left nobr'>
<?php
$story = '';
if($task->storyID and common::hasPriv('story', 'view')) $story = html::a($this->createLink('story', 'view', "storyid=$task->storyID"), $task->storyTitle);
if($task->storyID and !common::hasPriv('story', 'view')) $story = $task->storyTitle;
echo $story;
?>
</td>
<td>
<?php
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'finish', "taskID=$task->id", $lang->task->buttonDone))) echo $lang->task->buttonDone . ' ';
if(!(($task->status == 'done' or $task->status == 'cancel') and common::printLink('task', 'close', "taskID=$task->id", $lang->task->buttonClose))) echo $lang->task->buttonClose . ' ';
if(!common::printLink('task', 'edit', "taskID=$task->id", $lang->task->buttonEdit)) echo $lang->task->buttonEdit . ' ';
if($browseType == 'needconfirm') common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php $columns = $this->cookie->windowWidth > $this->config->wideSize ? 14 : 12;?>
<td colspan='<?php echo $columns;?>'>
<div class='f-left'>
<?php
if(common::hasPriv('task', 'batchEdit') and count($tasks))echo html::selectAll() . html::selectReverse() . html::submitButton($lang->task->batchEdit);
printf($lang->project->taskSummary, count($tasks), $statusWait, $statusDoing, $totalEstimate, $totalConsumed, $totalLeft);
?>
</div>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
</form>
</td>
</tr>
</table>
<script language='javascript'>
$('#project<?php echo $projectID;?>').addClass('active')
$('#<?php echo $browseType;?>Tab').addClass('active')
</script>
<?php include '../../common/view/footer.html.php';?>
+2 -1
View File
@@ -1,7 +1,8 @@
<div id='featurebar'>
<div class='f-left'>
<?php
echo "<span id='allTab'>" ; common::printLink('project', 'task', "project=$project->id", $lang->project->allTasks); echo '</span>' ;
echo "<span id='byprojectTab' onclick='browseByProject()'>"; common::printLink('project', 'task',"project=$project->id", $lang->project->projectTasks); echo '</span>';
echo "<span id='allTab'>" ; common::printLink('project', 'task', "project=$project->id&type=all", $lang->project->allTasks); echo '</span>' ;
echo "<span id='assignedtomeTab'>"; common::printLink('project', 'task', "project=$project->id&type=assignedtome", $lang->project->assignedToMe); echo '</span>' ;
echo "<span id='finishedbymeTab'>"; common::printLink('project', 'task', "project=$project->id&type=finishedbyme", $lang->project->finishedByMe); echo '</span>' ;
echo "<span id='waitTab'>" ; common::printLink('project', 'task', "project=$project->id&type=wait", $lang->project->statusWait); echo '</span>' ;
+2
View File
@@ -1 +1,3 @@
.w-220px{width:220px}
#featurebar .f-right a {padding:2px 8px}
+7 -7
View File
@@ -29,9 +29,9 @@ var moduleID = '<?php echo $moduleID;?>';
?>
</div>
<div class='f-right'>
<?php if($browseType != 'needconfirm') common::printLink('testcase', 'export', "productID=$productID&orderBy=$orderBy", $lang->export, '', 'class="export"'); ?>
<?php common::printLink('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID", $lang->testcase->batchCreate); ?>
<?php common::printLink('testcase', 'create', "productID=$productID&moduleID=$moduleID", $lang->testcase->create); ?>
<?php if($browseType != 'needconfirm') common::printLink('testcase', 'export', "productID=$productID&orderBy=$orderBy", '&nbsp;', '', "class='export icon-green-big-export' title='{$lang->testcase->export}'"); ?>
<?php common::printLink('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID", '&nbsp;', '', "class='icon-green-big-case-batchCreate' title='{$lang->testcase->batchCreate}'"); ?>
<?php common::printLink('testcase', 'create', "productID=$productID&moduleID=$moduleID", '&nbsp;', '', "class='icon-green-big-case-create' title='{$lang->testcase->create}'"); ?>
</div>
</div>
<div id='querybox' class='<?php if($browseType != 'bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
@@ -91,13 +91,13 @@ var moduleID = '<?php echo $moduleID;?>';
common::printLink('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $this->app->loadLang('testtask')->testtask->runCase, '', 'class="runcase"');
common::printLink('testtask', 'results', "runID=0&caseID=$case->id", $lang->testtask->results, '', 'class="results"');
common::printLink('testcase', 'edit', "caseID=$case->id", $lang->testcase->buttonEdit);
common::printLink('testcase', 'edit', "caseID=$case->id", '&nbsp;', '', "class='icon-green-small-edit' title='{$lang->testcase->edit}'");
common::printLink('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase&param=$case->id", $lang->copy);
common::printLink('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase&param=$case->id", '&nbsp;', '', "class='icon-green-small-copy' title='{$lang->copy}'");
common::printLink('testcase', 'delete', "caseID=$case->id", $lang->delete, 'hiddenwin');
common::printLink('testcase', 'delete', "caseID=$case->id", '&nbsp;', 'hiddenwin', "class='icon-green-small-delete' title='{$lang->delete}'");
if(!($case->lastRunResult == 'fail' and common::printLink('bug', 'create', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", $lang->testtask->createBug))) echo $lang->testtask->createBug;
if(!($case->lastRunResult == 'fail' and common::printLink('bug', 'create', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", '&nbsp;', '', "class='icon-green-small-case-createBug' title='{$lang->testtask->createBug}'"))) echo "<span class='icon-gray-small-case-createBug'>&nbsp;</span>";
?>
</td>
<?php endif;?>
+14 -14
View File
@@ -21,24 +21,24 @@
{
common::printLink('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->currentVersion", $this->app->loadLang('testtask')->testtask->runCase, '', 'class="runcase"');
common::printLink('testtask', 'results', "runID=0&caseID=$case->id&version=$case->version", $lang->testtask->results, '', 'class="results"');
echo "<span class='icon-green-big-splitLine'></span>";
if($case->lastRunResult == 'fail') common::printLink('bug', 'create', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", $lang->testtask->createBug);
common::printLink('testcase', 'edit', "caseID=$case->id", '&nbsp;', '', "class='icon-edit'");
if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-comment' onclick='setComment()'");
common::printLink('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase&param=$case->id", '&nbsp;', '', "class='icon-copy'");
common::printLink('testcase', 'delete', "caseID=$case->id", '&nbsp;', 'hiddenwin', "class='icon-delete'");
common::printLink('testcase', 'edit', "caseID=$case->id", '&nbsp;', '', "class='icon-green-big-edit' title={$lang->testcase->edit}");
if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' title={$lang->comment} onclick='setComment()'");
common::printLink('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase&param=$case->id", '&nbsp;', '', "class='icon-green-big-copy' title={$lang->copy}");
common::printLink('testcase', 'delete', "caseID=$case->id", '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title={$lang->delete}");
echo "<span class='icon-green-big-splitLine'></span>";
}
echo html::a($browseLink, '&nbsp;', '', "class='icon-goback'");
echo html::a($browseLink, '&nbsp;', '', "class='icon-green-big-goback' title={$lang->goback}");
if($preAndNext->pre)
{
echo html::a($this->inLink('view', "storyID={$preAndNext->pre->id}&version={$preAndNext->pre->version}"), '&nbsp;', '', "class='icon-pre' id='pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'");
echo html::a($this->inLink('view', "storyID={$preAndNext->pre->id}&version={$preAndNext->pre->version}"), '&nbsp;', '', "class='icon-green-big-pre' id='pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'");
}
if($preAndNext->next)
{
echo html::a($this->inLink('view', "storyID={$preAndNext->next->id}&version={$preAndNext->next->version}"), '&nbsp;', '', "class='icon-next' id='next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}'");
echo html::a($this->inLink('view', "storyID={$preAndNext->next->id}&version={$preAndNext->next->version}"), '&nbsp;', '', "class='icon-green-big-next' id='next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}'");
}
?>
</div>
@@ -74,12 +74,12 @@
<?php
if(!$case->deleted)
{
common::printLink('testcase', 'edit', "caseID=$case->id", '&nbsp;', '', "class='icon-edit'");
if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-comment' onclick='setComment()'");
common::printLink('testcase', 'delete', "caseID=$case->id", '&nbsp;', 'hiddenwin', "class='icon-delete'");
common::printLink('testcase', 'edit', "caseID=$case->id", '&nbsp;', '', "class='icon-green-big-edit' title={$lang->testcase->edit}");
if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' title={$lang->comment} onclick='setComment()'");
common::printLink('testcase', 'delete', "caseID=$case->id", '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title={$lang->delete}");
echo "<span class='icon-green-big-splitLine'></span>";
}
echo html::a($browseLink, '&nbsp;', '', "class='icon-goback'");
echo html::a($browseLink, '&nbsp;', '', "class='icon-green-big-goback'");
?>
</div>
<div id='comment' class='hidden'>