diff --git a/api/v1/entries/my.php b/api/v1/entries/my.php deleted file mode 100644 index 0031985771..0000000000 --- a/api/v1/entries/my.php +++ /dev/null @@ -1,22 +0,0 @@ -loadModel('my')->getInfo(); - $info->products = $this->loadModel('my')->getProducts(); - $info->projects = $this->loadModel('my')->getProjects(); - $info->joinProjectCount = count($info->projects); - $info->dynamic = $this->loadModel('my')->getDynamic(); - - if(!$info) return $this->sendError(400, $info->message); - $this->send(200, $info); - } -} diff --git a/api/v1/entries/product.php b/api/v1/entries/product.php index 524abf92d1..367e4594e2 100644 --- a/api/v1/entries/product.php +++ b/api/v1/entries/product.php @@ -14,7 +14,7 @@ class productEntry extends Entry $control->view($productID); $data = $this->getData(); - if(!$data or (isset($data->status) and $data->message == '404 Not found')) return $this->send404(); + if(!$data or (isset($data->message) and $data->message == '404 Not found')) return $this->send404(); if(isset($data->status) and $data->status == 'success') return $this->send(200, $this->format($data->data->product, 'createdDate:time')); if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message); diff --git a/api/v1/entries/productissue.php b/api/v1/entries/productissue.php index 1546897052..eecc5704c4 100644 --- a/api/v1/entries/productissue.php +++ b/api/v1/entries/productissue.php @@ -33,9 +33,8 @@ class productIssueEntry extends entry $issue->title = $story->title; $issue->labels = array($this->app->lang->story->common, zget($this->app->lang->story->categoryList, $story->category)); $issue->pri = $story->pri; - $issue->assignedTo = $this->entry->getAssignees('story', $story); $issue->openedDate = $story->openedDate; - $issue->openedBy = $this->entry->getUser($story->openedBy); + $issue->openedBy = $story->openedBy; $issue->lastEditedDate = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedDate : $story->lastEditedDate; $issue->lastEditedBy = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedBy : $story->lastEditedBy; $issue->status = $storyStatus[$story->status]; @@ -43,6 +42,16 @@ class productIssueEntry extends entry $storySpec = $this->dao->select('*')->from(TABLE_STORYSPEC)->where('story')->eq($id)->andWhere('version')->eq($story->version)->fetch(); $issue->desc = $storySpec->spec; + + if($story->assignedTo == "") + { + $issue->assignedTo = array(); + } + else + { + $issue->assignedTo = array($story->assignedTo); + } + break; case 'bug': $this->app->loadLang('bug'); @@ -55,15 +64,25 @@ class productIssueEntry extends entry $issue->title = $bug->title; $issue->labels = array($this->app->lang->bug->common, zget($this->app->lang->bug->typeList, $bug->type)); $issue->pri = $bug->pri; - $issue->assignedTo = $this->entry->getAssignees('bug', $bug); $issue->openedDate = $bug->openedDate; - $issue->openedBy = $this->entry->getUser($bug->openedBy); + $issue->openedBy = $bug->openedBy; $issue->lastEditedDate = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedDate : $bug->lastEditedDate; $issue->lastEditedBy = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedBy : $bug->lastEditedBy; $issue->status = $bugStatus[$bug->status]; $issue->url = helper::createLink('bug', 'view', "bugID=$id"); $issue->desc = $bug->steps; + + if($bug->assignedTo == "") + { + $issue->assignedTo = array(); + } + else + { + $issue->assignedTo = array($bug->assignedTo); + } + break; + case 'task': $this->app->loadLang('task'); $taskStatus = array('' => '', 'wait' => 'opened', 'doing' => 'opened', 'done' => 'opened', 'pause' => 'opened', 'cancel' => 'opened', 'closed' => 'closed'); @@ -75,22 +94,69 @@ class productIssueEntry extends entry $issue->title = $task->name; $issue->labels = array($this->app->lang->task->common, zget($this->app->lang->task->typeList, $task->type)); $issue->pri = $task->pri; - $issue->assignedTo = $this->entry->getAssignees('task', $task); $issue->openedDate = $task->openedDate; - $issue->openedBy = $this->entry->getUser($task->openedBy); + $issue->openedBy = $task->openedBy; $issue->lastEditedDate = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedDate : $task->lastEditedDate; $issue->lastEditedBy = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedBy : $task->lastEditedBy; $issue->status = $taskStatus[$task->status]; $issue->url = helper::createLink('task', 'view', "taskID=$id"); $issue->desc = $task->desc; + /* Get assignees for task, the task object has the type of multiple assign only so far. */ + $users = $this->dao->select('account')->from(TABLE_TEAM) + ->where('type')->eq('task') + ->andWhere('root')->eq($task->id) + ->fetchAll(); + if($users) + { + foreach($users as $user) + { + $issue->assignedTo[] = $user->account; + } + } + else + { + if($task->assignedTo == "") + { + $issue->assignedTo = array(); + } + else + { + $issue->assignedTo = array($task->assignedTo); + } + } + break; + default: $this->send404(); } $actions = $this->loadModel('action')->getList($type, $issueID); + /** + * Get all users in issues so that we can bulk get user detail later. + * + */ + $userList = array(); + foreach($issue->assignedTo as $user) + { + $userList[] = $user; + } + $userList[] = $issue->openedBy; + $userList = array_unique($userList); + $userDetails = $this->loadModel('user')->getUserDetailsForAPI($userList); + + /** + * Set the user detail to assignedTo and openedBy. + * + */ + foreach($issue->assignedTo as $index => $user) + { + $issue->assignedTo[$index] = $userDetails[$user]; + } + $issue->openedBy = $userDetails[$issue->openedBy]; + $this->send(200, array('issue' => $this->format($issue, 'openedDate:time,lastEditedDate:time'))); } } diff --git a/api/v1/entries/productissues.php b/api/v1/entries/productissues.php index a8c24b65c5..7c2e8d1abb 100644 --- a/api/v1/entries/productissues.php +++ b/api/v1/entries/productissues.php @@ -124,7 +124,7 @@ class productIssuesEntry extends entry ->beginIF($storyFilter != 'all')->andWhere('category')->in($storyFilter)->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); - foreach($stories as $story) $issues[] = array('id' => $story->id, 'type' => 'story', 'order' => $story->$order, 'status' => $this->getKey($story->status, $storyStatus)); + foreach($stories as $story) $issues[] = array('id' => $story->id, 'type' => 'story', 'order' => $story->$order, 'status' => $this->getKey($story->status, $storyStatus)); } if($bugFilter) @@ -136,7 +136,7 @@ class productIssuesEntry extends entry ->beginIF($bugFilter != 'all')->andWhere('type')->in($bugFilter)->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); - foreach($bugs as $bug) $issues[] = array('id' => $bug->id, 'type' => 'bug', 'order' => $bug->$order, 'status' => $this->getKey($bug->status, $bugStatus)); + foreach($bugs as $bug) $issues[] = array('id' => $bug->id, 'type' => 'bug', 'order' => $bug->$order, 'status' => $this->getKey($bug->status, $bugStatus)); } array_multisort(array_column($issues, 'order'), $sort == 'asc' ? SORT_ASC : SORT_DESC, $issues); @@ -190,13 +190,38 @@ class productIssuesEntry extends entry $r->title = $task->name; $r->labels = array($this->app->lang->task->common, zget($this->app->lang->task->typeList, $task->type)); $r->pri = $task->pri; - $r->assignedTo = $this->entry->getAssignees('task', $task); $r->openedDate = $task->openedDate; - $r->openedBy = $this->entry->getUser($task->openedBy); + $r->openedBy = $task->openedBy; $r->lastEditedDate = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedDate : $task->lastEditedDate; $r->lastEditedBy = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedBy : $task->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('task', 'view', "taskID=$task->id"); + $r->assignedTo = array(); + + /* Get assignees for task, the task object has the type of multiple assign only so far. */ + $users = $this->dao->select('account')->from(TABLE_TEAM) + ->where('type')->eq('task') + ->andWhere('root')->eq($task->id) + ->fetchAll(); + if($users) + { + foreach($users as $user) + { + $r->assignedTo[] = $user->account; + } + } + else + { + if($task->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($task->assignedTo); + } + } + } else if($issue['type'] == 'story') { @@ -206,13 +231,21 @@ class productIssuesEntry extends entry $r->title = $story->title; $r->labels = array($this->app->lang->story->common, zget($this->app->lang->story->categoryList, $story->category)); $r->pri = $story->pri; - $r->assignedTo = $this->entry->getAssignees('story', $story); $r->openedDate = $story->openedDate; - $r->openedBy = $this->entry->getUser($story->openedBy); + $r->openedBy = $story->openedBy; $r->lastEditedDate = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedDate : $story->lastEditedDate; $r->lastEditedBy = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedBy : $story->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('story', 'view', "storyID=$story->id"); + + if($story->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($story->assignedTo); + } } else if($issue['type'] == 'bug') { @@ -222,18 +255,55 @@ class productIssuesEntry extends entry $r->title = $bug->title; $r->labels = array($this->app->lang->bug->common, zget($this->app->lang->bug->typeList, $bug->type)); $r->pri = $bug->pri; - $r->assignedTo = $this->entry->getAssignees('bug', $bug); $r->openedDate = $bug->openedDate; - $r->openedBy = $this->entry->getUser($bug->openedBy); + $r->openedBy = $bug->openedBy; $r->lastEditedDate = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedDate : $bug->lastEditedDate; $r->lastEditedBy = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedBy : $bug->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('bug', 'view', "bugID=$bug->id"); + + if($bug->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($bug->assignedTo); + } } $result[] = $this->format($r, 'openedDate:time,lastEditedDate:time'); } + /** + * Get all users in issues so that we can bulk get user detail later. + * + */ + $userList = array(); + foreach($result as $issue) + { + foreach($issue->assignedTo as $user) + { + $userList[] = $user; + } + $userList[] = $issue->openedBy; + } + $userList = array_unique($userList); + $userDetails = $this->loadModel('user')->getUserDetailsForAPI($userList); + + /** + * Set the user detail to assignedTo and openedBy. + * + */ + foreach($result as $issue) + { + foreach($issue->assignedTo as $index => $user) + { + $issue->assignedTo[$index] = $userDetails[$user]; + } + $issue->openedBy = $userDetails[$issue->openedBy]; + } + return $result; } diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index ecc5faa910..b736b6d65a 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -10,6 +10,10 @@ class userEntry extends Entry { public function get($userID = 0) { + /* Get my info defaultly. */ + if(!$userID) return $this->getInfo(); + + /* Get user by id. */ $control = $this->loadController('user', 'profile'); $control->profile($userID); @@ -20,6 +24,25 @@ class userEntry extends Entry $this->send(200, $this->format($user, 'last:time,locked:time')); } + private function getInfo() + { + $info = $this->loadModel('my')->getInfo(); + + $products = $this->my->getProducts(); + $info->product = new stdclass(); + $info->product->total = count($products); + $info->product->products = $products; + + $projects = $this->my->getProjects(); + $info->project = new stdclass(); + $info->project->total = count($projects); + $info->project->projects = $projects; + + $info->actions = $this->my->getActions(); + + $this->send(200, $info); + } + public function put($userID) { $oldUser = $this->loadModel('user')->getByID($userID, 'id'); diff --git a/config/routes.php b/config/routes.php index a18c4c579f..bf01be4eaf 100644 --- a/config/routes.php +++ b/config/routes.php @@ -33,7 +33,7 @@ $routes['/tasks/:id/finish'] = 'taskFinish'; $routes['/users'] = 'users'; $routes['/users/:id'] = 'user'; -$routes['/my'] = 'my'; +$routes['/user'] = 'user'; $routes['/programs'] = 'programs'; $routes['/programs/:id'] = 'program'; diff --git a/db/update15.3.sql b/db/update15.3.sql index f0b147e39f..58685d2dd9 100644 --- a/db/update15.3.sql +++ b/db/update15.3.sql @@ -1,4 +1,4 @@ ALTER TABLE `zt_testtask` ADD `realFinishedDate` datetime NOT NULL AFTER `end`; -ALTER TABLE `zt_doc` ADD `tempContent` longtext NOT NULL AFTER `views`; +ALTER TABLE `zt_doc` ADD `draft` longtext NOT NULL AFTER `views`; ALTER TABLE `zt_release` ADD `mailto` text AFTER `desc`; ALTER TABLE `zt_release` ADD `notify` varchar(255) AFTER `mailto`; diff --git a/db/zentao.sql b/db/zentao.sql index bb9005b28e..1ffcfa5d74 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -310,7 +310,7 @@ CREATE TABLE IF NOT EXISTS `zt_doc` ( `keywords` varchar(255) NOT NULL, `type` varchar(30) NOT NULL, `views` smallint(5) unsigned NOT NULL, - `tempContent` longtext NOT NULL, + `draft` longtext NOT NULL, `collector` text NOT NULL, `addedBy` varchar(30) NOT NULL, `addedDate` datetime NOT NULL, @@ -1345,7 +1345,7 @@ INSERT INTO `zt_group` (`id`, `name`, `role`, `desc`) VALUES (10, 'OTHERS', 'others', 'for others.'), (11, 'guest', 'guest', 'For guest'), (12, 'LIMITED', 'limited', 'For limited user'), -(13, '项目管理员', 'projectAdmin', '项目管理员可以维护项目的权限'); +(13, 'Project Admin', 'projectAdmin', 'Project Admins manage project privileges'); INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'action','editComment'), diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index a5c472ed06..d360de0edb 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -151,30 +151,32 @@ class gitlab } /** - * Get branch + * Get branches. * * @access public * @return array */ public function branch() { - $branches = array(); - $api = "branches"; - + /* Max size of per_page in gitlab API is 100. */ $params = array(); $params['per_page'] = '100'; + + $branches = array(); for($page = 1; true; $page ++) { $params['page'] = $page; - $list = $this->fetch($api, $params); - if(empty($list)) break; + $branchList = $this->fetch("branches", $params); + if(empty($branchList)) break; - foreach($list as $branch) + foreach($branchList as $branch) { if(!isset($branch->name)) continue; $branches[$branch->name] = $branch->name; } - if(count($list) < $params['per_page']) break; + + /* Last page. */ + if(count($branchList) < $params['per_page']) break; } if(empty($branches)) $branches['master'] = 'master'; @@ -523,7 +525,6 @@ class gitlab if(!scm::checkRevision($version)) return array(); $api = "commits"; - /* TODO Put getCommits into cron job. And check best size of $count. */ if(empty($count)) $count = 10; $params = array(); diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 0c2e2b5dd7..2404362138 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -23,8 +23,7 @@ $lang->action->action = 'Action'; $lang->action->actionID = 'Action ID'; $lang->action->date = 'Date'; $lang->action->extra = 'Extra'; - -$lang->action->system = 'System'; +$lang->action->system = 'System'; $lang->action->trash = 'Recycle'; $lang->action->undelete = 'Restore'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 4b02f6a749..0851e53781 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -23,8 +23,7 @@ $lang->action->action = '动作'; $lang->action->actionID = '记录ID'; $lang->action->date = '日期'; $lang->action->extra = '附加值'; - -$lang->action->system = '系统'; +$lang->action->system = '系统'; $lang->action->trash = '回收站'; $lang->action->undelete = '还原'; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index 7c4f9a2d07..c587f8e284 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -23,8 +23,7 @@ $lang->action->action = '動作'; $lang->action->actionID = '記錄ID'; $lang->action->date = '日期'; $lang->action->extra = '附加值'; - -$lang->action->system = '系統'; +$lang->action->system = '系統'; $lang->action->trash = '資源回收筒'; $lang->action->undelete = '還原'; diff --git a/module/action/model.php b/module/action/model.php index f3fbe9325c..471854534c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1006,7 +1006,8 @@ class actionModel extends model if($object->type == 'project') $objectProject[$object->id] = $object->id; } } - elseif($objectType == 'stakeholder'){ + elseif($objectType == 'stakeholder') + { $objectName = $this->dao->select("t1.id, t2.realname")->from($table)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on("t1.{$field} = t2.account") ->where('t1.id')->in($objectIds) @@ -1055,7 +1056,8 @@ class actionModel extends model $objectType = strtolower($action->objectType); $action->originalDate = $action->date; $action->date = date(DT_MONTHTIME2, strtotime($action->date)); - $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : (isset($this->lang->$objectType->$actionType) ? $this->lang->$objectType->$actionType : $action->action); + $action->actionLabel = isset($this->lang->$objectType->$actionType) ? $this->lang->$objectType->$actionType : $action->action; + $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : $action->actionLabel; $action->objectLabel = $objectType; if(isset($this->lang->action->label->$objectType)) { @@ -1108,25 +1110,24 @@ class actionModel extends model $method = $this->config->action->assetViewMethod[$action->objectType]; } - $action->objectLink = helper::createLink('assetlib', $method, sprintf($vars, $action->objectID), '', '', $projectID); + $action->objectLink = helper::createLink('assetlib', $method, sprintf($vars, $action->objectID)); } else { if($action->objectType == 'doclib') { $docLib = $this->dao->select('type,product,project,execution,deleted')->from(TABLE_DOCLIB)->where('id')->eq($action->objectID)->fetch(); - $docLib->type = $docLib->type == 'execution' ? 'project' : $docLib->type; - $docLib->objectID = strpos('product,project', $docLib->type) !== false ? $docLib->{$docLib->type} : 0; + $docLib->objectID = strpos('product,project,execution', $docLib->type) !== false ? $docLib->{$docLib->type} : 0; $appendLib = $docLib->deleted == '1' ? $action->objectID : 0; $action->objectLink = helper::createLink('doc', 'objectLibs', sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib)); } elseif($action->objectType == 'user') { - $action->objectLink = !isset($deptUsers[$action->objectID]) ? 'javascript:void(0)' : helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID), '', '', $projectID); + $action->objectLink = !isset($deptUsers[$action->objectID]) ? 'javascript:void(0)' : helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); } else { - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID), '', '', $projectID); + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); } } $action->objectLabel = $objectLabel; diff --git a/module/bug/model.php b/module/bug/model.php index 4cef62c809..ee0a994d51 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -285,7 +285,7 @@ class bugModel extends model public function createBugFromGitlabIssue($bug, $executionID) { $bug->openedBy = $this->app->user->account; - $bug->openedDate = helper::now(); // TODO(dingguodong) use from issue->created_at ? + $bug->openedDate = helper::now(); $bug->assignedDate = isset($bug->assignedTo) ? helper::now() : 0; $bug->openedBuild = 'trunk'; $bug->story = 0; @@ -1817,7 +1817,7 @@ class bugModel extends model $bugSteps .= $this->lang->bug->tplResult; $bugSteps .= $this->lang->bug->tplExpect; } - + if(!empty($run->task)) $testtask = $this->loadModel('testtask')->getById($run->task); $executionID = isset($testtask->execution) ? $testtask->execution : 0; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 36be812a37..c8e1d76b5a 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -36,8 +36,8 @@ $lang->help = 'Help'; $lang->aboutZenTao = 'About'; $lang->profile = 'Profile'; $lang->changePassword = 'Password'; -$lang->unfoldMenu = 'Unfold Menu'; -$lang->collapseMenu = 'Collapse Menu'; +$lang->unfoldMenu = 'Unfold'; +$lang->collapseMenu = 'Collapse'; $lang->preference = 'Preference'; $lang->runInfo = "
Time %s MS, Memory %s KB, Query %s.
"; $lang->agreement = "I have read and agreed to the terms and conditions of Z PUBLIC LICENSE 1.2 . Without authorization, I should not remove, hide or cover any logos/links of ZenTao."; @@ -86,8 +86,8 @@ $lang->importSuccess = 'Saved'; $lang->fail = 'Fail'; $lang->addFiles = 'Added Files'; $lang->files = 'Files '; -$lang->pasteText = 'Multi-lines Paste'; -$lang->uploadImages = 'Multi-images Upload'; +$lang->pasteText = 'Multi-line Paste'; +$lang->uploadImages = 'Multi-image Upload'; $lang->timeout = 'Timeout. Check your newtwork connections, or try it again!'; $lang->repairTable = 'Database table might be damaged. Run phpmyadmin or myisamchk to fix it.'; $lang->duplicate = '%s has the same title as a file existed.'; @@ -144,7 +144,7 @@ $lang->admin->common = 'Admin'; $lang->task->common = 'Task'; $lang->bug->common = 'Bug'; $lang->testcase->common = 'Testcase'; -$lang->testtask->common = 'Testtask'; +$lang->testtask->common = 'Request'; $lang->score->common = 'Score'; $lang->build->common = 'Build'; $lang->testreport->common = 'Report'; @@ -185,7 +185,7 @@ $lang->track = 'Track'; $lang->settings = 'Settings'; $lang->overview = 'Overview'; $lang->module = 'Module'; -$lang->priv = 'Priv Group'; +$lang->priv = 'Privilege'; $lang->design = 'Design'; $lang->other = 'Other'; $lang->estimation = 'Estimation'; diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index 60149a36b2..990046fd20 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -5,8 +5,7 @@ $.initSidebar(); getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> - - +viewType != 'xhtml'):?>
loadModel('score')->getNotice(); ?>
diff --git a/module/execution/view/executionkanban.html.php b/module/execution/view/executionkanban.html.php index a7b00d03f0..b4b7775a76 100644 --- a/module/execution/view/executionkanban.html.php +++ b/module/execution/view/executionkanban.html.php @@ -22,7 +22,7 @@ execution->doingProject . ' (' . $projectCount . ')';?> execution->kanbanColType as $status => $colName):?> - + @@ -45,21 +45,7 @@
- $execution):?> - -
- createLink('execution', 'all', "status=closed&projectID=$projectID"), $execution, '', "title='$execution'"); - } - else - { - echo "$execution"; - } - ?> -
- +
status == 'doing' and isset($execution->delay)) echo "style='border-left: 3px solid red';";?>>
@@ -85,7 +71,6 @@
-
diff --git a/module/execution/view/managemembers.html.php b/module/execution/view/managemembers.html.php index 5b0476f8e0..ed523ff266 100644 --- a/module/execution/view/managemembers.html.php +++ b/module/execution/view/managemembers.html.php @@ -11,6 +11,8 @@ */ ?> +systemMode);?> +projectCommon);?> id);?> diff --git a/module/gitlab/model.php b/module/gitlab/model.php index e80bbf41e2..1d3b31d592 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -623,7 +623,6 @@ class gitlabModel extends model */ public function apiGetIssues($gitlabID, $projectID, $options = null) { - /* TODO(dingguodong) not pagination yet. */ if($options) { $url = sprintf($this->getApiRoot($gitlabID), "/projects/{$projectID}/issues") . '&per_page=20' . $options; diff --git a/module/index/lang/en.php b/module/index/lang/en.php index 4f1d780868..b2b1f44449 100644 --- a/module/index/lang/en.php +++ b/module/index/lang/en.php @@ -1,7 +1,7 @@ index->common = 'Home'; $lang->index->index = 'Home'; -$lang->index->pleaseInput = 'Please input'; +$lang->index->pleaseInput = 'Enter'; $lang->index->search = 'Search'; $lang->index->app = new stdClass(); @@ -14,4 +14,4 @@ $lang->index->upgradeNow = 'Upgrade now'; $lang->index->upgrade = 'Upgrade'; $lang->index->log = 'Log'; $lang->index->detailed = 'Details'; -$lang->index->website = 'Please visit the official website'; +$lang->index->website = 'Visit ZenTao official website'; diff --git a/module/message/model.php b/module/message/model.php index c8cfb2baad..c831c79e9c 100644 --- a/module/message/model.php +++ b/module/message/model.php @@ -15,7 +15,7 @@ class messageModel extends model { return $this->dao->select('*')->from(TABLE_NOTIFY) ->where('objectType')->eq('message') - ->andWhere('toList')->eq($this->app->user->account) + ->andWhere('toList')->like("%,{$this->app->user->account},%") ->beginIF($status)->andWhere('status')->eq($status)->fi() ->fetchAll('id'); } @@ -140,7 +140,7 @@ class messageModel extends model $notify = new stdclass(); $notify->objectType = 'message'; $notify->action = $actionID; - $notify->toList = $toList; + $notify->toList = str_replace(",{$actor},", '', ",$toList,"); $notify->data = $data; $notify->status = 'wait'; $notify->createdBy = $actor; @@ -168,12 +168,9 @@ class messageModel extends model { /* Get notifiy persons. */ $notifyPersons = array(); - if(!empty($toList->notify)) $notifyPersons = $this->loadModel('release')->getNotifyPersons($object->notify, $object->product, $object->build); + if(!empty($object->notify)) $notifyPersons = $this->loadModel('release')->getNotifyPersons($object->notify, $object->product, $object->build); - foreach($notifyPersons as $account) - { - if(strpos($object->mailto . ',', ",{$account},") === false) $toList .= ',' . $account; - } + if(!empty($notifyPersons)) $toList = implode(',', $notifyPersons); } if($toList == 'closed') $toList = ''; diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 29ed2df1c1..2a4ad2a4d4 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -19,7 +19,7 @@ $lang->misc->zentao->labels['about'] = 'About ZenTao'; $lang->misc->zentao->labels['support'] = 'Tech Support'; $lang->misc->zentao->labels['cowin'] = 'Help Us'; $lang->misc->zentao->labels['service'] = 'Service'; -$lang->misc->zentao->labels['others'] = 'EasyCorp Products'; +$lang->misc->zentao->labels['others'] = 'From EasyCorp'; $lang->misc->zentao->icons['about'] = 'group'; $lang->misc->zentao->icons['support'] = 'question-sign'; @@ -69,7 +69,7 @@ $lang->misc->tableName = "Table Name"; $lang->misc->tableStatus = "Status"; $lang->misc->novice = "New to ZenTao? Do you want to start ZenTao Tutorial?"; $lang->misc->showAnnual = 'Add Annual Summary'; -$lang->misc->annualDesc = 'After version 12.0, the Annual Summary can be viewed on 『Report->Annual Summary』 page. See now.'; +$lang->misc->annualDesc = 'After version 12.0, Annual Summary can be viewed on 『Report->Annual Summary』 page. See now.'; $lang->misc->remind = 'New feature reminders'; $lang->misc->noticeRepair = "
If you are not Administrator, contact your ZenTao Administrator to repair tables.
diff --git a/module/my/model.php b/module/my/model.php index 1805651168..0f66fb2e3d 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -58,7 +58,7 @@ class myModel extends model } /** - * My charged products. + * Get my charged products. * * @access public * @return array @@ -114,11 +114,12 @@ class myModel extends model if(isset($stories[$product->id])) $product->stories = $stories[$product->id]; if(isset($executions[$product->id])) $product->executions = $executions[$product->id]; } + return array_values($products); } /** - * All projects. + * Get my projects. * * @access public * @return array @@ -130,21 +131,21 @@ class myModel extends model { if($project->status == 'doing') { - $workhour = $this->loadModel('project')->getWorkhour($project->id); + $workhour = $this->project->getWorkhour($project->id); $projects[$key]->progress = ($workhour->totalConsumed + $workhour->totalLeft) ? floor($workhour->totalConsumed / ($workhour->totalConsumed + $workhour->totalLeft) * 1000) / 1000 * 100 : 0; } } + return array_values($projects); - } /** - * Dynamic. + * Get latest actions. * * @access public * @return array */ - public function getDynamic() + public function getActions() { $actions = $this->loadModel('action')->getDynamic('all', 'today', 'date_desc'); $users = $this->loadModel('user')->getPairs('noletter'); @@ -174,12 +175,12 @@ class myModel extends model if(common::hasPriv('task', 'view')) { $tasks = $this->dao->select('*')->from(TABLE_TASK) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq('0') - ->andWhere('status')->ne('closed') - ->orderBy('id_desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->ne('closed') + ->orderBy('id_desc') + ->limit(3) + ->fetchAll(); $info->task->dynamic = $tasks; } @@ -190,12 +191,12 @@ class myModel extends model if(common::hasPriv('story', 'view')) { $stories = $this->dao->select('*')->from(TABLE_STORY) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq('0') - ->andWhere('status')->ne('closed') - ->orderBy('id_desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->ne('closed') + ->orderBy('id_desc') + ->limit(3) + ->fetchAll(); $info->story->dynamic = $stories; } @@ -207,30 +208,30 @@ class myModel extends model { $this->app->loadLang('bug'); $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq('0') - ->andWhere('status')->ne('closed') - ->orderBy('id_desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->ne('closed') + ->orderBy('id_desc') + ->limit(3) + ->fetchAll(); $info->bug->dynamic = $bugs; } /* My todos. */ $info->todo = new stdclass(); $info->todo->total = (int) $this->dao->select('count(*) AS count')->from(TABLE_TODO)->where('assignedTo')->eq($this->app->user->account)->andWhere('status')->ne('closed')->andWhere('deleted')->eq(0)->fetch('count'); - $info->todo->dynamic = new stdclass(); + $info->todo->dynamic = array(); if(common::hasPriv('todo', 'view')) { $this->app->loadClass('date'); $todos = $this->dao->select('*')->from(TABLE_TODO) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('cycle')->eq(0) - ->andWhere('deleted')->eq(0) - ->andWhere('status')->eq('wait') - ->orderBy('`date` desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('cycle')->eq(0) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->eq('wait') + ->orderBy('`date` desc') + ->limit(3) + ->fetchAll(); foreach($todos as $key => $todo) { $todo->begin = date::formatTime($todo->begin); @@ -242,16 +243,16 @@ class myModel extends model /* My risks. */ $info->risk = new stdclass(); $info->risk->total = 0; - $info->risk->dynamic = new stdclass(); + $info->risk->dynamic = array(); if(common::hasPriv('risk', 'view') and isset($this->config->maxVersion)) { $risks = $this->dao->select('*')->from(TABLE_RISK) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq('0') - ->andWhere('status')->ne('closed') - ->orderBy('id_desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->ne('closed') + ->orderBy('id_desc') + ->limit(3) + ->fetchAll(); $info->risk->total = (int) $this->dao->select('count(*) AS count')->from(TABLE_RISK)->where('assignedTo')->eq($this->app->user->account)->andWhere('status')->ne('closed')->andWhere('deleted')->eq(0)->fetch('count'); $info->risk->dynamic = $risks; } @@ -259,23 +260,23 @@ class myModel extends model /* My meetings. */ $info->meeting = new stdclass(); $info->meeting->total = 0; - $info->meeting->dynamic = new stdclass(); + $info->meeting->dynamic = array(); if(common::hasPriv('meeting', 'view') and isset($this->config->maxVersion)) { $today = helper::today(); $now = date('H:i:s', strtotime(helper::now())); $meetings = $this->dao->select('*')->from(TABLE_MEETING) - ->Where('deleted')->eq('0') - ->andWhere('(date')->gt($today) - ->orWhere('(begin')->gt($now) - ->andWhere('date')->eq($today) - ->markRight(2) - ->andwhere('(host')->eq($this->app->user->account) - ->orWhere('participant')->in($this->app->user->account) - ->markRight(1) - ->orderBy('id_desc') - ->fetchAll(); + ->Where('deleted')->eq('0') + ->andWhere('(date')->gt($today) + ->orWhere('(begin')->gt($now) + ->andWhere('date')->eq($today) + ->markRight(2) + ->andwhere('(host')->eq($this->app->user->account) + ->orWhere('participant')->in($this->app->user->account) + ->markRight(1) + ->orderBy('id_desc') + ->fetchAll(); $info->meeting->total = count($meetings); $info->meeting->dynamic = array_slice($meetings, 0, 3); } @@ -283,22 +284,23 @@ class myModel extends model /* My issues. */ $info->issue = new stdclass(); $info->issue->total = 0; - $info->issue->dynamic = new stdclass(); + $info->issue->dynamic = array(); if(common::hasPriv('issue', 'view') and isset($this->config->maxVersion)) { $issues = $this->dao->select('*')->from(TABLE_ISSUE) - ->where('assignedTo')->eq($this->app->user->account) - ->andWhere('deleted')->eq('0') - ->andWhere('status')->ne('closed') - ->orderBy('id_desc') - ->limit(3) - ->fetchAll(); + ->where('assignedTo')->eq($this->app->user->account) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->ne('closed') + ->orderBy('id_desc') + ->limit(3) + ->fetchAll(); $info->issue->total = (int) $this->dao->select('count(*) AS count')->from(TABLE_ISSUE)->where('assignedTo')->eq($this->app->user->account)->andWhere('status')->ne('closed')->andWhere('deleted')->eq(0)->fetch('count'); $info->issue->dynamic = $issues; } - /* Some count. */ - $info->createdDocs = $this->dao->select('count(*) AS count')->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq('0')->fetch('count'); + /* Get count of docs created by me. */ + $info->doc = new stdclass(); + $info->doc->total = $this->dao->select('count(*) AS count')->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq('0')->fetch('count'); return $info; } diff --git a/module/personnel/control.php b/module/personnel/control.php index fc3b80d5fa..2b33b8cf42 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -202,7 +202,7 @@ class personnel extends control $this->view->objectID = $objectID; $this->view->objectType = $objectType; $this->view->objectName = $objectName; - $this->view->objects = array('' => '') + $this->personnel->getCopyObjects($objectID, $objectType); + $this->view->objects = array('' => '') + $this->personnel->getCopiedObjects($objectID, $objectType); $this->view->module = $module; $this->view->deptID = $deptID; $this->view->appendUsers = $appendUsers; diff --git a/module/personnel/css/addwhitelist.css b/module/personnel/css/addwhitelist.css new file mode 100644 index 0000000000..c1e69764bd --- /dev/null +++ b/module/personnel/css/addwhitelist.css @@ -0,0 +1,2 @@ +#object_chosen .chosen-single, #dept_chosen .chosen-single {width: 220px;} +#object_chosen .chosen-drop ul li .label {margin-top: 2px; background: #fff; color: #838a9d; border: 1px solid #d8d8d8;} diff --git a/module/personnel/js/addwhitelist.js b/module/personnel/js/addwhitelist.js index 083645bb30..62b8cc95d3 100644 --- a/module/personnel/js/addwhitelist.js +++ b/module/personnel/js/addwhitelist.js @@ -136,4 +136,9 @@ $(function() showItem(val); }); }); + + $('#object_chosen').click(function() + { + if(systemMode == 'new' && objectType == 'sprint') $('#object_chosen ul li:first').append(' ') + }) }) diff --git a/module/personnel/model.php b/module/personnel/model.php index 1372c50f92..7184ecf012 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -457,14 +457,14 @@ class personnelModel extends model } /** - * Get objects to copy whitelist. + * Get objects to copy. * * @param int $objectID * @param int $objectType * @access public * @return array */ - public function getCopyObjects($objectID, $objectType) + public function getCopiedObjects($objectID, $objectType) { $objects = array(); @@ -485,8 +485,7 @@ class personnelModel extends model ->fetchPairs(); foreach($objects as $id => &$object) { - if($id == $parentID) $object = $this->lang->projectCommon . '-' . $object; - if($id != $parentID) $object = $this->lang->execution->common . '-' . $object; + if($id != $parentID) $object = '   ' . $object; } } elseif($objectType == 'project') diff --git a/module/personnel/view/addwhitelist.html.php b/module/personnel/view/addwhitelist.html.php index e2cf748926..715b06fede 100644 --- a/module/personnel/view/addwhitelist.html.php +++ b/module/personnel/view/addwhitelist.html.php @@ -13,7 +13,8 @@ - +systemMode);?> +projectCommon);?>