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 @@
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 @@