* Finish task#54472.

This commit is contained in:
leiyong
2022-05-20 03:40:45 +00:00
parent 4e8ae522e4
commit df87ffddd2
4 changed files with 7 additions and 3 deletions

View File

@@ -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();
}

View File

@@ -67,7 +67,7 @@ function showEditCheckbox(show)
$tr.find('td:first').find('[name^="projectIdList"]').parent().remove();
}
});
if(show)
if(show && hasProject)
{
var tableFooter = "<div class='editCheckbox'><div class='checkbox-primary check-all'><input type='checkbox' id='checkAll' /><label>" + selectAll + "</label></div><div class='table-actions btn-toolbar'><button type='submit' class='btn'>" + edit + "</button></div></div>";
$('#programForm').attr('action', createLink('project', 'batchEdit', 'from=program'));

View File

@@ -15,6 +15,7 @@
<?php js::set('orderBy', $orderBy);?>
<?php js::set('edit', $lang->edit);?>
<?php js::set('selectAll', $lang->selectAll);?>
<?php js::set('hasProject', $hasProject);?>
<?php if($programType == 'bygrid'):?>
<style> #mainMenu{padding-left: 10px; padding-right: 10px;} </style>
<?php endif;?>
@@ -26,7 +27,7 @@
<?php echo html::a(inlink('browse', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
<?php endforeach;?>
<?php echo html::checkbox('showClosed', array('1' => $lang->program->showClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
<?php if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid') echo html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?>
<?php if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid' and $hasProject === true) echo html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '');?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
</div>
<div class='pull-right'>

View File

@@ -146,7 +146,7 @@
</tbody>
</table>
<div class='table-footer <?php if($status == 'bySearch') echo 'hide';?>'>
<div class="table-statistic"><?php echo $summary;?></div>
<div class="table-statistic">&nbsp;<?php echo $summary;?></div>
<?php if($status != 'bySearch') $pager->show('right', 'pagerjs');?>
</div>
</form>