- testtask: remove unused mergeChartOption method.
This commit is contained in:
@@ -407,8 +407,12 @@ class testtask extends control
|
||||
{
|
||||
$chartFunc = 'getDataOf' . $chart;
|
||||
$chartData = $this->testtask->$chartFunc($taskID);
|
||||
$chartOption = $this->testtask->mergeChartOption($chart);
|
||||
if(!empty($chartType)) $chartOption->type = $chartType;
|
||||
$chartOption = $this->lang->testtask->report->options;
|
||||
if(!empty($chartType))
|
||||
{
|
||||
$chartOption->type = $chartType;
|
||||
$chartOption->graph->caption = $this->lang->testtask->report->charts[$chartType];
|
||||
}
|
||||
|
||||
$this->view->charts[$chart] = $chartOption;
|
||||
$this->view->datas[$chart] = $this->report->computePercent($chartData);
|
||||
|
||||
@@ -634,34 +634,6 @@ class testtaskModel extends model
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the default chart settings and the settings of current chart.
|
||||
*
|
||||
* @param string $chartType
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function mergeChartOption($chartType)
|
||||
{
|
||||
$chartOption = isset($this->lang->testtask->report->$chartType) ? $this->lang->testtask->report->$chartType : new stdclass();
|
||||
$commonOption = $this->lang->testtask->report->options;
|
||||
|
||||
if(!isset($chartOption->graph)) $chartOption->graph = new stdclass();
|
||||
if(!isset($chartOption->type)) $chartOption->type = $commonOption->type;
|
||||
if(!isset($chartOption->width)) $chartOption->width = $commonOption->width;
|
||||
if(!isset($chartOption->height)) $chartOption->height = $commonOption->height;
|
||||
|
||||
$chartOption->graph->caption = $this->lang->testtask->report->charts[$chartType];
|
||||
|
||||
/* 合并配置。*/
|
||||
foreach($commonOption->graph as $key => $value)
|
||||
{
|
||||
if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value;
|
||||
}
|
||||
|
||||
return $chartOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新测试单。
|
||||
* Update a test task.
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/testtask.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testtaskModel->mergeChartOption();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$testtask = new testtaskTest();
|
||||
|
||||
r($testtask->mergeChartOptionTest()) && p() && e();
|
||||
Reference in New Issue
Block a user