* Add single release block.
This commit is contained in:
@@ -267,7 +267,8 @@ $config->block->params['productDoc'] = $config->block->params['default']->count;
|
||||
|
||||
$config->block->params['projectDoc'] = $config->block->params['default']->count;
|
||||
|
||||
$config->block->params['singlestory'] = $config->block->params['story'];
|
||||
$config->block->params['singlestory'] = $config->block->params['story'];
|
||||
$config->block->params['singlerelease'] = $config->block->params['release'];
|
||||
|
||||
$config->block->modules['project'] = new stdclass();
|
||||
$config->block->modules['project']->moreLinkList = new stdclass();
|
||||
|
||||
@@ -6,8 +6,8 @@ $config->block->release = new stdclass();
|
||||
$config->block->release->dtable = new stdclass();
|
||||
$config->block->release->dtable->fieldList = array();
|
||||
$config->block->release->dtable->fieldList['id'] = array('name' => 'id', 'title' => $lang->idAB, 'type' => 'id', 'sortType' => true);
|
||||
$config->block->release->dtable->fieldList['name'] = array('name' => 'name', 'title' => $lang->release->name, 'type' => 'title', 'sortType' => true, 'flex' => 1);
|
||||
$config->block->release->dtable->fieldList['productName'] = array('name' => 'productName', 'title' => $lang->release->product, 'type' => 'text', 'sortType' => true, 'minWidth' => '100');
|
||||
$config->block->release->dtable->fieldList['name'] = array('name' => 'name', 'title' => $lang->release->name, 'type' => 'title', 'sortType' => true, 'flex' => 1, 'link' => array('module' => 'release', 'method' => 'view', 'params' => 'release={id}'));
|
||||
$config->block->release->dtable->fieldList['productName'] = array('name' => 'productName', 'title' => $lang->release->product, 'type' => 'text', 'sortType' => true, 'minWidth' => '100', 'link' => array('module' => 'product', 'method' => 'browse', 'params' => 'productID={product}'));
|
||||
$config->block->release->dtable->fieldList['buildName'] = array('name' => 'buildName', 'title' => $lang->release->build, 'type' => 'text', 'sortType' => true, 'minWidth' => '100');
|
||||
$config->block->release->dtable->fieldList['date'] = array('name' => 'date', 'title' => $lang->release->date, 'type' => 'date', 'sortType' => true);
|
||||
$config->block->release->dtable->fieldList['status'] = array('name' => 'status', 'title' => $lang->release->status, 'type' => 'status', 'sortType' => true, 'statusMap' => $lang->release->statusList);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
window.onRenderReleaseNameCell = function(result, info)
|
||||
{
|
||||
if(info.col.name === 'name' && info.row.data.marker == '1')
|
||||
{
|
||||
result[result.length] = {html: "<icon class='icon icon-flag text-danger' title='" + markerTitle + "'></icon>"};
|
||||
return result;
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
window.onRenderReleaseNameCell = function(result, info)
|
||||
{
|
||||
if(info.col.name === 'name' && info.row.data.marker == '1')
|
||||
{
|
||||
result[result.length] = {html: "<icon class='icon icon-flag text-danger' title='" + markerTitle + "'></icon>"};
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -11,6 +11,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('markerTitle', $lang->release->marker);
|
||||
|
||||
if(!$longBlock)
|
||||
{
|
||||
unset($config->block->release->dtable->fieldList['id']);
|
||||
@@ -27,6 +29,7 @@ panel
|
||||
(
|
||||
set::height(318),
|
||||
set::fixedLeftWidth($longBlock ? '0.33' : '0.5'),
|
||||
set::onRenderCell(jsRaw('window.onRenderReleaseNameCell')),
|
||||
set::cols(array_values($config->block->release->dtable->fieldList)),
|
||||
set::data(array_values($releases))
|
||||
)
|
||||
|
||||
@@ -11,13 +11,27 @@ declare(strict_types=1);
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('markerTitle', $lang->release->marker);
|
||||
|
||||
if(!$longBlock)
|
||||
{
|
||||
unset($config->block->release->dtable->fieldList['id']);
|
||||
unset($config->block->release->dtable->fieldList['productName']);
|
||||
unset($config->block->release->dtable->fieldList['buildName']);
|
||||
}
|
||||
|
||||
panel
|
||||
(
|
||||
set('headingClass', 'border-b'),
|
||||
setClass('p-0'),
|
||||
set::title($block->title),
|
||||
div
|
||||
set::bodyClass('p-0 no-shadow border-t'),
|
||||
dtable
|
||||
(
|
||||
'正在开发中...'
|
||||
set::height(318),
|
||||
set::fixedLeftWidth($longBlock ? '0.33' : '0.5'),
|
||||
set::onRenderCell(jsRaw('window.onRenderReleaseNameCell')),
|
||||
set::cols(array_values($config->block->release->dtable->fieldList)),
|
||||
set::data(array_values($releases))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -2620,6 +2620,35 @@ class blockZen extends block
|
||||
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $orderBy, $this->viewType != 'json' ? $pager : '', 'story', true, 0, $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印单个产品发布列表区块数据。
|
||||
* Print releases block.
|
||||
*
|
||||
* @param object $block
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function printSingleReleaseBlock(object $block): void
|
||||
{
|
||||
$uri = $this->createLink('product', 'dashboard');
|
||||
$this->session->set('releaseList', $uri, 'product');
|
||||
$this->session->set('buildList', $uri, 'execution');
|
||||
|
||||
$productID = $this->session->product;
|
||||
|
||||
$this->app->loadLang('release');
|
||||
$this->view->releases = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName')->from(TABLE_RELEASE)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
|
||||
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
|
||||
->where('t1.deleted')->eq('0')
|
||||
->andWhere('t2.shadow')->eq(0)
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
|
||||
->orderBy('t1.id desc')
|
||||
->beginIF($this->viewType != 'json')->limit((int)$block->params->count)->fi()
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为内部调用。
|
||||
* Check request client is chandao or not.
|
||||
|
||||
Reference in New Issue
Block a user