* Fix search in browse,bug#38251,task#103073.
This commit is contained in:
+15
-11
@@ -123,22 +123,26 @@ class metric extends control
|
||||
$current = $this->metric->getByID($metricID);
|
||||
if(empty($current)) $current = current($metrics);
|
||||
|
||||
$resultHeader = array();
|
||||
$resultData = array();
|
||||
if(!empty($current))
|
||||
{
|
||||
$metric = $this->metric->getByID($current->id);
|
||||
$result = $this->metric->getResultByCode($metric->code, array(), 'cron');
|
||||
$this->view->resultHeader = $this->metricZen->getViewTableHeader($result);
|
||||
$this->view->resultData = $this->metricZen->getViewTableData($metric, $result);
|
||||
$resultHeader = $this->metricZen->getViewTableHeader($result);
|
||||
$resultData = $this->metricZen->getViewTableData($metric, $result);
|
||||
}
|
||||
|
||||
$this->view->metrics = $metrics;
|
||||
$this->view->current = $current;
|
||||
$this->view->metricList = $this->lang->metric->metricList;
|
||||
$this->view->scope = $scope;
|
||||
$this->view->title = $this->lang->metric->common;
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->recTotal = count($metrics);
|
||||
$this->view->filters = $filters;
|
||||
$this->view->metrics = $metrics;
|
||||
$this->view->current = $current;
|
||||
$this->view->metricList = $this->lang->metric->metricList;
|
||||
$this->view->scope = $scope;
|
||||
$this->view->title = $this->lang->metric->common;
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->recTotal = count($metrics);
|
||||
$this->view->filters = $filters;
|
||||
$this->view->resultHeader = $resultHeader;
|
||||
$this->view->resultData = $resultData;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -198,7 +202,7 @@ class metric extends control
|
||||
|
||||
/* Build the search form. */
|
||||
$queryID = $type == 'bydefault' ? 0 : (int)$param;
|
||||
$actionURL = $this->createLink('metric', 'browse', "scope=$scope¶m=myQueryID&type=bysearch");
|
||||
$actionURL = $this->createLink('metric', 'browse', "scope=$scope&stage=$stage¶m=myQueryID&type=bysearch");
|
||||
$this->metric->buildSearchForm($queryID, $actionURL);
|
||||
|
||||
$metrics = $this->metric->getList($scope, $stage, $param, $type, $queryID, $orderBy, $pager);
|
||||
|
||||
@@ -107,7 +107,9 @@ class metricModel extends model
|
||||
if(count($object_purpose) == 2) $purpose = $object_purpose[1];
|
||||
}
|
||||
|
||||
$metrics = $this->metricTao->fetchMetrics($scope, $stage, $object, $purpose, $this->session->metricQuery, $sort, $pager);
|
||||
$query = $type == 'bysearch' ? $this->session->metricQuery : '';
|
||||
|
||||
$metrics = $this->metricTao->fetchMetrics($scope, $stage, $object, $purpose, $query, $sort, $pager);
|
||||
$metrics = $this->processOldMetrics($metrics);
|
||||
|
||||
return $metrics;
|
||||
|
||||
@@ -29,7 +29,7 @@ $fnGenerateSide = function() use($metrics, $current, $viewType, $scope)
|
||||
return ul($metricList);
|
||||
};
|
||||
|
||||
$star = strpos($current->collector, ',' . $app->user->account . ',') !== false ? 'star' : 'star-empty';
|
||||
$star = (!empty($current->collector) and strpos($current->collector, ',' . $app->user->account . ',') !== false) ? 'star' : 'star-empty';
|
||||
$starBtn = "<a title='{$lang->metric->collectStar}' onclick='window.collectMetric($current->id)' class='btn btn-link square size-sm metric-collect'>" . html::image("static/svg/{$star}.svg", "class='$star'") . '</a>';
|
||||
|
||||
$fnGenerateFilterPanel = function($code, $filterItem) use($lang)
|
||||
|
||||
Reference in New Issue
Block a user