From 16dde69d135bf2d232d0eba968b851588ea2118a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 23 May 2024 13:21:52 +0800 Subject: [PATCH] * Fix bug #50075. --- module/program/ui/browse.html.php | 4 ++-- module/program/ui/project.html.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index 73a244f671..788476fe11 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -197,11 +197,11 @@ dtable set::checkable($canBatchEdit), set::nested(true), set::className('shadow rounded'), - set::footPager(usePager()), set::canRowCheckable(jsRaw("function(rowID){return this.getRowInfo(rowID).data.type == 'project';}")), set::onRenderCell(jsRaw('window.renderCell')), set::orderBy($orderBy), set::sortLink(createLink('program', 'browse', "status={$status}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}¶m={$param}")), + set::footPager(usePager()), set::footToolbar(array ( 'type' => 'btn-group', @@ -216,11 +216,11 @@ dtable ) : null ) )), - set::footer(array($showCheckbox ? 'checkbox' : null, 'toolbar', 'checkedInfo', 'flex', 'pager')), set::checkInfo(jsRaw("function(checkedIDList){ return window.footerSummary(this, checkedIDList);}")), set::emptyTip($lang->program->noProgram), set::createTip($lang->program->create), set::createLink($canCreateProgram ? createLink('program', 'create') : ''), + !$canBatchEdit ? set::footer([jsRaw("function(){return {html: '{$summary}'};}"), 'flex', 'pager']) : null, set::customData(array('pageSummary' => $summary, 'checkedSummary' => $lang->program->checkedProjects)) ); diff --git a/module/program/ui/project.html.php b/module/program/ui/project.html.php index d825b8819d..d74ff3ff10 100644 --- a/module/program/ui/project.html.php +++ b/module/program/ui/project.html.php @@ -62,19 +62,22 @@ foreach($projectStats as $project) $project = $this->project->formatDataForList($project, $PMList); } -$summary = $browseType == 'all' ? sprintf($lang->project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount) : sprintf($lang->project->summary, count($projectStats)); -$footToolbar = hasPriv('project', 'batchEdit') ? array('items' => array(array('text' => $lang->edit, 'class' => 'btn batch-btn size-sm secondary', 'data-url' => $this->createLink('project', 'batchEdit', "from=pgmproject&programID={$programID}")))) : null; +$canBatchEdit = hasPriv('project', 'batchEdit'); +$summary = $browseType == 'all' ? sprintf($lang->project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount) : sprintf($lang->project->summary, count($projectStats)); +$footToolbar = $canBatchEdit ? array('items' => array(array('text' => $lang->edit, 'class' => 'btn batch-btn size-sm secondary', 'data-url' => $this->createLink('project', 'batchEdit', "from=pgmproject&programID={$programID}")))) : null; dtable ( set::userMap($users), set::cols($cols), set::data(array_values($projectStats)), + set::checkable($canBatchEdit), set::nested(false), set::orderBy($orderBy), set::sortLink(createLink('program', 'project', "programID={$programID}&&browseType={$browseType}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")), set::footToolbar($footToolbar), set::footPager(usePager()), + !$canBatchEdit ? set::footer([jsRaw("function(){return {html: '{$summary}'};}"), 'flex', 'pager']) : null, set::checkInfo(jsRaw("function(checkedIDList){ return window.footerSummary(checkedIDList, '{$summary}');}")) );