* Adjust product ranking.
This commit is contained in:
@@ -144,21 +144,21 @@ class buildModel extends model
|
||||
$this->session->set('projectBuildForm', $query->form);
|
||||
}
|
||||
}
|
||||
if($this->session->PRJBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
|
||||
$buildQuery = $this->session->PRJBuildQuery;
|
||||
$buildQuery = $this->session->projectBuildQuery;
|
||||
|
||||
/* Distinguish between repeated fields. */
|
||||
$fields = array('id' => '`id`', 'name' => '`name`', 'product' => '`product`', 'desc' => '`desc`', 'project' => '`project`');
|
||||
foreach($fields as $field)
|
||||
{
|
||||
if(strpos($this->session->PRJBuildQuery, $field) !== false)
|
||||
if(strpos($this->session->projectBuildQuery, $field) !== false)
|
||||
{
|
||||
$buildQuery = str_replace($field, "t1." . $field, $buildQuery);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getExecutionBuilds($executionID, 'bysearch', $buildQuery);
|
||||
return $this->getProjectBuilds($projectID, 'bysearch', $buildQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -941,7 +941,7 @@ class product extends control
|
||||
|
||||
$moduleGroup = zget($this->lang->navGroup, $module);
|
||||
$moduleGroup = in_array($moduleGroup, array('product', 'qa'))? $moduleGroup : 'project';
|
||||
$products = $moduleGroup == 'project' ? $this->product->getProducts($this->session->PRJ, 'all', 'program desc, line desc, ') : $this->product->getList(0, 'all', 0, 0, 'program desc, line desc, ');
|
||||
$products = $moduleGroup == 'project' ? $this->product->getProducts($this->session->PRJ) : $this->product->getList();
|
||||
|
||||
$this->view->link = $this->product->getProductLink($module, $method, $extra);
|
||||
$this->view->productID = $productID;
|
||||
|
||||
@@ -258,7 +258,7 @@ class productModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($programID = 0, $status = 'all', $limit = 0, $line = 0, $orderBy = '')
|
||||
public function getList($programID = 0, $status = 'all', $limit = 0, $line = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCT)
|
||||
->where('deleted')->eq(0)
|
||||
@@ -274,7 +274,7 @@ class productModel extends model
|
||||
->orWhere('createdBy')->eq($this->app->user->account)
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->orderBy($orderBy . '`order` desc')
|
||||
->orderBy('program_asc,line_desc,order_asc')
|
||||
->beginIF($limit > 0)->limit($limit)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ class productModel extends model
|
||||
$productKeys = array_keys($products);
|
||||
$products = $this->dao->select('*')->from(TABLE_PRODUCT)
|
||||
->where('id')->in($productKeys)
|
||||
->orderBy($orderBy)
|
||||
->orderBy('program_asc,line_desc,' . $orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class programModel extends model
|
||||
{
|
||||
$link = html::a(helper::createLink('program', 'browse'), "<i class='icon icon-list'></i>", '', "style='border: none;'");
|
||||
$html = "<p style='padding-top:5px;'>" . $link . "</p>";
|
||||
return common::hasPriv('program', 'pgmbrowse') ? $html : '';
|
||||
return common::hasPriv('program', 'browse') ? $html : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,7 +464,7 @@ class programModel extends model
|
||||
|
||||
while($program = $stmt->fetch())
|
||||
{
|
||||
$link = $from == 'program' ? helper::createLink('program', 'pgmproduct', "programID=$program->id") : helper::createLink('product', 'all', "programID=$program->id" . $vars);
|
||||
$link = $from == 'program' ? helper::createLink('program', 'product', "programID=$program->id") : helper::createLink('product', 'all', "programID=$program->id" . $vars);
|
||||
$linkHtml = html::a($link, html::icon($this->lang->icons[$program->type], 'icon icon-sm text-muted') . ' ' . $program->name, '', "id='program$program->id' class='text-ellipsis' title=$program->name");
|
||||
|
||||
if(isset($programMenu[$program->id]) and !empty($programMenu[$program->id]))
|
||||
|
||||
@@ -9,12 +9,12 @@ $programsPinYin = common::convert2Pinyin($programNames);
|
||||
<div class="table-col col-left">
|
||||
<div class='list-group'>
|
||||
<?php
|
||||
echo $this->program->getPGMTreeMenu();
|
||||
echo $this->program->getTreeMenu();
|
||||
?>
|
||||
</div>
|
||||
<div class="col-footer">
|
||||
<div class='pull-right'>
|
||||
<?php echo html::checkbox('showClosed', array('1' => $lang->program->PGMShowClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
|
||||
<?php echo html::checkbox('showClosed', array('1' => $lang->program->showClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -125,6 +125,7 @@ class project extends control
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if($project->parent and $project->parent != $programID) continue;
|
||||
$project->parent = $this->program->getTopByID();
|
||||
$orderedProjects[] = $project;
|
||||
unset($projects[$project->id]);
|
||||
}
|
||||
|
||||
@@ -550,7 +550,7 @@ class projectModel extends model
|
||||
|
||||
/* Set search param. */
|
||||
if($type == 'execution') $this->config->build->search['module'] = 'executionBuild';
|
||||
if($type == 'execution') $this->config->build->search['module'] = 'executionBuild';
|
||||
if($type == 'project') $this->config->build->search['module'] = 'projectBuild';
|
||||
$this->config->build->search['actionURL'] = $actionURL;
|
||||
$this->config->build->search['queryID'] = $queryID;
|
||||
$this->config->build->search['params']['product']['values'] = $products;
|
||||
|
||||
Reference in New Issue
Block a user