From c1f71409f8fef1d5151cc70d4eb55cad5fb5a157 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 11 Aug 2022 16:49:33 +0800 Subject: [PATCH 01/22] * Fix bug #22376. --- .../lite/workflow/ext/view/ui.flow.html.hook.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 extension/lite/workflow/ext/view/ui.flow.html.hook.php diff --git a/extension/lite/workflow/ext/view/ui.flow.html.hook.php b/extension/lite/workflow/ext/view/ui.flow.html.hook.php new file mode 100644 index 0000000000..c7a346d076 --- /dev/null +++ b/extension/lite/workflow/ext/view/ui.flow.html.hook.php @@ -0,0 +1,11 @@ +visions == ',lite,'):?> +dao->select('id')->from(TABLE_WORKFLOWDATASOURCE)->where('code')->like('litefeedback%')->andWhere('vision')->eq('lite')->fetchPairs('id', 'id');?> + + + + From c5522146da19ecaa22884be7572d67bbf0dbb9dd Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 13:12:56 +0800 Subject: [PATCH 02/22] * Fix bug #26325. --- module/user/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/user/model.php b/module/user/model.php index 4e366ef854..83fe7a3f4a 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -798,6 +798,7 @@ class userModel extends model $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); $this->app->user->password = $user->password; $this->app->user->modifyPassword = false; + $_SESSION['user']->password = $user->password; if(!dao::isError()) { if(!empty($this->app->user->modifyPasswordReason)) $this->app->user->modifyPasswordReason = ''; From 698510fadfa88681f9d3d56e0b60458721263ef7 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 13:13:38 +0800 Subject: [PATCH 03/22] * Fix bug #26325. --- module/user/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/user/model.php b/module/user/model.php index 83fe7a3f4a..7fec646510 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -796,9 +796,9 @@ class userModel extends model } $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); + $_SESSION['user']->password = $user->password; $this->app->user->password = $user->password; $this->app->user->modifyPassword = false; - $_SESSION['user']->password = $user->password; if(!dao::isError()) { if(!empty($this->app->user->modifyPasswordReason)) $this->app->user->modifyPasswordReason = ''; From 4da9aac7c3f8276dba16f0b4ac55fe2bba0cc960 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 12 Aug 2022 13:49:10 +0800 Subject: [PATCH 04/22] * Fix bug#26177. --- module/project/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 98d88ee606..57e1968acd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2618,9 +2618,10 @@ class projectModel extends model public function setMenu($objectID) { global $lang; - $project = $this->getByID($objectID); - $model = 'scrum'; + $model = 'scrum'; + $objectID = (empty($objectID) and $this->session->project) ? $this->session->project : $objectID; + $project = $this->getByID($objectID); if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { @@ -2657,7 +2658,6 @@ class projectModel extends model $this->lang->switcherMenu = $this->getSwitcher($objectID, $moduleName, $methodName); $this->saveState($objectID, $this->getPairsByProgram()); - $project = $this->getById($objectID); if(isset($project->acl) and $project->acl == 'open') unset($this->lang->project->menu->settings['subMenu']->whitelist); From f540e5838851be00718416fc1be3af4f92c7b919 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 14:25:29 +0800 Subject: [PATCH 05/22] * Fix bug. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 5c441b0f47..14d8e21126 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -100,7 +100,7 @@ class executionModel extends model include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - if(isset($execution->cal) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); + if(isset($execution->acl) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); if($execution and $execution->lifetime == 'ops') { From 26085d7a41f3c7ea327c1edaf1ecca4155f8480f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 12 Aug 2022 14:56:27 +0800 Subject: [PATCH 06/22] * Operations type execution and story or design type stage do not display story field. --- module/task/control.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 905ee7cdc3..eb7277686d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -438,10 +438,16 @@ class task extends control $customFields[$field] = $this->lang->task->$field; } - if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') unset($customFields['story']); + $showFields = $this->config->task->custom->batchCreateFields; + if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') + { + unset($customFields['story']); + $showFields = str_replace(',story,', ',', ",$showFields,"); + $showFields = trim($showFields, ','); + } $this->view->customFields = $customFields; - $this->view->showFields = $this->config->task->custom->batchCreateFields; + $this->view->showFields = $showFields; if($execution->type == 'kanban') { From c7f587ef5a4d807a8c78795e84b32c71e92b6f87 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 12 Aug 2022 15:05:00 +0800 Subject: [PATCH 07/22] * Fix bug #26359. Optimize detail styles for creating documents. --- module/doc/lang/de.php | 1 + module/doc/lang/en.php | 1 + module/doc/lang/fr.php | 1 + module/doc/lang/zh-cn.php | 1 + module/doc/view/createtexttype.html.php | 18 ++++-------------- module/doc/view/edittexttype.html.php | 22 ++++------------------ module/upgrade/model.php | 22 ++++++++++++++++++++++ 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 1bda5ad37e..285060e931 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -154,6 +154,7 @@ $lang->doc->allCollections = 'All Collections'; $lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; $lang->doc->sortLibs = 'Sort Libs'; $lang->doc->titlePlaceholder = 'Please enter the title'; +$lang->doc->confirm = 'Confirm'; global $config; /* Query condition list. */ diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index b719793600..db444b059f 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -154,6 +154,7 @@ $lang->doc->allCollections = 'All Collections'; $lang->doc->keywordsTips = 'Please use commas to separate keywords.'; $lang->doc->sortLibs = 'Sort Libs'; $lang->doc->titlePlaceholder = 'Please enter the title'; +$lang->doc->confirm = 'Confirm'; global $config; /* Query condition list. */ diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index f544dd2113..cb11214407 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -154,6 +154,7 @@ $lang->doc->allCollections = 'All Collections'; $lang->doc->keywordsTips = 'Please use commas to separate multiple keywords.'; $lang->doc->sortLibs = 'Sort Libs'; $lang->doc->titlePlaceholder = 'Veuillez saisir le titre'; +$lang->doc->confirm = 'Confirm'; global $config; /* Query condition list. */ diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index ca2ba27227..35f81e9190 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -154,6 +154,7 @@ $lang->doc->allCollections = '查看全部收藏文档'; $lang->doc->keywordsTips = '多个关键字请用逗号分隔。'; $lang->doc->sortLibs = '文档库排序'; $lang->doc->titlePlaceholder = '请输入标题'; +$lang->doc->confirm = '确认'; global $config; /* 查询条件列表 */ diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php index b6d140b42d..af17839cb6 100644 --- a/module/doc/view/createtexttype.html.php +++ b/module/doc/view/createtexttype.html.php @@ -46,12 +46,7 @@ #noticeAcl {margin-left: 10px; vertical-align: middle;} -#moreList {display: inline-block; padding: 7px;} -#moreList .icon-more-circle {font-size: 20px;} -#moreList ul.dropdown-menu {left: -77px;} - -#backBtn {border: unset;} -#backBtn i {font-size: 20px;} +#basicInfoLink {border: unset;} .modal-title {font-size: 14px !important; font-weight: 700 !important;} @@ -64,16 +59,11 @@ - + @@ -154,7 +144,7 @@ - +
", $backLink, 'self', "id='backBtn'");?> ' . $lang->goback, '', "class='btn btn-secondary' id='backBtn'");?> doc->titlePlaceholder}' class='form-control' required");?> - + " . $lang->settings, '', "data-toggle='modal' id='basicInfoLink' class='btn'");?>
close, '', "class='btn btn-primary btn-wide'");?>doc->confirm, '', "class='btn btn-primary btn-wide'");?>
diff --git a/module/doc/view/edittexttype.html.php b/module/doc/view/edittexttype.html.php index fa3b18a86e..137a001a85 100644 --- a/module/doc/view/edittexttype.html.php +++ b/module/doc/view/edittexttype.html.php @@ -49,12 +49,7 @@ #noticeAcl {margin-left: 10px; vertical-align: middle;} -#moreList {display: inline-block; padding: 7px;} -#moreList .icon-more-circle {font-size: 20px;} -#moreList ul.dropdown-menu {left: -77px;} - -#backBtn {border: unset;} -#backBtn i {font-size: 20px;} +#basicInfoLink {border: unset;} .modal-title {font-size: 14px !important; font-weight: 700 !important;} @@ -64,20 +59,11 @@ - - - - - + @@ -155,7 +141,7 @@ - +
", $backLink, 'self', "id='backBtn'");?>", "id='backBtn'", '');?> " . $lang->goback, "id='backBtn'", 'btn btn-secondary');?> title, "placeholder='{$lang->doc->titlePlaceholder}' class='form-control' required");?> - + " . $lang->settings, '', "data-toggle='modal' id='basicInfoLink' class='btn'");?>
close, '', "class='btn btn-primary btn-wide'");?>doc->confirm, '', "class='btn btn-primary btn-wide'");?>
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d58fe72362..5346f4ee33 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -532,6 +532,15 @@ class upgradeModel extends model break; case '17_4': $this->updateSearchIndex(); + if(!$executedXuanxuan) + { + $table = $this->config->db->prefix . 'im_chat'; + $result = $this->checkFieldsExists($table, 'adminInvite'); + if($result->rowCount() == 0) + { + $this->dbh->query("ALTER TABLE $table ADD `adminInvite` enum('0','1') NOT NULL DEFAULT '0' AFTER `mergedChats`"); + } + } break; } @@ -7036,4 +7045,17 @@ class upgradeModel extends model return !dao::isError(); } + + /** + * Check whether the field exists. + * + * @param string $table + * @param string $field + * @access public + * @return object + */ + public function checkFieldsExists($table, $field) + { + return $this->dbh->query("show columns from `$table` like '$field'"); + } } From 8ae85f440c38c9aa182f087ae330ef9b3cb1adbb Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 12 Aug 2022 07:22:28 +0000 Subject: [PATCH 08/22] * Fix bug #26194. --- module/task/css/batchedit.css | 1 - 1 file changed, 1 deletion(-) diff --git a/module/task/css/batchedit.css b/module/task/css/batchedit.css index 1eb634abd1..dd7e102439 100644 --- a/module/task/css/batchedit.css +++ b/module/task/css/batchedit.css @@ -1,5 +1,4 @@ .c-id {width: 50px;} -.c-name {width: 150px;} .c-pri, .c-record, .c-left {width: 70px;} .c-reason {width: 100px;} .c-module, .c-assigned {width: 150px;} From 8dc2999075f6f7bc98526c331f8f50ca8ff87309 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 15:44:01 +0800 Subject: [PATCH 09/22] * Fix bug #26379. --- module/action/model.php | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 92c83c05b4..98b6cfe56c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -989,39 +989,43 @@ class actionModel extends model if($projectID == 'all') $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? $this->app->user->view->projects : '0'; if($executionID == 'all') $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? $this->app->user->view->sprints : '0'; + if(empty($authedProducts)) $authedProducts = '0'; + if($productID == 'all' and $projectID == 'all') { $productCondition = ''; - foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project " . helper::dbIN($authedProjects); - $executionCondition = isset($authedExecutions) ? "execution " . helper::dbIN($authedExecutions) : ''; + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = isset($authedExecutions) ? "(execution != 0 and execution " . helper::dbIN($authedExecutions) . ')' : ''; } elseif($productID == 'all' and is_numeric($projectID)) { $products = $this->loadModel('product')->getProductPairsByProject($projectID); - $executions = $this->loadModel('execution')->getPairs($projectID); + $executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = ''; - foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project = $projectID"; - $executionCondition = "execution " . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project = '$projectID')"; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } elseif(is_numeric($productID) and $projectID == 'all') { $this->loadModel('product'); $projects = $this->product->getProjectPairsByProduct($productID); - $executions = $this->product->getExecutionPairsByProduct($productID); + $executions = $this->product->getExecutionPairsByProduct($productID) + array(0 => 0); $authedProjects = array_intersect(array_keys($projects), explode(',', $authedProjects)); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = "product like '%,$productID,%'"; - $projectCondition = 'project ' . helper::dbIN($authedProjects); - $executionCondition = 'execution ' . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } $condition = "((product =',0,' or product = '0' or product=',,') AND project = '0' AND execution = '0')"; @@ -1222,17 +1226,8 @@ class actionModel extends model $relatedProjects = $relatedData['relatedProjects']; $requirements = $relatedData['requirements']; - $aclViews = isset($this->app->user->rights['acls']['views']) ? $this->app->user->rights['acls']['views'] : array(); - $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? ",{$this->app->user->view->projects}," : ''; - $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? ",{$this->app->user->view->sprints},": ''; - foreach($actions as $i => $action) { - if(($action->execution != '0' and strpos($authedExecutions, ",$action->execution,") === false) or ($action->execution == '0' and $action->project != '0' and strpos($authedProjects, ",$action->project,") === false)) - { - unset($actions[$i]); - continue; - } /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : ''; From b44027690c7cc4449213fe4e2ce046f2b5ed9b0f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 16:07:06 +0800 Subject: [PATCH 10/22] * Fix bug #26358. --- module/story/view/track.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/view/track.html.php b/module/story/view/track.html.php index 0d488d1c35..75cf44858c 100644 --- a/module/story/view/track.html.php +++ b/module/story/view/track.html.php @@ -33,7 +33,7 @@
{$projectProducts[$productID]->name}
", '', 'class="dropdown-toggle" data-toggle="dropdown"');?> From 9a3513a15c33072e562b1916b0e241b93eb384fe Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 12 Aug 2022 16:11:35 +0800 Subject: [PATCH 11/22] * change for change table engine. --- module/admin/control.php | 80 ++++++++++++++++++++++ module/admin/lang/de.php | 10 +++ module/admin/lang/en.php | 10 +++ module/admin/lang/fr.php | 10 +++ module/admin/lang/zh-cn.php | 10 +++ module/admin/view/tableengine.html.php | 94 ++++++++++++++++++++++++++ module/common/lang/de.php | 11 +-- module/common/lang/en.php | 11 +-- module/common/lang/fr.php | 11 +-- module/common/lang/menu.php | 1 + module/common/lang/zh-cn.php | 11 +-- module/group/lang/resource.php | 2 + module/misc/model.php | 15 ++++ module/upgrade/control.php | 77 --------------------- module/upgrade/lang/de.php | 5 +- module/upgrade/lang/en.php | 5 +- module/upgrade/lang/fr.php | 5 +- module/upgrade/lang/zh-cn.php | 5 +- module/upgrade/model.php | 39 +++++++++-- module/upgrade/view/afterexec.html.php | 52 +++----------- 20 files changed, 302 insertions(+), 162 deletions(-) create mode 100644 module/admin/view/tableengine.html.php diff --git a/module/admin/control.php b/module/admin/control.php index 0ed2c37aad..7061b75c1c 100644 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -373,4 +373,84 @@ class admin extends control $this->view->title = $this->lang->admin->resetPWDSetting; $this->display(); } + + /** + * Show table engine. + * + * @access public + * @return void + */ + public function tableEngine() + { + $this->view->title = $this->lang->admin->tableEngine; + $this->view->tableEngines = $this->loadModel('misc')->getTableEngines(); + $this->display(); + } + + /** + * Ajax change table engine. + * + * @access public + * @return void + */ + public function ajaxChangeTableEngine($tableName) + { + $response = array(); + $response['result'] = 'success'; + $response['message'] = ''; + + $tableEngines = $this->loadModel('misc')->getTableEngines(); + if(!isset($tableEngines[$tableName])) + { + $response['result'] = 'fail'; + return print(json_encode($response)); + } + + if($tableEngines[$tableName] == 'InnoDB') + { + $response['message'] = sprintf($this->lang->admin->changeSuccess, $tableName); + return print(json_encode($response)); + } + + try + { + /* Check process this table or not. */ + $dbProcesses = $this->dao->query("SHOW PROCESSLIST")->fetchAll(); + foreach($dbProcesses as $dbProcess) + { + if($dbProcess->db != $this->config->db->name) continue; + if(strpos($dbProcess->Info, " {$tableName} ") !== false) + { + $response['message'] = sprintf($this->lang->upgrade->changingTable, $tableName); + return print(json_encode($response)); + } + } + } + catch(PDOException $e){} + + if(stripos($tableName, 'searchindex') !== false) + { + $mysqlVersion = $this->loadModel('install')->getMysqlVersion(); + if($mysqlVersion < 5.6) + { + $response['result'] = 'fail'; + $response['message'] = $this->lang->admin->errorInnodb; + return print(json_encode($response)); + } + } + + try + { + $sql = "ALTER TABLE `$tableName` ENGINE='InnoDB'"; + $this->dao->exec($sql); + $response['message'] = sprintf($this->lang->admin->changeSuccess, $tableName); + } + catch(PDOException $e) + { + $response['result'] = 'fail'; + $response['message'] = sprintf($this->lang->admin->changeFail, $tableName, htmlspecialchars($e->getMessage())); + } + + return print(json_encode($response)); + } } diff --git a/module/admin/lang/de.php b/module/admin/lang/de.php index f3647127a2..b498651993 100644 --- a/module/admin/lang/de.php +++ b/module/admin/lang/de.php @@ -22,6 +22,7 @@ $lang->admin->captcha = 'Bestätigungscode'; $lang->admin->getCaptcha = 'Bestätigungscode anfordern'; $lang->admin->register = 'Register'; $lang->admin->resetPWDSetting = 'Reset password Setting'; +$lang->admin->tableEngine = 'Table Engine'; $lang->admin->api = 'API'; $lang->admin->log = 'Log'; @@ -29,6 +30,15 @@ $lang->admin->setting = 'Einstellungen'; $lang->admin->days = 'Gültige Tage'; $lang->admin->resetPWDByMail = 'Reset the password via the email'; +$lang->admin->changeEngine = "Change to InnoDB"; +$lang->admin->changingTable = 'Replacing data table %s engine...'; +$lang->admin->changeSuccess = 'The data table %s engine has been changed to InnoDB.'; +$lang->admin->changeFail = "Failed to replace table %s engine. Reason: %s。"; +$lang->admin->errorInnodb = 'Your MySQL does not support InnoDB data table engine.'; +$lang->admin->engineInfo = "The %s table engine is %s."; +$lang->admin->engineSummary['hasMyISAM'] = "There are %s tables that are not InnoDB engines"; +$lang->admin->engineSummary['allInnoDB'] = "All tables are InnoDB engines"; + $lang->admin->info = new stdclass(); $lang->admin->info->version = 'Aktuelle Version ist %s. '; $lang->admin->info->links = 'You can visit links below'; diff --git a/module/admin/lang/en.php b/module/admin/lang/en.php index ae785bc4f2..c850026926 100644 --- a/module/admin/lang/en.php +++ b/module/admin/lang/en.php @@ -22,6 +22,7 @@ $lang->admin->captcha = 'Verification Code'; $lang->admin->getCaptcha = 'Send Verification Code'; $lang->admin->register = 'Register'; $lang->admin->resetPWDSetting = 'Reset password Setting'; +$lang->admin->tableEngine = 'Table Engine'; $lang->admin->api = 'API'; $lang->admin->log = 'Log'; @@ -29,6 +30,15 @@ $lang->admin->setting = 'Setting'; $lang->admin->days = 'Valid Day'; $lang->admin->resetPWDByMail = 'Reset the password via the email'; +$lang->admin->changeEngine = "Change to InnoDB"; +$lang->admin->changingTable = 'Replacing data table %s engine...'; +$lang->admin->changeSuccess = 'The data table %s engine has been changed to InnoDB.'; +$lang->admin->changeFail = "Failed to replace table %s engine. Reason: %s。"; +$lang->admin->errorInnodb = 'Your MySQL does not support InnoDB data table engine.'; +$lang->admin->engineInfo = "The %s table engine is %s."; +$lang->admin->engineSummary['hasMyISAM'] = "There are %s tables that are not InnoDB engines"; +$lang->admin->engineSummary['allInnoDB'] = "All tables are InnoDB engines"; + $lang->admin->info = new stdclass(); $lang->admin->info->version = 'Current Version is %s. '; $lang->admin->info->links = 'You can visit links below'; diff --git a/module/admin/lang/fr.php b/module/admin/lang/fr.php index f3bb4993ad..a7749f2a4b 100644 --- a/module/admin/lang/fr.php +++ b/module/admin/lang/fr.php @@ -22,6 +22,7 @@ $lang->admin->captcha = 'Code de vérification'; $lang->admin->getCaptcha = 'Obtenir le Code de vérification'; $lang->admin->register = 'Register'; $lang->admin->resetPWDSetting = 'Reset password Setting'; +$lang->admin->tableEngine = 'Table Engine'; $lang->admin->api = 'API'; $lang->admin->log = 'Log'; @@ -29,6 +30,15 @@ $lang->admin->setting = 'Paramétrage'; $lang->admin->days = 'Durée de conservation'; $lang->admin->resetPWDByMail = 'Reset the password via the email'; +$lang->admin->changeEngine = "Change to InnoDB"; +$lang->admin->changingTable = 'Replacing data table %s engine...'; +$lang->admin->changeSuccess = 'The data table %s engine has been changed to InnoDB.'; +$lang->admin->changeFail = "Failed to replace table %s engine. Reason: %s。"; +$lang->admin->errorInnodb = 'Your MySQL does not support InnoDB data table engine.'; +$lang->admin->engineInfo = "The %s table engine is %s."; +$lang->admin->engineSummary['hasMyISAM'] = "There are %s tables that are not InnoDB engines"; +$lang->admin->engineSummary['allInnoDB'] = "All tables are InnoDB engines"; + $lang->admin->info = new stdclass(); $lang->admin->info->version = 'La version actuelle est %s customisée. '; $lang->admin->info->links = 'Vous pouvez visiter les liens ci-dessous'; diff --git a/module/admin/lang/zh-cn.php b/module/admin/lang/zh-cn.php index f07908c47e..10d8a111a6 100644 --- a/module/admin/lang/zh-cn.php +++ b/module/admin/lang/zh-cn.php @@ -22,6 +22,7 @@ $lang->admin->captcha = '验证码'; $lang->admin->getCaptcha = '获取验证码'; $lang->admin->register = '登记'; $lang->admin->resetPWDSetting = '重置密码设置'; +$lang->admin->tableEngine = '表引擎'; $lang->admin->api = '接口'; $lang->admin->log = '日志'; @@ -29,6 +30,15 @@ $lang->admin->setting = '设置'; $lang->admin->days = '日志保存天数'; $lang->admin->resetPWDByMail = '通过邮箱重置密码'; +$lang->admin->changeEngine = "更换到InnoDB"; +$lang->admin->changingTable = '正在更换数据表%s引擎...'; +$lang->admin->changeSuccess = '已经更换数据表%s引擎为InnoDB。'; +$lang->admin->changeFail = "更换数据表%s引擎失败,原因:%s。"; +$lang->admin->errorInnodb = '您当前的数据库不支持使用InnoDB数据表引擎。'; +$lang->admin->engineInfo = "表%s的引擎是%s。"; +$lang->admin->engineSummary['hasMyISAM'] = "有%s个表不是InnoDB引擎"; +$lang->admin->engineSummary['allInnoDB'] = "所有的表都是InnoDB引擎了"; + $lang->admin->info = new stdclass(); $lang->admin->info->version = '当前系统的版本是%s,'; $lang->admin->info->links = '您可以访问以下链接:'; diff --git a/module/admin/view/tableengine.html.php b/module/admin/view/tableengine.html.php new file mode 100644 index 0000000000..d89eb2f93b --- /dev/null +++ b/module/admin/view/tableengine.html.php @@ -0,0 +1,94 @@ + + * @package admin + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+ $engine) + { + if($engine != 'InnoDB') $MyISAMCount ++; + $engineListHtml .= "
  • " . sprintf($lang->admin->engineInfo, $tableName, $engine) . "
  • \n"; + } + ?> +

    + 0):?> + admin->engineSummary['hasMyISAM'], $MyISAMCount);?> + admin->changeEngine, '', "class='btn btn-sm changeEngine btn-primary' onclick='changeAllEngines()'");?> + + admin->engineSummary['allInnoDB']);?> + +

    +
    +
    +
    +
    +
    +admin->changingTable);?> + + diff --git a/module/common/lang/de.php b/module/common/lang/de.php index 9cd57439b5..d2113a3e89 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -288,11 +288,12 @@ $lang->devops->rules = 'Rule'; $lang->devops->settings = 'Setting Merge Request'; $lang->devops->set = 'Set'; -$lang->admin->system = 'System'; -$lang->admin->entry = 'Application'; -$lang->admin->data = 'Data'; -$lang->admin->cron = 'Cron'; -$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->system = 'System'; +$lang->admin->entry = 'Application'; +$lang->admin->data = 'Data'; +$lang->admin->cron = 'Cron'; +$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->tableEngine = 'Table Engine'; $lang->convert->importJira = 'Import Jira'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index e8022f9f17..d8390243ce 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -288,11 +288,12 @@ $lang->devops->rules = 'Rule'; $lang->devops->settings = 'Setting Merge Request'; $lang->devops->set = 'Set'; -$lang->admin->system = 'System'; -$lang->admin->entry = 'Application'; -$lang->admin->data = 'Data'; -$lang->admin->cron = 'Cron'; -$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->system = 'System'; +$lang->admin->entry = 'Application'; +$lang->admin->data = 'Data'; +$lang->admin->cron = 'Cron'; +$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->tableEngine = 'Table Engine'; $lang->convert->importJira = 'Import Jira'; diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index d291be8c95..67caf6b5fd 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -288,11 +288,12 @@ $lang->devops->rules = 'Rule'; $lang->devops->settings = 'Setting Merge Request'; $lang->devops->set = 'Set'; -$lang->admin->system = 'System'; -$lang->admin->entry = 'Application'; -$lang->admin->data = 'Data'; -$lang->admin->cron = 'Cron'; -$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->system = 'System'; +$lang->admin->entry = 'Application'; +$lang->admin->data = 'Data'; +$lang->admin->cron = 'Cron'; +$lang->admin->buildIndex = 'Full Text Search'; +$lang->admin->tableEngine = 'Table Engine'; $lang->convert->importJira = 'Import Jira'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index f4da4b6005..1327985178 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -568,6 +568,7 @@ $lang->admin->menu->system['subMenu']->safe = array('link' => "$lang->sec $lang->admin->menu->system['subMenu']->cron = array('link' => "{$lang->admin->cron}|cron|index", 'subModule' => 'cron'); $lang->admin->menu->system['subMenu']->timezone = array('link' => "$lang->timezone|custom|timezone"); $lang->admin->menu->system['subMenu']->buildIndex = array('link' => "{$lang->admin->buildIndex}|search|buildindex|"); +$lang->admin->menu->system['subMenu']->tableEngine = array('link' => "{$lang->admin->tableEngine}|admin|tableengine|"); if(version_compare(phpversion(), 5.6) > 0) $lang->admin->menu->system['subMenu']->convertJira = array('link' => "{$lang->convert->importJira}|convert|convertjira|", 'subModule' => 'convert'); $lang->admin->dividerMenu = ',company,message,system,'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index eb4cc5bf63..a27488d59e 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -288,11 +288,12 @@ $lang->devops->rules = '指令'; $lang->devops->settings = '合并请求设置'; $lang->devops->set = '设置'; -$lang->admin->system = '系统'; -$lang->admin->entry = '应用'; -$lang->admin->data = '数据'; -$lang->admin->cron = '定时'; -$lang->admin->buildIndex = '重建索引'; +$lang->admin->system = '系统'; +$lang->admin->entry = '应用'; +$lang->admin->data = '数据'; +$lang->admin->cron = '定时'; +$lang->admin->buildIndex = '重建索引'; +$lang->admin->tableEngine = '表引擎'; $lang->convert->importJira = '导入Jira数据'; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 333ecfee8e..56080b05d5 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1632,6 +1632,7 @@ $lang->resource->admin->sso = 'ssoAction'; $lang->resource->admin->register = 'register'; $lang->resource->admin->ztCompany = 'ztCompany'; $lang->resource->admin->resetPWDSetting = 'resetPWDSetting'; +$lang->resource->admin->tableEngine = 'tableEngine'; $lang->admin->methodOrder[0] = 'index'; $lang->admin->methodOrder[5] = 'checkDB'; @@ -1641,6 +1642,7 @@ $lang->admin->methodOrder[20] = 'sso'; $lang->admin->methodOrder[25] = 'register'; $lang->admin->methodOrder[30] = 'ztCompany'; $lang->admin->methodOrder[35] = 'resetPWDSetting'; +$lang->admin->methodOrder[40] = 'tableEngine'; /* Extension. */ $lang->resource->extension = new stdclass(); diff --git a/module/misc/model.php b/module/misc/model.php index 68ab08a1bc..739ab197e3 100644 --- a/module/misc/model.php +++ b/module/misc/model.php @@ -143,4 +143,19 @@ class miscModel extends model return $weakSites; } + + /** + * Get table and engine pairs. + * + * @access public + * @return array + */ + public function getTableEngines() + { + $tableEngines = array(); + $stmt = $this->dao->query("SHOW TABLE STATUS WHERE `Engine` is not null"); + while($table = $stmt->fetch()) $tableEngines[$table->Name] = $table->Engine; + + return $tableEngines; + } } diff --git a/module/upgrade/control.php b/module/upgrade/control.php index d2fb523a88..fe176ea746 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -906,83 +906,6 @@ class upgrade extends control echo $this->dao->select('status')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch('status'); } - /** - * Ajax change table engine. - * - * @access public - * @return void - */ - public function ajaxChangeTableEngine() - { - $response = array(); - $response['result'] = 'continue'; - $response['message'] = ''; - $response['nextMessage'] = ''; - - $stmt = $this->dao->query("SHOW TABLE STATUS WHERE `Engine` is not null AND `Engine` = 'MyISAM'"); - $table = $stmt->fetch(); - if(empty($table)) - { - $response['result'] = 'finished'; - $response['message'] = $this->lang->upgrade->finishedChange; - return print(json_encode($response)); - } - - $nextTable = $stmt->fetch(); - if($nextTable and stripos($nextTable->Name, 'searchindex') !== false) - { - $mysqlVersion = $this->loadModel('install')->getMysqlVersion(); - if($mysqlVersion < 5.6) $nextTable = $stmt->fetch(); - } - - $tableName = $table->Name; - - $response['table'] = $tableName; - - /* Check process this table or not. */ - $dbProcesses = $this->dao->query("SHOW PROCESSLIST")->fetchAll(); - foreach($dbProcesses as $dbProcess) - { - if($dbProcess->db != $this->config->db->name) continue; - if(strpos($dbProcess->Info, " `{$tableName}` ")) - { - $response['message'] = sprintf($this->lang->upgrade->changingTable, $response['table']); - return print(json_encode($response)); - } - } - - if($nextTable) - { - $response['next'] = $nextTable->Name; - if($response['next']) $response['nextMessage'] = sprintf($this->lang->upgrade->changingTable, $response['next']); - } - - if(stripos($tableName, 'searchindex') !== false) - { - /* Change fulltext index. */ - $stmt = $this->dao->query("show index from `$tableName`"); - $indexes = array(); - while($index = $stmt->fetch()) - { - if($index->Index_type != 'FULLTEXT') continue; - $indexes[$index->Key_name] = $index->Key_name; - } - - if(!isset($indexes['title_content'])) $this->dao->exec( "ALTER TABLE `{$tableName}` ADD FULLTEXT `title_content` (`title`, `content`)"); - if(isset($indexes['title'])) $this->dao->exec( "ALTER TABLE `{$tableName}` DROP INDEX `title`"); - if(isset($indexes['content'])) $this->dao->exec( "ALTER TABLE `{$tableName}` DROP INDEX `content`"); - - $mysqlVersion = $this->loadModel('install')->getMysqlVersion(); - if($mysqlVersion < 5.6) return print(json_encode($response)); - } - - $sql = "ALTER TABLE `$tableName` ENGINE='InnoDB'"; - $this->dao->exec($sql); - - $response['message'] = sprintf($this->lang->upgrade->finishedTable, $tableName); - return print(json_encode($response)); - } - /** * Move Extent files. * diff --git a/module/upgrade/lang/de.php b/module/upgrade/lang/de.php index 9512aea5d9..dfd5dffaf6 100644 --- a/module/upgrade/lang/de.php +++ b/module/upgrade/lang/de.php @@ -51,10 +51,6 @@ $lang->upgrade->sureExecute = 'Ausführen'; $lang->upgrade->upgradingTips = 'The upgrade is in progress, please be patient. Do not refresh the page, blackout, or turn off your computer!'; $lang->upgrade->forbiddenExt = 'Die Erweiterung ist nicht kompatibel mit der Upgradeversion. Sie wurde deaktiviert:'; $lang->upgrade->updateFile = 'Updateinformation wurden hinzugefügt.'; -$lang->upgrade->changeEngine = 'The database engine needs to be modified.'; -$lang->upgrade->changingTable = 'Replacing data table %s engine...'; -$lang->upgrade->finishedTable = 'The data table %s engine has been changed to InnoDB.'; -$lang->upgrade->finishedChange = 'The replacement of the database engine is completed.'; $lang->upgrade->noticeSQL = 'Your database is inconsistent with the standard and it failed to fix it. Please run the following SQL and refresh.'; $lang->upgrade->afterDeleted = 'File is not deleted. Please refresh after you delete it.'; $lang->upgrade->mergeProgram = 'Data Merge'; @@ -134,6 +130,7 @@ $lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You ca $lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently."; $lang->upgrade->mergeRepoTips = "Merge the selected version library under the selected product."; $lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrad. Please create an index.'; +$lang->upgrade->needChangeEngine = 'The table engine needs to be replaced in this upgrade, Please go [Admin->System->TableEngine] page to replace engine.'; $lang->upgrade->errorEngineInnodb = 'Your MySQL version is too low to support InnoDB data table engine. Please modify it to MyISAM and try again.'; $lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; $lang->upgrade->upgradeTips = "Historically deleted data cannot be upgraded, and restoration is not supported after the upgrade. Please be aware."; diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index 8d9c1b413b..ed38f78dd2 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -51,10 +51,6 @@ $lang->upgrade->sureExecute = 'Execute'; $lang->upgrade->upgradingTips = 'The upgrade is in progress, please be patient. Do not refresh the page, blackout, or turn off your computer!'; $lang->upgrade->forbiddenExt = 'The extension is incompatible with the version. It has been deactivated:'; $lang->upgrade->updateFile = 'File information has to be updated.'; -$lang->upgrade->changeEngine = 'The database engine needs to be modified.'; -$lang->upgrade->changingTable = 'Replacing data table %s engine...'; -$lang->upgrade->finishedTable = 'The data table %s engine has been changed to InnoDB.'; -$lang->upgrade->finishedChange = 'The replacement of the database engine is completed.'; $lang->upgrade->noticeSQL = 'Your database is inconsistent with the standard and it failed to fix it. Please run the following SQL and refresh.'; $lang->upgrade->afterDeleted = 'Please execute commands to delete the files. Please refresh after you delete them.'; $lang->upgrade->mergeProgram = 'Data Merge'; @@ -134,6 +130,7 @@ $lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You ca $lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently."; $lang->upgrade->mergeRepoTips = "Merge the selected version library under the selected product."; $lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrade. Need create index. Please go [Admin->System->BuildIndex] page to build index.'; +$lang->upgrade->needChangeEngine = 'The table engine needs to be replaced in this upgrade, Please go [Admin->System->TableEngine] page to replace engine.'; $lang->upgrade->errorEngineInnodb = 'Your MySQL does not support InnoDB data table engine. Please modify it to MyISAM and try again.'; $lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; $lang->upgrade->upgradeTips = "Historically deleted data cannot be upgraded, and restoration is not supported after the upgrade. Please be aware."; diff --git a/module/upgrade/lang/fr.php b/module/upgrade/lang/fr.php index 815df01348..ac63434bce 100644 --- a/module/upgrade/lang/fr.php +++ b/module/upgrade/lang/fr.php @@ -51,10 +51,6 @@ $lang->upgrade->sureExecute = 'Executez'; $lang->upgrade->upgradingTips = 'La mise à jour est en cours, veuillez être patient. Ne pas actualiser la page ou éteindre votre ordinateur!'; $lang->upgrade->forbiddenExt = 'Cette extension est incompatible avec la version. Elle a été désactivée :'; $lang->upgrade->updateFile = "Le fichier information a besoin d'une mise à jour."; -$lang->upgrade->changeEngine = 'The database engine needs to be modified.'; -$lang->upgrade->changingTable = 'Replacing data table %s engine...'; -$lang->upgrade->finishedTable = 'The data table %s engine has been changed to InnoDB.'; -$lang->upgrade->finishedChange = 'The replacement of the database engine is completed.'; $lang->upgrade->noticeSQL = 'Votre base de donnée est inconsistente avec le standard et il y a eu un échec pour la corriger. Exécutez la commande SQL suivante et rafraichissez.'; $lang->upgrade->afterDeleted = "Le fichier n'est pas supprimé. Recommencez après l'avoir supprimé."; $lang->upgrade->mergeProgram = 'Data Merge'; @@ -134,6 +130,7 @@ $lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You ca $lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently."; $lang->upgrade->mergeRepoTips = "Merge the selected version library under the selected product."; $lang->upgrade->needBuild4Add = 'Full text retrieval has been added in this upgrade. Need create index. Please go [Admin->System->BuildIndex] page to build index.'; +$lang->upgrade->needChangeEngine = 'The table engine needs to be replaced in this upgrade, Please go [Admin->System->TableEngine] page to replace engine.'; $lang->upgrade->errorEngineInnodb = 'Your MySQL does not support InnoDB data table engine. Please modify it to MyISAM and try again.'; $lang->upgrade->duplicateProject = "Project name in the same program cannot be duplicate. Please adjust the duplicate names."; $lang->upgrade->upgradeTips = "Historically deleted data cannot be upgraded, and restoration is not supported after the upgrade. Please be aware."; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index 4378626dcd..97450262e1 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -51,10 +51,6 @@ $lang->upgrade->sureExecute = '确认执行'; $lang->upgrade->upgradingTips = '正在升级中,请耐心等待,切勿刷新页面、断电、关机!'; $lang->upgrade->forbiddenExt = '以下插件与新版本不兼容,已经自动禁用:'; $lang->upgrade->updateFile = '需要更新附件信息。'; -$lang->upgrade->changeEngine = '需要修改数据库引擎。'; -$lang->upgrade->changingTable = '正在更换数据表%s引擎...'; -$lang->upgrade->finishedTable = '已经更换数据表%s引擎为InnoDB。'; -$lang->upgrade->finishedChange = '更换数据库引擎结束。'; $lang->upgrade->noticeSQL = '检查到你的数据库跟标准不一致,尝试修复失败。请执行以下SQL语句,再刷新页面检查。'; $lang->upgrade->afterDeleted = '请执行上面命令删除文件, 删除后刷新!'; $lang->upgrade->mergeProgram = '数据迁移'; @@ -134,6 +130,7 @@ $lang->upgrade->mergeByProject = "独立的{$lang->projectCommon}:可以 $lang->upgrade->mergeByMoreLink = "关联多个{$lang->productCommon}的{$lang->projectCommon}:选择一个或多个{$lang->projectCommon}归并到一个项目集和项目中。"; $lang->upgrade->mergeRepoTips = "将选中的版本库归并到所选产品下。"; $lang->upgrade->needBuild4Add = '本次升级需要创建索引。请到 [后台->系统->重建索引] 页面,重新创建索引。'; +$lang->upgrade->needChangeEngine = '本次升级需要更换表引擎, [后台->系统->表引擎] 页面更换引擎。'; $lang->upgrade->errorEngineInnodb = '您当前的数据库不支持使用InnoDB数据表引擎,请修改为MyISAM后重试。'; $lang->upgrade->duplicateProject = "同一个项目集内项目名称不能重复,请调整重名的项目名称"; $lang->upgrade->upgradeTips = "历史删除数据不参与升级,升级后将不支持还原,请知悉"; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d58fe72362..5cbc662961 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -531,6 +531,7 @@ class upgradeModel extends model $this->processBugLinkBug(); break; case '17_4': + $this->rebuildFULLTEXT(); $this->updateSearchIndex(); break; } @@ -3198,25 +3199,25 @@ class upgradeModel extends model { $fromVersion = $this->config->installedVersion; $needProcess = array(); - if(strpos($fromVersion, 'max') === false and strpos($fromVersion, 'biz') === false and (strpos($fromVersion, 'pro') === false ? version_compare($fromVersion, '8.3', '<') : version_compare($fromVersion, 'pro5.4', '<'))) $needProcess['updateFile'] = true; + if(strpos($fromVersion, 'max') === false and strpos($fromVersion, 'biz') === false and (strpos($fromVersion, 'pro') === false ? version_compare($fromVersion, '8.3', '<') : version_compare($fromVersion, 'pro5.4', '<'))) $needProcess['updateFile'] = 'process'; if(strpos($fromVersion, 'max') === false and $this->config->systemMode == 'new') { if(strpos($fromVersion, 'pro') !== false) { - if(version_compare($fromVersion, 'pro10.0', '<')) $needProcess['search'] = true; + if(version_compare($fromVersion, 'pro10.0', '<')) $needProcess['search'] = 'notice'; } elseif(strpos($fromVersion, 'biz') !== false) { - if(version_compare($fromVersion, 'biz5.0', '<')) $needProcess['search'] = true; + if(version_compare($fromVersion, 'biz5.0', '<')) $needProcess['search'] = 'notice'; } elseif(version_compare($fromVersion, '15.0.rc1', '<')) { - $needProcess['search'] = true; + $needProcess['search'] = 'notice'; } } $openVersion = $this->getOpenVersion($fromVersion); - if(version_compare($openVersion, '17_4', '<=')) $needProcess['changeEngine'] = true; + if(version_compare($openVersion, '17_4', '<=')) $needProcess['changeEngine'] = 'notice'; return $needProcess; } @@ -7036,4 +7037,32 @@ class upgradeModel extends model return !dao::isError(); } + + /** + * Change FULLTEXT index for searchindex table. + * + * @access public + * @return void + */ + public function rebuildFULLTEXT() + { + try + { + $table = TABLE_SEARCHINDEX; + $stmt = $this->dao->query("show index from $table"); + $indexes = array(); + while($index = $stmt->fetch()) + { + if($index->Index_type != 'FULLTEXT') continue; + $indexes[$index->Key_name] = $index->Key_name; + } + + if(!isset($indexes['title_content'])) $this->dao->exec( "ALTER TABLE {$table} ADD FULLTEXT `title_content` (`title`, `content`)"); + if(isset($indexes['title'])) $this->dao->exec( "ALTER TABLE {$table} DROP INDEX `title`"); + if(isset($indexes['content'])) $this->dao->exec( "ALTER TABLE {$table} DROP INDEX `content`"); + } + catch(PDOException $e){} + + return true; + } } diff --git a/module/upgrade/view/afterexec.html.php b/module/upgrade/view/afterexec.html.php index f3b82cd10c..3d240b4430 100644 --- a/module/upgrade/view/afterexec.html.php +++ b/module/upgrade/view/afterexec.html.php @@ -35,10 +35,10 @@ $(function() finishedShow(); }) $value) +foreach($needProcess as $processKey => $processType) { - $value = $processKey == 'search' ? 'true' : 'false'; - echo 'var ' . $processKey . "Finish = $value;\n"; + if($processType == 'notice') continue; + echo 'var ' . $processKey . "Finish = false;\n"; } ?> @@ -52,9 +52,9 @@ function initHideHome() { var hide = false; $value) + foreach($needProcess as $processKey => $processType) { - if($processKey == 'search') continue; + if($processType == 'notice') continue; echo "hide = true;\n"; break; } @@ -76,8 +76,9 @@ function finishedShow() { var show = true; $value) + foreach($needProcess as $processKey => $processType) { + if($processType == 'notice') continue; echo "if({$processKey}Finish == false) show = false;\n"; } ?> @@ -91,45 +92,8 @@ function finishedShow() $(function() { - $('.col-md-6:first').append("

    upgrade->changeEngine;?>

    "); - changeEngine(); + $('.col-md-6:first').append("

    upgrade->needChangeEngine;?>

    "); }) -function changeEngine() -{ - var link = ''; - var $infoBox = $('#changeEngineBox .info'); - $.ajax( - { - type: "GET", - url: link, - success: function(response) - { - response = JSON.parse(response); - if(response == null) - { - changeEngineFinish = true; - finishedShow(); - } - else if(response.result == 'finished') - { - changeEngineFinish = true; - $infoBox.prepend("
    " + response.message + "
    "); - finishedShow(); - } - else - { - if($infoBox.find('.' + response.table).length == 0) $infoBox.prepend("
    "); - $infoBox.find('.' + response.table).html(response.message); - if(response.next) $infoBox.prepend("
    " + response.nextMessage + "
    "); - changeEngine(); - } - }, - error: function() - { - changeEngine(); - } - }) -} $(function() From 9fa80dcd946c786d4d10bb5652fd17bcf4c7e286 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 12 Aug 2022 16:15:08 +0800 Subject: [PATCH 12/22] add cp gantt task move --- module/action/lang/de.php | 6 ------ module/action/lang/en.php | 6 ------ module/action/lang/fr.php | 6 ------ module/action/lang/zh-cn.php | 6 ------ module/programplan/control.php | 2 +- module/task/model.php | 10 +++++++++- 6 files changed, 10 insertions(+), 26 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 7e0ee16529..909bc81a19 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -245,10 +245,6 @@ $lang->action->desc->linkbug = '$date, $actor link bugs action->desc->unlinkstory = '$date, $actor remove stories $extra from plan.' . "\n"; $lang->action->desc->unlinkbug = '$date, $actor remove bugs $extra from plan.' . "\n"; -/* Used to describe the historical operation records of gantt. */ -$lang->action->desc->ganttdrag = '$date, $actor tasks dragged $extra.' . "\n"; -$lang->action->desc->ganttmove = '$date, $actor tasks sorted $extra.' . "\n"; - /* Used to display dynamic information. */ $lang->action->label = new stdclass(); $lang->action->label->install = 'install '; @@ -386,8 +382,6 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'imported'; $lang->action->label->updatetolib = 'updated'; -$lang->action->label->ganttdrag = 'dragged'; -$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 9a2d0e1634..a88734522b 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -245,10 +245,6 @@ $lang->action->desc->linkbug = '$date, $actor link bugs action->desc->unlinkstory = '$date, $actor remove stories $extra from plan.' . "\n"; $lang->action->desc->unlinkbug = '$date, $actor remove bugs $extra from plan.' . "\n"; -/* Used to describe the historical operation records of gantt. */ -$lang->action->desc->ganttdrag = '$date, $actor tasks dragged $extra.' . "\n"; -$lang->action->desc->ganttmove = '$date, $actor tasks sorted $extra.' . "\n"; - /* Used to display dynamic information. */ $lang->action->label = new stdclass(); $lang->action->label->install = 'install '; @@ -386,8 +382,6 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'imported'; $lang->action->label->updatetolib = 'updated'; -$lang->action->label->ganttdrag = 'dragged'; -$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 3f9c6bc522..b0cd6a60d6 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -245,10 +245,6 @@ $lang->action->desc->linkbug = '$date, $actor link bugs action->desc->unlinkstory = '$date, $actor remove stories $extra from plan.' . "\n"; $lang->action->desc->unlinkbug = '$date, $actor remove bugs $extra from plan.' . "\n"; -/* Used to describe the historical operation records of gantt. */ -$lang->action->desc->ganttdrag = '$date, $actor tasks dragged $extra.' . "\n"; -$lang->action->desc->ganttmove = '$date, $actor tasks sorted $extra.' . "\n"; - /* Used to display dynamic information. */ $lang->action->label = new stdclass(); $lang->action->label->install = 'install '; @@ -386,8 +382,6 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'Importé'; $lang->action->label->updatetolib = 'MàJ'; -$lang->action->label->ganttdrag = 'dragged'; -$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass(); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index af8c1ee524..ae7ce48891 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -245,10 +245,6 @@ $lang->action->desc->linkbug = '$date, 由 $actor 关联BUG $lang->action->desc->unlinkstory = '$date, 由 $actor 从计划移除需求 $extra。' . "\n"; $lang->action->desc->unlinkbug = '$date, 由 $actor 从计划移除BUG $extra。' . "\n"; -/* 用来描述gantt chat相关操作记录。 */ -$lang->action->desc->ganttdrag = '$date, 由 $actor 拖动了任务 $extra。' . "\n"; -$lang->action->desc->ganttmove = '$date, 由 $actor 排序了任务 $extra。' . "\n"; - /* 用来显示动态信息。*/ $lang->action->label = new stdclass(); $lang->action->label->install = '安装'; @@ -386,8 +382,6 @@ $lang->action->label->unlinkstory = '移除需求从'; $lang->action->label->unlinkbug = '移除BUG从'; $lang->action->label->tolib = '导入了'; $lang->action->label->updatetolib = '更新了'; -$lang->action->label->ganttdrag = '拖动了'; -$lang->action->label->ganttmove = '排序了'; /* 动态信息按照对象分组 */ $lang->action->dynamicAction = new stdclass(); diff --git a/module/programplan/control.php b/module/programplan/control.php index fa727343c4..1c02e0aae5 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -275,7 +275,7 @@ class programplan extends control $this->loadModel('task')->updateEsDateByGantt($objectID, $_POST['type']); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); -// $this->loadModel('action')->create('task', $objectID, 'ganttDrag', '', $this->app->user->account); + return $this->send(array('result' => 'success')); } } diff --git a/module/task/model.php b/module/task/model.php index a26082c9f5..b18bebe2fd 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3936,6 +3936,9 @@ class taskModel extends model $this->app->loadLang('project'); $post = fixer::input('post')->get(); $post->endDate = date('Y-m-d', strtotime('-1 day', strtotime($post->endDate))); + $changeTable = $objectType == 'task' ? TABLE_TASK : TABLE_PROJECT; + $actionType = $objectType == 'task' ? 'task' : 'execution'; + $oldObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch(); if($objectType == 'task') { $objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch(); @@ -4019,7 +4022,12 @@ class taskModel extends model { return false; } - + + $newObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch(); + $changes = common::createChanges($oldObject, $newObject); + $actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited'); + if(!empty($changes)) $this->loadModel('action')->logHistory($actionID, $changes); + return true; } From de80b35803825c4bba2b9df3150498acd9fec232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=88=9A?= Date: Fri, 12 Aug 2022 08:17:54 +0000 Subject: [PATCH 13/22] * Fix bug#26389,26333,26328 --- module/execution/model.php | 4 ++-- module/product/model.php | 6 +++--- module/search/control.php | 3 ++- module/search/model.php | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 14d8e21126..9944422cb3 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -396,7 +396,7 @@ class executionModel extends model $this->dao->insert(TABLE_EXECUTION)->data($sprint) ->autoCheck($skipFields = 'begin,end') ->batchcheck($this->config->execution->create->requiredFields, 'notempty') - ->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'") + ->checkIF(!empty($sprint->name), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject and `deleted` = '0'") ->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban') and `deleted` = '0'") ->checkIF($sprint->begin != '', 'begin', 'date') ->checkIF($sprint->end != '', 'end', 'date') @@ -551,7 +551,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'") + ->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `deleted` = '0'") ->checkFlow() ->where('id')->eq($executionID) diff --git a/module/product/model.php b/module/product/model.php index bda572234c..3ee3ad29c2 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -680,7 +680,7 @@ class productModel extends model $programID = isset($product->program) ? $product->program : 0; $this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->create->requiredFields, 'notempty') - ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID and `deleted` = '0'") + ->checkIF(!empty($product->name), 'name', 'unique', "`program` = $programID and `deleted` = '0'") ->checkIF(!empty($product->code), 'code', 'unique', "`deleted` = '0'") ->checkFlow() ->exec(); @@ -770,10 +770,10 @@ class productModel extends model $this->lang->error->unique = $this->lang->error->repeat; $product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid); - $programID = isset($product->program) ? $product->program : ''; + $programID = isset($product->program) ? $product->program : 0; $this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->edit->requiredFields, 'notempty') - ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'") + ->checkIF(!empty($product->name), 'name', 'unique', "id != $productID and `program` = $programID and `deleted` = '0'") ->checkIF(!empty($product->code), 'code', 'unique', "id != $productID and `deleted` = '0'") ->checkFlow() ->where('id')->eq($productID) diff --git a/module/search/control.php b/module/search/control.php index 6971bb6295..a6325b3faa 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -231,10 +231,11 @@ class search extends control $pager = new pager(0, $this->config->search->recPerPage, $pageID); $results = $this->search->getList($words, $type, $pager); - $typeCount = $this->search->getListCount(''); + $typeCount = $this->search->getListCount(); $typeList = array('all' => $this->lang->search->modules['all']); foreach($typeCount as $objectType => $count) { + if(!isset($this->lang->search->modules[$objectType])) continue; $typeList[$objectType] = $this->lang->search->modules[$objectType]; } diff --git a/module/search/model.php b/module/search/model.php index 8132a948b3..4055974eb6 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -647,7 +647,7 @@ class searchModel extends model * @access public * @return array */ - public function getListCount($keywords, $type = 'all') + public function getListCount($keywords = '', $type = 'all') { list($words, $againstCond, $likeCondition, $allowedObject) = $this->getSqlParams($keywords, $type); From 886c39228772a59e81e1756d278b00b43ff7d2d4 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 12 Aug 2022 16:18:57 +0800 Subject: [PATCH 14/22] add cp gantt task move --- module/programplan/control.php | 2 +- module/task/model.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/programplan/control.php b/module/programplan/control.php index 1c02e0aae5..65d638fc6a 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -296,7 +296,7 @@ class programplan extends control $this->loadModel('task')->updateOrderByGantt(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $this->loadModel('action')->create('task', $taskID, 'ganttMove', '', $this->app->user->account); + // $this->loadModel('action')->create('task', $taskID, 'ganttMove', '', $this->app->user->account); return $this->send(array('result' => 'success')); } diff --git a/module/task/model.php b/module/task/model.php index b18bebe2fd..09587571a5 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -4024,10 +4024,10 @@ class taskModel extends model } $newObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch(); - $changes = common::createChanges($oldObject, $newObject); - $actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited'); + $changes = common::createChanges($oldObject, $newObject); + $actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited'); if(!empty($changes)) $this->loadModel('action')->logHistory($actionID, $changes); - + return true; } From 4dbf6940e67c808e858e7b8bc8fa65e6f36a2252 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 12 Aug 2022 16:39:07 +0800 Subject: [PATCH 15/22] * Fix bug #26395. --- module/execution/model.php | 2 +- module/programplan/view/gantt.html.php | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 5c441b0f47..14d8e21126 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -100,7 +100,7 @@ class executionModel extends model include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - if(isset($execution->cal) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); + if(isset($execution->acl) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); if($execution and $execution->lifetime == 'ops') { diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index b096d6d64a..d58bde8cf0 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -70,12 +70,17 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} rawModule);?> rawMethod);?> - +config->programplan->ganttCustom->ganttFields);?>
    - createLink('custom', 'ajaxSaveCustomFields', 'module=programplan§ion=ganttCustom&key=ganttFields')?> - + app->getMethodName() == 'browse') + { + $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=programplan§ion=ganttCustom&key=ganttFields'); + include '../../common/view/customfield.html.php'; + } + ?>
    @@ -475,12 +480,15 @@ $(function() $realname) + if(!empty($users)) { - $user = array(); - $user['key'] = $account; - $user['label'] = $realname; - $userList[] = $user; + foreach($users as $account => $realname) + { + $user = array(); + $user['key'] = $account; + $user['label'] = $realname; + $userList[] = $user; + } } ?> gantt.serverList("userList", ); From f28a05f25b5f4645bd1dafde2cc902a0984f5847 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 12 Aug 2022 16:40:51 +0800 Subject: [PATCH 16/22] * Add the xuanxuan update sql to standard sql. --- db/standard/zentao17.5.sql | 3 +++ module/upgrade/model.php | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/db/standard/zentao17.5.sql b/db/standard/zentao17.5.sql index 71e49578e5..2473991ba5 100644 --- a/db/standard/zentao17.5.sql +++ b/db/standard/zentao17.5.sql @@ -1182,11 +1182,14 @@ CREATE TABLE `zt_im_chat` ( `ownedBy` varchar(30) NOT NULL DEFAULT '', `editedBy` varchar(30) NOT NULL DEFAULT '', `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `mergedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `lastMessage` int(11) unsigned NOT NULL DEFAULT '0', `lastMessageIndex` int(11) unsigned NOT NULL DEFAULT 0, `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `pinnedMessages` text NOT NULL, + `mergedChats` text NOT NULL DEFAULT '', + `adminInvite` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `gid` (`gid`), KEY `name` (`name`), diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 5346f4ee33..54595796c7 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -535,8 +535,8 @@ class upgradeModel extends model if(!$executedXuanxuan) { $table = $this->config->db->prefix . 'im_chat'; - $result = $this->checkFieldsExists($table, 'adminInvite'); - if($result->rowCount() == 0) + $exists = $this->checkFieldsExists($table, 'adminInvite'); + if(!$exists) { $this->dbh->query("ALTER TABLE $table ADD `adminInvite` enum('0','1') NOT NULL DEFAULT '0' AFTER `mergedChats`"); } @@ -7052,10 +7052,12 @@ class upgradeModel extends model * @param string $table * @param string $field * @access public - * @return object + * @return bool */ public function checkFieldsExists($table, $field) { - return $this->dbh->query("show columns from `$table` like '$field'"); + $result = $this->dbh->query("show columns from `$table` like '$field'"); + + return $result->rowCount() > 0; } } From 0c117ef702ae007884b1d645a83c8d1eb393c7b0 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 12 Aug 2022 16:49:27 +0800 Subject: [PATCH 17/22] add gantt move order --- module/action/lang/de.php | 2 ++ module/action/lang/en.php | 2 ++ module/action/lang/fr.php | 2 ++ module/action/lang/zh-cn.php | 2 ++ module/programplan/control.php | 3 +-- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 909bc81a19..e92cc40c4c 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -382,6 +382,7 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'imported'; $lang->action->label->updatetolib = 'updated'; +$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass; @@ -539,6 +540,7 @@ $lang->action->dynamicAction->task['undeleted'] = 'Restore Task'; $lang->action->dynamicAction->task['hidden'] = 'Hide Task'; $lang->action->dynamicAction->task['svncommited'] = 'SVN Commit'; $lang->action->dynamicAction->task['gitcommited'] = 'GIT Commit'; +$lang->action->dynamicAction->task['ganttmove'] = 'Order'; $lang->action->dynamicAction->build['opened'] = 'Create Build'; $lang->action->dynamicAction->build['edited'] = 'Edit Build'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index a88734522b..5d0d27fa41 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -382,6 +382,7 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'imported'; $lang->action->label->updatetolib = 'updated'; +$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass; @@ -539,6 +540,7 @@ $lang->action->dynamicAction->task['undeleted'] = 'Restore Task'; $lang->action->dynamicAction->task['hidden'] = 'Hide Task'; $lang->action->dynamicAction->task['svncommited'] = 'SVN Commit'; $lang->action->dynamicAction->task['gitcommited'] = 'GIT Commit'; +$lang->action->dynamicAction->task['ganttmove'] = 'Order'; $lang->action->dynamicAction->build['opened'] = 'Create Build'; $lang->action->dynamicAction->build['edited'] = 'Edit Build'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index b0cd6a60d6..3efb026564 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -382,6 +382,7 @@ $lang->action->label->unlinkstory = 'unlink stories from'; $lang->action->label->unlinkbug = 'unlink bugs from'; $lang->action->label->tolib = 'Importé'; $lang->action->label->updatetolib = 'MàJ'; +$lang->action->label->ganttmove = 'sorted'; /* Dynamic information is grouped by object. */ $lang->action->dynamicAction = new stdclass(); @@ -539,6 +540,7 @@ $lang->action->dynamicAction->task['undeleted'] = 'Restaurer Tâche'; $lang->action->dynamicAction->task['hidden'] = 'Masquer Tâche'; $lang->action->dynamicAction->task['svncommited'] = 'Committer SVN'; $lang->action->dynamicAction->task['gitcommited'] = 'Committer GIT'; +$lang->action->dynamicAction->task['ganttmove'] = 'Order'; $lang->action->dynamicAction->build['opened'] = 'Créer Build'; $lang->action->dynamicAction->build['edited'] = 'Editer Build'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index ae7ce48891..69c382104d 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -382,6 +382,7 @@ $lang->action->label->unlinkstory = '移除需求从'; $lang->action->label->unlinkbug = '移除BUG从'; $lang->action->label->tolib = '导入了'; $lang->action->label->updatetolib = '更新了'; +$lang->action->label->ganttmove = '排序了'; /* 动态信息按照对象分组 */ $lang->action->dynamicAction = new stdclass(); @@ -539,6 +540,7 @@ $lang->action->dynamicAction->task['undeleted'] = '还原任务'; $lang->action->dynamicAction->task['hidden'] = '隐藏任务'; $lang->action->dynamicAction->task['svncommited'] = 'SVN提交'; $lang->action->dynamicAction->task['gitcommited'] = 'GIT提交'; +$lang->action->dynamicAction->task['ganttmove'] = '排序'; $lang->action->dynamicAction->build['opened'] = '创建版本'; $lang->action->dynamicAction->build['edited'] = '编辑版本'; diff --git a/module/programplan/control.php b/module/programplan/control.php index 65d638fc6a..2c66ab4dfa 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -296,8 +296,7 @@ class programplan extends control $this->loadModel('task')->updateOrderByGantt(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - // $this->loadModel('action')->create('task', $taskID, 'ganttMove', '', $this->app->user->account); - + $this->loadModel('action')->create('task', $taskID, 'ganttMove'); return $this->send(array('result' => 'success')); } } From 4f60c73ab5c73cf8965ac222b82e90a1db085085 Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Fri, 12 Aug 2022 08:52:29 +0000 Subject: [PATCH 18/22] * Fix bug #26364 --- module/execution/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 97e0b3d9ad..5f98f51b32 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -23,7 +23,7 @@ arrow . ' ' . $lang->execution->edit;?>
    - id);?> + systemMode == 'new') echo html::hidden('project', $project->id);?> systemMode == 'new' and isset($project)):?> From b1aa1f2ea6a276478ac864887c7330d4f217fcf4 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 12 Aug 2022 17:00:53 +0800 Subject: [PATCH 19/22] * Add the xxc to changelog. --- doc/CHANGELOG | 30 ++++++++++++++++++++++++++++++ module/misc/lang/de.php | 2 +- module/misc/lang/en.php | 2 +- module/misc/lang/fr.php | 2 +- module/misc/lang/zh-cn.php | 2 +- 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d87103ea47..f701b65279 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -111,6 +111,23 @@ 35218 复制项目的交互样式优化 35310 复制项目增加团队成员与权限复制 36036 关闭审批后停用发起动作,再次开启审批未自动启用动作 +禅道客户端: +34119 一键包集成喧喧网页端 +34460 优化会话中禅道链接卡片的跳转交互 +34667 完善XXD命令行应用给出的提示 +34668 修改docker入口脚本,确保owt中的rabbitmq正常启动 +34669 服务器地址不正确导致客户端登录失败后,尝试去掉路径后进行重试 +34670 完善音视频服务器端口配置和提示 +34671 优化音视频服务配置中“是否启用HTTPS”的设置 +34672 设计并增加离线部署SRS音视频的方案 +34673 没有麦克风时允许加入会议 +34848 解决服务器时间和客户端时间不一样的问题 +35087 研究喧喧和其他应用系统的多页面集成 +35088 删除服务器聊天记录的功能 +35268 通过服务端下载客户端后,登录时带入服务端地址 +35280 实现自动清理解散90天以上群数据的功能 +35294 后台检查XXC是否有新版时去掉XXB的版本判断 +35297 网络诊断时给出具体提示以引导用户 修复的Bug 22662 执行任务列表父子任务显示错乱 24608 英文下批量编辑执行页面执行状态名称显示不全 @@ -120,6 +137,19 @@ 25837 产品-计划的需求列表没有展示需求标题颜色 25851 导入任务相关研发需求详情弹窗中样式问题 25282 导入用户时,左右滚动条必须拖动到底部才显示 +25019 需要测试再进行详细确认:xxd以windows服务的形式启动(注意是在windows管理的服务里面点击启动),日志会存在C:\Windows\System32\log下 +25273 禅道卡片中的弹窗不展示 +25390 一张图片发送多人再撤回其中一张图,在其他窗口中图片显示已撤回 +25402 sendChatMessage返回值有问题 +25427 提示升级页面不显示了 +25526 后台没有被禁用的用户登录客户端时提示“账号被禁用” +25603 喧喧一键安装包安装xxd错误 +25605 独立消息记录窗口中链接打不开 +25622 连续发送消息不给提示 +25628 客户端链接转任务跳转到地盘 +25630 消息记录点击两次喧喧直接崩溃了 +25644 产品计划卡片没显示内容 +25646 禅道客户端一、口、x遮挡成员按钮 2022-07-27 17.4 完成的需求 diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php index a56b7e4176..90115bb702 100644 --- a/module/misc/lang/de.php +++ b/module/misc/lang/de.php @@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; -$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); +$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => ''); diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index b676ab24ce..b76497cf92 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; -$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); +$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => ''); diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php index a6a8bb3c35..7a70ca590f 100644 --- a/module/misc/lang/fr.php +++ b/module/misc/lang/fr.php @@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; -$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); +$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => ''); $lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => ''); diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index d0680416a5..1f74434ae5 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; -$lang->misc->feature->all['17.5'][] = array('title' => '优化禅道性能,数据库引擎从MyISAM调整为InnoDB。甘特图优化升级,旗舰版的复制项目可以复制任务等更多信息。修复Bug。', 'desc' => ''); +$lang->misc->feature->all['17.5'][] = array('title' => '提供高效的可视化统计工具。优化禅道性能,数据库引擎从MyISAM调整为InnoDB。甘特图优化升级,旗舰版的复制项目可以复制任务等更多信息。修复Bug。', 'desc' => ''); $lang->misc->feature->all['17.4'][] = array('title' => '详情页面的视觉优化和部分页面跳转逻辑优化。看板功能完善。文档创建和编辑页面优化。修复Bug。', 'desc' => ''); $lang->misc->feature->all['17.3'][] = array('title' => '统计、后台等模块的UI优化,用例库同步用例信息功能优化。修复Bug。', 'desc' => ''); $lang->misc->feature->all['17.2'][] = array('title' => '调整敏捷项目区块的展示,项目集、项目和测试相关UI优化,细节体验优化。修复Bug。', 'desc' => ''); From f9711bc44334221d67f03a13de657dc28f247889 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 12 Aug 2022 17:04:32 +0800 Subject: [PATCH 20/22] * Optimize code. --- module/programplan/view/gantt.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index d58bde8cf0..cd90dcc682 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -75,7 +75,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
    app->getMethodName() == 'browse') + if($this->app->getModuleName() == 'programplan') { $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=programplan§ion=ganttCustom&key=ganttFields'); include '../../common/view/customfield.html.php'; From 5915e3189cf5d7fb50d220e2ab4433e2504676fd Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 12 Aug 2022 17:04:49 +0800 Subject: [PATCH 21/22] add gantt move order --- module/task/model.php | 184 ++++++++++++++++++++++++------------------ 1 file changed, 107 insertions(+), 77 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 09587571a5..6717cb0f90 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3941,88 +3941,15 @@ class taskModel extends model $oldObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch(); if($objectType == 'task') { - $objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch(); - $parent = $objectData->parent; - $project = $objectData->project; - $execution = $objectData->execution; - $stage = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($execution)->andWhere('project')->eq($project)->fetch(); - - if($parent <= 0) - { - $parentData = $stage; - - $start = $parentData->begin; - $end = $parentData->end; - } - else - { - $parentData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parent)->fetch(); - - $start = helper::isZeroDate($parentData->estStarted) ? '' : $parentData->estStarted; - $end = helper::isZeroDate($parentData->deadline) ? '' : $parentData->deadline; - } - - if(helper::diffDate($start, $post->startDate) > 0) - { - $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; - return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); - } - - if(helper::diffDate($end, $post->endDate) < 0) - { - $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; - return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); - } - - $this->dao->update(TABLE_TASK) - ->set('estStarted')->eq($post->startDate) - ->set('deadline')->eq($post->endDate) - ->set('lastEditedBy')->eq($this->app->user->account) - ->where('id')->eq($objectID) - ->exec(); + $this->updateTaskEsDateByGantt($objectID, $objectType, $post); } elseif($objectType == 'plan') { - $objectData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch(); - $parent = $objectData->parent; - $project = $objectData->project; - - if(empty($parent)) - { - $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($project)->fetch(); - } - else - { - $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($parent)->fetch(); - } - - $start = helper::isZeroDate($parentData->begin) ? '' : $parentData->begin; - $end = helper::isZeroDate($parentData->end) ? '' : $parentData->end; - - if(helper::diffDate($start, $post->startDate) > 0) - { - $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; - return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); - } - - if(helper::diffDate($end, $post->endDate) < 0) - { - $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; - return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); - } - - $this->dao->update(TABLE_PROJECT) - ->set('begin')->eq($post->startDate) - ->set('end')->eq($post->endDate) - ->set('lastEditedBy')->eq($this->app->user->account) - ->where('id')->eq($objectID) - ->exec(); - } - else - { - return false; + $this->updateExecutionEsDateByGantt($objectID, $objectType, $post); } + if(dao::isError()) return false; + $newObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch(); $changes = common::createChanges($oldObject, $newObject); $actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited'); @@ -4031,6 +3958,109 @@ class taskModel extends model return true; } + /** + * Update Task estimate date by gantt. + * + * @param int $objectID + * @param string $objectType + * @param object $postData + * @access private + * @return bool + */ + private function updateTaskEsDateByGantt($objectID, $objectType, $postData) + { + $objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch(); + $parent = $objectData->parent; + $project = $objectData->project; + $execution = $objectData->execution; + $stage = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($execution)->andWhere('project')->eq($project)->fetch(); + + if($parent <= 0) + { + $parentData = $stage; + + $start = $parentData->begin; + $end = $parentData->end; + } + else + { + $parentData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parent)->fetch(); + + $start = helper::isZeroDate($parentData->estStarted) ? '' : $parentData->estStarted; + $end = helper::isZeroDate($parentData->deadline) ? '' : $parentData->deadline; + } + + if(helper::diffDate($start, $postData->startDate) > 0) + { + $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; + return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); + } + + if(helper::diffDate($end, $postData->endDate) < 0) + { + $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; + return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); + } + + $this->dao->update(TABLE_TASK) + ->set('estStarted')->eq($postData->startDate) + ->set('deadline')->eq($postData->endDate) + ->set('lastEditedBy')->eq($this->app->user->account) + ->where('id')->eq($objectID) + ->exec(); + + return true; + } + + /** + * Update Execution estimate date by gantt. + * + * @param int $objectID + * @param string $objectType + * @param object $postData + * @access private + * @return bool + */ + private function updateExecutionEsDateByGantt($objectID, $objectType, $postData) + { + $objectData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch(); + $parent = $objectData->parent; + $project = $objectData->project; + + if(empty($parent)) + { + $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($project)->fetch(); + } + else + { + $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($parent)->fetch(); + } + + $start = helper::isZeroDate($parentData->begin) ? '' : $parentData->begin; + $end = helper::isZeroDate($parentData->end) ? '' : $parentData->end; + + if(helper::diffDate($start, $postData->startDate) > 0) + { + $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; + return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); + } + + if(helper::diffDate($end, $postData->endDate) < 0) + { + $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; + return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); + } + + $this->dao->update(TABLE_PROJECT) + ->set('begin')->eq($postData->startDate) + ->set('end')->eq($postData->endDate) + ->set('lastEditedBy')->eq($this->app->user->account) + ->where('id')->eq($objectID) + ->exec(); + + return true; + } + /** * Update order by gantt. * From 5b49a262142fba3c77892fccded591e95aa72a63 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 17:16:45 +0800 Subject: [PATCH 22/22] * Modify unit test of caselib. --- test/class/caselib.class.php | 110 ++++++------------------ test/model/caselib/batchcreatecase.php | 6 +- test/model/caselib/buildsearchform.php | 28 ------ test/model/caselib/createfromimport.php | 10 ++- test/model/caselib/getliblink.php | 29 ------- test/model/caselib/setlibmenu.php | 25 ------ 6 files changed, 37 insertions(+), 171 deletions(-) delete mode 100755 test/model/caselib/buildsearchform.php delete mode 100755 test/model/caselib/getliblink.php delete mode 100755 test/model/caselib/setlibmenu.php diff --git a/test/class/caselib.class.php b/test/class/caselib.class.php index 19523316be..805c9250fb 100644 --- a/test/class/caselib.class.php +++ b/test/class/caselib.class.php @@ -7,28 +7,11 @@ class caselibTest $this->objectModel = $tester->loadModel('caselib'); } - /** - * Set lib menu test. - * - * @param mixed $libraries - * @param mixed $libID - * @access public - * @return void - */ - public function setLibMenuTest($libraries, $libID) - { - $objects = $this->objectModel->setLibMenu($libraries, $libID); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - /** * Save lib state test. - * - * @param int $libID - * @param array $libraries + * + * @param int $libID + * @param array $libraries * @access public * @return void */ @@ -43,9 +26,9 @@ class caselibTest /** * Get by ID test. - * - * @param mixed $libID - * @param mixed $setImgSize + * + * @param mixed $libID + * @param mixed $setImgSize * @access public * @return void */ @@ -60,8 +43,8 @@ class caselibTest /** * Update test. - * - * @param mixed $libID + * + * @param mixed $libID * @access public * @return void */ @@ -78,9 +61,9 @@ class caselibTest /** * Delete test. - * - * @param mixed $libID - * @param string $table + * + * @param mixed $libID + * @param string $table * @access public * @return void */ @@ -97,7 +80,7 @@ class caselibTest /** * Get libraries test. - * + * * @access public * @return void */ @@ -112,9 +95,9 @@ class caselibTest /** * Get list test. - * - * @param string $orderBy - * @param mixed $pager + * + * @param string $orderBy + * @param mixed $pager * @access public * @return void */ @@ -129,8 +112,8 @@ class caselibTest /** * Create test. - * - * @param mixed $param + * + * @param mixed $param * @access public * @return void */ @@ -149,13 +132,13 @@ class caselibTest /** * Get libcases test. - * - * @param mixed $libID - * @param mixed $browseType - * @param int $queryID - * @param int $moduleID - * @param string $sort - * @param mixed $pager + * + * @param mixed $libID + * @param mixed $browseType + * @param int $queryID + * @param int $moduleID + * @param string $sort + * @param mixed $pager * @access public * @return void */ @@ -168,47 +151,10 @@ class caselibTest return $objects; } - /** - * Build searchform test. - * - * @param mixed $libID - * @param mixed $libraries - * @param mixed $queryID - * @param mixed $actionURL - * @access public - * @return void - */ - public function buildSearchFormTest($libID, $libraries, $queryID, $actionURL) - { - $objects = $this->objectModel->buildSearchForm($libID, $libraries, $queryID, $actionURL); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - - /** - * Get liblink test. - * - * @param mixed $module - * @param mixed $method - * @param mixed $extra - * @access public - * @return void - */ - public function getLibLinkTest($module, $method, $extra) - { - $objects = $this->objectModel->getLibLink($module, $method, $extra); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - /** * Create from import test. - * - * @param mixed $libID + * + * @param mixed $libID * @access public * @return void */ @@ -223,8 +169,8 @@ class caselibTest /** * Batch create case test. - * - * @param mixed $libID + * + * @param mixed $libID * @access public * @return void */ diff --git a/test/model/caselib/batchcreatecase.php b/test/model/caselib/batchcreatecase.php index 074c29d3da..043129c789 100755 --- a/test/model/caselib/batchcreatecase.php +++ b/test/model/caselib/batchcreatecase.php @@ -34,7 +34,7 @@ $total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where( 'lib') $cases = $tester->dao->select('*')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetchAll('id'); r($total) && p() && e('12'); // 添加两条数据之后查询数据条数是否正确 -r($cases) && p('411:title,type') && e('测试导入添加1,performance'); // 添加数据之后查询新加用例的名称,用例类型 -r($cases) && p('412:title,type') && e('测试导入添加2,unit'); // 添加数据之后查询新加用例的名称,用例类型 +r($cases) && p('561:title,type') && e('测试导入添加1,performance'); // 添加数据之后查询新加用例的名称,用例类型 +r($cases) && p('562:title,type') && e('测试导入添加2,unit'); // 添加数据之后查询新加用例的名称,用例类型 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/model/caselib/buildsearchform.php b/test/model/caselib/buildsearchform.php deleted file mode 100755 index 24c06fb5a9..0000000000 --- a/test/model/caselib/buildsearchform.php +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env php -buildSearchForm(); -cid=1 -pid=1 - -测试设置的url参数 >> model/caselib/buildsearchform.php?m=caselib&f=browse&t=&libID=201&browseType=bySearch&queryID=myQueryID -测试设置的queryID值是否正确 >> 10 - -*/ - -$caselib = new caselibTest(); -$libID = 201; -$queryID = 10; -$actionURL = helper::createLink('caselib', 'browse', "libID=$libID&browseType=bySearch&queryID=myQueryID"); -$libs = $tester->loadModel('caselib')->getLibraries(); - -$caselib->buildSearchFormTest($libID, $libs, $queryID, $actionURL); -$search = $tester->config->testcase->search; - -r($search) && p('actionURL') && e('model/caselib/buildsearchform.php?m=caselib&f=browse&t=&libID=201&browseType=bySearch&queryID=myQueryID'); //测试设置的url参数 -r($search) && p('queryID') && e('10'); //测试设置的queryID值是否正确 \ No newline at end of file diff --git a/test/model/caselib/createfromimport.php b/test/model/caselib/createfromimport.php index 7c877d3471..97a5797df3 100755 --- a/test/model/caselib/createfromimport.php +++ b/test/model/caselib/createfromimport.php @@ -26,8 +26,10 @@ $_POST = array( 'type' => array(2 => 'performance', 3 => 'unit'), 'stage' => array(2 => array(), 3 => array()), 'keywords' => array(2 => 'keywords1', 3 => 'keywords2'), + 'status' => array(2 => '', 3 => ''), + 'desc' => array(2 => array(), 3 => array()), 'precondition' => array(2 => '', 3 => ''), - 'isEndPage' => 1, + 'isEndPage' => 0, 'pagerID' => 1 ); @@ -37,7 +39,7 @@ $total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where( 'lib') $cases = $tester->dao->select('*')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetchAll('id'); r($total) && p() && e('12'); //添加两条数据之后查询数据条数是否正确 -r($cases) && p('411:title,keywords') && e('测试导入添加1,keywords1'); //添加数据之后查询新加用例的名称,关键字 -r($cases) && p('412:title,keywords') && e('测试导入添加2,keywords2'); //添加数据之后查询新加用例的名称,关键字 +r($cases) && p('561:title,keywords') && e('测试导入添加1,keywords1'); //添加数据之后查询新加用例的名称,关键字 +r($cases) && p('562:title,keywords') && e('测试导入添加2,keywords2'); //添加数据之后查询新加用例的名称,关键字 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/model/caselib/getliblink.php b/test/model/caselib/getliblink.php deleted file mode 100755 index d807e33254..0000000000 --- a/test/model/caselib/getliblink.php +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env php -getLibLink(); -cid=1 -pid=1 - -测试参数情况1返回值 >> model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s -测试参数情况2返回值 >> model/caselib/getliblink.php?m=caselib&f=test&t=&libID=%s -测试参数情况3返回值 >> model/caselib/getliblink.php?m=tree&f=&t=&libID=%s&type=caselib¤tModuleID=0 -测试参数情况4返回值 >> model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s - -*/ - -$caselib = new caselibTest(); -$link1 = $caselib->getLibLinkTest('caselib', 'create', ''); -$link2 = $caselib->getLibLinkTest('caselib', 'test', ''); -$link3 = $caselib->getLibLinkTest('tree', '', ''); -$link4 = $caselib->getLibLinkTest('', '', ''); - -r($link1) && p() && e('model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s'); // 测试参数情况1返回值 -r($link2) && p() && e('model/caselib/getliblink.php?m=caselib&f=test&t=&libID=%s'); // 测试参数情况2返回值 -r($link3) && p() && e('model/caselib/getliblink.php?m=tree&f=&t=&libID=%s&type=caselib¤tModuleID=0'); // 测试参数情况3返回值 -r($link4) && p() && e('model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s'); // 测试参数情况4返回值 \ No newline at end of file diff --git a/test/model/caselib/setlibmenu.php b/test/model/caselib/setlibmenu.php deleted file mode 100755 index 5956ccde75..0000000000 --- a/test/model/caselib/setlibmenu.php +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env php -setLibMenu(); -cid=1 -pid=1 - -修改下拉菜单之后返回值 >> 1 - -*/ - -$caselib = new caselibTest(); -$libs = $tester->loadModel('caselib')->getLibraries(); -$config->webRoot = 'model/caselib/';//ztest运行时候获取的不一致 -$info = $caselib->setLibMenuTest($libs, 201); - -$menuStr = <<
    -EOT; -r($tester->lang->switcherMenu == trim($menuStr)) && p() && e('1'); //修改下拉菜单之后返回值 \ No newline at end of file