From df87ffddd2a97697ef0cbde04712f03125d4f67b Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 20 May 2022 03:40:45 +0000 Subject: [PATCH] * Finish task#54472. --- module/program/control.php | 3 +++ module/program/js/browse.js | 2 +- module/program/view/browse.html.php | 3 ++- module/program/view/browsebylist.html.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index 9a5da66301..16b38013ff 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -67,9 +67,11 @@ class program extends control /* Get PM id list. */ $accounts = array(); + $hasProject = false; foreach($programs as $program) { if(!empty($program->PM) and !in_array($program->PM, $accounts)) $accounts[] = $program->PM; + if($hasProject === false and $program->type != 'program') $hasProject = true; } $PMList = $this->loadModel('user')->getListByAccounts($accounts, 'account'); @@ -92,6 +94,7 @@ class program extends control $this->view->programType = $programType; $this->view->PMList = $PMList; $this->view->progressList = $this->program->getProgressList(); + $this->view->hasProject = $hasProject; $this->display(); } diff --git a/module/program/js/browse.js b/module/program/js/browse.js index e716e7b4b2..88dd409049 100644 --- a/module/program/js/browse.js +++ b/module/program/js/browse.js @@ -67,7 +67,7 @@ function showEditCheckbox(show) $tr.find('td:first').find('[name^="projectIdList"]').parent().remove(); } }); - if(show) + if(show && hasProject) { var tableFooter = "
"; $('#programForm').attr('action', createLink('project', 'batchEdit', 'from=program')); diff --git a/module/program/view/browse.html.php b/module/program/view/browse.html.php index 75e70e538f..87f36f0e7f 100644 --- a/module/program/view/browse.html.php +++ b/module/program/view/browse.html.php @@ -15,6 +15,7 @@ edit);?> selectAll);?> + @@ -26,7 +27,7 @@ $lang->program->showClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?> - $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?> + $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?> user->search;?>
diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index c125b501a8..4497bfe809 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -146,7 +146,7 @@