- session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . base64_encode($branchID) . "&objectID=$objectID{$preDir}");?>
+ session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . helper::safe64Encode(base64_encode($branchID)) . "&objectID=$objectID{$preDir}");?>
" . $lang->goback, '', "class='btn btn-link'");?>
diff --git a/module/repo/view/view.html.php b/module/repo/view/view.html.php
index eaf3c11af9..9b61b93c80 100644
--- a/module/repo/view/view.html.php
+++ b/module/repo/view/view.html.php
@@ -25,7 +25,7 @@ $version = " $revisionName";
repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $repo->name, '', "data-app='{$app->tab}'");
$paths= explode('/', $entry);
$fileName = array_pop($paths);
diff --git a/module/search/control.php b/module/search/control.php
index 2e333ae320..14425eb982 100644
--- a/module/search/control.php
+++ b/module/search/control.php
@@ -110,6 +110,7 @@ class search extends control
return print(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID, $shortcut, '{$data->title}')}"));
}
+
$this->view->module = $module;
$this->view->onMenuBar = $onMenuBar;
$this->display();
diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php
index fa2f5f6f13..366cfcf8ba 100644
--- a/module/search/view/buildform.html.php
+++ b/module/search/view/buildform.html.php
@@ -250,6 +250,7 @@ foreach($fieldParams as $fieldName => $param)
search->custom);?>
+
diff --git a/module/upgrade/config.php b/module/upgrade/config.php
index fc5d01e5db..99613eb8fe 100644
--- a/module/upgrade/config.php
+++ b/module/upgrade/config.php
@@ -171,6 +171,10 @@ $config->upgrade->proVersion['pro10_3_1'] = '15_7_1';
$config->upgrade->proVersion['pro11_0_beta1'] = '16_0_beta1';
$config->upgrade->proVersion['pro11_0'] = '16_0';
+$config->upgrade->liteVersion = array();
+$config->upgrade->liteVersion['lite1_0'] = '16_5_beta1';
+$config->upgrade->liteVersion['lite1_1'] = '16_5';
+
$config->upgrade->lowerTables = array();
$config->upgrade->lowerTables[$config->db->prefix . 'caseStep'] = $config->db->prefix . 'casestep';
$config->upgrade->lowerTables[$config->db->prefix . 'docLib'] = $config->db->prefix . 'doclib';
diff --git a/module/upgrade/control.php b/module/upgrade/control.php
index 335390a852..823f95fb62 100644
--- a/module/upgrade/control.php
+++ b/module/upgrade/control.php
@@ -82,6 +82,20 @@ class upgrade extends control
{
$version = str_replace(array(' ', '.'), array('', '_'), $this->config->installedVersion);
$version = strtolower($version);
+
+ if($this->config->visions == ',lite,')
+ {
+ $installedVersion = str_replace('.', '_', $this->config->installedVersion);
+ $version = array_search($installedVersion, $this->config->upgrade->liteVersion);
+
+ foreach($this->lang->upgrade->fromVersions as $key => $value)
+ {
+ if(strpos($key, 'lite') === false) unset($this->lang->upgrade->fromVersions[$key]);
+ }
+
+ $this->config->version = ($this->config->edition == 'biz' ? 'LiteVIP' : 'Lite') . $this->config->liteVersion;
+ }
+
$this->view->title = $this->lang->upgrade->common . $this->lang->colon . $this->lang->upgrade->selectVersion;
$this->view->position[] = $this->lang->upgrade->common;
$this->view->version = $version;
@@ -96,6 +110,8 @@ class upgrade extends control
*/
public function confirm()
{
+ if(strpos($this->post->fromVersion, 'lite') !== false) $this->post->fromVersion = $this->config->upgrade->liteVersion[$this->post->fromVersion];
+
$this->session->set('step', '');
$this->view->title = $this->lang->upgrade->confirm;
$this->view->position[] = $this->lang->upgrade->common;
@@ -131,6 +147,7 @@ class upgrade extends control
}
$fromVersion = isset($_POST['fromVersion']) ? $this->post->fromVersion : $fromVersion;
+ if(strpos($fromVersion, 'lite') !== false) $fromVersion = $this->config->upgrade->liteVersion[$fromVersion];
$this->upgrade->execute($fromVersion);
if(!$this->upgrade->isError())
diff --git a/module/upgrade/lang/version.php b/module/upgrade/lang/version.php
index b8d17c6d19..999fe1818c 100644
--- a/module/upgrade/lang/version.php
+++ b/module/upgrade/lang/version.php
@@ -157,6 +157,10 @@ $lang->upgrade->fromVersions['16_4'] = '16.4';
$lang->upgrade->fromVersions['16_5_beta1'] = '16.5.beta1';
$lang->upgrade->fromVersions['16_5'] = '16.5';
+/* Lite. */
+$lang->upgrade->fromVersions['lite1_0'] = 'Lite1.0';
+$lang->upgrade->fromVersions['lite1_1'] = 'Lite1.1';
+
/* Pro. */
$lang->upgrade->fromVersions['pro1_0'] = 'Pro1.0';
$lang->upgrade->fromVersions['pro1_1'] = 'Pro1.1';
diff --git a/module/user/js/edit.js b/module/user/js/edit.js
index 75dd95ca6c..664049ff89 100644
--- a/module/user/js/edit.js
+++ b/module/user/js/edit.js
@@ -8,8 +8,8 @@ $(function()
{
if(!password1Encrypted && !password2Encrypted)
{
- var password1 = $('#password1').val();
- var password2 = $('#password2').val();
+ var password1 = $('#password1').val().trim();
+ var password2 = $('#password2').val().trim();
var passwordStrength = computePasswordStrength(password1);
if($("form input[name=passwordStrength]").length == 0) $('#submit').after("");
diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php
index 0ecc5415d9..2e7d720c74 100644
--- a/module/user/view/edit.html.php
+++ b/module/user/view/edit.html.php
@@ -59,7 +59,7 @@
user->accountInfo;?>
user->account;?>
- account, "class='form-control'");?>
+ account, "class='form-control' readonly");?>
user->email;?>
email, "class='form-control'");?>
diff --git a/module/weekly/css/index.css b/module/weekly/css/index.css
index 831d22fe7f..fe916f0ecb 100644
--- a/module/weekly/css/index.css
+++ b/module/weekly/css/index.css
@@ -1 +1,3 @@
#mainContent td.projectName {white-space: nowrap; overflow-x: hidden;}
+.main-table tbody>tr:nth-child(odd) {background-color:#fff;}
+#pageNav .angle-btn:first-child a.btn {max-width: 300px; overflow: hidden;}
diff --git a/module/weekly/js/index.js b/module/weekly/js/index.js
new file mode 100644
index 0000000000..98a71d6773
--- /dev/null
+++ b/module/weekly/js/index.js
@@ -0,0 +1 @@
+$('#pageNav .angle-btn:first a.btn').attr('title', $('#pageNav .angle-btn:first a.btn').text());
diff --git a/module/weekly/view/index.html.php b/module/weekly/view/index.html.php
index 5da81bb191..ceaf917100 100644
--- a/module/weekly/view/index.html.php
+++ b/module/weekly/view/index.html.php
@@ -180,7 +180,4 @@
-
diff --git a/test/class/custom.class.php b/test/class/custom.class.php
new file mode 100644
index 0000000000..e65e102c82
--- /dev/null
+++ b/test/class/custom.class.php
@@ -0,0 +1,337 @@
+objectModel = $tester->loadModel('custom');
+ }
+
+ /**
+ * Test get all custom lang.
+ *
+ * @access public
+ * @return int
+ */
+ public function getAllLangTest()
+ {
+ $objects = $this->objectModel->getAllLang();
+
+ if(dao::isError()) return dao::getError();
+ $counts = count($objects);
+
+ return $counts;
+ }
+
+ /**
+ * Test set value of an item.
+ *
+ * @param string $path
+ * @param string $value
+ * @access public
+ * @return object|int
+ */
+ public function setItemTest($path, $value = '')
+ {
+ $objects = $this->objectModel->setItem($path, $value);
+
+ if(dao::isError()) return dao::getError();
+
+ $level = substr_count($path, '.');
+ if($level > 1)
+ {
+ if($level == 2) list($lang, $module, $key) = explode('.', $path);
+ if($level == 3) list($lang, $module, $section, $key) = explode('.', $path);
+ if($level == 4) list($lang, $module, $section, $key, $system) = explode('.', $path);
+
+ global $tester;
+ $objects = $tester->dao->select('*')->from(TABLE_LANG)->where('`lang`')->eq($lang)->andWhere('`module`')->eq($module)->andWhere('`key`')->eq($key)->fetch();
+ }
+
+ return $objects;
+ }
+
+ /**
+ * Test get some items
+ *
+ * @param string $paramString
+ * @access public
+ * @return array
+ */
+ public function getItemsTest($paramString)
+ {
+ $objects = $this->objectModel->getItems($paramString);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test delete items.
+ *
+ * @param string $paramString
+ * @access public
+ * @return int
+ */
+ public function deleteItemsTest($paramString)
+ {
+ $objects = $this->objectModel->deleteItems($paramString);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test parse the param string for select or delete items.
+ *
+ * @param string $paramString
+ * @access public
+ * @return array
+ */
+ public function parseItemParamTest($paramString)
+ {
+ $objects = $this->objectModel->parseItemParam($paramString);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test create a DAO object to select or delete one or more records.
+ *
+ * @param string $paramString
+ * @param string $method
+ * @access public
+ * @return array|int
+ */
+ public function prepareSQLTest($paramString, $method = 'select')
+ {
+ $params = $this->objectModel->parseItemParam($paramString);
+ if($method == 'delete')
+ {
+ $objects = $this->objectModel->prepareSQL($params, $method)->exec();
+ }
+ else
+ {
+ $objects = $this->objectModel->prepareSQL($params, $method)->orderBy('lang,id')->fetchAll('key');
+ }
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function saveCustomMenuTest($menu, $module, $method = '')
+ {
+ $objects = $this->objectModel->saveCustomMenu($menu, $module, $method);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getRequiredFieldsTest($moduleConfig)
+ {
+ $objects = $this->objectModel->getRequiredFields($moduleConfig);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get module fields.
+ *
+ * @param string $moduleName
+ * @param string $method
+ * @access public
+ * @return array
+ */
+ public function getFormFieldsTest($moduleName, $method = '')
+ {
+ global $app;
+ $app->loadLang($moduleName);
+
+ $objects = $this->objectModel->getFormFields($moduleName, $method);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get UR and SR pairs.
+ *
+ * @access public
+ * @return array
+ */
+ public function getURSRPairsTest()
+ {
+ $objects = $this->objectModel->getURSRPairs();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get UR pairs.
+ *
+ * @access public
+ * @return array
+ */
+ public function getURPairsTest()
+ {
+ $objects = $this->objectModel->getURPairs();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get SR pairs.
+ *
+ * @access public
+ * @return array
+ */
+ public function getSRPairsTest()
+ {
+ $objects = $this->objectModel->getSRPairs();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get UR and SR list.
+ *
+ * @access public
+ * @return array
+ */
+ public function getURSRListTest()
+ {
+ $objects = $this->objectModel->getURSRList();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test save required fields.
+ *
+ * @param string $moduleName
+ * @param string $requiredFields
+ * @param string $fieldsType
+ * @access public
+ * @return object
+ */
+ public function saveRequiredFieldsTest($moduleName, $requiredFields, $fieldsType)
+ {
+ global $app, $tester;
+ $app->loadLang($moduleName);
+
+ $_POST = $requiredFields;
+ $this->objectModel->saveRequiredFields($moduleName);
+
+ $objects = $tester->dao->select('`value`')->from(TABLE_CONFIG)
+ ->where('`owner`')->eq('system')
+ ->andWhere('`module`')->eq($moduleName)
+ ->andWhere('`key`')->eq('requiredFields')
+ ->andWhere('`section`')->eq($fieldsType)
+ ->fetch();
+
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test set product and project and sprint concept.
+ *
+ * @param int $sprintConcept
+ * @access public
+ * @return object
+ */
+ public function setConceptTest($sprintConcept)
+ {
+ global $tester;
+
+ $_POST['sprintConcept'] = $sprintConcept;
+ $this->objectModel->setConcept();
+
+ if(dao::isError()) return dao::getError();
+ $objects = $tester->dao->select('`id`')->from(TABLE_BLOCK)->where('source')->eq('execution')->fetch();
+
+ unset($_POST);
+
+ return $objects;
+ }
+
+ /**
+ * Test set UR and SR concept.
+ *
+ * @param array $SRName
+ * @access public
+ * @return int
+ */
+ public function setURAndSRTest($SRName)
+ {
+ $_POST = $SRName;
+ $objects = $this->objectModel->setURAndSR();
+
+ if(dao::isError()) return dao::getError();
+
+ unset($_POST);
+
+ return $objects;
+ }
+
+ /**
+ * Test edit UR and SR concept.
+ *
+ * @param int $key
+ * @param string $SRName
+ * @access public
+ * @return object
+ */
+ public function updateURAndSRTest($key = 0, $SRName)
+ {
+ global $app, $tester;
+
+ $_POST['URName'] = '用户需求';
+ $_POST['SRName'] = $SRName;
+ $this->objectModel->updateURAndSR($key);
+
+ if(dao::isError()) return dao::getError();
+
+ $lang = $app->getClientLang();
+
+ $objects = $tester->dao->select('`value`')->from(TABLE_LANG)
+ ->where('`key`')->eq($key)
+ ->andWhere('section')->eq('URSRList')
+ ->andWhere('lang')->eq($lang)
+ ->andWhere('module')->eq('custom')
+ ->fetch();
+
+ unset($_POST);
+
+ return $objects;
+ }
+
+ public function setStoryRequirementTest()
+ {
+ $objects = $this->objectModel->setStoryRequirement();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+}
diff --git a/test/class/design.class.php b/test/class/design.class.php
index 7e09e62658..c99db6abd5 100644
--- a/test/class/design.class.php
+++ b/test/class/design.class.php
@@ -157,24 +157,6 @@ class designTest
return $objects;
}
- public function getAffectedScopeTest($design = 0)
- {
- $objects = $this->objectModel->getAffectedScope($design = 0);
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
- public function getListTest($projectID = 0, $productID = 0, $type = 'all', $param = 0, $orderBy = 'id_desc', $pager = null)
- {
- $objects = $this->objectModel->getList($projectID = 0, $productID = 0, $type = 'all', $param = 0, $orderBy = 'id_desc', $pager = null);
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
public function getCommitTest($designID = 0, $pager = null)
{
$objects = $this->objectModel->getCommit($designID = 0, $pager = null);
@@ -183,40 +165,4 @@ class designTest
return $objects;
}
-
- public function getBySearchTest($projectID = 0, $productID = 0, $queryID = 0, $orderBy = 'id_desc', $pager = null)
- {
- $objects = $this->objectModel->getBySearch($projectID = 0, $productID = 0, $queryID = 0, $orderBy = 'id_desc', $pager = null);
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
- public function setMenuTest($projectID, $products, $productID = 0)
- {
- $objects = $this->objectModel->setMenu($projectID, $products, $productID = 0);
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
- public function buildSearchFormTest($queryID = 0, $actionURL = '')
- {
- $objects = $this->objectModel->buildSearchForm($queryID = 0, $actionURL = '');
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
- public function printAssignedHtmlTest($design = '', $users = '')
- {
- $objects = $this->objectModel->printAssignedHtml($design = '', $users = '');
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
}
diff --git a/test/class/personnel.class.php b/test/class/personnel.class.php
new file mode 100644
index 0000000000..bab07168c7
--- /dev/null
+++ b/test/class/personnel.class.php
@@ -0,0 +1,262 @@
+objectModel = $tester->loadModel('personnel');
+ $tester->app->loadClass('dao');
+ }
+ /**
+ * Get accessible personnel test
+ *
+ * @param int $programID
+ * @param int $deptID
+ * @param string $browseType
+ * @param int $queryID
+ * @access public
+ * @return array
+ */
+ public function getAccessiblePersonnelTest($programID = 0, $deptID = 0, $browseType = 'all', $queryID = 0)
+ {
+ $objects = $this->objectModel->getAccessiblePersonnel($programID, $deptID, $browseType, $queryID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Check if you have permission to view the program
+ *
+ * @param int mixed $programID
+ * @param string mixed $account
+ * @access public
+ * @return bool
+ */
+ public function canViewProgramTest($programID, $account)
+ {
+ $objects = $this->objectModel->canViewProgram($programID, $account);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Get invest test
+ *
+ * @param int $programID
+ * @access public
+ * @return array
+ */
+ public function getInvestTest($programID = 0)
+ {
+ $objects = $this->objectModel->getInvest($programID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getRiskInvestTest($accounts, $projectID)
+ {
+ $projects = $this->personnel->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectID)->fetchAll('id');
+ $objects = $this->objectModel->getRiskInvest($accounts, $projects);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getIssueInvestTest($accounts, $projects)
+ {
+ $objects = $this->objectModel->getIssueInvest($accounts, $projects);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getBugAndStoryInvestTest($accounts, $programID)
+ {
+ $objects = $this->objectModel->getBugAndStoryInvest($accounts, $programID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getInvolvedProjectsTest($projects)
+ {
+ $objects = $this->objectModel->getInvolvedProjects($projects);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Get involved executions test
+ *
+ * @param array mixed $projectID
+ * @access public
+ * @return void
+ */
+ public function getInvolvedExecutionsTest($projectID)
+ {
+ global $tester;
+ $project = $tester->dao->select('id')->from(TABLE_PROJECT)->where('project')->in($projectID)->fetchall('project');
+ $objects = $this->objectModel->getInvolvedExecutions($project);
+ a($objects);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getProjectTaskInvestTest($projects, $accounts)
+ {
+ $objects = $this->objectModel->getProjectTaskInvest($projects, $accounts);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getUserEffortHoursTest($userTasks)
+ {
+ $objects = $this->objectModel->getUserEffortHours($userTasks);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getUserHoursTest($userTasks)
+ {
+ $objects = $this->objectModel->getUserHours($userTasks);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getSprintAndStageTest($projects)
+ {
+ $objects = $this->objectModel->getSprintAndStage($projects);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getCopiedObjectsTest($objectID, $objectType)
+ {
+ $objects = $this->objectModel->getCopiedObjects($objectID, $objectType);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getWhitelistTest($objectID = 0, $objectType = '', $orderBy = 'id_desc', $pager = '')
+ {
+ $objects = $this->objectModel->getWhitelist($objectID = 0, $objectType = '', $orderBy = 'id_desc', $pager = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getWhitelistAccountTest($objectID = 0, $objectType = '')
+ {
+ $objects = $this->objectModel->getWhitelistAccount($objectID = 0, $objectType = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function updateWhitelistTest($users = array(), $objectType = '', $objectID = 0, $type = 'whitelist', $source = 'add', $updateType = 'replace')
+ {
+ $objects = $this->objectModel->updateWhitelist($users = array(), $objectType = '', $objectID = 0, $type = 'whitelist', $source = 'add', $updateType = 'replace');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function addWhitelistTest($objectType = '', $objectID = 0)
+ {
+ $objects = $this->objectModel->addWhitelist($objectType = '', $objectID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function deleteProductWhitelistTest($productID, $account = '')
+ {
+ $objects = $this->objectModel->deleteProductWhitelist($productID, $account = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function deleteProgramWhitelistTest($programID = 0, $account = '')
+ {
+ $objects = $this->objectModel->deleteProgramWhitelist($programID = 0, $account = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function deleteProjectWhitelistTest($objectID = 0, $account = '')
+ {
+ $objects = $this->objectModel->deleteProjectWhitelist($objectID = 0, $account = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function deleteExecutionWhitelistTest($executionID, $account = '')
+ {
+ $objects = $this->objectModel->deleteExecutionWhitelist($executionID, $account = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function deleteWhitelistTest($users = array(), $objectType = 'program', $objectID = 0, $groupID = 0)
+ {
+ $objects = $this->objectModel->deleteWhitelist($users = array(), $objectType = 'program', $objectID = 0, $groupID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function createMemberLinkTest($dept = 0, $programID = 0)
+ {
+ $objects = $this->objectModel->createMemberLink($dept = 0, $programID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function buildSearchFormTest($queryID = 0, $actionURL = '')
+ {
+ $objects = $this->objectModel->buildSearchForm($queryID = 0, $actionURL = '');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+}
diff --git a/test/class/programplan.class.php b/test/class/programplan.class.php
new file mode 100644
index 0000000000..93cc06401d
--- /dev/null
+++ b/test/class/programplan.class.php
@@ -0,0 +1,338 @@
+objectModel = $tester->loadModel('programplan');
+ }
+
+ /**
+ * Test get plan by id.
+ *
+ * @param int $planID
+ * @access public
+ * @return object
+ */
+ public function getByIDTest($planID)
+ {
+ $object = $this->objectModel->getByID($planID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $object;
+ }
+
+ /**
+ * Test get plans list.
+ *
+ * @param int $executionID
+ * @param int $productID
+ * @param string $browseType
+ * @param string $orderBy
+ * @access public
+ * @return string
+ */
+ public function getStageTest($executionID = 0, $productID = 0, $browseType = 'all', $orderBy = 'id_asc')
+ {
+ $objects = $this->objectModel->getStage($executionID, $productID, $browseType, $orderBy);
+
+ if(dao::isError()) return dao::getError();
+
+ $title = '';
+ foreach($objects as $object) $title .= ',' . $object->name;
+ return $title;
+ }
+
+ /**
+ * Test get plans by idList.
+ *
+ * @param array $idList
+ * @access public
+ * @return array
+ */
+ public function getByListTest($idList = array())
+ {
+ $objects = $this->objectModel->getByList($idList);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get plans.
+ *
+ * @param int $executionID
+ * @param int $productID
+ * @param string $orderBy
+ * @access public
+ * @return string
+ */
+ public function getPlansTest($executionID = 0, $productID = 0, $orderBy = 'id_asc')
+ {
+ $objects = $this->objectModel->getPlans($executionID, $productID, $orderBy);
+
+ if(dao::isError()) return dao::getError();
+
+ $title = '';
+ foreach($objects as $object) $title .= ',' . $object->name;
+ return $title;
+ }
+
+ /**
+ * Test get pairs.
+ *
+ * @param int $executionID
+ * @param int $productID
+ * @param string $type
+ * @access public
+ * @return string
+ */
+ public function getPairsTest($executionID, $productID = 0, $type = 'all')
+ {
+ $objects = $this->objectModel->getPairs($executionID, $productID, $type);
+
+ if(dao::isError()) return dao::getError();
+
+ return implode(',', $objects);
+ }
+
+ /**
+ * Test get total percent.
+ *
+ * @param int $stageID
+ * @param bool $parent
+ * @access public
+ * @return int
+ */
+ public function getTotalPercentTest($stageID, $parent = false)
+ {
+ $stage = $this->objectModel->getByID($stageID);
+
+ $int = $this->objectModel->getTotalPercent($stage, $parent);
+
+ if(dao::isError()) return dao::getError();
+
+ return $int;
+ }
+
+ /**
+ * Test process plans.
+ *
+ * @param array $planIDList
+ * @access public
+ * @return array
+ */
+ public function processPlansTest($planIDList)
+ {
+ $plans = $this->objectModel->getByList($planIDList);
+
+ $objects = $this->objectModel->processPlans($plans);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test process plan.
+ *
+ * @param int $planID
+ * @access public
+ * @return object
+ */
+ public function processPlanTest($planID)
+ {
+ $plan = $this->objectModel->getByID($planID);
+
+ $object = $this->objectModel->processPlan($plan);
+
+ if(dao::isError()) return dao::getError();
+
+ return $object;
+ }
+
+ /**
+ * Test get duration.
+ *
+ * @param date $begin
+ * @param date $end
+ * @access public
+ * @return int
+ */
+ public function getDurationTest($begin, $end)
+ {
+ $count = $this->objectModel->getDuration($begin, $end);
+
+ if(dao::isError()) return dao::getError();
+
+ return $count;
+ }
+
+ /**
+ * Test create a plan.
+ *
+ * @param array $param
+ * @access public
+ * @return array
+ */
+ public function createTest($param = array())
+ {
+ $_POST['planIDList'] = array('131', '221', '311', '401', '491', '581', '671');
+
+ global $tester;
+ $plans = $tester->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($_POST['planIDList'])->fetchAll();
+
+
+ $_POST['names'] = array('阶段31', '阶段121', '阶段211', '阶段301', '阶段391', '阶段481', '阶段571', '', '', '', '', '');
+ $_POST['PM'] = array('', '', '', '', '', '', '', '', '', '', '', '');
+ $_POST['percents'] = array('0', '0', '0', '0', '0', '0', '0', '', '', '', '', '');
+ $_POST['attributes'] = array('request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request', 'request');
+ $_POST['acl'] = array('private', 'open', 'open', 'private', 'private', 'open', 'open', 'open', 'open', 'open', 'open', 'open');
+ $_POST['milestone'] = array('0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
+ $_POST['begin'] = (isset($param['begin']) and isset($param['end'])) ? array($plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, '', '', '', '') : array($plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, $plans[0]->begin, '', '', '', '', '');
+ $_POST['end'] = (isset($param['begin']) and isset($param['end'])) ? array($plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, '', '', '', '') : array($plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, $plans[0]->end, '', '', '', '', '');
+ $_POST['realBegan'] = array('', '', '', '', '', '', '', '', '', '', '', '');
+ $_POST['realEnd'] = array('', '', '', '', '', '', '', '', '', '', '', '');
+
+ foreach($param as $field => $value)
+ {
+ if(count($param) == 1 or ($field != 'begin' and $field != 'end')) $_POST[$field] = $value;
+ }
+
+ $objects = $this->objectModel->create(41, 0, 0);
+
+ unset($_POST);
+
+ if(dao::isError())
+ {
+ $error = dao::getError()['message'][0];
+ $error = strpos($error, '所属项目的') > 0 ? preg_replace('/\d{4}-\d{2}-\d{2}/', '', $error) : $error;
+ return $error;
+ }
+
+ $objects = $tester->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($plans[0]->parent)->andWhere('type')->eq('stage')->fetchAll();
+ return count($objects);
+ }
+
+ /**
+ * Test set stage tree path.
+ *
+ * @param int $planID
+ * @access public
+ * @return object
+ */
+ public function setTreePathTest($planID)
+ {
+ $this->objectModel->setTreePath($planID);
+
+ if(dao::isError()) return dao::getError();
+
+ $object = $this->objectModel->getByID($planID);
+ return $object;
+ }
+
+ /**
+ * updateTest
+ *
+ * @param int $planID
+ * @param int $projectID
+ * @param array $param
+ * @param string $index
+ * @access public
+ * @return array
+ */
+ public function updateTest($planID, $projectID, $param = array(), $index = '')
+ {
+ $plan = $this->objectModel->getByID($planID);
+
+ $_POST['parent'] = $plan->parent;
+ $_POST['name'] = $plan->name;
+ $_POST['percent'] = $plan->percent;
+ $_POST['attribute'] = $plan->attribute;
+ $_POST['milestone'] = $plan->milestone;
+ $_POST['acl'] = $plan->acl;
+ $_POST['begin'] = $plan->begin;
+ $_POST['end'] = $plan->end;
+ $_POST['realBegan'] = $plan->realBegan;
+ $_POST['realEnd'] = $plan->realEnd;
+
+ foreach($param as $key => $value) $_POST[$key] = $value;
+
+ $objects = $this->objectModel->update($planID, $projectID);
+
+ unset($_POST);
+
+ if(dao::isError()) return $index == 'end' ? preg_replace('/『\d{4}-\d{2}-\d{2}』/', '', dao::getError()[$index][0]) : dao::getError()[$index][0];
+
+ return $objects;
+ }
+
+ /**
+ * Test is create task.
+ *
+ * @param int $planID
+ * @access public
+ * @return int
+ */
+ public function isCreateTaskTest($planID)
+ {
+ $object = $this->objectModel->isCreateTask($planID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $object ? 2 : 1;
+ }
+
+ /**
+ * Test get the stage set to milestone.
+ *
+ * @param int $projectID
+ * @access public
+ * @return string
+ */
+ public function getMilestonesTest($projectID = 0)
+ {
+ $objects = $this->objectModel->getMilestones($projectID);
+
+ if(dao::isError()) return dao::getError();
+
+ return implode(',', $objects);
+ }
+
+ /**
+ * Test get milestone by product.
+ *
+ * @param int $productID
+ * @param int $projectID
+ * @access public
+ * @return string
+ */
+ public function getMilestoneByProductTest($productID, $projectID)
+ {
+ $objects = $this->objectModel->getMilestoneByProduct($productID, $projectID);
+
+ if(dao::isError()) return dao::getError();
+
+ return implode(',', $objects);
+ }
+
+ /**
+ * Test get parent stage list.
+ *
+ * @param int $executionID
+ * @param int $planID
+ * @param int $productID
+ * @access public
+ * @return string
+ */
+ public function getParentStageListTest($executionID, $planID, $productID)
+ {
+ $objects = $this->objectModel->getParentStageList($executionID, $planID, $productID);
+
+ if(dao::isError()) return dao::getError();
+
+ return implode(',', $objects);
+ }
+}
diff --git a/test/class/project.class.php b/test/class/project.class.php
index 82971993f9..dae625653c 100644
--- a/test/class/project.class.php
+++ b/test/class/project.class.php
@@ -16,273 +16,21 @@ class Project
}
/**
- * checkStatus
+ * Test start a project.
*
- * @param int mixed $projectID
+ * @param int $projectID
* @access public
* @return void
*/
- public function checkStatus($projectID)
- {
- $oldProject = $this->project->getById($projectID);
- if($oldProject->status != 'closed') return false;
-
- $change = $this->project->activate($projectID);
-
- $project = $this->project->getById($projectID);
- if($project->status != 'doing') return false;
-
- return true;
- }
-
- /**
- * checkStatusOff
- *
- * @param int mixed $projectID
- * @param array $closeTime
- * @access public
- * @return void
- */
- public function checkStatusOff($projectID, $closeTime = array())
- {
- $checkStatus = array();
- $closeEnd = array('realEnd' => '');
- foreach($closeEnd as $filed => $defaultValue) $_POST[$filed] = $defaultValue;
- foreach($closeTime as $key => $value) $_POST[$key] = $value;
-
- $oldProject = $this->project->getById($projectID);
- if($oldProject->status == 'suspended' or $oldProject->status == 'closed') return false;
-
- $change = $this->project->close($projectID);
-
- $project = $this->project->getById($projectID);
- if($project->status != 'closed') return false;
-
- return true;
- }
-
- /**
- * getListByOrder
- *
- * @param string mixed $orderBy
- * @access public
- * @return void
- */
- public function getListByOrder($orderBy)
- {
- $projects = $this->project->getOverviewList('byStatus', 'wait', $orderBy);
- return checkOrder($projects, $orderBy);
- }
-
- /**
- * getByID
- *
- * @param mixed $projectID
- * @access public
- * @return void
- */
- public function getByID($projectID)
- {
- return $this->project->getOverviewList('byID', $projectID);
- }
-
- /**
- * getTeamMemberPairs
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function getTeamMemberPairs($projectID)
- {
- $members = array_filter($this->project->getTeamMemberPairs($projectID));
- if(empty($members)) return false;
- return count($members);
- }
-
- /**
- * checkMembers
- *
- * @param int mixed $members
- * @param string mixed $users
- * @access public
- * @return void
- */
- public function checkMembers($members, $users)
- {
- foreach($users as $user)
- {
- if(!isset($members[$user])) return false;
- }
- return true;
- }
-
- /**
- * getTeamMembers
- *
- * @param int mixed $projectID
- * @param striong mixed $users
- * @param boolean mixed $tutorial
- * @access public
- * @return void
- */
- public function getTeamMembers($projectID, $users, $tutorial = false)
- {
- if($tutorial) define('TUTORIAL', true);
- $members = $this->project->getTeamMembers($projectID);
- if(empty($members)) return false;
- if(!empty($users)) $this->checkMembers($members, $users);
- return count($members);
- }
-
- /**
- * checkStatusBegin
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function checkStatusBegin($projectID)
+ public function start($projectID)
{
+ $_POST['realBegan'] = helper::today();
$oldProject = $this->project->getById($projectID);
if($oldProject->status != 'suspended' and $oldProject->status != 'wait') return false;
- $change = $this->project->start($projectID);
- $project = $this->project->getById($projectID);
- if($project->status != 'doing') return false;
+ $changes = $this->project->start($projectID);
- return true;
- }
-
- /**
- * checkStatusStop
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function checkStatusStop($projectID)
- {
- $oldProject = $this->project->getById($projectID);
- if($oldProject->status == 'suspended' or $oldProject->status == 'closed') return false;
-
- $change = $this->project->suspend($projectID);
- $project = $this->project->getById($projectID);
- if($project->status != 'suspended') return false;
-
- return true;
- }
-
- /**
- * getExecutionData
- *
- * @param int mixed $projectID
- * @param string $type
- * @access public
- * @return void
- */
- public function getExecutionData($projectID, $type = '')
- {
- $table = 'zt_project';
- $executions = $this->project->getDataByProject($table, $projectID, $type);
- if(empty($executions)) return false;
- return $executions;
- }
-
- /**
- * getBuildData
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function getBuildData($projectID)
- {
- $builds = $this->project->getDataByProject(TABLE_BUILD, $projectID);
- if(empty($builds)) return false;
- return $builds;
- }
-
- /**
- * getReleaseData
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function getReleaseData($projectID)
- {
- $releases = $this->project->getDataByProject(TABLE_RELEASE, $projectID);
- if(empty($releases)) return false;
- return $releases;
- }
-
- /**
- * getByStatusExe
- *
- * @param string mixed $status
- * @access public
- * @return void
- */
- public function getByStatusExe($status)
- {
- $executions = $this->project->getStats(0, $status);
- if(empty($executions)) return false;
- if($status != 'all')
- {
- foreach($executions as $execution)
- {
- if($execution->status != $status) return false;
- }
- }
- return count($executions);
- }
-
- /**
- * getByProject
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function getByProject($projectID)
- {
- $executions = $this->project->getStats($projectID, 'all');
- if(empty($executions)) return false;
- foreach($executions as $execution)
- {
- if($execution->project != $projectID) return false;
- }
- return count($executions);
- }
-
- /**
- * getStatData
- *
- * @param int mixed $projectID
- * @access public
- * @return void
- */
- public function getStatData($projectID)
- {
- $projects = $this->project->getStatData($projectID);
- return $projects;
- }
-
- /**
- * getTotalStoriesByProject
- *
- * @param int $projectID
- * @param array $productIdList
- * @param string $type
- * @param string $status
- * @access public
- * @return void
- */
- public function getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all')
- {
- $projects = $this->project->getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all');
- return $projects;
+ return $this->project->getById($projectID);
}
/**
@@ -305,16 +53,39 @@ class Project
}
/**
- * saveState
+ * Update a project.
*
- * @param int mixed $projectID
+ * @param int $projectID
+ * @param array $data
* @access public
* @return void
*/
- public function saveState($projectID)
+ public function update($projectID, $data)
{
- $projects = $this->project->getPairsByProgram();
- $object = $this->project->saveState($projectID, $projects);
- return $object;
+ $_POST = $data;
+ $this->project->update($projectID);
+
+ unset($_POST);
+ if(dao::isError()) return array('message' => dao::getError());
+
+ return $this->project->getByID($projectID);
+ }
+
+ /**
+ * Batch update projects.
+ *
+ * @param array $data
+ * @access public
+ * @return void
+ */
+ public function batchUpdate($data)
+ {
+ $_POST = $data;
+ $this->project->batchUpdate();
+
+ unset($_POST);
+ if(dao::isError()) return array('message' => dao::getError());
+
+ return $this->project->getByIdList($data['projectIdList']);
}
}
diff --git a/test/class/stage.class.php b/test/class/stage.class.php
new file mode 100644
index 0000000000..55d04a9e87
--- /dev/null
+++ b/test/class/stage.class.php
@@ -0,0 +1,119 @@
+objectModel = $tester->loadModel('stage');
+ }
+
+ /**
+ * Test create a stage.
+ *
+ * @param object $stage
+ * @access public
+ * @return object
+ */
+ public function createTest($stage)
+ {
+ foreach($stage as $key => $value) $_POST[$key] = $value;
+
+ $objectID = $this->objectModel->create();
+
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ $object = $this->objectModel->getByID($objectID);
+ return $object;
+ }
+
+ /**
+ * Test batch create stages.
+ *
+ * @param array $param
+ * @access public
+ * @return int
+ */
+ public function batchCreateTest($param)
+ {
+ foreach($param as $key => $value) $_POST[$key] = $value;
+
+ $this->objectModel->batchCreate();
+
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ $objects = $this->objectModel->getStages();
+ return count($objects);
+ }
+
+ /**
+ * Test update a stage.
+ *
+ * @param int $stageID
+ * @param array $param
+ * @access public
+ * @return array
+ */
+ public function updateTest($stageID, $param)
+ {
+ foreach($param as $key => $value) $_POST[$key] = $value;
+
+ $objects = $this->objectModel->update($stageID);
+
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get stages.
+ *
+ * @param string $orderBy
+ * @access public
+ * @return array
+ */
+ public function getStagesTest($orderBy = 'id_desc')
+ {
+ $objects = $this->objectModel->getStages($orderBy = 'id_desc');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get pairs of stage.
+ *
+ * @access public
+ * @return array
+ */
+ public function getPairsTest()
+ {
+ $objects = $this->objectModel->getPairs();
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Test get a stage by id.
+ *
+ * @param int $stageID
+ * @access public
+ * @return object
+ */
+ public function getByIDTest($stageID)
+ {
+ $object = $this->objectModel->getByID($stageID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $object;
+ }
+}
diff --git a/test/class/testcase.class.php b/test/class/testcase.class.php
index 37d196839d..5642b59f97 100644
--- a/test/class/testcase.class.php
+++ b/test/class/testcase.class.php
@@ -7,6 +7,90 @@ class testcaseTest
$this->objectModel = $tester->loadModel('testcase');
}
+ /**
+ * Test create a case.
+ *
+ * @param array $param
+ * @access public
+ * @return array
+ */
+ public function createTest($param)
+ {
+ $bugID = 0;
+
+ $_POST['product'] = '1';
+ $_POST['module'] = '1821';
+ $_POST['type'] = 'feature';
+ $_POST['stage'] = array('', 'unittest');
+ $_POST['story'] = '4';
+ $_POST['color'] = '';
+ $_POST['pri'] = '3';
+ $_POST['precondition'] = '前置条件';
+ $_POST['steps'] = array('1' => '1','1.1' => '1.1', '1.2' => '1.2', '2' => '2', '3' => '3', '4' => '');
+ $_POST['stepType'] = array('1' => 'group','1.1' => 'item', '1.2' => 'item', '2' => 'step', '3' => 'item', '4' => 'step');
+ $_POST['expects'] = array('1' => '','1.1' => '', '1.2' => '', '2' => '', '3' => '', '4' => '');
+ $_POST['keywords'] = '关键词1,关键词2';
+ $_POST['status'] = 'normal';
+ $_POST['labels'] = array('');
+ $_POST['files'] = array('');
+
+ foreach($param as $field => $value) $_POST[$field] = $value;
+
+ $objects = $this->objectModel->create($bugID);
+
+ unset($_POST);
+
+ if(dao::isError()) return isset($param['type']) ? dao::getError()['type'][0] : dao::getError()['title'][0];
+
+ return $objects;
+ }
+
+ /**
+ * Test batch create cases.
+ *
+ * @param array $param
+ * @access public
+ * @return int
+ */
+ function batchCreateTest($param)
+ {
+ $productID = 1;
+ $branch = 0;
+ $storyID = 0;
+
+ $module = array(0, 0, 0);
+ $story = array(0, 0, 0);
+ $title = array('测试批量创建1', '测试批量创建2', '测试批量创建3');
+ $color = array('#3da7f5', '', '#ffaf38');
+ $type = array('performance', 'config', 'install');
+ $pri = array('1', '2', '3');
+ $precondition = array('测试批量创建前置1', '测试批量创建前置2', '测试批量创建前置3');
+ $keywords = array('测试批量创建关键词1', '测试批量创建关键词2', '测试批量创建关键词3');
+ $stage = array(array('smoke'), array('bvt'), array('intergrate'));
+ $needReview = array(0, 0, 0);
+
+ $_POST['module'] = $module;
+ $_POST['story'] = $story;
+ $_POST['title'] = $title;
+ $_POST['color'] = $color;
+ $_POST['type'] = $type;
+ $_POST['pri'] = $pri;
+ $_POST['precondition'] = $precondition;
+ $_POST['keywords'] = $keywords;
+ $_POST['stage'] = $stage;
+ $_POST['needReview'] = $needReview;
+
+ foreach($param as $field => $value) $_POST[$field] = $value;
+
+ $objects = $this->objectModel->batchCreate($productID, $branch, $storyID);
+
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ return count($objects);
+ }
+
/**
* Test get cases of a module.
*
@@ -51,15 +135,6 @@ class testcaseTest
return $objects;
}
- public function getProjectCasesTest($projectID, $orderBy = 'id_desc', $pager = null, $browseType = '')
- {
- $objects = $this->objectModel->getProjectCases($projectID, $orderBy = 'id_desc', $pager = null, $browseType = '');
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
/**
* Test get execution cases.
*
@@ -134,9 +209,19 @@ class testcaseTest
return $objects;
}
- public function getTestCasesTest($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no')
+ /**
+ * Test get test cases.
+ *
+ * @param int $productID
+ * @param string $browseType
+ * @param int $queryID
+ * @param string $auto
+ * @access public
+ * @return array
+ */
+ public function getTestCasesTest($productID, $browseType, $queryID, $auto = 'no')
{
- $objects = $this->objectModel->getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no');
+ $objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, 'id_desc', null, $auto);
if(dao::isError()) return dao::getError();
@@ -182,6 +267,20 @@ class testcaseTest
return $objects;
}
+ /**
+ * Test get cases by type.
+ *
+ * @param int $productID
+ * @param int $branch
+ * @param string $type
+ * @param string $status
+ * @param int $moduleID
+ * @param string $orderBy
+ * @param object $pager
+ * @param string $auto
+ * @access public
+ * @return int
+ */
public function getByStatusTest($productID = 0, $branch = 0, $type = 'all', $status = 'all', $moduleID = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
$objects = $this->objectModel->getByStatus($productID, $branch, $type, $status, $moduleID, $orderBy, $pager, $auto);
@@ -191,6 +290,13 @@ class testcaseTest
return count($objects);
}
+ /**
+ * Test get stories' cases.
+ *
+ * @param int $storyID
+ * @access public
+ * @return array
+ */
public function getStoryCasesTest($storyID)
{
$objects = $this->objectModel->getStoryCases($storyID);
@@ -216,19 +322,64 @@ class testcaseTest
return $counts;
}
- public function updateTest($caseID)
+ /**
+ * Test update a case.
+ *
+ * @param array $param
+ * @access public
+ * @return int
+ */
+ public function updateTest($param = array())
{
- $objects = $this->objectModel->update($caseID);
+ $caseId = 1;
+ $case = $this->objectModel->getById($caseId);
+
+ $_POST['title'] = $case->title;
+ $_POST['color'] = $case->color;
+ $_POST['precondition'] = $case->precondition;
+ $_POST['steps'] = array('用例步骤描述1');
+ $_POST['stepType'] = array('step');
+ $_POST['expects'] = array('这是用例预期结果1');
+ $_POST['comment'] = '';
+ $_POST['labels'] = '';
+ $_POST['lastEditedDate'] = $case->lastEditedDate;
+ $_POST['product'] = $case->product;
+ $_POST['module'] = $case->module;
+ $_POST['story'] = $case->story;
+ $_POST['type'] = $case->type;
+ $_POST['stage'] = $case->stage;
+ $_POST['pri'] = $case->pri;
+ $_POST['status'] = $case->status;
+ $_POST['keywords'] = $case->keywords;
+
+ foreach($param as $field => $value) $_POST[$field] = $value;
+
+ $change = $this->objectModel->update('1');
+ if($change == array()) $change = '没有数据更新';
+
+ unset($_POST);
if(dao::isError()) return dao::getError();
- return $objects;
+ return $change;
}
- public function reviewTest($caseID)
+ /**
+ * Test review case.
+ *
+ * @param int $caseID
+ * @param object $case
+ * @access public
+ * @return array
+ */
+ public function reviewTest($caseID, $case)
{
+ foreach($case as $field => $value) $_POST[$field] = $value;
+
$objects = $this->objectModel->review($caseID);
+ unset($_POST);
+
if(dao::isError()) return dao::getError();
return $objects;
@@ -251,23 +402,21 @@ class testcaseTest
return $objects;
}
- public function getCases2LinkTest($caseID, $browseType = 'bySearch', $queryID = 0)
- {
- $objects = $this->objectModel->getCases2Link($caseID, $browseType = 'bySearch', $queryID = 0);
-
- if(dao::isError()) return dao::getError();
-
- return $objects;
- }
-
- public function batchUpdateTest($param = array())
+ /**
+ * Test batch update cases.
+ *
+ * @param array $param
+ * @access public
+ * @return array
+ */
+ public function batchUpdateTest($index, $param = array())
{
$batchUpdateField['caseIDList'] = array('1' => 1, '2' => 2, '3' => 3, '4' => 4);
$batchUpdateField['pris'] = array('1' => 1, '2' => 2, '3' => 3, '4' => 4);
$batchUpdateField['statuses'] = array('1' => 'wait', '2' => 'normal', '3' => 'blocked', '4' => 'investigate');
$batchUpdateField['modules'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
$batchUpdateField['branches'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
- $batchUpdateField['story'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
+ $batchUpdateField['story'] = array('1' => 2, '2' => 2, '3' => 2, '4' => 2);
$batchUpdateField['product'] = array('1' => 1, '2' => 1, '3' => 1, '4' => 1);
$batchUpdateField['title'] = array('1' => '这个是测试用例1', '2' => '这个是测试用例2', '3' => '这个是测试用例3', '4' => '这个是测试用例4');
$batchUpdateField['color'] = array('1' => '#3da7f5', '2' => '#75c941', '3' => '#2dbdb2', '4' => '#797ec9');
@@ -286,7 +435,7 @@ class testcaseTest
if(dao::isError()) return dao::getError();
- return $objects;
+ return $objects[$index][0];
}
/**
@@ -343,22 +492,69 @@ class testcaseTest
return $objects;
}
- public function joinStepTest($steps)
+ /**
+ * Test join steps to a string, thus can diff them.
+ *
+ * @param array $stepIDList
+ * @access public
+ * @return string
+ */
+ public function joinStepTest($stepIDList)
{
- $objects = $this->objectModel->joinStep($steps);
+ global $tester;
+ $steps = $tester->dao->select('*')->from(TABLE_CASESTEP)->where('id')->in($stepIDList)->fetchAll();
+
+ $string = $this->objectModel->joinStep($steps);
if(dao::isError()) return dao::getError();
- return $objects;
+ $string = str_replace("\n", ' ', $string);
+ return $string;
}
- public function createFromImportTest($productID, $branch = 0)
+ /**
+ * Test create from import.
+ *
+ * @param int $productID
+ * @param array $param
+ * @access public
+ * @return string
+ */
+ public function createFromImportTest($productID, $param = array())
{
- $objects = $this->objectModel->createFromImport($productID, $branch = 0);
+ global $tester;
+
+ $_POST['product'] = array('1' => '1', '2' => '1');
+ $_POST['keywords'] = array('1' => '这是关键词1', '2' => '这是关键词2');
+ $_POST['title'] = array('1' => '导入测试用例1', '2' => '导入测试用例2');
+ $_POST['module'] = array('1' => '0', '2' => '0');
+ $_POST['story'] = array('1' => '2', '2' => '2');
+ $_POST['pri'] = array('1' => '1', '2' => '2');
+ $_POST['type'] = array('1' => 'performance', '2' => 'feature');
+ $_POST['stage'] = array('1' => array('0' => 'feature'), '2' => array('0' => 'unittest'));
+ $_POST['precondition'] = array('1' => '这是前置条件1', '2' => '这是前置条件2');
+ $_POST['stepType'] = array('1' => array('1' => 'step'), '2' => array('1' => 'step'));
+ $_POST['desc'] = array('1' => array('1' => '用例步骤描述1'), '2' => array('1' => '用例步骤描述2'));
+ $_POST['expect'] = array('1' => array('1' => '这是用例预期结果1'), '2' => array('1' => '这是用例预期结果2'));
+ $_POST['isEndPage'] = '1';
+ $_POST['pagerID'] = '1';
+
+ foreach($param as $field => $value) $_POST[$field] = $value;
+
+ $fileName = __DIR__ . DS . 'a.txt';
+ fopen($fileName, 'a');
+ $tester->session->fileImport = $fileName;
+
+ $this->objectModel->createFromImport($productID, 0);
+
+
+ unset($_POST);
if(dao::isError()) return dao::getError();
- return $objects;
+ $objects = $tester->dao->select('*')->from(TABLE_CASE)->where('product')->eq(1)->andWhere('lib')->eq(0)->markLeft()->andWhere('id')->gt(560)->orWhere('id')->in('1,2')->markRight()->fetchAll('title');
+ $titles = implode(',', array_keys($objects));
+ return $titles;
}
/**
@@ -377,21 +573,27 @@ class testcaseTest
return $object;
}
- public function importFromLibTest($productID)
+ /**
+ * Test import case from Lib.
+ *
+ * @param int $productID
+ * @param array $caseIdList
+ * @access public
+ * @return array
+ */
+ public function importFromLibTest($productID, $caseIdList = array())
{
- $objects = $this->objectModel->importFromLib($productID);
+ $_POST['module'] = array('410' => 0, '409' => 'ditto', '408' => 'ditto', '407' => 'ditto', '406' => 'ditto', '405' => 'ditto', '404' => 'ditto', '403' => 'ditto', '402' => 'ditto', '401' => 'ditto');
+ $_POST['caseIdList'] = $caseIdList;
- if(dao::isError()) return dao::getError();
+ $this->objectModel->importFromLib($productID);
- return $objects;
- }
-
- public function buildSearchFormTest($productID, $products, $queryID, $actionURL, $projectID = 0)
- {
- $objects = $this->objectModel->buildSearchForm($productID, $products, $queryID, $actionURL, $projectID = 0);
+ unset($_POST);
if(dao::isError()) return dao::getError();
+ global $tester;
+ $objects = $tester->dao->select('*')->from(TABLE_CASE)->where('fromCaseID')->in($caseIdList)->orderBy('id_asc')->fetchAll();
return $objects;
}
@@ -427,29 +629,106 @@ class testcaseTest
return $object ? 1 : 2;
}
- public function syncCase2ProjectTest($case, $caseID)
+ /**
+ * Test sync case to project.
+ *
+ * @param int $caseID
+ * @access public
+ * @return int
+ */
+ public function syncCase2ProjectTest($caseID)
{
- $objects = $this->objectModel->syncCase2Project($case, $caseID);
+ global $tester;
+ $tester->dao->delete()->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->exec();
+ $case = $this->objectModel->getByID($caseID);
+ $this->objectModel->syncCase2Project($case, $caseID);
if(dao::isError()) return dao::getError();
+ $objects = $tester->dao->select('*')->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->fetchAll();
+ return count($objects);
+ }
+
+ /**
+ * Test deal with the relationship between the case and project when edit the case.
+ *
+ * @param int $caseID
+ * @param string $objectType
+ * @param int $objectID
+ * @access public
+ * @return array
+ */
+ public function updateCase2ProjectTest($caseID, $objectType, $objectID)
+ {
+ $oldCase = $this->objectModel->getByID($caseID);
+
+ $case = new stdclass();
+ $case->title = $oldCase->title;
+ $case->color = $oldCase->color;
+ $case->precondition = $oldCase->precondition;
+ $case->lastEditedDate = $oldCase->lastEditedDate;
+ $case->product = $objectType == 'product' ? $objectID : $oldCase->product;
+ $case->module = $oldCase->module;
+ $case->story = $objectType == 'story' ? $objectID : $oldCase->story;
+ $case->type = $oldCase->type;
+ $case->stage = $oldCase->stage;
+ $case->pri = $oldCase->pri;
+ $case->status = $oldCase->status;
+ $case->keywords = $oldCase->keywords;
+ $case->version = $oldCase->version + 1;
+ $case->linkCase = $oldCase->linkCase;
+ $case->lastEditedBy = $oldCase->lastEditedBy;
+ $case->branch = $oldCase->branch;
+
+ $this->objectModel->updateCase2Project($oldCase, $case, $caseID);
+
+ if(dao::isError()) return dao::getError();
+
+ global $tester;
+ $objects = $tester->dao->select('*')->from(TABLE_PROJECTCASE)->where('`case`')->eq($caseID)->fetchAll();
return $objects;
}
- public function updateCase2ProjectTest($oldCase, $case, $caseID)
+ /**
+ * Test get status for different method.
+ *
+ * @param string $methodName
+ * @param object $case
+ * @param array $param
+ * @access public
+ * @return array
+ */
+ public function getStatusTest($methodName, $case = null, $param = array())
{
- $objects = $this->objectModel->updateCase2Project($oldCase, $case, $caseID);
+ if($methodName == 'update')
+ {
+ $case = $this->objectModel->getByID(1);
+ $_POST['title'] = $case->title;
+ $_POST['color'] = $case->color;
+ $_POST['precondition'] = $case->precondition;
+ $_POST['steps'] = array('用例步骤描述1');
+ $_POST['stepType'] = array('step');
+ $_POST['expects'] = array('这是用例预期结果1');
+ $_POST['comment'] = '';
+ $_POST['labels'] = '';
+ $_POST['lastEditedDate'] = $case->lastEditedDate;
+ $_POST['product'] = $case->product;
+ $_POST['module'] = $case->module;
+ $_POST['story'] = $case->story;
+ $_POST['type'] = $case->type;
+ $_POST['stage'] = $case->stage;
+ $_POST['pri'] = $case->pri;
+ $_POST['status'] = $case->status;
+ $_POST['keywords'] = $case->keywords;
- if(dao::isError()) return dao::getError();
+ foreach($param as $field => $value) $_POST[$field] = $value;
+ }
- return $objects;
- }
+ $objects = $this->objectModel->getStatus($methodName, $case);
- public function getStatusTest($methodName, $case = null)
- {
- $objects = $this->objectModel->getStatus($methodName, $case = null);
+ unset($_POST);
- if(dao::isError()) return dao::getError();
+ if(dao::isError()) return dao::getError()[0];
return $objects;
}
diff --git a/test/class/testtask.class.php b/test/class/testtask.class.php
new file mode 100644
index 0000000000..df515abc6b
--- /dev/null
+++ b/test/class/testtask.class.php
@@ -0,0 +1,226 @@
+objectModel = $tester->loadModel('testtask');
+ }
+
+ /**
+ * Test create testtask.
+ *
+ * @param int $projectID
+ * @param array $params
+ * @access public
+ * @return void
+ */
+ public function create($projectID, $params)
+ {
+ $_POST = $params;
+ $taskID = $this->objectModel->create($projectID);
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ return $this->objectModel->getById($taskID);
+ }
+
+ public function update($taskID)
+ {
+ $objects = $this->objectModel->update($taskID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function startTest($taskID)
+ {
+ $objects = $this->objectModel->start($taskID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function closeTest($taskID)
+ {
+ $objects = $this->objectModel->close($taskID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function blockTest($taskID)
+ {
+ $objects = $this->objectModel->block($taskID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function activateTest($taskID)
+ {
+ $objects = $this->objectModel->activate($taskID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function linkCaseTest($taskID, $type)
+ {
+ $objects = $this->objectModel->linkCase($taskID, $type);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getRunsTest($taskID, $moduleID, $orderBy, $pager = null)
+ {
+ $objects = $this->objectModel->getRuns($taskID, $moduleID, $orderBy, $pager = null);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getUserRunsTest($taskID, $user, $modules = '', $orderBy = 'id_desc', $pager = null)
+ {
+ $objects = $this->objectModel->getUserRuns($taskID, $user, $modules = '', $orderBy = 'id_desc', $pager = null);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getTaskCasesTest($productID, $browseType, $queryID, $moduleID, $sort, $pager, $task)
+ {
+ $objects = $this->objectModel->getTaskCases($productID, $browseType, $queryID, $moduleID, $sort, $pager, $task);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getUserTestTaskPairsTest($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array())
+ {
+ $objects = $this->objectModel->getUserTestTaskPairs($account, $limit = 0, $status = 'all', $skipProductIDList = array(), $skipExecutionIDList = array());
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getRunByIdTest($runID)
+ {
+ $objects = $this->objectModel->getRunById($runID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function createResultTest($runID = 0)
+ {
+ $objects = $this->objectModel->createResult($runID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function batchRunTest($runCaseType = 'testcase', $taskID = 0)
+ {
+ $objects = $this->objectModel->batchRun($runCaseType = 'testcase', $taskID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getResultsTest($runID, $caseID = 0)
+ {
+ $objects = $this->objectModel->getResults($runID, $caseID = 0);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function printCellTest($col, $run, $users, $task, $branches, $mode = 'datatable')
+ {
+ $objects = $this->objectModel->printCell($col, $run, $users, $task, $branches, $mode = 'datatable');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function getToAndCcListTest($testtask)
+ {
+ $objects = $this->objectModel->getToAndCcList($testtask);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function importUnitResultTest($productID)
+ {
+ $objects = $this->objectModel->importUnitResult($productID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function processAutoResultTest($testtaskID, $productID, $suites, $cases, $results, $suiteNames = array(), $caseTitles = array(), $auto = 'unit')
+ {
+ $objects = $this->objectModel->processAutoResult($testtaskID, $productID, $suites, $cases, $results, $suiteNames = array(), $caseTitles = array(), $auto = 'unit');
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function parseCppXMLResultTest($fileName, $productID, $frame)
+ {
+ $objects = $this->objectModel->parseCppXMLResult($fileName, $productID, $frame);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function parseXMLResultTest($fileName, $productID, $frame)
+ {
+ $objects = $this->objectModel->parseXMLResult($fileName, $productID, $frame);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function parseZTFUnitResultTest($caseResults, $frame, $productID, $jobID, $compileID)
+ {
+ $objects = $this->objectModel->parseZTFUnitResult($caseResults, $frame, $productID, $jobID, $compileID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ public function parseZTFFuncResultTest($caseResults, $frame, $productID, $jobID, $compileID)
+ {
+ $objects = $this->objectModel->parseZTFFuncResult($caseResults, $frame, $productID, $jobID, $compileID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+}
diff --git a/test/data/build.yaml b/test/data/build.yaml
index ef47edb2ff..22ec785fa2 100644
--- a/test/data/build.yaml
+++ b/test/data/build.yaml
@@ -51,10 +51,22 @@ fields:
format: "YYYY-MM-DD"
- field: stories
- range: ''
+ fields:
+ - field: story1
+ range: 2-400:4
+ prefix: ""
+ postfix: ","
+ - field: story2
+ range: 4-400:4
- field: bugs
- range: ' '
+ fields:
+ - field: bug1
+ range: 1-300:3
+ prefix: ""
+ postfix: ","
+ - field: bug2
+ range: 2-400:3
- field: builder
range: 1-8
diff --git a/test/data/case.yaml b/test/data/case.yaml
index cbfba84e68..0b83ec487f 100644
--- a/test/data/case.yaml
+++ b/test/data/case.yaml
@@ -5,7 +5,7 @@ version: "1.0"
fields:
- field: id
note: "ID"
- range: 1-10000
+ range: 1-400
- field: product
note: "产品ID"
range: 1-100{4}
@@ -32,15 +32,15 @@ fields:
range: "1"
- field: title
note: "用例标题"
- range: "1-10000"
+ range: "1-400"
prefix: "这个是测试用例"
- field: precondition
note: "前置条件"
- range: "1-10000"
+ range: "1-400"
prefix: "这是前置条件"
- field: keywords
note: "关键词"
- range: "1-10000"
+ range: "1-400"
prefix: "这是关键词"
- field: pri
note: "优先级"
diff --git a/test/data/execution.yaml b/test/data/execution.yaml
index 94485096bb..977d864988 100644
--- a/test/data/execution.yaml
+++ b/test/data/execution.yaml
@@ -22,7 +22,9 @@ fields:
- field: status
range: wait,doing
- field: percent
- range: 0
+ range: 0{30},10{30},0{30}
+ - field: milestone
+ range: 0{30},1{10},0{10},1{10},0{30}
- field: auth
range: "extend"
- field: desc
diff --git a/test/data/libcase.yaml b/test/data/libcase.yaml
index a852dfcfda..6413079fa5 100644
--- a/test/data/libcase.yaml
+++ b/test/data/libcase.yaml
@@ -5,7 +5,7 @@ version: "1.0"
fields:
- field: id
note: "ID"
- range: 401-10000
+ range: 401-410
- field: product
note: "产品ID"
range: 0
@@ -32,15 +32,15 @@ fields:
range: "1"
- field: title
note: "用例标题"
- range: "1-10000"
+ range: "1-10"
prefix: "用例库用例"
- field: precondition
note: "前置条件"
- range: "1-10000"
+ range: "1-10"
prefix: "这是前置条件"
- field: keywords
note: "关键词"
- range: "1-10000"
+ range: "1-10"
prefix: "这是关键词"
- field: pri
note: "优先级"
diff --git a/test/data/module.yaml b/test/data/module.yaml
index d5db97e006..6dbb21392f 100644
--- a/test/data/module.yaml
+++ b/test/data/module.yaml
@@ -40,11 +40,14 @@ fields:
format: ""
- field: path
note: "ID路径"
- range: 1-10000
- prefix: ","
- postfix: ","
- loop: 0
- format: ""
+ fields:
+ - field: path1
+ range: 1-1000
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: []
+ postfix: ""
- field: grade
note: "等级"
range: 1
diff --git a/test/data/stage.yaml b/test/data/stage.yaml
new file mode 100644
index 0000000000..a5caa9bf28
--- /dev/null
+++ b/test/data/stage.yaml
@@ -0,0 +1,26 @@
+title: table zt_stage
+desc: ""
+author: automated export
+version: "1.0"
+fields:
+ - field: id
+ range: 1-6
+ - field: name
+ range: 需求,设计,开发,测试,发布,总结评审
+ - field: percent
+ range: 10{2},50,15,10,5
+ - field: type
+ range: request,design,dev,qa,release,review
+ - field: createdBy
+ range: admin
+ - field: createdDate
+ range: ""
+ prefix: "2018-02-12 12:00:00"
+ postfix: ""
+ - field: editedBy
+ range: admin
+ - field: editedDate
+ range: ""
+ prefix: "2020-02-12 13:50:27"
+ - field: deleted
+ range: "0"
diff --git a/test/data/storymodule.yaml b/test/data/storymodule.yaml
index b2be3f4949..8a285289d5 100644
--- a/test/data/storymodule.yaml
+++ b/test/data/storymodule.yaml
@@ -19,7 +19,7 @@ fields:
format: ""
- field: branch
note: "分支"
- range: 0
+ range: 0{161},1,2,0{2},3,4,0{10000}
prefix: ""
postfix: ""
loop: 0
@@ -40,10 +40,14 @@ fields:
format: ""
- field: path
note: "ID路径"
- range: 1821-10000
- prefix: ","
- postfix: ","
- loop: 0
+ fields:
+ - field: path1
+ range: 1821-2620
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: []
+ postfix: ""
format: ""
- field: grade
note: "等级"
diff --git a/test/data/storymoduleson.yaml b/test/data/storymoduleson.yaml
new file mode 100644
index 0000000000..a17c8fb846
--- /dev/null
+++ b/test/data/storymoduleson.yaml
@@ -0,0 +1,78 @@
+title: table zt_module
+desc: "模块"
+author: automated export
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 2621-10000
+ 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: "产品子模块"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: parent
+ note: "父ID"
+ range: 1821-2620:4{2}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: path
+ note: "ID路径"
+ fields:
+ - field: path1
+ range: 1821-2620:4{2}
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: 2621-10000
+ postfix: ","
+ - 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: story
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
diff --git a/test/data/taskmodule.yaml b/test/data/taskmodule.yaml
index 041b3313f8..10f8f183a2 100644
--- a/test/data/taskmodule.yaml
+++ b/test/data/taskmodule.yaml
@@ -40,11 +40,14 @@ fields:
format: ""
- field: path
note: "ID路径"
- range: 21-10000
- prefix: ","
- postfix: ","
- loop: 0
- format: ""
+ fields:
+ - field: path1
+ range: 21-1820
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: []
+ postfix: ""
- field: grade
note: "等级"
range: 1
diff --git a/test/data/taskmoduleson.yaml b/test/data/taskmoduleson.yaml
new file mode 100644
index 0000000000..da3d4b7d20
--- /dev/null
+++ b/test/data/taskmoduleson.yaml
@@ -0,0 +1,78 @@
+title: table zt_module
+desc: "模块"
+author: automated export
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 3021-3620
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: root
+ note: "根目录"
+ range: 101-700{1}
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: branch
+ note: "分支"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: name
+ note: "模块名称"
+ range: 1-10000
+ prefix: "执行子模块"
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: parent
+ note: "父ID"
+ range: 21-1820:2
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: path
+ note: "ID路径"
+ fields:
+ - field: path1
+ range: 21-1820:2
+ prefix: ","
+ postfix: ","
+ - field: path2
+ range: 3021-3620
+ postfix: ""
+ - 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: task
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
diff --git a/test/data/testresult.yaml b/test/data/testresult.yaml
index 014890f463..1489206cc9 100644
--- a/test/data/testresult.yaml
+++ b/test/data/testresult.yaml
@@ -5,21 +5,21 @@ version: "1.0"
fields:
- field: id
note: "ID"
- range: 1-40
+ range: 1-70
prefix: ""
postfix: ""
loop: 0
format: ""
- field: run
note: "运行"
- range: 1-40
+ range: 1-70
prefix: ""
postfix: ""
loop: 0
format: ""
- field: case
note: "用例ID"
- range: 1-400
+ range: 1-40,411-440
prefix: ""
postfix: ""
loop: 0
@@ -47,7 +47,7 @@ fields:
format: ""
- field: caseResult
note: "测试结果"
- range: pass,fail
+ range: [pass,fail]{20!},[pass,pass,fail]{15!}
prefix: ""
postfix: ""
loop: 0
diff --git a/test/data/testrun.yaml b/test/data/testrun.yaml
index 82a0a65a09..569ea35234 100644
--- a/test/data/testrun.yaml
+++ b/test/data/testrun.yaml
@@ -12,14 +12,14 @@ fields:
format: ""
- field: task
note: "测试单任务ID"
- range: 1-10{4}
+ range: 1-10{4},51-60{3}
prefix: ""
postfix: ""
loop: 0
format: ""
- field: case
note: "用例ID"
- range: 1-40
+ range: 1-40,411-440
prefix: ""
postfix: ""
loop: 0
@@ -44,7 +44,7 @@ fields:
format: ""
- field: lastRunner
note: "最后执行人"
- use: admin
+ range: []{40},admin{30}
prefix: ""
postfix: ""
loop: 0
@@ -59,14 +59,14 @@ fields:
format: "YYYY-MM-DD"
- field: lastRunResult
note: "最后执行结果"
- range: pass,fail
+ range: [pass,fail]{20!},[pass,pass,fail]{15!}
prefix: ""
postfix: ""
loop: 0
format: ""
- field: status
note: "状态"
- range: normal
+ range: normal{40},done{30}
prefix: ""
postfix: ""
loop: 0
diff --git a/test/data/testtask.yaml b/test/data/testtask.yaml
index 6f794fa878..ea7096c970 100644
--- a/test/data/testtask.yaml
+++ b/test/data/testtask.yaml
@@ -12,34 +12,38 @@ fields:
format: ""
- field: name
note: "测试单名称"
- range: 1-10000
- prefix: "测试单"
+ fields:
+ - field: name1
+ range: 测试单{50},单元测试{50}
+ - field: name2
+ range: 1-50,1-50
+ prefix: ""
postfix: ""
loop: 0
format: ""
- field: product
note: "所属产品"
- range: 1-10
+ range: 1-50
prefix: ""
postfix: ""
loop: 0
format: ""
- field: project
note: "所属项目"
- range: 11-20
+ range: 11-60
prefix: ""
postfix: ""
loop: 0
format: ""
- field: execution
note: "所属执行"
- range: 101-110
+ range: 101-150
prefix: ""
postfix: ""
loop: 0
format: ""
- field: build
- range: 11-20
+ range: 11-20,0{40}
note: "版本"
prefix: ""
postfix: ""
@@ -105,7 +109,7 @@ fields:
format: ""
- field: auto
note: "自动"
- range: no
+ range: no{50},unit{50}
prefix: ""
postfix: ""
loop: 0
diff --git a/test/data/unitcase.yaml b/test/data/unitcase.yaml
new file mode 100644
index 0000000000..92ba59a6ee
--- /dev/null
+++ b/test/data/unitcase.yaml
@@ -0,0 +1,141 @@
+title: table zt_case
+desc: "测试用例"
+author: automated export
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 411-10000
+ - field: product
+ note: "产品ID"
+ range: 1-50{3}
+ - field: branch
+ note: "分支ID"
+ range: 0
+ - field: execution
+ note: "执行ID"
+ range: 0
+ - field: lib
+ note: "所属库"
+ range: 0
+ - field: module
+ note: "所属模块"
+ range: 0
+ - field: path
+ note: ""
+ range: "0"
+ - field: story
+ note: "相关需求"
+ range: "0"
+ - field: storyVersion
+ note: "需求版本"
+ range: "1"
+ - field: title
+ note: "用例标题"
+ range: 登录成功,密码错误,账号过期
+ prefix: "com.ngtesting.autotest.test.TestLogin"
+ - field: precondition
+ note: "前置条件"
+ range: []
+ prefix: ""
+ - field: keywords
+ note: "关键词"
+ range: []
+ prefix: ""
+ - field: pri
+ note: "优先级"
+ range: 1-4
+ - field: type
+ note: "用例类型"
+ range: unit
+ - field: auto
+ note: "是否是自动化测试用例"
+ range: "unit"
+ - field: frame
+ note: "自动化测试框架"
+ range: "junit"
+ - field: stage
+ note: "适用阶段"
+ range: unittest
+ - field: howRun
+ note: "测试方式"
+ range: ""
+ - field: scriptedBy
+ note: "脚本由谁创建"
+ range: ""
+ - field: scriptedDate
+ note: "脚本创建日期"
+ from: common.date.v1.yaml
+ use: dateB
+ - field: scriptStatus
+ note: "脚本状态"
+ range: ""
+ - field: scriptLocation
+ note: "脚本地址"
+ range: ""
+ - field: status
+ note: "用例状态"
+ range: normal
+ - field: subStatus
+ note: "子状态"
+ range: ""
+ - field: color
+ note: "标题颜色"
+ range: ""
+ - field: frequency
+ note: "使用频率"
+ range: 1
+ - field: order
+ note: "排序"
+ range: 0
+ - field: openedBy
+ note: "由谁创建"
+ range: admin
+ prefix: ""
+ - field: openedDate
+ note: "创建日期"
+ range: "-:600"
+ type: timestamp
+ format: "YYYY-MM-DD hh:mm:ss"
+ - field: reviewedBy
+ note: "由谁评审"
+ range: ""
+ - field: reviewedDate
+ note: "评审时间"
+ range: ""
+ - field: lastEditedBy
+ note: "最后修改者"
+ range: ""
+ - field: lastEditedDate
+ note: "修改日期"
+ range: ""
+ - field: version
+ note: "用例版本"
+ range: "1"
+ - field: linkCase
+ note: "相关用例"
+ range: ""
+ - field: fromBug
+ note: "来源Bug"
+ range: 0
+ - field: fromCaseID
+ note: ""
+ range: 0
+ - field: fromCaseVersion
+ note: ""
+ range: 1
+ - field: deleted
+ note: "是否删除"
+ range: 0
+ - field: lastRunner
+ note: "执行人"
+ range: admin
+ prefix: ""
+ - field: lastRunDate
+ note: "执行时间"
+ range: "-:500"
+ type: timestamp
+ format: "YYYY-MM-DD hh:mm:ss"
+ - field: lastRunResult
+ note: "结果"
+ range: pass,pass,fail
diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php
index 11fc196c08..584924ae97 100644
--- a/test/data/zentao/config.php
+++ b/test/data/zentao/config.php
@@ -18,30 +18,33 @@ $builder->project = array('rows' => 90, 'extends' => array('project', 'proj
$builder->projectalone = array('rows' => 20, 'extends' => array('project', 'projectalone'));
$builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution'));
-$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->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->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->casestep = array('rows' => 400, 'extends' => array('casestep'));
-$builder->bug = array('rows' => 300, 'extends' => array('bug'));
-$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
+$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->bug = array('rows' => 300, 'extends' => array('bug'));
+$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
-$builder->testtask = array('rows' => 10, 'extends' => array('testtask'));
-$builder->testresult = array('rows' => 40, 'extends' => array('testresult'));
-$builder->testrun = array('rows' => 40, 'extends' => array('testrun'));
+$builder->testtask = array('rows' => 100, 'extends' => array('testtask'));
+$builder->testresult = array('rows' => 70, 'extends' => array('testresult'));
+$builder->testrun = array('rows' => 70, 'extends' => array('testrun'));
$builder->testreport = array('rows' => 10, 'extends' => array('testreport'));
$builder->testsuite = array('rows' => 201, 'extends' => array('testsuite'));
$builder->suitecase = array('rows' => 400, 'extends' => array('suitecase'));
@@ -88,6 +91,7 @@ $builder->release = array('rows' => 10, 'extends' => array('release'));
$builder->design = array('rows' => 120, 'extends' => array('design'));
$builder->designspec = array('rows' => 120, 'extends' => array('designspec'));
+$builder->stage = array('rows' => 6, 'extends' => array('stage'));
$builder->webhook = array('rows' => 7, 'extends' => array('webhook'));
$builder->entry = array('rows' => 1, 'extends' => array('entry'));
diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php
index 0796e8d6a9..18839c9dd7 100644
--- a/test/data/zentao/processor.php
+++ b/test/data/zentao/processor.php
@@ -344,6 +344,7 @@ class Processor
$this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (3, 'admin', 'user', '用户测试条件', 'a:48:{s:13:\"fieldrealname\";s:0:\"\";s:10:\"fieldemail\";s:0:\"\";s:9:\"fielddept\";s:0:\"\";s:12:\"fieldaccount\";s:0:\"\";s:9:\"fieldrole\";s:0:\"\";s:10:\"fieldphone\";s:0:\"\";s:9:\"fieldjoin\";s:0:\"\";s:12:\"fieldvisions\";s:3:\"rnd\";s:7:\"fieldid\";s:0:\"\";s:13:\"fieldcommiter\";s:1:\"0\";s:11:\"fieldgender\";s:1:\"m\";s:7:\"fieldqq\";s:0:\"\";s:10:\"fieldskype\";s:0:\"\";s:13:\"fielddingding\";s:0:\"\";s:11:\"fieldweixin\";s:0:\"\";s:10:\"fieldslack\";s:0:\"\";s:13:\"fieldwhatsapp\";s:0:\"\";s:12:\"fieldaddress\";s:0:\"\";s:12:\"fieldzipcode\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:8:\"realname\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:9:\"白名单\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:5:\"email\";s:9:\"operator2\";s:7:\"include\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:4:\"dept\";s:9:\"operator3\";s:6:\"belong\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"account\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:4:\"role\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:5:\"phone\";s:9:\"operator6\";s:7:\"include\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:4:\"user\";s:9:\"actionURL\";s:74:\"/index.php?m=company&f=browse&browseType=all¶m=myQueryID&type=bysearch\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"lite\";}', '(( 1 AND `realname` LIKE \'%白名单%\' ) AND ( 1 ))', '0');");
$this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (4, 'admin', 'projectBuild', '项目版本搜索', 'a:38:{s:9:\"fieldname\";s:0:\"\";s:12:\"fieldproduct\";s:0:\"\";s:12:\"fieldscmPath\";s:0:\"\";s:13:\"fieldfilePath\";s:0:\"\";s:9:\"fielddate\";s:0:\"\";s:12:\"fieldbuilder\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:14:\"fieldexecution\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:8:\"版本7\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:7:\"product\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"scmPath\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:8:\"filePath\";s:9:\"operator5\";s:7:\"include\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:4:\"date\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:12:\"projectBuild\";s:9:\"actionURL\";s:73:\"/index.php?m=project&f=build&projectID=13&type=bysearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%版本7%\' ) AND ( 1 ))', '0');");
$this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (5, 'admin', 'executionBuild', '执行版本搜索', 'a:37:{s:9:\"fieldname\";s:0:\"\";s:12:\"fieldproduct\";s:0:\"\";s:12:\"fieldscmPath\";s:0:\"\";s:13:\"fieldfilePath\";s:0:\"\";s:9:\"fielddate\";s:0:\"\";s:12:\"fieldbuilder\";s:0:\"\";s:9:\"fielddesc\";s:0:\"\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:4:\"name\";s:9:\"operator1\";s:7:\"include\";s:6:\"value1\";s:8:\"版本17\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:2:\"id\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:7:\"product\";s:9:\"operator3\";s:1:\"=\";s:6:\"value3\";s:0:\"\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:7:\"scmPath\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:8:\"filePath\";s:9:\"operator5\";s:7:\"include\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:4:\"date\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:14:\"executionBuild\";s:9:\"actionURL\";s:78:\"/index.php?m=execution&f=build&executionID=101&type=bysearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%版本17%\' ) AND ( 1 ))', '0');");
+ $this->dao->query("INSERT INTO `zt_userquery` (`id`, `account`, `module`, `title`, `form`, `sql`, `shortcut`) VALUES (6, 'admin', 'design', '设计搜索', 'a:37:{s:9:\"fieldtype\";s:0:\"\";s:9:\"fieldname\";s:0:\"\";s:11:\"fieldcommit\";s:0:\"\";s:14:\"fieldcreatedBy\";s:0:\"\";s:16:\"fieldcreatedDate\";s:0:\"\";s:15:\"fieldassignedTo\";s:0:\"\";s:10:\"fieldstory\";s:1:\"0\";s:7:\"fieldid\";s:0:\"\";s:6:\"andOr1\";s:3:\"AND\";s:6:\"field1\";s:2:\"id\";s:9:\"operator1\";s:1:\"=\";s:6:\"value1\";s:0:\"\";s:6:\"andOr2\";s:3:\"and\";s:6:\"field2\";s:4:\"type\";s:9:\"operator2\";s:1:\"=\";s:6:\"value2\";s:0:\"\";s:6:\"andOr3\";s:3:\"and\";s:6:\"field3\";s:4:\"name\";s:9:\"operator3\";s:7:\"include\";s:6:\"value3\";s:19:\"这是一个设计1\";s:10:\"groupAndOr\";s:3:\"and\";s:6:\"andOr4\";s:3:\"AND\";s:6:\"field4\";s:6:\"commit\";s:9:\"operator4\";s:7:\"include\";s:6:\"value4\";s:0:\"\";s:6:\"andOr5\";s:3:\"and\";s:6:\"field5\";s:9:\"createdBy\";s:9:\"operator5\";s:1:\"=\";s:6:\"value5\";s:0:\"\";s:6:\"andOr6\";s:3:\"and\";s:6:\"field6\";s:11:\"createdDate\";s:9:\"operator6\";s:1:\"=\";s:6:\"value6\";s:0:\"\";s:6:\"module\";s:6:\"design\";s:9:\"actionURL\";s:86:\"/index.php?m=design&f=browse&projectID=41&productID=31&type=bySearch&queryID=myQueryID\";s:10:\"groupItems\";s:1:\"3\";s:8:\"formType\";s:4:\"more\";}', '(( 1 AND `name` LIKE \'%这是一个设计1%\' ) AND ( 1 ))', '0');");
}
private function initMessage()
diff --git a/test/model/action/getlist.php b/test/model/action/getlist.php
index b5d7b47d0f..ee81c8740e 100755
--- a/test/model/action/getlist.php
+++ b/test/model/action/getlist.php
@@ -17,42 +17,42 @@ $objectId = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
$action = new actionTest();
-r($action->getListTest($objectType[0], $objectId[0])) && p('id,actor,extra') && e("1,admin,1"); // 测试获取objectType product objectId 1的动态信息
-r($action->getListTest($objectType[1], $objectId[1])) && p('id,actor,extra') && e("2,dev17,1"); // 测试获取objectType story objectId 2的动态信息
-r($action->getListTest($objectType[2], $objectId[2])) && p('id,actor,extra') && e("3,test18,1"); // 测试获取objectType productplan objectId 3的动态信息
-r($action->getListTest($objectType[3], $objectId[3])) && p('id,actor,extra') && e("4,admin,1"); // 测试获取objectType release objectId 4的动态信息
-r($action->getListTest($objectType[4], $objectId[4])) && p('id,actor,extra') && e("5,dev17,11"); // 测试获取objectType project objectId 5的动态信息
-r($action->getListTest($objectType[5], $objectId[5])) && p('id,actor,extra') && e("6,test18,1"); // 测试获取objectType task objectId 6的动态信息
-r($action->getListTest($objectType[6], $objectId[6])) && p('id,actor,extra') && e("7,admin,1"); // 测试获取objectType build objectId 7的动态信息
-r($action->getListTest($objectType[7], $objectId[7])) && p('id,actor,extra') && e("8,dev17,1"); // 测试获取objectType bug objectId 8的动态信息
-r($action->getListTest($objectType[8], $objectId[8])) && p('id,actor,extra') && e("9,test18,2"); // 测试获取objectType testcase objectId 9的动态信息
-r($action->getListTest($objectType[9], $objectId[9])) && p('id,actor,extra') && e("10,admin,1"); // 测试获取objectType case objectId 10的动态信息
-r($action->getListTest($objectType[10], $objectId[10])) && p('id,actor,extra') && e("11,dev17,1"); // 测试获取objectType testtask objectId 11的动态信息
-r($action->getListTest($objectType[11], $objectId[11])) && p('id,actor,extra') && e("12,test18,1"); // 测试获取objectType user objectId 12的动态信息
-r($action->getListTest($objectType[12], $objectId[12])) && p('id,actor,extra') && e("13,admin,1"); // 测试获取objectType doc objectId 13的动态信息
-r($action->getListTest($objectType[13], $objectId[13])) && p('id,actor,extra') && e("14,dev17,1"); // 测试获取objectType doclib objectId 14的动态信息
-r($action->getListTest($objectType[14], $objectId[14])) && p('id,actor,extra') && e("15,test18,1"); // 测试获取objectType todo objectId 15的动态信息
-r($action->getListTest($objectType[15], $objectId[15])) && p('id,actor,extra') && e("16,admin,1"); // 测试获取objectType branch objectId 16的动态信息
-r($action->getListTest($objectType[16], $objectId[16])) && p('id,actor,extra') && e("17,dev17,1"); // 测试获取objectType module objectId 17的动态信息
+r($action->getListTest($objectType[0], $objectId[0])) && p('id,actor,extra') && e("1,admin,1"); // 测试获取objectType product objectId 1的动态信息
+r($action->getListTest($objectType[1], $objectId[1])) && p('id,actor,extra') && e("2,dev17,1"); // 测试获取objectType story objectId 2的动态信息
+r($action->getListTest($objectType[2], $objectId[2])) && p('id,actor,extra') && e("3,test18,1"); // 测试获取objectType productplan objectId 3的动态信息
+r($action->getListTest($objectType[3], $objectId[3])) && p('id,actor,extra') && e("4,admin,1"); // 测试获取objectType release objectId 4的动态信息
+r($action->getListTest($objectType[4], $objectId[4])) && p('id,actor,extra') && e("5,dev17,11"); // 测试获取objectType project objectId 5的动态信息
+r($action->getListTest($objectType[5], $objectId[5])) && p('id,actor,extra') && e("6,test18,1"); // 测试获取objectType task objectId 6的动态信息
+r($action->getListTest($objectType[6], $objectId[6])) && p('id,actor,extra') && e("7,admin,1"); // 测试获取objectType build objectId 7的动态信息
+r($action->getListTest($objectType[7], $objectId[7])) && p('id,actor,extra') && e("8,dev17,1"); // 测试获取objectType bug objectId 8的动态信息
+r($action->getListTest($objectType[8], $objectId[8])) && p('id,actor,extra') && e("9,test18,2"); // 测试获取objectType testcase objectId 9的动态信息
+r($action->getListTest($objectType[9], $objectId[9])) && p('id,actor,extra') && e("10,admin,1"); // 测试获取objectType case objectId 10的动态信息
+r($action->getListTest($objectType[10], $objectId[10])) && p('id,actor,extra') && e("11,dev17,1"); // 测试获取objectType testtask objectId 11的动态信息
+r($action->getListTest($objectType[11], $objectId[11])) && p('id,actor,extra') && e("12,test18,1"); // 测试获取objectType user objectId 12的动态信息
+r($action->getListTest($objectType[12], $objectId[12])) && p('id,actor,extra') && e("13,admin,1"); // 测试获取objectType doc objectId 13的动态信息
+r($action->getListTest($objectType[13], $objectId[13])) && p('id,actor,extra') && e("14,dev17,1"); // 测试获取objectType doclib objectId 14的动态信息
+r($action->getListTest($objectType[14], $objectId[14])) && p('id,actor,extra') && e("15,test18,1"); // 测试获取objectType todo objectId 15的动态信息
+r($action->getListTest($objectType[15], $objectId[15])) && p('id,actor,extra') && e("16,admin,1"); // 测试获取objectType branch objectId 16的动态信息
+r($action->getListTest($objectType[16], $objectId[16])) && p('id,actor,extra') && e("17,dev17,1"); // 测试获取objectType module objectId 17的动态信息
r($action->getListTest($objectType[17], $objectId[17])) && p('id,actor,extra') && e("18,test18,#1 项目集1"); // 测试获取objectType testsuite objectId 18的动态信息
-r($action->getListTest($objectType[18], $objectId[18])) && p('id,actor,extra') && e("19,admin,1"); // 测试获取objectType caselib objectId 19的动态信息
-r($action->getListTest($objectType[19], $objectId[19])) && p('id,actor,extra') && e("20,dev17,1"); // 测试获取objectType testreport objectId 20的动态信息
-r($action->getListTest($objectType[20], $objectId[20])) && p('id,actor,extra') && e("21,test18,1"); // 测试获取objectType entry objectId 21的动态信息
+r($action->getListTest($objectType[18], $objectId[18])) && p('id,actor,extra') && e("19,admin,1"); // 测试获取objectType caselib objectId 19的动态信息
+r($action->getListTest($objectType[19], $objectId[19])) && p('id,actor,extra') && e("20,dev17,1"); // 测试获取objectType testreport objectId 20的动态信息
+r($action->getListTest($objectType[20], $objectId[20])) && p('id,actor,extra') && e("21,test18,1"); // 测试获取objectType entry objectId 21的动态信息
r($action->getListTest($objectType[21], $objectId[21])) && p('id,actor,extra') && e("22,admin,1"); // 测试获取objectType webhook objectId 22的动态信息
-r($action->getListTest($objectType[22], $objectId[22])) && p('id,actor,extra') && e("23,dev17,1"); // 测试获取objectType review objectId 23的动态信息
-r($action->getListTest($objectType[0], $objectId[23])) && p('id,actor,extra') && e("24,test18,1"); // 测试获取objectType product objectId 24的动态信息
-r($action->getListTest($objectType[1], $objectId[24])) && p('id,actor,extra') && e("25,admin,1"); // 测试获取objectType story objectId 25的动态信息
-r($action->getListTest($objectType[2], $objectId[25])) && p('id,actor,extra') && e("26,dev17,1"); // 测试获取objectType productplan objectId 26的动态信息
-r($action->getListTest($objectType[3], $objectId[26])) && p('id,actor,extra') && e("27,test18,1"); // 测试获取objectType release objectId 27的动态信息
-r($action->getListTest($objectType[4], $objectId[27])) && p('id,actor,extra') && e("28,admin,33"); // 测试获取objectType project objectId 28的动态信息
-r($action->getListTest($objectType[5], $objectId[28])) && p('id,actor,extra') && e("29,dev17,1"); // 测试获取objectType task objectId 29的动态信息
-r($action->getListTest($objectType[6], $objectId[29])) && p('id,actor,extra') && e("30,test18,1"); // 测试获取objectType build objectId 30的动态信息
-r($action->getListTest($objectType[7], $objectId[30])) && p('id,actor,extra') && e("31,admin,1"); // 测试获取objectType bug objectId 31的动态信息
-r($action->getListTest($objectType[8], $objectId[31])) && p('id,actor,extra') && e("32,项目经理17,1"); // 测试获取objectType testcase objectId 32的动态信息
-r($action->getListTest($objectType[9], $objectId[32])) && p('id,actor,extra') && e("33,test18,1"); // 测试获取objectType case objectId 33的动态信息
-r($action->getListTest($objectType[10], $objectId[33])) && p('id,actor,extra') && e("34,admin,1"); // 测试获取objectType testtask objectId 34的动态信息
-r($action->getListTest($objectType[11], $objectId[34])) && p('id,actor,extra') && e("35,dev17,1"); // 测试获取objectType user objectId 35的动态信息
-r($action->getListTest($objectType[12], $objectId[35])) && p('id,actor,extra') && e("36,test18,1"); // 测试获取objectType doc objectId 36的动态信息
-r($action->getListTest($objectType[13], $objectId[36])) && p('id,actor,extra') && e("37,admin,1"); // 测试获取objectType doclib objectId 37的动态信息
-r($action->getListTest($objectType[14], $objectId[37])) && p('id,actor,extra') && e("38,dev17,1"); // 测试获取objectType todo objectId 38的动态信息
+r($action->getListTest($objectType[22], $objectId[22])) && p('id,actor,extra') && e("23,dev17,1"); // 测试获取objectType review objectId 23的动态信息
+r($action->getListTest($objectType[0], $objectId[23])) && p('id,actor,extra') && e("24,test18,1"); // 测试获取objectType product objectId 24的动态信息
+r($action->getListTest($objectType[1], $objectId[24])) && p('id,actor,extra') && e("25,admin,1"); // 测试获取objectType story objectId 25的动态信息
+r($action->getListTest($objectType[2], $objectId[25])) && p('id,actor,extra') && e("26,dev17,1"); // 测试获取objectType productplan objectId 26的动态信息
+r($action->getListTest($objectType[3], $objectId[26])) && p('id,actor,extra') && e("27,test18,1"); // 测试获取objectType release objectId 27的动态信息
+r($action->getListTest($objectType[4], $objectId[27])) && p('id,actor,extra') && e("28,admin,33"); // 测试获取objectType project objectId 28的动态信息
+r($action->getListTest($objectType[5], $objectId[28])) && p('id,actor,extra') && e("29,dev17,1"); // 测试获取objectType task objectId 29的动态信息
+r($action->getListTest($objectType[6], $objectId[29])) && p('id,actor,extra') && e("30,test18,1"); // 测试获取objectType build objectId 30的动态信息
+r($action->getListTest($objectType[7], $objectId[30])) && p('id,actor,extra') && e("31,admin,1"); // 测试获取objectType bug objectId 31的动态信息
+r($action->getListTest($objectType[8], $objectId[31])) && p('id,actor,extra') && e("32,项目经理17,1"); // 测试获取objectType testcase objectId 32的动态信息
+r($action->getListTest($objectType[9], $objectId[32])) && p('id,actor,extra') && e("33,test18,1"); // 测试获取objectType case objectId 33的动态信息
+r($action->getListTest($objectType[10], $objectId[33])) && p('id,actor,extra') && e("34,admin,1"); // 测试获取objectType testtask objectId 34的动态信息
+r($action->getListTest($objectType[11], $objectId[34])) && p('id,actor,extra') && e("35,dev17,1"); // 测试获取objectType user objectId 35的动态信息
+r($action->getListTest($objectType[12], $objectId[35])) && p('id,actor,extra') && e("36,test18,1"); // 测试获取objectType doc objectId 36的动态信息
+r($action->getListTest($objectType[13], $objectId[36])) && p('id,actor,extra') && e("37,admin,1"); // 测试获取objectType doclib objectId 37的动态信息
+r($action->getListTest($objectType[14], $objectId[37])) && p('id,actor,extra') && e("38,dev17,1"); // 测试获取objectType todo objectId 38的动态信息
r($action->getListTest($objectType[15], $objectId[38])) && p('id,actor,extra') && e("39,test18,项目版本版本1"); // 测试获取objectType branch objectId 39的动态信息
diff --git a/test/model/custom/deleteitems.php b/test/model/custom/deleteitems.php
new file mode 100755
index 0000000000..a7cc6f8bb3
--- /dev/null
+++ b/test/model/custom/deleteitems.php
@@ -0,0 +1,37 @@
+#!/usr/bin/env php
+deleteItems();
+cid=1
+pid=1
+
+测试参数为空 >> 0
+测试参数为lang >> 0
+测试参数为lang,module >> 0
+测试参数为lang,key,section >> 0
+测试参数为lang,key,section,module >> 0
+测试参数为lang,key,section,module,vision >> 0
+
+*/
+
+$lang = 'lang=zh-cn';
+$module = 'module=custom';
+$section = 'section=URSRList';
+$key = 'key=1';
+$vision = 'vision=rnd';
+$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision);
+
+$custom = new customTest();
+
+r($custom->deleteItemsTest($paramString[0])) && p() && e('0'); //测试参数为空
+r($custom->deleteItemsTest($paramString[1])) && p() && e('0'); //测试参数为lang
+r($custom->deleteItemsTest($paramString[2])) && p() && e('0'); //测试参数为lang,module
+r($custom->deleteItemsTest($paramString[3])) && p() && e('0'); //测试参数为lang,key,section
+r($custom->deleteItemsTest($paramString[4])) && p() && e('0'); //测试参数为lang,key,section,module
+r($custom->deleteItemsTest($paramString[5])) && p() && e('0'); //测试参数为lang,key,section,module,vision
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/custom/getalllang.php b/test/model/custom/getalllang.php
new file mode 100755
index 0000000000..64c63eb325
--- /dev/null
+++ b/test/model/custom/getalllang.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getAllLang();
+cid=1
+pid=1
+
+测试正常查询 >> 2
+
+*/
+
+$custom = new customTest();
+
+r($custom->getAllLangTest()) && p() && e('2'); //测试正常查询
\ No newline at end of file
diff --git a/test/model/custom/getformfields.php b/test/model/custom/getformfields.php
new file mode 100755
index 0000000000..29eeec22bb
--- /dev/null
+++ b/test/model/custom/getformfields.php
@@ -0,0 +1,125 @@
+#!/usr/bin/env php
+getFormFields();
+cid=1
+pid=1
+
+测试moduleName值为product,method为空 >> 0
+测试moduleName值为product,method为create >> 产品负责人,测试负责人,发布负责人,产品类型
+测试moduleName值为product,method为edit >> 产品负责人,测试负责人,发布负责人,产品类型,状态
+测试moduleName值为story,method为空 >> 0
+测试moduleName值为story,method为create >> 所属模块,所属计划,来源,优先级
+测试moduleName值为story,method为change >> 备注
+测试moduleName值为story,method为close >> 备注
+测试moduleName值为story,method为review >> 评审时间,备注
+测试moduleName值为productplan,method为空 >> 开始日期,结束日期,描述
+测试moduleName值为productplan,method为create >> 开始日期,结束日期,描述
+测试moduleName值为productplan,method为edit >> 开始日期,结束日期,描述
+测试moduleName值为release,method为空 >> 0
+测试moduleName值为release,method为create >> 描述
+测试moduleName值为release,method为edit >> 描述
+测试moduleName值为execution,method为空 >> 0
+测试moduleName值为execution,method为create >> 可用工作日,迭代描述
+测试moduleName值为execution,method为edit >> 可用工作日,迭代描述,产品负责人,迭代负责人
+测试moduleName值为execution,method为close >> 0
+测试moduleName值为execution,method为start >> 0
+测试moduleName值为task,method为空 >> 0
+测试moduleName值为task,method为create >> 相关研发需求,优先级,最初预计,任务描述
+测试moduleName值为task,method为edit >> 优先级,最初预计,预计开始
+测试moduleName值为task,method为finish >> 备注
+测试moduleName值为task,method为activate >> 指派给,备注
+测试moduleName值为build,method为空 >> 源代码地址,下载地址,描述
+测试moduleName值为build,method为create >> 源代码地址,下载地址,描述
+测试moduleName值为build,method为edit >> 源代码地址,下载地址,描述
+测试moduleName值为bug,method为空 >> 0
+测试moduleName值为bug,method为create >> 所属模块,所属项目,截止日期
+测试moduleName值为bug,method为edit >> 所属计划,Bug类型,浏览器,优先级
+测试moduleName值为bug,method为resolve >> 解决版本,备注
+测试moduleName值为testcase,method为空 >> 0
+测试moduleName值为testcase,method为create >> 适用阶段,相关研发需求,优先级
+测试moduleName值为testcase,method为edit >> 适用阶段,相关研发需求,优先级
+测试moduleName值为testsuite,method为空 >> 描述
+测试moduleName值为testsuite,method为create >> 描述
+测试moduleName值为testsuite,method为edit >> 描述
+测试moduleName值为testreport,method为空 >> 开始时间,结束时间,参与人员,总结
+测试moduleName值为testreport,method为create >> 开始时间,结束时间,参与人员,总结
+测试moduleName值为testreport,method为edit >> 开始时间,结束时间,参与人员,总结
+测试moduleName值为caselib,method为空 >> 描述
+测试moduleName值为caselib,method为create >> 描述
+测试moduleName值为caselib,method为edit >> 描述
+测试moduleName值为caselib,method为空 >> 负责人,优先级,描述
+测试moduleName值为testtask,method为create >> 负责人,优先级,描述
+测试moduleName值为testtask,method为edit >> 负责人,优先级,描述
+测试moduleName值为testtask,method为importUnit >> 负责人,优先级,描述
+测试moduleName值为doc,method为空 >> 关键字,文档正文
+测试moduleName值为doc,method为create >> 关键字,文档正文
+测试moduleName值为doc,method为edit >> 关键字,文档正文
+测试moduleName值为user,method为空 >> 0
+测试moduleName值为user,method为create >> 部门,职位,邮箱,源代码帐号
+测试moduleName值为user,method为edit >> Skype,QQ,手机,电话
+
+*/
+$moduleName = array('product', 'story', 'productplan', 'release', 'execution', 'task', 'build', 'bug', 'testcase', 'testsuite', 'testreport', 'caselib', 'testtask', 'doc', 'user');
+$method = array('', 'create', 'edit', 'change', 'close', 'review', 'start', 'finish', 'activate', 'resolve', 'importUnit');
+
+$custom = new customTest();
+
+r($custom->getFormFieldsTest($moduleName[0], $method[0])) && p() && e('0'); //测试moduleName值为product,method为空
+r($custom->getFormFieldsTest($moduleName[0], $method[1])) && p('PO,QD,RD,type') && e('产品负责人,测试负责人,发布负责人,产品类型'); //测试moduleName值为product,method为create
+r($custom->getFormFieldsTest($moduleName[0], $method[2])) && p('PO,QD,RD,type,status') && e('产品负责人,测试负责人,发布负责人,产品类型,状态');//测试moduleName值为product,method为edit
+r($custom->getFormFieldsTest($moduleName[1], $method[0])) && p() && e('0'); //测试moduleName值为story,method为空
+r($custom->getFormFieldsTest($moduleName[1], $method[1])) && p('module,plan,source,pri') && e('所属模块,所属计划,来源,优先级'); //测试moduleName值为story,method为create
+r($custom->getFormFieldsTest($moduleName[1], $method[3])) && p('comment') && e('备注'); //测试moduleName值为story,method为change
+r($custom->getFormFieldsTest($moduleName[1], $method[4])) && p('comment') && e('备注'); //测试moduleName值为story,method为close
+r($custom->getFormFieldsTest($moduleName[1], $method[5])) && p('reviewedDate,comment') && e('评审时间,备注'); //测试moduleName值为story,method为review
+r($custom->getFormFieldsTest($moduleName[2], $method[0])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为空
+r($custom->getFormFieldsTest($moduleName[2], $method[1])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为create
+r($custom->getFormFieldsTest($moduleName[2], $method[2])) && p('begin,end,desc') && e('开始日期,结束日期,描述'); //测试moduleName值为productplan,method为edit
+r($custom->getFormFieldsTest($moduleName[3], $method[0])) && p() && e('0'); //测试moduleName值为release,method为空
+r($custom->getFormFieldsTest($moduleName[3], $method[1])) && p('desc') && e('描述'); //测试moduleName值为release,method为create
+r($custom->getFormFieldsTest($moduleName[3], $method[2])) && p('desc') && e('描述'); //测试moduleName值为release,method为edit
+r($custom->getFormFieldsTest($moduleName[4], $method[0])) && p() && e('0'); //测试moduleName值为execution,method为空
+r($custom->getFormFieldsTest($moduleName[4], $method[1])) && p('days,desc') && e('可用工作日,迭代描述'); //测试moduleName值为execution,method为create
+r($custom->getFormFieldsTest($moduleName[4], $method[2])) && p('days,desc,PO,PM') && e('可用工作日,迭代描述,产品负责人,迭代负责人'); //测试moduleName值为execution,method为edit
+r($custom->getFormFieldsTest($moduleName[4], $method[4])) && p() && e('0'); //测试moduleName值为execution,method为close
+r($custom->getFormFieldsTest($moduleName[4], $method[6])) && p() && e('0'); //测试moduleName值为execution,method为start
+r($custom->getFormFieldsTest($moduleName[5], $method[0])) && p() && e('0'); //测试moduleName值为task,method为空
+r($custom->getFormFieldsTest($moduleName[5], $method[1])) && p('story,pri,estimate,desc') && e('相关研发需求,优先级,最初预计,任务描述'); //测试moduleName值为task,method为create
+r($custom->getFormFieldsTest($moduleName[5], $method[2])) && p('pri,estimate,estStarted') && e('优先级,最初预计,预计开始'); //测试moduleName值为task,method为edit
+r($custom->getFormFieldsTest($moduleName[5], $method[7])) && p('comment') && e('备注'); //测试moduleName值为task,method为finish
+r($custom->getFormFieldsTest($moduleName[5], $method[8])) && p('assignedTo,comment') && e('指派给,备注'); //测试moduleName值为task,method为activate
+r($custom->getFormFieldsTest($moduleName[6], $method[0])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为空
+r($custom->getFormFieldsTest($moduleName[6], $method[1])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为create
+r($custom->getFormFieldsTest($moduleName[6], $method[2])) && p('scmPath,filePath,desc') && e('源代码地址,下载地址,描述'); //测试moduleName值为build,method为edit
+r($custom->getFormFieldsTest($moduleName[7], $method[0])) && p() && e('0'); //测试moduleName值为bug,method为空
+r($custom->getFormFieldsTest($moduleName[7], $method[1])) && p('module,project,deadline') && e('所属模块,所属项目,截止日期'); //测试moduleName值为bug,method为create
+r($custom->getFormFieldsTest($moduleName[7], $method[2])) && p('plan,type,browser,pri') && e('所属计划,Bug类型,浏览器,优先级'); //测试moduleName值为bug,method为edit
+r($custom->getFormFieldsTest($moduleName[7], $method[9])) && p('resolvedBuild,comment') && e('解决版本,备注'); //测试moduleName值为bug,method为resolve
+r($custom->getFormFieldsTest($moduleName[8], $method[0])) && p() && e('0'); //测试moduleName值为testcase,method为空
+r($custom->getFormFieldsTest($moduleName[8], $method[1])) && p('stage,story,pri') && e('适用阶段,相关研发需求,优先级'); //测试moduleName值为testcase,method为create
+r($custom->getFormFieldsTest($moduleName[8], $method[2])) && p('stage,story,pri') && e('适用阶段,相关研发需求,优先级'); //测试moduleName值为testcase,method为edit
+r($custom->getFormFieldsTest($moduleName[9], $method[0])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为空
+r($custom->getFormFieldsTest($moduleName[9], $method[1])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为create
+r($custom->getFormFieldsTest($moduleName[9], $method[2])) && p('desc') && e('描述'); //测试moduleName值为testsuite,method为edit
+r($custom->getFormFieldsTest($moduleName[10], $method[0])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为空
+r($custom->getFormFieldsTest($moduleName[10], $method[1])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为create
+r($custom->getFormFieldsTest($moduleName[10], $method[2])) && p('begin,end,members,report') && e('开始时间,结束时间,参与人员,总结'); //测试moduleName值为testreport,method为edit
+r($custom->getFormFieldsTest($moduleName[11], $method[0])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为空
+r($custom->getFormFieldsTest($moduleName[11], $method[1])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为create
+r($custom->getFormFieldsTest($moduleName[11], $method[2])) && p('desc') && e('描述'); //测试moduleName值为caselib,method为edit
+r($custom->getFormFieldsTest($moduleName[12], $method[0])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为caselib,method为空
+r($custom->getFormFieldsTest($moduleName[12], $method[1])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为create
+r($custom->getFormFieldsTest($moduleName[12], $method[2])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为edit
+r($custom->getFormFieldsTest($moduleName[12], $method[10])) && p('owner,pri,desc') && e('负责人,优先级,描述'); //测试moduleName值为testtask,method为importUnit
+r($custom->getFormFieldsTest($moduleName[13], $method[0])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为空
+r($custom->getFormFieldsTest($moduleName[13], $method[1])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为create
+r($custom->getFormFieldsTest($moduleName[13], $method[2])) && p('keywords,content') && e('关键字,文档正文'); //测试moduleName值为doc,method为edit
+r($custom->getFormFieldsTest($moduleName[14], $method[0])) && p() && e('0'); //测试moduleName值为user,method为空
+r($custom->getFormFieldsTest($moduleName[14], $method[1])) && p('dept,role,email,commiter') && e('部门,职位,邮箱,源代码帐号'); //测试moduleName值为user,method为create
+r($custom->getFormFieldsTest($moduleName[14], $method[2])) && p('skype,qq,mobile,phone') && e('Skype,QQ,手机,电话'); //测试moduleName值为user,method为edit
\ No newline at end of file
diff --git a/test/model/custom/getitems.php b/test/model/custom/getitems.php
new file mode 100755
index 0000000000..0099f074e6
--- /dev/null
+++ b/test/model/custom/getitems.php
@@ -0,0 +1,35 @@
+#!/usr/bin/env php
+getItems();
+cid=1
+pid=1
+
+测试参数为空 >> zh-cn,custom,URSRList,1,1,rnd
+测试参数为lang >> zh-cn,custom,URSRList,1,1,rnd
+测试参数为lang,module >> zh-cn,custom,URSRList,1,1,rnd
+测试参数为lang,key,section >> zh-cn,custom,URSRList,1,1,rnd
+测试参数为lang,key,section,module >> zh-cn,custom,URSRList,1,1,rnd
+测试参数为lang,key,section,module,vision >> zh-cn,custom,URSRList,1,1,rnd
+
+*/
+$lang = 'lang=zh-cn';
+$module = 'module=custom';
+$section = 'section=URSRList';
+$key = 'key=1';
+$vision = 'vision=rnd';
+$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision);
+
+$custom = new customTest();
+
+r($custom->getItemsTest($paramString[0])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为空
+r($custom->getItemsTest($paramString[1])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang
+r($custom->getItemsTest($paramString[2])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,module
+r($custom->getItemsTest($paramString[3])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section
+r($custom->getItemsTest($paramString[4])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section,module
+r($custom->getItemsTest($paramString[5])) && p('1:lang,module,section,key,system,vision') && e('zh-cn,custom,URSRList,1,1,rnd'); //测试参数为lang,key,section,module,vision
\ No newline at end of file
diff --git a/test/model/custom/getrequiredfields.php b/test/model/custom/getrequiredfields.php
new file mode 100755
index 0000000000..634dd5649c
--- /dev/null
+++ b/test/model/custom/getrequiredfields.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getRequiredFields();
+cid=1
+pid=1
+
+
+
+*/
+
+$custom = new customTest();
+
+r($custom->getRequiredFieldsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/custom/getsrpairs.php b/test/model/custom/getsrpairs.php
new file mode 100755
index 0000000000..5fb2ae0396
--- /dev/null
+++ b/test/model/custom/getsrpairs.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getSRPairs();
+cid=1
+pid=1
+
+测试正常查询 >> 软件需求,研发需求,软需,故事,需求
+
+*/
+
+$custom = new customTest();
+
+r($custom->getSRPairsTest()) && p('1,2,3,4,5') && e('软件需求,研发需求,软需,故事,需求'); //测试正常查询
\ No newline at end of file
diff --git a/test/model/custom/geturpairs.php b/test/model/custom/geturpairs.php
new file mode 100755
index 0000000000..953515421e
--- /dev/null
+++ b/test/model/custom/geturpairs.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getURPairs();
+cid=1
+pid=1
+
+测试正常查询 >> 用户需求,用户需求,用需,史诗,用户需求
+
+*/
+
+$custom = new customTest();
+
+r($custom->getURPairsTest()) && p('1,2,3,4,5') && e('用户需求,用户需求,用需,史诗,用户需求'); //测试正常查询
\ No newline at end of file
diff --git a/test/model/custom/getursrlist.php b/test/model/custom/getursrlist.php
new file mode 100755
index 0000000000..aed23b69cb
--- /dev/null
+++ b/test/model/custom/getursrlist.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getURSRList();
+cid=1
+pid=1
+
+测试正常查询 >> 软件需求,用户需求,1
+
+*/
+
+$custom = new customTest();
+
+r($custom->getURSRListTest()) && p('1:SRName,URName,system') && e('软件需求,用户需求,1'); //测试正常查询
\ No newline at end of file
diff --git a/test/model/custom/getursrpairs.php b/test/model/custom/getursrpairs.php
new file mode 100755
index 0000000000..14a71e5ab8
--- /dev/null
+++ b/test/model/custom/getursrpairs.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getURSRPairs();
+cid=1
+pid=1
+
+测试正常查询 >> 软件需求,研发需求,软需,故事,需求
+
+*/
+
+$custom = new customTest();
+
+r($custom->getURSRPairsTest()) && p('1,2,3,4,5') && e('软件需求,研发需求,软需,故事,需求'); //测试正常查询
\ No newline at end of file
diff --git a/test/model/custom/parseitemparam.php b/test/model/custom/parseitemparam.php
new file mode 100755
index 0000000000..b9f01255da
--- /dev/null
+++ b/test/model/custom/parseitemparam.php
@@ -0,0 +1,36 @@
+#!/usr/bin/env php
+parseItemParam();
+cid=1
+pid=1
+
+测试参数为空 >> ,,,,
+测试参数为lang >> zh-cn,,,,
+测试参数为lang,module >> zh-cn,custom,,,
+测试参数为lang,key,section >> zh-cn,,URSRList,1,
+测试参数为lang,key,section,module >> zh-cn,custom,URSRList,1,
+测试参数为lang,key,section,module,vision >> zh-cn,custom,URSRList,1,rnd
+
+*/
+
+$lang = 'lang=zh-cn';
+$module = 'module=custom';
+$section = 'section=URSRList';
+$key = 'key=1';
+$vision = 'vision=rnd';
+$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision);
+
+$custom = new customTest();
+
+r($custom->parseItemParamTest($paramString[0])) && p('lang,module,section,key,vision') && e(',,,,'); //测试参数为空
+r($custom->parseItemParamTest($paramString[1])) && p('lang,module,section,key,vision') && e('zh-cn,,,,'); //测试参数为lang
+r($custom->parseItemParamTest($paramString[2])) && p('lang,module,section,key,vision') && e('zh-cn,custom,,,'); //测试参数为lang,module
+r($custom->parseItemParamTest($paramString[3])) && p('lang,module,section,key,vision') && e('zh-cn,,URSRList,1,'); //测试参数为lang,key,section
+r($custom->parseItemParamTest($paramString[4])) && p('lang,module,section,key,vision') && e('zh-cn,custom,URSRList,1,'); //测试参数为lang,key,section,module
+r($custom->parseItemParamTest($paramString[5])) && p('lang,module,section,key,vision') && e('zh-cn,custom,URSRList,1,rnd'); //测试参数为lang,key,section,module,vision
\ No newline at end of file
diff --git a/test/model/custom/preparesql.php b/test/model/custom/preparesql.php
new file mode 100755
index 0000000000..8e7964c4ee
--- /dev/null
+++ b/test/model/custom/preparesql.php
@@ -0,0 +1,50 @@
+#!/usr/bin/env php
+prepareSQL();
+cid=1
+pid=1
+
+测试method为select,paramString参数为空 >> zh-cn,custom
+测试method为select,paramString参数为lang >> zh-cn,custom
+测试method为select,paramString参数为lang,module >> zh-cn,custom
+测试method为select,paramString参数为lang,key,section >> zh-cn,custom
+测试method为select,paramString参数为lang,key,section,module >> zh-cn,custom
+测试method为select,paramString参数为lang,key,section,module,vision >> zh-cn,custom
+测试method为delete,paramString参数为空 >> 14
+测试method为delete,paramString参数为lang >> 0
+测试method为delete,paramString参数为lang,module >> 0
+测试method为delete,paramString参数为lang,key,section >> 0
+测试method为delete,paramString参数为lang,key,section,module >> 0
+测试method为delete,paramString参数为lang,key,section,module,vision >> 0
+
+*/
+
+$lang = 'lang=zh-cn';
+$module = 'module=custom';
+$section = 'section=URSRList';
+$key = 'key=1';
+$vision = 'vision=rnd';
+$paramString = array('', $lang, $lang.'&'.$module, $lang.'&'.$key.'&'.$section, $lang.'&'.$key.'&'.$section.'&'.$module, $lang.'&'.$key.'&'.$section.'&'.$module.'&'.$vision);
+$method = array('select', 'delete');
+
+$custom = new customTest();
+
+r($custom->prepareSQLTest($paramString[0], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为空
+r($custom->prepareSQLTest($paramString[1], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang
+r($custom->prepareSQLTest($paramString[2], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,module
+r($custom->prepareSQLTest($paramString[3], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section
+r($custom->prepareSQLTest($paramString[4], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section,module
+r($custom->prepareSQLTest($paramString[5], $method[0])) && p('1:lang,module') && e('zh-cn,custom'); //测试method为select,paramString参数为lang,key,section,module,vision
+r($custom->prepareSQLTest($paramString[0], $method[1])) && p() && e('14'); //测试method为delete,paramString参数为空
+r($custom->prepareSQLTest($paramString[1], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang
+r($custom->prepareSQLTest($paramString[2], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,module
+r($custom->prepareSQLTest($paramString[3], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section
+r($custom->prepareSQLTest($paramString[4], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section,module
+r($custom->prepareSQLTest($paramString[5], $method[1])) && p() && e('0'); //测试method为delete,paramString参数为lang,key,section,module,vision
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/custom/savecustommenu.php b/test/model/custom/savecustommenu.php
new file mode 100755
index 0000000000..347a96cce1
--- /dev/null
+++ b/test/model/custom/savecustommenu.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+saveCustomMenu();
+cid=1
+pid=1
+
+
+
+*/
+
+$custom = new customTest();
+
+r($custom->saveCustomMenuTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/custom/saverequiredfields.php b/test/model/custom/saverequiredfields.php
new file mode 100755
index 0000000000..d52f33a695
--- /dev/null
+++ b/test/model/custom/saverequiredfields.php
@@ -0,0 +1,149 @@
+#!/usr/bin/env php
+saveRequiredFields();
+cid=1
+pid=1
+
+测试moduleName为product,requiredFields为空 >> name,code
+测试moduleName为product,requiredFields中的create存在一个值 >> PO,name,code
+测试moduleName为product,requiredFields中的create存在多个值 >> PO,RD,name,code
+测试moduleName为product,requiredFields中的edit存在一个值 >> PO,name,code
+测试moduleName为product,requiredFields中的edit存在多个值 >> PO,RD,name,code
+测试moduleName为product,requiredFields中的create,edit各存在多个值 >> PO,RD,name,code
+测试moduleName为release,requiredFields为空 >> name,date
+测试moduleName为release,requiredFields中的create存在一个值 >> desc,name,date
+测试moduleName为release,requiredFields中的rdit存在一个值 >> desc,name,date
+测试moduleName为release,requiredFields中的create,edit各存在一个值 >> desc,name,date
+测试moduleName为execution,requiredFields为空 >> name,code,begin,end
+测试moduleName为execution,requiredFields中的create存在一个值 >> desc,name,code,begin,end
+测试moduleName为execution,requiredFields中的create存在多个值 >> desc,days,name,code,begin,end
+测试moduleName为execution,requiredFields中的edit存在一个值 >> desc,name,code,begin,end
+测试moduleName为execution,requiredFields中的edit存在多个值 >> desc,days,name,code,begin,end
+测试moduleName为execution,requiredFields中的create,edit各存在多个值 >> desc,days,name,code,begin,end
+测试moduleName为task,requiredFields为空 >> execution,name,type
+测试moduleName为task,requiredFields中的create存在一个值 >> story,execution,name,type
+测试moduleName为task,requiredFields中的create存在多个值 >> story,desc,execution,name,type
+测试moduleName为task,requiredFields中的edit存在一个值 >> pri,execution,name,type
+测试moduleName为task,requiredFields中的edit存在多个值 >> pri,estimate,execution,name,type
+测试moduleName为task,requiredFields中的activate存在一个值 >> comment,left
+测试moduleName为task,requiredFields中的activate存在多个值 >> comment,assignedTo,left
+测试moduleName为task,requiredFields中的create,edit各存在一个值 >> story,execution,name,type
+测试moduleName为task,requiredFields中的create,edit,finsh各存在一个值 >> story,execution,name,type
+测试moduleName为task,requiredFields中的create,edit,finsh,activate各存在一个值 >> story,execution,name,type
+测试moduleName为bug,requiredFields为空 >> title,openedBuild
+测试moduleName为bug,requiredFields中的create存在一个值 >> type,title,openedBuild
+测试moduleName为bug,requiredFields中的create存在多个值 >> type,os,title,openedBuild
+测试moduleName为bug,requiredFields中的edit存在一个值 >> plan,title,openedBuild
+测试moduleName为bug,requiredFields中的edit存在多个值 >> plan,type,title,openedBuild
+测试moduleName为bug,requiredFields中的resolve存在一个值 >> comment,resolution
+测试moduleName为bug,requiredFields中的resolve存在多个值 >> comment,assignedTo,resolution
+测试moduleName为bug,requiredFields中的create,edit各存在一个值 >> type,title,openedBuild
+测试moduleName为bug,requiredFields中的create,edit,resolve各存在一个值 >> type,title,openedBuild
+测试moduleName为testcase,requiredFields为空 >> title,type
+测试moduleName为testcase,requiredFields中的create存在一个值 >> stage,title,type
+测试moduleName为testcase,requiredFields中的create存在多个值 >> stage,story,title,type
+测试moduleName为testcase,requiredFields中的edit存在一个值 >> stage,title,type
+测试moduleName为testcase,requiredFields中的edit存在多个值 >> stage,story,title,type
+测试moduleName为testcase,requiredFields中的create,edit各存在多个值 >> stage,story,title,type
+测试moduleName为task,requiredFields中的finish存在一个值 >> comment,realStarted,finishedDate,currentConsumed
+
+*/
+$moduleName = array('product', 'release', 'execution', 'task', 'bug', 'testcase');
+$fieldsType = array('create', 'edit', 'finish', 'activate', 'resolve');
+$requiredFields = array(
+ 'productFields1' => array(),
+ 'productFields2' => array('requiredFields' => array('create' => array('PO'))),
+ 'productFields3' => array('requiredFields' => array('create' => array('PO', 'RD'))),
+ 'productFields4' => array('requiredFields' => array('edit' => array('PO'))),
+ 'productFields5' => array('requiredFields' => array('edit' => array('PO', 'RD'))),
+ 'productFields6' => array('requiredFields' => array('create' => array('PO', 'RD'), 'edit' => array('PO', 'RD'))),
+ 'releaseFields1' => array(),
+ 'releaseFields2' => array('requiredFields' => array('create' => array('desc'))),
+ 'releaseFields3' => array('requiredFields' => array('edit' => array('desc'))),
+ 'releaseFields4' => array('requiredFields' => array('create' => array('desc'), 'edit' => array('desc'))),
+ 'executionFields1' => array(),
+ 'executionFields2' => array('requiredFields' => array('create' => array('desc'))),
+ 'executionFields3' => array('requiredFields' => array('create' => array('desc', 'days'))),
+ 'executionFields4' => array('requiredFields' => array('edit' => array('desc'))),
+ 'executionFields5' => array('requiredFields' => array('edit' => array('desc', 'days'))),
+ 'executionFields6' => array('requiredFields' => array('create' => array('desc', 'days'), 'edit' => array('desc', 'days'))),
+ 'taskFields1' => array(),
+ 'taskFields2' => array('requiredFields' => array('create' => array('story'))),
+ 'taskFields3' => array('requiredFields' => array('create' => array('story', 'desc'))),
+ 'taskFields4' => array('requiredFields' => array('edit' => array('pri'))),
+ 'taskFields5' => array('requiredFields' => array('edit' => array('pri', 'estimate'))),
+ 'taskFields6' => array('requiredFields' => array('finish' => array('comment'))),
+ 'taskFields7' => array('requiredFields' => array('activate' => array('comment'))),
+ 'taskFields8' => array('requiredFields' => array('activate' => array('comment', 'assignedTo'))),
+ 'taskFields9' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'))),
+ 'taskFields10' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'), 'finsh' => array('comment'))),
+ 'taskFields11' => array('requiredFields' => array('create' => array('story'), 'edit' => array('pri'), 'finsh' => array('comment'), 'activate' => array('comment'))),
+ 'bugFields1' => array(),
+ 'bugFields2' => array('requiredFields' => array('create' => array('type'))),
+ 'bugFields3' => array('requiredFields' => array('create' => array('type', 'os'))),
+ 'bugFields4' => array('requiredFields' => array('edit' => array('plan'))),
+ 'bugFields5' => array('requiredFields' => array('edit' => array('plan', 'type'))),
+ 'bugFields6' => array('requiredFields' => array('resolve' => array('comment'))),
+ 'bugFields7' => array('requiredFields' => array('resolve' => array('comment', 'assignedTo'))),
+ 'bugFields8' => array('requiredFields' => array('create' => array('type'), 'edit' => array('plan'))),
+ 'bugFields9' => array('requiredFields' => array('create' => array('type'), 'edit' => array('plan'), 'resolve' => array('comment'))),
+ 'testcaseFields1' => array(),
+ 'testcaseFields2' => array('requiredFields' => array('create' => array('stage'))),
+ 'testcaseFields3' => array('requiredFields' => array('create' => array('stage', 'story'))),
+ 'testcaseFields4' => array('requiredFields' => array('edit' => array('stage'))),
+ 'testcaseFields5' => array('requiredFields' => array('edit' => array('stage', 'story'))),
+ 'testcaseFields6' => array('requiredFields' => array('create' => array('stage', 'story'), 'edit' => array('stage', 'story'))),
+);
+
+$custom = new customTest();
+
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields1'], $fieldsType[0])) && p('value') && e('name,code'); //测试moduleName为product,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields2'], $fieldsType[0])) && p('value') && e('PO,name,code'); //测试moduleName为product,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields3'], $fieldsType[0])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的create存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields4'], $fieldsType[1])) && p('value') && e('PO,name,code'); //测试moduleName为product,requiredFields中的edit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields5'], $fieldsType[1])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的edit存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[0], $requiredFields['productFields6'], $fieldsType[0])) && p('value') && e('PO,RD,name,code'); //测试moduleName为product,requiredFields中的create,edit各存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields1'], $fieldsType[0])) && p('value') && e('name,date'); //测试moduleName为release,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields2'], $fieldsType[0])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields3'], $fieldsType[1])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的rdit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[1], $requiredFields['releaseFields4'], $fieldsType[0])) && p('value') && e('desc,name,date'); //测试moduleName为release,requiredFields中的create,edit各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields1'], $fieldsType[0])) && p('value') && e('name,code,begin,end'); //测试moduleName为execution,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields2'], $fieldsType[0])) && p('value') && e('desc,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields3'], $fieldsType[0])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields4'], $fieldsType[1])) && p('value') && e('desc,name,code,begin,end'); //测试moduleName为execution,requiredFields中的edit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields5'], $fieldsType[1])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的edit存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[2], $requiredFields['executionFields6'], $fieldsType[0])) && p('value') && e('desc,days,name,code,begin,end'); //测试moduleName为execution,requiredFields中的create,edit各存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields1'], $fieldsType[0])) && p('value') && e('execution,name,type'); //测试moduleName为task,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields2'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields3'], $fieldsType[0])) && p('value') && e('story,desc,execution,name,type'); //测试moduleName为task,requiredFields中的create存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields4'], $fieldsType[1])) && p('value') && e('pri,execution,name,type'); //测试moduleName为task,requiredFields中的edit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields5'], $fieldsType[1])) && p('value') && e('pri,estimate,execution,name,type'); //测试moduleName为task,requiredFields中的edit存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields7'], $fieldsType[3])) && p('value') && e('comment,left'); //测试moduleName为task,requiredFields中的activate存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields8'], $fieldsType[3])) && p('value') && e('comment,assignedTo,left'); //测试moduleName为task,requiredFields中的activate存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields9'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields10'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit,finsh各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields11'], $fieldsType[0])) && p('value') && e('story,execution,name,type'); //测试moduleName为task,requiredFields中的create,edit,finsh,activate各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields1'], $fieldsType[0])) && p('value') && e('title,openedBuild'); //测试moduleName为bug,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields2'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields3'], $fieldsType[0])) && p('value') && e('type,os,title,openedBuild'); //测试moduleName为bug,requiredFields中的create存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields4'], $fieldsType[1])) && p('value') && e('plan,title,openedBuild'); //测试moduleName为bug,requiredFields中的edit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields5'], $fieldsType[1])) && p('value') && e('plan,type,title,openedBuild'); //测试moduleName为bug,requiredFields中的edit存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields6'], $fieldsType[4])) && p('value') && e('comment,resolution'); //测试moduleName为bug,requiredFields中的resolve存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields7'], $fieldsType[4])) && p('value') && e('comment,assignedTo,resolution'); //测试moduleName为bug,requiredFields中的resolve存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields8'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create,edit各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[4], $requiredFields['bugFields9'], $fieldsType[0])) && p('value') && e('type,title,openedBuild'); //测试moduleName为bug,requiredFields中的create,edit,resolve各存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields1'], $fieldsType[0])) && p('value') && e('title,type'); //测试moduleName为testcase,requiredFields为空
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields2'], $fieldsType[0])) && p('value') && e('stage,title,type'); //测试moduleName为testcase,requiredFields中的create存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields3'], $fieldsType[0])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的create存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields4'], $fieldsType[1])) && p('value') && e('stage,title,type'); //测试moduleName为testcase,requiredFields中的edit存在一个值
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields5'], $fieldsType[1])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的edit存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[5], $requiredFields['testcaseFields6'], $fieldsType[0])) && p('value') && e('stage,story,title,type'); //测试moduleName为testcase,requiredFields中的create,edit各存在多个值
+r($custom->saveRequiredFieldsTest($moduleName[3], $requiredFields['taskFields6'], $fieldsType[2])) && p('value') && e('comment,realStarted,finishedDate,currentConsumed');//测试moduleName为task,requiredFields中的finish存在一个值
+
+system('./ztest init');
\ No newline at end of file
diff --git a/test/model/custom/setconcept.php b/test/model/custom/setconcept.php
new file mode 100755
index 0000000000..6f22e6e75e
--- /dev/null
+++ b/test/model/custom/setconcept.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+setConcept();
+cid=1
+pid=1
+
+测试sprintConcept值为0,编辑为产品 - 项目 >> 45
+测试sprintConcept值为1,编辑为产品 - 迭代 >> 45
+测试sprintConcept值为2,编辑为产品 - 冲刺 >> 45
+
+*/
+$sprintConcept = array('0', '1', '2');
+
+$custom = new customTest();
+
+r($custom->setConceptTest($sprintConcept[0])) && p('id') && e('45'); //测试sprintConcept值为0,编辑为产品 - 项目
+r($custom->setConceptTest($sprintConcept[1])) && p('id') && e('45'); //测试sprintConcept值为1,编辑为产品 - 迭代
+r($custom->setConceptTest($sprintConcept[2])) && p('id') && e('45'); //测试sprintConcept值为2,编辑为产品 - 冲刺
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/custom/setitem.php b/test/model/custom/setitem.php
new file mode 100755
index 0000000000..d598e278f8
--- /dev/null
+++ b/test/model/custom/setitem.php
@@ -0,0 +1,36 @@
+#!/usr/bin/env php
+setItem();
+cid=1
+pid=1
+
+测试path中.出现的个数为0,value正常存在,不能保存 >> 0
+测试path中.出现的个数为1,value正常存在,不能保存 >> 0
+测试path中.出现的个数为2,value正常存在,能保存 >> zh-cn,story,categoryList,功能
+测试path中.出现的个数为2,value为空,能保存 >> zh-cn,story,categoryList,
+测试path中.出现的个数为3,value正常存在,能保存 >> zh-cn,story,feature,功能
+测试path中.出现的个数为3,value为空,能保存 >> zh-cn,story,feature,
+测试path中.出现的个数为4,value正常存在,能保存 >> zh-cn,story,feature,功能
+测试path中.出现的个数为5,value为空,能保存 >> zh-cn,story,feature,
+
+*/
+$path = array('zh-cn', 'zh-cn.story', 'zh-cn.story.categoryList', 'zh-cn.story.categoryList.feature', 'zh-cn.story.categoryList.feature.1');
+$value = array('功能', '');
+
+$custom = new customTest();
+
+r($custom->setItemTest($path[0], $value[0])) && p() && e('0'); //测试path中.出现的个数为0,value正常存在,不能保存
+r($custom->setItemTest($path[1], $value[0])) && p() && e('0'); //测试path中.出现的个数为1,value正常存在,不能保存
+r($custom->setItemTest($path[2], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,categoryList,功能'); //测试path中.出现的个数为2,value正常存在,能保存
+r($custom->setItemTest($path[2], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,categoryList,'); //测试path中.出现的个数为2,value为空,能保存
+r($custom->setItemTest($path[3], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,feature,功能'); //测试path中.出现的个数为3,value正常存在,能保存
+r($custom->setItemTest($path[3], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,feature,'); //测试path中.出现的个数为3,value为空,能保存
+r($custom->setItemTest($path[4], $value[0])) && p('lang,module,key,value') && e('zh-cn,story,feature,功能'); //测试path中.出现的个数为4,value正常存在,能保存
+r($custom->setItemTest($path[4], $value[1])) && p('lang,module,key,value') && e('zh-cn,story,feature,'); //测试path中.出现的个数为5,value为空,能保存
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/custom/setstoryrequirement.php b/test/model/custom/setstoryrequirement.php
new file mode 100755
index 0000000000..93930aaffc
--- /dev/null
+++ b/test/model/custom/setstoryrequirement.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+setStoryRequirement();
+cid=1
+pid=1
+
+
+
+*/
+
+$custom = new customTest();
+
+r($custom->setStoryRequirementTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/custom/seturandsr.php b/test/model/custom/seturandsr.php
new file mode 100755
index 0000000000..6945c0d134
--- /dev/null
+++ b/test/model/custom/seturandsr.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+setURAndSR();
+cid=1
+pid=1
+
+测试SRName值为空 >> 1
+测试SRName值有一个 >> 1
+测试SRName值有多个 >> 1
+
+*/
+$SRName = array(
+ '0' => array('SRName' => array('')),
+ '1' => array('SRName' => array('测试需求')),
+ '2' => array('SRName' => array('测试需求', '用户需求'))
+);
+
+$custom = new customTest();
+
+r($custom->setURAndSRTest($SRName[0])) && p() && e('1'); //测试SRName值为空
+r($custom->setURAndSRTest($SRName[1])) && p() && e('1'); //测试SRName值有一个
+r($custom->setURAndSRTest($SRName[2])) && p() && e('1'); //测试SRName值有多个
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/custom/updateurandsr.php b/test/model/custom/updateurandsr.php
new file mode 100755
index 0000000000..10f975e9f2
--- /dev/null
+++ b/test/model/custom/updateurandsr.php
@@ -0,0 +1,33 @@
+#!/usr/bin/env php
+updateURAndSR();
+cid=1
+pid=1
+
+测试修改key为1,SRName值更改为空 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}
+测试修改key为1,SRName值更改为软件需求 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}
+测试修改key为1,SRName值更改为软件需求1 >> {"SRName":"\u8f6f\u4ef6\u9700\u6c421","URName":"\u7528\u6237\u9700\u6c42"}
+测试修改key为0,SRName值更改为空 >> 0
+测试修改key为0,SRName值更改为软件需求 >> 0
+测试修改key为0,SRName值更改为软件需求1 >> 0
+
+*/
+$key = array(1, 0);
+$SRName = array('', '软件需求', '软件需求1');
+
+$custom = new customTest();
+
+r($custom->updateURAndSRTest($key[0], $SRName[0])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为空
+r($custom->updateURAndSRTest($key[0], $SRName[1])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c42","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为软件需求
+r($custom->updateURAndSRTest($key[0], $SRName[2])) && p('value') && e('{"SRName":"\u8f6f\u4ef6\u9700\u6c421","URName":"\u7528\u6237\u9700\u6c42"}'); //测试修改key为1,SRName值更改为软件需求1
+r($custom->updateURAndSRTest($key[1], $SRName[0])) && p() && e('0'); //测试修改key为0,SRName值更改为空
+r($custom->updateURAndSRTest($key[1], $SRName[1])) && p() && e('0'); //测试修改key为0,SRName值更改为软件需求
+r($custom->updateURAndSRTest($key[1], $SRName[2])) && p() && e('0'); //测试修改key为0,SRName值更改为软件需求1
+
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/design/assign.php b/test/model/design/assign.php
old mode 100644
new mode 100755
index a043aaaa5e..20b22d0b0e
--- a/test/model/design/assign.php
+++ b/test/model/design/assign.php
@@ -10,6 +10,8 @@ title=测试 designModel->assign();
cid=1
pid=1
+设置指派人 >> dev10
+
*/
$designID = '17';
@@ -18,4 +20,4 @@ $noAssignedTo = array('comment' => '提交信息');
$design = new designTest();
r($design->assignTest($designID, $normalAssign)) && p('0:assignedTo') && e('dev10');//设置指派人
-r($design->assignTest($designID, $noAssignedTo)) && p('0:assignedTo') && e(''); //指派人为空
+r($design->assignTest($designID, $noAssignedTo)) && p('0:assignedTo') && e(''); //指派人为空
\ No newline at end of file
diff --git a/test/model/design/batchcreate.php b/test/model/design/batchcreate.php
old mode 100644
new mode 100755
index c1f41e26c2..700d522b4e
--- a/test/model/design/batchcreate.php
+++ b/test/model/design/batchcreate.php
@@ -10,6 +10,13 @@ title=测试 designModel->batchCreate();
cid=1
pid=1
+批量创建设计数量统计 >> 4
+批量创建敏捷项目设计 >> 设计一
+批量创建瀑布项目设计 >> 32
+批量创建看板项目设计 >> 41
+不输入类型 >> 『设计类型』不能为空。
+不输入名字 >> 0
+
*/
$projectIDList = array('12', '32', '62', '13', '71', '72', '73', '75');
$productIDList = array('1', '21', '41');
@@ -25,6 +32,7 @@ $noNameDesign = array('story' => $storys, 'type' => $types, 'desc' => $desc);
$noDescDesign = array('story' => $storys, 'type' => $types, 'name' => $names);
$design = new designTest();
+r(count($design->batchCreateTest($projectIDList[7], $productIDList[0], $noDescDesign))) && p() && e('4'); //批量创建设计数量统计
r($design->batchCreateTest($projectIDList[0], $productIDList[0], $normalDesign)) && p('0:name') && e('设计一'); //批量创建敏捷项目设计
r($design->batchCreateTest($projectIDList[1], $productIDList[1], $normalDesign)) && p('0:project') && e('32'); //批量创建瀑布项目设计
r($design->batchCreateTest($projectIDList[2], $productIDList[2], $normalDesign)) && p('0:product') && e('41'); //批量创建看板项目设计
@@ -32,6 +40,5 @@ r($design->batchCreateTest($projectIDList[3], $productIDList[0], $noStoryDesign)
r($design->batchCreateTest($projectIDList[4], $productIDList[0], $noTypeDesign)) && p('type:0') && e('『设计类型』不能为空。');//不输入类型
r($design->batchCreateTest($projectIDList[5], $productIDList[0], $noNameDesign)) && p() && e('0'); //不输入名字
r($design->batchCreateTest($projectIDList[6], $productIDList[0], $noDescDesign)) && p('0:desc') && e(''); //不输入详情
-r(count($design->batchCreateTest($projectIDList[7], $productIDList[0], $noDescDesign))) && p() && e('4'); //批量创建设计数量统计
-system("./ztest init");
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/design/buildsearchform.php b/test/model/design/buildsearchform.php
deleted file mode 100644
index a3e8885051..0000000000
--- a/test/model/design/buildsearchform.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-buildSearchForm();
-cid=1
-pid=1
-
-*/
-
-$design = new designTest();
-
-r($design->buildSearchFormTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/design/create.php b/test/model/design/create.php
old mode 100644
new mode 100755
index 8422317beb..e68709721a
--- a/test/model/design/create.php
+++ b/test/model/design/create.php
@@ -10,6 +10,13 @@ title=测试 designModel->create();
cid=1
pid=1
+不输入名称创建设计 >> 『设计名称』不能为空。
+创建hlds设计 >> hlds设计
+创建dds设计 >> 2
+创建dbds设计 >> 41
+创建ads设计 >> ADS
+不输入类型创建设计 >> 『设计类型』不能为空。
+
*/
$projectIDList = array('11', '31', '61');
$products = array('1', '21', '41');
@@ -25,13 +32,13 @@ $noTypeDesign = array('product' => $products[0], 'story' => '1', 'name' => '
$noNameDesign = array('product' => $products[0], 'story' => '1', 'type' => $type[3]);
$design = new designTest();
+r($design->createTest($projectIDList[0], $noNameDesign)) && p('name:0') && e('『设计名称』不能为空。'); //不输入名称创建设计
r($design->createTest($projectIDList[0], $hldsDesign)) && p('name') && e('hlds设计'); //创建hlds设计
r($design->createTest($projectIDList[1], $ddsDesign)) && p('story') && e('2'); //创建dds设计
-r($design->createTest($projectIDList[2], $dbdsDesign)) && p('product') && e('61'); //创建dbds设计
+r($design->createTest($projectIDList[2], $dbdsDesign)) && p('product') && e('41'); //创建dbds设计
r($design->createTest($projectIDList[0], $adsDesign)) && p('type') && e('ADS'); //创建ads设计
r($design->createTest($projectIDList[0], $noProductDesign)) && p('product') && e(''); //不输入产品创建设计
r($design->createTest($projectIDList[0], $noStoryDesign)) && p('story') && e(''); //不输入需求创建设计
r($design->createTest($projectIDList[0], $noTypeDesign)) && p('type:0') && e('『设计类型』不能为空。'); //不输入类型创建设计
-r($design->createTest($projectIDList[0], $noNameDesign)) && p('name:0') && e('『设计名称』不能为空。'); //不输入名称创建设计
-system("./ztest init");
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/design/getaffectedscope.php b/test/model/design/getaffectedscope.php
deleted file mode 100644
index 77926c3055..0000000000
--- a/test/model/design/getaffectedscope.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-getAffectedScope();
-cid=1
-pid=1
-
-*/
-
-$design = new designTest();
-
-r($design->getAffectedScopeTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/design/getbyid.php b/test/model/design/getbyid.php
old mode 100644
new mode 100755
index 805bc16f8b..36c5dedc69
--- a/test/model/design/getbyid.php
+++ b/test/model/design/getbyid.php
@@ -10,6 +10,9 @@ title=测试 designModel->getByID();
cid=1
pid=1
+正常根据id查询 >> 这是一个设计1
+查询不存在的设计id >> 0
+
*/
global $tester;
$design = $tester->loadModel('design');
@@ -17,4 +20,4 @@ $design = $tester->loadModel('design');
$designIDList = array('0', '1');
r($design->getByID($designIDList[1])) && p('name') && e('这是一个设计1');//正常根据id查询
-r($design->getByID($designIDList[0])) && p() && e('0'); //查询不存在的设计id
+r($design->getByID($designIDList[0])) && p() && e('0'); //查询不存在的设计id
\ No newline at end of file
diff --git a/test/model/design/getbysearch.php b/test/model/design/getbysearch.php
old mode 100644
new mode 100755
index 080af401ca..355a205e3f
--- a/test/model/design/getbysearch.php
+++ b/test/model/design/getbysearch.php
@@ -1,7 +1,6 @@
#!/usr/bin/env php
getBySearch();
cid=1
pid=1
+不输入产品和项目查询 >> 0
+输入项目查询 >> 0
+输入产品查询 >> 0
+正常查询条件查询 >> 这是一个设计1
+
*/
+global $tester;
+$design = $tester->loadModel('design');
-$design = new designTest();
+$productIDList = array('0', '31');
+$projectIDList = array('0', '41');
+$queryID = array('0', '6');
+$orderBy = array('id_desc', 'name_desc');
-r($design->getBySearchTest()) && p() && e();
\ No newline at end of file
+r($design->getBySearch($projectIDList[0], $productIDList[0], $queryID[0], $orderBy[0])) && p() && e('0'); //不输入产品和项目查询
+r($design->getBySearch($projectIDList[1], $productIDList[0], $queryID[0], $orderBy[0])) && p() && e('0'); //输入项目查询
+r($design->getBySearch($projectIDList[0], $productIDList[1], $queryID[0], $orderBy[0])) && p() && e('0'); //输入产品查询
+r($design->getBySearch($projectIDList[1], $productIDList[1], $queryID[1], $orderBy[1])) && p('1:name') && e('这是一个设计1');//正常查询条件查询
\ No newline at end of file
diff --git a/test/model/design/getcommit.php b/test/model/design/getcommit.php.bak
similarity index 100%
rename from test/model/design/getcommit.php
rename to test/model/design/getcommit.php.bak
diff --git a/test/model/design/getlist.php b/test/model/design/getlist.php
old mode 100644
new mode 100755
index 107edf2276..9b0b8af2b0
--- a/test/model/design/getlist.php
+++ b/test/model/design/getlist.php
@@ -10,8 +10,47 @@ title=测试 designModel->getList();
cid=1
pid=1
+默认输入查询 >> 0
+不输入产品查询 >> 0
+不输入项目查询 >> 31
+项目和产品一起输入查询 >> 41
+HLDS类型设计查询 >> HLDS
+DDS类型设计查询 >> DDS
+DBDS类型设计查询 >> DBDS
+ADS类型设计查询 >> ADS
+不存在类型设计查询 >> 0
+查询条件查询设计 >> 这是一个设计1
+不输入项目查询统计 >> 4
+项目和产品一起输入查询统计 >> 4
+HLDS类型设计查询统计 >> 1
+DDS类型设计查询统计 >> 1
+DBDS类型设计查询统计 >> 1
+ADS类型设计查询统计 >> 1
+
*/
+global $tester;
+$design = $tester->loadModel('design');
-$design = new designTest();
+$productIDList = array('0', '31');
+$projectIDList = array('0', '41');
+$types = array('all', 'bySearch', 'HLDS', 'DDS', 'DBDS', 'ADS', 'QT');
+$param = array('0', '6');
+$orderBy = array('id_desc', 'name_desc');
-r($design->getListTest()) && p() && e();
\ No newline at end of file
+r($design->getList($projectIDList[0], $productIDList[0], $types[0], $param[0], $orderBy[0])) && p() && e('0'); //默认输入查询
+r($design->getList($projectIDList[1], $productIDList[0], $types[0], $param[0], $orderBy[0])) && p() && e('0'); //不输入产品查询
+r($design->getList($projectIDList[0], $productIDList[1], $types[0], $param[0], $orderBy[0])) && p('1:product') && e('31'); //不输入项目查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[0], $param[0], $orderBy[1])) && p('1:project') && e('41'); //项目和产品一起输入查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[2], $param[0], $orderBy[0])) && p('1:type') && e('HLDS'); //HLDS类型设计查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[3], $param[0], $orderBy[0])) && p('2:type') && e('DDS'); //DDS类型设计查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[4], $param[0], $orderBy[0])) && p('3:type') && e('DBDS'); //DBDS类型设计查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[5], $param[0], $orderBy[0])) && p('4:type') && e('ADS'); //ADS类型设计查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[6], $param[0], $orderBy[0])) && p() && e('0'); //不存在类型设计查询
+r($design->getList($projectIDList[1], $productIDList[1], $types[1], $param[1], $orderBy[0])) && p('1:name') && e('这是一个设计1');//查询条件查询设计
+
+r(count($design->getList($projectIDList[0], $productIDList[1], $types[0], $param[0], $orderBy[0]))) && p() && e('4'); //不输入项目查询统计
+r(count($design->getList($projectIDList[1], $productIDList[1], $types[0], $param[0], $orderBy[1]))) && p() && e('4'); //项目和产品一起输入查询统计
+r(count($design->getList($projectIDList[1], $productIDList[1], $types[2], $param[0], $orderBy[0]))) && p() && e('1'); //HLDS类型设计查询统计
+r(count($design->getList($projectIDList[1], $productIDList[1], $types[3], $param[0], $orderBy[0]))) && p() && e('1'); //DDS类型设计查询统计
+r(count($design->getList($projectIDList[1], $productIDList[1], $types[4], $param[0], $orderBy[0]))) && p() && e('1'); //DBDS类型设计查询统计
+r(count($design->getList($projectIDList[1], $productIDList[1], $types[5], $param[0], $orderBy[0]))) && p() && e('1'); //ADS类型设计查询统计
\ No newline at end of file
diff --git a/test/model/design/getpairs.php b/test/model/design/getpairs.php
old mode 100644
new mode 100755
index 486225b07d..e088aacd14
--- a/test/model/design/getpairs.php
+++ b/test/model/design/getpairs.php
@@ -10,6 +10,13 @@ title=测试 designModel->getPairs();
cid=1
pid=1
+查询不存在的产品 >> 0
+查询不存在的类型 >> 0
+查询HLDS设计 >> 1:这是一个设计1
+查询DDS设计 >> 2:这是一个设计2
+查询DBDS设计 >> 3:这是一个设计3
+查询ADS设计 >> 4:这是一个设计4
+
*/
global $tester;
$design = $tester->loadModel('design');
@@ -22,4 +29,4 @@ r($design->getPairs($productIDList[1], $types[0])) && p() && e('0');
r($design->getPairs($productIDList[1], $types[1])) && p('1') && e('1:这是一个设计1');//查询HLDS设计
r($design->getPairs($productIDList[1], $types[2])) && p('2') && e('2:这是一个设计2');//查询DDS设计
r($design->getPairs($productIDList[1], $types[3])) && p('3') && e('3:这是一个设计3');//查询DBDS设计
-r($design->getPairs($productIDList[1], $types[4])) && p('4') && e('4:这是一个设计4');//查询ADS设计
+r($design->getPairs($productIDList[1], $types[4])) && p('4') && e('4:这是一个设计4');//查询ADS设计
\ No newline at end of file
diff --git a/test/model/design/printassignedhtml.php b/test/model/design/printassignedhtml.php
deleted file mode 100644
index 3a4a9f749f..0000000000
--- a/test/model/design/printassignedhtml.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-printAssignedHtml();
-cid=1
-pid=1
-
-*/
-
-$design = new designTest();
-
-r($design->printAssignedHtmlTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/design/setmenu.php b/test/model/design/setmenu.php
deleted file mode 100644
index f903541df6..0000000000
--- a/test/model/design/setmenu.php
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env php
-setMenu();
-cid=1
-pid=1
-
-*/
-
-$design = new designTest();
-
-r($design->setMenuTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/design/update.php b/test/model/design/update.php
old mode 100644
new mode 100755
index 95e5386b32..c5823cc406
--- a/test/model/design/update.php
+++ b/test/model/design/update.php
@@ -10,6 +10,14 @@ title=测试 designModel->update();
cid=1
pid=1
+修改设计类型 >> type,HLDS,DDS
+修改设计需求 >> story,0,17
+修改设计产品 >> product,31,21
+修改设计名称 >> name,这是一个设计1,修改设计
+修改设计详情 >> desc,这是设计描述1,详情修改
+设计名称不能为空 >> 『设计名称』不能为空。
+设计类型不能为空 >> 『设计类型』不能为空。
+
*/
$designIDList = array('1', '2', '3');
@@ -31,4 +39,4 @@ r($design->updateTest($designIDList[0],$updateDesc)) && p('0:field,old,new')
r($design->updateTest($designIDList[0],$noName)) && p('name:0') && e('『设计名称』不能为空。'); //设计名称不能为空
r($design->updateTest($designIDList[0],$noType)) && p('type:0') && e('『设计类型』不能为空。'); //设计类型不能为空
-system("./ztest init");
+system("./ztest init");
\ No newline at end of file
diff --git a/test/model/personnel/addwhitelist.php b/test/model/personnel/addwhitelist.php
new file mode 100644
index 0000000000..ee45a7b2eb
--- /dev/null
+++ b/test/model/personnel/addwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+addWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->addWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/buildsearchform.php b/test/model/personnel/buildsearchform.php
new file mode 100644
index 0000000000..edcd239213
--- /dev/null
+++ b/test/model/personnel/buildsearchform.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+buildSearchForm();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->buildSearchFormTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/canviewprogram.php b/test/model/personnel/canviewprogram.php
new file mode 100755
index 0000000000..5cae45f2e1
--- /dev/null
+++ b/test/model/personnel/canviewprogram.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+canViewProgram();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest('admin');
+
+$propramID = array();
+$programID[0] = 1;
+
+$account = array();
+$account[0] = 'test2';
+
+r($personnel->canViewProgramTest(1, 'test2')) && p() && e('1'); //看是否具有访问权限有的情况
+r($personnel->canViewProgramTest(10000, 'test2')) && p() && e('1'); //看是否具有访问权限no的情况
diff --git a/test/model/personnel/creatememberlink.php b/test/model/personnel/creatememberlink.php
new file mode 100644
index 0000000000..c991ed8e18
--- /dev/null
+++ b/test/model/personnel/creatememberlink.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+createMemberLink();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->createMemberLinkTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/deleteexecutionwhitelist.php b/test/model/personnel/deleteexecutionwhitelist.php
new file mode 100644
index 0000000000..3d9cdc899a
--- /dev/null
+++ b/test/model/personnel/deleteexecutionwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+deleteExecutionWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->deleteExecutionWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/deleteproductwhitelist.php b/test/model/personnel/deleteproductwhitelist.php
new file mode 100644
index 0000000000..999f5735d8
--- /dev/null
+++ b/test/model/personnel/deleteproductwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+deleteProductWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->deleteProductWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/deleteprogramwhitelist.php b/test/model/personnel/deleteprogramwhitelist.php
new file mode 100644
index 0000000000..62b756d600
--- /dev/null
+++ b/test/model/personnel/deleteprogramwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+deleteProgramWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->deleteProgramWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/deleteprojectwhitelist.php b/test/model/personnel/deleteprojectwhitelist.php
new file mode 100644
index 0000000000..9ef63d7cf4
--- /dev/null
+++ b/test/model/personnel/deleteprojectwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+deleteProjectWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->deleteProjectWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/deletewhitelist.php b/test/model/personnel/deletewhitelist.php
new file mode 100644
index 0000000000..f3e767a268
--- /dev/null
+++ b/test/model/personnel/deletewhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+deleteWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->deleteWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getaccessiblepersonnel.php b/test/model/personnel/getaccessiblepersonnel.php
new file mode 100755
index 0000000000..43024dcef0
--- /dev/null
+++ b/test/model/personnel/getaccessiblepersonnel.php
@@ -0,0 +1,41 @@
+#!/usr/bin/env php
+getAccessiblePersonnel();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest('admin');
+
+$programID = array();
+$programID[0] = 1;
+$programID[1] = 2;
+
+$deptID = array();
+$deptID[0] = 11;
+$deptID[1] = 12;
+
+$browseType = array();
+$browseType[0] = 'all';
+$browseType[1] = 'bysearch';
+
+$queryID = array();
+$browseType[0] = 1;
+
+$getrealname1 = $personnel->getAccessiblePersonnelTest($programID[0], $deptID[0], $browseType[0], $browseType[0])[101];
+$getnumber1 = count($personnel->getAccessiblePersonnelTest($programID[0], $deptID[0], $browseType[0], $browseType[0]));
+
+$getrealname2 = $personnel->getAccessiblePersonnelTest($programID[1], $deptID[1], $browseType[0], $browseType[0])[111];
+$getnumber2 = count($personnel->getAccessiblePersonnelTest($programID[1], $deptID[1], $browseType[0], $browseType[0]));
+
+r($getrealname1) && p('realname') && e('测试1'); //测试取出结果集中的一个对象里的名字programID=1
+r($getnumber1) && p() && e('10'); //测试取出匹配的数量
+r($getrealname2) && p('realname') && e('开发11'); //测试取出结果集中的一个对象里的名字programID=2
+r($getnumber2) && p() && e('10'); //测试取出匹配的数量
diff --git a/test/model/personnel/getbugandstoryinvest.php b/test/model/personnel/getbugandstoryinvest.php
new file mode 100644
index 0000000000..f31002d347
--- /dev/null
+++ b/test/model/personnel/getbugandstoryinvest.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getBugAndStoryInvest();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getBugAndStoryInvestTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getcopiedobjects.php b/test/model/personnel/getcopiedobjects.php
new file mode 100644
index 0000000000..698551d7cb
--- /dev/null
+++ b/test/model/personnel/getcopiedobjects.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getCopiedObjects();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getCopiedObjectsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getinvest.php b/test/model/personnel/getinvest.php
new file mode 100755
index 0000000000..4ab1075f40
--- /dev/null
+++ b/test/model/personnel/getinvest.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+getInvest();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest('admin');
+
+$programID = array();
+$programID[0] = 1;
+$programID[1] = 2;
+
+$invest1 = count($personnel->getInvestTest($programID[0]));
+$invest2 = count($personnel->getInvestTest($programID[1]));
+
+r($invest1) && p($invest1) && e(''); //获得项目id=1的授权用户数量
+r($invest2) && p($invest2) && e(''); //获得项目id=2的授权用户数量
diff --git a/test/model/personnel/getinvolvedexecutions.php b/test/model/personnel/getinvolvedexecutions.php
new file mode 100755
index 0000000000..1f7f6ec81d
--- /dev/null
+++ b/test/model/personnel/getinvolvedexecutions.php
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+getInvolvedExecutions();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest('admin');
+
+$project = array();
+$project[0] = 101;
+$project[1] = 102;
+
+r($personnel->getInvolvedExecutionsTest($project)) && p() && e(''); //
diff --git a/test/model/personnel/getinvolvedprojects.php b/test/model/personnel/getinvolvedprojects.php
new file mode 100644
index 0000000000..d1b7d1357e
--- /dev/null
+++ b/test/model/personnel/getinvolvedprojects.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getInvolvedProjects();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getInvolvedProjectsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getissueinvest.php b/test/model/personnel/getissueinvest.php
new file mode 100644
index 0000000000..2cda93661f
--- /dev/null
+++ b/test/model/personnel/getissueinvest.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getIssueInvest();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getIssueInvestTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getprojecttaskinvest.php b/test/model/personnel/getprojecttaskinvest.php
new file mode 100644
index 0000000000..691c956177
--- /dev/null
+++ b/test/model/personnel/getprojecttaskinvest.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getProjectTaskInvest();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getProjectTaskInvestTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getriskinvest.php b/test/model/personnel/getriskinvest.php
new file mode 100755
index 0000000000..8abe2503b6
--- /dev/null
+++ b/test/model/personnel/getriskinvest.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getRiskInvest();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest('admin');
+
+var_dump($personnel->getRiskInvestTest(array('test2', 'test3'), array(1, 2, 3)));die;
+
+r($personnel->getRiskInvestTest()) && p() && e();
diff --git a/test/model/personnel/getsprintandstage.php b/test/model/personnel/getsprintandstage.php
new file mode 100644
index 0000000000..ad77fac728
--- /dev/null
+++ b/test/model/personnel/getsprintandstage.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getSprintAndStage();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getSprintAndStageTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getuserefforthours.php b/test/model/personnel/getuserefforthours.php
new file mode 100644
index 0000000000..ebac34ab07
--- /dev/null
+++ b/test/model/personnel/getuserefforthours.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getUserEffortHours();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getUserEffortHoursTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getuserhours.php b/test/model/personnel/getuserhours.php
new file mode 100644
index 0000000000..a134a1fd95
--- /dev/null
+++ b/test/model/personnel/getuserhours.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getUserHours();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getUserHoursTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getwhitelist.php b/test/model/personnel/getwhitelist.php
new file mode 100644
index 0000000000..5d2f1e51ca
--- /dev/null
+++ b/test/model/personnel/getwhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/getwhitelistaccount.php b/test/model/personnel/getwhitelistaccount.php
new file mode 100644
index 0000000000..d1d2eed402
--- /dev/null
+++ b/test/model/personnel/getwhitelistaccount.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getWhitelistAccount();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->getWhitelistAccountTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/personnel/updatewhitelist.php b/test/model/personnel/updatewhitelist.php
new file mode 100644
index 0000000000..b513f5c90a
--- /dev/null
+++ b/test/model/personnel/updatewhitelist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+updateWhitelist();
+cid=1
+pid=1
+
+*/
+
+$personnel = new personnelTest();
+
+r($personnel->updateWhitelistTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/program/update.php b/test/model/program/update.php
index a81e60f420..15dc691661 100755
--- a/test/model/program/update.php
+++ b/test/model/program/update.php
@@ -25,7 +25,7 @@ $data = array(
'parent' => '0',
'name' => '测试更新项目集十',
'begin' => '2020-10-10',
- 'end' => '2022-06-01',
+ 'end' => '2022-06-03',
'acl' => 'private',
'budget' => '100',
'budgetUnit' => 'CNY',
@@ -37,7 +37,7 @@ $data = array(
$normalProgram = $data;
$emptyTitleProgram = $data;
-$emptyTitleProgram['name'] = '项目集1';
+$emptyTitleProgram['name'] = '';
$emptyBeginProgram = $data;
$emptyBeginProgram['begin'] = '';
@@ -52,9 +52,9 @@ $beginLtParentProgram = $data;
$beginLtParentProgram['parent'] = '9';
$beginLtParentProgram['begin'] = '2019-01-01';
-r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况
-r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』已经有『项目集1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 更新项目集名称重复时
-r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息
+r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况
+r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』不能为空。'); // 更新项目集名称为空时
+r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息
r($program->update(10, $emptyEndProgram)) && p('message:end') && e('子项目的最大完成日期:2022-05-27,父项目的完成日期不能小于子项目的最大完成日期'); //当计划完成小于计划开始时
r($program->update(10, $beginGtEndProgram)) && p('message:begin') && e('子项目集的最小开始日期:2022-02-01,父项目集的开始日期不能大于子项目集的最小开始日期'); // 父项目集的开始日期大于子项目集的开始日期时
r($program->update(10, $beginLtParentProgram)) && p('message:begin;message:end') && e('父项目集的开始日期:2022-02-09,开始日期不能小于父项目集的开始日期;父项目集的完成日期:2022-04-16,完成日期不能大于父项目集的完成日期'); // 项目集开始、结束日期和子项目不符的情况
diff --git a/test/model/programplan/create.php b/test/model/programplan/create.php
new file mode 100755
index 0000000000..470f8156d4
--- /dev/null
+++ b/test/model/programplan/create.php
@@ -0,0 +1,45 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+*/
+
+$percentNumber = array('percents' => array('a', '0', '0', '0', '0', '0', '0', '', '', '', '', ''));
+$emptyBegin = array('begin' => array('', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', ''));
+$checkBegin = array('begin' => array('a', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', ''));
+$emptyEnd = array('end' => array('', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', ''));
+$checkEnd = array('end' => array('a', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', ''));
+$planFinishSmall = array('end' => array('2022-03-12', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', ''));
+$errorBegin = array('begin' => array('2022-01-01', '2022-03-13', '2022-03-16', '2022-03-16', '2022-03-19', '2022-03-19', '2022-03-22', '', '', '', '', ''));
+$errorEnd = array('end' => array('2100-06-18', '2022-04-30', '2022-05-18', '2022-05-18', '2022-04-30', '2022-05-18', '2022-05-18', '', '', '', '', ''));
+$percentOver = array('percents' => array('50', '51', '0', '0', '0', '0', '0', '', '', '', '', ''));
+
+$names = array('阶段31', '阶段121', '阶段211', '阶段301', '阶段391', '阶段481', '阶段571', '新增的阶段', '', '', '', '');
+$percents = array('0', '0', '0', '0', '0', '0', '0', '0', '', '', '', '');
+$begin = array();
+$end = array();
+$create = array('names' => $names, 'percents' => $percents, 'begin' => $begin, 'end' => $end);
+
+
+$programplan = new programplanTest();
+
+r($programplan->createTest($percentNumber)) && p() && e('"工作量比例"必须为数字'); // 测试创建用例 工作量占比非数字
+r($programplan->createTest($emptyBegin)) && p() && e('『计划开始』日期不能为空'); // 测试创建用例 计划开始为空
+r($programplan->createTest($checkBegin)) && p() && e('『计划开始』应当为合法的日期'); // 测试创建用例 计划开始非日期
+r($programplan->createTest($emptyEnd)) && p() && e('『计划完成』日期不能为空'); // 测试创建用例 计划完成为空
+r($programplan->createTest($checkEnd)) && p() && e('『计划完成』应当为合法的日期'); // 测试创建用例 计划完成非日期
+r($programplan->createTest($planFinishSmall)) && p() && e('"计划完成时间"必须大于"计划开始时间"'); // 测试创建用例 计划完成小于计划开始
+r($programplan->createTest($errorBegin)) && p() && e("阶段的开始时间不能小于所属项目的开始时间"); // 测试创建用例 计划开始小于项目开始日期
+r($programplan->createTest($errorEnd)) && p() && e("阶段的结束时间不能大于所属项目的结束时间"); // 测试创建用例 计划完成大于项目计划完成
+r($programplan->createTest($percentOver)) && p() && e('工作量占比累计不应当超过100%'); // 测试创建用例 工作量占比之和大于100
+r($programplan->createTest()) && p() && e('7'); // 测试正常更新阶段信息 获取阶段数量
+r($programplan->createTest($create)) && p() && e('8'); // 测试正常创建一条阶段信息 获取阶段数量
+system("./ztest init");
diff --git a/test/model/programplan/getbyid.php b/test/model/programplan/getbyid.php
new file mode 100755
index 0000000000..b8980fc33f
--- /dev/null
+++ b/test/model/programplan/getbyid.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getByID();
+cid=1
+pid=1
+
+*/
+
+$planIDList = array('131', '132', '133', '134', '135');
+
+$programplan = new programplanTest();
+
+r($programplan->getByIDTest($planIDList[0])) && p('name,code') && e('阶段31,project31'); // 获取阶段131
+r($programplan->getByIDTest($planIDList[1])) && p('name,code') && e('阶段32,project32'); // 获取阶段132
+r($programplan->getByIDTest($planIDList[2])) && p('name,code') && e('阶段33,project33'); // 获取阶段133
+r($programplan->getByIDTest($planIDList[3])) && p('name,code') && e('阶段34,project34'); // 获取阶段134
+r($programplan->getByIDTest($planIDList[4])) && p('name,code') && e('阶段35,project35'); // 获取阶段135
diff --git a/test/model/programplan/getbylist.php b/test/model/programplan/getbylist.php
new file mode 100755
index 0000000000..e0229ffee1
--- /dev/null
+++ b/test/model/programplan/getbylist.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getByList();
+cid=1
+pid=1
+
+*/
+
+$planIDList = array(array(11, 12), array(13, 14), array(15, 16, 17), array(18, 19, 20), array(21, 22, 23, 24));
+
+$programplan = new programplanTest();
+
+r($programplan->getByListTest($planIDList[0])) && p('11:name;12:name') && e('项目1;项目2'); // 测试获取项目11 12的信息
+r($programplan->getByListTest($planIDList[1])) && p('13:name;14:name') && e('项目3;项目4'); // 测试获取项目13 14的信息
+r($programplan->getByListTest($planIDList[2])) && p('15:name;16:name;17:name') && e('项目5;项目6;项目7'); // 测试获取项目15 16 17的信息
+r($programplan->getByListTest($planIDList[3])) && p('18:name;19:name;20:name') && e('项目8;项目9;项目10'); // 测试获取项目18 19 20的信息
+r($programplan->getByListTest($planIDList[4])) && p('21:name;22:name;23:name;24:name') && e('项目11;项目12;项目13;项目14'); // 测试获取项目21 22 23 24的信息
diff --git a/test/model/programplan/getduration.php b/test/model/programplan/getduration.php
new file mode 100755
index 0000000000..cc539c6ce0
--- /dev/null
+++ b/test/model/programplan/getduration.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getDuration();
+cid=1
+pid=1
+
+*/
+
+$beginList = array('2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05');
+$endList = array('2022-05-01', '2022-05-06', '2022-05-11', '2022-05-16', '2022-05-21');
+
+$programplan = new programplanTest();
+
+r($programplan->getDurationTest($beginList[0], $endList[0])) && p() && e('21'); // 测试获取2022-04-01 ~ 2022-05-01持续时间
+r($programplan->getDurationTest($beginList[1], $endList[1])) && p() && e('25'); // 测试获取2022-04-02 ~ 2022-05-06持续时间
+r($programplan->getDurationTest($beginList[2], $endList[2])) && p() && e('28'); // 测试获取2022-04-03 ~ 2022-05-11持续时间
+r($programplan->getDurationTest($beginList[3], $endList[3])) && p() && e('31'); // 测试获取2022-04-04 ~ 2022-05-16持续时间
+r($programplan->getDurationTest($beginList[4], $endList[4])) && p() && e('34'); // 测试获取2022-04-05 ~ 2022-05-21持续时间
diff --git a/test/model/programplan/getmilestonebyproduct.php b/test/model/programplan/getmilestonebyproduct.php
new file mode 100755
index 0000000000..0ef6126ebc
--- /dev/null
+++ b/test/model/programplan/getmilestonebyproduct.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getMilestoneByProduct();
+cid=1
+pid=1
+
+*/
+$projectIDList = array(41, 52, 43, 54, 45);
+$productIDList = array(21, 32, 23, 34, 25);
+
+$programplan = new programplanTest();
+
+r($programplan->getMilestoneByProductTest($productIDList[0], $projectIDList[0])) && p() && e('阶段121,阶段301,阶段481,阶段31,阶段211,阶段391,阶段571'); // 测试获取产品21 项目41的里程碑
+r($programplan->getMilestoneByProductTest($productIDList[1], $projectIDList[1])) && p() && e('0'); // 测试获取产品32 项目52的里程碑
+r($programplan->getMilestoneByProductTest($productIDList[2], $projectIDList[2])) && p() && e('阶段123,阶段303,阶段483,阶段33,阶段213,阶段393,阶段573'); // 测试获取产品23 项目43的里程碑
+r($programplan->getMilestoneByProductTest($productIDList[3], $projectIDList[3])) && p() && e('0'); // 测试获取产品34 项目54的里程碑
+r($programplan->getMilestoneByProductTest($productIDList[4], $projectIDList[4])) && p() && e('阶段125,阶段305,阶段485,阶段35,阶段215,阶段395,阶段575'); // 测试获取产品25 项目45的里程碑
diff --git a/test/model/programplan/getmilestones.php b/test/model/programplan/getmilestones.php
new file mode 100755
index 0000000000..f070c3b6cc
--- /dev/null
+++ b/test/model/programplan/getmilestones.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+getMilestones();
+cid=1
+pid=1
+
+*/
+$projectIDList = array(41, 52, 43, 54, 45);
+
+$programplan = new programplanTest();
+
+r($programplan->getMilestonesTest($projectIDList[0])) && p() && e('阶段571,阶段481,阶段391,阶段301,阶段211'); // 测试获取项目41的里程碑
+r($programplan->getMilestonesTest($projectIDList[1])) && p() && e('0'); // 测试获取项目52的里程碑
+r($programplan->getMilestonesTest($projectIDList[2])) && p() && e('阶段573,阶段483,阶段393,阶段303,阶段213,阶段123,阶段33'); // 测试获取项目43的里程碑
+r($programplan->getMilestonesTest($projectIDList[3])) && p() && e('0'); // 测试获取项目54的里程碑
+r($programplan->getMilestonesTest($projectIDList[4])) && p() && e('阶段575,阶段485,阶段395,阶段305,阶段215,阶段125,阶段35'); // 测试获取项目45的里程碑
diff --git a/test/model/programplan/getpairs.php b/test/model/programplan/getpairs.php
new file mode 100755
index 0000000000..3feaa421db
--- /dev/null
+++ b/test/model/programplan/getpairs.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getPairs();
+cid=1
+pid=1
+
+*/
+$executionIDList = array(41, 42, 43, 44, 45);
+$productIDList = array(21, 22, 23, 24, 25);
+
+$programplan = new programplanTest();
+
+r($programplan->getPairsTest($executionIDList[0], $productIDList[0])) && p() && e(',阶段31,阶段31/子阶段1,阶段121,阶段211,阶段301,阶段391,阶段481,阶段571'); // 测试获取执行41 产品21的计划键值对
+r($programplan->getPairsTest($executionIDList[1], $productIDList[1])) && p() && e(',阶段32,阶段32/子阶段2,阶段122,阶段212,阶段302,阶段392,阶段482,阶段572'); // 测试获取执行42 产品22的计划键值对
+r($programplan->getPairsTest($executionIDList[2], $productIDList[2])) && p() && e(',阶段33,阶段33/子阶段3,阶段123,阶段213,阶段303,阶段393,阶段483,阶段573'); // 测试获取执行43 产品23的计划键值对
+r($programplan->getPairsTest($executionIDList[3], $productIDList[3])) && p() && e(',阶段34,阶段34/子阶段4,阶段124,阶段214,阶段304,阶段394,阶段484,阶段574'); // 测试获取执行44 产品24的计划键值对
+r($programplan->getPairsTest($executionIDList[4], $productIDList[4])) && p() && e(',阶段35,阶段35/子阶段5,阶段125,阶段215,阶段305,阶段395,阶段485,阶段575'); // 测试获取执行45 产品25的计划键值对
diff --git a/test/model/programplan/getparentstagelist.php b/test/model/programplan/getparentstagelist.php
new file mode 100755
index 0000000000..6e20a1426b
--- /dev/null
+++ b/test/model/programplan/getparentstagelist.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getParentStageList();
+cid=1
+pid=1
+
+*/
+$projectIDList = array(41, 42, 43, 44, 45);
+$planIDList = array(701, 702, 703, 704, 705);
+$productIDList = array(21, 22, 23, 24, 25);
+
+$programplan = new programplanTest();
+
+r($programplan->getParentStageListTest($projectIDList[0], $planIDList[0], $productIDList[0])) && p() && e('无,阶段31'); // 测试查询项目41 计划701 产品21的父阶段信息
+r($programplan->getParentStageListTest($projectIDList[1], $planIDList[1], $productIDList[1])) && p() && e('无,阶段32'); // 测试查询项目42 计划702 产品22的父阶段信息
+r($programplan->getParentStageListTest($projectIDList[2], $planIDList[2], $productIDList[2])) && p() && e('无,阶段33'); // 测试查询项目43 计划703 产品23的父阶段信息
+r($programplan->getParentStageListTest($projectIDList[3], $planIDList[3], $productIDList[3])) && p() && e('无,阶段34'); // 测试查询项目44 计划704 产品24的父阶段信息
+r($programplan->getParentStageListTest($projectIDList[4], $planIDList[4], $productIDList[4])) && p() && e('无,阶段35'); // 测试查询项目45 计划705 产品25的父阶段信息
diff --git a/test/model/programplan/getplans.php b/test/model/programplan/getplans.php
new file mode 100755
index 0000000000..5c2a6626e5
--- /dev/null
+++ b/test/model/programplan/getplans.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getPlans();
+cid=1
+pid=1
+
+*/
+$executionIDList = array(41, 42, 43, 44, 45);
+$productIDList = array(21, 22, 23, 24, 25);
+
+$programplan = new programplanTest();
+
+r($programplan->getPlansTest($executionIDList[0], $productIDList[0])) && p() && e(',阶段31,阶段121,阶段211,阶段301,阶段391,阶段481,阶段571'); // 测试获取执行41 产品21的计划键值对
+r($programplan->getPlansTest($executionIDList[1], $productIDList[1])) && p() && e(',阶段32,阶段122,阶段212,阶段302,阶段392,阶段482,阶段572'); // 测试获取执行42 产品22的计划键值对
+r($programplan->getPlansTest($executionIDList[2], $productIDList[2])) && p() && e(',阶段33,阶段123,阶段213,阶段303,阶段393,阶段483,阶段573'); // 测试获取执行43 产品23的计划键值对
+r($programplan->getPlansTest($executionIDList[3], $productIDList[3])) && p() && e(',阶段34,阶段124,阶段214,阶段304,阶段394,阶段484,阶段574'); // 测试获取执行44 产品24的计划键值对
+r($programplan->getPlansTest($executionIDList[4], $productIDList[4])) && p() && e(',阶段35,阶段125,阶段215,阶段305,阶段395,阶段485,阶段575'); // 测试获取执行45 产品25的计划键值对
diff --git a/test/model/programplan/getstage.php b/test/model/programplan/getstage.php
new file mode 100755
index 0000000000..2e2f761e16
--- /dev/null
+++ b/test/model/programplan/getstage.php
@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+getStage();
+cid=1
+pid=1
+
+*/
+$executionIDList = array(41, 42, 43, 44, 45);
+$productIDList = array(21, 22, 23, 24, 25);
+$browseTypeList = array('all', 'parent');
+$order = 'id_desc';
+
+$programplan = new programplanTest();
+
+r($programplan->getStageTest($executionIDList[0], $productIDList[0], $browseTypeList[0])) && p() && e(',阶段31,阶段121,阶段211,阶段301,阶段391,阶段481,阶段571,子阶段1'); // 测试获取执行41 产品21 browse all的计划键值对
+r($programplan->getStageTest($executionIDList[0], $productIDList[0], $browseTypeList[1])) && p() && e(',阶段31,阶段121,阶段211,阶段301,阶段391,阶段481,阶段571'); // 测试获取执行41 产品21 browse parent的计划键值对
+r($programplan->getStageTest($executionIDList[0], $productIDList[0], $browseTypeList[0], $order)) && p() && e(',子阶段1,阶段571,阶段481,阶段391,阶段301,阶段211,阶段121,阶段31'); // 测试获取执行41 产品21 browse all id desc的计划键值对
+r($programplan->getStageTest($executionIDList[1], $productIDList[1], $browseTypeList[0])) && p() && e(',阶段32,阶段122,阶段212,阶段302,阶段392,阶段482,阶段572,子阶段2'); // 测试获取执行42 产品22 browse all的计划键值对
+r($programplan->getStageTest($executionIDList[1], $productIDList[1], $browseTypeList[1])) && p() && e(',阶段32,阶段122,阶段212,阶段302,阶段392,阶段482,阶段572'); // 测试获取执行42 产品22 browse parent的计划键值对
+r($programplan->getStageTest($executionIDList[2], $productIDList[2], $browseTypeList[0])) && p() && e(',阶段33,阶段123,阶段213,阶段303,阶段393,阶段483,阶段573,子阶段3'); // 测试获取执行43 产品23 browse all的计划键值对
+r($programplan->getStageTest($executionIDList[2], $productIDList[2], $browseTypeList[1])) && p() && e(',阶段33,阶段123,阶段213,阶段303,阶段393,阶段483,阶段573'); // 测试获取执行43 产品23 browse parent的计划键值对
+r($programplan->getStageTest($executionIDList[3], $productIDList[3], $browseTypeList[0])) && p() && e(',阶段34,阶段124,阶段214,阶段304,阶段394,阶段484,阶段574,子阶段4'); // 测试获取执行44 产品24 browse all的计划键值对
+r($programplan->getStageTest($executionIDList[3], $productIDList[3], $browseTypeList[1])) && p() && e(',阶段34,阶段124,阶段214,阶段304,阶段394,阶段484,阶段574'); // 测试获取执行44 产品24 browse parent的计划键值对
+r($programplan->getStageTest($executionIDList[4], $productIDList[4], $browseTypeList[0])) && p() && e(',阶段35,阶段125,阶段215,阶段305,阶段395,阶段485,阶段575,子阶段5'); // 测试获取执行45 产品25 browse all的计划键值对
+r($programplan->getStageTest($executionIDList[4], $productIDList[4], $browseTypeList[1])) && p() && e(',阶段35,阶段125,阶段215,阶段305,阶段395,阶段485,阶段575'); // 测试获取执行45 产品25 browse parent的计划键值对
diff --git a/test/model/programplan/gettotalpercent.php b/test/model/programplan/gettotalpercent.php
new file mode 100755
index 0000000000..0b5f8d1ca7
--- /dev/null
+++ b/test/model/programplan/gettotalpercent.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getTotalPercent();
+cid=1
+pid=1
+
+*/
+
+$stageIDList = array(131, 132, 133, 134, 135);
+
+$programplan = new programplanTest();
+
+r($programplan->getTotalPercentTest($stageIDList[0])) && p() && e('60'); // 测试获取阶段131的总进度
+r($programplan->getTotalPercentTest($stageIDList[0], true)) && p() && e('0'); // 测试获取阶段131是父阶段的总进度
+r($programplan->getTotalPercentTest($stageIDList[1])) && p() && e('60'); // 测试获取阶段132的总进度
+r($programplan->getTotalPercentTest($stageIDList[2])) && p() && e('60'); // 测试获取阶段133的总进度
+r($programplan->getTotalPercentTest($stageIDList[3])) && p() && e('60'); // 测试获取阶段134的总进度
+r($programplan->getTotalPercentTest($stageIDList[4])) && p() && e('60'); // 测试获取阶段135的总进度
diff --git a/test/model/programplan/iscreatetask.php b/test/model/programplan/iscreatetask.php
new file mode 100755
index 0000000000..ff13b8cf8a
--- /dev/null
+++ b/test/model/programplan/iscreatetask.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+isCreateTask();
+cid=1
+pid=1
+
+*/
+$stageIDList = array(131, 132, 133, 134, 135);
+
+$programplan = new programplanTest();
+
+r($programplan->isCreateTaskTest($stageIDList[0])) && p() && e('1'); // 测试阶段131下有没有任务
+r($programplan->isCreateTaskTest($stageIDList[1])) && p() && e('1'); // 测试阶段132下有没有任务
+r($programplan->isCreateTaskTest($stageIDList[2])) && p() && e('1'); // 测试阶段133下有没有任务
+r($programplan->isCreateTaskTest($stageIDList[3])) && p() && e('1'); // 测试阶段134下有没有任务
+r($programplan->isCreateTaskTest($stageIDList[4])) && p() && e('1'); // 测试阶段135下有没有任务
diff --git a/test/model/programplan/processplan.php b/test/model/programplan/processplan.php
new file mode 100755
index 0000000000..12b020bd7b
--- /dev/null
+++ b/test/model/programplan/processplan.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+processPlan();
+cid=1
+pid=1
+
+*/
+$planIDList = array(131, 132, 133, 134, 135);
+
+$programplan = new programplanTest();
+
+r($programplan->processPlanTest($planIDList[0])) && p('id,name,productName') && e('131,阶段31,已关闭的正常产品21'); // 测试计算计划131
+r($programplan->processPlanTest($planIDList[1])) && p('id,name,productName') && e('132,阶段32,已关闭的正常产品22'); // 测试计算计划132
+r($programplan->processPlanTest($planIDList[2])) && p('id,name,productName') && e('133,阶段33,已关闭的正常产品23'); // 测试计算计划133
+r($programplan->processPlanTest($planIDList[3])) && p('id,name,productName') && e('134,阶段34,已关闭的正常产品24'); // 测试计算计划134
+r($programplan->processPlanTest($planIDList[4])) && p('id,name,productName') && e('135,阶段35,已关闭的正常产品25'); // 测试计算计划135
diff --git a/test/model/programplan/processplans.php b/test/model/programplan/processplans.php
new file mode 100755
index 0000000000..1d8448c233
--- /dev/null
+++ b/test/model/programplan/processplans.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+processPlans();
+cid=1
+pid=1
+
+*/
+$planIDList = array(array(11, 12), array(13, 14), array(15, 16, 17), array(18, 19, 20), array(21, 22, 23, 24));
+
+$programplan = new programplanTest();
+
+r($programplan->processPlansTest($planIDList[0])) && p('11:name,productName;12:name,productName') && e('项目1,正常产品1;项目2,正常产品2'); // 测试获取计划 11 12的信息
+r($programplan->processPlansTest($planIDList[1])) && p('13:name,productName;14:name,productName') && e('项目3,正常产品3;项目4,正常产品4'); // 测试获取计划 13 14的信息
+r($programplan->processPlansTest($planIDList[2])) && p('15:name,productName;16:name,productName;17:name,productName') && e('项目5,正常产品5;项目6,正常产品6;项目7,正常产品7'); // 测试获取计划 15 16 17的信息
+r($programplan->processPlansTest($planIDList[3])) && p('18:name,productName;19:name,productName;20:name,productName') && e('项目8,正常产品8;项目9,正常产品9;项目10,正常产品10'); // 测试获取计划 18 19 20的信息
+r($programplan->processPlansTest($planIDList[4])) && p('21:name,productName;22:name,productName;23:name,productName;24:name,productName') && e('项目11,正常产品1;项目12,正常产品2;项目13,正常产品3;项目14,正常产品4'); // 测试获取计划 21 22 23 24的信息
diff --git a/test/model/programplan/settreepath.php b/test/model/programplan/settreepath.php
new file mode 100755
index 0000000000..d9e4892a30
--- /dev/null
+++ b/test/model/programplan/settreepath.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+setTreePath();
+cid=1
+pid=1
+
+*/
+$planIDList = array(131, 132, 133, 134, 135);
+
+$programplan = new programplanTest();
+
+r($programplan->setTreePathTest($planIDList[0])) && p('name;path') && e('阶段31;,41,131,'); // 测试更新计划131的路径
+r($programplan->setTreePathTest($planIDList[1])) && p('name;path') && e('阶段32;,42,132,'); // 测试更新计划132的路径
+r($programplan->setTreePathTest($planIDList[2])) && p('name;path') && e('阶段33;,43,133,'); // 测试更新计划133的路径
+r($programplan->setTreePathTest($planIDList[3])) && p('name;path') && e('阶段34;,44,134,'); // 测试更新计划134的路径
+r($programplan->setTreePathTest($planIDList[4])) && p('name;path') && e('阶段35;,45,135,'); // 测试更新计划135的路径
diff --git a/test/model/programplan/update.php b/test/model/programplan/update.php
new file mode 100755
index 0000000000..7312bd196a
--- /dev/null
+++ b/test/model/programplan/update.php
@@ -0,0 +1,38 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+*/
+$planID = 131;
+$projectID = 41;
+
+$beginNotempty = array('begin' => '');
+$endNotempty = array('end' => '');
+$percentOver = array('percent' => 90);
+$endLeBegin = array('end' => '2022-01-01');
+$nameNotempty = array('name' => '');
+$changeName = array('name' => '修改后的阶段');
+$changePercent = array('percent' => '15');
+$changeBegin = array('begin' => '2022-04-01');
+$changeEnd = array('end' => '2022-04-30');
+
+$programplan = new programplanTest();
+
+//r($programplan->updateTest($planID, $projectID, $beginNotempty, 'begin')) && p() && e(''); // 测试修改plan的 begin 值 计划开始为空
+//r($programplan->updateTest($planID, $projectID, $endNotempty, 'end')) && p() && e(''); // 测试修改plan的 end 值 计划完成为空
+r($programplan->updateTest($planID, $projectID, $percentOver, 'percent')) && p() && e('工作量占比累计不应当超过100%'); // 测试修改plan的 percent 值 工作占比和超过100
+r($programplan->updateTest($planID, $projectID, $endLeBegin, 'end')) && p() && e('『end』应当不小于。'); // 测试修改plan的 end 值 计划完成小于计划开始
+r($programplan->updateTest($planID, $projectID, $nameNotempty, 'name')) && p() && e('『name』不能为空。'); // 测试修改plan的 name 值 名称为空
+r($programplan->updateTest($planID, $projectID, $changeName)) && p('0:field,new') && e('name,修改后的阶段'); // 测试修改plan的 name 值
+r($programplan->updateTest($planID, $projectID, $changePercent)) && p('0:field,new') && e('percent,15'); // 测试修改plan的 percent 值
+r($programplan->updateTest($planID, $projectID, $changeBegin)) && p('0:field,new') && e('begin,2022-04-01'); // 测试修改plan的 begin 值
+r($programplan->updateTest($planID, $projectID, $changeEnd)) && p('0:field,new') && e('end,2022-04-30'); // 测试修改plan的 end 值
+system("./ztest init");
diff --git a/test/model/project/activate.php b/test/model/project/activate.php
index 075a91c16d..2aaea526f7 100755
--- a/test/model/project/activate.php
+++ b/test/model/project/activate.php
@@ -1,11 +1,11 @@
#!/usr/bin/env php
activate();
cid=1
pid=1
@@ -14,10 +14,12 @@ pid=1
*/
-$project = new Project('admin');
+global $tester;
+$tester->loadModel('project');
-$beginId = array(66, 67);
+$changes1 = $tester->project->activate(66);
+$changes2 = $tester->project->activate(73);
-r($project->checkStatus($beginId[0])) && p() && e('1'); //开始id为66状态不是closed的项目
-r($project->checkStatus($beginId[1])) && p() && e('0'); //开始id为67状态是closed的项目
-system("./ztest init");
\ No newline at end of file
+r($changes1) && p('1:field,old,new') && e('status,closed,doing'); // 激活id为66状态是closed的项目
+r($changes2) && p('1:field,old,new') && e('status,suspended,doing'); // 激活id为73状态是suspended的项目
+system("./ztest init");
diff --git a/test/model/project/batchupdate.php b/test/model/project/batchupdate.php
new file mode 100644
index 0000000000..c798c2147a
--- /dev/null
+++ b/test/model/project/batchupdate.php
@@ -0,0 +1,32 @@
+#!/usr/bin/env php
+batchUpdate();
+cid=1
+pid=1
+
+*/
+
+$project = new Project();
+$projectIdList = array(11, 12, 13);
+
+$data['names'] = array(11 => '批量修改项目11', 12 => '批量修改项目12', 13 => '批量修改项目13');
+$data['parents'] = array(11 => 1, 12 => 2, 13 => 3);
+$data['projectIdList'] = $projectIdList;
+$data['PMs'] = array(11 => 'admin', 12 => '', 13 => '');
+$data['begins'] = array(11 => '2022-02-08', 12 => '2022-03-05', 13 => '2022-02-19');
+$data['ends'] = array(11 => '2022-04-13', 12 => '2022-04-13', 13 => '2022-04-13');
+$data['dayses'] = array(11 => 10, 12 => 10, 13 => 14);
+$data['acls'] = array(11 => 'open', 12 => 'private', 13 => 'program');
+
+$projects = $project->batchUpdate($data);
+
+r(count($projects)) && p() && e('3'); // 查看被编辑了的项目数量
+r($projects) && p('11:name,parent,PM,begin,acl') && e('批量修改项目11,1,admin,2022-02-08,open'); // 查看被编辑了的项目11详情
+r($projects) && p('12:name,parent,PM,begin,acl') && e('批量修改项目12,2,,2022-03-05,private'); // 查看被编辑了的项目12详情
+system("./ztest init");
diff --git a/test/model/project/checkcanchangemodel.php b/test/model/project/checkcanchangemodel.php
new file mode 100644
index 0000000000..5188fb328d
--- /dev/null
+++ b/test/model/project/checkcanchangemodel.php
@@ -0,0 +1,18 @@
+#!/usr/bin/env php
+checkCanChangeModel();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+
+r($tester->project->checkCanChangeModel(11, 'scrum')) && p() && e('0'); // 查看ID为11的敏捷项目是否可切换项目管理模型
+r($tester->project->checkCanChangeModel(41, 'waterfall')) && p() && e('0'); // 查看ID为41的瀑布项目是否可切换项目管理模型
diff --git a/test/model/project/close.php b/test/model/project/close.php
index 895a8d4220..5c99ab39d0 100755
--- a/test/model/project/close.php
+++ b/test/model/project/close.php
@@ -1,11 +1,11 @@
#!/usr/bin/env php
close();
cid=1
pid=1
@@ -15,13 +15,16 @@ pid=1
*/
-$project = new Project('admin');
+global $tester;
+$tester->loadModel('project');
-$closeId = array(20, 26, 41);
-$realEnd1 = array('realEnd' => '2022-03-11');
+$_POST['realEnd'] = '2022-03-11';
-//var_dump($project->checkStatusOff($closeId[0], $realEnd1));die;
-r($project->checkStatusOff($closeId[0], $realEnd1)) && p() && e('1'); //关闭id为20状态不是closed的项目
-r($project->checkStatusOff($closeId[1], $realEnd1)) && p() && e('0'); //关闭id为26状态是closed的项目
-r($project->checkStatusOff($closeId[2], $realEnd1)) && p() && e('0'); //关闭id为41状态是suspended的项目
-system("./ztest init");
\ No newline at end of file
+$changes1 = $tester->project->close(19);
+$changes2 = $tester->project->close(26);
+$changes3 = $tester->project->close(33);
+
+r($changes1) && p('1:field,old,new') && e('status,wait,closed'); // 关闭id为20状态不是closed的项目
+r($changes2) && p('1:field,old,new') && e('closedBy,,admin'); // 关闭id为26状态是closed的项目
+r($changes3) && p('1:field,old,new') && e('status,suspended,closed'); // 关闭id为41状态是suspended的项目
+system("./ztest init");
diff --git a/test/model/project/computerprogress.php b/test/model/project/computerprogress.php
new file mode 100644
index 0000000000..7bec97055a
--- /dev/null
+++ b/test/model/project/computerprogress.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+computerProgress();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+$tester->loadModel('execution');
+
+$executions = $tester->execution->getList(11);
+$executions = $tester->project->computerProgress($executions);
+
+r(count($executions)) && p('') && e('7'); // 查看项目11下的所有执行的数量
+r($executions) && p('551:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('10,3,10,23.08,13'); // 查看计算后的执行工时汇总信息
+r($executions) && p('641:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('1,3,1,75,4'); // 查看计算后的执行工时汇总信息
diff --git a/test/model/project/create.php b/test/model/project/create.php
index 2f8d17048d..d1c1e52250 100644
--- a/test/model/project/create.php
+++ b/test/model/project/create.php
@@ -6,7 +6,7 @@ su('admin');
/**
-title=测试 projectModel::create();
+title=测试 projectModel->create();
cid=1
pid=1
@@ -55,10 +55,10 @@ $moreThanParent = $data;
$moreThanParent['parent'] = '1';
$moreThanParent['begin'] = '2018-01-01';
-r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目
-r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时
-r($project->create($emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 项目的开始时间为空
-r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空
-r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-01-12』。'); // 项目的计划完成时间大于计划开始时间
-r($project->create($moreThanParent)) && p('message:begin;message:end') && e('父项目的开始日期:2022-01-16,开始日期不能小于父项目的开始日期'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期)
+r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目
+r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时
+r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空
+r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-02-07』。'); // 项目的计划完成时间大于计划开始时间
+r($project->create($emptyBeginProject)) && p('message:begin') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期'); // 项目的开始时间为空
+r($project->create($moreThanParent)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期;'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期)
system("./ztest init");
diff --git a/test/model/project/getdatabyproject.php b/test/model/project/getdatabyproject.php
deleted file mode 100755
index 59c46ee40b..0000000000
--- a/test/model/project/getdatabyproject.php
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env php
-> 129
-获取parent为11的首个项目的id >> 130
-获取parent为11的首个项目的id >> 131
-获取parent为10000的首个项目的id >> 0
-获取parent为131的首个版本的id >> 1
-获取parent为132的首个版本的id >> 6
-获取parent为10000的首个版本的id >> 0
-获取parent为132的首个发布的id >> 1
-获取parent为132的首个发布的id >> 6
-获取parent为10000的首个发布的id >> 0
-
-*/
-
-/* 还有case bug testtask doc表要写,暂时表中没数据 */
-
-$t = new Project('admin');
-
-$PID = array(39, 40, 'sprint', 41, 'stage', 10000, 131, 132, 10000, 131, 132, 10000);
-
-r($t->getExecutionData($PID[0])) && p('id') && e('129'); //获取parent为11首个项目的id
-r($t->getExecutionData($PID[1], $PID[2])) && p('id') && e('130'); //获取parent为11的首个项目的id
-r($t->getExecutionData($PID[3], $PID[4])) && p('id') && e('131'); //获取parent为11的首个项目的id
-r($t->getExecutionData($PID[5])) && p('id') && e('0'); //获取parent为10000的首个项目的id
-r($t->getBuildData($PID[6])) && p('id') && e('1'); //获取parent为131的首个版本的id
-r($t->getBuildData($PID[7])) && p('id') && e('6'); //获取parent为132的首个版本的id
-r($t->getBuildData($PID[8])) && p('id') && e('0'); //获取parent为10000的首个版本的id
-r($t->getReleaseData($PID[9])) && p('id') && e('1'); //获取parent为132的首个发布的id
-r($t->getReleaseData($PID[10])) && p('id') && e('6'); //获取parent为132的首个发布的id
-r($t->getReleaseData($PID[11])) && p('id') && e('0'); //获取parent为10000的首个发布的id
\ No newline at end of file
diff --git a/test/model/project/getmembers2import.php b/test/model/project/getmembers2import.php
new file mode 100644
index 0000000000..eaa12278e9
--- /dev/null
+++ b/test/model/project/getmembers2import.php
@@ -0,0 +1,20 @@
+#!/usr/bin/env php
+getMembers2Import();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+
+$members = $tester->project->getMembers2Import(11, array('admin'));
+
+r(count($members)) && p() && e('1'); // 获取id为11的项目团队成员个数,排除admin
+r($members) && p('pm92:role') && e('产品经理92'); // 获取id为11的项目团队成员的角色
diff --git a/test/model/project/getstats.php b/test/model/project/getstats.php
index b182cee1b1..a6871ce083 100755
--- a/test/model/project/getstats.php
+++ b/test/model/project/getstats.php
@@ -1,11 +1,11 @@
#!/usr/bin/env php
getStats();
cid=1
pid=1
@@ -18,13 +18,21 @@ pid=1
*/
-$t = new Project('admin');
+global $tester;
+$tester->loadModel('project');
$OpenImplement = array('all', 'undone', 'doing', 'wait', '11', '12');
-r($t->getByStatusExe($OpenImplement[0])) && p() && e('630'); //查看所有执行
-r($t->getByStatusExe($OpenImplement[1])) && p() && e('0'); //查看未完成的执行
-r($t->getByStatusExe($OpenImplement[2])) && p() && e('315'); //查看所有进行中的执行
-r($t->getByStatusExe($OpenImplement[3])) && p() && e('315'); //查看所有进行中的执行
-r($t->getByProject($OpenImplement[4])) && p() && e('7'); //查看id为11项目的执行
-r($t->getByProject($OpenImplement[5])) && p() && e('7'); //查看id为12项目的执行
\ No newline at end of file
+$allExecutions = $tester->project->getStats(0, 'all');
+$undoneExecutions = $tester->project->getStats(0, 'undone');
+$doingExecutions = $tester->project->getStats(0, 'doing');
+$waitExecutions = $tester->project->getStats(0, 'wait');
+$project11Executions = $tester->project->getStats(11);
+$project12Executions = $tester->project->getStats(12);
+
+r(count($allExecutions)) && p() && e('630'); // 查看所有执行数量
+r(count($undoneExecutions)) && p() && e('630'); // 查看未完成的执行数量
+r(count($doingExecutions)) && p() && e('315'); // 查看所有进行中的执行数量
+r(count($waitExecutions)) && p() && e('315'); // 查看所有进行中的执行数量
+r(count($project11Executions)) && p() && e('7'); // 查看id为11项目的执行数量
+r(count($project12Executions)) && p() && e('7'); // 查看id为12项目的执行数量
diff --git a/test/model/project/getstats4kanban.php b/test/model/project/getstats4kanban.php
new file mode 100644
index 0000000000..f7cf3107a0
--- /dev/null
+++ b/test/model/project/getstats4kanban.php
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+getStats4Kanban();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+$kanbanGroup = $tester->project->getStats4Kanban();
+
+r(count($kanbanGroup['kanbanGroup'])) && p() && e('2'); //统计获取到的看板数据的分组数量
+r(count($kanbanGroup['kanbanGroup']['other'])) && p() && e('11'); //统计获取到的看板数据的其他数量
+r(count($kanbanGroup['kanbanGroup']['other'][1]['wait'])) && p() && e('3'); //统计获取到的看板数据的其他下的项目集1下的wait的项目数量
+r(count($kanbanGroup['kanbanGroup']['other'][1]['doing'])) && p() && e('4'); //统计获取到的看板数据的其他下的项目集1下的doing的项目数量
diff --git a/test/model/project/getteammemberpairs.php b/test/model/project/getteammemberpairs.php
index 8b28fa1bcd..10a16437ac 100755
--- a/test/model/project/getteammemberpairs.php
+++ b/test/model/project/getteammemberpairs.php
@@ -1,22 +1,20 @@
#!/usr/bin/env php
getTeamMemberPairs();
cid=1
pid=1
-获取id为11的项目团队成员个数 >> 2
-获取id为1的项目团队成员个数 >> 0
-
*/
-$project = new Project('admin');
+global $tester;
+$tester->loadModel('project');
-$getIdNub = array(11, 1);
+$members = $tester->project->getTeamMemberPairs(11);
-r($project->getTeamMemberPairs($getIdNub[0])) && p() && e('2'); //获取id为11的项目团队成员个数
-r($project->getTeamMemberPairs($getIdNub[1])) && p() && e('0'); //获取id为1的项目团队成员个数
\ No newline at end of file
+r(count($members)) && p() && e('3'); // 获取id为11的项目团队成员个数
+r($members) && p('pm92') && e('产品经理92'); // 获取id为11的项目团队成员的详细信息
diff --git a/test/model/project/getteammembers.php b/test/model/project/getteammembers.php
index 17f52ad4a0..ceb40f3fb4 100755
--- a/test/model/project/getteammembers.php
+++ b/test/model/project/getteammembers.php
@@ -1,7 +1,7 @@
#!/usr/bin/env php
loadModel('project');
-$getNu = array(11, array('admin', 'pm92'), 11, array('admin'), true);
+$members = $tester->project->getTeamMembers(11);
-r($project->getTeamMembers($getNu[0], $getNu[1])) && p() && e('2'); //获取id为11的项目团队成员个数
-r($project->getTeamMembers($getNu[2], $getNu[3], $getNu[4])) && p() && e('1'); //获取id为11的项目团队成员个数,开启新手引导
\ No newline at end of file
+r(count($members)) && p() && e('2'); // 获取id为11的项目团队成员个数
+r($members) && p('pm92:role,totalHours,realname') && e('项目经理,343.0,产品经理92'); // 获取id为11的项目团队成员的详细信息
diff --git a/test/model/project/managemembers.php b/test/model/project/managemembers.php
new file mode 100644
index 0000000000..357b1601ff
--- /dev/null
+++ b/test/model/project/managemembers.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+unlinkMember();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+
+$_POST['accounts'] = array('test2', 'user10', 'dev1');
+$_POST['roles'] = array('测试', '市场', '研发');
+$_POST['days'] = array('10', '12', '11');
+$_POST['hours'] = array('7.5', '8', '8.5');
+$_POST['removeExecution'] = 'no';
+
+$tester->project->manageMembers(11);
+$members = $tester->project->getTeamMemberPairs(11);
+
+r(count($members)) && p('') && e('4'); // 查看维护团队之后的成员数量
+r($members) && p('dev1') && e('开发1'); // 查看维护团队之后的成员详情
+r($members) && p('test2') && e('测试2'); // 查看维护团队之后的成员详情
+system("./ztest init");
diff --git a/test/model/project/putoff.php b/test/model/project/putoff.php
new file mode 100644
index 0000000000..adc9b03237
--- /dev/null
+++ b/test/model/project/putoff.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+start();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+$_POST['end'] = '2023-07-01';
+
+$changes1 = $tester->project->putoff(81);
+$changes2 = $tester->project->putoff(0);
+
+r($changes1[0]) && p('new') && e('2023-07-01'); // 延期ID为81的项目,查看延期后的日期
+r($changes2) && p() && e('0'); // 延期ID为0的项目,返回空
+system("./ztest init");
diff --git a/test/model/project/start.php b/test/model/project/start.php
index 7305a71968..ad7a8b9160 100755
--- a/test/model/project/start.php
+++ b/test/model/project/start.php
@@ -2,26 +2,20 @@
start();
cid=1
pid=1
-开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告) >> 1
-开始id为83状态是wait的项目 >> 1
-开始id为82状态是closed的项目 >> 0
-开始id为85状态是doing的项目 >> 0
-
*/
-$project = new Project('admin');
+$project = new Project();
-$statusId = array(81, 83, 82, 85);
-
-r($project->checkStatusBegin($statusId[0])) && p() && e('1'); // 开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告)
-r($project->checkStatusBegin($statusId[1])) && p() && e('1'); // 开始id为83状态是wait的项目
-r($project->checkStatusBegin($statusId[2])) && p() && e('0'); // 开始id为82状态是closed的项目
-r($project->checkStatusBegin($statusId[3])) && p() && e('0'); // 开始id为85状态是doing的项目
-system("./ztest init");
\ No newline at end of file
+r($project->start(81)) && p('name,status') && e('项目71,doing'); // 开始id为81状态是suspended的项目
+r($project->start(82)) && p() && e('0'); // 开始id为82状态是closed的项目
+r($project->start(83)) && p('name,status') && e('项目73,doing'); // 开始id为83状态是wait的项目
+r($project->start(85)) && p() && e('0'); // 开始id为85状态是doing的项目
+system("./ztest init");
diff --git a/test/model/project/suspend.php b/test/model/project/suspend.php
index f6e322e188..46566e47f6 100755
--- a/test/model/project/suspend.php
+++ b/test/model/project/suspend.php
@@ -1,23 +1,24 @@
#!/usr/bin/env php
suspend();
cid=1
pid=1
-暂停id为56状态是doing的项目 >> 1
-暂停id为73状态是suspended的项目 >> 0
-暂停id为74状态是closed的项目 >> 0
-
*/
-$t = new Project('admin');
+global $tester;
+$tester->loadModel('project');
-r($t->checkStatusStop(56)) && p() && e('1'); // 暂停id为56状态是doing的项目
-r($t->checkStatusStop(73)) && p() && e('0'); // 暂停id为73状态是suspended的项目
-r($t->checkStatusStop(74)) && p() && e('0'); // 暂停id为74状态是closed的项目
-system("./ztest init");
\ No newline at end of file
+$changes1 = $tester->project->suspend(56);
+$changes2 = $tester->project->suspend(73);
+$changes3 = $tester->project->suspend(74);
+
+r($changes1[0]) && p('new') && e('suspended'); // 挂起id为56状态是doing的项目
+r($changes2[0]) && p('field') && e('suspendedDate'); // 挂起id为73状态是suspended的项目
+r($changes3[0]) && p('new') && e('suspended'); // 挂起id为74状态是closed的项目
+system("./ztest init");
diff --git a/test/model/project/unlinkmember.php b/test/model/project/unlinkmember.php
new file mode 100644
index 0000000000..dcf098add6
--- /dev/null
+++ b/test/model/project/unlinkmember.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+unlinkMember();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+
+$beforeMembers = $tester->project->getTeamMemberPairs(11);
+$tester->project->unlinkMember(11, 'admin', false);
+$afterMembers = $tester->project->getTeamMemberPairs(11);
+
+r(count($beforeMembers)) && p('') && e('3'); // 查看移除团队成员之前的ID为11的项目团队成员数量
+r(count($afterMembers)) && p('') && e('2'); // 查看移除团队成员之后的ID为11的项目团队成员数量
+r($beforeMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名
+r($afterMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名
+system("./ztest init");
diff --git a/test/model/project/update.php b/test/model/project/update.php
new file mode 100644
index 0000000000..e342fb80d8
--- /dev/null
+++ b/test/model/project/update.php
@@ -0,0 +1,68 @@
+#!/usr/bin/env php
+> 测试更新项目十
+当计划开始为空时更新项目信息 >> 『计划开始』不能为空。
+当计划完成为空时更新项目信息 >> 『计划完成』不能为空。
+当计划完成小于计划开始时 >> 『计划完成』应当大于『2020-10-10』。
+项目名称已经存在时 >> 『项目名称』已经有『项目1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
+项目开始时间小于父项目时 >> 父项目的开始日期:2019-09-09,开始日期不能小于父项目的开始日期;父项目的完成日期:2019-09-09,完成日期不能大于父项目的完成日期
+
+*/
+
+global $tester;
+$tester->app->loadConfig('execution');
+
+$project = new Project();
+
+$data = array(
+ 'parent' => '0',
+ 'name' => '测试更新项目十',
+ 'begin' => '2020-10-10',
+ 'end' => '2022-06-01',
+ 'acl' => 'private',
+ 'budget' => '100',
+ 'budgetUnit' => 'CNY',
+ 'PM' => 'admin',
+ 'products' => array(1, 2, 3),
+ 'whitelist' => array('dev10', 'dev12')
+);
+
+$normalProject = $data;
+
+$noProductProject = $data;
+$noProductProject['products'] = array();
+
+$emptyTitleProject = $data;
+$emptyTitleProject['name'] = '';
+
+$emptyBeginProject = $data;
+$emptyBeginProject['begin'] = '';
+
+$emptyEndProject = $data;
+$emptyEndProject['end'] = '';
+
+$beginGtEndProject = $data;
+$beginGtEndProject['begin'] = '2022-07-01';
+
+$beginLtParentProject = $data;
+$beginLtParentProject['parent'] = '9';
+$beginLtParentProject['begin'] = '2019-01-01';
+
+r($project->update(10, $normalProject)) && p('name') && e('测试更新项目十'); // 正常更新项目的情况
+r($project->update(10, $noProductProject)) && p('message:0') && e('最少关联一个产品'); // 未关联产品的项目
+r($project->update(10, $emptyTitleProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 更新项目名称为空时
+r($project->update(10, $emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目信息
+r($project->update(10, $emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 当计划完成小于计划开始时
+r($project->update(10, $beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-07-01』。'); // 父项目的开始日期大于子项目的开始日期时
+r($project->update(10, $beginLtParentProject)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-15,项目的开始日期不能小于项目集的最小开始日期;项目集的最大完成日期:2022-04-22,项目的完成日期不能大于项目集的最大完成日期'); // 项目开始、结束日期和子项目不符的情况
+system("./ztest init");
diff --git a/test/model/project/updateproductprogram.php b/test/model/project/updateproductprogram.php
new file mode 100644
index 0000000000..f8e3b50450
--- /dev/null
+++ b/test/model/project/updateproductprogram.php
@@ -0,0 +1,28 @@
+#!/usr/bin/env php
+updateProductProgram();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+
+$productIdList = array(1, 2, 3, 4);
+$tester->project->updateProductProgram(7, 1, $productIdList);
+
+$products = $tester->loadModel('product')->getByIdList($productIdList);
+
+r(count($products)) && p('') && e('4'); // 查看被更新了项目集的产品数量
+r($products) && p('1:program,name') && e('1,正常产品1'); // 查看被更新了项目集的产品详情
+r($products) && p('2:program,name') && e('1,正常产品2'); // 查看被更新了项目集的产品详情
+r($products) && p('3:program,name') && e('1,正常产品3'); // 查看被更新了项目集的产品详情
+r($products) && p('4:program,name') && e('1,正常产品4'); // 查看被更新了项目集的产品详情
+system("./ztest init");
diff --git a/test/model/project/updateproducts.php b/test/model/project/updateproducts.php
new file mode 100644
index 0000000000..a874abd6c7
--- /dev/null
+++ b/test/model/project/updateproducts.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+updateProducts();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('project');
+$tester->loadModel('product');
+
+$beforeProducts = $tester->product->getProductPairsByProject(11);
+
+$productIdList = array(1, 2, 3, 4);
+$tester->project->updateProducts(11, $productIdList);
+
+$afterProducts = $tester->product->getProductPairsByProject(11);
+
+r(count($beforeProducts)) && p() && e('3'); // 查看更新项目关联的产品之前的产品数量
+r(count($afterProducts)) && p() && e('4'); // 查看更新项目关联的产品之后的产品数量
+r($beforeProducts) && p('81') && e('多平台产品81'); // 查看更新项目关联的产品之前的产品名称
+r($afterProducts) && p('4') && e('正常产品4'); // 查看更新项目关联的产品之后的产品名称
+system("./ztest init");
diff --git a/test/model/stage/batchcreate.php b/test/model/stage/batchcreate.php
new file mode 100755
index 0000000000..cfe58e2b5f
--- /dev/null
+++ b/test/model/stage/batchcreate.php
@@ -0,0 +1,41 @@
+#!/usr/bin/env php
+batchCreate();
+cid=1
+pid=1
+
+*/
+$name1 = array('1' => '批量创建的需求', '2' => '批量创建的设计', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$percent1 = array('1' => '1', '2' => '2', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$type1 = array('1' => 'request', '2' => 'design', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+
+$name2 = array('1' => '批量创建的开发', '2' => '批量创建的测试', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$percent2 = array('1' => '3', '2' => '4', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$type2 = array('1' => 'dev', '2' => 'qa', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+
+$name3 = array('1' => '批量创建的发布', '2' => '批量创建的总结评审', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$percent3 = array('1' => '5', '2' => '6', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$type3 = array('1' => 'release', '2' => 'review', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+
+$name4 = array('1' => '', '2' => '批量创建的其他', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$percent4 = array('1' => '1', '2' => '7', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+$type4 = array('1' => 'request', '2' => 'other', '3' => '', '4' => '', '5' => '', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '');
+
+$param1 = array('name' => $name1, 'percent' => $percent1, 'type' => $type1);
+$param2 = array('name' => $name2, 'percent' => $percent2, 'type' => $type2);
+$param3 = array('name' => $name3, 'percent' => $percent3, 'type' => $type3);
+$param4 = array('name' => $name4, 'percent' => $percent4, 'type' => $type4);
+
+$stage = new stageTest();
+
+r($stage->batchCreateTest($param1)) && p() && e('8'); // 测试批量创建阶段 1
+r($stage->batchCreateTest($param2)) && p() && e('10'); // 测试批量创建阶段 2
+r($stage->batchCreateTest($param3)) && p() && e('12'); // 测试批量创建阶段 3
+r($stage->batchCreateTest($param4)) && p() && e('13'); // 测试批量创建阶段 4
+system("./ztest init");
diff --git a/test/model/stage/create.php b/test/model/stage/create.php
new file mode 100755
index 0000000000..f36b638153
--- /dev/null
+++ b/test/model/stage/create.php
@@ -0,0 +1,59 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+*/
+
+$stage1 = new stdclass();
+$stage1->name = '新建的需求';
+$stage1->percent = 1;
+$stage1->type = 'request';
+
+$stage2 = new stdclass();
+$stage2->name = '新建的设计';
+$stage2->percent = 2;
+$stage2->type = 'design';
+
+$stage3 = new stdclass();
+$stage3->name = '新建的开发';
+$stage3->percent = 3;
+$stage3->type = 'dev';
+
+$stage4 = new stdclass();
+$stage4->name = '新建的测试';
+$stage4->percent = 4;
+$stage4->type = 'qa';
+
+$stage5 = new stdclass();
+$stage5->name = '新建的发布';
+$stage5->percent = 5;
+$stage5->type = 'release';
+
+$stage6 = new stdclass();
+$stage6->name = '新建的总结评审';
+$stage6->percent = 6;
+$stage6->type = 'review';
+
+$stage7 = new stdclass();
+$stage7->name = '新建的其他';
+$stage7->percent = 7;
+$stage7->type = 'other';
+
+$stage = new stageTest();
+
+r($stage->createTest($stage1)) && p('name,percent,type') && e('新建的需求,1,request'); // 测试新建一个需求阶段
+r($stage->createTest($stage2)) && p('name,percent,type') && e('新建的设计,2,design'); // 测试新建一个设计阶段
+r($stage->createTest($stage3)) && p('name,percent,type') && e('新建的开发,3,dev'); // 测试新建一个开发阶段
+r($stage->createTest($stage4)) && p('name,percent,type') && e('新建的测试,4,qa'); // 测试新建一个测试阶段
+r($stage->createTest($stage5)) && p('name,percent,type') && e('新建的发布,5,release'); // 测试新建一个发布阶段
+r($stage->createTest($stage6)) && p('name,percent,type') && e('新建的总结评审,6,review'); // 测试新建一个总结评审阶段
+r($stage->createTest($stage7)) && p('name,percent,type') && e('新建的其他,7,other'); // 测试新建一个其他阶段
+system("./ztest init");
diff --git a/test/model/stage/getbyid.php b/test/model/stage/getbyid.php
new file mode 100755
index 0000000000..bf6743d703
--- /dev/null
+++ b/test/model/stage/getbyid.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getByID();
+cid=1
+pid=1
+
+*/
+
+$stageIDList = array(1, 2, 3, 4, 5, 6);
+
+$stage = new stageTest();
+
+r($stage->getByIDTest($stageIDList[0])) && p('name,percent,type') && e('需求,10,request'); // 测试获取阶段 1
+r($stage->getByIDTest($stageIDList[1])) && p('name,percent,type') && e('设计,10,design'); // 测试获取阶段 2
+r($stage->getByIDTest($stageIDList[2])) && p('name,percent,type') && e('开发,50,dev'); // 测试获取阶段 3
+r($stage->getByIDTest($stageIDList[3])) && p('name,percent,type') && e('测试,15,qa'); // 测试获取阶段 4
+r($stage->getByIDTest($stageIDList[4])) && p('name,percent,type') && e('发布,10,release'); // 测试获取阶段 5
+r($stage->getByIDTest($stageIDList[5])) && p('name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6
diff --git a/test/model/stage/getpairs.php b/test/model/stage/getpairs.php
new file mode 100755
index 0000000000..b1c4e34e73
--- /dev/null
+++ b/test/model/stage/getpairs.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+getPairs();
+cid=1
+pid=1
+
+*/
+
+$stage = new stageTest();
+
+r($stage->getPairsTest()) && p('1') && e('需求'); // 测试获取阶段 1
+r($stage->getPairsTest()) && p('2') && e('设计'); // 测试获取阶段 2
+r($stage->getPairsTest()) && p('3') && e('开发'); // 测试获取阶段 3
+r($stage->getPairsTest()) && p('4') && e('测试'); // 测试获取阶段 4
+r($stage->getPairsTest()) && p('5') && e('发布'); // 测试获取阶段 5
+r($stage->getPairsTest()) && p('6') && e('总结评审'); // 测试获取阶段 6
diff --git a/test/model/stage/getstages.php b/test/model/stage/getstages.php
new file mode 100755
index 0000000000..d58f5146f5
--- /dev/null
+++ b/test/model/stage/getstages.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+getStages();
+cid=1
+pid=1
+
+*/
+
+$stage = new stageTest();
+
+r($stage->getStagesTest()) && p('1:name,percent,type') && e('需求,10,request'); // 测试获取阶段 1
+r($stage->getStagesTest()) && p('2:name,percent,type') && e('设计,10,design'); // 测试获取阶段 2
+r($stage->getStagesTest()) && p('3:name,percent,type') && e('开发,50,dev'); // 测试获取阶段 3
+r($stage->getStagesTest()) && p('4:name,percent,type') && e('测试,15,qa'); // 测试获取阶段 4
+r($stage->getStagesTest()) && p('5:name,percent,type') && e('发布,10,release'); // 测试获取阶段 5
+r($stage->getStagesTest()) && p('6:name,percent,type') && e('总结评审,5,review'); // 测试获取阶段 6
diff --git a/test/model/stage/update.php b/test/model/stage/update.php
new file mode 100755
index 0000000000..e52ea89cb5
--- /dev/null
+++ b/test/model/stage/update.php
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+*/
+
+$stageID = 1;
+
+$changeName = array('name' => '修改后的需求');
+$changePercent = array('percent' => '15');
+$changeType = array('type' => 'other');
+
+$stage = new stageTest();
+
+r($stage->updateTest($stageID, $changeName)) && p('0:field,old,new') && e('name,需求,修改后的需求'); // 测试修改名称
+r($stage->updateTest($stageID, $changePercent)) && p('0:field,old,new') && e('percent,10,15'); // 测试修改工作量占比
+r($stage->updateTest($stageID, $changeType)) && p('0:field,old,new') && e('type,request,other'); // 测试修改阶段分类
+system("./ztest init");
+
diff --git a/test/model/testcase/batchcreate.php b/test/model/testcase/batchcreate.php
new file mode 100755
index 0000000000..f6857731fa
--- /dev/null
+++ b/test/model/testcase/batchcreate.php
@@ -0,0 +1,34 @@
+#!/usr/bin/env php
+batchCreate();
+cid=1
+pid=1
+
+*/
+
+$title1 = array('测试批量创建4', '', '测试批量创建6');
+$title2 = array('测试批量创建7', '测试批量创建8', '测试批量创建9');
+$title3 = array('测试批量创建10', '测试批量创建11', '测试批量创建12');
+$title4 = array('测试批量创建13', '测试批量创建14', '测试批量创建15');
+$title5 = array('测试批量创建16', '测试批量创建17', '测试批量创建18');
+$type = array('feature', 'ditto', 'config');
+$pri = array('2', 'ditto', '1');
+$stage = array(array('system', 'smoke'), array('bvt'), array('unittest'));
+$needReview = array(0, 1, 0);
+
+
+$testcase = new testcaseTest();
+
+r($testcase->batchCreateTest(array('title' => $title1))) && p() && e('2'); // 测试批量创建用例1
+r($testcase->batchCreateTest(array('type' => $type, 'title' => $title2))) && p() && e('3'); // 测试批量创建用例2
+r($testcase->batchCreateTest(array('pri' => $pri, 'title' => $title3))) && p() && e('3'); // 测试批量创建用例3
+r($testcase->batchCreateTest(array('stage' => $stage, 'title' => $title4))) && p() && e('3'); // 测试批量创建用例4
+r($testcase->batchCreateTest(array('needReview' => $needReview, 'title' => $title5))) && p() && e('3'); // 测试批量创建用例5
+r($testcase->batchCreateTest(array('title' => $title1))) && p() && e('0'); // 测试重复批量创建用例1
+system("./ztest init");
diff --git a/test/model/testcase/batchupdate.php b/test/model/testcase/batchupdate.php
new file mode 100755
index 0000000000..c41c261b53
--- /dev/null
+++ b/test/model/testcase/batchupdate.php
@@ -0,0 +1,47 @@
+#!/usr/bin/env php
+batchUpdate();
+cid=1
+pid=1
+
+*/
+
+$changeTitle = array('1' => '修改后的测试用例1', '2' => '这个是测试用例2', '3' => '这个是测试用例3', '4' => '这个是测试用例4');;
+$changePris = array('1' => 1, '2' => 1, '3' => 3, '4' => 4);
+$changeStatuses = array('1' => 'wait', '2' => 'normal', '3' => 'nomal', '4' => 'investigate');
+$changeModules = array('1' => 0, '2' => 0, '3' => 0, '4' => 1822);
+$changeColor = array('1' => '#2dbdb2', '2' => '#75c941', '3' => '#2dbdb2', '4' => '#797ec9');
+$changeTypes = array('1' => 'feature', '2' => 'other', '3' => 'config', '4' => 'install');
+$changePrecondition = array('1' => '这是前置条件1', '2' => '这是前置条件2', '3' => '修改后的前置条件3', '4' => '这是前置条件4');
+$changeKeywords = array('1' => '这是关键词1', '2' => '这是关键词2', '3' => '这是关键词3', '4' => '修改后的关键词4');
+$changeStages = array('1' => array('unittest', 'feature'), '2' => array('feature'), '3' => array('intergrate'), '4' => array('system'));
+
+$changeTitle = array('title' => $changeTitle);
+$changePris = array('pris' => $changePris);
+$changeStatuses = array('statuses' => $changeStatuses);
+$changeModules = array('modules' => $changeModules);
+$changeColor = array('color' => $changeColor);
+$changeTypes = array('types' => $changeTypes);
+$changePrecondition = array('precondition' => $changePrecondition);
+$changeKeywords = array('keywords' => $changeKeywords);
+$changeStages = array('stages' => $changeStages);
+
+
+$testcase = new testcaseTest();
+
+r($testcase->batchUpdateTest(1, $changeTitle)) && p('field,old,new') && e('title,这个是测试用例1,修改后的测试用例1'); // 测试批量修改用例标题
+r($testcase->batchUpdateTest(2, $changePris)) && p('field,old,new') && e('pri,2,1'); // 测试批量修改用例优先级
+r($testcase->batchUpdateTest(3, $changeStatuses)) && p('field,old,new') && e('status,blocked,nomal'); // 测试批量修改用例状态
+r($testcase->batchUpdateTest(4, $changeModules)) && p('field,old,new') && e('module,0,1822'); // 测试批量修改用例模块
+r($testcase->batchUpdateTest(1, $changeColor)) && p('field,old,new') && e('color,#3da7f5,#2dbdb2'); // 测试批量修改用例颜色
+r($testcase->batchUpdateTest(2, $changeTypes)) && p('field,old,new') && e('type,performance,other'); // 测试批量修改用例类型
+r($testcase->batchUpdateTest(3, $changePrecondition)) && p('field,old,new') && e('precondition,这是前置条件3,修改后的前置条件3'); // 测试批量修改用例前置条件
+r($testcase->batchUpdateTest(4, $changeKeywords)) && p('field,old,new') && e('keywords,这是关键词4,修改后的关键词4'); // 测试批量修改用例关键词
+r($testcase->batchUpdateTest(1, $changeStages)) && p('field,old,new') && e('stage,unittest,unittest,feature'); // 测试批量修改用例阶段
+system("./ztest init");
diff --git a/test/model/testcase/create.php b/test/model/testcase/create.php
new file mode 100755
index 0000000000..84f17b9b86
--- /dev/null
+++ b/test/model/testcase/create.php
@@ -0,0 +1,32 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+*/
+
+$testcase1 = array('title' => '测试创建测试用例1');
+$testcase2 = array('title' => '测试创建测试用例2', 'pri' => '1', 'type' => 'performance');
+$testcase3 = array('title' => '测试创建测试用例3', 'keywords' => '测试关键词3', 'stage' => array('unittest', 'smoke'));
+
+$no_title = array('title' => '');
+$no_type = array('type' => '', 'title' => '测试创建没有填写类型的用例');
+
+
+
+$testcase = new testcaseTest();
+
+r($testcase->createTest($testcase1)) && p('status') && e('created'); // 测试创建用例1
+r($testcase->createTest($testcase2)) && p('status') && e('created'); // 测试创建用例2
+r($testcase->createTest($testcase3)) && p('status') && e('created'); // 测试创建用例3
+r($testcase->createTest($testcase1)) && p('status') && e('exists'); // 测试创建重名用例1
+r($testcase->createTest($no_title)) && p() && e('『用例标题』不能为空。'); // 测试创建没有填写名字的用例
+r($testcase->createTest($no_type)) && p() && e('『用例类型』不能为空。'); // 测试创建没有填写类型的用例
+system("./ztest init");
diff --git a/test/model/testcase/createfromimport.php b/test/model/testcase/createfromimport.php
new file mode 100755
index 0000000000..0f47224321
--- /dev/null
+++ b/test/model/testcase/createfromimport.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+createFromImport();
+cid=1
+pid=1
+
+*/
+
+$productID = 1;
+
+$param1 = array('id' => array('1' => 1, '2' => 2), 'title' => array('1' => '导入覆盖的用例1', '2' => '导入覆盖的用例2'), 'insert' => '0');
+$param2 = array('id' => array('1' => 1, '2' => 2), 'title' => array('1' => '导入插入的用例1', '2' => '导入插入的用例2'), 'insert' => '1');
+
+$testcase = new testcaseTest();
+
+r($testcase->createFromImportTest($productID)) && p() && e('这个是测试用例1,这个是测试用例2,导入测试用例1,导入测试用例2'); // 测试直接导入数据
+r($testcase->createFromImportTest($productID, $param1)) && p() && e('导入覆盖的用例1,导入覆盖的用例2,导入测试用例1,导入测试用例2'); // 测试导入数据覆盖原有数据
+r($testcase->createFromImportTest($productID, $param2)) && p() && e('导入覆盖的用例1,导入覆盖的用例2,导入测试用例1,导入测试用例2,导入插入的用例1,导入插入的用例2'); // 测试导入数据不覆盖原有数据
+system("./ztest init");
diff --git a/test/model/testcase/getstatus.php b/test/model/testcase/getstatus.php
new file mode 100755
index 0000000000..63721cd77c
--- /dev/null
+++ b/test/model/testcase/getstatus.php
@@ -0,0 +1,32 @@
+#!/usr/bin/env php
+getStatus();
+cid=1
+pid=1
+
+*/
+
+$typeList = array('create', 'review', 'update');
+
+$case1 = new stdclass();
+$case1->status = 'pass';
+
+$case2 = new stdclass();
+$case2->status = 'clarify';
+
+$case = null;
+$param1 = array('lastEditedDate' => '2022-03-04 00:00:00');
+
+$testcase = new testcaseTest();
+
+r($testcase->getStatusTest($typeList[0])) && p() && e('normal'); // 测试获取create的状态
+r($testcase->getStatusTest($typeList[1], $case1)) && p() && e('pass'); // 测试获取review pass 的状态
+r($testcase->getStatusTest($typeList[1], $case2)) && p() && e('clarify'); // 测试获取review clarify 的状态
+r($testcase->getStatusTest($typeList[2], $case)) && p('1') && e('wait'); // 测试获取update的状态
+r($testcase->getStatusTest($typeList[2], $case, $param1)) && p() && e('该记录可能已经被改动。请刷新页面重新编辑!'); // 测试获取update 别人变更 的状态
diff --git a/test/model/testcase/gettestcases.php b/test/model/testcase/gettestcases.php
new file mode 100755
index 0000000000..aaf5649a36
--- /dev/null
+++ b/test/model/testcase/gettestcases.php
@@ -0,0 +1,45 @@
+#!/usr/bin/env php
+getTestCases();
+cid=1
+pid=1
+
+*/
+
+$productID = array('1', '2', '3', '4', '5');
+$browseType = array('all', 'wait', 'bymodule', 'needconfirm', 'bysuite');
+$suiteID = array('1', '3', '5', '7', '9');
+
+$testcase = new testcaseTest();
+
+r($testcase->getTestCasesTest($productID[0], $browseType[0], $suiteID[0])) && p('1:title;2:title;3:title;4:title') && e('这个是测试用例1;这个是测试用例2;这个是测试用例3;这个是测试用例4'); // 测试查询产品1 suiteID 1 browseType all 的测试用例
+r($testcase->getTestCasesTest($productID[0], $browseType[1], $suiteID[0])) && p('1:title') && e('这个是测试用例1'); // 测试查询产品1 suiteID 1 browseType wait 的测试用例
+r($testcase->getTestCasesTest($productID[0], $browseType[2], $suiteID[0])) && p('1:title;2:title;3:title;4:title') && e('这个是测试用例1;这个是测试用例2;这个是测试用例3;这个是测试用例4'); // 测试查询产品1 suiteID 1 browseType bymodule 的测试用例
+r($testcase->getTestCasesTest($productID[0], $browseType[3], $suiteID[0])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例4;这个是测试用例3;这个是测试用例2;这个是测试用例1'); // 测试查询产品1 suiteID 1 browseType needconfirm 的测试用例
+r($testcase->getTestCasesTest($productID[0], $browseType[4], $suiteID[0])) && p('1:title;2:title') && e('这个是测试用例1;这个是测试用例2'); // 测试查询产品1 suiteID 1 browseType bysuite 的测试用例
+r($testcase->getTestCasesTest($productID[1], $browseType[0], $suiteID[1])) && p('5:title;6:title;7:title;8:title') && e('这个是测试用例5;这个是测试用例6;这个是测试用例7;这个是测试用例8'); // 测试查询产品2 suiteID 3 browseType all 的测试用例
+r($testcase->getTestCasesTest($productID[1], $browseType[1], $suiteID[1])) && p('5:title') && e('这个是测试用例5'); // 测试查询产品2 suiteID 3 browseType wait 的测试用例
+r($testcase->getTestCasesTest($productID[1], $browseType[2], $suiteID[1])) && p('5:title;6:title;7:title;8:title') && e('这个是测试用例5;这个是测试用例6;这个是测试用例7;这个是测试用例8'); // 测试查询产品2 suiteID 3 browseType bymodule 的测试用例
+r($testcase->getTestCasesTest($productID[1], $browseType[3], $suiteID[1])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例8;这个是测试用例7;这个是测试用例6;这个是测试用例5'); // 测试查询产品2 suiteID 3 browseType needconfirm 的测试用例
+r($testcase->getTestCasesTest($productID[1], $browseType[4], $suiteID[1])) && p('5:title;6:title') && e('这个是测试用例5;这个是测试用例6'); // 测试查询产品2 suiteID 3 browseType bysuite 的测试用例
+r($testcase->getTestCasesTest($productID[2], $browseType[0], $suiteID[2])) && p('9:title;10:title;11:title;12:title') && e('这个是测试用例9;这个是测试用例10;这个是测试用例11;这个是测试用例12'); // 测试查询产品3 suiteID 5 browseType all 的测试用例
+r($testcase->getTestCasesTest($productID[2], $browseType[1], $suiteID[2])) && p('9:title') && e('这个是测试用例9'); // 测试查询产品3 suiteID 5 browseType wait 的测试用例
+r($testcase->getTestCasesTest($productID[2], $browseType[2], $suiteID[2])) && p('9:title;10:title;11:title;12:title') && e('这个是测试用例9;这个是测试用例10;这个是测试用例11;这个是测试用例12'); // 测试查询产品3 suiteID 5 browseType bymodule 的测试用例
+r($testcase->getTestCasesTest($productID[2], $browseType[3], $suiteID[2])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例12;这个是测试用例11;这个是测试用例10;这个是测试用例9'); // 测试查询产品3 suiteID 5 browseType needconfirm 的测试用例
+r($testcase->getTestCasesTest($productID[2], $browseType[4], $suiteID[2])) && p('9:title;10:title') && e('这个是测试用例9;这个是测试用例10'); // 测试查询产品3 suiteID 5 browseType bysuite 的测试用例
+r($testcase->getTestCasesTest($productID[3], $browseType[0], $suiteID[3])) && p('13:title;14:title;15:title;16:title') && e('这个是测试用例13;这个是测试用例14;这个是测试用例15;这个是测试用例16'); // 测试查询产品4 suiteID 7 browseType all 的测试用例
+r($testcase->getTestCasesTest($productID[3], $browseType[1], $suiteID[3])) && p('13:title') && e('这个是测试用例13'); // 测试查询产品4 suiteID 7 browseType wait 的测试用例
+r($testcase->getTestCasesTest($productID[3], $browseType[2], $suiteID[3])) && p('13:title;14:title;15:title;16:title') && e('这个是测试用例13;这个是测试用例14;这个是测试用例15;这个是测试用例16'); // 测试查询产品4 suiteID 7 browseType bymodule 的测试用例
+r($testcase->getTestCasesTest($productID[3], $browseType[3], $suiteID[3])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例16;这个是测试用例15;这个是测试用例14;这个是测试用例13'); // 测试查询产品4 suiteID 7 browseType needconfirm 的测试用例
+r($testcase->getTestCasesTest($productID[3], $browseType[4], $suiteID[3])) && p('13:title;14:title') && e('这个是测试用例13;这个是测试用例14'); // 测试查询产品4 suiteID 7 browseType bysuite 的测试用例
+r($testcase->getTestCasesTest($productID[4], $browseType[0], $suiteID[4])) && p('17:title;18:title;19:title;20:title') && e('这个是测试用例17;这个是测试用例18;这个是测试用例19;这个是测试用例20'); // 测试查询产品5 suiteID 9 browseType all 的测试用例
+r($testcase->getTestCasesTest($productID[4], $browseType[1], $suiteID[4])) && p('17:title') && e('这个是测试用例17'); // 测试查询产品5 suiteID 9 browseType wait 的测试用例
+r($testcase->getTestCasesTest($productID[4], $browseType[2], $suiteID[4])) && p('17:title;18:title;19:title;20:title') && e('这个是测试用例17;这个是测试用例18;这个是测试用例19;这个是测试用例20'); // 测试查询产品5 suiteID 9 browseType bymodule 的测试用例
+r($testcase->getTestCasesTest($productID[4], $browseType[3], $suiteID[4])) && p('0:title;1:title;2:title;3:title') && e('这个是测试用例20;这个是测试用例19;这个是测试用例18;这个是测试用例17'); // 测试查询产品5 suiteID 9 browseType needconfirm 的测试用例
+r($testcase->getTestCasesTest($productID[4], $browseType[4], $suiteID[4])) && p('17:title;18:title') && e('这个是测试用例17;这个是测试用例18'); // 测试查询产品5 suiteID 9 browseType bysuite 的测试用例
diff --git a/test/model/testcase/importfromlib.php b/test/model/testcase/importfromlib.php
new file mode 100755
index 0000000000..8d4871d39f
--- /dev/null
+++ b/test/model/testcase/importfromlib.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+importFromLib();
+cid=1
+pid=1
+
+*/
+
+$productID = 1;
+$caseIdList = array(array('401' => '401', '402' => '402'), array('403' => '403', '404' => '404'), array('405' => '405', '406' => '406'), array('407' => '407', '408' => '408'), array('409' => '409', '410' => '410'));
+
+$testcase = new testcaseTest();
+
+r($testcase->importFromLibTest($productID, $caseIdList[0])) && p('0:title;1:title') && e('用例库用例1;用例库用例2'); // 测试导入用例库用例 401 402
+r($testcase->importFromLibTest($productID, $caseIdList[1])) && p('0:title;1:title') && e('用例库用例3;用例库用例4'); // 测试导入用例库用例 403 404
+r($testcase->importFromLibTest($productID, $caseIdList[2])) && p('0:title;1:title') && e('用例库用例5;用例库用例6'); // 测试导入用例库用例 405 406
+r($testcase->importFromLibTest($productID, $caseIdList[3])) && p('0:title;1:title') && e('用例库用例7;用例库用例8'); // 测试导入用例库用例 407 408
+r($testcase->importFromLibTest($productID, $caseIdList[4])) && p('0:title;1:title') && e('用例库用例9;用例库用例10'); // 测试导入用例库用例 409 410
+system("./ztest init");
diff --git a/test/model/testcase/joinstep.php b/test/model/testcase/joinstep.php
new file mode 100755
index 0000000000..00240da386
--- /dev/null
+++ b/test/model/testcase/joinstep.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+joinStep();
+cid=1
+pid=1
+
+*/
+
+$stepIDList = array('1,2', '3,4', '5,6', '7,8', '9,10');
+
+$testcase = new testcaseTest();
+
+r($testcase->joinStepTest($stepIDList[0])) && p() && e('用例步骤描述1 EXPECT:这是用例预期结果1 用例步骤描述2 EXPECT:这是用例预期结果2'); // 测试获取步骤 1 2 的字符串
+r($testcase->joinStepTest($stepIDList[1])) && p() && e('用例步骤描述3 EXPECT:这是用例预期结果3 用例步骤描述4 EXPECT:这是用例预期结果4'); // 测试获取步骤 3 4 的字符串
+r($testcase->joinStepTest($stepIDList[2])) && p() && e('用例步骤描述5 EXPECT:这是用例预期结果5 用例步骤描述6 EXPECT:这是用例预期结果6'); // 测试获取步骤 5 6 的字符串
+r($testcase->joinStepTest($stepIDList[3])) && p() && e('用例步骤描述7 EXPECT:这是用例预期结果7 用例步骤描述8 EXPECT:这是用例预期结果8'); // 测试获取步骤 7 8 的字符串
+r($testcase->joinStepTest($stepIDList[4])) && p() && e('用例步骤描述9 EXPECT:这是用例预期结果9 用例步骤描述10 EXPECT:这是用例预期结果10'); // 测试获取步骤 9 10 的字符串
diff --git a/test/model/testcase/review.php b/test/model/testcase/review.php
new file mode 100755
index 0000000000..24367cef64
--- /dev/null
+++ b/test/model/testcase/review.php
@@ -0,0 +1,49 @@
+#!/usr/bin/env php
+review();
+cid=1
+pid=1
+
+*/
+
+$caseIDList = array(1, 5, 9, 13, 17);
+
+$case1 = new stdclass();
+$case1->result = 'pass';
+$case1->status = 'normal';
+$case1->reviewedBy = array('test1');
+
+$case2 = new stdclass();
+$case2->result = 'clarify';
+$case2->status = 'wait';
+$case2->reviewedBy = array('test2');
+
+$case3 = new stdclass();
+$case3->result = 'pass';
+$case3->status = 'normal';
+$case3->reviewedBy = array('test3');
+
+$case4 = new stdclass();
+$case4->result = 'clarify';
+$case4->status = 'wait';
+$case4->reviewedBy = array('test4');
+
+$case5 = new stdclass();
+$case5->result = 'pass';
+$case5->status = 'normal';
+$case5->reviewedBy = array('test5');
+
+$testcase = new testcaseTest();
+
+r($testcase->reviewTest($caseIDList[0], $case1)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 1
+r($testcase->reviewTest($caseIDList[1], $case2)) && p('0:field,old,new') && e('reviewedBy,admin,test2'); // 测试评审用例 2
+r($testcase->reviewTest($caseIDList[2], $case3)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 3
+r($testcase->reviewTest($caseIDList[3], $case4)) && p('0:field,old,new') && e('reviewedBy,admin,test4'); // 测试评审用例 4
+r($testcase->reviewTest($caseIDList[4], $case5)) && p('0:field,old,new') && e('status,wait,normal'); // 测试评审用例 5
+system("./ztest init");
diff --git a/test/model/testcase/synccase2project.php b/test/model/testcase/synccase2project.php
new file mode 100755
index 0000000000..71a53dddfa
--- /dev/null
+++ b/test/model/testcase/synccase2project.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+syncCase2Project();
+cid=1
+pid=1
+
+*/
+
+$caseIDList = array(1, 5, 9, 13, 17, 2);
+
+$testcase = new testcaseTest();
+
+r($testcase->syncCase2ProjectTest($caseIDList[0])) && p() && e('2'); // 测试同步用例 1 到关联项目中
+r($testcase->syncCase2ProjectTest($caseIDList[1])) && p() && e('2'); // 测试同步用例 2 到关联项目中
+r($testcase->syncCase2ProjectTest($caseIDList[2])) && p() && e('2'); // 测试同步用例 3 到关联项目中
+r($testcase->syncCase2ProjectTest($caseIDList[3])) && p() && e('2'); // 测试同步用例 4 到关联项目中
+r($testcase->syncCase2ProjectTest($caseIDList[4])) && p() && e('2'); // 测试同步用例 5 到关联项目中
+system("./ztest init");
diff --git a/test/model/testcase/update.php b/test/model/testcase/update.php
new file mode 100755
index 0000000000..7fe154abc0
--- /dev/null
+++ b/test/model/testcase/update.php
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+*/
+
+$changeTitle = array('title' => '修改后的名称');
+$changePrecondition = array('precondition' => '修改后的前置条件');
+$changeStatus = array('status' => 'normal');
+$changePri = array('pri' => '3');
+
+$testcase = new testcaseTest();
+
+r($testcase->updateTest($changeTitle)) && p('0:field,old,new') && e('title,这个是测试用例1,修改后的名称'); // 测试修改标题
+r($testcase->updateTest($changeTitle)) && p('0:field,old,new') && e('没有数据更新'); // 测试重复修改标题
+r($testcase->updateTest($changePrecondition)) && p('0:field,old,new') && e('precondition,这是前置条件1,修改后的前置条件'); // 测试修改前置条件
+r($testcase->updateTest($changeStatus)) && p('0:field,old,new') && e('status,wait,normal'); // 测试修改状态
+r($testcase->updateTest($changePri)) && p('0:field,old,new') && e('pri,1,3'); // 测试修改优先级
+system("./ztest init");
diff --git a/test/model/testcase/updatecase2project.php b/test/model/testcase/updatecase2project.php
new file mode 100755
index 0000000000..169881869b
--- /dev/null
+++ b/test/model/testcase/updatecase2project.php
@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+updateCase2Project();
+cid=1
+pid=1
+
+*/
+
+$caseIDList = array('1', '3', '5', '7', '9');
+$objectTypeList = array('product', 'story');
+$objectIDList = array('2', '1', '6', '2');
+
+$testcase = new testcaseTest();
+
+r($testcase->updateCase2ProjectTest($caseIDList[0], $objectTypeList[0], $objectIDList[0])) && p('0:project,product,case') && e('101,2,1'); // 测试修改用例 1 产品
+r($testcase->updateCase2ProjectTest($caseIDList[0], $objectTypeList[1], $objectIDList[2])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('101,2,1;12,1,1;102,1,1'); // 测试修改用例 1 需求
+r($testcase->updateCase2ProjectTest($caseIDList[1], $objectTypeList[0], $objectIDList[0])) && p('0:project,product,case') && e('101,2,3'); // 测试修改用例 3 产品
+r($testcase->updateCase2ProjectTest($caseIDList[1], $objectTypeList[1], $objectIDList[2])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('101,2,3;12,1,3;102,1,3'); // 测试修改用例 3 需求
+r($testcase->updateCase2ProjectTest($caseIDList[2], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('102,1,5'); // 测试修改用例 5 产品
+r($testcase->updateCase2ProjectTest($caseIDList[2], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('102,1,5;11,2,5;101,2,5'); // 测试修改用例 5 需求
+r($testcase->updateCase2ProjectTest($caseIDList[3], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('102,1,7'); // 测试修改用例 7 产品
+r($testcase->updateCase2ProjectTest($caseIDList[3], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('102,1,7;11,2,7;101,2,7'); // 测试修改用例 7 需求
+r($testcase->updateCase2ProjectTest($caseIDList[4], $objectTypeList[0], $objectIDList[1])) && p('0:project,product,case') && e('103,1,9'); // 测试修改用例 9 产品
+r($testcase->updateCase2ProjectTest($caseIDList[4], $objectTypeList[1], $objectIDList[3])) && p('0:project,product,case;1:project,product,case;2:project,product,case') && e('103,1,9;11,3,9;101,3,9'); // 测试修改用例 9 需求
+system("./ztest init");
diff --git a/test/model/testtask/activate.php b/test/model/testtask/activate.php
new file mode 100644
index 0000000000..b0dd7a65d7
--- /dev/null
+++ b/test/model/testtask/activate.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+activate();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->activateTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/batchrun.php b/test/model/testtask/batchrun.php
new file mode 100644
index 0000000000..e6432d9995
--- /dev/null
+++ b/test/model/testtask/batchrun.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+batchRun();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->batchRunTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/block.php b/test/model/testtask/block.php
new file mode 100644
index 0000000000..9389ae2600
--- /dev/null
+++ b/test/model/testtask/block.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+block();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->blockTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/close.php b/test/model/testtask/close.php
new file mode 100644
index 0000000000..6118e0e800
--- /dev/null
+++ b/test/model/testtask/close.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+close();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->closeTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/create.php b/test/model/testtask/create.php
new file mode 100644
index 0000000000..580fe3c374
--- /dev/null
+++ b/test/model/testtask/create.php
@@ -0,0 +1,39 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+$normalTask['product'] = 1;
+$normalTask['execution'] = 200;
+$normalTask['build'] = 11;
+$normalTask['type'] = 'system';
+$normalTask['owner'] = 'test10';
+$normalTask['pri'] = 3;
+$normalTask['begin'] = '2022-03-05';
+$normalTask['end'] = '2022-09-05';
+$normalTask['status'] = 'wait';
+$normalTask['name'] = '新增测试单';
+$normalTask['desc'] = '新增测试单的描述详情';
+
+$emptyNameTask = $normalTask;
+$emptyNameTask['name'] = '';
+
+$beginGtEndTask = $normalTask;
+$beginGtEndTask['begin'] = '2022-10-05';
+
+r($testtask->create(11, $normalTask)) && p('id,name,execution,product,type') && e('11,新增测试报告,200,1,system'); // 新增一个正常的测试单
+r($testtask->create(12, $emptyNameTask)) && p('name:0') && e('『名称』不能为空。'); // 新增一个名称为空的测试单
+r($testtask->create(13, $beginGtEndTask)) && p('end:0') && e('『结束日期』应当不小于『2022-10-05』。'); // 新增一个结束日期小于开始日期的测试单
+
+system('./ztest init');
diff --git a/test/model/testtask/createresult.php b/test/model/testtask/createresult.php
new file mode 100644
index 0000000000..86b7d104d2
--- /dev/null
+++ b/test/model/testtask/createresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+createResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->createResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/getalllinkablecases.php b/test/model/testtask/getalllinkablecases.php
new file mode 100644
index 0000000000..d497fe4d0f
--- /dev/null
+++ b/test/model/testtask/getalllinkablecases.php
@@ -0,0 +1,30 @@
+#!/usr/bin/env php
+getAllLinkableCases();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+$tester->app->loadClass('pager', $static = true);
+
+$task1 = $tester->testtask->getById(1);
+$task2 = $tester->testtask->getById(2);
+$pager = new pager(0, 10, 1);
+
+$cases1 = $tester->testtask->getAllLinkableCases($task1, '1 = 1', '', $pager);
+$cases2 = $tester->testtask->getAllLinkableCases($task2, '1 = 1', '', null);
+$cases3 = $tester->testtask->getAllLinkableCases($task2, '1 = 1', '410,408', null);
+$cases4 = $tester->testtask->getAllLinkableCases($task2, 'id < 100', '410,408', null);
+
+r(count($cases1)) && p() && e('10'); // 获取可关联到测试单1的用例列表,每页10条,查看数量
+r(count($cases2)) && p() && e('307'); // 获取可关联到测试单2的用例列表,查看数量
+r(count($cases3)) && p() && e('305'); // 获取可关联到测试单2的用例列表,传入已关联的用例ID,查看数量
+r(count($cases4)) && p() && e('74'); // 获取可关联到测试单2的用例列表,传入sql语句,查看数量
diff --git a/test/model/testtask/getbuginfo.php b/test/model/testtask/getbuginfo.php
new file mode 100644
index 0000000000..59e2335d35
--- /dev/null
+++ b/test/model/testtask/getbuginfo.php
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+getBugInfo();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$task1 = $tester->testtask->getBugInfo(1, 1);
+$task2 = $tester->testtask->getBugInfo(2, 2);
+
+r(count($task1)) && p() && e('8'); // 查看根据测试单的ID获取到的数据数量
+r($task1['bugSeverityGroups']) && p('1:name,value') && e('1,1'); // 查看根据测试单的ID获取到的数据数量
+r($task1['bugStatusGroups']) && p('active:name,value') && e('激活,1'); // 查看根据测试单的ID获取到的数据数量
+
+r(count($task2)) && p() && e('8'); // 查看根据测试单的ID获取到的数据数量
+r($task2['bugSeverityGroups']) && p('2:name,value') && e('2,1'); // 查看根据测试单的ID获取到的数据数量
+r($task2['bugOpenedByGroups']) && p('admin:name,value') && e('admin,1'); // 查看根据测试单的ID获取到的数据数量
diff --git a/test/model/testtask/getbyid.php b/test/model/testtask/getbyid.php
new file mode 100644
index 0000000000..83b0917ed6
--- /dev/null
+++ b/test/model/testtask/getbyid.php
@@ -0,0 +1,20 @@
+#!/usr/bin/env php
+getById();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+r($tester->testtask->getById(0)) && p('') && e('0'); // 获取ID为0的测试单,返回空
+r($tester->testtask->getById(1)) && p('name,buildName,desc,begin,end') && e('测试单1,执行版本版本11,这是测试单描述1,2022-04-08,2022-04-15'); // 获取ID为1的测试单的详细信息
+r($tester->testtask->getById(2)) && p('name,buildName,desc,begin,end') && e('测试单2,执行版本版本12,这是测试单描述2,2022-04-08,2022-04-15'); // 获取ID为2的测试单的详细信息
+r($tester->testtask->getById(3)) && p('name,buildName,desc,begin,end') && e('测试单3,执行版本版本13,这是测试单描述3,2022-04-08,2022-04-15'); // 获取ID为3的测试单的详细信息
diff --git a/test/model/testtask/getbylist.php b/test/model/testtask/getbylist.php
new file mode 100644
index 0000000000..415921da8c
--- /dev/null
+++ b/test/model/testtask/getbylist.php
@@ -0,0 +1,20 @@
+#!/usr/bin/env php
+getByList();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$taskIdList = array(1, 2, 3, 4, 5);
+
+r(count($tester->testtask->getByList($taskIdList))) && p() && e('5'); // 查看按照ID列表获取的测试单的数量
+r($tester->testtask->getByList($taskIdList)) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看按照ID列表获取的测试单的详情
diff --git a/test/model/testtask/getbyuser.php b/test/model/testtask/getbyuser.php
new file mode 100644
index 0000000000..79f1eb22c6
--- /dev/null
+++ b/test/model/testtask/getbyuser.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getByUser();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+r(count($tester->testtask->getByUser('user3'))) && p() && e('1'); // 获取用户user3的测试单数量
+r(count($tester->testtask->getByUser('user4'))) && p() && e('1'); // 获取用户user4的测试单数量
+r(count($tester->testtask->getByUser('user5'))) && p() && e('1'); // 获取用户user5的测试单数量
+r(count($tester->testtask->getByUser('user6'))) && p() && e('1'); // 获取用户user6的测试单数量
+r($tester->testtask->getByUser('user3')) && p('0:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 获取用户user3的测试单详细信息
+r($tester->testtask->getByUser('user4')) && p('0:name,type,status,begin,end') && e('测试单2,,doing,2022-04-08,2022-04-15'); // 获取用户user4的测试单详细信息
+r($tester->testtask->getByUser('user5')) && p('0:name,type,status,begin,end') && e('测试单3,,done,2022-04-08,2022-04-15'); // 获取用户user5的测试单详细信息
+r($tester->testtask->getByUser('user6')) && p('0:name,type,status,begin,end') && e('测试单4,,blocked,2022-04-08,2022-04-15'); // 获取用户user6的测试单详细信息
diff --git a/test/model/testtask/getdataoftesttaskpermodule.php b/test/model/testtask/getdataoftesttaskpermodule.php
new file mode 100644
index 0000000000..0afd473dc8
--- /dev/null
+++ b/test/model/testtask/getdataoftesttaskpermodule.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getDataOfTestTaskPerModule();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$result0 = $tester->testtask->getDataOfTestTaskPerModule(0);
+$result1 = $tester->testtask->getDataOfTestTaskPerModule(1);
+$result2 = $tester->testtask->getDataOfTestTaskPerModule(2);
+
+r($result0) && p() && e('0'); // 获取测试单0的模块分组
+r($result1[0]) && p('name,value') && e('/,4'); // 获取测试单1模块分组,查看各个模块的数量
+r($result2[0]) && p('name,value') && e('/,4'); // 获取测试单2模块分组,查看各个模块的数量
diff --git a/test/model/testtask/getdataoftesttaskperrunner.php b/test/model/testtask/getdataoftesttaskperrunner.php
new file mode 100644
index 0000000000..afb2a9484c
--- /dev/null
+++ b/test/model/testtask/getdataoftesttaskperrunner.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+getDataOfTestTaskPerRunner();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$result0 = $tester->testtask->getDataOfTestTaskPerRunner(0);
+$result1 = $tester->testtask->getDataOfTestTaskPerRunner(1);
+$result2 = $tester->testtask->getDataOfTestTaskPerRunner(2);
+
+r($result0) && p() && e('0'); // 获取测试单0的执行人分组
+r(current($result1)) && p('name,value') && e('未执行,4'); // 获取测试单1执行人分组,查看各个执行人的执行数量
+r(current($result2)) && p('name,value') && e('未执行,4'); // 获取测试单2执行人分组,查看各个执行人的执行数量
diff --git a/test/model/testtask/getdataoftesttaskperrunresult.php b/test/model/testtask/getdataoftesttaskperrunresult.php
new file mode 100644
index 0000000000..f950c7a5a2
--- /dev/null
+++ b/test/model/testtask/getdataoftesttaskperrunresult.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+getDataOfTestTaskPerRunResult();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$result0 = $tester->testtask->getDataOfTestTaskPerRunResult(0);
+$result1 = $tester->testtask->getDataOfTestTaskPerRunResult(1);
+$result2 = $tester->testtask->getDataOfTestTaskPerRunResult(2);
+
+r($result0) && p() && e('0'); // 获取测试单0的执行结果
+r($result1) && p('pass:value') && e('2'); // 获取测试单1的成功执行结果
+r($result1) && p('fail:value') && e('2'); // 获取测试单1的失败执行结果
+r($result2) && p('pass:value') && e('2'); // 获取测试单2的成功执行结果
+r($result2) && p('fail:value') && e('2'); // 获取测试单2的失败执行结果
diff --git a/test/model/testtask/getdataoftesttaskpertype.php b/test/model/testtask/getdataoftesttaskpertype.php
new file mode 100644
index 0000000000..d2f5e37216
--- /dev/null
+++ b/test/model/testtask/getdataoftesttaskpertype.php
@@ -0,0 +1,30 @@
+#!/usr/bin/env php
+getDataOfTestTaskPerType();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$result0 = $tester->testtask->getDataOfTestTaskPerType(0);
+$result1 = $tester->testtask->getDataOfTestTaskPerType(1);
+$result2 = $tester->testtask->getDataOfTestTaskPerType(2);
+
+r($result0) && p() && e('0'); // 获取测试单0的类型分组
+r($result1) && p('config:value') && e('1'); // 获取测试单1的config类型数量
+r($result1) && p('feature:value') && e('1'); // 获取测试单1的feature类型数量
+r($result1) && p('install:value') && e('1'); // 获取测试单1的install类型数量
+r($result1) && p('performance:value') && e('1'); // 获取测试单1的performance类型数量
+r($result2) && p('other:value') && e('1'); // 获取测试单2的other类型数量
+r($result2) && p('security:value') && e('1'); // 获取测试单2的security类型数量
+r($result2) && p('feature:value') && e('1'); // 获取测试单2的feature类型数量
+r($result2) && p('interface:value') && e('1'); // 获取测试单2的interface类型数量
diff --git a/test/model/testtask/getexecutiontasks.php b/test/model/testtask/getexecutiontasks.php
new file mode 100644
index 0000000000..c695907ba7
--- /dev/null
+++ b/test/model/testtask/getexecutiontasks.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+getExecutionTasks();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$execution101Tasks = $tester->testtask->getExecutionTasks(101);
+$execution110Tasks = $tester->testtask->getExecutionTasks(110);
+$execution120Tasks = $tester->testtask->getExecutionTasks(120);
+
+r(count($execution101Tasks)) && p() && e('1'); // 查看迭代101下的所有测试单数量
+r(count($execution110Tasks)) && p() && e('1'); // 查看迭代110下的所有测试单数量
+r(count($execution120Tasks)) && p() && e('0'); // 查看迭代120下的所有测试单数量
+r($execution101Tasks) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看迭代101下的测试单1的详细信息
+r($execution110Tasks) && p('10:name,type,status,begin,end') && e('测试单10,,doing,2022-04-08,2022-04-15'); // 查看迭代110下的所有测试单10的详细信息
diff --git a/test/model/testtask/getlinkablecasesbybug.php b/test/model/testtask/getlinkablecasesbybug.php
new file mode 100644
index 0000000000..621150268a
--- /dev/null
+++ b/test/model/testtask/getlinkablecasesbybug.php
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+getLinkableCasesByBug();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+$tester->app->loadClass('pager', $static = true);
+
+$task1 = $tester->testtask->getById(1);
+$task2 = $tester->testtask->getById(2);
+$pager = new pager(0, 10, 1);
+
+$cases1 = $tester->testtask->getLinkableCasesByBug(1, $task1, '1 = 1', '', $pager);
+$cases2 = $tester->testtask->getLinkableCasesByBug(2, $task2, '1 = 1', '', $pager);
+
+r(count($cases1)) && p() && e('0'); // 通过测试单1关联的版本下的Bug,获取可关联到测试单1的用例数量
+r(count($cases2)) && p() && e('0'); // 通过测试单2关联的版本下的Bug,获取可关联到测试单2的用例数量
diff --git a/test/model/testtask/getlinkablecasesbystory.php b/test/model/testtask/getlinkablecasesbystory.php
new file mode 100644
index 0000000000..6ff58fcffb
--- /dev/null
+++ b/test/model/testtask/getlinkablecasesbystory.php
@@ -0,0 +1,26 @@
+#!/usr/bin/env php
+getLinkableCasesByStory();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+$tester->app->loadClass('pager', $static = true);
+
+$task1 = $tester->testtask->getById(1);
+$task2 = $tester->testtask->getById(2);
+$pager = new pager(0, 10, 1);
+
+$cases1 = $tester->testtask->getLinkableCasesByStory(1, $task1, '1 = 1', '', $pager);
+$cases2 = $tester->testtask->getLinkableCasesByStory(2, $task2, '1 = 1', '', $pager);
+
+r(count($cases1)) && p() && e('0'); // 通过测试单1关联的版本下的需求,获取可关联到测试单1的用例数量
+r(count($cases2)) && p() && e('0'); // 通过测试单2关联的版本下的需求,获取可关联到测试单2的用例数量
diff --git a/test/model/testtask/getlinkablecasesbysuite.php b/test/model/testtask/getlinkablecasesbysuite.php
new file mode 100644
index 0000000000..7090ae1767
--- /dev/null
+++ b/test/model/testtask/getlinkablecasesbysuite.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+getLinkableCasesBySuite();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+$tester->app->loadClass('pager', $static = true);
+
+$task1 = $tester->testtask->getById(1);
+$task2 = $tester->testtask->getById(2);
+$pager = new pager(0, 10, 1);
+
+$cases1 = $tester->testtask->getLinkableCasesBySuite(1, $task1, '1 = 1', 1, '', $pager);
+$cases2 = $tester->testtask->getLinkableCasesBySuite(2, $task2, '1 = 1', 3, '', $pager);
+
+r(count($cases1)) && p() && e('1'); // 根据测试套件1获取测试单1可关联的用例数量
+r(count($cases2)) && p() && e('1'); // 根据测试套件2获取测试单2可关联的用例数量
+r($cases1) && p('0:id,title,status,type') && e('2,这个是测试用例2,normal,performance'); // 根据测试套件1获取测试单1可关联的用例详情
+r($cases2) && p('0:id,title,status,type') && e('6,这个是测试用例6,normal,interface'); // 根据测试套件2获取测试单2可关联的用例详情
diff --git a/test/model/testtask/getlinkablecasesbytesttask.php b/test/model/testtask/getlinkablecasesbytesttask.php
new file mode 100644
index 0000000000..00b35fb497
--- /dev/null
+++ b/test/model/testtask/getlinkablecasesbytesttask.php
@@ -0,0 +1,32 @@
+#!/usr/bin/env php
+getLinkableCasesByTestTask();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+$tester->app->loadClass('pager', $static = true);
+
+$task1 = $tester->testtask->getById(1);
+$task2 = $tester->testtask->getById(2);
+$pager = new pager(0, 10, 1);
+
+$cases1 = $tester->testtask->getLinkableCasesByTestTask(1, array(2), '1 = 1', $pager);
+$cases2 = $tester->testtask->getLinkableCasesByTestTask(2, '', '1 = 1', $pager);
+$cases3 = $tester->testtask->getLinkableCasesByTestTask(3, '', '1 = 1', $pager);
+
+r(count($cases1)) && p() && e('2'); // 直接获取测试单1可关联的用例数量,排除掉ID为2的用例,查看数量
+r(count($cases2)) && p() && e('3'); // 直接获取测试单2可关联的用例数量,查看数量
+r(count($cases3)) && p() && e('3'); // 直接获取测试单3可关联的用例数量,查看数量
+r($cases1) && p('0:id,title,type,stage') && e('3,这个是测试用例3,config,intergrate'); // 直接获取测试单1可关联的用例数量,排除掉ID为2的用例,查看获取到的第一个用例的详情
+r($cases2) && p('0:id,title,type,stage') && e('6,这个是测试用例6,interface,bvt'); // 直接获取测试单2可关联的用例数量,查看获取到的第一个用例的详情
+r($cases3) && p('0:id,title,type,stage') && e('10,这个是测试用例10,config,system'); // 直接获取测试单3可关联的用例数量,查看获取到的第一个用例的详情
diff --git a/test/model/testtask/getpairs.php b/test/model/testtask/getpairs.php
new file mode 100644
index 0000000000..c4cfb4428c
--- /dev/null
+++ b/test/model/testtask/getpairs.php
@@ -0,0 +1,28 @@
+#!/usr/bin/env php
+getPairs();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$appendIdList = array(40, 45, 50);
+
+$taskPairs1 = $tester->testtask->getPairs(1);
+$taskPairs2 = $tester->testtask->getPairs(1, 101);
+$taskPairs3 = $tester->testtask->getPairs(1, 101, $appendIdList);
+
+r(count($taskPairs1)) && p() && e(''); // 获取产品1下的测试单的数量
+r(count($taskPairs2)) && p() && e(''); // 获取产品1下的测试单的数量
+r(count($taskPairs3)) && p() && e(''); // 获取产品1下的测试单的数量
+r($taskPairs1) && p() && e(''); // 获取产品1下的测试单的数量
+r($taskPairs2) && p() && e(''); // 获取产品1下的测试单的数量
+r($taskPairs3) && p() && e(''); // 获取产品1下的测试单的数量
diff --git a/test/model/testtask/getproducttasks.php b/test/model/testtask/getproducttasks.php
new file mode 100644
index 0000000000..59008cfa3a
--- /dev/null
+++ b/test/model/testtask/getproducttasks.php
@@ -0,0 +1,28 @@
+#!/usr/bin/env php
+getProductTasks();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$localScope = array('local', 'totalstatus');
+$allScope = array('all', 'totalstatus');
+
+$tasks1 = $tester->testtask->getProductTasks(1, 'all', 'id_desc', null, $localScope);
+$tasks2 = $tester->testtask->getProductTasks(2, 'all', 'id_asc', null, $allScope);
+$tasks3 = $tester->testtask->getProductTasks(2, 'all', 'id_asc', null, $allScope, '2023-01-01');
+
+r(count($tasks1)) && p() && e('2'); // 查看产品1下的测试单的数量
+r(count($tasks2)) && p() && e('11'); // 查看系统中所有测试单的数量
+r(count($tasks3)) && p() && e('0'); // 查看系统中所有截止日期大于2023-01-01的测试单的数量
+r($tasks1) && p('11:name,type,begin,end') && e('新增测试报告,system,2022-03-05,2022-09-05'); // 查看ID为11的测试单的详细信息
+r($tasks2) && p('3:name,type,begin,end') && e('测试单3,,2022-04-08,2022-04-15'); // 查看ID为3的测试单的详细信息
diff --git a/test/model/testtask/getproductunittasks.php b/test/model/testtask/getproductunittasks.php
new file mode 100644
index 0000000000..004a85bb86
--- /dev/null
+++ b/test/model/testtask/getproductunittasks.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+getProductUnitTasks();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$tasks = $tester->testtask->getProductUnitTasks(1, 'all');
+
+r($testtask->getProductUnitTasksTest()) && p() && e();
diff --git a/test/model/testtask/getprojecttasks.php b/test/model/testtask/getprojecttasks.php
new file mode 100644
index 0000000000..f712177ff5
--- /dev/null
+++ b/test/model/testtask/getprojecttasks.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+getProjectTasks();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$project11Tasks = $tester->testtask->getProjectTasks(11);
+$project20Tasks = $tester->testtask->getProjectTasks(20);
+$project100Tasks = $tester->testtask->getProjectTasks(100);
+
+r(count($project11Tasks)) && p() && e('1'); // 查看项目11下的所有测试单数量
+r(count($project20Tasks)) && p() && e('1'); // 查看项目20下的所有测试单数量
+r(count($project100Tasks)) && p() && e('0'); // 查看项目100下的所有测试单数量
+r($project11Tasks) && p('1:name,type,status,begin,end') && e('测试单1,,wait,2022-04-08,2022-04-15'); // 查看项目11下的测试单1的详细信息
+r($project20Tasks) && p('10:name,type,status,begin,end') && e('测试单10,,doing,2022-04-08,2022-04-15'); // 查看项目20下的所有测试单10的详细信息
diff --git a/test/model/testtask/getrelatedtesttasks.php b/test/model/testtask/getrelatedtesttasks.php
new file mode 100644
index 0000000000..171a23b1f4
--- /dev/null
+++ b/test/model/testtask/getrelatedtesttasks.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+getRelatedTestTasks();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$tester->loadModel('testtask');
+
+$tasks1 = $tester->testtask->getRelatedTestTasks(1, 1);
+$tasks2 = $tester->testtask->getRelatedTestTasks(1, 0);
+$tasks3 = $tester->testtask->getRelatedTestTasks(2, 0);
+
+r(count($tasks1)) && p() && e('0'); //查看产品1下相关的测试单,排除掉测试单1,查看数量
+r(count($tasks2)) && p() && e('1'); //查看产品1下相关的测试单,不排除任何测试单,查看数量
+r(count($tasks3)) && p() && e('1'); //查看产品2下相关的测试单,不排除任何测试单,查看数量
+r($tasks2) && p('1') && e('测试单1'); //查看产品2下相关的测试单,不排除任何测试单,查看数量
+r($tasks3) && p('2') && e('测试单2'); //查看产品2下相关的测试单,不排除任何测试单,查看数量
diff --git a/test/model/testtask/getresults.php b/test/model/testtask/getresults.php
new file mode 100644
index 0000000000..c94bb37b9d
--- /dev/null
+++ b/test/model/testtask/getresults.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getResults();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getResultsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/getrunbyid.php b/test/model/testtask/getrunbyid.php
new file mode 100644
index 0000000000..8c0a618b55
--- /dev/null
+++ b/test/model/testtask/getrunbyid.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getRunById();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getRunByIdTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/getruns.php b/test/model/testtask/getruns.php
new file mode 100644
index 0000000000..fd2c2f5ebc
--- /dev/null
+++ b/test/model/testtask/getruns.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getRuns();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getRunsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/gettaskcases.php b/test/model/testtask/gettaskcases.php
new file mode 100644
index 0000000000..5bfc555b8c
--- /dev/null
+++ b/test/model/testtask/gettaskcases.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getTaskCases();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getTaskCasesTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/gettoandcclist.php b/test/model/testtask/gettoandcclist.php
new file mode 100644
index 0000000000..83f0d44ce5
--- /dev/null
+++ b/test/model/testtask/gettoandcclist.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getToAndCcList();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getToAndCcListTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/getuserruns.php b/test/model/testtask/getuserruns.php
new file mode 100644
index 0000000000..fa13907f6e
--- /dev/null
+++ b/test/model/testtask/getuserruns.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getUserRuns();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getUserRunsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/getusertesttaskpairs.php b/test/model/testtask/getusertesttaskpairs.php
new file mode 100644
index 0000000000..0eba1ec5f3
--- /dev/null
+++ b/test/model/testtask/getusertesttaskpairs.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+getUserTestTaskPairs();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->getUserTestTaskPairsTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/importunitresult.php b/test/model/testtask/importunitresult.php
new file mode 100644
index 0000000000..1bdf1f153c
--- /dev/null
+++ b/test/model/testtask/importunitresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+importUnitResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->importUnitResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/linkcase.php b/test/model/testtask/linkcase.php
new file mode 100644
index 0000000000..945753da2c
--- /dev/null
+++ b/test/model/testtask/linkcase.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+linkCase();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->linkCaseTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/mergechartoption.php b/test/model/testtask/mergechartoption.php
new file mode 100644
index 0000000000..ac81f6b450
--- /dev/null
+++ b/test/model/testtask/mergechartoption.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+mergeChartOption();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->mergeChartOptionTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/parsecppxmlresult.php b/test/model/testtask/parsecppxmlresult.php
new file mode 100644
index 0000000000..32f93a51bb
--- /dev/null
+++ b/test/model/testtask/parsecppxmlresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+parseCppXMLResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->parseCppXMLResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/parsexmlresult.php b/test/model/testtask/parsexmlresult.php
new file mode 100644
index 0000000000..152284d716
--- /dev/null
+++ b/test/model/testtask/parsexmlresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+parseXMLResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->parseXMLResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/parseztffuncresult.php b/test/model/testtask/parseztffuncresult.php
new file mode 100644
index 0000000000..4b342e240d
--- /dev/null
+++ b/test/model/testtask/parseztffuncresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+parseZTFFuncResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->parseZTFFuncResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/parseztfunitresult.php b/test/model/testtask/parseztfunitresult.php
new file mode 100644
index 0000000000..7b46b6ea48
--- /dev/null
+++ b/test/model/testtask/parseztfunitresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+parseZTFUnitResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->parseZTFUnitResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/printcell.php b/test/model/testtask/printcell.php
new file mode 100644
index 0000000000..8cebbe25cd
--- /dev/null
+++ b/test/model/testtask/printcell.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+printCell();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->printCellTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/processautoresult.php b/test/model/testtask/processautoresult.php
new file mode 100644
index 0000000000..b0e87cc8e2
--- /dev/null
+++ b/test/model/testtask/processautoresult.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+processAutoResult();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->processAutoResultTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/start.php b/test/model/testtask/start.php
new file mode 100644
index 0000000000..7f4173178c
--- /dev/null
+++ b/test/model/testtask/start.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+start();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->startTest()) && p() && e();
\ No newline at end of file
diff --git a/test/model/testtask/update.php b/test/model/testtask/update.php
new file mode 100644
index 0000000000..089ba79348
--- /dev/null
+++ b/test/model/testtask/update.php
@@ -0,0 +1,17 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+*/
+
+$testtask = new testtaskTest();
+
+r($testtask->updateTest()) && p() && e();
\ No newline at end of file
diff --git a/test/ztest b/test/ztest
index 156a8839c3..4b11c90231 100755
--- a/test/ztest
+++ b/test/ztest
@@ -22,6 +22,9 @@ switch($argv[1])
case 'program':
ztfRun('model/program');
break;
+ case 'programplan':
+ ztfRun('model/programplan');
+ break;
case 'product':
ztfRun('model/product');
break;
@@ -73,6 +76,12 @@ switch($argv[1])
case 'cron':
ztfRun('model/cron');
break;
+ case 'stage':
+ ztfRun('model/stage');
+ break;
+ case 'design':
+ ztfRun('model/design');
+ break;
case 'model':
ztfRun('model');
break;
diff --git a/www/js/zui/min.js b/www/js/zui/min.js
index c0fac09be7..16baf9bd1e 100644
--- a/www/js/zui/min.js
+++ b/www/js/zui/min.js
@@ -1,5 +1,5 @@
/*!
- * ZUI: ZUI for Zentao - v1.10.0 - 2022-04-06
+ * ZUI: ZUI for Zentao - v1.10.0 - 2022-04-07
* http://openzui.com
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2022 cnezsoft.com; Licensed MIT
@@ -41,8 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
*/
-function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=c.substr(0,l)+""+c.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(h),c=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+=' '+c.substr(0,l)+""+c.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("",i),this.is_multiple?this.container.html(''):(this.container.html(''+this.default_text+''),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),c=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+c+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('- '+this.results_none_found+' ""
'),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,c;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=s.length;l ",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o,
-selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,c=this.options,h=this,d=c.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof c.checkFunc?c.checkFunc:null,g="function"==typeof c.rangeFunc?c.rangeFunc:null,m=!1,v=null,y="mousedown"+p,b=function(){a&&h.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(f){var s=f.call(h,{intersect:n,target:e,range:a,targetRange:i});s===!0?h.select(e):s===!1&&h.unselect(e)}else n?h.select(e):h.multiKey||h.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},h.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=0,C=function(e){x&&(t.zui.clearAsap||clearTimeout)(x),x=(t.zui.asap||setTimeout)(function(){x=0,w(e)},0)},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()}),e.preventDefault())},k=function(o){if(m)return _(o);var a=t.zui.getMouseButtonCode(c.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||h.altKey||3===o.which||h.callEvent("start",o)===!1)){var s=h.$children=h.$.find(c.selector);s.addClass("selectable-item");var r=h.multiKey?"multi":c.clickBehavior;if("single"===r&&h.unselect(),c.listenClick&&("multi"===r?h.toggle(o.target):"single"===r?h.select(o.target):"toggle"===r&&h.toggle(o.target,null,function(t){h.unselect()})),h.callEvent("startDrag",o)===!1)return void h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+p,C).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(y,_)},10),o.preventDefault()}},T=c.container&&"default"!==c.container?t(c.container):this.$;c.trigger?T.on(y,c.trigger,k):T.on(y,k),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?h.multiKey=e:18===e&&(h.altKey=!0)}).on("keyup",function(t){h.multiKey=!1,h.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,c=o.dragCssClass,h=o.targetSelector,d=o.reverse,u=o.moveDirection,p=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};h||p(),n.droppable({handle:o.trigger,target:h?h:r?s+","+r:s,selector:s,container:o.container||n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,noShadow:o.noShadow,dropOnMouseleave:o.dropOnMouseleave,stopPropagation:o.stopPropagation,start:function(t){if(c&&t.element.addClass(c),e=!1,i.$element=t.element,!u&&t.targets.length>1){var n=t.targets.eq(0).offset(),o=t.targets.eq(1).offset();u=Math.abs(n.left-o.left)>Math.abs(n.top-o.top)?"h":"v"}p(),i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,c=t.target,h=r&&c.is(r);if(h)return void(c.children(s).filter(".dragging").length||(c.append(o),p(b),i.trigger(a,{list:b,element:o})));var f=o.data(a),g=c.data(a);if(f===g)return;var m="h"===u?"left":"top",v=t.mouseOffset[m]-t.lastMouseOffset[m];if(0===v)return;var y=f>g?d:!d;if(v<0&&y||v>0&&!y)return;c[y?"after":"before"](o),e=!0;var b=i.getItems(1);p(b),i.trigger(a,{list:b,element:o})}},finish:function(t){c&&t.element&&t.element.removeClass(c),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e}),i.$element=null}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i,n=this,o=n.options.targetSelector;return i=o?"function"==typeof o?o(n.$element,n.$):n.$.find(o):n.$.find(n.options.selector),i=i.not(".drag-shadow"),e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";function i(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('');var n=t("").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick);var o=t("").toggleClass("disabled",e.disabled===!0).append(n);return e.items&&o.data("item",e).addClass("dropdown-submenu"),o}function n(e,n,o){var a=o.itemCreator||i,s=typeof e;return"string"===s?e=e.split(","):"function"===s&&(e=e(o)),!!e&&(t.each(e,function(t,e){n.append(a(e,t,o))}),!0)}var o="zui.contextmenu",a={animation:"fade",menuTemplate:''):(this.container.html(''+this.default_text+''),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.val(e.search_field.val()),e.search_field.focus(),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),c=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+c+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('- '+this.results_none_found+' ""
'),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,c;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=s.length;l ",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,
+target:o,selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,c=this.options,h=this,d=c.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof c.checkFunc?c.checkFunc:null,g="function"==typeof c.rangeFunc?c.rangeFunc:null,m=!1,v=null,y="mousedown"+p,b=function(){a&&h.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(f){var s=f.call(h,{intersect:n,target:e,range:a,targetRange:i});s===!0?h.select(e):s===!1&&h.unselect(e)}else n?h.select(e):h.multiKey||h.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},h.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=0,C=function(e){x&&(t.zui.clearAsap||clearTimeout)(x),x=(t.zui.asap||setTimeout)(function(){x=0,w(e)},0)},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()}),e.preventDefault())},k=function(o){if(m)return _(o);var a=t.zui.getMouseButtonCode(c.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||h.altKey||3===o.which||h.callEvent("start",o)===!1)){var s=h.$children=h.$.find(c.selector);s.addClass("selectable-item");var r=h.multiKey?"multi":c.clickBehavior;if("single"===r&&h.unselect(),c.listenClick&&("multi"===r?h.toggle(o.target):"single"===r?h.select(o.target):"toggle"===r&&h.toggle(o.target,null,function(t){h.unselect()})),h.callEvent("startDrag",o)===!1)return void h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+p,C).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(y,_)},10),o.preventDefault()}},T=c.container&&"default"!==c.container?t(c.container):this.$;c.trigger?T.on(y,c.trigger,k):T.on(y,k),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?h.multiKey=e:18===e&&(h.altKey=!0)}).on("keyup",function(t){h.multiKey=!1,h.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,c=o.dragCssClass,h=o.targetSelector,d=o.reverse,u=o.moveDirection,p=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};h||p(),n.droppable({handle:o.trigger,target:h?h:r?s+","+r:s,selector:s,container:o.container||n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,noShadow:o.noShadow,dropOnMouseleave:o.dropOnMouseleave,stopPropagation:o.stopPropagation,start:function(t){if(c&&t.element.addClass(c),e=!1,i.$element=t.element,!u&&t.targets.length>1){var n=t.targets.eq(0).offset(),o=t.targets.eq(1).offset();u=Math.abs(n.left-o.left)>Math.abs(n.top-o.top)?"h":"v"}p(),i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,c=t.target,h=r&&c.is(r);if(h)return void(c.children(s).filter(".dragging").length||(c.append(o),p(b),i.trigger(a,{list:b,element:o})));var f=o.data(a),g=c.data(a);if(f===g)return;var m="h"===u?"left":"top",v=t.mouseOffset[m]-t.lastMouseOffset[m];if(0===v)return;var y=f>g?d:!d;if(v<0&&y||v>0&&!y)return;c[y?"after":"before"](o),e=!0;var b=i.getItems(1);p(b),i.trigger(a,{list:b,element:o})}},finish:function(t){c&&t.element&&t.element.removeClass(c),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e}),i.$element=null}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i,n=this,o=n.options.targetSelector;return i=o?"function"==typeof o?o(n.$element,n.$):n.$.find(o):n.$.find(n.options.selector),i=i.not(".drag-shadow"),e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";function i(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('');var n=t("").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick);var o=t("").toggleClass("disabled",e.disabled===!0).append(n);return e.items&&o.data("item",e).addClass("dropdown-submenu"),o}function n(e,n,o){var a=o.itemCreator||i,s=typeof e;return"string"===s?e=e.split(","):"function"===s&&(e=e(o)),!!e&&(t.each(e,function(t,e){n.append(a(e,t,o))}),!0)}var o="zui.contextmenu",a={animation:"fade",menuTemplate:'
').appendTo("body"));var m=g.find(".contextmenu-menu").empty();m.off("click."+o).on("click."+o,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).off("mouseenter."+o).on("mouseenter."+o,".dropdown-submenu",function(e){var i=t(this),o=i.data("item"),a=i.children(".dropdown-menu");if(o&&(o.items&&(a.length||(a=t(d.menuTemplate).appendTo(i)),n(o.items,a,d)),i.removeData("item")),a.length){a.removeClass("pull-left").css("top",0);var s=(i[0].getBoundingClientRect(),a[0].getBoundingClientRect()),r=window.innerWidth,l=window.innerHeight;if(s.bottom>l){var c=Math.max(-s.top,l-s.bottom);a.css("top",c)}s.right>r&&a.addClass("pull-left")}}),m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(i,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=n(i,y,d);if(b===!1)return b}var w=d.animation,x=d.duration;w===!0&&(d.animation=w="fade"),p&&(clearTimeout(p),p=null);var C=function(){m.addClass("in"),d.onShown&&d.onShown(),u&&u()};d.onShow&&d.onShow(),g.data("options",{animation:w,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:x});var _=d.x,k=d.y;_===e&&(_=(d.event||d).clientX),_===e&&(_=c),k===e&&(k=(d.event||d).clientY),k===e&&(k=h);var T=window.innerHeight,S=window.innerWidth,y=m.children().first(),D=y.outerWidth(),M=y.outerHeight();if(d.position){var L=d.position({x:_,y:k,width:D,height:M,winHeight:T,winWidth:S},d,m);L&&(_=L.x,k=L.y)}return _=Math.max(0,Math.min(_,S-D)),k=Math.max(0,Math.min(k,T-M)),g.css({left:_,top:k}).show(),m.addClass("open"),w?(m.addClass(w),p=setTimeout(function(){C(),s=!1},10)):(C(),s=!1),r};t.extend(r,{NAME:o,DEFAULTS:a,show:g,hide:f,listenMouse:d,isShow:u}),t.zui({ContextMenu:r});var m=function(e,i){var n=this;n.name=o,n.$=t(e),n.id=t.zui.uuid(),i=n.options=t.extend({trigger:"contextmenu"},r.DEFAULTS,this.$.data(),i);var a=function(t){if("mousedown"!==t.type||2===t.button){if(i.toggleTrigger&&n.isShow())n.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(n.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},s=i.trigger,l=s+"."+o;i.selector?n.$.on(l,i.selector,a):n.$.on(l,a),i.show&&n.show("object"==typeof i.show?i.show:null)};m.prototype.destory=function(){that.$.off("."+o)},m.prototype.hide=function(t){return r.hide(this.id,t)},m.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),r.show(e,i)},m.prototype.isShow=function(){return u(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var i=t(this),n=i.data(o),a="object"==typeof e&&e;n||i.data(o,n=new m(this,a)),"string"==typeof e&&n[e]()})},t.fn.contextmenu.Constructor=m,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var i=t(e.target),n=i.closest('[data-toggle="context-dropdown"]');if(n.length){var a=n.data(o);a||n.contextDropdown({show:!0})}else s||i.closest(".contextmenu").length||f()})}(jQuery,void 0),/*!
+function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=c.substr(0,l)+""+c.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(h),c=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+=' '+c.substr(0,l)+""+c.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("",i),this.is_multiple?this.container.html('
').appendTo("body"));var m=g.find(".contextmenu-menu").empty();m.off("click."+o).on("click."+o,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).off("mouseenter."+o).on("mouseenter."+o,".dropdown-submenu",function(e){var i=t(this),o=i.data("item"),a=i.children(".dropdown-menu");if(o&&(o.items&&(a.length||(a=t(d.menuTemplate).appendTo(i)),n(o.items,a,d)),i.removeData("item")),a.length){a.removeClass("pull-left").css("top",0);var s=(i[0].getBoundingClientRect(),a[0].getBoundingClientRect()),r=window.innerWidth,l=window.innerHeight;if(s.bottom>l){var c=Math.max(-s.top,l-s.bottom);a.css("top",c)}s.right>r&&a.addClass("pull-left")}}),m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(i,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=n(i,y,d);if(b===!1)return b}var w=d.animation,x=d.duration;w===!0&&(d.animation=w="fade"),p&&(clearTimeout(p),p=null);var C=function(){m.addClass("in"),d.onShown&&d.onShown(),u&&u()};d.onShow&&d.onShow(),g.data("options",{animation:w,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:x});var _=d.x,k=d.y;_===e&&(_=(d.event||d).clientX),_===e&&(_=c),k===e&&(k=(d.event||d).clientY),k===e&&(k=h);var T=window.innerHeight,S=window.innerWidth,y=m.children().first(),D=y.outerWidth(),M=y.outerHeight();if(d.position){var L=d.position({x:_,y:k,width:D,height:M,winHeight:T,winWidth:S},d,m);L&&(_=L.x,k=L.y)}return _=Math.max(0,Math.min(_,S-D)),k=Math.max(0,Math.min(k,T-M)),g.css({left:_,top:k}).show(),m.addClass("open"),w?(m.addClass(w),p=setTimeout(function(){C(),s=!1},10)):(C(),s=!1),r};t.extend(r,{NAME:o,DEFAULTS:a,show:g,hide:f,listenMouse:d,isShow:u}),t.zui({ContextMenu:r});var m=function(e,i){var n=this;n.name=o,n.$=t(e),n.id=t.zui.uuid(),i=n.options=t.extend({trigger:"contextmenu"},r.DEFAULTS,this.$.data(),i);var a=function(t){if("mousedown"!==t.type||2===t.button){if(i.toggleTrigger&&n.isShow())n.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(n.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},s=i.trigger,l=s+"."+o;i.selector?n.$.on(l,i.selector,a):n.$.on(l,a),i.show&&n.show("object"==typeof i.show?i.show:null)};m.prototype.destory=function(){that.$.off("."+o)},m.prototype.hide=function(t){return r.hide(this.id,t)},m.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),r.show(e,i)},m.prototype.isShow=function(){return u(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var i=t(this),n=i.data(o),a="object"==typeof e&&e;n||i.data(o,n=new m(this,a)),"string"==typeof e&&n[e]()})},t.fn.contextmenu.Constructor=m,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var i=t(e.target),n=i.closest('[data-toggle="context-dropdown"]');if(n.length){var a=n.data(o);a||n.contextDropdown({show:!0})}else s||i.closest(".contextmenu").length||f()})}(jQuery,void 0),/*!
* jQuery Form Plugin
* version: 4.2.2
* Requires jQuery v1.7.2 or later