diff --git a/module/api/control.php b/module/api/control.php index d601c7ba31..0c3c7253a0 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -414,21 +414,7 @@ class api extends control { if(helper::isAjaxRequest() && !empty($_POST)) { - $this->loadModel('api'); - - $now = helper::now(); - $userId = $this->app->user->account; - $params = fixer::input('post') - ->remove('type') - ->skipSpecial('params,response') - ->add('addedBy', $userId) - ->add('addedDate', $now) - ->add('editedBy', $userId) - ->add('editedDate', $now) - ->setDefault('product,module', 0) - ->get(); - - $changes = $this->api->update($apiID, $params); + $changes = $this->api->update($apiID); if(dao::isError()) return $this->sendError(dao::getError()); if($changes) diff --git a/module/api/css/index.css b/module/api/css/index.css index 3b8c3f5263..228854c88d 100644 --- a/module/api/css/index.css +++ b/module/api/css/index.css @@ -11,7 +11,7 @@ .main-col .doc-title {display: flex; font-size: 16px; margin-bottom: 15px;} .main-col .doc-title .title {margin: 0; line-height: 30px; font-size: 25px;} .main-col .doc-title .http-method {line-height: 27px; height: 27px; font-size: 13px; margin-right: 10px; padding: 0 10px;} -.main-col .doc-title .path { line-height: 30px; font-size: 20px; margin-right: 15px;} +.main-col .doc-title .path { line-height: 30px; font-size: 20px; margin-right: 15px;width:60%;word-wrap: break-word; } .main-col .doc-title .info {flex: 1 1 0;} .main-col .doc-title .version a {font-size: 13px; color: #8c8c8c;} .main-col .doc-title .version .dropdown-menu a:hover {color: #ffffff;} diff --git a/module/api/model.php b/module/api/model.php index c5171d84e8..47c37c18ae 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -177,7 +177,7 @@ class apiModel extends model /** * Delete a struct. * - * @param int $id + * @param int $id * @access public * @return void */ @@ -192,14 +192,29 @@ class apiModel extends model /** * Update an api doc. * - * @param int $id - * @param object $data + * @param int $apiID * @access public - * @return void + * @return bool|array */ - public function update($id, $data) + public function update($apiID) { - $oldApi = $this->dao->findByID($id)->from(TABLE_API)->fetch(); + $oldApi = $this->dao->findByID($apiID)->from(TABLE_API)->fetch(); + + if(!empty($_POST['editedDate']) and $oldApi->editedDate != $this->post->editedDate) + { + dao::$errors[] = $this->lang->error->editedByOther; + return false; + } + + $now = helper::now(); + $account = $this->app->user->account; + $data = fixer::input('post') + ->remove('type') + ->skipSpecial('params,response') + ->add('editedBy', $account) + ->add('editedDate', $now) + ->setDefault('product,module', 0) + ->get(); $data->id = $oldApi->id; $data->version = $oldApi->version + 1; @@ -212,7 +227,7 @@ class apiModel extends model ->data($data) ->autoCheck() ->batchCheck($this->config->api->edit->requiredFields, 'notempty') - ->where('id')->eq($id) + ->where('id')->eq($apiID) ->exec(); return common::createChanges($oldApi, $data); diff --git a/module/api/view/edit.html.php b/module/api/view/edit.html.php index 5441e6b912..0aba1ce526 100644 --- a/module/api/view/edit.html.php +++ b/module/api/view/edit.html.php @@ -227,6 +227,7 @@ js::set('api', $api); + editedDate);?> goback, "data-app='{$app->tab}'");?> goback, '', "class='btn btn-back btn-wide'");?> diff --git a/module/bug/model.php b/module/bug/model.php index 8cfa5e97a6..ce3d53ac9c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -202,7 +202,10 @@ class bugModel extends model foreach(explode(',', $this->config->bug->create->requiredFields) as $field) { $field = trim($field); - if($field and isset($bug->$field) and empty($bug->$field)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->$field))); + if($field and empty($bug->$field)) + { + die(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->$field))); + } } $bugs[$i] = $bug; diff --git a/module/install/lang/en.php b/module/install/lang/en.php index d19fe950e9..5f33fbb725 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -48,7 +48,10 @@ $lang->install->introductionContent = <<Dear users, welcome to ZenTao project management system.

ZenTao has two managment modes in version 15.0 and up. One is the classic management mode, providing two core features, Product and Project; the other is a new project management mode, with Program and Execution added. The following is an introduction to the new mode:

-

Program

+
+

Program

+

Program is used to manage a group of products and projects, and the company executives or PMO can use it for strategic planning.

+

Product

Product is used to subdivide the company's strategy into requirements that can be developed, and the product manager can use it to make release plans.

diff --git a/module/product/css/view.css b/module/product/css/view.css index 537f2b58fa..1f7d2f9caa 100644 --- a/module/product/css/view.css +++ b/module/product/css/view.css @@ -5,3 +5,6 @@ td.normal {color: #00da88;} td.acl {white-space: nowrap;} .row > .col-sm-12:first-child {padding-bottom: 20px;} +.c-product ,.c-release ,.c-code {width: 100px !important;} +.c-openedBy ,.c-acl ,.c-common {width:110px !important;} +.c-bugs {width:120px !important;} diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index b5b6bb9692..7d0552716e 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -43,9 +43,9 @@ - + - + @@ -64,13 +64,13 @@ code)):?> - + - + @@ -86,10 +86,10 @@ code)):?> - + - + acl == 'custom'):?> @@ -116,11 +116,11 @@ - + - + diff --git a/module/release/model.php b/module/release/model.php index 3ffa2e60e0..da4afb63c3 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -474,7 +474,7 @@ class releaseModel extends model public function changeStatus($releaseID, $status) { $this->dao->update(TABLE_RELEASE)->set('status')->eq($status)->where('id')->eq($releaseID)->exec(); - return dao::isError(); + return !dao::isError(); } /** diff --git a/module/story/lang/de.php b/module/story/lang/de.php index e589726df6..7e01c9697c 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -254,7 +254,7 @@ $lang->story->lblClose = 'Close'; $lang->story->lblTBC = 'Task/Bug/Case'; $lang->story->checkAffection = 'Impact'; -$lang->story->affectedProjects = "{$lang->project->common}s/{$lang->execution->common}s"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "{$lang->project->common}s/{$lang->execution->common}s" : "{$lang->project->common}s"; $lang->story->affectedBugs = 'Bug'; $lang->story->affectedCases = 'Fall'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index d59c74c0bb..9424fb6cdd 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -115,8 +115,8 @@ $lang->story->stage = 'Phase'; $lang->story->stageAB = 'Phase'; $lang->story->stagedBy = 'SetBy'; $lang->story->mailto = 'Mailto'; -$lang->story->openedBy = 'CreatedBy'; -$lang->story->openedDate = 'CreatedDate'; +$lang->story->openedBy = 'Created By'; +$lang->story->openedDate = 'Created Date'; $lang->story->assignedTo = 'AssignTo'; $lang->story->assignedDate = 'AssignedDate'; $lang->story->lastEditedBy = 'EditedBy'; @@ -256,7 +256,7 @@ $lang->story->lblClose = 'Close'; $lang->story->lblTBC = 'Task/Bug/Case'; $lang->story->checkAffection = 'Influence'; -$lang->story->affectedProjects = "{$lang->project->common}s/{$lang->execution->common}s"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "{$lang->project->common}s/{$lang->execution->common}s" : "{$lang->project->common}s"; $lang->story->affectedBugs = 'Bugs'; $lang->story->affectedCases = 'Cases'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 3246283bd3..e90d636936 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -254,7 +254,7 @@ $lang->story->lblClose = 'Fermer'; $lang->story->lblTBC = 'Tâche/Bug/CasTest'; $lang->story->checkAffection = 'Influence'; -$lang->story->affectedProjects = "{$lang->project->common}s/{$lang->execution->common}s"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "{$lang->project->common}s/{$lang->execution->common}s" : "{$lang->project->common}s"; $lang->story->affectedBugs = 'Bugs'; $lang->story->affectedCases = 'CasTests'; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index b8d22f1713..b12e410b61 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -254,7 +254,7 @@ $lang->story->lblClose = 'Đóng'; $lang->story->lblTBC = 'Nhiệm vụ/Bug/Tình huống'; $lang->story->checkAffection = 'Ảnh hưởng'; -$lang->story->affectedProjects = "{$lang->project->common}s/{$lang->execution->common}s"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "{$lang->project->common}s/{$lang->execution->common}s" : "{$lang->project->common}s"; $lang->story->affectedBugs = 'Bugs'; $lang->story->affectedCases = 'Tình huống'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 30e658b15b..1d34df98bd 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -256,7 +256,7 @@ $lang->story->lblClose = "关闭{$lang->SRCommon}"; $lang->story->lblTBC = '任务Bug用例'; $lang->story->checkAffection = '影响范围'; -$lang->story->affectedProjects = "影响的{$lang->project->common}或{$lang->execution->common}"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "影响的{$lang->project->common}或{$lang->execution->common}" : "影响的{$lang->project->common}"; $lang->story->affectedBugs = '影响的Bug'; $lang->story->affectedCases = '影响的用例'; diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php index a71dd8030a..c25e83ec61 100644 --- a/module/story/lang/zh-tw.php +++ b/module/story/lang/zh-tw.php @@ -256,7 +256,7 @@ $lang->story->lblClose = "關閉{$lang->SRCommon}"; $lang->story->lblTBC = '任務Bug用例'; $lang->story->checkAffection = '影響範圍'; -$lang->story->affectedProjects = "影響的{$lang->project->common}或{$lang->execution->common}"; +$lang->story->affectedProjects = $config->systemMode == 'new' ? "影響的{$lang->project->common}或{$lang->execution->common}": "影響的{$lang->project->common}"; $lang->story->affectedBugs = '影響的Bug'; $lang->story->affectedCases = '影響的用例'; diff --git a/module/story/model.php b/module/story/model.php index 90cc985186..25a49f5c07 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3771,7 +3771,7 @@ class storyModel extends model common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', $vars . "&from=$story->from", $story, 'list', '', '', '', false, "data-group=$story->from"); if($story->type != 'requirement') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', '', false, "data-app='qa'"); - common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&storyID=$story->id", $story, 'list', 'split', '', '', '', '', $this->lang->story->subdivide); + if($this->app->rawModule != 'projectstory') common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&storyID=$story->id", $story, 'list', 'split', '', '', '', '', $this->lang->story->subdivide); if($this->app->rawModule == 'projectstory') common::printIcon('projectstory', 'unlinkStory', "projectID={$this->session->project}&storyID=$story->id", '', 'list', 'unlink', 'hiddenwin'); } else diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index e7ee7788cc..2b11382752 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -222,16 +222,6 @@ $(document).on('mousedown', 'select', function() $(function() { - /* Adjust width for ie chosen width. */ - if(!hiddenStory) - { - var chosenWidth = $('#module1_chosen').width(); - } - else - { - var chosenWidth = 170; - } - $('.chosen-container[id^=module]').width(chosenWidth); $('.chosen-container[id^=module]').css('max-width', chosenWidth); diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index d8ff99104d..905c159823 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -51,8 +51,6 @@ } } $colspan = count($visibleFields) + 3; - $hiddenStory = (isonlybody() and $storyID) ? ' hidden' : ''; - if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; ?>
@@ -62,7 +60,7 @@
type != 'ops'):?> - + @@ -108,7 +106,7 @@ type != 'ops'):?> - -
productCommon;?> productCommon;?> PO);?> product->release;?> product->release;?> RD);?>
product->code;?>product->code;?> code;?> product->type;?> product->typeList, $product->type);?> story->openedBy?>story->openedBy?> createdBy);?>
productCommon . $lang->product->status;?>productCommon ." ". $lang->product->status;?> product->statusList, $product->status);?> product->acl;?>product->acl;?> code) ? "colspan='4'" : "colspan='2'";?>>product->aclList[$product->acl];?>
story->statusList['active'] . $space . $lang->story->common;?>story->statusList['active'] . $space . $lang->story->common;?> stories['active']?> product->plans?> plans?>product->bugs?>product->bugs?> bugs?>
idAB;?> '>task->module?> '>task->story;?>'>task->story;?> task->name;?> typeAB;?> style='overflow: visible'> + style='overflow: visible'>
@@ -176,7 +174,7 @@ id, \"%s\")'")?>
style='overflow: visible'> + style='overflow: visible'>
@@ -227,6 +225,5 @@ task->ditto);?> - diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 4ebce95de7..1edd84a1d6 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4584,7 +4584,7 @@ class upgradeModel extends model { $projectCase->project = $projectID; $projectCase->order = $projectCase->case * 5; - $this->dao->insert(TABLE_PROJECTCASE)->data($projectCase)->exec(); + $this->dao->replace(TABLE_PROJECTCASE)->data($projectCase)->exec(); } /* Put sprint cases into project case table. */ diff --git a/module/user/lang/de.php b/module/user/lang/de.php index 548a7c5e86..e1fac43bbf 100644 --- a/module/user/lang/de.php +++ b/module/user/lang/de.php @@ -121,7 +121,7 @@ $lang->user->testTask2Him = 'Build'; $lang->user->case2Him = 'Fall zugeordnet'; $lang->user->caseByHim = 'Fall geöffnet'; -$lang->user->errorDeny = "Sorry, your access to %s of %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; +$lang->user->errorDeny = "Sorry, your access to %2\$s of %1\$s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->errorView = "Sorry, your access view %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->loginFailed = "Login fehlgeschlagen. Bitte prüfen Sie Ihren Benutzernamen und das Passwort."; $lang->user->lockWarning = "Sie haben %s Versuche."; @@ -249,14 +249,14 @@ $lang->user->process4DB = "It is detected that you may be using the one click i $lang->user->mkdirWin = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
EOT; $lang->user->mkdirLinux = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
命令为:chmod o=rwx -R %s
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
Commond: chmod o=rwx -R %s.
diff --git a/module/user/lang/en.php b/module/user/lang/en.php index 615a392c1b..f964a41a94 100644 --- a/module/user/lang/en.php +++ b/module/user/lang/en.php @@ -137,7 +137,7 @@ $lang->user->testTask2Him = 'RequestsAssignedTo%s'; $lang->user->case2Him = 'CasesAssignedTo%s'; $lang->user->caseByHim = 'CasesCreatedBy%s'; -$lang->user->errorDeny = "Sorry, your access to %s of %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; +$lang->user->errorDeny = "Sorry, your access to %2\$s of %1\$s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->errorView = "Sorry, your access view %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->loginFailed = "Login failed. Please check your account and password."; $lang->user->lockWarning = "You can try %s times."; @@ -267,14 +267,14 @@ $lang->user->process4DB = "It is detected that you might use the one-click inst $lang->user->mkdirWin = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
A tmp directory cannot be created. Make sure the directory %s exists and you have the right permission.
EOT; $lang->user->mkdirLinux = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
命令为:chmod o=rwx -R %s
A tmp directory cannot be created. Make sure the directory %s exists and you have the right permission.
Commond: chmod o=rwx -R %s.
diff --git a/module/user/lang/fr.php b/module/user/lang/fr.php index ccb6cae872..4fee2d2e56 100644 --- a/module/user/lang/fr.php +++ b/module/user/lang/fr.php @@ -121,7 +121,7 @@ $lang->user->testTask2Him = 'Recette assignée à %s'; $lang->user->case2Him = 'CasTest assigné à %s'; $lang->user->caseByHim = 'CasTest créé par %s'; -$lang->user->errorDeny = "Sorry, your access to %s of %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; +$lang->user->errorDeny = "Sorry, your access to %2\$s of %1\$s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->errorView = "Sorry, your access view %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->loginFailed = "Echec de connexion. Vérifiez votre login et mot de passe."; $lang->user->lockWarning = "Vous avez %s essais."; @@ -249,14 +249,14 @@ $lang->user->process4DB = "It is detected that you may be using the one click i $lang->user->mkdirWin = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
EOT; $lang->user->mkdirLinux = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
命令为:chmod o=rwx -R %s
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
Commond: chmod o=rwx -R %s.
diff --git a/module/user/lang/vi.php b/module/user/lang/vi.php index 140b8826fe..be2c0df758 100644 --- a/module/user/lang/vi.php +++ b/module/user/lang/vi.php @@ -121,7 +121,7 @@ $lang->user->testTask2Him = 'Nhận yêu cầu'; $lang->user->case2Him = 'Nhận tình huống'; $lang->user->caseByHim = 'Tạo tình huống'; -$lang->user->errorDeny = "Sorry, your access to %s of %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; +$lang->user->errorDeny = "Sorry, your access to %2\$s of %1\$s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->errorView = "Sorry, your access view %s is denied. Please contact your Admin to get privileges. Return to home page or login again."; $lang->user->loginFailed = "Đăng nhập thất bại. Vui lòng kiểm tra tài khoản và mật khẩu của bạn."; $lang->user->lockWarning = "Bạn có thể thử %s lần."; @@ -249,14 +249,14 @@ $lang->user->process4DB = "It is detected that you may be using the one click i $lang->user->mkdirWin = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
EOT; $lang->user->mkdirLinux = <<
-
不能创建临时目录,请确认目录%s是否存在并有操作权限。
+
不能创建临时目录,请确认目录%s是否存在并有操作权限。
命令为:chmod o=rwx -R %s
Can't create tmp directory, make sure the directory %s exists and has permission to operate.
Commond: chmod o=rwx -R %s.
diff --git a/test/api/users/delete.php b/test/api/users/delete.php new file mode 100644 index 0000000000..34aa2671ff --- /dev/null +++ b/test/api/users/delete.php @@ -0,0 +1,18 @@ +#!use/bin/env php +> message:success + +*/ + +global $token; +$result = $rest->delete('/users/10', array('token' => $token->token)); + +r($result) && c(200) && p() && e("message:success") ; //删除ID为10的用户,判断返回信息 diff --git a/test/api/users/edit.php b/test/api/users/edit.php new file mode 100644 index 0000000000..60bb708d0a --- /dev/null +++ b/test/api/users/edit.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +> 李铁柱 + +*/ +global $token; +$user = $rest->put('/users/3', array('realname' => '李铁柱'), array('token' => $token->token)); + +r($user) && c(200) && p('realname') && e('李铁柱'); // 编辑ID为3的用户,获取真实姓名 \ No newline at end of file diff --git a/test/api/users/getbyid.php b/test/api/users/getbyid.php old mode 100755 new mode 100644 diff --git a/test/api/users/getlist.php b/test/api/users/getlist.php new file mode 100644 index 0000000000..548ecabcbd --- /dev/null +++ b/test/api/users/getlist.php @@ -0,0 +1,18 @@ +#!use/bin/env php +> admin,测试1 + +*/ + +global $token; +$list = $rest->get('/users?page=1&limit=2&order=id_asc', array('token' => $token->token)); + +r($list->body->users) && p('realname') && e('admin,测试1'); //获取用户列表,判断ID为1和2的真实姓名 \ No newline at end of file diff --git a/test/api/users/insert.php b/test/api/users/insert.php old mode 100755 new mode 100644 index 6a81af7f96..d39d497166 --- a/test/api/users/insert.php +++ b/test/api/users/insert.php @@ -16,7 +16,6 @@ $insert = array( 'account' => 'sgm', 'password' => 'qaz19950422', 'realname' => '孙广明', - 'gender' => 'm', 'email' => 'sgm0422@163.com', ); $user = $rest->post('/users', $insert, array('token' => $token->token));