- Renamed public method system/Filters_model->getFiltersByAppDatasetName to getFiltersByAppDatasetNamePersonId

- Added new parameter person_id to method getFiltersByAppDatasetNamePersonId
- Changed query inside getFiltersByAppDatasetNamePersonId to get global
  and personal filters
- Adapted FilterWidgetLib to use the new method getFiltersByAppDatasetNamePersonId
This commit is contained in:
Paolo
2021-09-14 12:44:33 +02:00
parent 2159e81888
commit 848cc52cfa
3 changed files with 38 additions and 18 deletions
+9 -5
View File
@@ -266,6 +266,7 @@ class FilterWidgetLib
$whereParameters = array(
'app' => $app,
'dataset_name' => $datasetName,
'person_id' => null,
'default_filter' => true
);
@@ -738,8 +739,10 @@ class FilterWidgetLib
$this->_ci->load->model('system/Filters_model', 'FiltersModel');
// Loads all the filters related to this page (same dataset_name and same app name)
$filters = $this->_ci->FiltersModel->getFiltersByAppDatasetName(
$session[self::APP], $session[self::DATASET_NAME]
$filters = $this->_ci->FiltersModel->getFiltersByAppDatasetNamePersonId(
$session[self::APP],
$session[self::DATASET_NAME],
getAuthPersonId()
);
// If filters were loaded
@@ -813,9 +816,6 @@ class FilterWidgetLib
}
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Return an unique string that identify this filter widget
* NOTE: The default value is the URI where the FilterWidget is called
@@ -857,6 +857,9 @@ class FilterWidgetLib
$this->_filterUniqueId = $filterUniqueId;
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Generates a condition for a SQL where clause using the given applied filter definition.
* By default an empty string is returned.
@@ -972,3 +975,4 @@ class FilterWidgetLib
return $pos;
}
}