* convert to unix format.

This commit is contained in:
wangchunsheng
2012-02-21 07:22:58 +00:00
parent f1dfdf6ea0
commit 65e19fa8a8
389 changed files with 55211 additions and 55211 deletions
+471 -471
View File
@@ -1,471 +1,471 @@
<?php
/**
* The control file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
class testtask extends control
{
private $products = array();
/**
* Construct function, load product module, assign products to view auto.
*
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
$this->loadModel('product');
$this->view->products = $this->products = $this->product->getPairs();
}
/**
* Index page, header to browse.
*
* @access public
* @return void
*/
public function index()
{
$this->locate($this->createLink('testtask', 'browse'));
}
/**
* Browse test tasks.
*
* @param int $productID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($productID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$this->session->set('testtaskList', $this->app->getURI(true));
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->testtask->setMenu($this->products, $productID);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->pager = $pager;
$this->view->orderBy = $orderBy;
$this->view->tasks = $this->testtask->getProductTasks($productID);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();
}
/**
* Create a test task.
*
* @param int $productID
* @access public
* @return void
*/
public function create($productID, $projectID = 0, $build = 0)
{
if(!empty($_POST))
{
$taskID = $this->testtask->create();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('testtask', $taskID, 'opened');
die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent'));
}
/* Create testtask from build of project.*/
if($projectID != 0 and $build != 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->eq($build)->fetchPairs('id');
}
/* Create testtask from testtask of project.*/
if($projectID != 0 and $build == 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('project')->eq($projectID)->fetchPairs('id');
}
/* Create testtask from testtask of test.*/
if($projectID == 0)
{
$projects = $this->product->getProjectPairs($productID, $params = 'nodeleted');
$builds = $this->loadModel('build')->getProductBuildPairs($productID);
}
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->create;
if($projectID != 0)
{
$this->view->products = $products;
$this->view->projectID = $projectID;
}
$this->view->projects = $projects;
$this->view->productID = $productID;
$this->view->builds = $builds;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->display();
}
/**
* View a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function view($taskID)
{
/* Get test task, and set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->view;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->view;
$this->view->productID = $productID;
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->actions = $this->loadModel('action')->getList('testtask', $taskID);
$this->display();
}
/**
* Browse cases of a test task.
*
* @param int $taskID
* @param string $browseType bymodule|all|assignedtome
* @param int $param
* @access public
* @return void
*/
public function cases($taskID, $browseType = 'byModule', $param = 0)
{
/* Save the session. */
$this->app->loadLang('testcase');
$this->session->set('caseList', $this->app->getURI(true));
/* Set the browseType and moduleID. */
$browseType = strtolower($browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : 0;
/* Get task and product info, set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID);
if($browseType == 'bymodule' or $browseType == 'all')
{
$modules = '';
if($moduleID) $modules = $this->loadModel('tree')->getAllChildID($moduleID);
$this->view->runs = $this->testtask->getRuns($taskID, $modules);
}
elseif($browseType == 'assignedtome')
{
$this->view->runs = $this->testtask->getUserRuns($taskID, $this->session->user->account);
}
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->cases;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID);
$this->view->browseType = $browseType;
$this->view->taskID = $taskID;
$this->view->moduleID = $moduleID;
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
$this->display();
}
/**
* Edit a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function edit($taskID)
{
if(!empty($_POST))
{
$changes = $this->testtask->update($taskID);
if(dao::isError()) die(js::error(dao::getError()));
if($changes)
{
$actionID = $this->loadModel('action')->create('testtask', $taskID, 'edited');
$this->action->logHistory($actionID, $changes);
}
die(js::locate(inlink('view', "taskID=$taskID"), 'parent'));
}
/* Get task info. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Set menu. */
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->edit;
$this->view->task = $task;
$this->view->projects = $this->product->getProjectPairs($productID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->users = $this->loadModel('user')->getPairs();
$this->display();
}
/**
* Delete a test task.
*
* @param int $taskID
* @param string $confirm yes|no
* @access public
* @return void
*/
public function delete($taskID, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->testtask->confirmDelete, inlink('delete', "taskID=$taskID&confirm=yes")));
}
else
{
$task = $this->testtask->getByID($taskID);
$this->testtask->delete(TABLE_TESTTASK, $taskID);
die(js::locate(inlink('browse', "product=$task->product"), 'parent'));
}
}
/**
* Link cases to a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function linkCase($taskID, $param = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if(!empty($_POST))
{
$this->testtask->linkCase($taskID);
$this->locate(inlink('cases', "taskID=$taskID"));
}
/* Save session. */
$this->session->set('caseList', $this->app->getURI(true));
/* Get task and product id. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Build the search form. */
$this->loadModel('testcase');
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID");
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
/* Save session. */
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->linkCase;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->linkCase;
/* Get cases. */
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
$query = str_replace("`product` = 'all'", '1', $this->session->testcaseQuery); // If search all product, replace product = all to 1=1
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
if($param == 'all')
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->andWhere('id')->notIN($linkedCases)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
if($param == 'bystory')
{
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->andWhere('story')->in($stories)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
if($param == 'bybug')
{
$bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->andWhere('fromBug')->in($bugs)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->cases = $cases;
$this->view->taskID = $taskID;
$this->view->pager = $pager;
$this->display();
}
/**
* Remove a case from test task.
*
* @param int $rowID
* @access public
* @return void
*/
public function unlinkCase($rowID)
{
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
die(js::reload('parent'));
}
/**
* Run case.
*
* @param int $runID
* @param String $extras others params, forexample, caseID=10, version=3
* @access public
* @return void
*/
public function runCase($runID, $caseID = 0, $version = 0)
{
if(!empty($_POST))
{
$this->testtask->createResult($runID);
if(dao::isError()) die(js::error(dao::getError()));
echo js::reload('parent');
die(js::closeWindow());
}
if(!$caseID) $run = $this->testtask->getRunById($runID);
if($caseID) $run->case = $this->loadModel('testcase')->getById($caseID, $version);
$this->view->run = $run;
die($this->display());
}
/**
* View test results of a test run.
*
* @param int $runID
* @param int $caseID
* @access public
* @return void
*/
public function results($runID, $caseID = 0, $version = 0)
{
if($caseID)
{
$this->view->case = $this->loadModel('testcase')->getByID($caseID, $version);
$this->view->results = $this->testtask->getResults(0, $caseID);
}
else
{
$this->view->case = $this->testtask->getRunById($runID)->case;
$this->view->results = $this->testtask->getResults($runID);
}
$this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
die($this->display());
}
/**
* Batch assign cases.
*
* @param int $taskID
* @access public
* @return void
*/
public function batchAssign($taskID)
{
$this->dao->update(TABLE_TESTRUN)
->set('assignedTo')->eq($this->post->assignedTo)
->where('task')->eq((int)$taskID)
->andWhere('`case`')->in($this->post->cases)
->exec();
die(js::reload('parent'));
}
}
<?php
/**
* The control file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
class testtask extends control
{
private $products = array();
/**
* Construct function, load product module, assign products to view auto.
*
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
$this->loadModel('product');
$this->view->products = $this->products = $this->product->getPairs();
}
/**
* Index page, header to browse.
*
* @access public
* @return void
*/
public function index()
{
$this->locate($this->createLink('testtask', 'browse'));
}
/**
* Browse test tasks.
*
* @param int $productID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function browse($productID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$this->session->set('testtaskList', $this->app->getURI(true));
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->testtask->setMenu($this->products, $productID);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->pager = $pager;
$this->view->orderBy = $orderBy;
$this->view->tasks = $this->testtask->getProductTasks($productID);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();
}
/**
* Create a test task.
*
* @param int $productID
* @access public
* @return void
*/
public function create($productID, $projectID = 0, $build = 0)
{
if(!empty($_POST))
{
$taskID = $this->testtask->create();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('testtask', $taskID, 'opened');
die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent'));
}
/* Create testtask from build of project.*/
if($projectID != 0 and $build != 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->eq($build)->fetchPairs('id');
}
/* Create testtask from testtask of project.*/
if($projectID != 0 and $build == 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('project')->eq($projectID)->fetchPairs('id');
}
/* Create testtask from testtask of test.*/
if($projectID == 0)
{
$projects = $this->product->getProjectPairs($productID, $params = 'nodeleted');
$builds = $this->loadModel('build')->getProductBuildPairs($productID);
}
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->create;
if($projectID != 0)
{
$this->view->products = $products;
$this->view->projectID = $projectID;
}
$this->view->projects = $projects;
$this->view->productID = $productID;
$this->view->builds = $builds;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->display();
}
/**
* View a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function view($taskID)
{
/* Get test task, and set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->view;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->view;
$this->view->productID = $productID;
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->actions = $this->loadModel('action')->getList('testtask', $taskID);
$this->display();
}
/**
* Browse cases of a test task.
*
* @param int $taskID
* @param string $browseType bymodule|all|assignedtome
* @param int $param
* @access public
* @return void
*/
public function cases($taskID, $browseType = 'byModule', $param = 0)
{
/* Save the session. */
$this->app->loadLang('testcase');
$this->session->set('caseList', $this->app->getURI(true));
/* Set the browseType and moduleID. */
$browseType = strtolower($browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : 0;
/* Get task and product info, set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID);
if($browseType == 'bymodule' or $browseType == 'all')
{
$modules = '';
if($moduleID) $modules = $this->loadModel('tree')->getAllChildID($moduleID);
$this->view->runs = $this->testtask->getRuns($taskID, $modules);
}
elseif($browseType == 'assignedtome')
{
$this->view->runs = $this->testtask->getUserRuns($taskID, $this->session->user->account);
}
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->cases;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID);
$this->view->browseType = $browseType;
$this->view->taskID = $taskID;
$this->view->moduleID = $moduleID;
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
$this->display();
}
/**
* Edit a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function edit($taskID)
{
if(!empty($_POST))
{
$changes = $this->testtask->update($taskID);
if(dao::isError()) die(js::error(dao::getError()));
if($changes)
{
$actionID = $this->loadModel('action')->create('testtask', $taskID, 'edited');
$this->action->logHistory($actionID, $changes);
}
die(js::locate(inlink('view', "taskID=$taskID"), 'parent'));
}
/* Get task info. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Set menu. */
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->edit;
$this->view->task = $task;
$this->view->projects = $this->product->getProjectPairs($productID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->users = $this->loadModel('user')->getPairs();
$this->display();
}
/**
* Delete a test task.
*
* @param int $taskID
* @param string $confirm yes|no
* @access public
* @return void
*/
public function delete($taskID, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->testtask->confirmDelete, inlink('delete', "taskID=$taskID&confirm=yes")));
}
else
{
$task = $this->testtask->getByID($taskID);
$this->testtask->delete(TABLE_TESTTASK, $taskID);
die(js::locate(inlink('browse', "product=$task->product"), 'parent'));
}
}
/**
* Link cases to a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function linkCase($taskID, $param = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if(!empty($_POST))
{
$this->testtask->linkCase($taskID);
$this->locate(inlink('cases', "taskID=$taskID"));
}
/* Save session. */
$this->session->set('caseList', $this->app->getURI(true));
/* Get task and product id. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Build the search form. */
$this->loadModel('testcase');
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID");
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
/* Save session. */
$this->testtask->setMenu($this->products, $productID);
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->linkCase;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->linkCase;
/* Get cases. */
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
$query = str_replace("`product` = 'all'", '1', $this->session->testcaseQuery); // If search all product, replace product = all to 1=1
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
if($param == 'all')
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->andWhere('id')->notIN($linkedCases)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
if($param == 'bystory')
{
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->andWhere('story')->in($stories)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
if($param == 'bybug')
{
$bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->andWhere('product')->eq($productID)
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
->andWhere('fromBug')->in($bugs)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
->fetchAll();
}
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->cases = $cases;
$this->view->taskID = $taskID;
$this->view->pager = $pager;
$this->display();
}
/**
* Remove a case from test task.
*
* @param int $rowID
* @access public
* @return void
*/
public function unlinkCase($rowID)
{
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
die(js::reload('parent'));
}
/**
* Run case.
*
* @param int $runID
* @param String $extras others params, forexample, caseID=10, version=3
* @access public
* @return void
*/
public function runCase($runID, $caseID = 0, $version = 0)
{
if(!empty($_POST))
{
$this->testtask->createResult($runID);
if(dao::isError()) die(js::error(dao::getError()));
echo js::reload('parent');
die(js::closeWindow());
}
if(!$caseID) $run = $this->testtask->getRunById($runID);
if($caseID) $run->case = $this->loadModel('testcase')->getById($caseID, $version);
$this->view->run = $run;
die($this->display());
}
/**
* View test results of a test run.
*
* @param int $runID
* @param int $caseID
* @access public
* @return void
*/
public function results($runID, $caseID = 0, $version = 0)
{
if($caseID)
{
$this->view->case = $this->loadModel('testcase')->getByID($caseID, $version);
$this->view->results = $this->testtask->getResults(0, $caseID);
}
else
{
$this->view->case = $this->testtask->getRunById($runID)->case;
$this->view->results = $this->testtask->getResults($runID);
}
$this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
die($this->display());
}
/**
* Batch assign cases.
*
* @param int $taskID
* @access public
* @return void
*/
public function batchAssign($taskID)
{
$this->dao->update(TABLE_TESTRUN)
->set('assignedTo')->eq($this->post->assignedTo)
->where('task')->eq((int)$taskID)
->andWhere('`case`')->in($this->post->cases)
->exec();
die(js::reload('parent'));
}
}
+66 -66
View File
@@ -1,66 +1,66 @@
<?php
/**
* The testtask module English file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
$lang->testtask->index = "Index";
$lang->testtask->create = "Create";
$lang->testtask->delete = "Delete";
$lang->testtask->view = "Info";
$lang->testtask->edit = "Edit";
$lang->testtask->browse = "Browse";
$lang->testtask->linkCase = "Link case";
$lang->testtask->linkCaseAB = "Link";
$lang->testtask->unlinkCase = "Remove";
$lang->testtask->batchAssign = "Batch Assign";
$lang->testtask->runCase = "Run";
$lang->testtask->results = "Result";
$lang->testtask->createBug = "Create bug";
$lang->testtask->assign = 'Assign';
$lang->testtask->cases = 'Cases';
$lang->testtask->common = 'Test task';
$lang->testtask->id = 'ID';
$lang->testtask->product = 'Product';
$lang->testtask->project = 'Project';
$lang->testtask->build = 'Build';
$lang->testtask->owner = 'Owner';
$lang->testtask->name = 'Name';
$lang->testtask->begin = 'Begin';
$lang->testtask->end = 'End';
$lang->testtask->desc = 'Desc';
$lang->testtask->status = 'Status';
$lang->testtask->assignedTo = 'Assigned to';
$lang->testtask->linkVersion = 'Link(version)';
$lang->testtask->lastRunAccount = "Run account";
$lang->testtask->lastRunTime = 'Last run';
$lang->testtask->lastRunResult = 'Last result';
$lang->testtask->statusList['wait'] = 'Pending';
$lang->testtask->statusList['doing'] = 'In progress';
$lang->testtask->statusList['done'] = 'Done';
$lang->testtask->statusList['blocked'] = 'Blocked';
$lang->testtask->unlinkedCases = 'Unlinked cases';
$lang->testtask->linkedCases = 'Linked cases';
$lang->testtask->linkByStory = 'Link by story';
$lang->testtask->linkByBug = 'Link by bug';
$lang->testtask->confirmDelete = 'Are you sure to delete this test task?';
$lang->testtask->passAll = 'Pass all';
$lang->testtask->pass = 'Pass';
$lang->testtask->fail = 'Fail';
$lang->testtask->byModule = 'By module';
$lang->testtask->assignedToMe = 'Assgined to me';
$lang->testtask->allCases = 'All Cases';
$lang->testtask->lblCases = 'Case list';
$lang->testtask->lblUnlinkCase = 'Remove case';
$lang->testtask->lblRunCase = 'Run';
$lang->testtask->lblResults = 'Result';
<?php
/**
* The testtask module English file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
$lang->testtask->index = "Index";
$lang->testtask->create = "Create";
$lang->testtask->delete = "Delete";
$lang->testtask->view = "Info";
$lang->testtask->edit = "Edit";
$lang->testtask->browse = "Browse";
$lang->testtask->linkCase = "Link case";
$lang->testtask->linkCaseAB = "Link";
$lang->testtask->unlinkCase = "Remove";
$lang->testtask->batchAssign = "Batch Assign";
$lang->testtask->runCase = "Run";
$lang->testtask->results = "Result";
$lang->testtask->createBug = "Create bug";
$lang->testtask->assign = 'Assign';
$lang->testtask->cases = 'Cases';
$lang->testtask->common = 'Test task';
$lang->testtask->id = 'ID';
$lang->testtask->product = 'Product';
$lang->testtask->project = 'Project';
$lang->testtask->build = 'Build';
$lang->testtask->owner = 'Owner';
$lang->testtask->name = 'Name';
$lang->testtask->begin = 'Begin';
$lang->testtask->end = 'End';
$lang->testtask->desc = 'Desc';
$lang->testtask->status = 'Status';
$lang->testtask->assignedTo = 'Assigned to';
$lang->testtask->linkVersion = 'Link(version)';
$lang->testtask->lastRunAccount = "Run account";
$lang->testtask->lastRunTime = 'Last run';
$lang->testtask->lastRunResult = 'Last result';
$lang->testtask->statusList['wait'] = 'Pending';
$lang->testtask->statusList['doing'] = 'In progress';
$lang->testtask->statusList['done'] = 'Done';
$lang->testtask->statusList['blocked'] = 'Blocked';
$lang->testtask->unlinkedCases = 'Unlinked cases';
$lang->testtask->linkedCases = 'Linked cases';
$lang->testtask->linkByStory = 'Link by story';
$lang->testtask->linkByBug = 'Link by bug';
$lang->testtask->confirmDelete = 'Are you sure to delete this test task?';
$lang->testtask->passAll = 'Pass all';
$lang->testtask->pass = 'Pass';
$lang->testtask->fail = 'Fail';
$lang->testtask->byModule = 'By module';
$lang->testtask->assignedToMe = 'Assgined to me';
$lang->testtask->allCases = 'All Cases';
$lang->testtask->lblCases = 'Case list';
$lang->testtask->lblUnlinkCase = 'Remove case';
$lang->testtask->lblRunCase = 'Run';
$lang->testtask->lblResults = 'Result';
+66 -66
View File
@@ -1,66 +1,66 @@
<?php
/**
* The testtask module zh-cn file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
$lang->testtask->index = "测试任务首页";
$lang->testtask->create = "创建测试任务";
$lang->testtask->delete = "删除测试任务";
$lang->testtask->view = "详情";
$lang->testtask->edit = "编辑测试任务";
$lang->testtask->browse = "测试任务列表";
$lang->testtask->linkCase = "关联用例";
$lang->testtask->linkCaseAB = "关联";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchAssign = "批量指派";
$lang->testtask->runCase = "执行";
$lang->testtask->results = "结果";
$lang->testtask->createBug = "创建Bug";
$lang->testtask->assign = '指派';
$lang->testtask->cases = '用例';
$lang->testtask->common = '测试任务';
$lang->testtask->id = '任务编号';
$lang->testtask->product = '所属产品';
$lang->testtask->project = '所属项目';
$lang->testtask->build = 'Build';
$lang->testtask->owner = '负责人';
$lang->testtask->name = '任务名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->desc = '任务描述';
$lang->testtask->status = '当前状态';
$lang->testtask->assignedTo = '指派给';
$lang->testtask->linkVersion = '关联(版本)';
$lang->testtask->lastRunAccount = '最后执行人';
$lang->testtask->lastRunTime = '最后执行时间';
$lang->testtask->lastRunResult = '最终结果';
$lang->testtask->statusList['wait'] = '未开始';
$lang->testtask->statusList['doing'] = '进行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['blocked'] = '被阻塞';
$lang->testtask->unlinkedCases = '未关联用例列表';
$lang->testtask->linkedCases = '已关联用例列表';
$lang->testtask->linkByStory = '按需求关联用例';
$lang->testtask->linkByBug = '按Bug关联用例';
$lang->testtask->confirmDelete = '您确认要删除该测试任务吗?';
$lang->testtask->passAll = '全部通过';
$lang->testtask->pass = '通过';
$lang->testtask->fail = '失败';
$lang->testtask->byModule = '按模块';
$lang->testtask->assignedToMe = '指派给我';
$lang->testtask->allCases = '所有Case';
$lang->testtask->lblCases = '用例列表';
$lang->testtask->lblUnlinkCase = '移除用例';
$lang->testtask->lblRunCase = '执行用例';
$lang->testtask->lblResults = '执行结果';
<?php
/**
* The testtask module zh-cn file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
$lang->testtask->index = "测试任务首页";
$lang->testtask->create = "创建测试任务";
$lang->testtask->delete = "删除测试任务";
$lang->testtask->view = "详情";
$lang->testtask->edit = "编辑测试任务";
$lang->testtask->browse = "测试任务列表";
$lang->testtask->linkCase = "关联用例";
$lang->testtask->linkCaseAB = "关联";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchAssign = "批量指派";
$lang->testtask->runCase = "执行";
$lang->testtask->results = "结果";
$lang->testtask->createBug = "创建Bug";
$lang->testtask->assign = '指派';
$lang->testtask->cases = '用例';
$lang->testtask->common = '测试任务';
$lang->testtask->id = '任务编号';
$lang->testtask->product = '所属产品';
$lang->testtask->project = '所属项目';
$lang->testtask->build = 'Build';
$lang->testtask->owner = '负责人';
$lang->testtask->name = '任务名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->desc = '任务描述';
$lang->testtask->status = '当前状态';
$lang->testtask->assignedTo = '指派给';
$lang->testtask->linkVersion = '关联(版本)';
$lang->testtask->lastRunAccount = '最后执行人';
$lang->testtask->lastRunTime = '最后执行时间';
$lang->testtask->lastRunResult = '最终结果';
$lang->testtask->statusList['wait'] = '未开始';
$lang->testtask->statusList['doing'] = '进行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['blocked'] = '被阻塞';
$lang->testtask->unlinkedCases = '未关联用例列表';
$lang->testtask->linkedCases = '已关联用例列表';
$lang->testtask->linkByStory = '按需求关联用例';
$lang->testtask->linkByBug = '按Bug关联用例';
$lang->testtask->confirmDelete = '您确认要删除该测试任务吗?';
$lang->testtask->passAll = '全部通过';
$lang->testtask->pass = '通过';
$lang->testtask->fail = '失败';
$lang->testtask->byModule = '按模块';
$lang->testtask->assignedToMe = '指派给我';
$lang->testtask->allCases = '所有Case';
$lang->testtask->lblCases = '用例列表';
$lang->testtask->lblUnlinkCase = '移除用例';
$lang->testtask->lblRunCase = '执行用例';
$lang->testtask->lblResults = '执行结果';
+66 -66
View File
@@ -1,66 +1,66 @@
<?php
/**
* The testtask module zh-tw file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id: zh-tw.php 2570 2012-02-10 01:31:52Z shiyangyangwork@yahoo.cn $
* @link http://www.zentao.net
*/
$lang->testtask->index = "測試任務首頁";
$lang->testtask->create = "創建測試任務";
$lang->testtask->delete = "刪除測試任務";
$lang->testtask->view = "詳情";
$lang->testtask->edit = "編輯測試任務";
$lang->testtask->browse = "測試任務列表";
$lang->testtask->linkCase = "關聯用例";
$lang->testtask->linkCaseAB = "關聯";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchAssign = "批量指派";
$lang->testtask->runCase = "執行";
$lang->testtask->results = "結果";
$lang->testtask->createBug = "創建Bug";
$lang->testtask->assign = '指派';
$lang->testtask->cases = '用例';
$lang->testtask->common = '測試任務';
$lang->testtask->id = '任務編號';
$lang->testtask->product = '所屬產品';
$lang->testtask->project = '所屬項目';
$lang->testtask->build = 'Build';
$lang->testtask->owner = '負責人';
$lang->testtask->name = '任務名稱';
$lang->testtask->begin = '開始日期';
$lang->testtask->end = '結束日期';
$lang->testtask->desc = '任務描述';
$lang->testtask->status = '當前狀態';
$lang->testtask->assignedTo = '指派給';
$lang->testtask->linkVersion = '關聯(版本)';
$lang->testtask->lastRunAccount = '最後執行人';
$lang->testtask->lastRunTime = '最後執行時間';
$lang->testtask->lastRunResult = '最終結果';
$lang->testtask->statusList['wait'] = '未開始';
$lang->testtask->statusList['doing'] = '進行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['blocked'] = '被阻塞';
$lang->testtask->unlinkedCases = '未關聯用例列表';
$lang->testtask->linkedCases = '已關聯用例列表';
$lang->testtask->linkByStory = '按需求關聯用例';
$lang->testtask->linkByBug = '按Bug關聯用例';
$lang->testtask->confirmDelete = '您確認要刪除該測試任務嗎?';
$lang->testtask->passAll = '全部通過';
$lang->testtask->pass = '通過';
$lang->testtask->fail = '失敗';
$lang->testtask->byModule = '按模組';
$lang->testtask->assignedToMe = '指派給我';
$lang->testtask->allCases = '所有Case';
$lang->testtask->lblCases = '用例列表';
$lang->testtask->lblUnlinkCase = '移除用例';
$lang->testtask->lblRunCase = '執行用例';
$lang->testtask->lblResults = '執行結果';
<?php
/**
* The testtask module zh-tw file of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id: zh-tw.php 2570 2012-02-10 01:31:52Z shiyangyangwork@yahoo.cn $
* @link http://www.zentao.net
*/
$lang->testtask->index = "測試任務首頁";
$lang->testtask->create = "創建測試任務";
$lang->testtask->delete = "刪除測試任務";
$lang->testtask->view = "詳情";
$lang->testtask->edit = "編輯測試任務";
$lang->testtask->browse = "測試任務列表";
$lang->testtask->linkCase = "關聯用例";
$lang->testtask->linkCaseAB = "關聯";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchAssign = "批量指派";
$lang->testtask->runCase = "執行";
$lang->testtask->results = "結果";
$lang->testtask->createBug = "創建Bug";
$lang->testtask->assign = '指派';
$lang->testtask->cases = '用例';
$lang->testtask->common = '測試任務';
$lang->testtask->id = '任務編號';
$lang->testtask->product = '所屬產品';
$lang->testtask->project = '所屬項目';
$lang->testtask->build = 'Build';
$lang->testtask->owner = '負責人';
$lang->testtask->name = '任務名稱';
$lang->testtask->begin = '開始日期';
$lang->testtask->end = '結束日期';
$lang->testtask->desc = '任務描述';
$lang->testtask->status = '當前狀態';
$lang->testtask->assignedTo = '指派給';
$lang->testtask->linkVersion = '關聯(版本)';
$lang->testtask->lastRunAccount = '最後執行人';
$lang->testtask->lastRunTime = '最後執行時間';
$lang->testtask->lastRunResult = '最終結果';
$lang->testtask->statusList['wait'] = '未開始';
$lang->testtask->statusList['doing'] = '進行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['blocked'] = '被阻塞';
$lang->testtask->unlinkedCases = '未關聯用例列表';
$lang->testtask->linkedCases = '已關聯用例列表';
$lang->testtask->linkByStory = '按需求關聯用例';
$lang->testtask->linkByBug = '按Bug關聯用例';
$lang->testtask->confirmDelete = '您確認要刪除該測試任務嗎?';
$lang->testtask->passAll = '全部通過';
$lang->testtask->pass = '通過';
$lang->testtask->fail = '失敗';
$lang->testtask->byModule = '按模組';
$lang->testtask->assignedToMe = '指派給我';
$lang->testtask->allCases = '所有Case';
$lang->testtask->lblCases = '用例列表';
$lang->testtask->lblUnlinkCase = '移除用例';
$lang->testtask->lblRunCase = '執行用例';
$lang->testtask->lblResults = '執行結果';
+345 -345
View File
@@ -1,345 +1,345 @@
<?php
/**
* The model file of test task module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
class testtaskModel extends model
{
/**
* Set the menu.
*
* @param array $products
* @param int $productID
* @access public
* @return void
*/
public function setMenu($products, $productID)
{
$this->loadModel('product')->setMenu($products, $productID);
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browse');
foreach($this->lang->testtask->menu as $key => $value)
{
$replace = ($key == 'product') ? $selectHtml . $this->lang->arrow: $productID;
common::setMenuVars($this->lang->testtask->menu, $key, $replace);
}
}
/**
* Create a test task.
*
* @param int $productID
* @access public
* @return void
*/
function create()
{
$task = fixer::input('post')
->stripTags('name')
->get();
$this->dao->insert(TABLE_TESTTASK)->data($task)->autoCheck()->batchcheck($this->config->testtask->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
/**
* Get test tasks of a product.
*
* @param int $productID
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getProductTasks($productID, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->where('t1.product')->eq((int)$productID)
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
->fetchAll();
}
/**
* Get test tasks of a project.
*
* @param int $projectID
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getProjectTasks($projectID, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id')
->where('t1.project')->eq((int)$projectID)
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
->fetchAll();
}
/**
* Get test task info by id.
*
* @param int $taskID
* @access public
* @return void
*/
public function getById($taskID)
{
$task = $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->where('t1.id')->eq((int)$taskID)->fetch();
$task->desc = $this->loadModel('file')->setImgSize($task->desc);
return $task;
}
/**
* Get test tasks by user.
*
* @param string $account
* @access public
* @return array
*/
public function getByUser($account)
{
return $this->dao->select('t1.*, t2.name AS projectName, t3.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
->where('t1.deleted')->eq(0)
->andWhere('t1.owner')->eq($account)
->orderBy('id desc')
->fetchAll();
}
/**
* Update a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function update($taskID)
{
$oldTask = $this->getById($taskID);
$task = fixer::input('post')->stripTags('name')->get();
$this->dao->update(TABLE_TESTTASK)->data($task)->autoCheck()->batchcheck($this->config->testtask->edit->requiredFields, 'notempty')->where('id')->eq($taskID)->exec();
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
/**
* Link cases.
*
* @param int $taskID
* @access public
* @return void
*/
public function linkCase($taskID)
{
if($this->post->cases == false) return;
foreach($this->post->cases as $caseID)
{
$row->task = $taskID;
$row->case = $caseID;
$row->version = $this->post->versions[$caseID];
$row->assignedTo = '';
$row->status = 'wait';
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
}
}
/**
* Get test runs of a test task.
*
* @param int $taskID
* @param int $moduleID
* @access public
* @return array
*/
public function getRuns($taskID, $moduleID)
{
return $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq((int)$taskID)
->beginIF($moduleID)->andWhere('t2.module')->in($moduleID)->fi()
->fetchAll();
}
/**
* Get test runs of a user.
*
* @param int $taskID
* @param int $user
* @access public
* @return array
*/
public function getUserRuns($taskID, $user)
{
return $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq((int)$taskID)
->andWhere('t1.assignedTo')->eq($user)
->fetchAll();
}
/**
* Get info of a test run.
*
* @param int $runID
* @access public
* @return void
*/
public function getRunById($runID)
{
$testRun = $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch();
$testRun->case = $this->loadModel('testcase')->getById($testRun->case, $testRun->version);
return $testRun;
}
/**
* Create test result
*
* @param int $runID
* @access public
* @return void
*/
public function createResult($runID = 0)
{
/* Compute the test result.
*
* 1. if there result in the post, use it.
* 2. if no result, set default is pass.
* 3. then check the steps to compute result.
*
* */
$caseResult = $this->post->result ? $this->post->result : 'pass';
if(isset($_POST['passall']) and $this->post->passall == false)
{
if($this->post->steps)
{
foreach($this->post->steps as $stepID => $stepResult)
{
if($stepResult != 'pass' and $stepResult != 'n/a')
{
$caseResult = $stepResult;
break;
}
}
}
}
/* Create result of every step. */
if($this->post->steps)
{
foreach($this->post->steps as $stepID =>$stepResult)
{
$step['result'] = $stepResult;
$step['real'] = $this->post->reals[$stepID];
$stepResults[$stepID] = $step;
}
}
else
{
$stepResults = array();
}
/* Insert into testResult table. */
$now = helper::now();
$result = fixer::input('post')
->add('run', $runID)
->add('caseResult', $caseResult)
->setForce('stepResults', serialize($stepResults))
->add('lastRunner', $this->app->user->account)
->add('date', $now)
->remove('steps,reals,passall,result')
->get();
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
$this->dao->update(TABLE_CASE)->set('lastRunner')->eq($this->app->user->account)->set('lastRunDate')->eq($now)->set('lastRunResult')->eq($caseResult)->where('id')->eq($this->post->case)->exec();
if($runID)
{
/* Update testRun's status. */
if(!dao::isError())
{
$runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
$this->dao->update(TABLE_TESTRUN)
->set('lastRunResult')->eq($caseResult)
->set('status')->eq($runStatus)
->set('lastRunner')->eq($this->app->user->account)
->set('lastRunDate')->eq($now)
->where('id')->eq($runID)
->exec();
}
}
}
/**
* Get results by runID or caseID
*
* @param int $runID
* @param int $caseID
* @access public
* @return array
*/
public function getResults($runID, $caseID = 0)
{
if($caseID > 0)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('`case`')->eq($caseID)->orderBy('id desc')->fetchAll('id');
}
else
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
}
if(!$results) return array();
$relatedVersions = array();
foreach($results as $result)
{
$relatedVersions[] = $result->version;
$runCaseID = $result->case;
}
$relatedVersions = array_unique($relatedVersions);
$relatedSteps = $this->dao->select('*')->from(TABLE_CASESTEP)
->beginIF($caseID)->where('`case`')->eq($caseID)->fi()
->beginIF($runID)->where('`case`')->eq($runCaseID)->fi()
->andWhere('version')->in($relatedVersions)
->fetchAll();
foreach($results as $resultID => $result)
{
$result->stepResults = unserialize($result->stepResults);
$results[$resultID] = $result;
foreach($relatedSteps as $key => $step)
{
if($result->version == $step->version)
{
$result->stepResults[$step->id]['desc'] = $step->desc;
$result->stepResults[$step->id]['expect'] = $step->expect;
}
}
}
return $results;
}
}
<?php
/**
* The model file of test task module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
class testtaskModel extends model
{
/**
* Set the menu.
*
* @param array $products
* @param int $productID
* @access public
* @return void
*/
public function setMenu($products, $productID)
{
$this->loadModel('product')->setMenu($products, $productID);
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browse');
foreach($this->lang->testtask->menu as $key => $value)
{
$replace = ($key == 'product') ? $selectHtml . $this->lang->arrow: $productID;
common::setMenuVars($this->lang->testtask->menu, $key, $replace);
}
}
/**
* Create a test task.
*
* @param int $productID
* @access public
* @return void
*/
function create()
{
$task = fixer::input('post')
->stripTags('name')
->get();
$this->dao->insert(TABLE_TESTTASK)->data($task)->autoCheck()->batchcheck($this->config->testtask->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
/**
* Get test tasks of a product.
*
* @param int $productID
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getProductTasks($productID, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->where('t1.product')->eq((int)$productID)
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
->fetchAll();
}
/**
* Get test tasks of a project.
*
* @param int $projectID
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getProjectTasks($projectID, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id')
->where('t1.project')->eq((int)$projectID)
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
->fetchAll();
}
/**
* Get test task info by id.
*
* @param int $taskID
* @access public
* @return void
*/
public function getById($taskID)
{
$task = $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->where('t1.id')->eq((int)$taskID)->fetch();
$task->desc = $this->loadModel('file')->setImgSize($task->desc);
return $task;
}
/**
* Get test tasks by user.
*
* @param string $account
* @access public
* @return array
*/
public function getByUser($account)
{
return $this->dao->select('t1.*, t2.name AS projectName, t3.name AS buildName')
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
->where('t1.deleted')->eq(0)
->andWhere('t1.owner')->eq($account)
->orderBy('id desc')
->fetchAll();
}
/**
* Update a test task.
*
* @param int $taskID
* @access public
* @return void
*/
public function update($taskID)
{
$oldTask = $this->getById($taskID);
$task = fixer::input('post')->stripTags('name')->get();
$this->dao->update(TABLE_TESTTASK)->data($task)->autoCheck()->batchcheck($this->config->testtask->edit->requiredFields, 'notempty')->where('id')->eq($taskID)->exec();
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
/**
* Link cases.
*
* @param int $taskID
* @access public
* @return void
*/
public function linkCase($taskID)
{
if($this->post->cases == false) return;
foreach($this->post->cases as $caseID)
{
$row->task = $taskID;
$row->case = $caseID;
$row->version = $this->post->versions[$caseID];
$row->assignedTo = '';
$row->status = 'wait';
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
}
}
/**
* Get test runs of a test task.
*
* @param int $taskID
* @param int $moduleID
* @access public
* @return array
*/
public function getRuns($taskID, $moduleID)
{
return $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq((int)$taskID)
->beginIF($moduleID)->andWhere('t2.module')->in($moduleID)->fi()
->fetchAll();
}
/**
* Get test runs of a user.
*
* @param int $taskID
* @param int $user
* @access public
* @return array
*/
public function getUserRuns($taskID, $user)
{
return $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq((int)$taskID)
->andWhere('t1.assignedTo')->eq($user)
->fetchAll();
}
/**
* Get info of a test run.
*
* @param int $runID
* @access public
* @return void
*/
public function getRunById($runID)
{
$testRun = $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch();
$testRun->case = $this->loadModel('testcase')->getById($testRun->case, $testRun->version);
return $testRun;
}
/**
* Create test result
*
* @param int $runID
* @access public
* @return void
*/
public function createResult($runID = 0)
{
/* Compute the test result.
*
* 1. if there result in the post, use it.
* 2. if no result, set default is pass.
* 3. then check the steps to compute result.
*
* */
$caseResult = $this->post->result ? $this->post->result : 'pass';
if(isset($_POST['passall']) and $this->post->passall == false)
{
if($this->post->steps)
{
foreach($this->post->steps as $stepID => $stepResult)
{
if($stepResult != 'pass' and $stepResult != 'n/a')
{
$caseResult = $stepResult;
break;
}
}
}
}
/* Create result of every step. */
if($this->post->steps)
{
foreach($this->post->steps as $stepID =>$stepResult)
{
$step['result'] = $stepResult;
$step['real'] = $this->post->reals[$stepID];
$stepResults[$stepID] = $step;
}
}
else
{
$stepResults = array();
}
/* Insert into testResult table. */
$now = helper::now();
$result = fixer::input('post')
->add('run', $runID)
->add('caseResult', $caseResult)
->setForce('stepResults', serialize($stepResults))
->add('lastRunner', $this->app->user->account)
->add('date', $now)
->remove('steps,reals,passall,result')
->get();
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
$this->dao->update(TABLE_CASE)->set('lastRunner')->eq($this->app->user->account)->set('lastRunDate')->eq($now)->set('lastRunResult')->eq($caseResult)->where('id')->eq($this->post->case)->exec();
if($runID)
{
/* Update testRun's status. */
if(!dao::isError())
{
$runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
$this->dao->update(TABLE_TESTRUN)
->set('lastRunResult')->eq($caseResult)
->set('status')->eq($runStatus)
->set('lastRunner')->eq($this->app->user->account)
->set('lastRunDate')->eq($now)
->where('id')->eq($runID)
->exec();
}
}
}
/**
* Get results by runID or caseID
*
* @param int $runID
* @param int $caseID
* @access public
* @return array
*/
public function getResults($runID, $caseID = 0)
{
if($caseID > 0)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('`case`')->eq($caseID)->orderBy('id desc')->fetchAll('id');
}
else
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
}
if(!$results) return array();
$relatedVersions = array();
foreach($results as $result)
{
$relatedVersions[] = $result->version;
$runCaseID = $result->case;
}
$relatedVersions = array_unique($relatedVersions);
$relatedSteps = $this->dao->select('*')->from(TABLE_CASESTEP)
->beginIF($caseID)->where('`case`')->eq($caseID)->fi()
->beginIF($runID)->where('`case`')->eq($runCaseID)->fi()
->andWhere('version')->in($relatedVersions)
->fetchAll();
foreach($results as $resultID => $result)
{
$result->stepResults = unserialize($result->stepResults);
$results[$resultID] = $result;
foreach($relatedSteps as $key => $step)
{
if($result->version == $step->version)
{
$result->stepResults[$step->id]['desc'] = $step->desc;
$result->stepResults[$step->id]['expect'] = $step->expect;
}
}
}
return $results;
}
}
+56 -56
View File
@@ -1,56 +1,56 @@
<?php
/**
* The browse view file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table-1 colored tablesorter fixed'>
<caption class='caption-tl'>
<div class='f-left'><?php echo $lang->testtask->browse;?></div>
<div class='f-right'><?php common::printLink('testtask', 'create', "product=$productID", $lang->testtask->create);?></div>
</caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->testtask->name;?></th>
<th><?php echo $lang->testtask->project;?></th>
<th><?php echo $lang->testtask->build;?></th>
<th class='w-user'><?php echo $lang->testtask->owner;?></th>
<th class='w-80px'><?php echo $lang->testtask->begin;?></th>
<th class='w-80px'><?php echo $lang->testtask->end;?></th>
<th class='w-50px'><?php echo $lang->statusAB;?></th>
<th class='w-130px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($tasks as $task):?>
<tr class='a-center'>
<td><?php echo html::a(inlink('view', "taskID=$task->id"), sprintf('%03d', $task->id));?></td>
<td class='a-left nobr'><?php echo html::a(inlink('view', "taskID=$task->id"), $task->name);?></td>
<td class='nobr'><?php echo $task->projectName?></td>
<td class='nobr'><?php $task->build == 'trunk' ? print('Trunk') : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?></td>
<td><?php echo $users[$task->owner];?></td>
<td><?php echo $task->begin?></td>
<td><?php echo $task->end?></td>
<td><?php echo $lang->testtask->statusList[$task->status];?></td>
<td>
<?php
common::printLink('testtask', 'cases', "taskID=$task->id", $lang->testtask->cases);
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB);
common::printLink('testtask', 'edit', "taskID=$task->id", $lang->edit);
common::printLink('testtask', 'delete', "taskID=$task->id", $lang->delete, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The browse view file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table-1 colored tablesorter fixed'>
<caption class='caption-tl'>
<div class='f-left'><?php echo $lang->testtask->browse;?></div>
<div class='f-right'><?php common::printLink('testtask', 'create', "product=$productID", $lang->testtask->create);?></div>
</caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->testtask->name;?></th>
<th><?php echo $lang->testtask->project;?></th>
<th><?php echo $lang->testtask->build;?></th>
<th class='w-user'><?php echo $lang->testtask->owner;?></th>
<th class='w-80px'><?php echo $lang->testtask->begin;?></th>
<th class='w-80px'><?php echo $lang->testtask->end;?></th>
<th class='w-50px'><?php echo $lang->statusAB;?></th>
<th class='w-130px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($tasks as $task):?>
<tr class='a-center'>
<td><?php echo html::a(inlink('view', "taskID=$task->id"), sprintf('%03d', $task->id));?></td>
<td class='a-left nobr'><?php echo html::a(inlink('view', "taskID=$task->id"), $task->name);?></td>
<td class='nobr'><?php echo $task->projectName?></td>
<td class='nobr'><?php $task->build == 'trunk' ? print('Trunk') : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?></td>
<td><?php echo $users[$task->owner];?></td>
<td><?php echo $task->begin?></td>
<td><?php echo $task->end?></td>
<td><?php echo $lang->testtask->statusList[$task->status];?></td>
<td>
<?php
common::printLink('testtask', 'cases', "taskID=$task->id", $lang->testtask->cases);
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB);
common::printLink('testtask', 'edit', "taskID=$task->id", $lang->edit);
common::printLink('testtask', 'delete', "taskID=$task->id", $lang->delete, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php include '../../common/view/footer.html.php';?>
+101 -101
View File
@@ -1,101 +1,101 @@
<?php
/**
* The view file of case module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package case
* @version $Id: view.html.php 594 2010-03-27 13:44:07Z wwccss $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<script language="Javascript">
var browseType = '<?php echo $browseType;?>';
var moduleID = '<?php echo $moduleID;?>';
</script>
<div id='featurebar'>
<div class='f-left'>
<?php
echo "<span id='bymoduleTab' onclick=\"browseByModule('$browseType')\"><a href='#'>" . $lang->testtask->byModule . "</a></span> ";
echo "<span id='allTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all&param=0"), $lang->testtask->allCases) . "</span>";
echo "<span id='assignedtomeTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome&param=0"), $lang->testtask->assignedToMe) . "</span>";
?>
</div>
<div class='f-right'>
<?php
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);
echo html::a($this->session->testtaskList, $lang->goback);
?>
</div>
</div>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>'>
<div class='box-title'><?php echo $productName;?></div>
<div class='box-content'><?php echo $moduleTree;?></div>
</td>
<td class='divider <?php echo $treeClass;?>'></td>
<td>
<form method='post' action='<?php echo inlink('batchAssign', "task=$task->id");?>' target='hiddenwin'>
<table class='table-1 tablesorter datatable mb-zero fixed'>
<thead>
<tr class='colhead'>
<th class='w-id'><nobr><?php echo $lang->idAB;?></nobr></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th><?php echo $lang->testcase->type;?></th>
<th class='w-100px'><?php echo $lang->testtask->assignedTo;?></th>
<th class='w-100px'><?php echo $lang->testtask->lastRunAccount;?></th>
<th class='w-100px'><?php echo $lang->testtask->lastRunTime;?></th>
<th class='w-80px'><?php echo $lang->testtask->lastRunResult;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-160px {sorter: false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td class='a-left'><?php echo "<input type='checkbox' name='cases[]' value='$run->case' /> "; printf('%03d', $run->case);?></td>
<td><?php echo $run->pri?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php $assignedTo = $users[$run->assignedTo]; echo substr($assignedTo, strpos($assignedTo, ':') + 1);?></td>
<td><?php $lastRunner = $users[$run->lastRunner]; echo substr($lastRunner, strpos($lastRunner, ':') + 1);?></td>
<td><?php if(!helper::isZeroDate($run->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($run->lastRunDate));?></td>
<td class='<?php echo $run->lastRunResult;?>'><?php if($run->lastRunResult) echo $lang->testcase->resultList[$run->lastRunResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testtask->statusList[$run->status];?></td>
<td class='a-left'>
<?php
common::printLink('testtask', 'runcase', "id=$run->id", $lang->testtask->runCase, '', 'class="iframe"');
common::printLink('testtask', 'results', "id=$run->id", $lang->testtask->results, '', 'class="iframe"');
common::printLink('testtask', 'unlinkcase', "id=$run->id", $lang->testtask->unlinkCase, 'hiddenwin');
if($run->lastRunResult == 'fail') common::printLink('bug', 'create', "product=$productID&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,runID=$run->id", $lang->testtask->createBug);
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<table class='table-1'>
<tr>
<td><nobr><?php echo "<input type='checkbox' onclick='checkall(this);'> " . $lang->selectAll;?></nobr></td>
<td colspan='9'>
<?php
echo html::select('assignedTo', $users);
echo html::submitButton($lang->testtask->assign);
?>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The view file of case module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package case
* @version $Id: view.html.php 594 2010-03-27 13:44:07Z wwccss $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<script language="Javascript">
var browseType = '<?php echo $browseType;?>';
var moduleID = '<?php echo $moduleID;?>';
</script>
<div id='featurebar'>
<div class='f-left'>
<?php
echo "<span id='bymoduleTab' onclick=\"browseByModule('$browseType')\"><a href='#'>" . $lang->testtask->byModule . "</a></span> ";
echo "<span id='allTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all&param=0"), $lang->testtask->allCases) . "</span>";
echo "<span id='assignedtomeTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome&param=0"), $lang->testtask->assignedToMe) . "</span>";
?>
</div>
<div class='f-right'>
<?php
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);
echo html::a($this->session->testtaskList, $lang->goback);
?>
</div>
</div>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>'>
<div class='box-title'><?php echo $productName;?></div>
<div class='box-content'><?php echo $moduleTree;?></div>
</td>
<td class='divider <?php echo $treeClass;?>'></td>
<td>
<form method='post' action='<?php echo inlink('batchAssign', "task=$task->id");?>' target='hiddenwin'>
<table class='table-1 tablesorter datatable mb-zero fixed'>
<thead>
<tr class='colhead'>
<th class='w-id'><nobr><?php echo $lang->idAB;?></nobr></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th><?php echo $lang->testcase->type;?></th>
<th class='w-100px'><?php echo $lang->testtask->assignedTo;?></th>
<th class='w-100px'><?php echo $lang->testtask->lastRunAccount;?></th>
<th class='w-100px'><?php echo $lang->testtask->lastRunTime;?></th>
<th class='w-80px'><?php echo $lang->testtask->lastRunResult;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-160px {sorter: false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td class='a-left'><?php echo "<input type='checkbox' name='cases[]' value='$run->case' /> "; printf('%03d', $run->case);?></td>
<td><?php echo $run->pri?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php $assignedTo = $users[$run->assignedTo]; echo substr($assignedTo, strpos($assignedTo, ':') + 1);?></td>
<td><?php $lastRunner = $users[$run->lastRunner]; echo substr($lastRunner, strpos($lastRunner, ':') + 1);?></td>
<td><?php if(!helper::isZeroDate($run->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($run->lastRunDate));?></td>
<td class='<?php echo $run->lastRunResult;?>'><?php if($run->lastRunResult) echo $lang->testcase->resultList[$run->lastRunResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testtask->statusList[$run->status];?></td>
<td class='a-left'>
<?php
common::printLink('testtask', 'runcase', "id=$run->id", $lang->testtask->runCase, '', 'class="iframe"');
common::printLink('testtask', 'results', "id=$run->id", $lang->testtask->results, '', 'class="iframe"');
common::printLink('testtask', 'unlinkcase', "id=$run->id", $lang->testtask->unlinkCase, 'hiddenwin');
if($run->lastRunResult == 'fail') common::printLink('bug', 'create', "product=$productID&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,runID=$run->id", $lang->testtask->createBug);
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<table class='table-1'>
<tr>
<td><nobr><?php echo "<input type='checkbox' onclick='checkall(this);'> " . $lang->selectAll;?></nobr></td>
<td colspan='9'>
<?php
echo html::select('assignedTo', $users);
echo html::submitButton($lang->testtask->assign);
?>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php include '../../common/view/footer.html.php';?>
+67 -67
View File
@@ -1,67 +1,67 @@
<?php
/**
* The create view of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<form method='post' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->testtask->create;?></caption>
<?php if(isset($projectID)):?>
<tr>
<th class='rowhead'><?php echo $lang->testtask->product;?></th>
<td><?php echo html::select('product', $products, '', 'class=select-3');?></td>
</tr>
<?php else:?>
<tr class='hidden'>
<th><?php echo $lang->testtask->product;?></th>
<td><?php echo html::input('product', $productID, 'class=select-3');?></td>
</tr>
<?php endif;?>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo html::select('project', $projects, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php echo html::select('build', $builds, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo html::select('owner', $users, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo html::input('begin', '', "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo html::input('end', '', "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, '', "class='select-3'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo html::input('name', '', "class='text-1'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows=10 class='area-1'");?>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?> </td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The create view of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<form method='post' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->testtask->create;?></caption>
<?php if(isset($projectID)):?>
<tr>
<th class='rowhead'><?php echo $lang->testtask->product;?></th>
<td><?php echo html::select('product', $products, '', 'class=select-3');?></td>
</tr>
<?php else:?>
<tr class='hidden'>
<th><?php echo $lang->testtask->product;?></th>
<td><?php echo html::input('product', $productID, 'class=select-3');?></td>
</tr>
<?php endif;?>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo html::select('project', $projects, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php echo html::select('build', $builds, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo html::select('owner', $users, '', 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo html::input('begin', '', "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo html::input('end', '', "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, '', "class='select-3'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo html::input('name', '', "class='text-1'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows=10 class='area-1'");?>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?> </td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+56 -56
View File
@@ -1,56 +1,56 @@
<?php
/**
* The edit view of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<form method='post' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->testtask->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo html::select('project', $projects, $task->project, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php echo html::select('build', $builds, $task->build, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo html::select('owner', $users, $task->owner, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo html::input('begin', $task->begin, "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo html::input('end', $task->end, "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, $task->status, "class='select-3'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo html::input('name', $task->name, "class='text-1'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo html::textarea('desc', htmlspecialchars($task->desc), "rows=10 class='area-1'");?>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?> </td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The edit view of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<form method='post' target='hiddenwin'>
<table class='table-1'>
<caption><?php echo $lang->testtask->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo html::select('project', $projects, $task->project, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php echo html::select('build', $builds, $task->build, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo html::select('owner', $users, $task->owner, 'class=select-3');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo html::input('begin', $task->begin, "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo html::input('end', $task->end, "class='text-3 date'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo html::select('status', $lang->testtask->statusList, $task->status, "class='select-3'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo html::input('name', $task->name, "class='text-1'");?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo html::textarea('desc', htmlspecialchars($task->desc), "rows=10 class='area-1'");?>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?> </td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+68 -68
View File
@@ -1,68 +1,68 @@
<?php
/**
* The linkcase view file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php echo $searchForm;?>
<form method='post'>
<table class='table-1 colored tablesorter fixed'>
<caption class='caption-tl'>
<div class='f-left'><?php echo $lang->testtask->unlinkedCases;?></div>
<div class='f-right'><?php echo html::a($this->session->testtaskList, $lang->goback);?></div>
<div class='f-right'><?php echo html::a($this->createLink('testtask', 'linkcase', "taskID=$taskID&param=bybug"), $lang->testtask->linkByBug);?></div>
<div class='f-right'><?php echo html::a($this->createLink('testtask', 'linkcase', "taskID=$taskID&param=bystory"), $lang->testtask->linkByStory);?></div>
</caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th class='w-type'><?php echo $lang->testcase->type;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><nobr><?php echo $lang->testtask->linkVersion;?></nobr></th>
</tr>
</thead>
<tbody>
<?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 echo $case->pri?></td>
<td class='a-left'>
<?php
echo $case->title . ' ( ';
for($i = $case->version; $i >= 1; $i --)
{
echo html::a($this->createLink('testcase', 'view', "caseID=$case->id&version=$i"), "#$i", '_blank');
}
echo ')';
?>
</td>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $lang->testcase->statusList[$case->status];?></td>
<td class='a-left'><nobr>
<input type='checkbox' name='cases[]' value='<?php echo $case->id;?>' />
<?php echo html::select("versions[$case->id]", array_combine(range($case->version, 1), range($case->version, 1)), '', 'style=width:50px');?></nobr>
</td>
</tr>
</tbody>
<?php endforeach;?>
<tfoot>
<tr><td colspan='7' class='a-right'><?php $pager->show();?></td></tr>
<tr>
<td colspan='7' class='a-center'><input type='checkbox' onclick='checkall(this);'><?php echo $lang->selectAll; echo html::submitButton();?></td>
</tr>
</tfoot>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The linkcase view file of testtask module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php echo $searchForm;?>
<form method='post'>
<table class='table-1 colored tablesorter fixed'>
<caption class='caption-tl'>
<div class='f-left'><?php echo $lang->testtask->unlinkedCases;?></div>
<div class='f-right'><?php echo html::a($this->session->testtaskList, $lang->goback);?></div>
<div class='f-right'><?php echo html::a($this->createLink('testtask', 'linkcase', "taskID=$taskID&param=bybug"), $lang->testtask->linkByBug);?></div>
<div class='f-right'><?php echo html::a($this->createLink('testtask', 'linkcase', "taskID=$taskID&param=bystory"), $lang->testtask->linkByStory);?></div>
</caption>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th class='w-type'><?php echo $lang->testcase->type;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><nobr><?php echo $lang->testtask->linkVersion;?></nobr></th>
</tr>
</thead>
<tbody>
<?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 echo $case->pri?></td>
<td class='a-left'>
<?php
echo $case->title . ' ( ';
for($i = $case->version; $i >= 1; $i --)
{
echo html::a($this->createLink('testcase', 'view', "caseID=$case->id&version=$i"), "#$i", '_blank');
}
echo ')';
?>
</td>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $lang->testcase->statusList[$case->status];?></td>
<td class='a-left'><nobr>
<input type='checkbox' name='cases[]' value='<?php echo $case->id;?>' />
<?php echo html::select("versions[$case->id]", array_combine(range($case->version, 1), range($case->version, 1)), '', 'style=width:50px');?></nobr>
</td>
</tr>
</tbody>
<?php endforeach;?>
<tfoot>
<tr><td colspan='7' class='a-right'><?php $pager->show();?></td></tr>
<tr>
<td colspan='7' class='a-center'><input type='checkbox' onclick='checkall(this);'><?php echo $lang->selectAll; echo html::submitButton();?></td>
</tr>
</tfoot>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+49 -49
View File
@@ -1,49 +1,49 @@
<?php
/**
* The resutls view file of testtask of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<h1>CASE#<?php echo $case->id. $lang->colon . $case->title;?></h1>
<fieldset>
<legend><?php echo $lang->testcase->precondition;?></legend>
<?php echo $case->precondition;?>
</fieldset>
<?php foreach($results as $result):?>
<table class='table-1'>
<caption>RESULT#<?php echo $result->id . ' ' . $result->date . ' ' . $users[$result->lastRunner] . ' ' . $lang->testtask->runCase . ':'. " <span class='$result->caseResult'>" . $lang->testcase->resultList[$result->caseResult] . '</span>';?></caption>
<tr>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
</tr>
<?php
$i = 1;
foreach($result->stepResults as $key => $stepResult):
?>
<tr>
<th><?php echo $i;?></th>
<td><?php echo nl2br($stepResult['desc']);?></td>
<td><?php echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($result->stepResults)):?>
<td class='<?php echo $stepResult['result'];?> a-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
</tr>
<?php else:?>
<td></td>
<td></td>
</tr>
<?php endif; $i++;?>
<?php endforeach;?>
</table>
<?php endforeach;?>
</div>
<?php
/**
* The resutls view file of testtask of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<h1>CASE#<?php echo $case->id. $lang->colon . $case->title;?></h1>
<fieldset>
<legend><?php echo $lang->testcase->precondition;?></legend>
<?php echo $case->precondition;?>
</fieldset>
<?php foreach($results as $result):?>
<table class='table-1'>
<caption>RESULT#<?php echo $result->id . ' ' . $result->date . ' ' . $users[$result->lastRunner] . ' ' . $lang->testtask->runCase . ':'. " <span class='$result->caseResult'>" . $lang->testcase->resultList[$result->caseResult] . '</span>';?></caption>
<tr>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
</tr>
<?php
$i = 1;
foreach($result->stepResults as $key => $stepResult):
?>
<tr>
<th><?php echo $i;?></th>
<td><?php echo nl2br($stepResult['desc']);?></td>
<td><?php echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($result->stepResults)):?>
<td class='<?php echo $stepResult['result'];?> a-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
</tr>
<?php else:?>
<td></td>
<td></td>
</tr>
<?php endif; $i++;?>
<?php endforeach;?>
</table>
<?php endforeach;?>
</div>
+59 -59
View File
@@ -1,59 +1,59 @@
<?php
/**
* The runrun view file of testtask of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<form method='post'>
<table class='table-1'>
<caption class='caption-tl'>CASE#<?php echo $run->case->id. $lang->colon . $run->case->title;?></caption>
<tr>
<td colspan='5'><h5><?php echo $lang->testcase->precondition;?></h5><?php echo $run->case->precondition;?></td>
</tr>
<tr class='colhead'>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-100px'><?php echo $lang->testcase->result;?></th>
<th><?php echo $lang->testcase->real;?></th>
</tr>
<?php foreach($run->case->steps as $key => $step):?>
<?php $defaultResult = $step->expect ? 'pass' : 'n/a';?>
<tr>
<th><?php echo $key + 1;?></th>
<td><?php echo nl2br($step->desc);?></td>
<td><?php echo nl2br($step->expect);?></td>
<td class='a-center'><?php echo html::select("steps[$step->id]", $lang->testcase->resultList, $defaultResult);?></td>
<td><?php echo html::textarea("reals[$step->id]", '', "rows=3 class='area-1'");?></td>
</tr>
<?php endforeach;?>
<tr class='a-center'>
<td colspan='5'>
<?php
if(empty($run->case->steps))
{
echo html::submitButton($lang->testtask->pass, "onclick=$('#result').val('pass')");
echo html::submitButton($lang->testtask->fail, "onclick=$('#result').val('fail')");
}
else
{
echo html::submitButton();
echo html::submitButton($lang->testtask->passAll, "onclick=$('#passall').val(1)");
}
echo html::hidden('case', $run->case->id);
echo html::hidden('version', $run->case->version);
if($run->case->steps) echo html::hidden('passall', 0);
if(!$run->case->steps) echo html::hidden('result', '');
?>
</td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
<?php
/**
* The runrun view file of testtask of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<form method='post'>
<table class='table-1'>
<caption class='caption-tl'>CASE#<?php echo $run->case->id. $lang->colon . $run->case->title;?></caption>
<tr>
<td colspan='5'><h5><?php echo $lang->testcase->precondition;?></h5><?php echo $run->case->precondition;?></td>
</tr>
<tr class='colhead'>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-100px'><?php echo $lang->testcase->result;?></th>
<th><?php echo $lang->testcase->real;?></th>
</tr>
<?php foreach($run->case->steps as $key => $step):?>
<?php $defaultResult = $step->expect ? 'pass' : 'n/a';?>
<tr>
<th><?php echo $key + 1;?></th>
<td><?php echo nl2br($step->desc);?></td>
<td><?php echo nl2br($step->expect);?></td>
<td class='a-center'><?php echo html::select("steps[$step->id]", $lang->testcase->resultList, $defaultResult);?></td>
<td><?php echo html::textarea("reals[$step->id]", '', "rows=3 class='area-1'");?></td>
</tr>
<?php endforeach;?>
<tr class='a-center'>
<td colspan='5'>
<?php
if(empty($run->case->steps))
{
echo html::submitButton($lang->testtask->pass, "onclick=$('#result').val('pass')");
echo html::submitButton($lang->testtask->fail, "onclick=$('#result').val('fail')");
}
else
{
echo html::submitButton();
echo html::submitButton($lang->testtask->passAll, "onclick=$('#passall').val(1)");
}
echo html::hidden('case', $run->case->id);
echo html::hidden('version', $run->case->version);
if($run->case->steps) echo html::hidden('passall', 0);
if(!$run->case->steps) echo html::hidden('result', '');
?>
</td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+64 -64
View File
@@ -1,64 +1,64 @@
<?php
/**
* The view file of case module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package case
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table-1'>
<caption><?php echo $lang->testtask->view;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td class='<?php if($task->deleted) echo 'deleted';?>'><?php echo $task->name;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo $task->projectName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php $task->buildName ? print($task->buildName) : print($task->build);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo $users[$task->owner];?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo $task->begin;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo $task->end;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo $lang->testtask->statusList[$task->status];?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td class='content'><?php echo $task->desc;?></td>
</tr>
</table>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browse', "productID=$task->product");
if(!$task->deleted)
{
common::printLink('testtask', 'cases', "taskID=$task->id", $lang->testtask->cases);
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB);
common::printLink('testtask', 'edit', "taskID=$task->id", $lang->edit);
common::printLink('testtask', 'delete', "taskID=$task->id", $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
</div>
<?php include '../../common/view/action.html.php';?>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The view file of case module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package case
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table-1'>
<caption><?php echo $lang->testtask->view;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td class='<?php if($task->deleted) echo 'deleted';?>'><?php echo $task->name;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo $task->projectName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php $task->buildName ? print($task->buildName) : print($task->build);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->owner;?></th>
<td><?php echo $users[$task->owner];?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo $task->begin;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo $task->end;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo $lang->testtask->statusList[$task->status];?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td class='content'><?php echo $task->desc;?></td>
</tr>
</table>
<div class='a-center f-16px strong'>
<?php
$browseLink = $this->session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browse', "productID=$task->product");
if(!$task->deleted)
{
common::printLink('testtask', 'cases', "taskID=$task->id", $lang->testtask->cases);
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB);
common::printLink('testtask', 'edit', "taskID=$task->id", $lang->edit);
common::printLink('testtask', 'delete', "taskID=$task->id", $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
</div>
<?php include '../../common/view/action.html.php';?>
<?php include '../../common/view/footer.html.php';?>