* finish task #40874.

This commit is contained in:
王怡栋
2021-08-31 14:33:25 +08:00
parent 454ddd6394
commit 189cca6b75
3 changed files with 12 additions and 15 deletions
+5 -8
View File
@@ -96,9 +96,6 @@ class program extends control
$this->program->setMenu($programID);
$program = $this->program->getByID($programID);
if(empty($program) || $program->type != 'program') die(js::error($this->lang->notFound) . js::locate('back'));
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -106,6 +103,7 @@ class program extends control
/* Get the top programID. */
if($programID)
{
$program = $this->program->getByID($programID);
$path = explode(',', $program->path);
$path = array_filter($path);
$programID = current($path);
@@ -113,7 +111,7 @@ class program extends control
$this->view->title = $this->lang->program->product;
$this->view->position[] = $this->lang->program->product;
$this->view->program = $program;
$this->view->programID = $programID;
$this->view->browseType = $browseType;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
@@ -386,12 +384,12 @@ class program extends control
{
$programID = $this->program->saveState($programID, $this->program->getPairs());
setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if(!$programID) $this->locate($this->createLink('program', 'browse'));
$this->program->setMenu($programID);
$this->app->session->set('programProject', $this->app->getURI(true), 'program');
$this->app->session->set('projectList', $this->app->getURI(true), 'project');
$uri = $this->app->getURI(true);
$this->app->session->set('programProject', $uri, 'program');
$this->app->session->set('projectList', $uri, 'program');
$this->loadModel('datatable');
@@ -410,7 +408,6 @@ class program extends control
$this->view->projectStats = $projectStats;
$this->view->pager = $pager;
$this->view->programID = $programID;
$this->view->program = $this->program->getByID($programID);
$this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted');
$this->view->browseType = $browseType;
$this->view->orderBy = $orderBy;
+6 -6
View File
@@ -17,11 +17,11 @@
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
<?php $active = $key == $browseType ? 'btn-active-text' : '';?>
<?php if($key == $browseType) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
<?php echo html::a(inlink("product", "programID=$program->id&browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link $active'");?>
<?php echo html::a(inlink("product", "programID=$programID&browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link $active'");?>
<?php endforeach;?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('product', 'create', "programID=$program->id", '<i class="icon icon-plus"></i> ' . $lang->product->create, '', 'class="btn btn-primary"');?>
<?php common::printLink('product', 'create', "programID=$programID", '<i class="icon icon-plus"></i> ' . $lang->product->create, '', 'class="btn btn-primary"');?>
</div>
<?php endif;?>
</div>
@@ -32,11 +32,11 @@
</div>
<?php else:?>
<div class="main-col">
<form class="main-table table-product" data-ride="table" id="productListForm" method="post" action='<?php echo $this->createLink('product', 'batchEdit', "programID=$program->id");?>'>
<form class="main-table table-product" data-ride="table" id="productListForm" method="post" action='<?php echo $this->createLink('product', 'batchEdit', "programID=$programID");?>'>
<?php $canOrder = common::hasPriv('product', 'updateOrder');?>
<?php $canBatchEdit = common::hasPriv('product', 'batchEdit');?>
<table id="productList" class="table has-sort-head table-bordered table-fixed">
<?php $vars = "programID=$program->id&browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $vars = "programID=$programID&browseType=$browseType&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr class="text-center">
<th class='c-id text-left' rowspan='2'>
@@ -104,7 +104,7 @@
<td><?php echo $product->plans;?></td>
<td><?php echo $product->releases;?></td>
<td class='c-actions'>
<?php common::printIcon('product', 'edit', "product=$product->id&action=edit&extra=&programID=$program->id", $product, 'list', 'edit');?>
<?php common::printIcon('product', 'edit', "product=$product->id&action=edit&extra=&programID=$programID", $product, 'list', 'edit');?>
<?php if($canOrder):?>
<span class='c-actions sort-handler'><i class="icon icon-move"></i></span>
<?php endif;?>
@@ -129,7 +129,7 @@
<?php endif;?>
</div>
<?php js::set('orderBy', $orderBy)?>
<?php js::set('programID', $program->id)?>
<?php js::set('programID', $programID)?>
<script>
$(function()
{