mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
- FiltersLib bugfix: now method generateDatasetQuery always build a query with no filters (no where clause) if the filters array is empty
- Added comments to Filters_model methods - Removed method deleteCustomFilter from Filters_model - Method getFilterList changed to load all the filters, removed default_filter = false from the where clause
This commit is contained in:
@@ -264,7 +264,7 @@ class FiltersLib
|
||||
*/
|
||||
public function generateDatasetQuery($query, $filters)
|
||||
{
|
||||
$datasetQuery = null;
|
||||
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS;
|
||||
|
||||
// If the given query is valid and the parameter filters is an array
|
||||
if (!empty(trim($query)) && $filters != null && is_array($filters))
|
||||
@@ -287,7 +287,7 @@ class FiltersLib
|
||||
|
||||
if ($where != '') // if the SQL where clause was built
|
||||
{
|
||||
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS.' WHERE '.$where;
|
||||
$datasetQuery .= ' WHERE '.$where;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Filters_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Loads a filter by its app, dataset_name and filter_kurzbz
|
||||
*/
|
||||
public function getFilterList($app, $dataset_name, $filter_kurzbz)
|
||||
{
|
||||
@@ -24,7 +24,6 @@ class Filters_model extends DB_Model
|
||||
'app' => $app,
|
||||
'dataset_name' => $dataset_name,
|
||||
'person_id' => null,
|
||||
'default_filter' => false,
|
||||
'array_length(description, 1) >' => 0,
|
||||
'filter_kurzbz ILIKE' => $filter_kurzbz
|
||||
);
|
||||
@@ -33,7 +32,7 @@ class Filters_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Loads a custom filter by its app, dataset_name and the uid of the owner
|
||||
*/
|
||||
public function getCustomFiltersList($app, $dataset_name, $uid)
|
||||
{
|
||||
@@ -50,12 +49,4 @@ class Filters_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($filterParametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function deleteCustomFilter($filter_id)
|
||||
{
|
||||
return $this->delete($filter_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user