* code for task #73471.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$config->program = new stdclass();
|
||||
$config->program->showAllProjects = 0;
|
||||
|
||||
$config->program->editor = new stdclass();
|
||||
$config->program->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
*/
|
||||
class program extends control
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($moduleName = '', $methodName = '')
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
@@ -757,4 +765,16 @@ class program extends control
|
||||
|
||||
echo $this->fetch('program', 'product', "programID=$programID");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax set show setting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSetShowSetting()
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$this->loadModel('setting')->updateItem("{$this->app->user->account}.program.showAllProjects", $data->showAllProjects);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,3 +26,6 @@
|
||||
|
||||
.scroll {overflow-x: hidden; overflow-y: auto;}
|
||||
.fix-table-copy-wrapper thead > tr > th:first-child {background: none!important;}
|
||||
|
||||
#showSettingsBox {text-align:right; margin-top:-15px; margin-right:4px;}
|
||||
#showSettingsBox .checkbox-primary {display:inline-block;}
|
||||
|
||||
@@ -131,9 +131,14 @@ function calcColHeight(col, lane, colCards, colHeight)
|
||||
return colCards.length * 62;
|
||||
}
|
||||
|
||||
$(function()
|
||||
/**
|
||||
* Init kanban.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initKanban()
|
||||
{
|
||||
/* Init all kanbans */
|
||||
$.each(kanbanGroup, function(key, programsData)
|
||||
{
|
||||
var $kanban = $('#kanban-' + key);
|
||||
@@ -146,4 +151,23 @@ $(function()
|
||||
calcColHeight: calcColHeight
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
/* Init all kanbans */
|
||||
initKanban();
|
||||
|
||||
$('#showAllProjects').click(function()
|
||||
{
|
||||
var showAllProjects = $(this).prop('checked') ? 1 : 0;
|
||||
$.post(createLink('program', 'ajaxSetShowSetting'), {"showAllProjects": showAllProjects}, function()
|
||||
{
|
||||
$.get(createLink('program', 'kanban'), function(data)
|
||||
{
|
||||
$('#kanbanList').html($(data).find('#kanbanList').html());
|
||||
initKanban();
|
||||
});
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
@@ -82,6 +82,7 @@ $lang->program->manageMembers = '项目集团队';
|
||||
$lang->program->confirmChangePRJUint = '是否同步更新该项目集下子项目集和项目的预算的单位?若确认更新,请填写今日汇率。';
|
||||
$lang->program->exRateNotNegative = '『汇率』不能是负数。';
|
||||
$lang->program->changePRJUnit = '更新项目预算单位';
|
||||
$lang->program->showNotCurrentProjects = '显示非当前项目集的项目信息';
|
||||
|
||||
$lang->program->progress = '项目进度';
|
||||
$lang->program->children = '添加子项目集';
|
||||
|
||||
@@ -271,9 +271,8 @@ class programModel extends model
|
||||
->fetchGroup('product');
|
||||
|
||||
/* Get all products linked projects. */
|
||||
$projectGroup = $this->dao->select('DISTINCT t1.product, t2.id, t2.name, t2.status, t2.end')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')
|
||||
->on('t1.project = t2.id')
|
||||
$projectGroup = $this->dao->select('DISTINCT t1.product, t2.id, t2.name, t2.status, t2.end, t2.path')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t2.deleted')->eq(0)
|
||||
->andWhere('t1.product')->in($productPairs)
|
||||
->andWhere('t2.type')->eq('project')
|
||||
@@ -336,6 +335,7 @@ class programModel extends model
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if(helper::diffDate(helper::today(), $project->end) > 0) $project->delay = 1;
|
||||
if(!$this->config->program->showAllProjects and strpos($project->path, ",{$product->program},") !== 0) continue;
|
||||
|
||||
$status = $project->status == 'wait' ? 'wait' : 'doing';
|
||||
$execution = zget($doingExecutions, $project->id, array());
|
||||
|
||||
@@ -11,12 +11,18 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kanban.html.php';?>
|
||||
<div id='showSettingsBox'>
|
||||
<div class="checkbox-primary checkbox">
|
||||
<input type="checkbox" value="1" id="showAllProjects" title="<?php echo $lang->program->showNotCurrentProjects;?>" <?php echo $config->program->showAllProjects ? 'checked' : '';?>>
|
||||
<label for="showAllProjects"><?php echo $lang->program->showNotCurrentProjects;?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div id='kanbanList'>
|
||||
<?php if(empty($kanbanGroup)):?>
|
||||
<div class="table-empty-tip cell">
|
||||
<p class="text-muted"><?php echo $lang->program->noProgram;?></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='kanbanList'>
|
||||
<?php foreach($kanbanGroup as $type => $programs):?>
|
||||
<?php if(empty($programs)) continue;?>
|
||||
<div class='panel kanban-panel'>
|
||||
@@ -28,7 +34,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php
|
||||
$kanbanColumns = array();
|
||||
$kanbanColumns['unclosedProduct'] = array('name' => $lang->program->kanban->openProducts, 'type' => 'unclosedProduct');
|
||||
@@ -49,4 +54,5 @@ js::set('kanbanGroup', $kanbanGroup);
|
||||
js::set('doingText', $lang->program->statusList['doing']);
|
||||
?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user