From 6cb8ca59086084fd1c7c4c6dfc2fdabf4634c3be Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 9 Sep 2021 13:33:14 +0800 Subject: [PATCH 01/11] * Fix bug #14948. --- module/tree/model.php | 30 +++++++++++++++--------------- www/theme/default/style.css | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/module/tree/model.php b/module/tree/model.php index 555c847a0b..a547c4c696 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1033,16 +1033,16 @@ class treeModel extends model { $productID = zget($extra, 'productID', 0); $projectID = $extra['projectID']; - return html::a(helper::createLink('projectstory', 'story', "projectID=$projectID&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('projectstory', 'story', "projectID=$projectID&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } elseif(isset($extra['executionID']) and !empty($extra['executionID'])) { $executionID = $extra['executionID']; - return html::a(helper::createLink('execution', 'story', "executionID=$executionID&orderBy=order_desc&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('execution', 'story', "executionID=$executionID&orderBy=order_desc&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } else { - return html::a(helper::createLink('product', 'browse', "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('product', 'browse', "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } } @@ -1075,7 +1075,7 @@ class treeModel extends model { $executionID = $extra['executionID']; $productID = $extra['productID']; - return html::a(helper::createLink('execution', 'task', "executionID={$executionID}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('execution', 'task', "executionID={$executionID}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1090,7 +1090,7 @@ class treeModel extends model public function createProjectStoryLink($type, $module, $extra) { $productID = $extra['productID']; - return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}&productID=$productID&branch=&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1103,7 +1103,7 @@ class treeModel extends model */ public function createRequirementLink($type, $module) { - return html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "root={$module->root}&branch=&type=byModule¶m={$module->id}&storyType=requirement"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "root={$module->root}&branch=&type=byModule¶m={$module->id}&storyType=requirement"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1115,7 +1115,7 @@ class treeModel extends model */ public function createDocLink($type, $module, $extra = '') { - return html::a(helper::createLink('doc', 'browse', "libID={$module->root}&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('doc', 'browse', "libID={$module->root}&browseType=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1187,7 +1187,7 @@ class treeModel extends model */ public function createBugLink($type, $module) { - return html::a(helper::createLink('bug', 'browse', "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('bug', 'browse', "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1202,7 +1202,7 @@ class treeModel extends model $moduleName = $this->app->tab == 'project' ? 'project' : 'testcase'; $methodName = $this->app->tab == 'project' ? 'testcase' : 'browse'; $projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ''; - return html::a(helper::createLink($moduleName, $methodName, $projectParam . "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}'"); + return html::a(helper::createLink($moduleName, $methodName, $projectParam . "root={$module->root}&branch=&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}' title='{$module->name}'"); } /** @@ -1214,7 +1214,7 @@ class treeModel extends model */ public function createTestTaskLink($type, $module, $extra) { - return html::a(helper::createLink('testtask', 'cases', "taskID=$extra&type=byModule&module={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('testtask', 'cases', "taskID=$extra&type=byModule&module={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1227,7 +1227,7 @@ class treeModel extends model */ public function createCaseLibLink($type, $module) { - return html::a(helper::createLink('caselib', 'browse', "root={$module->root}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('caselib', 'browse', "root={$module->root}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1257,7 +1257,7 @@ class treeModel extends model */ public function createFeedbackLink($type, $module) { - return html::a(helper::createLink('feedback', $this->app->methodName, "type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}'"); + return html::a(helper::createLink('feedback', $this->app->methodName, "type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1270,7 +1270,7 @@ class treeModel extends model */ public function createTrainSkillLink($type, $module, $extra = '') { - return html::a(helper::createLink('trainskill', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}'"); + return html::a(helper::createLink('trainskill', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1283,7 +1283,7 @@ class treeModel extends model */ public function createTrainCourseLink($type, $module, $extra = '') { - return html::a(helper::createLink('traincourse', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}'"); + return html::a(helper::createLink('traincourse', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}' title='{$module->name}'"); } /** @@ -1296,7 +1296,7 @@ class treeModel extends model */ public function createTrainPostLink($type, $module, $extra = '') { - return html::a(helper::createLink('trainpost', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}'"); + return html::a(helper::createLink('trainpost', 'browse', "type=byModule¶m={$module->id}"), $module->name, '', "id='module{$module->id}' title='{$module->name}'"); } /** diff --git a/www/theme/default/style.css b/www/theme/default/style.css index c01679cbdf..6363418df5 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -70,3 +70,4 @@ a.showMoreImage:hover {opacity: 1;} #userNav .dropdown-menu, #userNav .create-list {margin-right: -15px !important; border-top: 0px;} #userNav .dropdown-menu .dropdown-submenu>ul {margin-right: 0px !important;} #userNav .create-list:hover:before {right: 21.5% !important;} +#modules li>a, #modules ul>li>a {overflow: hidden; white-space: nowrap;} From 851fa4a77af4ec25942093dd1d785c05eb014a90 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 9 Sep 2021 13:38:44 +0800 Subject: [PATCH 02/11] * Modify the problem that the avatar of the program list is incorrectly reported. --- lib/front/front.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/front/front.class.php b/lib/front/front.class.php index b097da7a91..0cae6b372e 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -278,7 +278,7 @@ class html extends baseHTML { $colorHue = (html::stringToCode($user->account) * $hueDistance) % 360; $style .= "background: hsl($colorHue, $saturation, $lightness);"; - if($size) $style .= 'font-size: ' . round($size * 2 / 3) . 'px;'; + if(is_numeric($size)) $style .= 'font-size: ' . round($size * 2 / 3) . 'px;'; } if(!empty($style)) $style = "style='$style'"; From 71c5376be7a212381b0999edfe41817f8a04ada1 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 9 Sep 2021 13:41:16 +0800 Subject: [PATCH 03/11] * bug #15069, fix doing execution and prooject count not show. --- module/common/view/kanban.html.php | 15 ++++++++++++++- www/js/zui/kanban/min.js | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index 9a6cf6bd3f..7278a11bf4 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -391,13 +391,26 @@ $.extend($.fn.kanban.Constructor.DEFAULTS, { if(col.type === 'doingProject') $col.attr('data-span-text', doingText); }, - onRenderKanban: function($kanban) + onRenderKanban: function($kanban, kanbanData) { $kanban.find('.kanban-lane-name').each(function(index) { var color = kanbanColorList[index % kanbanColorList.length]; $(this).css('background-color', color); }); + + /* Update project count and execution count */ + var doingProjectCount = 0; + var doingExecutionCount = 0; + var $doingProjectItems = $kanban.find('.kanban-lane-col[data-type="doingProject"] > .kanban-lane-items'); + if($doingProjectItems.length) + { + doingProjectCount = $doingProjectItems.find('.project-item').length; + doingExecutionCount = $doingProjectItems.find('.execution-item').length; + } + $kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount || ''); + $kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount || ''); + updateKanbanAffixState(); } }); diff --git a/www/js/zui/kanban/min.js b/www/js/zui/kanban/min.js index dde17938d5..6449252efc 100644 --- a/www/js/zui/kanban/min.js +++ b/www/js/zui/kanban/min.js @@ -4,4 +4,4 @@ * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function(a){"use strict";var n="zui.kanban",e="object"==typeof CSS&&CSS.supports("display","flex"),t=function(d,i){var o=this;o.name=n,o.$=a(d),o.options=i=a.extend({},t.DEFAULTS,this.$.data(),i),o.data=i.data||[],o.render(o.data);var s=function(n){if(i.onAction){var e=a(this);i.onAction(e.data("action"),e,n,o)}};if(o.$.on("click",".action",s).on("dblclick",".action-dbc",s),"auto"===i.droppable&&(i.droppable=!i.readonly),i.droppable){var r={selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof i.droppable?i.droppable(a):i.onAction&&i.onAction("dropItem",a.element,a,o)}};"object"==typeof i.droppable&&a.extend(r,i.droppable),o.$.droppable(r)}e&&i.useFlex||a(window).on("resize",function(){o.adjustSize()}),i.useFlex&&e||o.$.addClass("not-use-flex")};t.prototype.render=function(a){var n=this;a&&(n.data=a),n.data&&!Array.isArray(n.data)&&(n.data=[n.data]);var t=n.data||[];n.options.beforeRender&&n.options.beforeRender(n,t),n.$.toggleClass("kanban-readonly",!!n.options.readonly).toggleClass("kanban-no-lane-name",!!n.options.noLaneName),n.$.children(".kanban-board").addClass("kanban-expired");for(var d=0;d-1){var d=this.data[t];n=a.extend(d,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,o=i.$,s=o.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items > .kanban-item').length;s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count').text(p||"")}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var d=this;t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var o=n.columns,s=0;s',"<"+(d?"a":"div")+' class="title">','','','',"",""].join("")).appendTo(e),d?t.children(".title").addClass("action").attr("data-action","addCol"):(t.children(".title").addClass("action-dbc").attr("data-action","editCol"),this.options.readonly||t.append(['
','',"
"].join("")));var i=this.options.minColumnWidth;i&&t.css("min-width",i)}t.data("col",n),t.attr("data-type",n.type),t.find(".title>.icon").attr("class","icon icon-"+(n.icon||"")),t.find(".title>.text").text(n.name),t.find(".title>.count").text(n.count||""),this.options.onRenderHeaderCol&&this.options.onRenderHeaderCol(t,n,e)},t.prototype.renderLane=function(n,t,d){var i=this;d=d||i.$.children('.kanban-board[data-id="'+n.kanban+'"]');var o=d.children('.kanban-lane[data-id="'+n.id+'"]');if(o.length?o.removeClass("kanban-expired"):(o=a('
').appendTo(d),e||o.addClass("clearfix")),o.data("lane",n),!i.options.noLaneName){var s=o.children('.kanban-lane-name[data-id="'+n.id+'"]');s.length||(s=a('
').appendTo(o)),s.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&s.css("background-color",n.color),i.options.onRenderLaneName&&i.options.onRenderLaneName(s,n,d,t)}o.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),o.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?i.renderSubLanes(n,t,o):i.renderLaneItems(t,n.items,o),i.options.readonly||i.renderLaneCol({id:"EMPTY",type:"EMPTY"},o),o.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var d=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(d),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,i),i.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e){for(var t=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(d.append('
'),t.options.readonly||d.append(['
','","
"].join("")));var i=t.options;i.minColumnWidth&&d.css("min-width",i.minColumnWidth),i.maxColHeight&&d.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&d.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&d.addClass(i.laneColClass)}return"EMPTY"===n.id&&d.appendTo(e),d.attr("data-type",n.type),d},t.prototype.renderLaneItem=function(n,e,t){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t);else{var i=d.find(".title");i.length||(i=a('
').appendTo(d)),i.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){var d=this,i=d.options.noLaneName?0:d.options.laneNameWidth,o=n.columns.length+(d.options.readonly?0:1),s=d.options.minColumnWidth*o+i;if(t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]'),t.removeClass("kanban-size-inited").css({minWidth:s}),!d.options.useFlex||!e){var r=Math.max(s,d.$.width()),l=Math.floor((r-i)/o);t.find(".kanban-col").css("width",l),t.children(".kanban-lane").each(function(){var n=a(this),e=n.height();n.children(".kanban-col").css("height",e)}),t.find(".kanban-lane:not(.has-sub-lane),.kanban-sub-lane").each(function(){var n=a(this),e=0,t=n.children(".kanban-lane-col").css("height","auto");t.each(function(){e=Math.max(e,a(this).outerHeight())}),t.css("height",e)}),t.addClass("kanban-size-inited")}},t.prototype.adjustSize=function(){for(var a=0;a-1){var d=this.data[t];n=a.extend(d,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,o=i.$,s=o.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length;s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count').text(p||"")}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var d=this;t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var o=n.columns,s=0;s',"<"+(d?"a":"div")+' class="title">','','','',"",""].join("")).appendTo(e),d?t.children(".title").addClass("action").attr("data-action","addCol"):(t.children(".title").addClass("action-dbc").attr("data-action","editCol"),this.options.readonly||t.append(['
','',"
"].join("")));var i=this.options.minColumnWidth;i&&t.css("min-width",i)}t.data("col",n),t.attr("data-type",n.type),t.find(".title>.icon").attr("class","icon icon-"+(n.icon||"")),t.find(".title>.text").text(n.name),t.find(".title>.count").text(n.count||""),this.options.onRenderHeaderCol&&this.options.onRenderHeaderCol(t,n,e)},t.prototype.renderLane=function(n,t,d){var i=this;d=d||i.$.children('.kanban-board[data-id="'+n.kanban+'"]');var o=d.children('.kanban-lane[data-id="'+n.id+'"]');if(o.length?o.removeClass("kanban-expired"):(o=a('
').appendTo(d),e||o.addClass("clearfix")),o.data("lane",n),!i.options.noLaneName){var s=o.children('.kanban-lane-name[data-id="'+n.id+'"]');s.length||(s=a('
').appendTo(o)),s.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&s.css("background-color",n.color),i.options.onRenderLaneName&&i.options.onRenderLaneName(s,n,d,t)}o.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),o.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?i.renderSubLanes(n,t,o):i.renderLaneItems(t,n.items,o),i.options.readonly||i.renderLaneCol({id:"EMPTY",type:"EMPTY"},o),o.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var d=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(d),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,i),i.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e){for(var t=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(d.append('
'),t.options.readonly||d.append(['
','","
"].join("")));var i=t.options;i.minColumnWidth&&d.css("min-width",i.minColumnWidth),i.maxColHeight&&d.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&d.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&d.addClass(i.laneColClass)}return"EMPTY"===n.id&&d.appendTo(e),d.attr("data-type",n.type),d},t.prototype.renderLaneItem=function(n,e,t){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t);else{var i=d.find(".title");i.length||(i=a('
').appendTo(d)),i.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){var d=this,i=d.options.noLaneName?0:d.options.laneNameWidth,o=n.columns.length+(d.options.readonly?0:1),s=d.options.minColumnWidth*o+i;if(t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]'),t.removeClass("kanban-size-inited").css({minWidth:s}),!d.options.useFlex||!e){var r=Math.max(s,d.$.width()),l=Math.floor((r-i)/o);t.find(".kanban-col").css("width",l),t.children(".kanban-lane").each(function(){var n=a(this),e=n.height();n.children(".kanban-col").css("height",e)}),t.find(".kanban-lane:not(.has-sub-lane),.kanban-sub-lane").each(function(){var n=a(this),e=0,t=n.children(".kanban-lane-col").css("height","auto");t.each(function(){e=Math.max(e,a(this).outerHeight())}),t.css("height",e)}),t.addClass("kanban-size-inited")}},t.prototype.adjustSize=function(){for(var a=0;a Date: Thu, 9 Sep 2021 13:51:38 +0800 Subject: [PATCH 04/11] * fix tutorial mode for classic mode. --- module/tutorial/lang/en.php | 2 +- module/tutorial/lang/zh-cn.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/tutorial/lang/en.php b/module/tutorial/lang/en.php index 4e8cd5dc02..805e104a1e 100644 --- a/module/tutorial/lang/en.php +++ b/module/tutorial/lang/en.php @@ -59,7 +59,7 @@ $lang->tutorial->tasks['createProject']['desc'] = "

Create a {$lang->projectCo $lang->tutorial->tasks['manageTeam'] = array('title' => "Manage {$lang->projectCommon} Team"); $lang->tutorial->tasks['manageTeam']['mode'] = 'new'; -$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => '', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#projectTableList>tr:first>.c-name a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'accounts1', 'submit' => '#submit', 'targetPageName' => 'Manage team members'); +$lang->tutorial->tasks['manageTeam']['nav'] = array('app' => 'project', 'module' => 'project', 'method' => 'managemembers', 'menuModule' => '', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#projectTableList>tr:first>.c-name a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="members"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'accounts1,accounts', 'submit' => '#submit', 'targetPageName' => 'Manage team members'); $lang->tutorial->tasks['manageTeam']['desc'] = "

Manage {$lang->projectCommon} team members:

  • Open {$lang->projectCommon} Team Manage Team Members Page;
  • Choose users for the team.
  • Save
"; $lang->tutorial->tasks['createExecution'] = array('title' => 'Create a ' . $lang->executionCommon); diff --git a/module/tutorial/lang/zh-cn.php b/module/tutorial/lang/zh-cn.php index 860116503a..623e0b58f7 100644 --- a/module/tutorial/lang/zh-cn.php +++ b/module/tutorial/lang/zh-cn.php @@ -68,7 +68,7 @@ $lang->tutorial->tasks['createExecution']['desc'] = "

在系统创建一个新 $lang->tutorial->tasks['manageExecutionTeam'] = array('title' => "管理{$lang->executionCommon}团队"); $lang->tutorial->tasks['manageExecutionTeam']['mode'] = 'classic'; -$lang->tutorial->tasks['manageExecutionTeam']['nav'] = array('app' => 'execution', 'module' => 'execution', 'method' => 'managemembers', 'menuModule' => '', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#executionTableList>tr:first>.c-name>a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="team"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1', 'submit' => '#submit', 'targetPageName' => '团队管理'); +$lang->tutorial->tasks['manageExecutionTeam']['nav'] = array('app' => 'execution', 'module' => 'execution', 'method' => 'managemembers', 'menuModule' => '', 'menu' => '#navbar>.nav>li[data-id="browse"],#cards>.col>.panel:first .project-name,#executionTableList>tr:first>.c-name>a,#navbar>.nav>li[data-id="settings"],#subNavbar>.nav>li[data-id="team"],.manage-team-btn', 'target' => '.manage-team-btn', 'form' => '#teamForm', 'requiredFields' => 'account1,accounts', 'submit' => '#submit', 'targetPageName' => '团队管理'); $lang->tutorial->tasks['manageExecutionTeam']['desc'] = "

管理{$lang->executionCommon}团队成员:

  • 打开 {$lang->executionCommon} 设置 团队 团队管理 页面;
  • 选择要加入团队的成员;
  • 保存团队成员信息。
"; $lang->tutorial->tasks['linkStory'] = array('title' => "关联{$lang->SRCommon}"); From 4ca4f1457c78972cf45fde0c314d6aabeae94c93 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Thu, 9 Sep 2021 13:58:27 +0800 Subject: [PATCH 05/11] + Add release and productplan entry point. --- api/v1/entries/productline.php | 0 api/v1/entries/productlines.php | 0 api/v1/entries/productplan.php | 80 +++++++++++++++++++++++++++++++++ api/v1/entries/productplans.php | 44 ++++++++++++++++++ api/v1/entries/products.php | 2 +- api/v1/entries/release.php | 78 ++++++++++++++++++++++++++++++++ api/v1/entries/releases.php | 44 ++++++++++++++++++ config/routes.php | 13 +++++- module/productplan/control.php | 8 +++- module/release/control.php | 3 ++ 10 files changed, 268 insertions(+), 4 deletions(-) delete mode 100644 api/v1/entries/productline.php delete mode 100644 api/v1/entries/productlines.php create mode 100644 api/v1/entries/productplan.php create mode 100644 api/v1/entries/productplans.php create mode 100644 api/v1/entries/release.php create mode 100644 api/v1/entries/releases.php diff --git a/api/v1/entries/productline.php b/api/v1/entries/productline.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/api/v1/entries/productlines.php b/api/v1/entries/productlines.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/api/v1/entries/productplan.php b/api/v1/entries/productplan.php new file mode 100644 index 0000000000..3df13abe58 --- /dev/null +++ b/api/v1/entries/productplan.php @@ -0,0 +1,80 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + */ +class productplanEntry extends Entry +{ + /** + * GET method. + * + * @param int $planID + * @access public + * @return void + */ + public function get($planID) + { + $fields = $this->param('fields'); + + $control = $this->loadController('productplan', 'view'); + $control->view($planID); + + $data = $this->getData(); + if(!$data or !isset($data->status)) return $this->send400('error'); + if(isset($data->status) and $data->status == 'fail') + { + return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message); + } + + $plan = $this->format($data->data->plan, 'begin:date,end:date,deleted:bool'); + + return $this->send(200, $plan); + } + + /** + * PUT method. + * + * @param int $planID + * @access public + * @return void + */ + public function put($planID) + { + $oldPlan = $this->loadModel('productplan')->getByID($planID); + + /* Set $_POST variables. */ + $fields = 'title,begin,end,desc'; + $this->batchSetPost($fields, $oldPlan); + + $control = $this->loadController('productplan', 'edit'); + $control->edit($planID); + + $data = $this->getData(); + if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); + + $plan = $this->productplan->getByID($planID); + $this->sendSuccess(200, $this->format($plan, 'begin:date,end:date')); + } + + /** + * DELETE method. + * + * @param int $productID + * @access public + * @return void + */ + public function delete($planID) + { + $control = $this->loadController('productplan', 'delete'); + $control->delete($planID, 'yes'); + + $this->getData(); + $this->sendSuccess(200, 'success'); + } +} diff --git a/api/v1/entries/productplans.php b/api/v1/entries/productplans.php new file mode 100644 index 0000000000..50586dd352 --- /dev/null +++ b/api/v1/entries/productplans.php @@ -0,0 +1,44 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + */ +class productplansEntry extends entry +{ + /** + * GET method. + * + * @param int $productID + * @access public + * @return void + */ + public function get($productID = 0) + { + if(!$productID) $productID = $this->param('product'); + if(!$productID) return $this->sendError(400, 'No product id.'); + + $control = $this->loadController('productplan', 'browse'); + $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all'), $this->param('order', 'begin_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); + + /* Response */ + $data = $this->getData(); + if(isset($data->status) and $data->status == 'success') + { + $result = array(); + $plans = $data->data->plans; + foreach($plans as $plan) $result[] = $plan; + + return $this->send(200, array('productplans' => $result)); + } + + if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message); + + return $this->sendError(400, 'error'); + } +} diff --git a/api/v1/entries/products.php b/api/v1/entries/products.php index e3c0dc7b76..9c88576cd8 100644 --- a/api/v1/entries/products.php +++ b/api/v1/entries/products.php @@ -12,7 +12,7 @@ class productsEntry extends entry { /** - * POST method. + * GET method. * * @param int $projectID * @access public diff --git a/api/v1/entries/release.php b/api/v1/entries/release.php new file mode 100644 index 0000000000..d005662ab7 --- /dev/null +++ b/api/v1/entries/release.php @@ -0,0 +1,78 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + */ +class releaseEntry extends Entry +{ + /** + * GET method. + * + * @param int $planID + * @access public + * @return void + */ + public function get($releaseID) + { + $control = $this->loadController('release', 'view'); + $control->view($releaseID); + + $data = $this->getData(); + if(!$data or !isset($data->status)) return $this->send400('error'); + if(isset($data->status) and $data->status == 'fail') + { + return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message); + } + + $plan = $this->format($data->data->release, 'date:date,deleted:bool'); + + return $this->send(200, $plan); + } + + /** + * PUT method. + * + * @param int $releaseID + * @access public + * @return void + */ + public function put($releaseID) + { + $oldRelease = $this->loadModel('release')->getByID($releaseID); + + /* Set $_POST variables. */ + $fields = 'name,build,status,desc'; + $this->batchSetPost($fields, $oldRelease); + + $control = $this->loadController('release', 'edit'); + $control->edit($releaseID); + + $data = $this->getData(); + if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); + + $release = $this->release->getByID($releaseID); + $this->sendSuccess(200, $this->format($release, 'date:date,deleted:bool')); + } + + /** + * DELETE method. + * + * @param int $releaseID + * @access public + * @return void + */ + public function delete($releaseID) + { + $control = $this->loadController('release', 'delete'); + $control->delete($releaseID, 'yes'); + + $this->getData(); + $this->sendSuccess(200, 'success'); + } +} diff --git a/api/v1/entries/releases.php b/api/v1/entries/releases.php new file mode 100644 index 0000000000..131d306a1c --- /dev/null +++ b/api/v1/entries/releases.php @@ -0,0 +1,44 @@ + + * @package entries + * @version 1 + * @link http://www.zentao.net + */ +class releasesEntry extends entry +{ + /** + * GET method. + * + * @param int $productID + * @access public + * @return void + */ + public function get($productID = 0) + { + if(!$productID) $productID = $this->param('product'); + if(!$productID) return $this->sendError(400, 'No product id.'); + + $control = $this->loadController('release', 'browse'); + $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all')); + + /* Response */ + $data = $this->getData(); + if(isset($data->status) and $data->status == 'success') + { + $result = array(); + $releases = $data->data->releases; + foreach($releases as $release) $result[] = $release; + + return $this->send(200, array('releases' => $result)); + } + + if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message); + + return $this->sendError(400, 'error'); + } +} diff --git a/config/routes.php b/config/routes.php index 62255b3112..5d00080a0e 100644 --- a/config/routes.php +++ b/config/routes.php @@ -9,11 +9,20 @@ $routes['/tokens'] = 'tokens'; $routes['/configurations'] = 'configs'; $routes['/configurations/:name'] = 'config'; -$routes['/products'] = 'products'; -$routes['/products/:id'] = 'product'; +$routes['/products'] = 'products'; +$routes['/products/:id'] = 'product'; + $routes['/productlines'] = 'productLines'; $routes['/productlines/:id'] = 'productLine'; +$routes['/productplans'] = 'productPlans'; +$routes['/product/:id/productplans'] = 'productPlans'; +$routes['/productplans/:id'] = 'productPlan'; + +$routes['/releases'] = 'releases'; +$routes['/product/:id/releases'] = 'releases'; +$routes['/releases/:id'] = 'release'; + $routes['/products/:id/stories'] = 'stories'; $routes['/executions/:id/stories'] = 'executionStories'; $routes['/stories/:id'] = 'story'; diff --git a/module/productplan/control.php b/module/productplan/control.php index 92d221689a..1bd51618a2 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -189,6 +189,8 @@ class productplan extends control } return $this->send($response); } + + if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); die(js::locate(inlink('browse', "productID=$plan->product&branch=$plan->branch"), 'parent')); } } @@ -249,7 +251,11 @@ class productplan extends control { $planID = (int)$planID; $plan = $this->productplan->getByID($planID, true); - if(!$plan) die(js::error($this->lang->notFound) . js::locate('back')); + if(!$plan) + { + if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); + die(js::error($this->lang->notFound) . js::locate('back')); + } $this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story', 'product'); $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug', 'qa'); diff --git a/module/release/control.php b/module/release/control.php index 27fa02a681..bee5bea94b 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -259,9 +259,12 @@ class release extends control $release = $this->release->getById($releaseID); $this->dao->update(TABLE_BUILD)->set('deleted')->eq(1)->where('id')->eq($release->build)->andWhere('name')->eq($release->name)->exec(); } + return $this->send($response); } + if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); + $locateLink = $this->session->releaseList ? $this->session->releaseList : inlink('browse', "productID={$release->product}"); die(js::locate($locateLink, 'parent')); } From 230c02728fd2fc4d4360b68ac016526d48978ea8 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 9 Sep 2021 14:03:46 +0800 Subject: [PATCH 06/11] * bug #15069, show zero count in kanban header. --- module/common/view/kanban.html.php | 5 +++-- www/js/zui/kanban/min.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index 7278a11bf4..4aeb377d1b 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -387,6 +387,7 @@ $.extend($.fn.kanban.Constructor.DEFAULTS, /* laneItemsClass: 'scrollbar-hover', */ // only show scrollbar on mouse hover itemRender: renderKanbanItem, useFlex: false, + showZeroCount: true, onRenderHeaderCol: function($col, col) { if(col.type === 'doingProject') $col.attr('data-span-text', doingText); @@ -408,8 +409,8 @@ $.extend($.fn.kanban.Constructor.DEFAULTS, doingProjectCount = $doingProjectItems.find('.project-item').length; doingExecutionCount = $doingProjectItems.find('.execution-item').length; } - $kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount || ''); - $kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount || ''); + $kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount || 0); + $kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount || 0); updateKanbanAffixState(); } diff --git a/www/js/zui/kanban/min.js b/www/js/zui/kanban/min.js index 6449252efc..cd5e45aae1 100644 --- a/www/js/zui/kanban/min.js +++ b/www/js/zui/kanban/min.js @@ -4,4 +4,4 @@ * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function(a){"use strict";var n="zui.kanban",e="object"==typeof CSS&&CSS.supports("display","flex"),t=function(d,i){var o=this;o.name=n,o.$=a(d),o.options=i=a.extend({},t.DEFAULTS,this.$.data(),i),o.data=i.data||[],o.render(o.data);var s=function(n){if(i.onAction){var e=a(this);i.onAction(e.data("action"),e,n,o)}};if(o.$.on("click",".action",s).on("dblclick",".action-dbc",s),"auto"===i.droppable&&(i.droppable=!i.readonly),i.droppable){var r={selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof i.droppable?i.droppable(a):i.onAction&&i.onAction("dropItem",a.element,a,o)}};"object"==typeof i.droppable&&a.extend(r,i.droppable),o.$.droppable(r)}e&&i.useFlex||a(window).on("resize",function(){o.adjustSize()}),i.useFlex&&e||o.$.addClass("not-use-flex")};t.prototype.render=function(a){var n=this;a&&(n.data=a),n.data&&!Array.isArray(n.data)&&(n.data=[n.data]);var t=n.data||[];n.options.beforeRender&&n.options.beforeRender(n,t),n.$.toggleClass("kanban-readonly",!!n.options.readonly).toggleClass("kanban-no-lane-name",!!n.options.noLaneName),n.$.children(".kanban-board").addClass("kanban-expired");for(var d=0;d-1){var d=this.data[t];n=a.extend(d,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,o=i.$,s=o.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length;s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count').text(p||"")}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var d=this;t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var o=n.columns,s=0;s',"<"+(d?"a":"div")+' class="title">','','','',"",""].join("")).appendTo(e),d?t.children(".title").addClass("action").attr("data-action","addCol"):(t.children(".title").addClass("action-dbc").attr("data-action","editCol"),this.options.readonly||t.append(['
','',"
"].join("")));var i=this.options.minColumnWidth;i&&t.css("min-width",i)}t.data("col",n),t.attr("data-type",n.type),t.find(".title>.icon").attr("class","icon icon-"+(n.icon||"")),t.find(".title>.text").text(n.name),t.find(".title>.count").text(n.count||""),this.options.onRenderHeaderCol&&this.options.onRenderHeaderCol(t,n,e)},t.prototype.renderLane=function(n,t,d){var i=this;d=d||i.$.children('.kanban-board[data-id="'+n.kanban+'"]');var o=d.children('.kanban-lane[data-id="'+n.id+'"]');if(o.length?o.removeClass("kanban-expired"):(o=a('
').appendTo(d),e||o.addClass("clearfix")),o.data("lane",n),!i.options.noLaneName){var s=o.children('.kanban-lane-name[data-id="'+n.id+'"]');s.length||(s=a('
').appendTo(o)),s.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&s.css("background-color",n.color),i.options.onRenderLaneName&&i.options.onRenderLaneName(s,n,d,t)}o.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),o.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?i.renderSubLanes(n,t,o):i.renderLaneItems(t,n.items,o),i.options.readonly||i.renderLaneCol({id:"EMPTY",type:"EMPTY"},o),o.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var d=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(d),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,i),i.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e){for(var t=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(d.append('
'),t.options.readonly||d.append(['
','","
"].join("")));var i=t.options;i.minColumnWidth&&d.css("min-width",i.minColumnWidth),i.maxColHeight&&d.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&d.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&d.addClass(i.laneColClass)}return"EMPTY"===n.id&&d.appendTo(e),d.attr("data-type",n.type),d},t.prototype.renderLaneItem=function(n,e,t){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t);else{var i=d.find(".title");i.length||(i=a('
').appendTo(d)),i.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){var d=this,i=d.options.noLaneName?0:d.options.laneNameWidth,o=n.columns.length+(d.options.readonly?0:1),s=d.options.minColumnWidth*o+i;if(t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]'),t.removeClass("kanban-size-inited").css({minWidth:s}),!d.options.useFlex||!e){var r=Math.max(s,d.$.width()),l=Math.floor((r-i)/o);t.find(".kanban-col").css("width",l),t.children(".kanban-lane").each(function(){var n=a(this),e=n.height();n.children(".kanban-col").css("height",e)}),t.find(".kanban-lane:not(.has-sub-lane),.kanban-sub-lane").each(function(){var n=a(this),e=0,t=n.children(".kanban-lane-col").css("height","auto");t.each(function(){e=Math.max(e,a(this).outerHeight())}),t.css("height",e)}),t.addClass("kanban-size-inited")}},t.prototype.adjustSize=function(){for(var a=0;a-1){var d=this.data[t];n=a.extend(d,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,o=i.$,s=o.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length;s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count').text(p||(i.options.showZeroCount?0:""))}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var d=this;t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var o=n.columns,s=0;s',"<"+(i?"a":"div")+' class="title">','','','',"",""].join("")).appendTo(e),i?d.children(".title").addClass("action").attr("data-action","addCol"):(d.children(".title").addClass("action-dbc").attr("data-action","editCol"),t.options.readonly||d.append(['
','',"
"].join("")));var o=t.options.minColumnWidth;o&&d.css("min-width",o)}d.data("col",n),d.attr("data-type",n.type),d.find(".title>.icon").attr("class","icon icon-"+(n.icon||"")),d.find(".title>.text").text(n.name),d.find(".title>.count").text(n.count||(t.options.showZeroCount?0:"")),t.options.onRenderHeaderCol&&t.options.onRenderHeaderCol(d,n,e)},t.prototype.renderLane=function(n,t,d){var i=this;d=d||i.$.children('.kanban-board[data-id="'+n.kanban+'"]');var o=d.children('.kanban-lane[data-id="'+n.id+'"]');if(o.length?o.removeClass("kanban-expired"):(o=a('
').appendTo(d),e||o.addClass("clearfix")),o.data("lane",n),!i.options.noLaneName){var s=o.children('.kanban-lane-name[data-id="'+n.id+'"]');s.length||(s=a('
').appendTo(o)),s.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&s.css("background-color",n.color),i.options.onRenderLaneName&&i.options.onRenderLaneName(s,n,d,t)}o.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),o.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?i.renderSubLanes(n,t,o):i.renderLaneItems(t,n.items,o),i.options.readonly||i.renderLaneCol({id:"EMPTY",type:"EMPTY"},o),o.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var d=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(d),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,i),i.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e){for(var t=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(d.append('
'),t.options.readonly||d.append(['
','","
"].join("")));var i=t.options;i.minColumnWidth&&d.css("min-width",i.minColumnWidth),i.maxColHeight&&d.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&d.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&d.addClass(i.laneColClass)}return"EMPTY"===n.id&&d.appendTo(e),d.attr("data-type",n.type),d},t.prototype.renderLaneItem=function(n,e,t){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t);else{var i=d.find(".title");i.length||(i=a('
').appendTo(d)),i.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){var d=this,i=d.options.noLaneName?0:d.options.laneNameWidth,o=n.columns.length+(d.options.readonly?0:1),s=d.options.minColumnWidth*o+i;if(t=t||d.$.children('.kanban-board[data-id="'+n.id+'"]'),t.removeClass("kanban-size-inited").css({minWidth:s}),!d.options.useFlex||!e){var r=Math.max(s,d.$.width()),l=Math.floor((r-i)/o);t.find(".kanban-col").css("width",l),t.children(".kanban-lane").each(function(){var n=a(this),e=n.height();n.children(".kanban-col").css("height",e)}),t.find(".kanban-lane:not(.has-sub-lane),.kanban-sub-lane").each(function(){var n=a(this),e=0,t=n.children(".kanban-lane-col").css("height","auto");t.each(function(){e=Math.max(e,a(this).outerHeight())}),t.css("height",e)}),t.addClass("kanban-size-inited")}},t.prototype.adjustSize=function(){for(var a=0;a Date: Thu, 9 Sep 2021 14:17:39 +0800 Subject: [PATCH 07/11] * bug #15030, improve UI for scrolling in kanban page. --- module/common/view/kanban.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index 4aeb377d1b..2f6100ee6a 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -33,6 +33,7 @@ #kanbanList .kanban-item.has-left-border.border-left-red {border-left-color: #ff5d5d;} #kanbanList .kanban-item.has-left-border.border-left-blue {border-left-color: #0991ff;} +.kanban-affixed {padding-top: 72px;} .kanban-affixed > .kanban-header {position: fixed!important; top: 0; background: rgba(80,80,80,.9); color: #fff; z-index: 100;} #kanbanList .kanban-header-col[data-type="doingProject"], @@ -341,9 +342,9 @@ function renderKanbanItem(item, $item, col) */ function affixKanbanHeader($kanbanBoard, affixed) { - $kanbanBoard.toggleClass('kanban-affixed', !!affixed); var $header = $kanbanBoard.children('.kanban-header'); $header.css('width', affixed ? $kanbanBoard.width() : ''); + $kanbanBoard.toggleClass('kanban-affixed', !!affixed); $kanbanBoard.css('padding-top', affixed ? $header.outerHeight() : ''); } From c9d9a16b7d8686450fb701eda251079df6827361 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 9 Sep 2021 14:25:24 +0800 Subject: [PATCH 08/11] * align checkbox in product table list. --- module/product/css/all.css | 1 - 1 file changed, 1 deletion(-) diff --git a/module/product/css/all.css b/module/product/css/all.css index ef18226e2f..39217434d9 100644 --- a/module/product/css/all.css +++ b/module/product/css/all.css @@ -44,7 +44,6 @@ th.table-nest-title .table-nest-toggle {top: 12px; opacity: .6;} th.table-nest-title .table-nest-toggle:hover {opacity: 1;} #productTableList .icon-product:before {content: '\e98f'; width: 22px; height: 22px; background: none; color: rgb(166, 170, 184); top: 0; line-height: 22px; margin-right: 2px; font-size: 14px;} -#productTableList>tr>td:first-child {padding-left: 10px;} .table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -3px;} .main-table thead>tr>th {padding: 0px 8px; line-height: 24px;} From 0a57ae9e091c5bf71cf3f6c146ece4b5a1eb374d Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 9 Sep 2021 14:41:57 +0800 Subject: [PATCH 09/11] * bug #15017, adjust table style in product/all in tutorial mode. --- module/product/view/all.html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index 001ed85c10..0a89d06094 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -238,4 +238,10 @@ + + + From 30fc52a6953130a5b07920ef6ebc0465ca13ba8b Mon Sep 17 00:00:00 2001 From: lichengjun Date: Thu, 9 Sep 2021 06:42:09 +0000 Subject: [PATCH 10/11] * Fix GitLab mr Details Style And API request condition status pending. --- module/gitlab/model.php | 2 +- module/mr/model.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 3b986b63ff..1b6250993f 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -405,7 +405,7 @@ class gitlabModel extends model { $gitlab = $this->loadModel('gitlab')->getByID($gitlabID); if(!$gitlab) return ''; - $url = rtrim($gitlab->url, '/')."/api/v4/todos?project_id=$projectID&type=MergeRequest&private_token={$gitlab->token}&sudo={$sudo}"; + $url = rtrim($gitlab->url, '/')."/api/v4/todos?project_id=$projectID&type=MergeRequest&state=pending&private_token={$gitlab->token}&sudo={$sudo}"; return json_decode(commonModel::http($url)); } diff --git a/module/mr/model.php b/module/mr/model.php index e323cf7604..110bab59a4 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -331,9 +331,10 @@ class mrModel extends model $todo->idvalue = $rawTodo->id; $todo->pri = 3; $todo->name = $this->lang->mr->common . ": " . $rawTodo->target->title; - $todo->desc = $rawTodo->target->description . "
" . '' . $this->todoDescriptionLink($gitlabID, $projectID) .''; + $todo->desc = $rawTodo->target->description . "
" . '' . $rawTodo->target->web_url .''; $todo->status = 'wait'; $todo->finishedBy = ''; + $this->dao->insert(TABLE_TODO)->data($todo)->exec(); } } From fa2e8cd1b0773079b629445bca89ee10aaef2b8e Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 9 Sep 2021 14:43:41 +0800 Subject: [PATCH 11/11] * Fix bug #15004. --- module/action/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index eba7679086..06abe6dae7 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -781,7 +781,7 @@ class actionModel extends model $docs = $this->doc->getPrivDocs(array_keys($libs), 0, 'all'); $actionCondition = $this->getActionCondition(); - if(!$actionCondition and isset($this->app->user->rights['acls']['actions'])) return array(); + if(!$actionCondition and !$this->app->user->admin and isset($this->app->user->rights['acls']['actions'])) return array(); /* Get actions. */ $actions = $this->dao->select('*')->from(TABLE_ACTION)