This commit is contained in:
chujilu
2014-08-14 17:35:36 +08:00
16 changed files with 108 additions and 47 deletions
+3 -37
View File
@@ -1,6 +1,6 @@
VERSION=$(shell head -n 1 VERSION)
all: prepare pms
all: pms
clean:
rm -fr zentaopms
rm -fr zentaostory
@@ -11,7 +11,7 @@ clean:
rm -fr api*
rm -fr build/linux/lampp
rm -fr lampp
prepare:
pms:
mkdir zentaopms
cp -fr bin zentaopms/
cp -fr config zentaopms/ && rm -fr zentaopms/config/my.php
@@ -37,7 +37,7 @@ prepare:
find zentaopms -name tests |xargs rm -fr
# notify.zip.
mkdir zentaopms/www/data/notify/
wget http://192.168.1.99/release/notify.zip -O zentaopms/www/data/notify/notify.zip
#wget http://192.168.1.99/release/notify.zip -O zentaopms/www/data/notify/notify.zip
# change mode.
chmod 777 -R zentaopms/tmp/
chmod 777 -R zentaopms/www/data
@@ -45,42 +45,8 @@ prepare:
chmod 777 zentaopms/module
chmod a+rx zentaopms/bin/*
find zentaopms/ -name ext |xargs chmod -R 777
pms:
echo full > zentaopms/.flow
zip -r -9 ZenTaoPMS.$(VERSION).zip zentaopms
zstory:
cp -frp zentaopms zentaostory
svn export https://svn.cnezsoft.com/easysoft/trunk/zentaoext/zentaostory storyext
cp -fr storyext/module/* zentaostory/module/
find zentaostory/ -name ext |xargs chmod -R 777
echo zentaostory > zentaostory/.flow
sed -e 's/zentao/story/g' zentaostory/www/.ztaccess > .ztaccess.bak
mv .ztaccess.bak zentaostory/www/.ztaccess
zip -r -9 ZenTaoStory.$(VERSION).zip zentaostory
rm -fr storyext
rm -fr zentaostory
ztask:
cp -frp zentaopms zentaotask
svn export https://svn.cnezsoft.com/easysoft/trunk/zentaoext/zentaotask taskext
cp -fr taskext/module/* zentaotask/module/
find zentaotask/ -name ext |xargs chmod -R 777
echo zentaotask > zentaotask/.flow
sed -e 's/zentao/task/g' zentaotask/www/.ztaccess > .ztaccess.bak
mv .ztaccess.bak zentaotask/www/.ztaccess
zip -r -9 ZenTaoTask.$(VERSION).zip zentaotask
rm -fr taskext
rm -fr zentaotask
ztest:
cp -frp zentaopms zentaotest
svn export https://svn.cnezsoft.com/easysoft/trunk/zentaoext/zentaotest testext
cp -fr testext/module/* zentaotest/module/
find zentaotest/ -name ext |xargs chmod -R 777
echo zentaotest > zentaotest/.flow
sed -e 's/zentao/test/g' zentaotest/www/.ztaccess > .ztaccess.bak
mv .ztaccess.bak zentaotest/www/.ztaccess
zip -r -9 ZenTaoTest.$(VERSION).zip zentaotest
rm -fr testext
rm -fr zentaotest
rm -fr zentaopms
patchphpdoc:
sudo cp misc/doc/phpdoc/*.tpl /usr/share/php/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/phphtmllib/templates/
+1 -1
View File
@@ -583,7 +583,7 @@ function isLocalIP()
function getWebRoot()
{
$path = $_SERVER['SCRIPT_NAME'];
if(defined('IN_SHELL'))
if(PHP_SAPI == 'cli')
{
$url = parse_url($_SERVER['argv'][1]);
$path = empty($url['path']) ? '/' : rtrim($url['path'], '/');
+1 -1
View File
@@ -1597,7 +1597,7 @@ class router
$errorLog .= "when visiting <strong>" . $this->getURI() . "</strong>\n";
/* If the ip is pulic, hidden the full path of scripts. */
if(!defined('IN_SHELL') and !($this->server->server_addr == '127.0.0.1' or filter_var($this->server->server_addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) === false))
if(PHP_SAPI != 'cli' and !($this->server->server_addr == '127.0.0.1' or filter_var($this->server->server_addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) === false))
{
$errorLog = str_replace($this->getBasePath(), '', $errorLog);
}
+1 -1
View File
@@ -214,7 +214,7 @@ class bug extends control
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
$this->app->loadLang('release');
if(!empty($_POST))
if(!empty($_POST) and !isset($_POST['stepIDList']))
{
$response['result'] = 'success';
$response['message'] = '';
+5 -1
View File
@@ -769,6 +769,7 @@ class bugModel extends model
{
$title = '';
$bugSteps = '';
$steps = $this->post->stepIDList;
$result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch();
if($caseID > 0)
@@ -794,13 +795,15 @@ class bugModel extends model
{
foreach($caseSteps as $key => $step)
{
if(!in_array($step->id, $steps)) continue;
$bugSteps .= ($key + 1) . '. ' . $step->desc . "<br />";
}
$bugSteps .= $this->lang->bug->tplResult;
foreach($caseSteps as $key => $step)
{
if(!$stepResults[$step->id]['real']) continue;
if(empty($stepResults[$step->id]['real'])) continue;
if(!in_array($step->id, $steps)) continue;
$bugSteps .= ($key + 1) . '. ' . $stepResults[$step->id]['real'] . "<br />";
}
@@ -808,6 +811,7 @@ class bugModel extends model
foreach($caseSteps as $key => $step)
{
if(!$step->expect) continue;
if(!in_array($step->id, $steps)) continue;
$bugSteps .= ($key + 1) . '. ' . $step->expect . "<br />";
}
-1
View File
@@ -259,7 +259,6 @@ class common extends control
}
/* Set module and method, then create link to it. */
if(strtolower($module) == 'testcase' and strtolower($method) == 'createbug') ($module = 'bug') and ($method = 'create');
if(strtolower($module) == 'story' and strtolower($method) == 'createcase') ($module = 'testcase') and ($method = 'create');
if(strtolower($module) == 'bug' and strtolower($method) == 'tostory') ($module = 'story') and ($method = 'create');
if(strtolower($module) == 'bug' and strtolower($method) == 'createcase') ($module = 'testcase') and ($method = 'create');
+1 -1
View File
@@ -73,7 +73,7 @@ class commonModel extends model
{
$this->app->user = $this->session->user;
}
elseif($this->app->company->guest or defined('IN_SHELL'))
elseif($this->app->company->guest or PHP_SAPI == 'cli')
{
$user = new stdClass();
$user->id = 0;
+1 -1
View File
@@ -519,7 +519,7 @@ EOT;
public function getSysURL()
{
/* Ger URL when run in shell. */
if(defined('IN_SHELL'))
if(PHP_SAPI == 'cli')
{
$url = parse_url(trim($this->server->argv[1]));
$port = (empty($url['port']) or $url['port'] == 80) ? '' : $url['port'];
+36
View File
@@ -379,6 +379,42 @@ class testcase extends control
$this->display();
}
/**
* Create bug.
*
* @param int $productID
* @param string $extras
* @access public
* @return void
*/
public function createBug($productID, $extras = '')
{
parse_str(str_replace(array(',', ' '), array('&', ''), $extras));
$this->loadModel('testtask');
$case = '';
if($runID)
{
$case = $this->testtask->getRunById($runID)->case;
$results = $this->testtask->getResults($runID);
}
elseif($caseID)
{
$case = $this->testcase->getById($caseID);
$results = $this->testtask->getResults(0, $caseID);
}
if(!$case) die(js::error($this->lang->notFound) . js::locate('back', 'parent'));
if(empty($case->steps)) die(js::locate($this->createLink('bug', 'create', "product=$productID&extras=$extras")));
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->createBug;
$this->view->case = $case;
$this->view->result = reset($results);
$this->view->extras = $extras;
$this->view->productID = $productID;
$this->display();
}
/**
* View a test case.
*
+1
View File
@@ -45,6 +45,7 @@ $lang->testcase->allProduct = 'All product';
$lang->testcase->fromBug = 'From bug';
$lang->testcase->toBug = 'To bug';
$lang->testcase->changed = 'Changed';
$lang->testcase->createBug = 'Create bug';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
$lang->testcase->stepID = 'ID';
+1
View File
@@ -45,6 +45,7 @@ $lang->testcase->allProduct = '所有产品';
$lang->testcase->fromBug = '来源Bug';
$lang->testcase->toBug = '生成Bug';
$lang->testcase->changed = '用例变更';
$lang->testcase->createBug = '创建Bug';
$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。
$lang->testcase->stepID = '编号';
+1 -1
View File
@@ -89,7 +89,7 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->testcase->delete}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug');
common::printIcon('testcase', 'createBug', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe');
?>
</td>
<?php endif;?>
+53
View File
@@ -0,0 +1,53 @@
<?php
/**
* The createByg view file of testcase module of ZenTaoPMS.
*
* @copyright Copyright 2009-2014 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package testcase
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<form action='<?php echo $this->createLink('bug', 'create', "product=$productID&extras=$extras")?>' target='_parent' method='post'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<thead>
<tr>
<th class='w-60px'><?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>
</thead>
<tbody>
<?php $i = 1;?>
<?php foreach($result->stepResults as $stepID => $stepResult):?>
<tr>
<td>
<input type='checkbox' name='stepIDList[]' value='<?php echo $stepID;?>'/>
<?php echo $i?>
</td>
<td><?php echo $stepResult['desc']?></td>
<td><?php echo $stepResult['expect']?></td>
<td class='<?php echo zget($stepResult, 'result');?> text-center'><?php echo zget($lang->testcase->resultList, zget($stepResult, 'result'));?></td>
<td><?php echo zget($stepResult, 'real');?></td>
</tr>
<?php $i++;?>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='5'>
<?php
echo "<div class='btn-group'>" . html::selectButton() . '</div>';
echo html::submitButton();
?>
</td>
</tr>
</tfoot>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
+1 -1
View File
@@ -46,7 +46,7 @@
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->currentVersion", '', 'button', '', '', 'runCase');
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id&version=$case->version", '', 'button', '', '', 'results');
if($case->lastRunResult == 'fail') common::printIcon('testcase', 'createBug', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", '', 'button', 'bug');
if($case->lastRunResult == 'fail') common::printIcon('testcase', 'createBug', "product=$case->product&extra=caseID=$case->id,version=$case->version,runID=", '', 'button', 'bug', '', 'iframe');
echo '</div>';
echo "<div class='btn-group'>";
+1
View File
@@ -337,6 +337,7 @@ class testtaskModel extends model
->setForce('stepResults', serialize($stepResults))
->add('lastRunner', $this->app->user->account)
->add('date', $now)
->skipSpecial('stepResults')
->remove('steps,reals,result')
->get();
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
+1 -1
View File
@@ -82,7 +82,7 @@ var moduleID = '<?php echo $moduleID;?>';
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '<i class="icon-unlink"></i>', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$productID&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$taskID", $run, 'list', 'bug');
common::printIcon('testcase', 'createBug', "product=$productID&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$taskID", $run, 'list', 'bug', '', 'iframe');
?>
</td>
</tr>