From abe047ee581a49edfc807577d36a68b66896a513 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 9 Nov 2022 03:07:57 +0000 Subject: [PATCH] * Finish task#75321. --- module/execution/model.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index ce7d32ce74..3c2ff6c461 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4744,21 +4744,10 @@ class executionModel extends model if($execution->type == 'stage') { - if($execution->grade == 1 && $this->loadModel('programplan')->isCreateTask($execution->id)) - { - common::printIcon('programplan', 'create', "program={$execution->parent}&productID=$productID&planID=$execution->id", $execution, 'list', 'split', '', '', '', '', $this->lang->programplan->createSubPlan); - } - else - { - if($execution->grade == 2) - { - echo ""; - } - else - { - echo common::hasPriv('programplan', 'create') ? html::a('javascript:alert("' . $this->lang->programplan->error->createdTask . '");', '', '', 'class="btn"') : ''; - } - } + $isCreateTask = $this->loadModel('programplan')->isCreateTask($execution->id); + $disabled = ($execution->grade == 1 && $isCreateTask) ? '' : ' disabled'; + $title = !$isCreateTask ? $this->lang->programplan->error->createdTask : $this->lang->programplan->createSubPlan; + common::printIcon('programplan', 'create', "program={$execution->parent}&productID=$productID&planID=$execution->id", $execution, 'list', 'split', '', $disabled, '', '', $title); } if($execution->type == 'stage')