diff --git a/module/block/model.php b/module/block/model.php
index 25b7e2fc0b..c676ecb089 100644
--- a/module/block/model.php
+++ b/module/block/model.php
@@ -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;
}
diff --git a/module/common/view/header.lite.html.php b/module/common/view/header.lite.html.php
index ae2508f2cd..560f800007 100755
--- a/module/common/view/header.lite.html.php
+++ b/module/common/view/header.lite.html.php
@@ -16,7 +16,6 @@ $onlybody = zget($_GET, 'onlybody', 'no');
-
zentaoPMS);
js::exportConfigVars();
diff --git a/module/execution/control.php b/module/execution/control.php
index 9811f255d1..25b7228018 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -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();
}
diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php
index 8b2a97e1ac..a653f8e02b 100644
--- a/module/execution/lang/en.php
+++ b/module/execution/lang/en.php
@@ -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 ';
diff --git a/module/execution/model.php b/module/execution/model.php
index 5296c17f03..0d301e8dad 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -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;
}
/**
diff --git a/module/execution/view/computeburn.html.php b/module/execution/view/computeburn.html.php
index 8cbbbff589..ea9ea7d339 100644
--- a/module/execution/view/computeburn.html.php
+++ b/module/execution/view/computeburn.html.php
@@ -11,11 +11,8 @@
*/
?>
$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";
}
?>
diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php
index 90ec222e0e..87e758c145 100644
--- a/module/execution/view/view.html.php
+++ b/module/execution/view/view.html.php
@@ -12,6 +12,7 @@
?>
+
>
@@ -321,6 +322,19 @@ $(function()
}]
};
+ var delaySets =
+ {
+ label: "execution->charts->burn->graph->delay;?>",
+ color: 'red',
+ pointStrokeColor: 'red',
+ pointHighlightStroke: 'red',
+ pointColor: 'red',
+ fillColor: 'rgba(0,106,241, .07)',
+ pointHighlightFill: '#fff',
+ data:
+ }
+ if(type.match('withdelay')) data.datasets.push(delaySets);
+
var burnChart = $("#burnCanvas").lineChart(data,
{
pointDotStrokeWidth: 2,
diff --git a/module/story/model.php b/module/story/model.php
index 822dfc0087..40de139460 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -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);
}
diff --git a/module/upgrade/model.php b/module/upgrade/model.php
index 5dc35483fa..e1017434f4 100644
--- a/module/upgrade/model.php
+++ b/module/upgrade/model.php
@@ -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);
diff --git a/test/class/block.class.php b/test/class/block.class.php
index 673575a26c..8b61f69ee6 100644
--- a/test/class/block.class.php
+++ b/test/class/block.class.php
@@ -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();
diff --git a/test/class/program.class.php b/test/class/program.class.php
index de87cfb82b..a9f3ef6315 100644
--- a/test/class/program.class.php
+++ b/test/class/program.class.php
@@ -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());
diff --git a/test/class/search.class.php b/test/class/search.class.php
index 8d69fbd912..9021e13d66 100644
--- a/test/class/search.class.php
+++ b/test/class/search.class.php
@@ -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;
}
diff --git a/test/model/block/getqastatisticparams.php b/test/model/block/getqastatisticparams.php
index 280c2e7981..e3567adbb4 100755
--- a/test/model/block/getqastatisticparams.php
+++ b/test/model/block/getqastatisticparams.php
@@ -16,4 +16,5 @@ pid=1
$block = new blockTest();
-r($block->getQaStatisticParamsTest()) && p() && e();
\ No newline at end of file
+r($block->getQaStatisticParamsTest()) && p('type:name') && e('类型'); //测试name
+r($block->getQaStatisticParamsTest()) && p('type:control') && e('select');//测试control
diff --git a/test/model/block/getrecentprojectparams.php b/test/model/block/getrecentprojectparams.php
deleted file mode 100755
index 60b18810b3..0000000000
--- a/test/model/block/getrecentprojectparams.php
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env php
-getRecentProjectParams();
-cid=1
-pid=1
-
-
-
-*/
-
-$block = new blockTest();
-
-r($block->getRecentProjectParamsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/block/getreleaseparams.php b/test/model/block/getreleaseparams.php
index 03cd0771f3..a88bbaff46 100755
--- a/test/model/block/getreleaseparams.php
+++ b/test/model/block/getreleaseparams.php
@@ -16,4 +16,4 @@ pid=1
$block = new blockTest();
-r($block->getReleaseParamsTest()) && p() && e();
\ No newline at end of file
+r($block->getReleaseParamsTest()) && p('name,default,control') && e('数量,20,input'); //测试name
diff --git a/test/model/block/getscrumlistparams.php b/test/model/block/getscrumlistparams.php
index b113738a27..d6469a1283 100755
--- a/test/model/block/getscrumlistparams.php
+++ b/test/model/block/getscrumlistparams.php
@@ -16,4 +16,8 @@ pid=1
$block = new blockTest();
-r($block->getScrumListParamsTest()) && p() && e();
\ No newline at end of file
+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
diff --git a/test/model/block/getscrumproductparams.php b/test/model/block/getscrumproductparams.php
index c29c134c64..c90dc410fc 100755
--- a/test/model/block/getscrumproductparams.php
+++ b/test/model/block/getscrumproductparams.php
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumProductParams();
cid=1
pid=1
-
+测试获取产品区块的参数 >> 数量;20;input
*/
$block = new blockTest();
-r($block->getScrumProductParamsTest()) && p() && e();
\ No newline at end of file
+r($block->getScrumProductParamsTest()) && p('count:name;count:default;count:control') && e('数量;20;input'); // 测试获取产品区块的参数
diff --git a/test/model/block/getscrumroadmapparams.php b/test/model/block/getscrumroadmapparams.php
index 5007f35a07..ae3b926dad 100755
--- a/test/model/block/getscrumroadmapparams.php
+++ b/test/model/block/getscrumroadmapparams.php
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumRoadMapParams();
cid=1
pid=1
-
+测试获取产品路线图区块的参数 >> 0
*/
$block = new blockTest();
-r($block->getScrumRoadMapParamsTest()) && p() && e();
\ No newline at end of file
+r($block->getScrumRoadMapParamsTest()) && p() && e('0'); // 测试获取产品路线图区块的参数
diff --git a/test/model/block/getscrumtestparams.php b/test/model/block/getscrumtestparams.php
index f2e9ca73d0..6414903188 100755
--- a/test/model/block/getscrumtestparams.php
+++ b/test/model/block/getscrumtestparams.php
@@ -10,10 +10,10 @@ title=测试 blockModel->getScrumTestParams();
cid=1
pid=1
-
+测试获取测试单区块的参数 >> 数量;类型
*/
$block = new blockTest();
-r($block->getScrumTestParamsTest()) && p() && e();
\ No newline at end of file
+r($block->getScrumTestParamsTest()) && p('count:name;type:name') && e('数量;类型'); // 测试获取测试单区块的参数
diff --git a/test/model/block/getstatisticparams.php b/test/model/block/getstatisticparams.php
index aec3ccbb16..4e9aa9b7e8 100755
--- a/test/model/block/getstatisticparams.php
+++ b/test/model/block/getstatisticparams.php
@@ -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();
\ No newline at end of file
+$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"}}'); // 获取测试区块的参数
diff --git a/test/model/block/initblock.php b/test/model/block/initblock.php
index 4ff906feca..f50d76795f 100755
--- a/test/model/block/initblock.php
+++ b/test/model/block/initblock.php
@@ -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();
\ No newline at end of file
+$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");
diff --git a/test/model/program/getlist.php b/test/model/program/getlist.php
index 443127d20d..eed70377c7 100755
--- a/test/model/program/getlist.php
+++ b/test/model/program/getlist.php
@@ -2,6 +2,7 @@
> 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'); // 获取分页后顶级项目集个数
diff --git a/test/model/search/appendfiles.php b/test/model/search/appendfiles.php
deleted file mode 100644
index 055bf09795..0000000000
--- a/test/model/search/appendfiles.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-appendFiles();
-cid=1
-pid=1
-
-*/
-
-$search = new searchTest();
-
-r($search->appendFilesTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/search/buildallindex.php b/test/model/search/buildallindex.php
deleted file mode 100644
index f59d4dd5e1..0000000000
--- a/test/model/search/buildallindex.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-buildAllIndex();
-cid=1
-pid=1
-
-*/
-
-$search = new searchTest();
-
-r($search->buildAllIndexTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/search/checkpriv.php b/test/model/search/checkpriv.php
deleted file mode 100644
index 5a66bcc5a6..0000000000
--- a/test/model/search/checkpriv.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-checkPriv();
-cid=1
-pid=1
-
-*/
-
-$search = new searchTest();
-
-r($search->checkPrivTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/search/decode.php b/test/model/search/decode.php
index 0fbb8e4263..0dc37300f0 100644
--- a/test/model/search/decode.php
+++ b/test/model/search/decode.php
@@ -14,4 +14,4 @@ pid=1
$search = new searchTest();
-r($search->decodeTest()) && p() && e();
\ No newline at end of file
+r($search->decodeTest(20135)) && p() && e('产'); //测试将搜索字转化为正确的汉字
diff --git a/test/model/search/deleteindex.php b/test/model/search/deleteindex.php
deleted file mode 100644
index b670de8411..0000000000
--- a/test/model/search/deleteindex.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-deleteIndex();
-cid=1
-pid=1
-
-*/
-
-$search = new searchTest();
-
-r($search->deleteIndexTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/search/getlist.php b/test/model/search/getlist.php
index ee23e709b3..2b3a9704d0 100644
--- a/test/model/search/getlist.php
+++ b/test/model/search/getlist.php
@@ -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'); //测试在版本类型中搜索带有版本字体的条数
diff --git a/test/model/search/getsummary.php b/test/model/search/getsummary.php
index 3cfe9a3d01..69f5c8bd9d 100644
--- a/test/model/search/getsummary.php
+++ b/test/model/search/getsummary.php
@@ -14,4 +14,6 @@ pid=1
$search = new searchTest();
-r($search->getSummaryTest()) && p() && e();
\ No newline at end of file
+r($search->getSummaryTest(1, 0)) && p() && e('【步骤】【结果】【期望】'); //测试搜索的内容中不带关键字的结果展示
+r($search->getSummaryTest(1, 39588)) && p() && e("【步骤 】【结果】【期望】"); //测试搜索的内容中带关键字的结果展示
+
diff --git a/test/model/search/markkeywords.php b/test/model/search/markkeywords.php
index 470a4b15a0..2f56d24da3 100644
--- a/test/model/search/markkeywords.php
+++ b/test/model/search/markkeywords.php
@@ -14,4 +14,4 @@ pid=1
$search = new searchTest();
-r($search->markKeywordsTest()) && p() && e();
\ No newline at end of file
+r($search->markKeywordsTest(1, 39588)) && p() && e("12304 27493 骤 12305 12304 32467 26524 12305 12304 26399 26395 12305"); //测试查找带骤字的bug