From ffaf91d467c850df4d0ae48bcb83b4af791043c7 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Tue, 22 Sep 2020 13:33:52 +0800 Subject: [PATCH] * Rename program to PRJ. --- module/bug/model.php | 6 +++--- module/product/model.php | 8 ++++---- module/programplan/model.php | 5 ++--- module/project/model.php | 3 ++- module/task/control.php | 2 +- module/user/model.php | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 292cdea6b9..bb449e3c53 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -108,7 +108,7 @@ class bugModel extends model { $now = helper::now(); $bug = fixer::input('post') - ->setDefault('program', $this->session->PRJ) + ->setDefault('PRJ', $this->session->PRJ) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) ->setDefault('project,story,task', 0) @@ -269,7 +269,7 @@ class bugModel extends model } } - $bug->program = $this->session->PRJ; + $bug->PRJ = $this->session->PRJ; $this->dao->insert(TABLE_BUG)->data($bug) ->autoCheck() ->batchCheck($this->config->bug->create->requiredFields, 'notempty') @@ -1367,7 +1367,7 @@ class bugModel extends model if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->beginIF($programID)->andWhere('program')->eq($programID)->fi() + ->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi() ->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi() ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('status')->ne('closed')->fi() ->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi() diff --git a/module/product/model.php b/module/product/model.php index d3a0eb1e7e..4b016875b6 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -272,7 +272,7 @@ class productModel extends model { return $this->dao->select('*')->from(TABLE_PRODUCT) ->where('deleted')->eq(0) - ->beginIF($programID)->andWhere('program')->eq($programID)->fi() + ->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi() ->beginIF($line > 0)->andWhere('line')->eq($line)->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi() ->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi() @@ -304,7 +304,7 @@ class productModel extends model $products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed') ->from(TABLE_PRODUCT) ->where('deleted')->eq(0) - ->beginIF($programID)->andWhere('program')->eq($programID)->fi() + ->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi() ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi() ->orderBy($orderBy) @@ -418,7 +418,7 @@ class productModel extends model { $product = fixer::input('post') ->setIF($this->post->acl != 'custom', 'whitelist', '') - ->setDefault('program', $this->session->PRJ) + ->setDefault('PRJ', $this->session->PRJ) ->setDefault('status', 'normal') ->setDefault('createdBy', $this->app->user->account) ->setDefault('createdDate', helper::now()) @@ -672,7 +672,7 @@ class productModel extends model ->where('t1.product')->eq((int)$productID) ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() - ->andWhere('t2.program')->gt(0) + ->andWhere('t2.type')->in('sprint,stage') ->andWhere('t2.deleted')->eq(0) ->orderBy('t1.project desc') ->fetchAll(); diff --git a/module/programplan/model.php b/module/programplan/model.php index e403970bbf..d52776fb9f 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -445,9 +445,8 @@ class programplanModel extends model $plan = new stdclass(); $plan->id = isset($planIDs[$key]) ? $planIDs[$key] : ''; - $plan->type = 'project'; - $plan->program = (int)$programID; - $plan->parent = $parentID; + $plan->type = 'stage'; + $plan->parent = $parentID ? $parentID : (int)$programID; $plan->name = $names[$key]; $plan->percent = $percents[$key]; $plan->attribute = empty($parentID) ? $attributes[$key] : $parentStage; diff --git a/module/project/model.php b/module/project/model.php index 81b9557a13..183c5e3403 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -307,7 +307,8 @@ class projectModel extends model $this->lang->project->team = $this->lang->project->teamname; $project = fixer::input('post') ->setDefault('status', 'wait') - ->setDefault('program', $this->session->PRJ) + ->setDefault('type', 'sprint') + ->setDefault('parent', $this->session->PRJ) ->setIF($this->post->acl != 'custom', 'whitelist', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) diff --git a/module/task/control.php b/module/task/control.php index 71c7e63a0c..153dd00389 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -47,7 +47,7 @@ class task extends control } $program = $this->loadModel('project')->getByID($this->session->PRJ); - if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; + if($program->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; $task = new stdClass(); $task->module = $moduleID; diff --git a/module/user/model.php b/module/user/model.php index 75c90098b6..666498e26c 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1547,7 +1547,7 @@ class userModel extends model $linkedProjectProducts = array(); if($objectType == 'product') { - $stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $stmt = $this->dao->select('project,t1.product')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') ->where('t1.product')->in($objectIdList) ->andWhere('t2.deleted')->eq(0)