From fa4d37f1a21493cf9d4bc1efb709c60abaa3185a Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Wed, 10 Aug 2022 03:01:48 +0000 Subject: [PATCH 01/14] * Fix bug #25249 --- module/execution/model.php | 32 ++++++++++++++++++++------------ module/task/model.php | 23 ++++++++--------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 90704f6e09..46a73bc318 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4368,25 +4368,33 @@ class executionModel extends model echo "{$this->lang->execution->typeList[$execution->type]} "; } echo empty($execution->children) ? html::a(helper::createLink('execution', 'view', "executionID=$execution->id"), $execution->name) : $execution->name; - echo '' . zget($users, $execution->PM) . ''; - echo "" . zget($this->lang->project->statusList, $execution->status) . ''; - echo '' . html::ring($execution->hours->progress) . ''; - echo helper::isZeroDate($execution->begin) ? '' : '' . $execution->begin . ''; - if(!helper::isZeroDate($execution->end)) + if(empty($execution->children)) { - if($execution->status != 'closed') + echo html::a(helper::createLink('execution', 'view', "executionID=$execution->id"), $execution->name); + if(!helper::isZeroDate($execution->end)) { - echo strtotime($today) > strtotime($execution->end) ? '' . $execution->end . '' : '' . $execution->end . ''; - } - else - { - echo '' . $execution->end . ''; + if($execution->status != 'closed') + { + echo strtotime($today) > strtotime($execution->end) ? '' . $this->lang->execution->delayed . '' : ''; + } } } else { - echo ''; + echo $execution->name; + if(!helper::isZeroDate($execution->end)) + { + if($execution->status != 'closed') + { + echo strtotime($today) > strtotime($execution->end) ? '' . $this->lang->execution->delayed . '' : ''; + } + } } + echo '' . zget($users, $execution->PM) . ''; + echo "" . zget($this->lang->project->statusList, $execution->status) . ''; + echo '' . html::ring($execution->hours->progress) . ''; + echo helper::isZeroDate($execution->begin) ? '' : '' . $execution->begin . ''; + echo helper::isZeroDate($execution->end) ? '' : '' . $execution->end . ''; echo "" . $execution->hours->totalEstimate . $this->lang->execution->workHourUnit . ''; echo "" . $execution->hours->totalConsumed . $this->lang->execution->workHourUnit . ''; echo "" . $execution->hours->totalLeft . $this->lang->execution->workHourUnit . ''; diff --git a/module/task/model.php b/module/task/model.php index e5edc31911..f312bbfc1c 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3805,26 +3805,19 @@ class taskModel extends model $list .= ''; if($task->parent > 0) $list .= '' . $this->lang->task->childrenAB . ' '; $list .= common::hasPriv('task', 'view') ? html::a(helper::createLink('task', 'view', "id=$task->id"), $task->name, '', "style='color: $task->color'", "data-app='project'") : "$task->name"; - $list .= ''; - $list .= '' . zget($users, $task->assignedTo, '') . ''; - $list .= "" . $this->processStatus('task', $task) . ''; - $list .= ''; - $list .= helper::isZeroDate($task->estStarted) ? '' : '' . $task->estStarted . ''; if(!helper::isZeroDate($task->deadline)) { - if($task->status != 'done') + if($task->status != done) { - $list .= strtotime($today) > strtotime($task->deadline) ? '' . $task->deadline . '' : '' . $task->deadline . ''; - } - else - { - $list .= '' . $task->deadline . ''; + $list .= strtotime($today) > strtotime($task->deadline) ? '' . $this->lang->execution->delayed . '' : ''; } } - else - { - $list .= ''; - } + $list .= ''; + $list .= '' . zget($users, $task->assignedTo, '') . ''; + $list .= "" . $this->processStatus('task', $task) . ''; + $list .= ''; + $list .= helper::isZeroDate($task->estStarted) ? '' : '' . $task->estStarted . ''; + $list .= helper::isZeroDate($task->deadline) ? '' : '' . $task->deadline . ''; $list .= '' . $task->estimate . $this->lang->execution->workHourUnit . ''; $list .= '' . $task->consumed . $this->lang->execution->workHourUnit . ''; $list .= '' . $task->left . $this->lang->execution->workHourUnit . ''; From 986ff8cb6c102d147b4a5efbe7ffefa45841afbe Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 10 Aug 2022 11:09:20 +0800 Subject: [PATCH 02/14] * Fix bug #26109. --- module/execution/js/kanban.js | 2 +- module/execution/view/taskkanban.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 2e3d2f7363..e5b9e41801 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1861,7 +1861,7 @@ function searchCards(value, order = '') if(hideAll && rdSearchValue != '') { - if($('.table-empty-tip').length == 0) $('#kanban').append('

' + kanbanLang.empty + '

'); + if($('.table-empty-tip').length == 0) $('#kanban').append('

' + kanbancardLang.empty + '

'); } else { diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 8ce420b01a..2a9b390200 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -132,7 +132,7 @@
From 72f038d37918f24000a00a3b1b34b1f5204118f2 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 10 Aug 2022 11:20:05 +0800 Subject: [PATCH 03/14] * Fix bug of edit execution can change closedDate. --- module/execution/model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index d51d512938..9c6e4f0bdd 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -501,8 +501,8 @@ class executionModel extends model ->setIF(helper::isZeroDate($this->post->begin), 'begin', '') ->setIF(helper::isZeroDate($this->post->end), 'end', '') ->setIF(!isset($_POST['whitelist']), 'whitelist', '') - ->setIF($this->post->status == 'closed', 'closedDate', helper::now()) - ->setIF($this->post->status == 'suspended', 'suspendedDate', helper::today()) + ->setIF($this->post->status == 'closed' and $oldExecution->status != 'closed', 'closedDate', helper::now()) + ->setIF($this->post->status == 'suspended' and $oldExecution->status != 'suspended', 'suspendedDate', helper::today()) ->setIF($oldExecution->type == 'stage', 'project', $oldExecution->project) ->setDefault('team', $this->post->name) ->join('whitelist', ',') @@ -700,8 +700,8 @@ class executionModel extends model if(isset($data->codes)) $executions[$executionID]->code = $executionCode; if(isset($data->projects)) $executions[$executionID]->project = zget($data->projects, $executionID, 0); if(isset($data->attributes)) $executions[$executionID]->attribute = zget($data->attributes, $executionID, ''); - if($executions[$executionID]->status == 'closed') $executions[$executionID]->closedDate = helper::now(); - if($executions[$executionID]->status == 'suspended') $executions[$executionID]->suspendedDate = helper::today(); + if($executions[$executionID]->status == 'closed' and $oldExecutions[$executionID]->status != 'closed') $executions[$executionID]->closedDate = helper::now(); + if($executions[$executionID]->status == 'suspended' and $oldExecutions[$executionID]->status != 'suspended') $executions[$executionID]->suspendedDate = helper::today(); /* Check unique code for edited executions. */ if($projectModel == 'scrum' and isset($executionCode) and empty($executionCode)) From 52cad31920548457b43c0633789d98b12d419aee Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 10 Aug 2022 12:37:14 +0800 Subject: [PATCH 04/14] * Code for port. --- db/update17.4.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/update17.4.sql b/db/update17.4.sql index ff29c01259..c99338e4cc 100644 --- a/db/update17.4.sql +++ b/db/update17.4.sql @@ -28,4 +28,5 @@ UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='feedbackSolution' ORDER BY `id` DESC LIMIT 1) WHERE `module`='feedback' AND `field`='solution'; UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='feedbackclosedReason' ORDER BY `id` DESC LIMIT 1), `control`='select' WHERE `module`='feedback' AND `field`='closedReason'; -UPDATE `zt_project` SET `closedDate`='' AND `closedBy`='' WHERE `status` != 'closed'; \ No newline at end of file +UPDATE `zt_project` SET `closedDate`='' AND `closedBy`='' WHERE `status` != 'closed'; +UPDATE `zt_grouppriv` SET `method`='exportTemplate' WHERE `method` = 'exportTemplet'; From e05e56ee704c4b1757d4289f1a66e8225016d9f7 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Wed, 10 Aug 2022 05:16:15 +0000 Subject: [PATCH 05/14] * Fix bug #26173. --- module/upgrade/config.php | 2 ++ module/upgrade/model.php | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/module/upgrade/config.php b/module/upgrade/config.php index 677663bb20..dbdc6caf0f 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -423,3 +423,5 @@ $config->upgrade->recoveryActions->testcase->review['name'] = $lang->upgrade $config->upgrade->recoveryActions->testcase->review['method'] = 'operate'; $config->upgrade->recoveryActions->testcase->review['open'] = 'normal'; $config->upgrade->recoveryActions->testcase->review['position'] = 'browseandview'; + +$config->upgrade->workflowRequiredField = array('product', 'execution', 'program', 'project', 'release', 'story', 'bug', 'task', 'testcase', 'testtask', 'feedback'); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d9af99d480..250ebdef98 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -533,7 +533,6 @@ class upgradeModel extends model case '17_4': $this->processCreatedInfo(); $this->processCreatedBy(); - $this->updateApproval(); break; } @@ -679,8 +678,9 @@ class upgradeModel extends model case 'biz7.0': $this->processFlowPosition(); break; - case 'biz7.3': + case 'biz7.4': $this->updateApproval(); + $this->addDefaultRuleToWorkflow(); break; } } @@ -6880,4 +6880,30 @@ class upgradeModel extends model return !dao::isError(); } + + /** + * Add requred rule to the built-in workflow status field. + * + * @access public + * @return void + */ + public function addDefaultRuleToWorkflow() + { + $notemptyRule = $this->dao->select('id')->from(TABLE_WORKFLOWRULE)->where('rule')->eq('notempty')->fetch(); + if(empty($notemptyRule)) return false; + + $fields = $this->dao->select('*')->from(TABLE_WORKFLOWFIELD)->where('field')->eq('status')->andWhere('module')->in($this->config->upgrade->workflowRequiredField)->fetchAll(); + + foreach($fields as $field) + { + if(strpos(',' . $field->rules . ',', ',' . $notemptyRule->id . ',') !== false) continue; + + $rules = $notemptyRule->id; + if(!empty($field->rules)) $rules = $field->rules . ',' . $rules; + + $this->dao->update(TABLE_WORKFLOWFIELD)->set('rules')->eq($rules)->where('id')->eq($field->id)->exec(); + } + + return !dao::isError(); + } } From 0da420f283acdde672f294396cf54eafecf10bd1 Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Wed, 10 Aug 2022 05:20:19 +0000 Subject: [PATCH 06/14] * Fix bug #26065 --- module/kanban/css/space.css | 2 +- module/kanban/js/space.js | 36 +++++++++++++++++++++++++++++++ module/kanban/view/space.html.php | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/module/kanban/css/space.css b/module/kanban/css/space.css index fafa03aaa0..9b330ee75a 100644 --- a/module/kanban/css/space.css +++ b/module/kanban/css/space.css @@ -25,7 +25,7 @@ .kanbans .kanban-actions .dropdown-menu.pull-left {top:31px; right:-1px; left: auto;} .kanbans .panel .label-closed {background: #AAA !important; color: #FFF; margin-top:-6px;} .kanbans .panel-body {padding: 0 16px 16px;} -.kanbans .kanban-desc {color: #838a9d; word-break:break-all; height: 70px; overflow: hidden; display: -webkit-box; float:left;} +.kanbans .kanban-desc {color: #838a9d; word-break:break-all; height: 70px; overflow: hidden; float:left;} .kanbans .kanban-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;} .kanbans .kanban-members {float: left; height: 24px; line-height: 24px;} .kanbans .kanban-members > div {display: inline-block; height: 24px;} diff --git a/module/kanban/js/space.js b/module/kanban/js/space.js index 260931a56f..4f39482177 100644 --- a/module/kanban/js/space.js +++ b/module/kanban/js/space.js @@ -30,3 +30,39 @@ $(function() window.location.reload(); }); }); + +(function() +{ + /* Expand or collapse text */ + function limitText() + { + var fullText; + var limitText; + var $text = $(this); + var options = $.extend({limitSize: 40, suffix: '…'}, $text.data()); + var text = $text.text(); + if(text.length > options.limitSize) + { + fullText = $text.html(); + limitText = text.substring(0, options.limitSize) + options.suffix; + $text.text(limitText).addClass('limit-text-on'); + + var $toggleBtn = options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle'); + $toggleBtn.text($toggleBtn.data('textExpand')); + $toggleBtn.on('click', function() + { + var isLimitOn = $text.toggleClass('limit-text-on').hasClass('limit-text-on'); + if(isLimitOn) $text.text(limitText); + else $text.html(fullText); + $toggleBtn.text($toggleBtn.data(isLimitOn ? 'textExpand' : 'textCollapse')); + }); + } + else + { + (options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle')).hide(); + } + $text.removeClass('hidden'); + }; + $.fn.textLimit = function(){return this.each(limitText);}; + $(function(){$('.text-limit').textLimit();}); +})(); diff --git a/module/kanban/view/space.html.php b/module/kanban/view/space.html.php index 715a472351..e2b33bf37c 100644 --- a/module/kanban/view/space.html.php +++ b/module/kanban/view/space.html.php @@ -50,7 +50,7 @@ desc) ? $lang->kanban->emptyDesc : str_replace("\n", '', strip_tags($space->desc));?> ]*>|]*>/';?> desc) ? $lang->kanban->emptyDesc : preg_replace($pattern, '', $space->desc);?> -

+

status == 'closed' ? 'disabled' : '';?> From 3317e702039ac7c7cbbefa60c831f9c2c39b0bf4 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 10 Aug 2022 13:20:37 +0800 Subject: [PATCH 07/14] * Code for port. --- module/port/model.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/port/model.php b/module/port/model.php index 4b4974ebcd..3e664c4401 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -600,28 +600,27 @@ class portModel extends model { foreach($values as $field => $value) { - if(empty($value)) continue; if(in_array($field, $dataSourceList)) { if($fieldList[$field]['control'] == 'multiple') { - $value = explode(',', $value); $multiple = ''; - foreach($value as $tmpValue) $multiple .= "\n" . zget($exportDatas[$field], $tmpValue); + $multipleLsit = explode(',', $value); + foreach($multipleLsit as $tmpValue) $multiple .= "\n" . zget($exportDatas[$field], $tmpValue); $rows[$id]->$field = $multiple; } else { - $rows[$id]->$field = zget($exportDatas[$field], $value); + $rows[$id]->$field = zget($exportDatas[$field], $value, ''); } } elseif(strpos($this->config->port->userFields, $field) !== false) { - $rows[$id]->$field = zget($exportDatas['user'], $value); + $rows[$id]->$field = zget($exportDatas['user'], $value, ''); } /* if value = 0 or value = 0000:00:00 set value = ''*/ - if(!$value or helper::isZeroDate($value)) + if(helper::isZeroDate($value)) { $rows[$id]->$field = ''; } From 824b9219d905005495c949dca8db0eadeeb5278d Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 10 Aug 2022 13:34:57 +0800 Subject: [PATCH 08/14] * Code for gantt. --- module/common/view/gantt.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/common/view/gantt.html.php b/module/common/view/gantt.html.php index ec81e3d8c0..76ec9eca20 100644 --- a/module/common/view/gantt.html.php +++ b/module/common/view/gantt.html.php @@ -16,6 +16,7 @@ if($currentLang != 'en') js::import($jsRoot . 'dhtmlxgantt/lang/' . $currentLang ?>