Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2019-11-27 10:24:49 +08:00
14 changed files with 67 additions and 67 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ class bug extends control
$this->view->plans = $this->loadModel('productplan')->getPairs($productID);
$this->view->stories = $storyList;
$this->view->tasks = $taskList;
$this->view->setShowModule = true;
$this->view->setModule = true;
$this->display();
}
+1 -1
View File
@@ -222,7 +222,7 @@ class caselib extends control
$this->view->moduleID = $moduleID;
$this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
$this->view->param = $param;
$this->view->setShowModule = true;
$this->view->setModule = true;
$this->display();
}
+39 -10
View File
@@ -5,8 +5,8 @@
<script>
$(function()
{
<?php if(!empty($setShowModule)):?>
$('#sidebar .cell .text-center:last').append("<a href='#showModuleModal' data-toggle='modal' class='text-secondary small'><?php echo $lang->datatable->showModuleAB?></a><hr class='space-sm' />");
<?php if(!empty($setModule)):?>
$('#sidebar .cell .text-center:last').append("<a href='#showModuleModal' data-toggle='modal' class='btn btn-info btn-wide'><?php echo $lang->datatable->moduleSetting?></a><hr class='space-sm' />");
<?php endif;?>
var $btnToolbar = $('#main .table-header .btn-toolbar:first');
@@ -22,13 +22,31 @@ $(function()
$('#setShowModule').click(function()
{
saveDatatableConfig('showModule', $('#showModuleModal input[name="showModule"]:checked').val(), true)
if('<?php echo $this->app->user->account?>' == 'guest') return;
datatableId = '<?php echo $datatableId?>';
var value = $('#showModuleModal input[name="showModule"]:checked').val();
var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val();
if(typeof allModule === 'undefined') allModule = false;
$.ajax(
{
type: "POST",
dataType: 'json',
data:
{
target: datatableId,
name: 'showModule',
value: value,
allModule: allModule,
},
success:function(){window.location.reload();},
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
});
});
window.saveDatatableConfig = function(name, value, reload, global)
{
if('<?php echo $this->app->user->account?>' == 'guest') return;
datatableId = '<?php echo $datatableId?>';
var datatableId = '<?php echo $datatableId;?>';
if(typeof value === 'object') value = JSON.stringify(value);
if(typeof global === 'undefined') global = 0;
$.ajax(
@@ -36,7 +54,7 @@ $(function()
type: "POST",
dataType: 'json',
data: {target: datatableId, name: name, value: value, global: global},
success:function(){if(reload) window.location.reload();},
success:function(e){if(reload) window.location.reload();},
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
});
$.get(createLink('score', 'ajax', "method=switchToDataTable"));
@@ -49,14 +67,25 @@ $(function()
<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->datatable->showModule?></h4>
<h4 class="modal-title"><i class="icon-cog"></i> <?php echo $lang->datatable->moduleSetting;?></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('showModule', $lang->datatable->showModuleList, isset($config->datatable->$datatableId->showModule) ? $config->datatable->$datatableId->showModule : '');?></span>
<button type='button' id='setShowModule' class='btn btn-primary'><?php echo $lang->save?></button>
</p>
<table class='table table-form'>
<tr>
<td class='w-150px'><?php echo $lang->datatable->showModule;?></td>
<td><?php echo html::radio('showModule', $lang->datatable->showModuleList, isset($config->datatable->$datatableId->showModule) ? $config->datatable->$datatableId->showModule : '');?></td>
</tr>
<?php if($app->moduleName == 'project' && $app->methodName == 'task'):?>
<tr>
<td><?php echo $lang->datatable->showAllModule;?></td>
<td><?php echo html::radio('showAllModule', $lang->datatable->showAllModuleList, isset($config->project->task->allModule) ? $config->project->task->allModule : 0);?></td>
</tr>
<?php endif;?>
<tr>
<td colspan='2' class='text-center'><button type='button' id='setShowModule' class='btn btn-primary'><?php echo $lang->save?></button></td>
</tr>
</table>
</form>
</div>
</div>
+3 -2
View File
@@ -28,15 +28,16 @@ class datatable extends control
* @access public
* @return void
*/
public function ajaxSave($type = '')
public function ajaxSave()
{
if(!empty($_POST))
{
$account = $this->app->user->account;
if($account == 'guest') $this->send(array('result' => 'fail', 'target' => $target, 'message' => 'guest.'));
$name = $type == 'allModule' ? 'project.task.allModule' : 'datatable.' . $this->post->target . '.' . $this->post->name;
$name = 'datatable.' . $this->post->target . '.' . $this->post->name;
$this->loadModel('setting')->setItem($account . '.' . $name, $this->post->value);
if($this->post->allModule !== false) $this->setting->setItem("$account.project.task.allModule", $this->post->allModule);
if($this->post->global) $this->setting->setItem('system.' . $name, $this->post->value);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => 'dao error.'));
+3 -2
View File
@@ -18,8 +18,9 @@ $lang->datatable->resetGlobal = 'Global Reset';
$lang->datatable->branch = 'Branch';
$lang->datatable->platform = 'Platform';
$lang->datatable->showModule = 'Show module names on the list page';
$lang->datatable->showModuleAB = 'Show modules in the list';
$lang->datatable->moduleSetting = 'Set Module';
$lang->datatable->showModule = 'Show modules in the list';
$lang->datatable->showAllModule = 'Show product modules';
$lang->datatable->showModuleList[] = 'N/A';
$lang->datatable->showModuleList['base'] = 'Base Node';
$lang->datatable->showModuleList['end'] = 'End Node';
+4 -1
View File
@@ -18,8 +18,11 @@ $lang->datatable->resetGlobal = '全局恢复默认';
$lang->datatable->branch = '分支';
$lang->datatable->platform = '平台';
$lang->datatable->moduleSetting = '模块设置';
$lang->datatable->showModule = '列表页是否显示模块名';
$lang->datatable->showModuleAB = '列表页是否显示模块名';
$lang->datatable->showAllModule = '是否显示完整产品模块';
$lang->datatable->showModuleList[] = '不显示';
$lang->datatable->showModuleList['base'] = '只显示一级模块';
$lang->datatable->showModuleList['end'] = '只显示最后一级模块';
$lang->datatable->showAllModuleList[0] = '不显示';
$lang->datatable->showAllModuleList[1] = '显示';
+1 -1
View File
@@ -188,7 +188,7 @@ class product extends control
$this->view->branch = $branch;
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->storyStages = $this->product->batchGetStoryStage($stories);
$this->view->setShowModule = true;
$this->view->setModule = true;
$this->view->storyTasks = $storyTasks;
$this->view->storyBugs = $storyBugs;
$this->view->storyCases = $storyCases;
+1 -1
View File
@@ -214,7 +214,7 @@ class project extends control
$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;
$this->view->setModule = true;
$this->display();
}
-1
View File
@@ -72,7 +72,6 @@ $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';
-4
View File
@@ -72,10 +72,6 @@ $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 = "激活";
-35
View File
@@ -166,7 +166,6 @@ 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>
@@ -339,24 +338,6 @@ 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()
@@ -427,22 +408,6 @@ $(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';?>
+1 -1
View File
@@ -136,7 +136,7 @@ class testcase extends control
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
$this->view->suiteID = $suiteID;
$this->view->setShowModule = true;
$this->view->setModule = true;
$this->display();
}
+12 -6
View File
@@ -256,8 +256,10 @@ class testreport extends control
$this->view->cases = $cases;
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases, $begin, $end);
$this->view->datas['testTaskPerRunResult'] = $this->testreport->getPerCaseResult4Report($tasks, $cases, $begin, $end);
$this->view->datas['testTaskPerRunner'] = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $begin, $end);
$perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $cases, $begin, $end);
$perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $begin, $end);
$this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult);
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
@@ -366,8 +368,10 @@ class testreport extends control
$this->view->cases = $cases;
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunResult'] = $this->testreport->getPerCaseResult4Report($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunner'] = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $report->begin, $report->end);
$perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $cases, $report->begin, $report->end);
$perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult);
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
@@ -447,8 +451,10 @@ class testreport extends control
$this->view->storySummary = $this->product->summary($stories);
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunResult'] = $this->testreport->getPerCaseResult4Report($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunner'] = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $report->begin, $report->end);
$perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $cases, $report->begin, $report->end);
$perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $report->begin, $report->end);
$this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult);
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
unset($bugInfo['legacyBugs']);
+1 -1
View File
@@ -324,7 +324,7 @@ class testtask extends control
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
$this->view->pager = $pager;
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->setShowModule = false;
$this->view->setModule = false;
$this->display();
}