* finish task#1560.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-12 02:51:33 +00:00
parent 67a49f076b
commit d4818f9ea1
5 changed files with 60 additions and 19 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ $lang->my->menu->index = 'Index|my|index';
$lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo');
$lang->my->menu->task = array('link' => 'Task|my|task|', 'subModule' => 'task');
$lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug');
$lang->my->menu->testtask = array('link' => 'Test|my|testtask|', 'alias' => 'testcase');
$lang->my->menu->testtask = array('link' => 'Test|my|testtask|', 'subModule' => 'testcase', 'alias' => 'testcase');
$lang->my->menu->story = 'Story|my|story|';
$lang->my->menu->myProject = 'Project|my|project|';
$lang->my->menu->dynamic = 'Dynamic|my|dynamic|';
+1 -1
View File
@@ -139,7 +139,7 @@ $lang->my->menu->index = '首页|my|index';
$lang->my->menu->todo = array('link' => '待办|my|todo|', 'subModule' => 'todo');
$lang->my->menu->task = array('link' => '任务|my|task|', 'subModule' => 'task');
$lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug');
$lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'alias' => 'testcase');
$lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'subModule' => 'testcase', 'alias' => 'testcase');
$lang->my->menu->story = '需求|my|story|';
$lang->my->menu->myProject = '项目|my|project|';
$lang->my->menu->dynamic = '动态|my|dynamic|';
+30 -2
View File
@@ -24,6 +24,7 @@
</div>
<?php $vars = "type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<form method='post' id='myCaseForm'>
<table class='table-1 fixed tablesorter colored'>
<?php
$vars = "type=$type&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID";
@@ -44,9 +45,16 @@
</tr>
</thead>
<tbody>
<?php
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
?>
<?php foreach($cases as $case):?>
<tr class='a-center'>
<td><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), sprintf('%03d', $case->id));?></td>
<td>
<?php if($canBatchEdit or $canBatchRun):?><input type='checkbox' name='caseIDList[]' value='<?php echo $case->id;?>'/><?php endif;?>
<?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), sprintf('%03d', $case->id));?>
</td>
<td><span class='<?php echo 'pri' . $case->pri?>'><?php echo $case->pri?></span</td>
<td class='a-left'><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), $case->title);?></td>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
@@ -68,7 +76,27 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='10'><?php $pager->show();?></td></tr></tfoot>
<tfoot>
<tr>
<td colspan='10'>
<?php if($cases):?>
<div class='f-left'>
<?php
if($canBatchEdit or $canBatchRun) echo html::selectAll() . html::selectReverse();
if($canBatchEdit)
{
$actionLink = $this->createLink('testcase', 'batchEdit');
echo html::submitButton($lang->edit, "onclick=changeAction('myCaseForm','batchEdit','$actionLink')");
}
if($canBatchRun) echo html::submitButton($lang->testtask->runCase, "onclick='changeAction(\"" . $this->createLink('testtask', 'batchRun', "productID=0&orderBy=$orderBy") . "\")'");
?>
</div>
<?php endif?>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
</form>
<script language="Javascript">$("#<?php echo $type;?>Tab").addClass('active'); </script>
<?php include '../../common/view/footer.html.php';?>
+27 -15
View File
@@ -438,16 +438,31 @@ class testcase extends control
die(js::locate($this->session->caseList, 'parent'));
}
/* Init vars. */
$caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent'));
$product = $this->product->getByID($productID);
/* Get all cases. */
$caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent'));
/* Get the edited cases. */
$cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIDList)->fetchAll('id');
/* Set product menu. */
$this->testcase->setMenu($this->products, $productID);
/* The cases of a product. */
if($productID)
{
$this->testcase->setMenu($this->products, $productID);
$product = $this->product->getByID($productID);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
}
/* The cases of my. */
else
{
$this->lang->testcase->menu = $this->lang->my->menu;
$this->lang->set('menugroup.testcase', 'my');
$this->lang->testcase->menuOrder = $this->lang->my->menuOrder;
$this->loadModel('my')->setMenu();
$this->view->title = $this->lang->testcase->batchEdit;
}
/* Judge whether the editedTasks is too large and set session. */
$showSuhosinInfo = false;
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($cases), $this->config->testcase->batchEdit->columns);
@@ -455,14 +470,11 @@ class testcase extends control
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
/* Assign. */
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
$this->view->caseIDList = $caseIDList;
$this->view->productID = $productID;
$this->view->cases = $cases;
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
$this->view->caseIDList = $caseIDList;
$this->view->productID = $productID;
$this->view->cases = $cases;
$this->display();
}
+1
View File
@@ -24,6 +24,7 @@
<th class='w-340px'><?php echo $lang->testcase->stage;?></th>
</tr>
<?php foreach($caseIDList as $caseID):?>
<?php if(!$productID) $moduleOptionMenu = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0); ?>
<tr class='a-center'>
<td><?php echo $caseID . html::hidden("caseIDList[$caseID]", $caseID);?></td>
<td><?php echo html::select("pris[$caseID]", $lang->testcase->priList, $cases[$caseID]->pri, 'class=select-1');?></td>