From 262ab9e5cdc298617daa31e589c6f6a4b4ba47c6 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 5 Aug 2022 05:19:47 +0000 Subject: [PATCH] * Fix sprint211 problems. --- module/block/control.php | 8 +++++++- module/block/model.php | 4 +++- module/project/js/common.js | 7 ++++--- module/project/js/execution.js | 8 ++++---- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/view/execution.html.php | 4 ++++ 9 files changed, 26 insertions(+), 9 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 03d96eef00..6b53ff3a5b 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1804,7 +1804,13 @@ class block extends control $this->app->loadLang('task'); $this->app->loadLang('execution'); - $objects = $this->loadModel('task')->getUserTasks($this->app->user->account, 'assignedTo', $limitCount); + $objects = $this->loadModel('task')->getUserTasks($this->app->user->account, 'assignedTo'); + + foreach($objects as $k => $task) + { + if(in_array($task->status, array('closed', 'cancel', 'pause'))) unset($objects[$k]); + } + if($limitCount > 0) $objects = array_slice($objects, 0, $limitCount); } if($objectType == 'bug') $this->app->loadLang('bug'); diff --git a/module/block/model.php b/module/block/model.php index dc75037e58..245277cf93 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -171,12 +171,14 @@ class blockModel extends model $tasks = $this->dao->select("count(t1.id) as tasks, count(if(t1.status = 'done', 1, null)) as doneTasks")->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = t2.id") ->leftJoin(TABLE_EXECUTION)->alias('t3')->on("t1.execution = t3.id") - ->where('t1.assignedTo')->eq($this->app->user->account) + ->leftJoin(TABLE_TEAM)->alias('t4')->on("t4.root = t1.id and t4.type = 'task' and t4.account = '{$this->app->user->account}'") + ->where("(t1.assignedTo = '{$this->app->user->account}' or (t1.mode = 'multi' and t4.`account` = '{$this->app->user->account}') )") ->andWhere('(t2.status')->ne('suspended') ->orWhere('t3.status')->ne('suspended') ->markRight(1) ->andWhere('t1.deleted')->eq('0') ->andWhere('t3.deleted')->eq('0') + ->andWhere('t1.status')->notin('closed,cancel,pause') ->beginIF(!$this->app->user->admin)->andWhere('t1.execution')->in($this->app->user->view->sprints)->fi() ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($this->config->vision)->andWhere('t3.vision')->eq($this->config->vision)->fi() diff --git a/module/project/js/common.js b/module/project/js/common.js index 59d45e9091..cc7cfee2fa 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -112,9 +112,9 @@ function computeEndDate(delta) delta = parseInt(delta); if(delta == 999) { - $('#end').val(longTime); + $('#end').val(longTime).trigger('mousedown'); $('#daysBox').addClass('hidden'); - $('#days').val(0); + $('#days').val(0).trigger('mousedown'); return false; } $('#daysBox').removeClass('hidden'); @@ -125,8 +125,9 @@ function computeEndDate(delta) } endDate = $.zui.formatDate(beginDate.addDays(delta - 1), 'yyyy-MM-dd'); - $('#end').val(endDate).datetimepicker('update'); + $('#end').val(endDate).datetimepicker('update').trigger('mousedown'); computeWorkDays(); + $('#days').trigger('mousedown'); } /** diff --git a/module/project/js/execution.js b/module/project/js/execution.js index d8ea9e70b7..9e037beeb9 100644 --- a/module/project/js/execution.js +++ b/module/project/js/execution.js @@ -4,16 +4,16 @@ $(function() { var show = $(this).is(':checked') ? 1 : 0; $.cookie('showTask', show, {expires:config.cookieLife, path:config.webRoot}); - $('input#editExecution1').prop('disabled', show); + $('input#editExecution1').prop('disabled', show).attr('title', show == 1 ? disabledExecutionTip : defaultExecutionTip); window.location.reload(); }); - if($.cookie('showTask') == 1) $('input#editExecution1').prop('disabled', true); + if($.cookie('showTask') == 1) $('input#editExecution1').prop('disabled', true).attr('title', disabledExecutionTip); $('input#editExecution1').click(function() { var editExecution = $(this).is(':checked') ? 1 : 0; $.cookie('editExecution', editExecution, {expires:config.cookieLife, path:config.webRoot}); - $('input[name^="showTask"]').prop('disabled', editExecution); + $('input[name^="showTask"]').prop('disabled', editExecution).attr('title', editExecution == 1 ? disabledTaskTip : defaultTaskTip); showEditCheckbox(editExecution); }); @@ -21,7 +21,7 @@ $(function() { $('input#editExecution1').prop('checked', 'true'); showEditCheckbox(true); - $('input[name^="showTask"]').prop('disabled', true); + $('input[name^="showTask"]').prop('disabled', true).attr('title', disabledTaskTip); } $(document).on('click', ":checkbox[name^='executionIDList']", function() diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 7fe57fc29b..06f3d7307b 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -197,6 +197,7 @@ $lang->project->unlinkExecutionMembers = "The team members you are removing are $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; $lang->project->budgetOverrun = "The project's budget has exceeded the remaining budget of the parent program:"; +$lang->project->disabledInputTip = 'Please cancel %s first'; $lang->project->tenThousand = ''; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 4021d0bdec..7e4a3e01de 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -197,6 +197,7 @@ $lang->project->unlinkExecutionMembers = "The team members you are removing are $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; $lang->project->budgetOverrun = "The project's budget has exceeded the remaining budget of the parent program:"; +$lang->project->disabledInputTip = 'Please cancel %s first'; $lang->project->tenThousand = 'Ten Thousand'; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 43e975fc76..282c0fb80b 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -197,6 +197,7 @@ $lang->project->unlinkExecutionMembers = "The team members you are removing are $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = "Il n'y a pas de phase R&D dans ce projet, ou vous n'avez pas la permission d'accès. La version ne peut pas être créée pour le moment."; $lang->project->budgetOverrun = "Le budget du projet a dépassé le budget restant du programme parent:"; +$lang->project->disabledInputTip = 'Please cancel %s first'; $lang->project->tenThousand = ''; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 539b8ae4aa..1841308fa7 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -197,6 +197,7 @@ $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项 $lang->project->productTip = '点击新建产品后,项目将不会关联已选中的产品。'; $lang->project->noDevStage = '该项目下没有研发类型的阶段,或者您没有权限访问,暂时不支持创建版本。'; $lang->project->budgetOverrun = '项目的预算已超出父项目集的剩余预算:'; +$lang->project->disabledInputTip = '请先取消%s'; $lang->project->tenThousand = '万'; $lang->project->hundredMillion = '亿'; diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index b0e81cf157..22f4130f1d 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -4,6 +4,10 @@ selectAll);?> execution->checkedExecutions);?> app->getClientLang());?> +programplan->stageCustom->task);?> +project->disabledInputTip, $lang->edit . $lang->executionCommon));?> +edit . $lang->executionCommon);?> +project->disabledInputTip, $lang->programplan->stageCustom->task));?>