Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
+12
-12
@@ -232,7 +232,8 @@ class blockModel extends model
|
||||
/**
|
||||
* Init block when account use first.
|
||||
*
|
||||
* @param string $appName
|
||||
* @param string $module project|product|execution|qa|my
|
||||
* @param string $type scrum|waterfall|kanban
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -531,15 +532,16 @@ class blockModel extends model
|
||||
/**
|
||||
* Get statistic params.
|
||||
*
|
||||
* @param string $module product|project|execution|qa
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getStatisticParams($module = 'product')
|
||||
{
|
||||
if($module == 'product') return $this->getProductStatisticParams($module);
|
||||
if($module == 'project') return $this->getProjectStatisticParams($module);
|
||||
if($module == 'execution') return $this->getExecutionStatisticParams($module);
|
||||
if($module == 'qa') return $this->getQaStatisticParams($module);
|
||||
if($module == 'product') return $this->getProductStatisticParams();
|
||||
if($module == 'project') return $this->getProjectStatisticParams();
|
||||
if($module == 'execution') return $this->getExecutionStatisticParams();
|
||||
if($module == 'qa') return $this->getQaStatisticParams();
|
||||
|
||||
$params = new stdclass();
|
||||
$params = $this->appendCountParams($params);
|
||||
@@ -876,12 +878,11 @@ class blockModel extends model
|
||||
|
||||
/**
|
||||
* Get testtask params.
|
||||
*▫
|
||||
* @param string $module
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getScrumTestParams($module = '')
|
||||
public function getScrumTestParams()
|
||||
{
|
||||
$params = $this->appendCountParams();
|
||||
$params->type['name'] = $this->lang->block->type;
|
||||
@@ -923,11 +924,10 @@ class blockModel extends model
|
||||
/**
|
||||
* Get scrum roadmap list params.
|
||||
*
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return string
|
||||
* @return bool
|
||||
*/
|
||||
public function getScrumRoadMapParams($module = '')
|
||||
public function getScrumRoadMapParams()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ $onlybody = zget($_GET, 'onlybody', 'no');
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<?php
|
||||
echo html::title($title . ' - ' . $lang->zentaoPMS);
|
||||
js::exportConfigVars();
|
||||
|
||||
@@ -2011,8 +2011,18 @@ class execution extends control
|
||||
$this->execution->setMenu($execution->id);
|
||||
$this->app->loadLang('bug');
|
||||
|
||||
list($dateList, $interval) = $this->execution->getDateList($execution->begin, $execution->end, 'noweekend', 0, 'Y-m-d');
|
||||
$chartData = $this->execution->buildBurnData($executionID, $dateList, 'noweekend');
|
||||
$type = 'noweekend';
|
||||
if(((strpos('closed,suspended', $execution->status) === false and helper::today() > $execution->end)
|
||||
or ($execution->status == 'closed' and substr($execution->closedDate, 0, 10) > $execution->end)
|
||||
or ($execution->status == 'suspended' and $execution->suspendedDate > $execution->end))
|
||||
and strpos($type, 'delay') === false)
|
||||
$type .= ',withdelay';
|
||||
|
||||
$deadline = $execution->status == 'closed' ? substr($execution->closedDate, 0, 10) : $execution->suspendedDate;
|
||||
$deadline = strpos('closed,suspended', $execution->status) === false ? helper::today() : $deadline;
|
||||
$endDate = strpos($type, 'withdelay') !== false ? $deadline : $execution->end;
|
||||
list($dateList, $interval) = $this->execution->getDateList($execution->begin, $endDate, $type, 0, 'Y-m-d');
|
||||
$chartData = $this->execution->buildBurnData($executionID, $dateList, $type);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -2036,6 +2046,7 @@ class execution extends control
|
||||
$this->view->statData = $this->execution->statRelatedData($executionID);
|
||||
$this->view->chartData = $chartData;
|
||||
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
|
||||
$this->view->type = $type;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ $lang->execution->linkStory = 'Link Story';
|
||||
$lang->execution->createTask = 'Create Task';
|
||||
$lang->execution->goback = "Go Back";
|
||||
$lang->execution->noweekend = 'Exclude Weekend';
|
||||
$lang->execution->nowdelay = 'Exclude Delay Date';
|
||||
$lang->execution->nodelay = 'Exclude Delay Date';
|
||||
$lang->execution->withweekend = 'Include Weekend';
|
||||
$lang->execution->withdelay = 'Include Delay Date';
|
||||
$lang->execution->interval = 'Intervals ';
|
||||
|
||||
+14
-58
@@ -475,6 +475,8 @@ class executionModel extends model
|
||||
->setIF(helper::isZeroDate($this->post->begin), 'begin', '')
|
||||
->setIF(helper::isZeroDate($this->post->end), 'end', '')
|
||||
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
|
||||
->setIF($this->post->status == 'closed', 'closedDate', helper::now())
|
||||
->setIF($this->post->status == 'suspended', 'suspendedDate', helper::today())
|
||||
->setDefault('team', $this->post->name)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->execution->editor->edit['id'], $this->config->allowedTags)
|
||||
@@ -664,6 +666,8 @@ class executionModel extends model
|
||||
$executions[$executionID]->lastEditedDate = helper::now();
|
||||
if(isset($data->projects)) $executions[$executionID]->project = zget($data->projects, $executionID, 0);
|
||||
if(isset($data->attributes)) $executions[$executionID]->attribute = zget($data->attributes, $executionID, '');
|
||||
if($executions[$executionID]->status == 'closed') $executions[$executionID]->closedDate = helper::now();
|
||||
if($executions[$executionID]->status == 'suspended') $executions[$executionID]->suspendedDate = helper::today();
|
||||
|
||||
/* Check unique code for edited executions. */
|
||||
if($projectModel == 'scrum' and empty($executionCode))
|
||||
@@ -700,6 +704,14 @@ class executionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Update burn before close execution. */
|
||||
$closedIDList = array();
|
||||
foreach($executions as $executionID => $execution)
|
||||
{
|
||||
if(isset($execution->status) and in_array($execution->status, array('done', 'closed', 'suspended'))) $closedIDList[$executionID] = $executionID;
|
||||
}
|
||||
$this->computeBurn($closedIDList);
|
||||
|
||||
foreach($executions as $executionID => $execution)
|
||||
{
|
||||
$oldExecution = $oldExecutions[$executionID];
|
||||
@@ -2841,65 +2853,10 @@ class executionModel extends model
|
||||
->where('type')->in('sprint,stage')
|
||||
->andWhere('lifetime')->ne('ops')
|
||||
->andWhere('status')->notin('done,closed,suspended')
|
||||
->beginIF($executionID)->andWhere('id')->eq($executionID)->fi()
|
||||
->beginIF($executionID)->andWhere('id')->in($executionID)->fi()
|
||||
->fetchPairs();
|
||||
if(!$executions) return array();
|
||||
|
||||
/* Update historical data of burn. */
|
||||
$table = $this->config->edition == 'open' ? TABLE_TASKESTIMATE : TABLE_EFFORT;
|
||||
$field = $this->config->edition == 'open' ? 'task' : 'objectID';
|
||||
$totalConsumed = $this->dao->select("t2.execution as execution, t1.$field as task, t1.date as date, sum(t1.consumed) as totalConsumed")->from($table)->alias('t1')
|
||||
->leftJoin(TABLE_TASK)->alias('t2')->on("t1.$field=t2.id")
|
||||
->where('t2.execution')->in(array_keys($executions))
|
||||
->beginIF($this->config->edition != 'open')->andWhere('t1.objectType')->eq('task')->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->andWhere('t2.parent')->ge('0')
|
||||
->andWhere('t2.status')->ne('cancel')
|
||||
->andWhere('t1.date')->ne($today)
|
||||
->groupBy("t1.$field, t1.date")
|
||||
->orderBy('t1.id_desc')
|
||||
->fetchGroup('task', 'date');
|
||||
|
||||
$latestIdList = $this->dao->select('max(id) as id')->from($table)
|
||||
->where($field)->in(array_keys($totalConsumed))
|
||||
->beginIF($this->config->edition != 'open')->andWhere('objectType')->eq('task')->fi()
|
||||
->groupBy("$field,date")->fetchAll('id');
|
||||
$latestLefts = $this->dao->select("$field, date, `left`")->from($table)
|
||||
->where('id')->in(array_keys($latestIdList))
|
||||
->fetchGroup($field, 'date');
|
||||
|
||||
$burnList = array();
|
||||
foreach($totalConsumed as $taskID => $consumedList)
|
||||
{
|
||||
foreach($consumedList as $date => $consumed)
|
||||
{
|
||||
$executionID = $consumed->execution;
|
||||
if(!isset($burnList[$executionID])) $burnList[$executionID] = array();
|
||||
|
||||
if(!isset($burnList[$executionID][$date]))
|
||||
{
|
||||
$burnList[$executionID][$date] = new stdclass();
|
||||
$burnList[$executionID][$date]->consumed = 0;
|
||||
$burnList[$executionID][$date]->left = 0;
|
||||
}
|
||||
|
||||
$burnList[$executionID][$date]->consumed += $consumed->totalConsumed;
|
||||
$burnList[$executionID][$date]->left += $latestLefts[$taskID][$date]->left;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($burnList as $executionID => $burns)
|
||||
{
|
||||
foreach($burns as $date => $burn)
|
||||
{
|
||||
$burn->execution = $executionID;
|
||||
$burn->date = $date;
|
||||
|
||||
$this->dao->replace(TABLE_BURN)->data($burn)->exec();
|
||||
$burn->executionName = $executions[$burn->execution];
|
||||
}
|
||||
}
|
||||
|
||||
/* Update today's data of burn. */
|
||||
$burns = $this->dao->select("execution, '$today' AS date, sum(estimate) AS `estimate`, sum(`left`) AS `left`, SUM(consumed) AS `consumed`")
|
||||
->from(TABLE_TASK)
|
||||
@@ -2953,10 +2910,9 @@ class executionModel extends model
|
||||
|
||||
$this->dao->replace(TABLE_BURN)->data($burn)->exec();
|
||||
$burn->executionName = $executions[$burn->execution];
|
||||
$burnList[$executionID][$today] = $burn;
|
||||
}
|
||||
|
||||
return $burnList;
|
||||
return $burns;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,11 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
foreach($burns as $executionID => $burnList)
|
||||
foreach($burns as $burn)
|
||||
{
|
||||
foreach($burnList as $date => $burn)
|
||||
{
|
||||
echo $burn->execution . "\t" . $burn->executionName . "\t" . $burn->date . "\t" . $burn->left . "\n";
|
||||
}
|
||||
echo $burn->execution . "\t" . $burn->executionName . "\t" . $burn->date . "\t" . $burn->left . "\n";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php $style = isonlybody() ? 'style="padding-top: 0px;"' : '';?>
|
||||
<div id='mainContent' class="main-row" <?php echo $style;?>>
|
||||
<div class="col-8 main-col">
|
||||
@@ -321,6 +322,19 @@ $(function()
|
||||
}]
|
||||
};
|
||||
|
||||
var delaySets =
|
||||
{
|
||||
label: "<?php echo $lang->execution->charts->burn->graph->delay;?>",
|
||||
color: 'red',
|
||||
pointStrokeColor: 'red',
|
||||
pointHighlightStroke: 'red',
|
||||
pointColor: 'red',
|
||||
fillColor: 'rgba(0,106,241, .07)',
|
||||
pointHighlightFill: '#fff',
|
||||
data: <?php echo isset($chartData['delayLine']) ? $chartData['delayLine'] : '[]';?>
|
||||
}
|
||||
if(type.match('withdelay')) data.datasets.push(delaySets);
|
||||
|
||||
var burnChart = $("#burnCanvas").lineChart(data,
|
||||
{
|
||||
pointDotStrokeWidth: 2,
|
||||
|
||||
@@ -1591,7 +1591,11 @@ class storyModel extends model
|
||||
$this->updateParentStatus($storyID, $oldStory->parent);
|
||||
$this->setStage($oldStory->parent);
|
||||
}
|
||||
if(!dao::isError()) $this->loadModel('score')->create('story', 'close', $storyID);
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->setStage($storyID);
|
||||
$this->loadModel('score')->create('story', 'close', $storyID);
|
||||
}
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
|
||||
|
||||
@@ -6106,7 +6106,7 @@ class upgradeModel extends model
|
||||
$content = file_get_contents($filePath);
|
||||
if(strpos(basename($filePath), 'html'))
|
||||
{
|
||||
$content = preg_replace('#(include )(\'|")((../){2,})([a-z]+/)(?!ext/)([a-z]+/)#', '$1' . '$app->getModuleRoot() . ' . '"$5$6', $content);
|
||||
$content = preg_replace('#(include )(\'|")((../){2,})([a-z]+/)(?!ext/)([a-z]+/)#', '$1' . '$app->getModuleRoot() . ' . '$2$5$6', $content);
|
||||
|
||||
$systemFiles = file_get_contents('systemfiles.txt');
|
||||
$systemFiles = str_replace('/', DS, $systemFiles);
|
||||
|
||||
+62
-14
@@ -135,13 +135,32 @@ class blockTest
|
||||
return json_encode($objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init block when account use first.
|
||||
*
|
||||
* @param string $module project|product|execution|qa|my
|
||||
* @param string $type scrum|waterfall|kanban
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function initBlockTest($module, $type = '')
|
||||
{
|
||||
$objects = $this->objectModel->initBlock($module, $type = '');
|
||||
global $tester;
|
||||
$this->objectModel->initBlock($module, $type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$object = new stdclass();
|
||||
$account = $tester->app->user->account;
|
||||
$section = $module == 'project' ? $type . 'common' : 'common';
|
||||
|
||||
$object->blockInited = $tester->loadModel('setting')->getItem("owner=$account&module=$module§ion=$section&key=blockInited");
|
||||
$object->blockversion = $tester->loadModel('setting')->getItem("owner=$account&module=$module§ion=block&key=initVersion");
|
||||
|
||||
$blockData = $this->objectModel->getBlockList($module, $type);
|
||||
$object->blockData = current($blockData);
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,7 +306,9 @@ class blockTest
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$objects = json_decode($objects);
|
||||
|
||||
return $objects->count;
|
||||
}
|
||||
|
||||
public function getProjectParamsTest()
|
||||
@@ -352,13 +373,20 @@ class blockTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get statistic params.
|
||||
*
|
||||
* @param string $module product|project|execution|qa
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getStatisticParamsTest($module = 'product')
|
||||
{
|
||||
$objects = $this->objectModel->getStatisticParams($module = 'product');
|
||||
$objects = $this->objectModel->getStatisticParams($module);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return json_encode(json_decode($objects), JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
public function getProductStatisticParamsTest()
|
||||
@@ -402,11 +430,11 @@ class blockTest
|
||||
|
||||
public function getQaStatisticParamsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getQaStatisticParams();
|
||||
$object = $this->objectModel->getQaStatisticParams();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
return json_decode($object);
|
||||
}
|
||||
|
||||
public function getRecentProjectParamsTest()
|
||||
@@ -559,9 +587,15 @@ class blockTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getScrumTestParamsTest($module = '')
|
||||
/**
|
||||
* Get testtask params.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getScrumTestParamsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getScrumTestParams($module = '');
|
||||
$objects = json_decode($this->objectModel->getScrumTestParams());
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
@@ -574,7 +608,9 @@ class blockTest
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
$objects = json_decode($objects);
|
||||
|
||||
return $objects->type;
|
||||
}
|
||||
|
||||
public function getScrumOverviewParamsTest($module = '')
|
||||
@@ -586,18 +622,30 @@ class blockTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getScrumRoadMapParamsTest($module = '')
|
||||
/**
|
||||
* Get scrum roadmap list params.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getScrumRoadMapParamsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getScrumRoadMapParams($module = '');
|
||||
$objects = $this->objectModel->getScrumRoadMapParams();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getScrumProductParamsTest($module = '')
|
||||
/**
|
||||
* Get scrum product list params.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getScrumProductParamsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getScrumProductParams($module = '');
|
||||
$objects = json_decode($this->objectModel->getScrumProductParams());
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class programTest
|
||||
*
|
||||
* @param array $data
|
||||
* @access public
|
||||
* @return object
|
||||
* @return object
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
@@ -54,13 +54,17 @@ class programTest
|
||||
* Test get list.
|
||||
*
|
||||
* @param mixed $status
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $type top|child
|
||||
* @param mixed $idList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL)
|
||||
public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL, $type = '', $idList = '')
|
||||
{
|
||||
$this->program->cookie->showClosed = 'ture';
|
||||
$programs = $this->program->getList($status, $orderBy, $pager);
|
||||
$programs = $this->program->getList($status, $orderBy, $pager, $type, $idList);
|
||||
|
||||
if(dao::isError()) return array('message' => dao::getError());
|
||||
|
||||
|
||||
+95
-54
@@ -12,7 +12,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryTest($queryID)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getByIDTest($queryID)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function deleteQueryTest($queryID)
|
||||
{
|
||||
@@ -69,9 +69,9 @@ class searchTest
|
||||
/**
|
||||
* Test get query pairs.
|
||||
*
|
||||
* @param int $module
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryPairsTest($module)
|
||||
{
|
||||
@@ -85,10 +85,10 @@ class searchTest
|
||||
/**
|
||||
* Test get list.
|
||||
*
|
||||
* @param int $keywords
|
||||
* @param int $type
|
||||
* @param string $keywords
|
||||
* @param sreing $type
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function getListTest($keywords, $type)
|
||||
{
|
||||
@@ -119,10 +119,10 @@ class searchTest
|
||||
/**
|
||||
* Test save index.
|
||||
*
|
||||
* @param int $objectType
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function saveIndexTest($objectType, $objectID)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ class searchTest
|
||||
*
|
||||
* @param string $word
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function saveDictTest($word)
|
||||
{
|
||||
@@ -171,69 +171,110 @@ class searchTest
|
||||
/**
|
||||
* Test decode.
|
||||
*
|
||||
* @param int $string
|
||||
* @param int $key
|
||||
* @access public
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function decodeTest($string)
|
||||
public function decodeTest($key)
|
||||
{
|
||||
$objects = $this->objectModel->decode($string);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$objects = $this->objectModel->decode($key);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getSummaryTest($content, $words)
|
||||
/**
|
||||
* Test get summary.
|
||||
*
|
||||
* @param int $indexID
|
||||
* @param string $words
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSummaryTest($indexID, $words)
|
||||
{
|
||||
$objects = $this->objectModel->getSummary($content, $words);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$searchIndex = $tester->dao->select('*')->from(TABLE_SEARCHINDEX)->where('id')->eq($indexID)->fetch();
|
||||
|
||||
$objects = $this->objectModel->getSummary($searchIndex->content, $words);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function checkPrivTest($results)
|
||||
/**
|
||||
* Test mark keywords.
|
||||
*
|
||||
* @param int $indexID
|
||||
* @param string $keywords
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function markKeywordsTest($indexID, $keywords)
|
||||
{
|
||||
$objects = $this->objectModel->checkPriv($results);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$searchIndex = $tester->dao->select('*')->from(TABLE_SEARCHINDEX)->where('id')->eq($indexID)->fetch();
|
||||
|
||||
$objects = $this->objectModel->markKeywords($searchIndex->content, $keywords);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function markKeywordsTest($content, $keywords)
|
||||
{
|
||||
$objects = $this->objectModel->markKeywords($content, $keywords);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function buildAllIndexTest($type = '', $lastID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->buildAllIndex($type = '', $lastID = 0);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteIndexTest($objectType, $objectID)
|
||||
{
|
||||
$objects = $this->objectModel->deleteIndex($objectType, $objectID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function appendFilesTest($object)
|
||||
{
|
||||
$objects = $this->objectModel->appendFiles($object);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
@@ -16,4 +16,5 @@ pid=1
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getQaStatisticParamsTest()) && p() && e();
|
||||
r($block->getQaStatisticParamsTest()) && p('type:name') && e('类型'); //测试name
|
||||
r($block->getQaStatisticParamsTest()) && p('type:control') && e('select');//测试control
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 blockModel->getRecentProjectParams();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getRecentProjectParamsTest()) && p() && e();
|
||||
@@ -16,4 +16,4 @@ pid=1
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getReleaseParamsTest()) && p() && e();
|
||||
r($block->getReleaseParamsTest()) && p('name,default,control') && e('数量,20,input'); //测试name
|
||||
|
||||
@@ -16,4 +16,8 @@ pid=1
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getScrumListParamsTest()) && p() && e();
|
||||
r($block->getScrumListParamsTest()) && p('name,control') && e('类型,select'); //测试name和select
|
||||
r($block->getScrumListParamsTest()) && p('options:undone') && e('未完成'); //测试options
|
||||
r($block->getScrumListParamsTest()) && p('options:doing') && e('进行中'); //测试options
|
||||
r($block->getScrumListParamsTest()) && p('options:all') && e('全部'); //测试options
|
||||
r($block->getScrumListParamsTest()) && p('options:involved') && e('我参与'); //测试options
|
||||
|
||||
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumProductParams();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
测试获取产品区块的参数 >> 数量;20;input
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getScrumProductParamsTest()) && p() && e();
|
||||
r($block->getScrumProductParamsTest()) && p('count:name;count:default;count:control') && e('数量;20;input'); // 测试获取产品区块的参数
|
||||
|
||||
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumRoadMapParams();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
测试获取产品路线图区块的参数 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getScrumRoadMapParamsTest()) && p() && e();
|
||||
r($block->getScrumRoadMapParamsTest()) && p() && e('0'); // 测试获取产品路线图区块的参数
|
||||
|
||||
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumTestParams();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
测试获取测试单区块的参数 >> 数量;类型
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getScrumTestParamsTest()) && p() && e();
|
||||
r($block->getScrumTestParamsTest()) && p('count:name;type:name') && e('数量;类型'); // 测试获取测试单区块的参数
|
||||
|
||||
@@ -10,10 +10,25 @@ title=测试 blockModel->getStatisticParams();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
获取空区块的参数 >> {"count":{"name":"数量","default":20,"control":"input"}}
|
||||
获取产品区块的参数 >> {"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"noclosed":"未关闭","closed":"已关闭","all":"全部","involved":"我参与"},"control":"select"}}
|
||||
获取项目区块的参数 >> {"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"undone":"未完成","doing":"进行中","all":"全部","involved":"我参与的"},"control":"select"}}
|
||||
获取执行区块的参数 >> {"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"undone":"未完成","doing":"进行中","all":"所有","involved":"我参与"},"control":"select"}}
|
||||
获取测试区块的参数 >> {"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"noclosed":"未关闭","closed":"已关闭","all":"全部","involved":"我参与"},"control":"select"}}
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->getStatisticParamsTest()) && p() && e();
|
||||
$data = array();
|
||||
$data[0] = $block->getStatisticParamsTest('');
|
||||
$data[1] = $block->getStatisticParamsTest('product');
|
||||
$data[2] = $block->getStatisticParamsTest('project');
|
||||
$data[3] = $block->getStatisticParamsTest('execution');
|
||||
$data[4] = $block->getStatisticParamsTest('qa');
|
||||
|
||||
r($data[0]) && p() && e('{"count":{"name":"数量","default":20,"control":"input"}}'); // 获取空区块的参数
|
||||
r($data[1]) && p() && e('{"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"noclosed":"未关闭","closed":"已关闭","all":"全部","involved":"我参与"},"control":"select"}}'); // 获取产品区块的参数
|
||||
r($data[2]) && p() && e('{"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"undone":"未完成","doing":"进行中","all":"全部","involved":"我参与的"},"control":"select"}}'); // 获取项目区块的参数
|
||||
r($data[3]) && p() && e('{"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"undone":"未完成","doing":"进行中","all":"所有","involved":"我参与"},"control":"select"}}'); // 获取执行区块的参数
|
||||
r($data[4]) && p() && e('{"count":{"name":"数量","default":20,"control":"input"},"type":{"name":"类型","options":{"noclosed":"未关闭","closed":"已关闭","all":"全部","involved":"我参与"},"control":"select"}}'); // 获取测试区块的参数
|
||||
|
||||
@@ -10,10 +10,52 @@ title=测试 blockModel->initBlock();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
获取敏捷项目的区块版本 >> 1;2
|
||||
获取敏捷项目的区块数据 >> project;scrum
|
||||
获取瀑布项目的区块版本 >> 1;2
|
||||
获取瀑布项目的区块数据 >> project;waterfall
|
||||
获取看板项目的区块版本 >> 1;2
|
||||
获取看板项目的区块数据 >> project;kanban
|
||||
获取产品的区块版本 >> 1;2
|
||||
获取产品的区块数据 >> product;
|
||||
获取执行的区块版本 >> 1;2
|
||||
获取执行的区块数据 >> execution;
|
||||
获取地盘的区块版本 >> 1;2
|
||||
获取地盘的区块数据 >> my;
|
||||
获取测试的区块版本 >> 1;2
|
||||
获取测试的区块数据 >> qa;
|
||||
获取空区块版本 >> 1;2
|
||||
获取空区块数据 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$block = new blockTest();
|
||||
|
||||
r($block->initBlockTest()) && p() && e();
|
||||
$dataList = array();
|
||||
$dataList[0] = $block->initBlockTest('project', 'scrum');
|
||||
$dataList[1] = $block->initBlockTest('project', 'waterfall');
|
||||
$dataList[2] = $block->initBlockTest('project', 'kanban');
|
||||
$dataList[3] = $block->initBlockTest('product');
|
||||
$dataList[4] = $block->initBlockTest('execution');
|
||||
$dataList[5] = $block->initBlockTest('my');
|
||||
$dataList[6] = $block->initBlockTest('qa');
|
||||
$dataList[7] = $block->initBlockTest('');
|
||||
|
||||
r($dataList[0]) && p("blockInited;blockversion") && e('1;2'); // 获取敏捷项目的区块版本
|
||||
r($dataList[0]) && p("blockData:module;blockData:type") && e('project;scrum'); // 获取敏捷项目的区块数据
|
||||
r($dataList[1]) && p("blockInited;blockversion") && e('1;2'); // 获取瀑布项目的区块版本
|
||||
r($dataList[1]) && p("blockData:module;blockData:type") && e('project;waterfall'); // 获取瀑布项目的区块数据
|
||||
r($dataList[2]) && p("blockInited;blockversion") && e('1;2'); // 获取看板项目的区块版本
|
||||
r($dataList[2]) && p("blockData:module;blockData:type") && e('project;kanban'); // 获取看板项目的区块数据
|
||||
r($dataList[3]) && p("blockInited;blockversion") && e('1;2'); // 获取产品的区块版本
|
||||
r($dataList[3]) && p("blockData:module;blockData:type") && e('product;'); // 获取产品的区块数据
|
||||
r($dataList[4]) && p("blockInited;blockversion") && e('1;2'); // 获取执行的区块版本
|
||||
r($dataList[4]) && p("blockData:module;blockData:type") && e('execution;'); // 获取执行的区块数据
|
||||
r($dataList[5]) && p("blockInited;blockversion") && e('1;2'); // 获取地盘的区块版本
|
||||
r($dataList[5]) && p("blockData:module;blockData:type") && e('my;'); // 获取地盘的区块数据
|
||||
r($dataList[6]) && p("blockInited;blockversion") && e('1;2'); // 获取测试的区块版本
|
||||
r($dataList[6]) && p("blockData:module;blockData:type") && e('qa;'); // 获取测试的区块数据
|
||||
r($dataList[7]) && p("blockInited;blockversion") && e('1;2'); // 获取空区块版本
|
||||
r($dataList[7]) && p("blockData") && e('0'); // 获取空区块数据
|
||||
|
||||
system("./ztest init");
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/program.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,11 +10,15 @@ title=测试 programModel::getList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查看所有项目和项目集的个数 >> 100
|
||||
查看所有'wait'的项目和项目集的个数 >> 34
|
||||
查看所有'doing'的项目和项目集的个数 >> 44
|
||||
查看所有项目和项目集的个数 >> 120
|
||||
查看分页后项目集和项目的个数 >> 10
|
||||
查看所有'closed'的项目和项目集的个数 >> 11
|
||||
查看所有'suspended'的项目和项目集的个数 >> 11
|
||||
查看所有'closed'的项目和项目集的个数 >> 11
|
||||
按照项目和项目集名称倒序获取第一个ID >> 9
|
||||
按照ID正序获取项目和项目集列表第一个ID >> 1
|
||||
获取顶级项目集个数 >> 30
|
||||
获取分页后顶级项目集个数 >> 10
|
||||
获取type=child 项目集个数 >> 120
|
||||
|
||||
*/
|
||||
|
||||
@@ -28,6 +33,9 @@ $closedPrograms = $program->getList('closed');
|
||||
$suspendedPrograms = $program->getList('closed');
|
||||
$namedescPrograms = $program->getList('all', 'name_desc');
|
||||
$idascPrograms = $program->getList('all', 'id_asc');
|
||||
$topPrograms = $program->getList('all', 'id_asc', null, 'top');
|
||||
$topPagePrograms = $program->getList('all', 'id_asc', $pager, 'top');
|
||||
$childPrograms = $program->getList('all', 'id_asc', null, 'child', $topPrograms);
|
||||
|
||||
r(count($allPorgrams)) && p() && e('120'); // 查看所有项目和项目集的个数
|
||||
r(count($pagerPrograms)) && p() && e('10'); // 查看分页后项目集和项目的个数
|
||||
@@ -35,3 +43,6 @@ r(count($closedPrograms)) && p() && e('11'); // 查看所有'closed'的项
|
||||
r(count($suspendedPrograms)) && p() && e('11'); // 查看所有'suspended'的项目和项目集的个数
|
||||
r(key($namedescPrograms)) && p() && e('9'); // 按照项目和项目集名称倒序获取第一个ID
|
||||
r(key($idascPrograms)) && p() && e('1'); // 按照ID正序获取项目和项目集列表第一个ID
|
||||
r(count($topPrograms)) && p() && e('30'); // 获取顶级项目集个数
|
||||
r(count($topPagePrograms)) && p() && e('10'); // 获取分页后顶级项目集个数
|
||||
r(count($childPrograms)) && p() && e('120'); // 获取分页后顶级项目集个数
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->appendFiles();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->appendFilesTest()) && p() && e();
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->buildAllIndex();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->buildAllIndexTest()) && p() && e();
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->checkPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->checkPrivTest()) && p() && e();
|
||||
@@ -14,4 +14,4 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->decodeTest()) && p() && e();
|
||||
r($search->decodeTest(20135)) && p() && e('产'); //测试将搜索字转化为正确的汉字
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->deleteIndex();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->deleteIndexTest()) && p() && e();
|
||||
@@ -39,7 +39,7 @@ $searchWords = array('任务','bug','用例','文档','待办','版本','用例
|
||||
r($search->getListTest($searchWords[0], $searchType[0])) && p() && e('1246'); //测试在全部类型中搜索带有任务字体的条数
|
||||
r($search->getListTest($searchWords[0], $searchType[1])) && p() && e('910'); //测试在任务类型中搜索带有任务字体的条数
|
||||
r($search->getListTest($searchWords[1], $searchType[2])) && p() && e('239'); //测试在bug类型中搜索带有bug字体的条数
|
||||
r($search->getListTest($searchWords[2], $searchType[3])) && p() && e('208'); //测试在用例类型中搜索带有用例字体的条数
|
||||
r($search->getListTest($searchWords[2], $searchType[3])) && p() && e('97'); //测试在用例类型中搜索带有用例字体的条数
|
||||
r($search->getListTest($searchWords[3], $searchType[4])) && p() && e('900'); //测试在文档类型中搜索带有文档字体的条数
|
||||
r($search->getListTest($searchWords[4], $searchType[5])) && p() && e('1680'); //测试在待办类型中搜索带有待办字体的条数
|
||||
r($search->getListTest($searchWords[5], $searchType[6])) && p() && e('20'); //测试在版本类型中搜索带有版本字体的条数
|
||||
|
||||
@@ -14,4 +14,6 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->getSummaryTest()) && p() && e();
|
||||
r($search->getSummaryTest(1, 0)) && p() && e('【步骤】【结果】【期望】'); //测试搜索的内容中不带关键字的结果展示
|
||||
r($search->getSummaryTest(1, 39588)) && p() && e("【步<span class='text-danger'>骤</span> 】【结果】【期望】"); //测试搜索的内容中带关键字的结果展示
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->markKeywordsTest()) && p() && e();
|
||||
r($search->markKeywordsTest(1, 39588)) && p() && e("12304 27493 <span class='text-danger'>骤</span> 12305 12304 32467 26524 12305 12304 26399 26395 12305"); //测试查找带骤字的bug
|
||||
|
||||
Reference in New Issue
Block a user