mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 09:04:28 +00:00
- Moved controller system/Filters to widgets/Filters
- Renamed FiltersLib to FilterWidgetLib - Adapted code in widgets/FilterWidget, public/js/FilterWidget.js and public/js/infocenter/infocenterPersonDataset.js
This commit is contained in:
@@ -64,13 +64,13 @@ class FilterWidget extends Widget
|
||||
|
||||
self::$_FilterWidgetInstance = $this; // set static property $_FilterWidgetInstance with this instance
|
||||
|
||||
$this->load->library('FiltersLib'); // Loads the FiltersLib that contains all the used logic
|
||||
$this->load->library('FilterWidgetLib'); // Loads the FilterWidgetLib that contains all the used logic
|
||||
|
||||
$this->_initFilterWidget($args); // checks parameters and initialize properties
|
||||
|
||||
// Let's start if it's allowed
|
||||
// NOTE: If it is NOT allowed then no data are loaded
|
||||
if ($this->filterslib->isAllowed($this->_requiredPermissions))
|
||||
if ($this->filterwidgetlib->isAllowed($this->_requiredPermissions))
|
||||
{
|
||||
$this->_startFilterWidget();
|
||||
|
||||
@@ -131,17 +131,17 @@ class FilterWidget extends Widget
|
||||
*/
|
||||
public static function loadViewDataset()
|
||||
{
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FiltersLib::DATASET_REP_TABLESORTER)
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FilterWidgetLib::DATASET_REP_TABLESORTER)
|
||||
{
|
||||
self::_loadView(self::WIDGET_URL_DATASET_TABLESORTER);
|
||||
}
|
||||
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FiltersLib::DATASET_REP_PIVOTUI)
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FilterWidgetLib::DATASET_REP_PIVOTUI)
|
||||
{
|
||||
self::_loadView(self::WIDGET_URL_DATASET_PIVOTUI);
|
||||
}
|
||||
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FiltersLib::DATASET_REP_TABULATOR)
|
||||
if (self::$_FilterWidgetInstance->_datasetRepresentation == FilterWidgetLib::DATASET_REP_TABULATOR)
|
||||
{
|
||||
self::_loadView(self::WIDGET_URL_DATASET_TABULATOR);
|
||||
}
|
||||
@@ -180,115 +180,115 @@ class FilterWidget extends Widget
|
||||
$this->_datasetRepFieldsDefs = null;
|
||||
|
||||
// Retrieved the required permissions parameter if present
|
||||
if (isset($args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::REQUIRED_PERMISSIONS_PARAMETER]))
|
||||
{
|
||||
$this->_requiredPermissions = $args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER];
|
||||
$this->_requiredPermissions = $args[FilterWidgetLib::REQUIRED_PERMISSIONS_PARAMETER];
|
||||
}
|
||||
|
||||
// Parameters needed to retrieve univocally a filter from DB
|
||||
if (isset($args[FiltersLib::APP_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::APP_PARAMETER]))
|
||||
{
|
||||
$this->_app = $args[FiltersLib::APP_PARAMETER];
|
||||
$this->_app = $args[FilterWidgetLib::APP_PARAMETER];
|
||||
}
|
||||
|
||||
if (isset($args[FiltersLib::DATASET_NAME_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::DATASET_NAME_PARAMETER]))
|
||||
{
|
||||
$this->_datasetName = $args[FiltersLib::DATASET_NAME_PARAMETER];
|
||||
$this->_datasetName = $args[FilterWidgetLib::DATASET_NAME_PARAMETER];
|
||||
}
|
||||
|
||||
if (isset($args[FiltersLib::FILTER_KURZBZ_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::FILTER_KURZBZ_PARAMETER]))
|
||||
{
|
||||
$this->_filterKurzbz = $args[FiltersLib::FILTER_KURZBZ_PARAMETER];
|
||||
$this->_filterKurzbz = $args[FilterWidgetLib::FILTER_KURZBZ_PARAMETER];
|
||||
}
|
||||
|
||||
if (isset($args[FiltersLib::FILTER_ID]))
|
||||
if (isset($args[FilterWidgetLib::FILTER_ID]))
|
||||
{
|
||||
$this->_filterId = $args[FiltersLib::FILTER_ID];
|
||||
$this->_filterId = $args[FilterWidgetLib::FILTER_ID];
|
||||
}
|
||||
|
||||
// How to retrieve data for the filter: SQL statement or a result from DB
|
||||
if (isset($args[FiltersLib::QUERY_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::QUERY_PARAMETER]))
|
||||
{
|
||||
$this->_query = $args[FiltersLib::QUERY_PARAMETER];
|
||||
$this->_query = $args[FilterWidgetLib::QUERY_PARAMETER];
|
||||
}
|
||||
|
||||
if (isset($args[FiltersLib::DATASET_RELOAD_PARAMETER]))
|
||||
if (isset($args[FilterWidgetLib::DATASET_RELOAD_PARAMETER]))
|
||||
{
|
||||
$this->_reloadDataset = $args[FiltersLib::DATASET_RELOAD_PARAMETER];
|
||||
$this->_reloadDataset = $args[FilterWidgetLib::DATASET_RELOAD_PARAMETER];
|
||||
}
|
||||
|
||||
// Parameter is used to add extra columns to the dataset
|
||||
if (isset($args[FiltersLib::ADDITIONAL_COLUMNS])
|
||||
&& is_array($args[FiltersLib::ADDITIONAL_COLUMNS])
|
||||
&& count($args[FiltersLib::ADDITIONAL_COLUMNS]) > 0)
|
||||
if (isset($args[FilterWidgetLib::ADDITIONAL_COLUMNS])
|
||||
&& is_array($args[FilterWidgetLib::ADDITIONAL_COLUMNS])
|
||||
&& count($args[FilterWidgetLib::ADDITIONAL_COLUMNS]) > 0)
|
||||
{
|
||||
$this->_additionalColumns = $args[FiltersLib::ADDITIONAL_COLUMNS];
|
||||
$this->_additionalColumns = $args[FilterWidgetLib::ADDITIONAL_COLUMNS];
|
||||
}
|
||||
|
||||
// Parameter is used to add use aliases for the columns fo the dataset
|
||||
if (isset($args[FiltersLib::COLUMNS_ALIASES])
|
||||
&& is_array($args[FiltersLib::COLUMNS_ALIASES])
|
||||
&& count($args[FiltersLib::COLUMNS_ALIASES]) > 0)
|
||||
if (isset($args[FilterWidgetLib::COLUMNS_ALIASES])
|
||||
&& is_array($args[FilterWidgetLib::COLUMNS_ALIASES])
|
||||
&& count($args[FilterWidgetLib::COLUMNS_ALIASES]) > 0)
|
||||
{
|
||||
$this->_columnsAliases = $args[FiltersLib::COLUMNS_ALIASES];
|
||||
$this->_columnsAliases = $args[FilterWidgetLib::COLUMNS_ALIASES];
|
||||
}
|
||||
|
||||
// Parameter that contains a function to format the rows of the dataset
|
||||
if (isset($args[FiltersLib::FORMAT_ROW]) && is_callable($args[FiltersLib::FORMAT_ROW]))
|
||||
if (isset($args[FilterWidgetLib::FORMAT_ROW]) && is_callable($args[FilterWidgetLib::FORMAT_ROW]))
|
||||
{
|
||||
$this->_formatRow = $args[FiltersLib::FORMAT_ROW];
|
||||
$this->_formatRow = $args[FilterWidgetLib::FORMAT_ROW];
|
||||
}
|
||||
|
||||
// Parameter that contains a function to mark in the GUI the rows of the dataset
|
||||
if (isset($args[FiltersLib::MARK_ROW]) && is_callable($args[FiltersLib::MARK_ROW]))
|
||||
if (isset($args[FilterWidgetLib::MARK_ROW]) && is_callable($args[FilterWidgetLib::MARK_ROW]))
|
||||
{
|
||||
$this->_markRow = $args[FiltersLib::MARK_ROW];
|
||||
$this->_markRow = $args[FilterWidgetLib::MARK_ROW];
|
||||
}
|
||||
|
||||
// Parameter used to specify the column of the dataset that will be used
|
||||
// as id of the checkboxes column in the GUI
|
||||
if (isset($args[FiltersLib::CHECKBOXES]))
|
||||
if (isset($args[FilterWidgetLib::CHECKBOXES]))
|
||||
{
|
||||
$this->_checkboxes = $args[FiltersLib::CHECKBOXES];
|
||||
$this->_checkboxes = $args[FilterWidgetLib::CHECKBOXES];
|
||||
}
|
||||
|
||||
// To specify if the header to operate with the FilterWidget is shown or not
|
||||
if (isset($args[FiltersLib::HIDE_HEADER]) && is_bool($args[FiltersLib::HIDE_HEADER]))
|
||||
if (isset($args[FilterWidgetLib::HIDE_HEADER]) && is_bool($args[FilterWidgetLib::HIDE_HEADER]))
|
||||
{
|
||||
$this->_hideHeader = $args[FiltersLib::HIDE_HEADER];
|
||||
$this->_hideHeader = $args[FilterWidgetLib::HIDE_HEADER];
|
||||
}
|
||||
|
||||
// To specify if the form to save a custom FilterWidget is shown or not
|
||||
if (isset($args[FiltersLib::HIDE_SAVE]) && is_bool($args[FiltersLib::HIDE_SAVE]))
|
||||
if (isset($args[FilterWidgetLib::HIDE_SAVE]) && is_bool($args[FilterWidgetLib::HIDE_SAVE]))
|
||||
{
|
||||
$this->_hideSave = $args[FiltersLib::HIDE_SAVE];
|
||||
$this->_hideSave = $args[FilterWidgetLib::HIDE_SAVE];
|
||||
}
|
||||
|
||||
// If a custom menu is set
|
||||
if (isset($args[FiltersLib::CUSTOM_MENU]) && is_bool($args[FiltersLib::CUSTOM_MENU]))
|
||||
if (isset($args[FilterWidgetLib::CUSTOM_MENU]) && is_bool($args[FilterWidgetLib::CUSTOM_MENU]))
|
||||
{
|
||||
$this->_customMenu = $args[FiltersLib::CUSTOM_MENU];
|
||||
$this->_customMenu = $args[FilterWidgetLib::CUSTOM_MENU];
|
||||
}
|
||||
|
||||
// To specify how to represent the dataset (ex: tablesorter, pivotUI, ...)
|
||||
if (isset($args[FiltersLib::DATASET_REPRESENTATION])
|
||||
&& ($args[FiltersLib::DATASET_REPRESENTATION] == FiltersLib::DATASET_REP_TABLESORTER
|
||||
|| $args[FiltersLib::DATASET_REPRESENTATION] == FiltersLib::DATASET_REP_PIVOTUI
|
||||
|| $args[FiltersLib::DATASET_REPRESENTATION] == FiltersLib::DATASET_REP_TABULATOR))
|
||||
if (isset($args[FilterWidgetLib::DATASET_REPRESENTATION])
|
||||
&& ($args[FilterWidgetLib::DATASET_REPRESENTATION] == FilterWidgetLib::DATASET_REP_TABLESORTER
|
||||
|| $args[FilterWidgetLib::DATASET_REPRESENTATION] == FilterWidgetLib::DATASET_REP_PIVOTUI
|
||||
|| $args[FilterWidgetLib::DATASET_REPRESENTATION] == FilterWidgetLib::DATASET_REP_TABULATOR))
|
||||
{
|
||||
$this->_datasetRepresentation = $args[FiltersLib::DATASET_REPRESENTATION];
|
||||
$this->_datasetRepresentation = $args[FilterWidgetLib::DATASET_REPRESENTATION];
|
||||
}
|
||||
|
||||
// To specify options for the dataset representation (ex: tablesorter, pivotUI, ...)
|
||||
if (isset($args[FiltersLib::DATASET_REP_OPTIONS]) && !isEmptyString($args[FiltersLib::DATASET_REP_OPTIONS]))
|
||||
if (isset($args[FilterWidgetLib::DATASET_REP_OPTIONS]) && !isEmptyString($args[FilterWidgetLib::DATASET_REP_OPTIONS]))
|
||||
{
|
||||
$this->_datasetRepresentationOptions = $args[FiltersLib::DATASET_REP_OPTIONS];
|
||||
$this->_datasetRepresentationOptions = $args[FilterWidgetLib::DATASET_REP_OPTIONS];
|
||||
}
|
||||
|
||||
// To specify how to represent each record field
|
||||
if (isset($args[FiltersLib::DATASET_REP_FIELDS_DEFS]) && !isEmptyString($args[FiltersLib::DATASET_REP_FIELDS_DEFS]))
|
||||
if (isset($args[FilterWidgetLib::DATASET_REP_FIELDS_DEFS]) && !isEmptyString($args[FilterWidgetLib::DATASET_REP_FIELDS_DEFS]))
|
||||
{
|
||||
$this->_datasetRepFieldsDefs = $args[FiltersLib::DATASET_REP_FIELDS_DEFS];
|
||||
$this->_datasetRepFieldsDefs = $args[FilterWidgetLib::DATASET_REP_FIELDS_DEFS];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,36 +303,36 @@ class FilterWidget extends Widget
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!isset($args[FiltersLib::APP_PARAMETER]) && !isset($args[FiltersLib::DATASET_NAME_PARAMETER]))
|
||||
&& !isset($args[FiltersLib::FILTER_ID]))
|
||||
if ((!isset($args[FilterWidgetLib::APP_PARAMETER]) && !isset($args[FilterWidgetLib::DATASET_NAME_PARAMETER]))
|
||||
&& !isset($args[FilterWidgetLib::FILTER_ID]))
|
||||
{
|
||||
show_error(
|
||||
'The parameters ("'.FiltersLib::APP_PARAMETER.'" and "'.FiltersLib::DATASET_NAME_PARAMETER.') OR "'.
|
||||
FiltersLib::FILTER_ID.'" must be specified'
|
||||
'The parameters ("'.FilterWidgetLib::APP_PARAMETER.'" and "'.FilterWidgetLib::DATASET_NAME_PARAMETER.') OR "'.
|
||||
FilterWidgetLib::FILTER_ID.'" must be specified'
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($args[FiltersLib::QUERY_PARAMETER]))
|
||||
if (!isset($args[FilterWidgetLib::QUERY_PARAMETER]))
|
||||
{
|
||||
show_error('The parameters "'.FiltersLib::QUERY_PARAMETER.'" must be specified');
|
||||
show_error('The parameters "'.FilterWidgetLib::QUERY_PARAMETER.'" must be specified');
|
||||
}
|
||||
|
||||
if (!isset($args[FiltersLib::DATASET_REPRESENTATION]))
|
||||
if (!isset($args[FilterWidgetLib::DATASET_REPRESENTATION]))
|
||||
{
|
||||
show_error('The parameter "'.FiltersLib::DATASET_REPRESENTATION.'" must be specified');
|
||||
show_error('The parameter "'.FilterWidgetLib::DATASET_REPRESENTATION.'" must be specified');
|
||||
}
|
||||
|
||||
if (isset($args[FiltersLib::DATASET_REPRESENTATION])
|
||||
&& $args[FiltersLib::DATASET_REPRESENTATION] != FiltersLib::DATASET_REP_TABLESORTER
|
||||
&& $args[FiltersLib::DATASET_REPRESENTATION] != FiltersLib::DATASET_REP_PIVOTUI
|
||||
&& $args[FiltersLib::DATASET_REPRESENTATION] != FiltersLib::DATASET_REP_TABULATOR)
|
||||
if (isset($args[FilterWidgetLib::DATASET_REPRESENTATION])
|
||||
&& $args[FilterWidgetLib::DATASET_REPRESENTATION] != FilterWidgetLib::DATASET_REP_TABLESORTER
|
||||
&& $args[FilterWidgetLib::DATASET_REPRESENTATION] != FilterWidgetLib::DATASET_REP_PIVOTUI
|
||||
&& $args[FilterWidgetLib::DATASET_REPRESENTATION] != FilterWidgetLib::DATASET_REP_TABULATOR)
|
||||
{
|
||||
show_error(
|
||||
'The parameter "'.FiltersLib::DATASET_REPRESENTATION.
|
||||
'The parameter "'.FilterWidgetLib::DATASET_REPRESENTATION.
|
||||
'" must be IN ("'
|
||||
.FiltersLib::DATASET_REP_TABLESORTER.'", "'
|
||||
.FiltersLib::DATASET_REP_PIVOTUI.'", "'
|
||||
.FiltersLib::DATASET_REP_TABULATOR.'")'
|
||||
.FilterWidgetLib::DATASET_REP_TABLESORTER.'", "'
|
||||
.FilterWidgetLib::DATASET_REP_PIVOTUI.'", "'
|
||||
.FilterWidgetLib::DATASET_REP_TABULATOR.'")'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -344,51 +344,49 @@ class FilterWidget extends Widget
|
||||
private function _startFilterWidget()
|
||||
{
|
||||
// Read the all session for this filter widget
|
||||
$session = $this->filterslib->getSession();
|
||||
$session = $this->filterwidgetlib->getSession();
|
||||
|
||||
// If session is NOT empty -> a filter was already loaded
|
||||
if ($session != null)
|
||||
{
|
||||
// Retrieve the filterId stored in the session
|
||||
$sessionFilterId = $this->filterslib->getSessionElement(FiltersLib::FILTER_ID);
|
||||
$sessionFilterId = $this->filterwidgetlib->getSessionElement(FilterWidgetLib::FILTER_ID);
|
||||
|
||||
// If the filter loaded in session is NOT the same that is being requested then empty the session
|
||||
if ($this->_filterId != $sessionFilterId)
|
||||
{
|
||||
$this->filterslib->setSession(null);
|
||||
$this->filterwidgetlib->setSession(null);
|
||||
$session = null;
|
||||
}
|
||||
else // else if the filter loaded in session is the same that is being requested
|
||||
{
|
||||
// Get SESSION_RELOAD_DATASET from the session
|
||||
$sessionReloadDataset = $this->filterslib->getSessionElement(FiltersLib::SESSION_RELOAD_DATASET);
|
||||
$sessionReloadDataset = $this->filterwidgetlib->getSessionElement(FilterWidgetLib::SESSION_RELOAD_DATASET);
|
||||
|
||||
// if Filter changed or reload is forced by parameter then reload the Dataset
|
||||
if ($this->_reloadDataset === true || $sessionReloadDataset === true)
|
||||
{
|
||||
// Set as false to stop changing the dataset
|
||||
$this->filterslib->setSessionElement(FiltersLib::SESSION_RELOAD_DATASET, false);
|
||||
$this->filterwidgetlib->setSessionElement(FilterWidgetLib::SESSION_RELOAD_DATASET, false);
|
||||
|
||||
// Generate dataset query using filters from the session
|
||||
$datasetQuery = $this->filterslib->generateDatasetQuery(
|
||||
$datasetQuery = $this->filterwidgetlib->generateDatasetQuery(
|
||||
$this->_query,
|
||||
$this->filterslib->getSessionElement(FiltersLib::SESSION_FILTERS)
|
||||
$this->filterwidgetlib->getSessionElement(FilterWidgetLib::SESSION_FILTERS)
|
||||
);
|
||||
|
||||
// Then retrieve dataset from DB
|
||||
$dataset = $this->filterslib->getDataset($datasetQuery);
|
||||
$dataset = $this->filterwidgetlib->getDataset($datasetQuery);
|
||||
|
||||
// Save changes into session if data are valid
|
||||
if (!isError($dataset))
|
||||
{
|
||||
$this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow
|
||||
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
|
||||
// Set the new dataset and its attributes in the session
|
||||
$this->filterslib->setSessionElement(FiltersLib::SESSION_METADATA, $this->FiltersModel->getExecutedQueryMetaData());
|
||||
$this->filterslib->setSessionElement(FiltersLib::SESSION_ROW_NUMBER, count($dataset->retval));
|
||||
$this->filterslib->setSessionElement(FiltersLib::SESSION_DATASET, $dataset->retval);
|
||||
$this->filterwidgetlib->setSessionElement(FilterWidgetLib::SESSION_METADATA, $this->FiltersModel->getExecutedQueryMetaData());
|
||||
$this->filterwidgetlib->setSessionElement(FilterWidgetLib::SESSION_ROW_NUMBER, count($dataset->retval));
|
||||
$this->filterwidgetlib->setSessionElement(FilterWidgetLib::SESSION_DATASET, $dataset->retval);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,7 +396,7 @@ class FilterWidget extends Widget
|
||||
if ($session == null)
|
||||
{
|
||||
// Load filter definition data from DB
|
||||
$definition = $this->filterslib->loadDefinition(
|
||||
$definition = $this->filterwidgetlib->loadDefinition(
|
||||
$this->_filterId,
|
||||
$this->_app,
|
||||
$this->_datasetName,
|
||||
@@ -406,45 +404,43 @@ class FilterWidget extends Widget
|
||||
);
|
||||
|
||||
// Checks and parse json present into the definition
|
||||
$parsedFilterJson = $this->filterslib->parseFilterJson($definition);
|
||||
$parsedFilterJson = $this->filterwidgetlib->parseFilterJson($definition);
|
||||
if ($parsedFilterJson != null) // if the json is valid
|
||||
{
|
||||
// Generate dataset query
|
||||
$datasetQuery = $this->filterslib->generateDatasetQuery($this->_query, $parsedFilterJson->filters);
|
||||
$datasetQuery = $this->filterwidgetlib->generateDatasetQuery($this->_query, $parsedFilterJson->filters);
|
||||
|
||||
// Then retrieve dataset from DB
|
||||
$dataset = $this->filterslib->getDataset($datasetQuery);
|
||||
$dataset = $this->filterwidgetlib->getDataset($datasetQuery);
|
||||
|
||||
// Try to load the name of the filter using the PhrasesLib
|
||||
$filterName = $this->filterslib->getFilterName($parsedFilterJson);
|
||||
$filterName = $this->filterwidgetlib->getFilterName($parsedFilterJson);
|
||||
|
||||
// Save changes into session if data are valid
|
||||
if (!isError($dataset))
|
||||
{
|
||||
$this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow
|
||||
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
|
||||
// Stores an array that contains all the data useful for
|
||||
$this->filterslib->setSession(
|
||||
$this->filterwidgetlib->setSession(
|
||||
array(
|
||||
FiltersLib::FILTER_ID => $this->_filterId, // the current filter id
|
||||
FiltersLib::APP_PARAMETER => $this->_app, // the current app parameter
|
||||
FiltersLib::DATASET_NAME_PARAMETER => $this->_datasetName, // the carrent dataset name
|
||||
FiltersLib::SESSION_FILTER_NAME => $filterName, // the current filter name
|
||||
FiltersLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset
|
||||
FiltersLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields
|
||||
FiltersLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases
|
||||
FiltersLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns
|
||||
FiltersLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column
|
||||
FiltersLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset
|
||||
FiltersLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset
|
||||
FiltersLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter
|
||||
FiltersLib::SESSION_DATASET => $dataset->retval, // the entire dataset
|
||||
FiltersLib::SESSION_RELOAD_DATASET => false, // if the dataset must be reloaded, not needed the first time
|
||||
FiltersLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation
|
||||
FiltersLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, // the choosen dataset representation options
|
||||
FiltersLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs // the choosen dataset representation record fields definition
|
||||
FilterWidgetLib::FILTER_ID => $this->_filterId, // the current filter id
|
||||
FilterWidgetLib::APP_PARAMETER => $this->_app, // the current app parameter
|
||||
FilterWidgetLib::DATASET_NAME_PARAMETER => $this->_datasetName, // the carrent dataset name
|
||||
FilterWidgetLib::SESSION_FILTER_NAME => $filterName, // the current filter name
|
||||
FilterWidgetLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset
|
||||
FilterWidgetLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields
|
||||
FilterWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases
|
||||
FilterWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns
|
||||
FilterWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column
|
||||
FilterWidgetLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset
|
||||
FilterWidgetLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset
|
||||
FilterWidgetLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter
|
||||
FilterWidgetLib::SESSION_DATASET => $dataset->retval, // the entire dataset
|
||||
FilterWidgetLib::SESSION_RELOAD_DATASET => false, // if the dataset must be reloaded, not needed the first time
|
||||
FilterWidgetLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation
|
||||
FilterWidgetLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, // the choosen dataset representation options
|
||||
FilterWidgetLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs // the choosen dataset representation record fields definition
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -453,7 +449,7 @@ class FilterWidget extends Widget
|
||||
|
||||
// To be always stored in the session, otherwise is not possible to load data from Filters controller
|
||||
// NOTE: must the latest operation to be performed in the session to be shure that is always present
|
||||
$this->filterslib->setSessionElement(FiltersLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions);
|
||||
$this->filterwidgetlib->setSessionElement(FilterWidgetLib::REQUIRED_PERMISSIONS_PARAMETER, $this->_requiredPermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -462,7 +458,7 @@ class FilterWidget extends Widget
|
||||
private function _setFilterMenu()
|
||||
{
|
||||
// Generates the filters structure array
|
||||
$filterMenu = $this->filterslib->generateFilterMenu(
|
||||
$filterMenu = $this->filterwidgetlib->generateFilterMenu(
|
||||
$this->router->directory.$this->router->class.'/'.$this->router->method
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user