- Changed system/dbupdate_3.3.php to create table system.tbl_filters and what its needed

- Added model system/Filters_model to manage system.tbl_filters
- Removed method execQuery from model system/UDF_model
- Added property executedQueryMetaData to DB_Model
- Added property executedQueryListFields to DB_Model
- Added method getExecutedQueryListFields to DB_Model
- Added method getExecutedQueryMetaData to DB_Model
- Added method execReadOnlyQuery to DB_Model to execute read only queries from outside a model
- Changed DB_Model method _toPhp to store infos about an executed query into properties executedQueryMetaData and executedQueryListFields
- Updated library UDFLib to use execReadOnlyQuery
- Added widget FilterWidget to render and manage a filter into VileSci
- Added views widgets/filter/selectFields, widgets/filter/selectFilters and widgets/filter/tableDataset used by FilterWidget
This commit is contained in:
Paolo
2017-11-22 12:08:54 +01:00
parent 60a9afc4fb
commit ee3998f62e
10 changed files with 468 additions and 69 deletions
+61
View File
@@ -0,0 +1,61 @@
<?php
/**
*
*/
class FilterWidget extends Widget
{
private $app;
private $datasetName;
/**
*
*/
public function __construct($name, $args = array())
{
parent::__construct($name, $args);
}
/**
*
*/
public function display($widgetData)
{
$this->load->model('system/Filters_model', 'FiltersModel');
$this->app = $widgetData['app'];
$this->datasetName = $widgetData['datasetName'];
$dataset = $this->FiltersModel->execReadOnlyQuery($widgetData['query']);
$this->loadViewSelectFields($this->FiltersModel->getExecutedQueryListFields());
$this->loadViewSelectFilters($this->FiltersModel->getExecutedQueryMetaData());
$this->loadViewTableDataset($dataset);
}
/**
*
*/
private function loadViewSelectFields($listFields)
{
$this->view('widgets/filter/selectFields', array('listFields' => $listFields));
}
/**
*
*/
private function loadViewSelectFilters($metaData)
{
$this->view('widgets/filter/selectFilters', array('metaData' => $metaData));
}
/**
*
*/
private function loadViewTableDataset($result)
{
$this->view('widgets/filter/tableDataset', array('dataset' => $result));
}
}