Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/244_wzm_70007
This commit is contained in:
@@ -25,7 +25,7 @@ class productProjectsEntry extends entry
|
||||
$appendFields = $this->param('fields', '');
|
||||
|
||||
$control = $this->loadController('product', 'project');
|
||||
$control->project($this->param('status', 'all'), $productID, $this->param('branch', 0), $this->param('involved', 0), $this->param('order', 'order_desc'));
|
||||
$control->project($this->param('status', 'all'), $productID, $this->param('branch', 0), $this->param('involved', 0), $this->param('order', 'order_desc'), 0, $this->param('limit', 20), $this->param('page', 1));
|
||||
$data = $this->getData();
|
||||
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
|
||||
@@ -23,8 +23,10 @@ class projectReleasesEntry extends entry
|
||||
if(empty($projectID)) $projectID = $this->param('project');
|
||||
if(empty($projectID)) return $this->sendError(400, 'Need project id.');
|
||||
|
||||
$page = intval($this->param('page', 1));
|
||||
$limit = intval($this->param('limit', 20));
|
||||
$control = $this->loadController('projectrelease', 'browse');
|
||||
$control->browse($projectID, $this->param('execution', 0), $this->param('status', 'all'), $this->param('order', 't1.date_desc'));
|
||||
$control->browse($projectID, $this->param('execution', 0), $this->param('status', 'all'), $this->param('order', 't1.date_desc'), 0, $limit, $page);
|
||||
|
||||
/* Response */
|
||||
$data = $this->getData();
|
||||
|
||||
@@ -73,10 +73,13 @@ class product extends control
|
||||
* @param int $branch
|
||||
* @param int $involved
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function project($status = 'all', $productID = 0, $branch = '', $involved = 0, $orderBy = 'order_desc')
|
||||
public function project($status = 'all', $productID = 0, $branch = '', $involved = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->app->loadLang('execution');
|
||||
$this->loadModel('project');
|
||||
@@ -87,9 +90,13 @@ class product extends control
|
||||
|
||||
$this->product->setMenu($productID, $branch);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get PM id list. */
|
||||
$accounts = array();
|
||||
$projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $involved, $orderBy);
|
||||
$projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $involved, $orderBy, $pager);
|
||||
$product = $this->product->getByID($productID);
|
||||
$projects = $this->project->getPairsByProgram($product->program, 'all', false, 'order_asc');
|
||||
|
||||
@@ -112,6 +119,10 @@ class product extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->branchID = $branch;
|
||||
$this->view->branchStatus = $this->loadModel('branch')->getByID($branch, 0, 'status');
|
||||
$this->view->recTotal = $recTotal;
|
||||
$this->view->recPerPage = $recPerPage;
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,15 +1183,16 @@ class productModel extends model
|
||||
/**
|
||||
* Get project list by product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $browseType
|
||||
* @param int $branch
|
||||
* @param int $involved
|
||||
* @param string $orderBy
|
||||
* @param int $productID
|
||||
* @param string $browseType
|
||||
* @param int $branch
|
||||
* @param int $involved
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectListByProduct($productID, $browseType = 'all', $branch = 0, $involved = 0, $orderBy = 'order_desc')
|
||||
public function getProjectListByProduct($productID, $browseType = 'all', $branch = 0, $involved = 0, $orderBy = 'order_desc', $pager = null)
|
||||
{
|
||||
$projectList = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
@@ -1210,6 +1211,7 @@ class productModel extends model
|
||||
->beginIF($branch !== '' and $branch !== 'all')->andWhere('t1.branch')->in($branch)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
/* Determine how to display the name of the program. */
|
||||
@@ -1231,12 +1233,13 @@ class productModel extends model
|
||||
* @param int $branch
|
||||
* @param int $involved
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectStatsByProduct($productID, $browseType = 'all', $branch = 0, $involved = 0, $orderBy = 'order_desc')
|
||||
public function getProjectStatsByProduct($productID, $browseType = 'all', $branch = 0, $involved = 0, $orderBy = 'order_desc', $pager = null)
|
||||
{
|
||||
$projects = $this->getProjectListByProduct($productID, $browseType, $branch, $involved, $orderBy);
|
||||
$projects = $this->getProjectListByProduct($productID, $browseType, $branch, $involved, $orderBy, $pager);
|
||||
if(empty($projects)) return array();
|
||||
|
||||
$projectKeys = array_keys($projects);
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'><?php echo $pager->show('left', 'pagerjs');?></div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,6 @@ th.c-name {min-width: 240px;}
|
||||
th.c-name {width: auto;}
|
||||
}
|
||||
[lang^='en'] .project-name > .label-warning {width: 55px !important;}
|
||||
[lang^='en'] .c-status {width: 100px !important;}
|
||||
|
||||
.table-responsive {overflow: auto !important;}
|
||||
.checkbox-primary {margin-right: 10px;}
|
||||
|
||||
@@ -61,10 +61,13 @@ class projectrelease extends control
|
||||
* @param int $executionID
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($projectID = 0, $executionID = 0, $type = 'all', $orderBy = 't1.date_desc')
|
||||
public function browse($projectID = 0, $executionID = 0, $type = 'all', $orderBy = 't1.date_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->session->set('releaseList', $this->app->getURI(true), 'project');
|
||||
$project = $this->project->getById($projectID);
|
||||
@@ -75,16 +78,24 @@ class projectrelease extends control
|
||||
|
||||
$objectName = isset($project->name) ? $project->name : $execution->name;
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $objectName . $this->lang->colon . $this->lang->release->browse;
|
||||
$this->view->position[] = $this->lang->release->browse;
|
||||
$this->view->execution = $execution;
|
||||
$this->view->project = $project;
|
||||
$this->view->products = $this->loadModel('product')->getProducts($projectID);
|
||||
$this->view->releases = $this->projectrelease->getList($projectID, $type, $orderBy);
|
||||
$this->view->releases = $this->projectrelease->getList($projectID, $type, $orderBy, $pager);
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->type = $type;
|
||||
$this->view->from = $this->app->tab;
|
||||
$this->view->recTotal = $recTotal;
|
||||
$this->view->recPerPage = $recPerPage;
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class projectreleaseModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($projectID, $type = 'all', $orderBy = 't1.date_desc')
|
||||
public function getList($projectID, $type = 'all', $orderBy = 't1.date_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.execution, t4.name as executionName')
|
||||
->from(TABLE_RELEASE)->alias('t1')
|
||||
@@ -61,6 +61,7 @@ class projectreleaseModel extends model
|
||||
->beginIF($type == 'review')->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)")->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='table-footer'><?php echo $pager->show('left', 'pagerjs');?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -24,16 +24,6 @@ $status = $this->session->testTaskVersionStatus;
|
||||
</style>
|
||||
<div id="mainMenu" class='clearfix'>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<div class='btn-group'>
|
||||
<?php $viewName = $scope == 'local'? $productName : $lang->testtask->all;?>
|
||||
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo $viewName;?>'><?php echo $viewName;?></span> <span class='caret'></span></a>
|
||||
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
|
||||
<?php
|
||||
echo "<li>" . html::a(inlink('browse', "productID=$productID&branch=0&type=all,$status"), $lang->testtask->all) . "</li>";
|
||||
echo "<li>" . html::a(inlink('browse', "productID=$productID&branch=$branch&type=local,$status"), $productName, '', "title='{$productName}' class='text-ellipsis'") . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php common::sortFeatureMenu();?>
|
||||
<?php foreach($lang->testtask->featureBar['browse'] as $key => $label):?>
|
||||
<?php $key = strtolower($key);?>
|
||||
|
||||
Reference in New Issue
Block a user