From 8d33e803fe9e916b541149e385877775f7bdd13a Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 2 Sep 2021 14:09:54 +0800 Subject: [PATCH 1/5] * Adjust my api --- module/my/model.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/module/my/model.php b/module/my/model.php index 57b8c074e0..9ccbff3ed6 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -73,17 +73,16 @@ class myModel extends model ->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id') ->where('t1.deleted')->eq(0) ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->products)->fi() - ->andWhere('t1.PO')->eq($this->app->user->account) ->orderBy('t1.order_asc') ->fetchAll('id'); $productKeys = array_keys($products); - $stories = $this->dao->select('product, status, count(status) AS count') + $stories = $this->dao->select('product, sum(estimate) AS estimateCount') ->from(TABLE_STORY) ->where('deleted')->eq(0) ->andWhere('product')->in($productKeys) - ->groupBy('product, status') - ->fetchGroup('product', 'status'); + ->groupBy('product') + ->fetchPairs(); $plans = $this->dao->select('product, count(*) AS count') ->from(TABLE_PRODUCTPLAN) ->where('deleted')->eq(0) @@ -112,15 +111,19 @@ class myModel extends model foreach($products as $key => $product) { - $product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0; - $product->releases = isset($releases[$product->id]) ? $releases[$product->id] : 0; - if(isset($stories[$product->id])) $product->stories = $stories[$product->id]; + $product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0; + $product->releases = isset($releases[$product->id]) ? $releases[$product->id] : 0; + $product->storyCount = isset($stories[$product->id]) ? $stories[$product->id] : 0; if(isset($executions[$product->id])) $product->executions = $executions[$product->id]; $countAll++; if($product->status != 'closed') $countUnclosed++; if($product->status == 'closed') unset($products[$key]); } + /* Sort by storyCount,get five record */ + array_multisort(array_column($products, 'storyCount'), SORT_DESC, $products); + $products = array_slice($products, 0, 5); + $data->count_all = $countAll; $data->count_unclosed = $countUnclosed; $data->products = array_values($products); @@ -136,16 +139,18 @@ class myModel extends model public function getProjects() { $data = new stdClass(); + $countDoing = 0; $consumedAll = 0; $consumedThisYear = 0; $doingProjects = array(); - $projects = $this->loadModel('project')->getOverviewList('byStatus', 'all', 'order_asc'); + $projects = $this->loadModel('project')->getOverviewList('byStatus', 'all', 'id_desc'); $projectsConsumed = $this->project->getProjectsConsumed(array_keys($projects), 'this_year'); foreach($projects as $key => $project) { if($project->status == 'doing') { + $countDoing++; $workhour = $this->project->getWorkhour($project->id); $projects[$key]->progress = ($workhour->totalConsumed + $workhour->totalLeft) ? floor($workhour->totalConsumed / ($workhour->totalConsumed + $workhour->totalLeft) * 1000) / 1000 * 100 : 0; $doingProjects[] = $projects[$key]; @@ -154,7 +159,12 @@ class myModel extends model $consumedThisYear += $projectsConsumed[$project->id]->totalConsumed; } + /* Sort by consumed,get five record */ + array_multisort(array_column($doingProjects, 'consumed'), SORT_DESC, $doingProjects); + $doingProjects = array_slice($doingProjects, 0, 5); + $data->count_all = count($projects); + $data->count_doing = $countDoing; $data->consumed_all = $consumedAll; $data->consumed_this_year = $consumedThisYear; $data->projects = $doingProjects; From aba2bb23e7073b43283693b5e3cd8ba3ffee99dc Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 2 Sep 2021 14:09:49 +0800 Subject: [PATCH 2/5] * Finish task#42127. --- module/execution/css/executionkanban.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/css/executionkanban.css b/module/execution/css/executionkanban.css index 2fda8f1499..61f4acead8 100644 --- a/module/execution/css/executionkanban.css +++ b/module/execution/css/executionkanban.css @@ -12,7 +12,7 @@ #kanban tbody > tr > td {line-height: 24px;} #kanban tbody > tr > td {border-bottom: 2px solid #fff !important;} #kanban thead > tr > th:not(:last-child) {border-right: 2px solid #efefef;} -#kanban tbody > tr > td.color-my {background-color: #FFEDED; border-bottom: 5px solid #fff !important;} +#kanban tbody > tr > td.color-my {background-color: #F5F5F5; border-bottom: 5px solid #fff !important;} #kanban tbody > tr > td.color-project {background-color: #F5F5F5;} .s-doing .table-row .table-col:last-child, .c-progress {width: 30px;} From 17dba195eff736535ad93c88acf7a5e0ac473587 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 2 Sep 2021 14:17:44 +0800 Subject: [PATCH 3/5] * Fix bug #14764. --- www/theme/default/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 4434c8cf42..9aced3b2fa 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -45,6 +45,7 @@ a.showMoreImage:hover {opacity: 1;} #userMenu>ul>li {margin-right: 10px;} #userNav .dropdown-menu>li>a>.icon-w {top: 2px;} +#globalCreate .dropdown-menu {z-index: 2000;} .icon-plus-solid-circle:before {font-size: 30px; color: #3b92f7;} .create-list {min-width: 120px !important;} .create-list>li>a {padding-left: 35px !important;} From 8088a0c285361b0190d05cdcfba572388de6ba2d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 2 Sep 2021 14:33:50 +0800 Subject: [PATCH 4/5] * Finish task #42146. --- module/execution/model.php | 12 +++++++++--- module/product/config.php | 4 ++-- module/product/model.php | 4 ++-- module/product/view/create.html.php | 4 ++++ module/product/view/edit.html.php | 4 ++++ module/project/model.php | 2 ++ module/project/view/create.html.php | 6 +++++- module/project/view/edit.html.php | 9 ++++++--- 8 files changed, 34 insertions(+), 11 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 3ed0a6c0ed..4d412450aa 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -354,6 +354,11 @@ class executionModel extends model $this->lang->project->name = $this->lang->execution->name; $this->lang->project->code = $this->lang->execution->code; } + else + { + $this->lang->project->name = $this->lang->execution->execName; + $this->lang->project->code = $this->lang->execution->execCode; + } $this->dao->insert(TABLE_EXECUTION)->data($sprint) ->autoCheck($skipFields = 'begin,end') @@ -361,7 +366,7 @@ class executionModel extends model ->checkIF($sprint->begin != '', 'begin', 'date') ->checkIF($sprint->end != '', 'end', 'date') ->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin) - ->checkIF(!empty($sprint->code), 'code', 'unique') + ->checkIF(!empty($sprint->code), 'code', 'unique', "type in ('sprint','stage')") ->exec(); /* Add the creater to the team. */ @@ -499,6 +504,7 @@ class executionModel extends model foreach(explode(',', $this->config->execution->edit->requiredFields) as $field) { if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field; + if($oldExecution->type == 'stage' and $field == 'name') $this->lang->project->name = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->project->name); } /* Update data. */ @@ -508,7 +514,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->check('code', 'unique', "id != $executionID and code != '' and deleted = '0'") + ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')") ->where('id')->eq($executionID) ->limit(1) ->exec(); @@ -639,7 +645,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'gt', $execution->begin) - ->checkIF($execution->code != '', 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'") + ->checkIF(!empty($execution->code), 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and type in ('sprint','stage')") ->where('id')->eq($executionID) ->limit(1) ->exec(); diff --git a/module/product/config.php b/module/product/config.php index c5f8291efc..ba9339760b 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -85,8 +85,8 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=', $config->product->create = new stdclass(); $config->product->edit = new stdclass(); -$config->product->create->requiredFields = 'name'; -$config->product->edit->requiredFields = 'name'; +$config->product->create->requiredFields = 'name,code'; +$config->product->edit->requiredFields = 'name,code'; $config->product->editor = new stdclass(); $config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/product/model.php b/module/product/model.php index e9e891a509..7f5169436c 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -555,7 +555,7 @@ class productModel extends model $this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->create->requiredFields, 'notempty') ->checkIF(!empty($product->name), 'name', 'unique') - ->checkIF(!empty($product->name), 'code', 'unique') + ->checkIF(!empty($product->code), 'code', 'unique') ->exec(); if(!dao::isError()) @@ -625,8 +625,8 @@ class productModel extends model $product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->edit->requiredFields, 'notempty') + ->checkIF(!empty($product->code), 'code', 'unique', "id != $productID") ->check('name', 'unique', "id != $productID and deleted = '0'") - ->check('code', 'unique', "id != $productID and deleted = '0'") ->where('id')->eq($productID) ->exec(); diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 4ba5d04185..845e7267f4 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -52,6 +52,10 @@ product->name;?> + + product->code;?> + + product->PO;?> app->user->account, "class='form-control chosen'");?> diff --git a/module/product/view/edit.html.php b/module/product/view/edit.html.php index a619913fb7..ed7efcfb09 100644 --- a/module/product/view/edit.html.php +++ b/module/product/view/edit.html.php @@ -48,6 +48,10 @@ product->name;?> name, "class='form-control' required");?> + + product->code;?> + code, "class='form-control' required");?> + product->PO;?> PO, "class='form-control chosen'");?> diff --git a/module/project/model.php b/module/project/model.php index f34d432078..27ebda9435 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -802,6 +802,7 @@ class projectModel extends model $this->dao->insert(TABLE_PROJECT)->data($project) ->autoCheck() ->batchcheck($requiredFields, 'notempty') + ->checkIF(!empty($project->code), 'code', 'unique', "type='project'") ->check('name', 'unique', "type='project' AND deleted='0'") ->exec(); @@ -993,6 +994,7 @@ class projectModel extends model ->checkIF($project->begin != '', 'begin', 'date') ->checkIF($project->end != '', 'end', 'date') ->checkIF($project->end != '', 'end', 'gt', $project->begin) + ->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and type='project'") ->check('name', 'unique', "id != $projectID AND type='project' AND deleted='0'") ->where('id')->eq($projectID) ->exec(); diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index d3df8c3e31..ab28605baa 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -41,7 +41,11 @@ project->name;?> - + + + + project->code;?> + project->PM;?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 3f753cb2fe..2073c73d08 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -42,12 +42,15 @@ } ?> parent, "class='form-control chosen' $attr");?> - - + project->name;?> - name, "class='form-control' required");?> + name, "class='form-control' required");?> + + + project->code;?> + code, "class='form-control' required");?> project->PM;?> From 60369d8e64d55cf6272f387c9d1a1eb47a4d4e4e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 2 Sep 2021 14:40:12 +0800 Subject: [PATCH 5/5] * Finish task#42126. --- module/execution/css/executionkanban.css | 7 +++---- module/execution/view/executionkanban.html.php | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/execution/css/executionkanban.css b/module/execution/css/executionkanban.css index 61f4acead8..1e6e659ae1 100644 --- a/module/execution/css/executionkanban.css +++ b/module/execution/css/executionkanban.css @@ -9,11 +9,10 @@ .board-item + .board-item {margin-top: 10px;} #kanban {overflow-y: auto;} -#kanban tbody > tr > td {line-height: 24px;} -#kanban tbody > tr > td {border-bottom: 2px solid #fff !important;} #kanban thead > tr > th:not(:last-child) {border-right: 2px solid #efefef;} -#kanban tbody > tr > td.color-my {background-color: #F5F5F5; border-bottom: 5px solid #fff !important;} -#kanban tbody > tr > td.color-project {background-color: #F5F5F5;} +#kanban tbody > tr > td {line-height: 24px;} +#kanban tbody > tr > td {background-color: #F5F5F5;} +#kanban tbody > tr:not(:last-child) {border-bottom: 5px solid #fff !important;} .s-doing .table-row .table-col:last-child, .c-progress {width: 30px;} .table-row .table-col:first-child {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} diff --git a/module/execution/view/executionkanban.html.php b/module/execution/view/executionkanban.html.php index b4b7775a76..a77eef6a01 100644 --- a/module/execution/view/executionkanban.html.php +++ b/module/execution/view/executionkanban.html.php @@ -30,7 +30,7 @@ $executionList):?> - +
execution->myExecutions : zget($projects, $projectID);?> @@ -38,7 +38,7 @@
- +
execution->kanbanColType as $colStatus => $colName):?>