From c40bfab4936a9507f962273b11132220a4f30ec0 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 9 Jul 2018 16:48:29 +0800 Subject: [PATCH 1/3] * If the member is not the last, can not finish task, fix bug #1939. --- module/task/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 65a7fec37b..e3b517f315 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -508,9 +508,12 @@ class taskModel extends model if($currentTask->left == 0 && $oldTask->left != 0 && $currentTask->consumed != 0) { - $currentTask->status = 'done'; - $currentTask->finishedBy = $this->app->user->account; - $currentTask->finishedDate = $now; + if($oldTask->assignedTo == $teams[count($teams) - 1] && $team[$oldTask->assignedTo]->left == 0 && $team[$oldTask->assignedTo]->consumed != 0) + { + $currentTask->status = 'done'; + $currentTask->finishedBy = $this->app->user->account; + $currentTask->finishedDate = $now; + } } return $currentTask; From 67cc92c81287933d54d1efd0c2f4ea3d3e949e05 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Mon, 9 Jul 2018 17:16:24 +0800 Subject: [PATCH 2/3] * Finish task #4544. --- module/product/control.php | 11 ++++++----- module/product/view/create.html.php | 4 ++-- module/tree/control.php | 7 +++++-- module/tree/css/common.css | 2 ++ module/tree/view/browse.html.php | 3 ++- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index e50f83637d..a21f07c06e 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -558,11 +558,12 @@ class product extends control $output = html::select($field, $plans, $planID, "class='form-control chosen'"); if(count($plans) == 1 and $needCreate) { - $output .= ""; - $output .= html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), $this->lang->productplan->create, '_blank'); - $output .= '  '; - $output .= html::a("javascript:loadProductPlans($productID)", $this->lang->refresh); - $output .= ''; + $output .= "
"; + $output .= html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch", '', true), "", '', "class='btn btn-icon' data-toggle='modal' data-type='iframe' data-width='95%' title='{$this->lang->productplan->create}'"); + $output .= '
'; + $output .= "
"; + $output .= html::a("#", "", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$this->lang->refresh}' onclick='loadProductPlans($productID)'"); + $output .= '
'; } die($output); } diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 4e754f784b..f8e4c1c16d 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -38,9 +38,9 @@ if(count($lines) == 1) { echo ""; - echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line"), $lang->tree->manageLine, '_blank'); + echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line", '', true), $lang->tree->manageLine, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); echo '  '; - echo html::a("javascript:loadProductLines({$rootID})", $lang->refresh, '', "class='refresh'"); + echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'"); echo ''; } ?> diff --git a/module/tree/control.php b/module/tree/control.php index 202bd98aa5..01147a880a 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -296,6 +296,9 @@ class tree extends control if(!empty($_POST)) { $this->tree->manageChild($rootID, $viewType); + + if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.$('a.refresh').click()}")); + die(js::reload('parent')); } } @@ -357,9 +360,9 @@ class tree extends control if(count($optionMenu) == 1 and $needManage) { $output .= ""; - $output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch"), $viewType == 'line' ? $this->lang->tree->manageLine : $this->lang->tree->manage, '_blank'); + $output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $viewType == 'line' ? $this->lang->tree->manageLine : $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); $output .= '  '; - $output .= $viewType == 'line' ? html::a("javascript:loadProductLines($rootID)", $this->lang->refresh) : html::a("javascript:loadProductModules($rootID)", $this->lang->refresh); + $output .= $viewType == 'line' ? html::a("#", $this->lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'") : html::a("#", $this->lang->refresh, '', "class='refresh' onclick='loadProductModules($rootID)'"); $output .= ''; } die($output); diff --git a/module/tree/css/common.css b/module/tree/css/common.css index c17a5ec478..4ca130302a 100644 --- a/module/tree/css/common.css +++ b/module/tree/css/common.css @@ -17,3 +17,5 @@ #modulesTree li > .list-toggle {top: 0} #childrenForm table tr > td.text-middle span{display:block; float:left;} + +.body-modal #mainMenu{display: none;} diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index a87480bb5a..70c0bfc61b 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -22,7 +22,8 @@
- + name;?> + Date: Mon, 9 Jul 2018 17:16:51 +0800 Subject: [PATCH 3/3] * Code for task 4640. --- module/productplan/control.php | 1 + module/story/view/create.html.php | 10 +++++----- module/story/view/edit.html.php | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 6a00642153..dd80eb90e6 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -49,6 +49,7 @@ class productplan extends control $planID = $this->productplan->create(); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('productplan', $planID, 'opened'); + if(isonlybody()) die(js::closeModal('parent.parent', '', "function(){parent.parent.$('a.refresh').click()}")); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$product&branch=$branch"))); } diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index df5d9eeaa6..b9f33602f4 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -45,9 +45,9 @@ if(count($moduleOptionMenu) == 1) { echo "
"; - echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch"), $lang->tree->manage, '_blank'); + echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=story¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); echo '  '; - echo html::a("javascript:loadProductModules($productID)", $lang->refresh); + echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'"); echo '
'; } ?> @@ -60,13 +60,13 @@
"; - echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), "", '_blank', "class='btn btn-icon' data-toggle='tooltip' title='{$lang->productplan->create}'"); + echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch", '', true), "", '', "class='btn btn-icon' data-toggle='modal' data-type='iframe' data-width='95%' title='{$lang->productplan->create}'"); echo '
'; echo "
"; - echo html::a("javascript:loadProductPlans($productID)", "", '', "class='btn btn-icon' data-toggle='tooltip' title='{$lang->refresh}'"); + echo html::a("#", "", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadProductPlans($productID)'"); echo '
'; } ?> diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 7521b86081..494ef21bad 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -84,9 +84,9 @@ if(count($moduleOptionMenu) == 1) { echo ""; - echo html::a($this->createLink('tree', 'browse', "rootID=$story->product&view=story¤tModuleID=0&branch=$story->branch"), $lang->tree->manage, '_blank'); + echo html::a($this->createLink('tree', 'browse', "rootID=$story->product&view=story¤tModuleID=0&branch=$story->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); echo '  '; - echo html::a("javascript:loadProductModules($story->product)", $lang->refresh); + echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($story->product)'"); echo ''; } ?> @@ -102,8 +102,8 @@ if(count($plans) == 1) { echo ""; - echo html::a($this->createLink('productplan', 'create', "productID=$story->product&branch=$story->branch"), $lang->productplan->create, '_blank'); - echo html::a("javascript:loadProductPlans($story->product)", $lang->refresh); + echo html::a($this->createLink('productplan', 'create', "productID=$story->product&branch=$story->branch", '', true), $lang->productplan->create, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); + echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductPlans($story->product)'"); echo ''; } ?>