mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Fixed PHP compatibility issues
This commit is contained in:
@@ -241,9 +241,9 @@ class FiltersLib
|
||||
public function generateDatasetQuery($query, $filters)
|
||||
{
|
||||
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS;
|
||||
|
||||
$trimed = trim($query);
|
||||
// If the given query is valid and the parameter filters is an array
|
||||
if (!empty(trim($query)) && $filters != null && is_array($filters))
|
||||
if (!empty($trimed) && $filters != null && is_array($filters))
|
||||
{
|
||||
$where = ''; // starts building the SQL where clause
|
||||
|
||||
@@ -254,7 +254,8 @@ class FiltersLib
|
||||
|
||||
if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one
|
||||
|
||||
if (!empty(trim($filterDefinition->name))) // if the name of the applied filter is valid
|
||||
$trimed2 = trim($filterDefinition->name);
|
||||
if (!empty($trimed2)) // if the name of the applied filter is valid
|
||||
{
|
||||
// ...build the condition
|
||||
$where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition);
|
||||
@@ -294,15 +295,16 @@ class FiltersLib
|
||||
public function getFilterName($filterJson)
|
||||
{
|
||||
$filterName = $filterJson->name; // always present, used as default
|
||||
|
||||
$trimed = (isset($filterJson->namePhrase)?trim($filterJson->namePhrase):'');
|
||||
// Filter name from phrases system
|
||||
if (isset($filterJson->namePhrase) && !empty(trim($filterJson->namePhrase)))
|
||||
if (isset($filterJson->namePhrase) && !empty($trimed))
|
||||
{
|
||||
// Loads the library to use the phrases system
|
||||
$this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY));
|
||||
|
||||
$tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase);
|
||||
if (isset($tmpFilterNamePhrase) && !empty(trim($tmpFilterNamePhrase))) // if is not null or an empty string
|
||||
$trimed2 = trim($tmpFilterNamePhrase);
|
||||
if (isset($tmpFilterNamePhrase) && !empty($trimed2)) // if is not null or an empty string
|
||||
{
|
||||
$filterName = $tmpFilterNamePhrase;
|
||||
}
|
||||
@@ -342,9 +344,9 @@ class FiltersLib
|
||||
public function removeSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
$trimed = trim($selectedField);
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
if (isset($selectedField) && !empty($trimed))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -376,9 +378,9 @@ class FiltersLib
|
||||
public function addSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
$trimed = trim($selectedField);
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
if (isset($selectedField) && !empty($trimed))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -405,9 +407,9 @@ class FiltersLib
|
||||
public function removeAppliedFilter($appliedFilter)
|
||||
{
|
||||
$removeAppliedFilter = false;
|
||||
|
||||
$trimed = trim($appliedFilter);
|
||||
// Checks the parameter appliedFilter
|
||||
if (isset($appliedFilter) && !empty(trim($appliedFilter)))
|
||||
if (isset($appliedFilter) && !empty($trimed))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -493,9 +495,9 @@ class FiltersLib
|
||||
public function addFilter($filter)
|
||||
{
|
||||
$addFilter = false;
|
||||
|
||||
$trimed = trim($filter);
|
||||
// Checks the parameter filter
|
||||
if (isset($filter) && !empty(trim($filter)))
|
||||
if (isset($filter) && !empty($trimed))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -536,9 +538,9 @@ class FiltersLib
|
||||
public function saveCustomFilter($customFilterDescription)
|
||||
{
|
||||
$saveCustomFilter = false; // by default returns a failure
|
||||
|
||||
$trimed = trim($customFilterDescription);
|
||||
// Checks parameter customFilterDescription if not valid stop the execution
|
||||
if (!isset($customFilterDescription) || empty(trim($customFilterDescription)))
|
||||
if (!isset($customFilterDescription) || empty($triemd))
|
||||
{
|
||||
return $saveCustomFilter;
|
||||
}
|
||||
@@ -655,11 +657,11 @@ class FiltersLib
|
||||
*/
|
||||
private function _getFilterUniqueId($params)
|
||||
{
|
||||
//
|
||||
$trimed = trim($params[self::FILTER_PAGE_PARAM]);
|
||||
if ($params != null
|
||||
&& is_array($params)
|
||||
&& isset($params[self::FILTER_PAGE_PARAM])
|
||||
&& !empty(trim($params[self::FILTER_PAGE_PARAM])))
|
||||
&& !empty($trimed))
|
||||
{
|
||||
$filterUniqueId = $params[self::FILTER_PAGE_PARAM];
|
||||
}
|
||||
@@ -689,9 +691,9 @@ class FiltersLib
|
||||
private function _getDatasetQueryCondition($filterDefinition)
|
||||
{
|
||||
$condition = ''; // starts building the condition
|
||||
|
||||
$trimed = trim($filterDefinition->operation);
|
||||
// "operation" is a required property for the applied filter definition
|
||||
if (!empty(trim($filterDefinition->operation)))
|
||||
if (!empty($trimed))
|
||||
{
|
||||
// Checks what operation is required
|
||||
switch ($filterDefinition->operation)
|
||||
@@ -764,9 +766,9 @@ class FiltersLib
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$trimed = trim($condition);
|
||||
// if the condition is valid
|
||||
if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before
|
||||
if (!empty($trimed)) $condition = ' '.$condition; // add a white space before
|
||||
|
||||
return $condition;
|
||||
}
|
||||
|
||||
@@ -306,10 +306,11 @@ class NavigationLib
|
||||
private function _getNavigationtPage($params)
|
||||
{
|
||||
//
|
||||
$trimed = trim($params[self::NAVIGATION_PAGE_PARAM]);
|
||||
if ($params != null
|
||||
&& is_array($params)
|
||||
&& isset($params[self::NAVIGATION_PAGE_PARAM])
|
||||
&& !empty(trim($params[self::NAVIGATION_PAGE_PARAM])))
|
||||
&& !empty($trimed))
|
||||
{
|
||||
$navigationPage = $params[self::NAVIGATION_PAGE_PARAM];
|
||||
}
|
||||
|
||||
@@ -196,13 +196,13 @@ class PhrasesLib
|
||||
for ($i = 0; $i < count($this->_phrases); $i++)
|
||||
{
|
||||
$_phrase = $this->_phrases[$i]; // single phrase
|
||||
|
||||
$trimed = trim($_phrase->text);
|
||||
// If the single phrase match the given parameters and is not an empty string
|
||||
if ($_phrase->category == $category
|
||||
&& $_phrase->phrase == $phrase
|
||||
&& $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz
|
||||
&& $_phrase->orgform_kurzbz == $orgform_kurzbz
|
||||
&& (!empty(trim($_phrase->text))))
|
||||
&& (!empty($trimed)))
|
||||
{
|
||||
if (!is_array($parameters)) $parameters = array(); // if params is not an array
|
||||
|
||||
|
||||
@@ -222,8 +222,8 @@
|
||||
'<a href="%s?person_id=%s&origin_page=%s&fhc_controller_id=%s">Details</a>',
|
||||
site_url('system/infocenter/InfoCenter/showDetails'),
|
||||
$datasetRaw->{'PersonId'},
|
||||
$this->router->method,
|
||||
$this->input->get('fhc_controller_id')
|
||||
'index',
|
||||
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
|
||||
@@ -156,8 +156,8 @@
|
||||
'<a href="%s?person_id=%s&origin_page=%s&fhc_controller_id=%s">Details</a>',
|
||||
site_url('system/infocenter/InfoCenter/showDetails'),
|
||||
$datasetRaw->{'PersonId'},
|
||||
$this->router->method,
|
||||
$this->input->get('fhc_controller_id')
|
||||
'freigegeben',
|
||||
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
require_once(dirname(__FILE__).'/datum.class.php');
|
||||
require_once(dirname(__FILE__).'/functions.inc.php');
|
||||
|
||||
class cronjob extends basis_db
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
require_once(dirname(__FILE__).'/../../config/vilesci.config.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../include/cronjob.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/datum.class.php');
|
||||
require_once(dirname(__FILE__).'/../../include/functions.inc.php');
|
||||
|
||||
$datum = new datum();
|
||||
$cj = new cronjob();
|
||||
|
||||
Reference in New Issue
Block a user