From cab0ed4caf981df98545b60281ee311607aa6183 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 29 Nov 2022 15:50:31 +0800 Subject: [PATCH] project edit plan modify --- module/productplan/model.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 40a5e36044..2796962d0b 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -365,19 +365,22 @@ class productplanModel extends model $planGroup = array(); foreach($plans as $plan) { - if(!isset($planGroup[$plan->product][$plan->branch])) $planGroup[$plan->product][$plan->branch] = array('' => ''); - - if($plan->parent == '-1' and strpos($param, 'skipparent') !== false) continue; - - if($field == 'name') + foreach(explode(',', $plan->branch) as $branch) { - if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; - $planGroup[$plan->product][$plan->branch][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]"; - if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planGroup[$plan->product][$plan->branch][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; - } - else - { - $planGroup[$plan->product][$plan->branch][$plan->id] = $plan; + if(!isset($planGroup[$plan->product][$branch])) $planGroup[$plan->product][$branch] = array('' => ''); + + if($plan->parent == '-1' and strpos($param, 'skipparent') !== false) continue 2; + + if($field == 'name') + { + if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; + $planGroup[$plan->product][$branch][$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]"; + if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planGroup[$plan->product][$branch][$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; + } + else + { + $planGroup[$plan->product][$branch][$plan->id] = $plan; + } } } return $planGroup;