From c319f176c063cba07a3803d11e5fd0fbf2714fc5 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 3 Aug 2021 08:15:12 +0800 Subject: [PATCH] * Code modified when submitting code review. --- module/program/model.php | 3 ++- module/todo/view/view.html.php | 2 +- module/tree/view/browse.html.php | 1 + module/upgrade/js/mergeprogram.js | 8 ++++++-- module/upgrade/model.php | 1 + module/upgrade/view/confirm.html.php | 2 -- module/upgrade/view/mergebyproduct.html.php | 2 -- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index 42d6e9c1e6..6e191216df 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -958,7 +958,7 @@ class programModel extends model $hour->progress = $hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0; } - /* Get the number of lefting tasks. */ + /* Get the number of left tasks. */ if($this->cookie->projectType and $this->cookie->projectType == 'bycard') { $leftTasks = $this->dao->select('project,count(*) as tasks')->from(TABLE_TASK) @@ -1003,6 +1003,7 @@ class programModel extends model $project->teamCount = isset($teams[$project->id]) ? $teams[$project->id]->teams : 0; $project->leftTasks = isset($leftTasks[$project->id]) ? $leftTasks[$project->id]->tasks : '—'; $project->teamMembers = isset($teamMembers[$project->id]) ? array_keys($teamMembers[$project->id]) : array(); + $stats[$key] = $project; } return $stats; diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index 16e1a6c768..9adb6a2d3f 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -65,7 +65,7 @@ if($this->app->user->admin or ($this->app->user->account == $todo->account) or ($this->app->user->account == $todo->assignedTo)) { if($todo->status == 'wait') common::printLink('todo', 'start', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->start}' class='btn showinonlybody'"); - if($todo->status == 'done' || $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'"); + if($todo->status == 'done' or $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'"); if($todo->status == 'done') common::printLink('todo', 'close', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'"); common::printLink('todo', 'edit', "todoID=$todo->id", "", '', "title='{$lang->todo->edit}' class='btn showinonlybody'"); common::printLink('todo', 'delete', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'"); diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index 6a17896fb8..b5bd245b1e 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -253,6 +253,7 @@ $(function() var item = $li.data(); orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order; }); + $.post('createLink('tree', 'updateOrder', "rootID=$rootID&viewType=$viewType");?>', orders, function(data) { $('.main-col').load(location.href + ' .main-col .panel'); diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index c3873c6a41..8d12db19ed 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -80,6 +80,7 @@ $(function() { var checkedProject = isSelectAll(0, 'project'); } + var checkedProduct = isSelectAll(lineID, 'product'); $('#checkAllProjects').prop('checked', checkedProject); $('#checkAllProducts').prop('checked', checkedProduct); @@ -466,7 +467,6 @@ $(function() var productID = $(this).attr('data-product'); if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true); - $('#programName').val($("[lineid='" + lineID + "']").find('a').text()); setProgramByProduct($(':checkbox[data-productid=' + productID + ']')); } @@ -477,10 +477,11 @@ $(function() { var lineID = $(this).attr('data-line'); var checkedProductNum = $("[id^='products\[" + lineID + "\]']:checked").length; + var checkedLine = true; + checked = isSelectAll(lineID, 'project'); checkedProduct = isSelectAll(lineID, 'product'); - var checkedLine = true; if(checkedProductNum > 0) $('[lineid=' + lineID + ']').addClass('active'); if(checkedProductNum == 0) { @@ -653,6 +654,7 @@ function toggleProgram(obj) var programID = $('#programs').val(); getProgramStatus('program', programID); } + var projectType = $('input[name="projectType"]:checked').val(); if(projectType == 'project') { @@ -779,6 +781,7 @@ function hiddenProject() $('[name=projectAcl]').attr('disabled', 'disabled'); $('[name=programAcl]').removeAttr('disabled'); } + if(projectType == 'execution') { $('.projectName').removeClass('hidden'); @@ -1122,6 +1125,7 @@ function isSelectAll(lineID = 0, type = 'product') var checkedObjectNum = $("[id^='productLines']:checked").length; } } + if(objectNum > checkedObjectNum || objectNum == 0) checked = false; return checked; } diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 59e75c9b32..650e862811 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4644,6 +4644,7 @@ class upgradeModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product=t3.id') ->where('t2.id')->in($projectIdList) ->fetchGroup('project', 'product'); + $sprintGroups = $this->dao->select('*')->from(TABLE_PROJECT)->where('project')->in($projectIdList)->fetchGroup('project', 'id'); $teamGroups = $this->dao->select('root,account')->from(TABLE_TEAM)->where('type')->eq('execution')->fetchGroup('root', 'account'); $users = $this->dao->select('*')->from(TABLE_USER)->where('deleted')->eq('0')->fetchAll('account'); diff --git a/module/upgrade/view/confirm.html.php b/module/upgrade/view/confirm.html.php index 6b9283afaf..cbbd696363 100644 --- a/module/upgrade/view/confirm.html.php +++ b/module/upgrade/view/confirm.html.php @@ -23,6 +23,4 @@ - diff --git a/module/upgrade/view/mergebyproduct.html.php b/module/upgrade/view/mergebyproduct.html.php index 00264ce5cf..3847d25860 100644 --- a/module/upgrade/view/mergebyproduct.html.php +++ b/module/upgrade/view/mergebyproduct.html.php @@ -20,7 +20,6 @@
- $product):?>
@@ -37,7 +36,6 @@
-