@@ -351,6 +342,7 @@ $(function()
})
+
-
diff --git a/module/upgrade/view/to18guide.html.php b/module/upgrade/view/to18guide.html.php
new file mode 100644
index 0000000000..53bead6f5f
--- /dev/null
+++ b/module/upgrade/view/to18guide.html.php
@@ -0,0 +1,118 @@
+
+ * @package upgrade
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+?>
+
+
+
diff --git a/module/user/model.php b/module/user/model.php
index e779699ede..e7ca37c431 100644
--- a/module/user/model.php
+++ b/module/user/model.php
@@ -1756,7 +1756,7 @@ class userModel extends model
if($allProducts === null) $allProducts = $this->dao->select('id,PO,QD,RD,createdBy,acl,whitelist,program,createdBy')->from(TABLE_PRODUCT)->where('acl')->ne('open')->fetchAll('id');
if($allProjects === null) $allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,type,path,parent,openedBy')->from(TABLE_PROJECT)->where('acl')->ne('open')->andWhere('type')->eq('project')->fetchAll('id');
if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,type,path,parent,openedBy')->from(TABLE_PROGRAM)->where('acl')->ne('open')->andWhere('type')->eq('program')->fetchAll('id');
- if($allSprints === null) $allSprints = $this->dao->select('id,PO,PM,QD,RD,acl,project,path,parent,type,openedBy')->from(TABLE_PROJECT)->where('acl')->eq('private')->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage,kanban')->fi()->fetchAll('id');
+ if($allSprints === null) $allSprints = $this->dao->select('id,PO,PM,QD,RD,acl,project,path,parent,type,openedBy')->from(TABLE_PROJECT)->where('acl')->eq('private')->andWhere('type')->in('sprint,stage,kanban')->fetchAll('id');
/* Get admins. */
$manageObjects = array();
@@ -1938,8 +1938,7 @@ class userModel extends model
$teamGroups = array();
$stmt = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('1=1')
- ->beginIF($this->config->systemMode == 'new')->andWhere('type')->eq('project')->fi()
- ->beginIF($this->config->systemMode == 'classic')->andWhere('type')->eq('execution')->fi()
+ ->andWhere('type')->eq('project')
->andWhere('root')->in(array_keys($projectProducts))
->andWhere('root')->ne(0)
->query();
@@ -2057,8 +2056,8 @@ class userModel extends model
/* Set opened sprints and stages into userview. */
$openedSprints = $this->dao->select('id')->from(TABLE_PROJECT)
->where('acl')->eq('open')
- ->beginIF($this->config->systemMode == 'new')->andWhere('type')->in('sprint,stage,kanban')->fi()
- ->beginIF($this->config->systemMode == 'new')->andWhere('project')->in($userView->projects)->fi()
+ ->andWhere('type')->in('sprint,stage,kanban')
+ ->andWhere('project')->in($userView->projects)
->fetchAll('id');
$openedSprints = join(',', array_keys($openedSprints));
@@ -2516,7 +2515,7 @@ class userModel extends model
}
/* Judge sprint auth. */
- if(($project->type == 'sprint' or $project->type == 'stage' or $project->type == 'kanban') and $project->acl == 'private' and $this->config->systemMode == 'new')
+ if(($project->type == 'sprint' or $project->type == 'stage' or $project->type == 'kanban') and $project->acl == 'private')
{
$parent = $this->dao->select('openedBy,PM')->from(TABLE_PROJECT)->where('id')->eq($project->project)->fetch();
if(empty($parent)) return false;
@@ -2611,7 +2610,7 @@ class userModel extends model
}
/* Judge sprint auth. */
- if(($project->type == 'sprint' || $project->type == 'stage') && $project->acl == 'private' && $this->config->systemMode == 'new')
+ if(($project->type == 'sprint' || $project->type == 'stage') && $project->acl == 'private')
{
$parent = $this->dao->select('openedBy,PM')->from(TABLE_PROJECT)->where('id')->eq($project->project)->fetch();
$users[$parent->openedBy] = $parent->openedBy;
@@ -2976,7 +2975,7 @@ class userModel extends model
*/
public function processAccountSort($users = array())
{
- if(isset($users[$this->app->user->account]))
+ if(isset($this->app->user->account) and isset($users[$this->app->user->account]))
{
$currentUser = array();
$currentUser[$this->app->user->account] = $users[$this->app->user->account];
diff --git a/test/class/execution.class.php b/test/class/execution.class.php
index 7e7284d0e2..c2efc8c0ea 100644
--- a/test/class/execution.class.php
+++ b/test/class/execution.class.php
@@ -2382,4 +2382,20 @@ class executionTest
return $tester->app->user->view->sprints;
}
}
+
+ /**
+ * Create default sprint.
+ *
+ * @param int $projectID
+ * @access public
+ * @return int
+ */
+ public function createDefaultSprintTest($projectID)
+ {
+ $result = $this->objectModel->createDefaultSprint($projectID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $result;
+ }
}
diff --git a/test/class/program.class.php b/test/class/program.class.php
index a9f3ef6315..2ce4dd705c 100644
--- a/test/class/program.class.php
+++ b/test/class/program.class.php
@@ -50,6 +50,19 @@ class programTest
return $this->program->getStakeholdersByPrograms($programID);
}
+ /**
+ * Create default program.
+ *
+ * @access public
+ * @return void
+ */
+ public function createDefaultProgramTest()
+ {
+ $programID = $this->program->createDefaultProgram();
+
+ return $programID;
+ }
+
/**
* Test get list.
*
diff --git a/test/class/setting.class.php b/test/class/setting.class.php
index 95b3769040..bd3fb39806 100644
--- a/test/class/setting.class.php
+++ b/test/class/setting.class.php
@@ -108,6 +108,19 @@ class settingTest
return $object;
}
+ /**
+ * Parse item path test.
+ *
+ * @param string $path
+ * @access public
+ * @return object
+ */
+ public function parseItemPathTest($path)
+ {
+ $object = $this->objectModel->parseItemPath($path);
+ return $object;
+ }
+
/**
* Parse the param string for select or delete items.
*
diff --git a/test/data/feedback.yaml b/test/data/feedback.yaml
new file mode 100644
index 0000000000..4fe0306a42
--- /dev/null
+++ b/test/data/feedback.yaml
@@ -0,0 +1,219 @@
+title: table zt_feedback
+desc: "模块"
+author: zongjun.lan
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 1-1000
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: product
+ note: "所属产品"
+ range: 1-100{4}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: module
+ note: "所属模块"
+ range: 4521-4820{1}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: title
+ note: "标题"
+ range: 1-10000
+ prefix: "反馈标题"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: type
+ note: "反馈类型"
+ range: story,task,bug,todo,advice,issue,risk,opportunity
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: solution
+ note: "处理方案"
+ range: tobug,tostory,touserstory,totask,totodo
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: desc
+ note: "描述"
+ range: 1-10000
+ prefix: "这是反馈描述"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: status
+ note: "状态"
+ range: noreview,clarify,wait,commenting,replied,asked,closed
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: subStatus
+ note: "子状态"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: public
+ note: "公开"
+ range: 0,1
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: notify
+ note: "通知"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: notifyEmail
+ note: "通知邮箱"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: likes
+ note: "点赞人"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: result
+ note: "转化结果"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: faq
+ note: "FAQ"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: openedBy
+ note: "反馈创建人"
+ range: admin
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: openedDate
+ range: "(-1M)-(+1w):-1D"
+ type: timestamp
+ format: "YYYY-MM-DD hh:mm:ss"
+ - field: reviewedBy
+ note: "由谁评审"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: reviewedDate
+ note: "评审时间"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: processedBy
+ note: "由谁处理"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: processedDate
+ note: "处理时间"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: closedBy
+ note: "由谁关闭"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: closedDate
+ note: "关闭时间"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: closedReason
+ note: "关闭原因"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: editedBy
+ note: "最后处理人"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: editedDate
+ note: "最后修改时间"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: assignedTo
+ note: "指派给"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: assignedDate
+ note: "指派时间"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: feedbackBy
+ note: "反馈者"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: mailto
+ note: "抄送给"
+ range: ""
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
diff --git a/test/data/feedbackmodule.yaml b/test/data/feedbackmodule.yaml
new file mode 100644
index 0000000000..aa138815db
--- /dev/null
+++ b/test/data/feedbackmodule.yaml
@@ -0,0 +1,79 @@
+title: table zt_module
+desc: "模块"
+author: zongjun.lan
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 4521-4620
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: root
+ note: "根目录"
+ range: 1-100
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: branch
+ note: "分支"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: name
+ note: "模块名称"
+ range: 1-10000
+ prefix: "feedback模块"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: parent
+ note: "父ID"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: path
+ note: "ID路径"
+ fields:
+ - field: path1
+ range: 4521-4620
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: []
+ postfix: ""
+ format: ""
+ - field: grade
+ note: "等级"
+ range: 1
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: order
+ note: "排序"
+ range: 10-100:10
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: type
+ note: "对象类型"
+ range: feedback
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
diff --git a/test/data/feedbackmoduleson.yaml b/test/data/feedbackmoduleson.yaml
new file mode 100644
index 0000000000..681b458972
--- /dev/null
+++ b/test/data/feedbackmoduleson.yaml
@@ -0,0 +1,79 @@
+title: table zt_module
+desc: "模块"
+author: zongjun.lan
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 4621-4820
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: root
+ note: "根目录"
+ range: 1-100{2}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: branch
+ note: "分支"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: name
+ note: "模块名称"
+ range: 1-10000
+ prefix: "feedback子模块"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: parent
+ note: "父ID"
+ range: 4521-4620{2}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: path
+ note: "ID路径"
+ fields:
+ - field: path1
+ range: 4521-4620{2}
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: 4621-4820
+ postfix: ","
+ format: ""
+ - field: grade
+ note: "等级"
+ range: 2
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: order
+ note: "排序"
+ range: 10-100:10
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: type
+ note: "对象类型"
+ range: feedback
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php
index 1dd6d8f647..fc44770af3 100644
--- a/test/data/zentao/config.php
+++ b/test/data/zentao/config.php
@@ -21,33 +21,36 @@ $builder->project = array('rows' => 90, 'extends' => array('project', 'proj
$builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution'));
$builder->projectalone = array('rows' => 20, 'extends' => array('project', 'projectalone'));
-$builder->story = array('rows' => 400, 'extends' => array('story'));
-$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory'));
-$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview'));
-$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
-$builder->storymoduleson = array('rows' => 400, 'extends' => array('module','storymoduleson'));
-$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
-$builder->storystage = array('rows' => 450, 'extends' => array('storystage'));
-$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec'));
-$builder->storyestimate = array('rows' => 6, 'extends' => array('storyestimate'));
-$builder->relation = array('rows' => 12, 'extends' => array('relation'));
-$builder->task = array('rows' => 600, 'extends' => array('task','task'));
-$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
-$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec'));
-$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule'));
-$builder->taskmoduleson = array('rows' => 600, 'extends' => array('module','taskmoduleson'));
-$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate'));
-$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson'));
-$builder->case = array('rows' => 400, 'extends' => array('case'));
-$builder->libcase = array('rows' => 10, 'extends' => array('case','libcase'));
-$builder->unitcase = array('rows' => 150, 'extends' => array('case','unitcase'));
-$builder->casestep = array('rows' => 400, 'extends' => array('casestep'));
-$builder->casemodule = array('rows' => 100, 'extends' => array('module', 'casemodule'));
-$builder->casemoduleson = array('rows' => 200, 'extends' => array('module', 'casemoduleson'));
-$builder->bug = array('rows' => 300, 'extends' => array('bug'));
-$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
-$builder->bugmodule = array('rows' => 100, 'extends' => array('module','bugmodule'));
-$builder->bugmoduleson = array('rows' => 200, 'extends' => array('module','bugmoduleson'));
+$builder->story = array('rows' => 400, 'extends' => array('story'));
+$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory'));
+$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview'));
+$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
+$builder->storymoduleson = array('rows' => 400, 'extends' => array('module','storymoduleson'));
+$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
+$builder->storystage = array('rows' => 450, 'extends' => array('storystage'));
+$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec'));
+$builder->storyestimate = array('rows' => 6, 'extends' => array('storyestimate'));
+$builder->relation = array('rows' => 12, 'extends' => array('relation'));
+$builder->task = array('rows' => 600, 'extends' => array('task','task'));
+$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
+$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec'));
+$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule'));
+$builder->taskmoduleson = array('rows' => 600, 'extends' => array('module','taskmoduleson'));
+$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate'));
+$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson'));
+$builder->case = array('rows' => 400, 'extends' => array('case'));
+$builder->libcase = array('rows' => 10, 'extends' => array('case','libcase'));
+$builder->unitcase = array('rows' => 150, 'extends' => array('case','unitcase'));
+$builder->casestep = array('rows' => 400, 'extends' => array('casestep'));
+$builder->casemodule = array('rows' => 100, 'extends' => array('module', 'casemodule'));
+$builder->casemoduleson = array('rows' => 200, 'extends' => array('module', 'casemoduleson'));
+$builder->bug = array('rows' => 300, 'extends' => array('bug'));
+$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
+$builder->bugmodule = array('rows' => 100, 'extends' => array('module','bugmodule'));
+$builder->bugmoduleson = array('rows' => 200, 'extends' => array('module','bugmoduleson'));
+$builder->feedback = array('rows' => 100, 'extends' => array('feedback'));
+$builder->feedbackmodule = array('rows' => 100, 'extends' => array('module','feedbackmodule'));
+$builder->feedbackmoduleson = array('rows' => 200, 'extends' => array('module','feedbackmoduleson'));
$builder->testtask = array('rows' => 100, 'extends' => array('testtask'));
$builder->testresult = array('rows' => 70, 'extends' => array('testresult'));
diff --git a/test/lib/controlapi.php b/test/lib/controlapi.php
new file mode 100755
index 0000000000..ca160059b4
--- /dev/null
+++ b/test/lib/controlapi.php
@@ -0,0 +1,256 @@
+run($argv[1], $entries);
+ }
+
+ public $ztPath;
+
+ /**
+ * Run generate report.
+ *
+ * @param string $path
+ * @param string $entries
+ * @access public
+ * @return array
+ */
+ public function run($path, $entries = '')
+ {
+ $independent = array();
+ $strIndependent = '';
+
+ if($entries)
+ {
+ $results = $this->checkInput($path);
+ echo $results ? 'true' : 'false' ;
+
+ foreach($results as $result)
+ {
+ if(strpos($result['filePath'], $entries) != false) $independent[count($independent)] = $result;
+ }
+
+ $strIndependent .= ' $array)
+ {
+ $strIndependent .= '$result->key' . $key . ' = new stdclass;' . ";\n";
+ foreach($array as $field => $val)
+ {
+ $strIndependent .= '$result->key' . $key . '->' . $field . " = ";
+ $strIndependent .= $val . ";\n";
+ }
+ $strIndependent .= "\n";
+ }
+ file_put_contents($entries . '.php', $strIndependent);
+
+ return $independent;
+ }
+ else
+ {
+ $results = $this->checkInput($path);
+
+ echo $results ? 'true' : 'false' ;
+
+ $strResults = '';
+ $strResults .= ' $array)
+ {
+ $strResults .= '$result->key' . $key . ' = new stdclass;' . ";\n";
+ foreach($array as $field => $val)
+ {
+ $strResults .= '$result->key' . $key . '->' . $field . " = ";
+ $strResults .= $val . ";\n";
+ }
+ $strResults .= "\n";
+ }
+ file_put_contents('entries.php', $strResults);
+ return $results;
+ }
+ }
+
+ /*
+ * Check user input.
+ *
+ * @param string $path
+ * @access public
+ * @return array
+ */
+
+ public function checkInput($path = '')
+ {
+ if(empty($path)) return false;
+
+ $path = $this->checkWebDir($path);
+ if(!$path) return false;
+
+ $this->ztPath = $path;
+ $openRes = $this->checkOpen();
+ return $openRes;
+ }
+
+ /*
+ * Check zentao path.
+ *
+ * @param string $path
+ * @access public
+ * @return void
+ */
+ public function checkWebDir($path = '')
+ {
+ $configPath = $path . DS . 'config' . DS . 'config.php';
+
+ $info = new SplFileInfo($configPath);
+ $realPath = $info->getRealPath();
+
+ if($realPath) return dirname(dirname($realPath));
+ return '';
+ }
+
+ /**
+ * Get files under a directory recursive.
+ *
+ * @param string $dir
+ * @param array $exceptions
+ * @access private
+ * @return array
+ */
+ public function readDir($dir, $exceptions = array())
+ {
+ static $files = array();
+
+ if(!is_dir($dir)) return $files;
+
+ $dir = realpath($dir) . DS;
+ $entries = scandir($dir);
+
+ foreach($entries as $entry)
+ {
+ if(in_array($entry, array('.', '..', '.svn', '.git'))) continue;
+ if(in_array($entry, $exceptions)) continue;
+
+ $fullEntry = $dir . $entry;
+ if(is_file($fullEntry))
+ {
+ $files[] = $dir . $entry;
+ }
+ else
+ {
+ $nextDir = $dir . $entry;
+ $this->readDir($nextDir);
+ }
+ }
+ return $files;
+ }
+
+ /**
+ * Matching control.
+ *
+ * @access public
+ * @return bool|array
+ */
+ public function checkOpen()
+ {
+ $apiFiles = $this->readDir($this->ztPath . DS . 'api' . DS . 'v1' . DS . 'entries' . DS);
+ $results = array();
+ foreach ($apiFiles as $key => $filePath)
+ {
+ $fileContent = file($filePath);
+ $controls = array();
+ foreach ($fileContent as $line => $code)
+ {
+ preg_match('/\$control\s+=\s\$this->loadController\([\'"]([a-z]+)[\'"],\s[\'"]([a-zA-Z0-9]+)[\'"]\);/', $code, $controlNames);
+ if(!empty($controlNames))
+ {
+ $controls[] = $controlNames[1];
+ continue;
+ }
+ if(!preg_match('/\$control->([a-z0-9]+)\((\$[a-z0-9]+,\s|\$this->param\([\'\"][a-z0-9]+[\'\"],\s*[\'\"]?[a-z0-9-_\s]*[\'\"]?\)[,]?\s*|[\'\"]?[0-9a-z]+[\'\"]?,\s)+\)/i', $code, $controlMethod)) continue;
+
+ $res = preg_match_all('/(\$[a-z0-9]+[,\)])|([0-9]+[,\)])|((?[a-z0-9]+\()/i', $code, $execControls, PREG_PATTERN_ORDER);
+ if(!empty($execControls[0]))
+ {
+ $params = $execControls[0];
+ $pramsLen = count($params) - 1;
+ $methodName = trim(trim($params[0], '->'), '(');
+ $module = $controls[count($controls) - 1];
+ $checkRes = $this->checkParamLen($module, $methodName, $pramsLen);
+
+ if(!is_bool($checkRes))
+ {
+ $results[] = array(
+ 'filePath' => $filePath,
+ 'line' => ++$line,
+ 'moduleName' => $module,
+ 'methodName' => $methodName,
+ 'apiCode' => $controlMethod[0],
+ 'controlCode' => $checkRes['lineCode'],
+ 'controlFile' => $checkRes['controlFile'],
+ 'status' => 'fail'
+ );
+ }
+ elseif($checkRes)
+ {
+ $results[] = array(
+ 'filePath' => $filePath,
+ 'line' => ++$line,
+ 'moduleName' => $module,
+ 'methodName' => $methodName,
+ 'apiCode' => $controlMethod[0],
+ 'controlCode' => '',
+ 'controlFile' => '',
+ 'status' => 'success'
+ );
+ }
+ }
+ }
+ }
+ return empty($results) ? true : $results;
+ }
+
+ /*
+ * Check method params length.
+ *
+ * @param string $module
+ * @param string $method
+ * @param int $length
+ * @access public
+ * @return array|bool
+ */
+ public function checkParamLen($module, $method, $length)
+ {
+ $controlFile = $this->ztPath . DS . 'module' . DS . $module . DS . 'control.php';
+ $controlExtFile = $this->ztPath . DS . 'extension/max/' . $module . '/control.php';
+ $controlFuncFile = $this->ztPath . DS . 'extension/max/' . $module . '/ext/control/' . $method . '.php';
+
+ $realFile = file_exists($controlFuncFile) ? $controlFuncFile : (file_exists($controlExtFile) ? $controlExtFile : $controlFile);
+ $controlContent = file_get_contents($realFile);
+ preg_match('/public\sfunction\s' . $method . '\((\$[a-z0-9]+(\s=\s[\'\"]?[a-z0-9-_,]*[\'\"]?)?,?\s?)*\)/i', $controlContent, $matches);
+ if(empty($matches)) return false;
+
+ $paramLen = substr_count($matches[0], '$');
+ if($paramLen != $length)
+ {
+ return array('lineCode' => $matches[0], 'controlFile' => $realFile);
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
+
+$tester = new apiCheckModel();
diff --git a/test/model/execution/createdefaultsprint.php b/test/model/execution/createdefaultsprint.php
new file mode 100644
index 0000000000..8e8c3a3fb5
--- /dev/null
+++ b/test/model/execution/createdefaultsprint.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+switchDB();
+su('admin');
+
+/**
+
+title=测试executionModel->createDefaultSprintTest();
+cid=1
+pid=1
+
+创建默认迭代并返回ID >> 751
+
+*/
+
+$test = new executionTest();
+
+$result = $test->createDefaultSprintTest(11);
+
+r($result) && p('') && e('751'); // 创建默认迭代并返回ID
+
+$db->restoreDB();
\ No newline at end of file
diff --git a/test/model/program/createdefaultprogram.php b/test/model/program/createdefaultprogram.php
new file mode 100644
index 0000000000..136076867e
--- /dev/null
+++ b/test/model/program/createdefaultprogram.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+switchDB();
+
+/**
+
+title=测试 programModel::createDefaultProgram();
+cid=1
+pid=1
+
+创建默认项目集并返回ID >> 751
+
+*/
+
+$test = new programTest();
+
+$result = $test->createDefaultProgramTest();
+
+r($result) && p('') && e('751'); // 创建默认项目集并返回ID
+
+$db->restoreDB();
\ No newline at end of file
diff --git a/test/model/setting/parseitempath.php b/test/model/setting/parseitempath.php
new file mode 100755
index 0000000000..d677367262
--- /dev/null
+++ b/test/model/setting/parseitempath.php
@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+parseItemPath();
+cid=1
+pid=1
+
+解析参数包含vision、owner、module、section、key的数据 >> rnd,system,common,global,version
+解析参数包含vision、owner、module、key的数据 >> rnd,system,common,,hourPoint
+解析参数包含owner、module、section、key的数据 >> system,common,global,mode
+解析参数包含owner、module、key的数据 >> system,common,,CRProduct
+
+*/
+
+$setting = new settingTest();
+
+$params = array();
+$params[0] = "system.common.global.version@rnd";
+$params[1] = "system.common.hourPoint@rnd";
+$params[2] = "system.common.global.mode";
+$params[3] = "system.common.CRProduct";
+
+r($setting->parseItemPathTest($params[0])) && p('vision,owner,module,section,key') && e('rnd,system,common,global,version'); // 解析参数包含vision、owner、module、section、key的数据
+r($setting->parseItemPathTest($params[1])) && p('vision,owner,module,section,key') && e('rnd,system,common,,hourPoint'); // 解析参数包含vision、owner、module、key的数据
+r($setting->parseItemPathTest($params[2])) && p('owner,module,section,key') && e('system,common,global,mode'); // 解析参数包含owner、module、section、key的数据
+r($setting->parseItemPathTest($params[3])) && p('owner,module,section,key') && e('system,common,,CRProduct'); // 解析参数包含owner、module、key的数据