diff --git a/module/program/model.php b/module/program/model.php index e560fe5a3a..f761b31132 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -323,57 +323,6 @@ class programModel extends model return array($productGroup, $planGroup, $releaseGroup, $projectGroup, $doingExecutions); } - /** - * 处理项目集看板中产品数据。 - * Process product data in program Kanban. - * - * @param array $productGroup - * @param array $planGroup - * @param array $releaseGroup - * @param array $projectGroup - * @param array $doingExecutions - * @access public - * @return array - */ - public function processProductsForKanban(array $productGroup, array $planGroup, array $releaseGroup, array $projectGroup, array $doingExecutions): array - { - if(empty($productGroup)) return $productGroup; - - $today = helper::today(); - foreach($productGroup as $programID => $products) - { - foreach($products as $product) - { - $product->plans = zget($planGroup, $product->id, array()); - - /* Convert predefined HTML entities to characters. */ - foreach($product->plans as $plan) $plan->title = htmlspecialchars_decode($plan->title, ENT_QUOTES); - $product->name = htmlspecialchars_decode($product->name, ENT_QUOTES); - - $product->releases = zget($releaseGroup, $product->id, array()); - $projects = zget($projectGroup, $product->id, array()); - foreach($projects as $project) - { - if(helper::diffDate($today, $project->end) > 0) $project->delay = 1; - if($this->config->systemMode == 'ALM' && !$this->config->program->showAllProjects && $project->parent != $product->program && strpos($project->path, ",{$product->program},") !== 0) continue; - - $status = $project->status == 'wait' ? 'wait' : 'doing'; - $execution = zget($doingExecutions, $project->id, array()); - - if(!empty($execution) && helper::diffDate($today, $execution->end) > 0) $execution->delay = 1; - - $project->execution = $execution; - $project->hours = array('progress' => $project->progress); - - /* Convert predefined HTML entities to characters. */ - $project->name = htmlspecialchars_decode($project->name, ENT_QUOTES); - $product->projects[$status][] = $project; - } - } - } - return $productGroup; - } - /** * 获取用户参与的项目集列表信息。 * Get involved programs by user. diff --git a/module/program/test/model/processproductsforkanban.php b/module/program/test/model/processproductsforkanban.php deleted file mode 100644 index 8bd8f6cce3..0000000000 --- a/module/program/test/model/processproductsforkanban.php +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env php -gen(5); -su('admin'); - -zdTable('project')->config('program')->gen(30); -zdTable('product')->config('product')->gen(30); -zdTable('task')->gen(0); -zdTable('projectproduct')->gen(0); -zdTable('productplan')->gen(0); -zdTable('release')->gen(0); -zdTable('team')->gen(0); - -global $app; -$app->rawModule = 'program'; - -$programTester = new programTest(); -$productGroup = $programTester->processProductsForKanbanTest(); - -r(count($productGroup)) && p() && e('9'); // 获取产品的数量 -r($productGroup[1][0]) && p('name') && e('产品1'); // 获取产品的名字 -r($productGroup[1][0]) && p('plans:0') && e('``'); // 获取产品1的计划 -r($productGroup[1][0]) && p('releases:0') && e('``'); // 获取产品1的发布 diff --git a/module/program/test/program.class.php b/module/program/test/program.class.php index 46872da3e7..df9e1e8f10 100644 --- a/module/program/test/program.class.php +++ b/module/program/test/program.class.php @@ -358,20 +358,6 @@ class programTest return $this->program->getKanbanStatisticData($programs); } - /** - * 处理项目集看板中产品数据。 - * Process product data in program Kanban. - * - * @access public - * @return array - */ - public function processProductsForKanbanTest(): array - { - $programs = $this->program->getTopPairs('noclosed'); - list($productGroup, $planGroup, $releaseGroup, $projectGroup, $doingExecutions, ) = $this->program->getKanbanStatisticData($programs); - return $this->program->processProductsForKanban($productGroup, $planGroup, $releaseGroup, $projectGroup, $doingExecutions); - } - /** * 获取项目/执行的所属项目集ID。 * Get the programID of the project/execution.