diff --git a/db/zentao.sql b/db/zentao.sql index a0f5b70f0e..d45ae77472 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1445,6 +1445,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'doc','edit'), (1,'doc','editLib'), (1,'doc','index'), +(1,'doc','tableContents'), (1,'doc','objectLibs'), (1,'doc','showFiles'), (1,'doc','sort'), @@ -1860,6 +1861,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2,'doc','create'), (2,'doc','edit'), (2,'doc','index'), +(2,'doc','tableContents'), (2,'doc','objectLibs'), (2,'doc','showFiles'), (2,'doc','view'), @@ -2055,6 +2057,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3,'doc','create'), (3,'doc','edit'), (3,'doc','index'), +(3,'doc','tableContents'), (3,'doc','objectLibs'), (3,'doc','showFiles'), (3,'doc','view'), @@ -2305,6 +2308,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4,'doc','edit'), (4,'doc','editLib'), (4,'doc','index'), +(4,'doc','tableContents'), (4,'doc','objectLibs'), (4,'doc','showFiles'), (4,'doc','view'), @@ -2599,6 +2603,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5,'doc','edit'), (5,'doc','editLib'), (5,'doc','index'), +(5,'doc','tableContents'), (5,'doc','objectLibs'), (5,'doc','showFiles'), (5,'doc','view'), @@ -2921,6 +2926,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6,'doc','edit'), (6,'doc','editLib'), (6,'doc','index'), +(6,'doc','tableContents'), (6,'doc','objectLibs'), (6,'doc','showFiles'), (6,'doc','view'), @@ -3197,6 +3203,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7,'doc','edit'), (7,'doc','editLib'), (7,'doc','index'), +(7,'doc','tableContents'), (7,'doc','objectLibs'), (7,'doc','showFiles'), (7,'doc','view'), @@ -3485,6 +3492,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8,'doc','edit'), (8,'doc','editLib'), (8,'doc','index'), +(8,'doc','tableContents'), (8,'doc','objectLibs'), (8,'doc','showFiles'), (8,'doc','view'), @@ -3768,6 +3776,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9,'doc','edit'), (9,'doc','editLib'), (9,'doc','index'), +(9,'doc','tableContents'), (9,'doc','objectLibs'), (9,'doc','showFiles'), (9,'doc','view'), @@ -3980,6 +3989,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10,'doc','allLibs'), (10,'doc','browse'), (10,'doc','index'), +(10,'doc','tableContents'), (10,'doc','objectLibs'), (10,'doc','showFiles'), (10,'doc','view'), @@ -4101,6 +4111,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11,'doc','allLibs'), (11,'doc','browse'), (11,'doc','index'), +(11,'doc','tableContents'), (11,'doc','objectLibs'), (11,'doc','showFiles'), (11,'doc','view'), diff --git a/module/action/model.php b/module/action/model.php index e735fcfb39..0738ab9bbf 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -36,7 +36,7 @@ class actionModel extends model $actor = $actor ? $actor : $this->app->user->account; $actionType = strtolower($actionType); - $actor = $actionType == 'openedbysystem' ? '' : $actor; + $actor = ($actionType == 'openedbysystem' or $actionType == 'closedbysystem') ? '' : $actor; if($actor == 'guest' and $actionType == 'logout') return false; $objectType = str_replace('`', '', $objectType); @@ -965,7 +965,7 @@ class actionModel extends model $objectName = array(); $objectProject = array(); - if(strpos($this->config->action->needGetProjectType, $objectType) !== false) + if(strpos(",{$this->config->action->needGetProjectType},", ",{$objectType},") !== false) { $objectInfo = $this->dao->select("id, project, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll(); foreach($objectInfo as $object) diff --git a/module/caselib/model.php b/module/caselib/model.php index b0ebca73a3..efd7ce5c17 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -475,7 +475,7 @@ class caselibModel extends model } else { - $caseData->project = $this->session->project; + $caseData->project = (int)$this->session->project; $caseData->version = 1; $caseData->openedBy = $this->app->user->account; $caseData->openedDate = $now; diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index a96ecd15c0..c9e949c9ef 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -64,7 +64,7 @@ objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?> maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName)) + if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName)) { echo '#' . $action->objectID; } diff --git a/module/doc/control.php b/module/doc/control.php index 58b07227a7..7724b65df6 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -886,6 +886,7 @@ class doc extends control $lib = $this->doc->getLibById($libID); if(!empty($lib) and $lib->deleted == '1') $appendLib = $libID; + if($this->config->systemMode == 'classic' and $type == 'project') $type = 'execution'; list($libs, $libID, $object, $objectID) = $this->doc->setMenuByType($type, $objectID, $libID, $appendLib); /* Set Custom. */ diff --git a/module/doc/js/objectlibs.js b/module/doc/js/objectlibs.js index b45baa93d7..25ab8bb260 100644 --- a/module/doc/js/objectlibs.js +++ b/module/doc/js/objectlibs.js @@ -118,6 +118,15 @@ document.addEventListener('msfullscreenChange', function (e) $(function() { + $(document).keydown(function(event) + { + if($.cookie('isFullScreen') == 1) + { + if(event.keyCode == 37) $('#prevPage').click(); + if(event.keyCode == 39) $('#nextPage').click(); + } + }); + $('.outline').height($('.article-content').height()); $('#content').on('click', '.outline .outline-toggle i.icon-angle-right', function() diff --git a/module/doc/model.php b/module/doc/model.php index f17e84c49a..56dd28616c 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -255,9 +255,38 @@ class docModel extends model ->fetchAll('id'); } + $projects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.project') + ->where('t2.id')->in(array_keys($docs)) + ->andWhere('t2.execution')->eq(0) + ->fetchPairs(); + + $executions = $this->dao->select('t1.id, t1.name')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.execution') + ->where('t2.id')->in(array_keys($docs)) + ->fetchPairs(); + + $products = $this->dao->select('t1.id, t1.name')->from(TABLE_PRODUCT)->alias('t1') + ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.product') + ->where('t2.id')->in(array_keys($docs)) + ->fetchPairs(); + $docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc'); + + $objects = array('product' => 'products', 'execution' => 'executions', 'project' => 'projects'); foreach($docs as $index => $doc) { + foreach($objects as $type => $object) + { + if(!empty($doc->{$type})) + { + $doc->objectID = $doc->{$type}; + $doc->objectName = ${$object}[$doc->{$type}]; + $doc->objectType = $type; + break; + } + } + $docs[$index]->fileSize = 0; if(isset($files[$index])) { @@ -1076,6 +1105,11 @@ class docModel extends model ->where('deleted')->eq(0) ->andWhere($type)->eq($objectID) ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi() + ->beginIF($type == 'project') + ->andWhere('(execution')->eq(0) + ->orWhere('main')->eq(0) + ->markRight(1) + ->fi() ->orderBy('`order`, id') ->fetchAll('id'); } @@ -2242,7 +2276,7 @@ EOT; /* Summary of each type. */ foreach($extensionCount as $extension => $count) { - if(in_array($this->app->getClientLang(), ['zh-cn','zh-tw'])) + if(in_array($this->app->getClientLang(), array('zh-cn','zh-tw'))) { $extensionSummary .= $extension . ' ' . $count . $this->lang->doc->ge . $this->lang->doc->point; } diff --git a/module/execution/css/kanban.css b/module/execution/css/kanban.css index 9e83f11bb6..41f2a2d128 100644 --- a/module/execution/css/kanban.css +++ b/module/execution/css/kanban.css @@ -22,7 +22,7 @@ .board-title {padding-right: 20px;} .board-actions {position: absolute; right: 3px; top: 3px;} .board-actions.nav > li > a {padding: 3px 3px;} -#kanban {overflow-y: auto;} +#kanban {overflow-y: auto; min-height:350px;} #kanban > .table {min-width: 1100px; table-layout: auto;} #kanban.dragging .boards.dragging .board {background: #eee; opacity: .35; border-color: #f1f1f1;} #kanban thead > tr > th {padding-left: 0; padding-right: 0;} diff --git a/module/execution/model.php b/module/execution/model.php index 0e416d6bb5..2c0ca5cd0f 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2279,7 +2279,7 @@ class executionModel extends model $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project'); $this->linkStory($executionID, $planStories, $planProducts); - $this->linkStory($projectID, $planStories, $planProducts); + if($this->config->systemMode == 'new') $this->linkStory($projectID, $planStories, $planProducts); if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate(helper::createLink('execution', 'create', "projectID=$projectID&executionID=$executionID")); } @@ -2434,7 +2434,7 @@ class executionModel extends model return $this->dao->select('account, role, hours') ->from(TABLE_TEAM) ->where('root')->eq($execution) - ->andWhere('type')->eq('execution') + ->andWhere('type')->in('project,execution') ->andWhere('account')->notIN($currentMembers) ->fetchAll('account'); } diff --git a/module/execution/view/dynamic.html.php b/module/execution/view/dynamic.html.php index 488962a9be..b7f7185db3 100755 --- a/module/execution/view/dynamic.html.php +++ b/module/execution/view/dynamic.html.php @@ -87,7 +87,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?> diff --git a/module/execution/view/treestory.html.php b/module/execution/view/treestory.html.php index 95f5d7e72e..e4d308484c 100644 --- a/module/execution/view/treestory.html.php +++ b/module/execution/view/treestory.html.php @@ -10,9 +10,9 @@
id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'fork', '', 'btn btn-info btn-icon'); + common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'btn btn-info btn-icon'); common::printIcon('story', 'delete', $vars, $story, 'list', 'trash', 'hiddenwin', 'btn btn-info btn-icon'); - common::printIcon('story', 'review', $vars, $story, 'list', 'glasses', '', 'btn btn-info btn-icon'); + common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'btn btn-info btn-icon'); common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'btn btn-info btn-icon iframe', true); common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'btn btn-info btn-icon'); common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'btn btn-info btn-icon'); diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 1fc8b0f9be..9284d875fe 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -140,6 +140,20 @@ $lang->resource->todo->activate = 'activate'; $lang->resource->todo->close = 'close'; $lang->resource->todo->batchClose = 'batchClose'; +/* Personnel . */ +$lang->resource->personnel = new stdclass(); +$lang->resource->personnel->accessible = 'accessible'; +$lang->resource->personnel->invest = 'invest'; +$lang->resource->personnel->whitelist = 'whitelist'; +$lang->resource->personnel->addWhitelist = 'addWhitelist'; +$lang->resource->personnel->unbindWhitelist = 'unbindWhitelist'; + +$lang->personnel->methodOrder[5] = 'accessible'; +$lang->personnel->methodOrder[10] = 'invest'; +$lang->personnel->methodOrder[15] = 'whitelist'; +$lang->personnel->methodOrder[20] = 'addWhitelist'; +$lang->personnel->methodOrder[25] = 'unbindWhitelist'; + global $config; if($config->systemMode == 'new') { @@ -267,20 +281,6 @@ if($config->systemMode == 'new') $lang->projectbuild->methodOrder[5] = 'browse'; - /* Personnel . */ - $lang->resource->personnel = new stdclass(); - $lang->resource->personnel->accessible = 'accessible'; - $lang->resource->personnel->invest = 'invest'; - $lang->resource->personnel->whitelist = 'whitelist'; - $lang->resource->personnel->addWhitelist = 'addWhitelist'; - $lang->resource->personnel->unbindWhitelist = 'unbindWhitelist'; - - $lang->personnel->methodOrder[5] = 'accessible'; - $lang->personnel->methodOrder[10] = 'invest'; - $lang->personnel->methodOrder[15] = 'whitelist'; - $lang->personnel->methodOrder[20] = 'addWhitelist'; - $lang->personnel->methodOrder[25] = 'unbindWhitelist'; - /* Project Story. */ $lang->resource->projectstory = new stdclass(); $lang->resource->projectstory->story = 'story'; diff --git a/module/index/js/index.js b/module/index/js/index.js index 5db7039709..c7703c866c 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -71,7 +71,7 @@ if(code) return code; var link = $.parseLink(urlOrModuleName); - if(!link.moduleName || link.isOnlyBody) return ''; + if(!link.moduleName || link.isOnlyBody || (link.moduleName === 'index' && link.methodName === 'index')) return ''; if(link.hash && link.hash.indexOf('app=') === 0) return link.hash.substr(4); @@ -463,7 +463,7 @@ { var $item = $(this); var isDivider = $item.hasClass('divider'); - var height = isDivider ? 17 : 40; + var height = isDivider ? 17 : ($.cookie('hideMenu') ? 44 : 40); currentHeight += height; if(currentHeight > maxHeight) { diff --git a/module/job/config.php b/module/job/config.php index 75baa8009d..d78c25c63e 100644 --- a/module/job/config.php +++ b/module/job/config.php @@ -2,5 +2,5 @@ $config->job = new stdclass(); $config->job->create = new stdclass(); $config->job->edit = new stdclass(); -$config->job->create->requiredFields = 'name,repo,server,pipeline,triggerType'; +$config->job->create->requiredFields = 'name,repo,engine,server,pipeline,triggerType'; $config->job->edit->requiredFields = 'name,repo,server,pipeline,triggerType'; diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index bec16a86e1..e375481f11 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -60,7 +60,7 @@ objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?> maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName)) + if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName)) { echo '#' . $action->objectID; } diff --git a/module/personnel/lang/zh-cn.php b/module/personnel/lang/zh-cn.php index 993b2b48b8..a262e8fb5d 100644 --- a/module/personnel/lang/zh-cn.php +++ b/module/personnel/lang/zh-cn.php @@ -1,7 +1,7 @@ personnel->common = '项目集人员'; +$lang->personnel->common = '可访问人员'; $lang->personnel->accessible = '可访问人员列表'; -$lang->personnel->invest = '投入人员列表'; +$lang->personnel->invest = '投入人员列表'; $lang->personnel->department = '部门'; $lang->personnel->realName = '真实姓名'; $lang->personnel->userName = '用户名'; diff --git a/module/personnel/model.php b/module/personnel/model.php index 4d7535b0b7..d6cd126d74 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -473,6 +473,7 @@ class personnelModel extends model ->where('t1.objectID')->eq($objectID) ->andWhere('t1.type')->eq('whitelist') ->andWhere('t1.objectType')->eq($objectType) + ->andWhere('t2.realname')->ne('') ->orderBy($orderBy) ->beginIF(!empty($pager))->page($pager)->fi() ->fetchAll(); @@ -488,7 +489,7 @@ class personnelModel extends model */ public function getWhitelistAccount($objectID = 0, $objectType = '') { - return $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($objectID)->andWhere('objectType')->eq($objectType)->fetchPairs('account'); + return $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($objectID)->andWhere('objectType')->eq($objectType)->fetchPairs('account', 'account'); } /** @@ -536,8 +537,18 @@ class personnelModel extends model if($updateType == 'increase') { $oldWhitelist = $this->dao->select('whitelist')->from($objectTable)->where('id')->eq($objectID)->fetch('whitelist'); - $oldWhitelist = explode(',', $oldWhitelist); - $accounts = array_unique(array_merge($accounts, $oldWhitelist)); + + $groups = $this->dao->select('id')->from(TABLE_GROUP)->where('id')->in($oldWhitelist)->fetchPairs('id', 'id'); + if($groups) + { + $oldWhitelist = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account', 'account'); + if($oldWhitelist) $accounts = array_unique(array_merge($accounts, $oldWhitelist)); + } + else + { + $oldWhitelist = $this->dao->select('account')->from(TABLE_USER)->where('account')->in($oldWhitelist)->fetchPairs('account', 'account'); + if($oldWhitelist) $accounts = array_unique(array_merge($accounts, $oldWhitelist)); + } } $whitelist = ',' . implode(',', $accounts); $this->dao->update($objectTable)->set('whitelist')->eq($whitelist)->where('id')->eq($objectID)->exec(); @@ -575,7 +586,7 @@ class personnelModel extends model $projectWhitelist = $this->getWhitelistAccount($sprint->project, 'project'); $newWhitelist = array_merge($projectWhitelist, $accounts); $source = $source == 'upgrade' ? 'upgrade' : 'sync'; - $this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source); + $this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source, $updateType); /* Removal of whitelisted persons from projects. */ if($updateType == 'replace') diff --git a/module/personnel/view/whitelist.html.php b/module/personnel/view/whitelist.html.php index dd4c75a106..7e95335470 100644 --- a/module/personnel/view/whitelist.html.php +++ b/module/personnel/view/whitelist.html.php @@ -58,8 +58,7 @@ email;?> createLink($module, 'unbindWhitelist', "id=$user->id&confirm=no"), '', 'hiddenwin', "title='{$lang->personnel->delete}' class='{$deleteClass}' $openApp"); + if(common::hasPriv($module, 'unbindWhitelist')) echo html::a($this->createLink($module, 'unbindWhitelist', "id=$user->id&confirm=no"), '', 'hiddenwin', "title='{$lang->personnel->delete}' class='btn' $openApp"); ?> diff --git a/module/product/view/dynamic.html.php b/module/product/view/dynamic.html.php index 15cfa32eb3..22a202c115 100755 --- a/module/product/view/dynamic.html.php +++ b/module/product/view/dynamic.html.php @@ -86,7 +86,7 @@ actionLabel;?> objectLabel;?> objectID;?> - objectLink, $action->objectName);?> + objectName) echo html::a($action->objectLink, $action->objectName);?>
diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index 35a85baca2..4e59f68dc1 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -62,8 +62,8 @@ project->statusList, $program->status, '');?> PM)):?> -
- PM, '')) ? html::image(zget($usersAvatar, $program->PM)) : strtoupper($program->PM[0]);?> +
+ PM]) ? html::image($usersAvatar[$program->PM]) : strtoupper($program->PM[0]);?>
PM]) ? $PMList[$program->PM]->id : '';?> PM);?> diff --git a/module/project/view/browsebycard.html.php b/module/project/view/browsebycard.html.php index b2758f0784..a80ca96b65 100644 --- a/module/project/view/browsebycard.html.php +++ b/module/project/view/browsebycard.html.php @@ -50,6 +50,7 @@ #cards .project-actions .open>.dropdown-menu ul {display: flex;} #cards .menu-actions .btn.btn-action {margin-bottom: -3px !important; margin-right: 5px;} #cards .icon-ellipsis-v {font-size: 13px;} +#cards .teamTitle {margin-bottom: 30px;}