* Finish task #4477

This commit is contained in:
liugang
2018-06-22 11:15:08 +08:00
parent bace586795
commit 01683e7ec4
3 changed files with 34 additions and 1 deletions

2
db/update10.0.beta.sql Normal file
View File

@@ -0,0 +1,2 @@
UPDATE `zt_block` SET `grid` = 8 WHERE `block` IN ('statistic', 'flowchart', 'welcome');
UPDATE `zt_block` SET `grid` = 4 WHERE `block` = 'overview';

View File

@@ -13,5 +13,16 @@ $config->block = new stdclass();
$config->block->editor = new stdclass();
$config->block->editor->set = array('id' => 'html', 'tools' => 'simple');
$config->block->longBlock = array();
$config->block->longBlock['']['flowchart'] = 'flowchart';
$config->block->longBlock['']['welcome'] = 'welcome';
$config->block->longBlock['product']['statistic'] = 'statistic';
$config->block->longBlock['project']['statistic'] = 'statistic';
$config->block->longBlock['qa']['statistic'] = 'statistic';
$config->block->shortBlock = array();
$config->block->shortBlock['product']['overview'] = 'overview';
$config->block->shortBlock['project']['overview'] = 'overview';
$config->statistic = new stdclass();
$config->statistic->storyStages = array('wait', 'planned', 'developing', 'testing', 'released');

View File

@@ -17,6 +17,26 @@
<div class='form-group'>
<label for='grid' class='col-sm-3'><?php echo $lang->block->grid;?></label>
<div class='col-sm-7'>
<?php echo html::select('grid', $lang->block->gridOptions, $block ? $block->grid : 8, "class='form-control chosen'")?>
<?php
$grid = 8;
$gridOptions = $lang->block->gridOptions;
if($block)
{
$type = $block->block;
$source = $block->source;
$grid = $block->grid;
}
if(isset($config->block->longBlock[$source][$type]))
{
$grid = 8;
unset($gridOptions[4]);
}
elseif(isset($config->block->shortBlock[$source][$type]))
{
$grid = 4;
unset($gridOptions[8]);
}
echo html::select('grid', $gridOptions, $grid, "class='form-control'");
?>
</div>
</div>