* Finish task #6546.
This commit is contained in:
@@ -28,14 +28,14 @@ class datatable extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSave()
|
||||
public function ajaxSave($type = '')
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
if($account == 'guest') $this->send(array('result' => 'fail', 'target' => $target, 'message' => 'guest.'));
|
||||
|
||||
$name = 'datatable.' . $this->post->target . '.' . $this->post->name;
|
||||
$name = $type == 'allModule' ? 'project.task.allModule' : 'datatable.' . $this->post->target . '.' . $this->post->name;
|
||||
$this->loadModel('setting')->setItem($account . '.' . $name, $this->post->value);
|
||||
if($this->post->global) $this->setting->setItem('system.' . $name, $this->post->value);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ $lang->datatable->branch = 'Branch';
|
||||
$lang->datatable->platform = 'Platform';
|
||||
|
||||
$lang->datatable->showModule = 'Show module names on the list page';
|
||||
$lang->datatable->showModuleAB = 'Show Module Names';
|
||||
$lang->datatable->showModuleAB = 'Show modules in the list';
|
||||
$lang->datatable->showModuleList[] = 'N/A';
|
||||
$lang->datatable->showModuleList['base'] = 'Base Node';
|
||||
$lang->datatable->showModuleList['end'] = 'End Node';
|
||||
|
||||
@@ -189,6 +189,7 @@ class project extends control
|
||||
$memberPairs = array();
|
||||
foreach($this->view->teamMembers as $key => $member) $memberPairs[$key] = $member->realname;
|
||||
|
||||
$extra = (isset($this->config->project->task->allModule) && $this->config->project->task->allModule == 1) ? 'allModule' : '';
|
||||
$showModule = !empty($this->config->datatable->projectTask->showModule) ? $this->config->datatable->projectTask->showModule : '';
|
||||
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($projectID, 'task', $showModule) : array();
|
||||
|
||||
@@ -209,7 +210,7 @@ class project extends control
|
||||
$this->view->productID = $productID;
|
||||
$this->view->modules = $this->tree->getTaskOptionMenu($projectID);
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'));
|
||||
$this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra);
|
||||
$this->view->memberPairs = $memberPairs;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty');
|
||||
$this->view->setShowModule = true;
|
||||
|
||||
@@ -72,6 +72,7 @@ $lang->project->effort = 'Effort';
|
||||
$lang->project->relatedMember = 'Team';
|
||||
$lang->project->watermark = 'Exported by ZenTao';
|
||||
$lang->project->viewByUser = 'By User';
|
||||
$lang->project->showAllModule = "Show {$lang->productCommon} modules";
|
||||
|
||||
$lang->project->start = 'Start';
|
||||
$lang->project->activate = 'Activate';
|
||||
|
||||
@@ -72,6 +72,10 @@ $lang->project->effort = '日志';
|
||||
$lang->project->relatedMember = '相关成员';
|
||||
$lang->project->watermark = '由禅道导出';
|
||||
$lang->project->viewByUser = '按用户查看';
|
||||
$lang->project->showAllModule = "是否显示完整{$lang->productCommon}模块";
|
||||
|
||||
$lang->project->showAllModuleList[0] = '不显示';
|
||||
$lang->project->showAllModuleList[1] = '显示';
|
||||
|
||||
$lang->project->start = "开始";
|
||||
$lang->project->activate = "激活";
|
||||
|
||||
@@ -166,6 +166,7 @@ js::set('browseType', $browseType);
|
||||
<div class="text-center">
|
||||
<?php common::printLink('tree', 'browsetask', "rootID=$projectID&productID=0", $lang->tree->manage, '', "class='btn btn-info btn-wide'");?>
|
||||
<hr class="space-sm" />
|
||||
<?php echo html::a('#showAllModuleModal', $lang->project->showAllModule, '', "data-toggle='modal' class='text-secondary small'");?><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -338,6 +339,24 @@ js::set('browseType', $browseType);
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="showAllModuleModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog w-600px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon icon-close"></i></button>
|
||||
<h4 class="modal-title"><i class="icon-cog"></i> <?php echo $lang->project->showAllModule;?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class='form-condensed' method='post' target='hiddenwin' action='<?php echo $this->createLink('datatable', 'ajaxSave')?>'>
|
||||
<p>
|
||||
<span><?php echo html::radio('showAllModule', $lang->project->showAllModuleList, isset($config->project->task->allModule) ? $config->project->task->allModule : 0);?></span>
|
||||
<button type='button' id='setShowAllModule' class='btn btn-primary'><?php echo $lang->save?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('replaceID', 'taskList')?>
|
||||
<script>
|
||||
$(function()
|
||||
@@ -408,6 +427,22 @@ $(function()
|
||||
.replace('%left%', checkedLeft.toFixed(1));
|
||||
}
|
||||
})
|
||||
|
||||
$('#setShowAllModule').click(function()
|
||||
{
|
||||
var name = 'allModule';
|
||||
var value = $('#showAllModuleModal input[name="showAllModule"]:checked').val();
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
data: {name: name, value: value},
|
||||
success:function(){window.location.reload();},
|
||||
url: '<?php echo $this->createLink('datatable', 'ajaxSave', 'type=allModule')?>'
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -226,7 +226,7 @@ class tree extends control
|
||||
$this->view->newModule = $newModule;
|
||||
$this->view->currentProject = $currentProject;
|
||||
$this->view->projectModules = $this->tree->getTaskOptionMenu($currentProject, $productID);
|
||||
$this->view->modules = $this->tree->getTaskTreeMenu($rootID, $productID, $rooteModuleID = 0, array('treeModel', 'createTaskManageLink'));
|
||||
$this->view->modules = $this->tree->getTaskTreeMenu($rootID, $productID, $rooteModuleID = 0, array('treeModel', 'createTaskManageLink'), 'allModule');
|
||||
$this->view->sons = $this->tree->getTaskSons($rootID, $productID, $currentModuleID);
|
||||
$this->view->parentModules = $parentModules;
|
||||
$this->view->currentModuleID = $currentModuleID;
|
||||
|
||||
@@ -1706,7 +1706,8 @@ class treeModel extends model
|
||||
while($module = $stmt->fetch())
|
||||
{
|
||||
/* Ignore useless module for task. */
|
||||
if($keepModules and !isset($keepModules[$module->id])) continue;
|
||||
$allModule = (isset($this->config->project->task->allModule) and ($this->config->project->task->allModule == 1));
|
||||
if($keepModules and !isset($keepModules[$module->id]) and !$allModule) continue;
|
||||
if(isset($parent[$module->id]))
|
||||
{
|
||||
$module->children = $parent[$module->id]->children;
|
||||
|
||||
Reference in New Issue
Block a user