From ebcf8e9b05cf140c89abce1f85bf7110e34ad867 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 09:28:17 +0800 Subject: [PATCH 01/10] * Fix bug #33660. --- module/doc/view/lefttree.html.php | 4 +-- module/doc/view/showfiles.html.php | 35 +++++++++++++++++++++++++- module/doc/view/tablecontents.html.php | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/module/doc/view/lefttree.html.php b/module/doc/view/lefttree.html.php index f97ae54674..a88e03672f 100644 --- a/module/doc/view/lefttree.html.php +++ b/module/doc/view/lefttree.html.php @@ -369,8 +369,7 @@ $(function() */ function lcatePage(libID, moduleID, type) { - - linkParams = linkParams.replace('%s', '&libID=' + libID + '&moduleID=' + moduleID); + linkParams = linkParams.replace('%s', 'libID=' + libID + '&moduleID=' + moduleID); var methodName = ''; if(config.currentModule == 'api') { @@ -388,7 +387,6 @@ $(function() linkParams = objectType == 'custom' ? 'type=custom&' + linkParams : linkParams; } - location.href = createLink(config.currentModule, methodName, linkParams); } diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 167edca46d..349bd57409 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -15,6 +15,7 @@ doc);?> + app->tab);?> @@ -69,10 +70,14 @@ pathname)) continue;?> + file->getImageSize($file); + $imageWidth = isset($imageSize[0]) ? $imageSize[0] : 0; + ?> id);?> extension, '', $file->title);?>'> extension, $config->file->imageExtensions)):?> -
+
id];?> @@ -233,5 +238,33 @@ function downloadFile(fileID, extension, imageWidth) } return false; } + +/** + * Set the max with of image. + * + * @access public + * @return void + */ +function setImageSize(image, maxWidth, maxHeight) +{ + var $image = $(image); + if($image.parent().prop('tagName').toLowerCase() == 'a') return; + + /* If not set maxWidth, set it auto. */ + if(!maxWidth) + { + bodyWidth = $('body').width(); + maxWidth = bodyWidth - 470; // The side bar's width is 336, and add some margins. + } + if(!maxHeight) maxHeight = $(top.window).height(); + + setTimeout(function() + { + maxHeightStyle = $image.height() > 0 ? 'max-height:' + maxHeight + 'px' : ''; + if(!document.getElementsByClassName('xxc-embed').length && $image.width() > 0 && $image.width() > maxWidth) $image.attr('width', maxWidth); + $image.wrap(''); + if($image.height() > 0 && $image.height() > maxHeight) $image.closest('a').append("" + lang.expand + " "); + }, 50); +} diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 93d6e470f3..71985041e9 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -12,7 +12,7 @@ ?> - + doc);?> From f5158ac6e06a3d1ae3fc7995ead142fd6b0bcdbb Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 09:33:06 +0800 Subject: [PATCH 02/10] * Fix bug #33647. --- module/api/view/createlib.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/api/view/createlib.html.php b/module/api/view/createlib.html.php index c04317f65b..1f90647228 100644 --- a/module/api/view/createlib.html.php +++ b/module/api/view/createlib.html.php @@ -28,13 +28,13 @@ api->libTypeList, $type, "onchange='toggleLibType(this.value)'")?> - + api->product;?> - + api->project;?> From 5d7165ea951047676f1cfdb03fb0d4e584768c78 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 09:45:26 +0800 Subject: [PATCH 03/10] * Fix bug #33637. --- module/api/css/index.css | 4 ++-- module/api/view/apilist.html.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/api/css/index.css b/module/api/css/index.css index c632eb7c53..d1a2d2eb31 100644 --- a/module/api/css/index.css +++ b/module/api/css/index.css @@ -24,7 +24,7 @@ .no-content-button {text-align: center; padding-top: 20px;} .no-content-button a:nth-child(2) {margin-left: 20px;} -.cell .detail .detail-title {padding-left: 5px; list-style: none;} +.apiList .detail .detail-title {padding-left: 5px; list-style: none;} .menu-actions {position: absolute; top: 7px; right: 45px; padding: 7px 8px;} .detail ul {position: relative;} .tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;} @@ -46,7 +46,7 @@ span.dotted-line+a {display: block;} .is-sorting > li > .tree-group {opacity: 1; border-radius: 4px;} .is-sorting > li ul {display: none!important;} li.drag-shadow ul {display: none!important;} -.cell {height: 100%;} +.apiList {height: 100%;} #queryBox #groupAndOr {min-width: 60px;} .tree li>.list-toggle {left: -4px;} diff --git a/module/api/view/apilist.html.php b/module/api/view/apilist.html.php index b41047ad78..e7f0ade3cf 100644 --- a/module/api/view/apilist.html.php +++ b/module/api/view/apilist.html.php @@ -81,7 +81,7 @@ -
+
  • 0 ? $lang->api->apiList : $lang->api->pageTitle;?>
  • From dd4f6dd90bdfe781f33d17ee4285a8b3acadfde6 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 09:55:58 +0800 Subject: [PATCH 04/10] * Fix bug #33639. --- module/api/view/editlib.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/api/view/editlib.html.php b/module/api/view/editlib.html.php index c7f2fb46d0..fe1c880f65 100644 --- a/module/api/view/editlib.html.php +++ b/module/api/view/editlib.html.php @@ -42,7 +42,7 @@ api->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?> - '> + '> api->whiteList;?>
    From 8273eb56ffc3d8ecfb2dad2d437550848eb44937 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 09:58:50 +0800 Subject: [PATCH 05/10] * Fix bug #33635. --- module/doc/lang/de.php | 2 +- module/doc/lang/fr.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 4469f75ff3..e052e4bd90 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -11,7 +11,7 @@ */ $lang->doclib = new stdclass(); $lang->doclib->name = 'Name'; -$lang->doclib->control = 'Zugriffskontrolle'; +$lang->doclib->control = 'Access Control'; $lang->doclib->group = 'Gruppe'; $lang->doclib->user = 'Benutzer'; $lang->doclib->files = 'Dateien'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index c2896eb533..e224861a05 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -11,7 +11,7 @@ */ $lang->doclib = new stdclass(); $lang->doclib->name = 'Nom'; -$lang->doclib->control = "Contrôle d'Accès"; +$lang->doclib->control = 'Access Control'; $lang->doclib->group = 'Groupe'; $lang->doclib->user = 'Utilisateur'; $lang->doclib->files = 'Pièces Jointes'; From 0280b418b20205c715fc3e421c62a794e81aa272 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 10:04:51 +0800 Subject: [PATCH 06/10] * Fix bug #33688. --- module/doc/view/createtexttype.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php index e68acbcb7a..2ed7f917fa 100644 --- a/module/doc/view/createtexttype.html.php +++ b/module/doc/view/createtexttype.html.php @@ -91,7 +91,7 @@ doc->keywords;?> - '>doc->keywordsTips}'");?> + '>doc->keywordsTips}'");?> doc->files;?> From 6d075a59c2f86e1574b949d4f13c3f92898be6b3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 10:23:50 +0800 Subject: [PATCH 07/10] * Fix bug #33635. --- module/doc/lang/de.php | 2 +- module/doc/lang/fr.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index e052e4bd90..5fbf6b438d 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -11,7 +11,7 @@ */ $lang->doclib = new stdclass(); $lang->doclib->name = 'Name'; -$lang->doclib->control = 'Access Control'; +$lang->doclib->control = 'Zugang'; $lang->doclib->group = 'Gruppe'; $lang->doclib->user = 'Benutzer'; $lang->doclib->files = 'Dateien'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index e224861a05..a4409ea990 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -11,7 +11,7 @@ */ $lang->doclib = new stdclass(); $lang->doclib->name = 'Nom'; -$lang->doclib->control = 'Access Control'; +$lang->doclib->control = 'Droit'; $lang->doclib->group = 'Groupe'; $lang->doclib->user = 'Utilisateur'; $lang->doclib->files = 'Pièces Jointes'; From 52a40837df1279ddf3d4fe596a4c9da2aaa318bd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 10:33:46 +0800 Subject: [PATCH 08/10] * Fix bug #33617. --- module/api/control.php | 2 +- module/doc/control.php | 12 ++++++------ module/doc/model.php | 10 ++++++---- module/execution/model.php | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 7385d80a54..892b236a29 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -431,7 +431,7 @@ class api extends control $this->view->objectID = $objectID; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed'); - $this->view->projects = $this->loadModel('project')->getPairsByModel(); + $this->view->projects = $this->loadModel('project')->getPairsByModel('scrum,waterfall,agileplus,waterfallplus'); $this->view->products = $this->loadModel('product')->getPairs(); $this->display(); diff --git a/module/doc/control.php b/module/doc/control.php index f750ff202b..36d3026a6d 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -151,7 +151,7 @@ class doc extends control if($type == 'product') $objects = $this->product->getPairs(); if($type == 'project') { - $objects = $this->project->getPairsByProgram(); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); if($this->app->tab == 'doc') { $this->view->executionPairs = array(0 => '') + $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); @@ -391,13 +391,13 @@ class doc extends control $objects = array(); if($objectType == 'project') { - $objects = $this->loadModel('project')->getPairs(); - $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); + $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'sprint,stage', 'multiple,leaf,noprefix'); } elseif($objectType == 'execution') { $execution = $this->loadModel('execution')->getById($objectID); - $objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix"); + $objects = $this->execution->getPairs($execution->project, 'sprint,stage', "multiple,leaf,noprefix"); } elseif($objectType == 'product') { @@ -552,7 +552,7 @@ class doc extends control $objects = array(); if($objectType == 'project') { - $objects = $this->loadModel('project')->getPairs(); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); } elseif($objectType == 'execution') { @@ -1494,7 +1494,7 @@ class doc extends control public function ajaxGetExecution($projectID) { $executions = $this->execution->getList($projectID); - $executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'all', 'multiple,leaf,noprefix'); + $executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'sprint,stage', 'multiple,leaf,noprefix'); $project = $this->project->getById($projectID); $disabled = $project->multiple ? '' : 'disabled'; diff --git a/module/doc/model.php b/module/doc/model.php index 1504433d4f..6948a52e0f 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -986,8 +986,8 @@ class docModel extends model $this->config->doc->search['module'] = 'contributeDoc'; $products = $this->product->getPairs(); - $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->doc->allProjects); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', 'kanban') + array('all' => $this->lang->doc->allProjects); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); $this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all); $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); @@ -1008,7 +1008,7 @@ class docModel extends model if($type == 'project') { - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); } else { @@ -1024,7 +1024,7 @@ class docModel extends model else { $products = $this->product->getPairs('nocode', $this->session->project); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); $this->config->doc->search['params']['lib']['values'] = array('' => '', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all); $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); } @@ -1587,6 +1587,7 @@ class docModel extends model ->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id') ->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%") ->andWhere('t1.vision')->eq($this->config->vision) + ->andWhere('t1.model')->ne('kanban') ->andWhere('t1.deleted')->eq(0) ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi() ->fetchPairs(); @@ -1596,6 +1597,7 @@ class docModel extends model ->where('type')->eq('project') ->andWhere('vision')->eq($this->config->vision) ->andWhere('deleted')->eq(0) + ->andWhere('model')->ne('kanban') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->orderBy('order_asc') ->fetchAll('id'); diff --git a/module/execution/model.php b/module/execution/model.php index 57e01c6c50..a343b46f3f 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1638,7 +1638,7 @@ class executionModel extends model ->beginIF(strpos($mode, 'multiple') !== false)->andWhere('multiple')->eq('1')->fi() ->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi() ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->beginIF($type != 'all')->andWhere('type')->eq($type)->fi() + ->beginIF($type != 'all')->andWhere('type')->in($type)->fi() ->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi() ->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy($orderBy) From bcfd37f6e465823e123bd162a3742b5415a37f38 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 10:54:30 +0800 Subject: [PATCH 09/10] * Fix bug #33697. --- module/tree/model.php | 7 +++++++ module/tree/view/edit.html.php | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/module/tree/model.php b/module/tree/model.php index 597179bd7a..7906ce47a3 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1837,6 +1837,13 @@ class treeModel extends model $repeatName = $this->checkUnique($self, array("id{$self->id}" => $module->name), array("id{$self->id}" => $module->branch)); if($repeatName) helper::end(js::alert(sprintf($this->lang->tree->repeatName, $repeatName))); + if((empty($module->root) or empty($module->name)) and in_array($self->type, array('doc', 'api'))) + { + $this->app->loadLang('doc'); + if(empty($module->root)) helper::end(js::alert(sprintf($this->lang->error->notempty, $this->lang->doc->lib))); + if(empty($module->name)) helper::end(js::alert(sprintf($this->lang->error->notempty, $this->lang->doc->catalogName))); + } + $modules = $self->type == 'story' ? $this->getOptionMenu($self->root, 'story', 0, 'all') : ''; $parent = $this->getById($this->post->parent); diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 9c20aa463d..5be8d6298d 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -23,7 +23,12 @@ if(isset($pageCSS)) css::internal($pageCSS); tree->edit; - if($type == 'doc' or $type == 'api') $lblEditTree = $lang->tree->editDir; + $required = ''; + if($type == 'doc' or $type == 'api') + { + $lblEditTree = $lang->tree->editDir; + $required = 'root,name'; + } if($type == 'line') $lblEditTree = $lang->tree->manageLine; echo $lblEditTree; ?> @@ -52,7 +57,7 @@ if(isset($pageCSS)) css::internal($pageCSS); doc->lib;?> - root, "class='form-control chosen'");?> + root, "class='form-control chosen'");?> type != 'line'):?> @@ -74,7 +79,7 @@ if(isset($pageCSS)) css::internal($pageCSS); echo $lblTreeName; ?> - name, "class='form-control'");?> + name, "class='form-control'");?> From a3e64446b4cbd2f52e9725ffce9760d13456b17a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 11:05:17 +0800 Subject: [PATCH 10/10] * Fix jump link for execution document library. --- module/doc/view/lefttree.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/view/lefttree.html.php b/module/doc/view/lefttree.html.php index a88e03672f..c4ba5ac4a2 100644 --- a/module/doc/view/lefttree.html.php +++ b/module/doc/view/lefttree.html.php @@ -383,8 +383,8 @@ $(function() } else { - methodName = objectType == 'custom' ? 'tableContents' : objectType + 'Space'; - linkParams = objectType == 'custom' ? 'type=custom&' + linkParams : linkParams; + methodName = objectType == 'execution' || objectType == 'custom' ? 'tableContents' : objectType + 'Space'; + linkParams = objectType == 'execution' || objectType == 'custom' ? 'type=' + objectType + '&' + linkParams : linkParams; } location.href = createLink(config.currentModule, methodName, linkParams);