mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 07:22:17 +00:00
Fixed PHP Version compatibility
This commit is contained in:
@@ -758,10 +758,10 @@ class InfoCenter extends Auth_Controller
|
||||
$this->navigationlib->setSessionMenu(
|
||||
array(
|
||||
'back' => $this->navigationlib->oneLevel(
|
||||
'<< Züruck', // description
|
||||
'Zurück', // description
|
||||
$link, // link
|
||||
array(), // children
|
||||
'', // icon
|
||||
'angle-left', // icon
|
||||
true // expand
|
||||
)
|
||||
)
|
||||
@@ -823,7 +823,7 @@ class InfoCenter extends Auth_Controller
|
||||
'filters' => $this->navigationlib->oneLevel(
|
||||
'Filter', // description
|
||||
'#', // link
|
||||
$filtersArray['children'], // children
|
||||
(isset($filtersArray['children'])?$filtersArray['children']:''), // children
|
||||
'', // icon
|
||||
true // expand
|
||||
)
|
||||
|
||||
@@ -288,9 +288,10 @@ class FiltersLib
|
||||
public function generateDatasetQuery($query, $filters)
|
||||
{
|
||||
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS;
|
||||
$trimedval = 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($trimedval) && $filters != null && is_array($filters))
|
||||
{
|
||||
$where = ''; // starts building the SQL where clause
|
||||
|
||||
@@ -299,9 +300,11 @@ class FiltersLib
|
||||
{
|
||||
$filterDefinition = $filters[$filtersCounter]; // definition of one filter
|
||||
|
||||
if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one
|
||||
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
|
||||
$trimedname = trim($filterDefinition->name);
|
||||
if (!empty($trimedname)) // if the name of the applied filter is valid
|
||||
{
|
||||
// ...build the condition
|
||||
$where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition);
|
||||
@@ -341,15 +344,16 @@ class FiltersLib
|
||||
public function getFilterName($filterJson)
|
||||
{
|
||||
$filterName = $filterJson->name; // always present, used as default
|
||||
|
||||
$trimedname = (isset($filterJson->namePhrase)?trim($filterJson->namePhrase):'');
|
||||
// Filter name from phrases system
|
||||
if (isset($filterJson->namePhrase) && !empty(trim($filterJson->namePhrase)))
|
||||
if (isset($filterJson->namePhrase) && !empty($trimedname))
|
||||
{
|
||||
// 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
|
||||
$trimedphrase = (isset($tmpFilterNamePhrase)?trim($tmpFilterNamePhrase):'');
|
||||
if (isset($tmpFilterNamePhrase) && !empty($trimedphrase)) // if is not null or an empty string
|
||||
{
|
||||
$filterName = $tmpFilterNamePhrase;
|
||||
}
|
||||
@@ -389,9 +393,9 @@ class FiltersLib
|
||||
public function removeSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
$trimedval = (isset($selectedField)?trim($selectedField):'');
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
if (isset($selectedField) && !empty($trimedval))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -423,9 +427,9 @@ class FiltersLib
|
||||
public function addSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
$trimedval = (isset($selectedField)?trim($selectedField):'');
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
if (isset($selectedField) && !empty($trimedval))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -452,9 +456,9 @@ class FiltersLib
|
||||
public function removeAppliedFilter($appliedFilter)
|
||||
{
|
||||
$removeAppliedFilter = false;
|
||||
|
||||
$trimedval = (isset($appliedFilter)?trim($appliedFilter):'');
|
||||
// Checks the parameter appliedFilter
|
||||
if (isset($appliedFilter) && !empty(trim($appliedFilter)))
|
||||
if (isset($appliedFilter) && !empty($trimedval))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -540,9 +544,9 @@ class FiltersLib
|
||||
public function addFilter($filter)
|
||||
{
|
||||
$addFilter = false;
|
||||
|
||||
$trimedval = (isset($filter)?trim($filter):'');
|
||||
// Checks the parameter filter
|
||||
if (isset($filter) && !empty(trim($filter)))
|
||||
if (isset($filter) && !empty($trimedval))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
@@ -583,9 +587,9 @@ class FiltersLib
|
||||
public function saveCustomFilter($customFilterDescription)
|
||||
{
|
||||
$saveCustomFilter = false; // by default returns a failure
|
||||
|
||||
$trimedval = (isset($customFilterDescription)?trim($customFilterDescription):'');
|
||||
// Checks parameter customFilterDescription if not valid stop the execution
|
||||
if (!isset($customFilterDescription) || empty(trim($customFilterDescription)))
|
||||
if (!isset($customFilterDescription) || empty($trimedval))
|
||||
{
|
||||
return $saveCustomFilter;
|
||||
}
|
||||
@@ -702,11 +706,11 @@ class FiltersLib
|
||||
*/
|
||||
private function _getFilterUniqueId($params)
|
||||
{
|
||||
//
|
||||
$trimedval = (isset($params[self::FILTER_PAGE_PARAM])?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($trimedval))
|
||||
{
|
||||
$filterUniqueId = $params[self::FILTER_PAGE_PARAM];
|
||||
}
|
||||
@@ -738,7 +742,8 @@ class FiltersLib
|
||||
$condition = ''; // starts building the condition
|
||||
|
||||
// "operation" is a required property for the applied filter definition
|
||||
if (!empty(trim($filterDefinition->operation)))
|
||||
$trimedval = trim($filterDefinition->operation);
|
||||
if (!empty($trimedval))
|
||||
{
|
||||
// Checks what operation is required
|
||||
switch ($filterDefinition->operation)
|
||||
@@ -813,7 +818,9 @@ class FiltersLib
|
||||
}
|
||||
|
||||
// if the condition is valid
|
||||
if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before
|
||||
$trimedval = trim($condition);
|
||||
if (!empty($trimedval))
|
||||
$condition = ' '.$condition; // add a white space before
|
||||
|
||||
return $condition;
|
||||
}
|
||||
|
||||
@@ -334,11 +334,12 @@ class NavigationLib
|
||||
*/
|
||||
private function _getNavigationtPage($params)
|
||||
{
|
||||
$trimedval = 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($trimedval))
|
||||
{
|
||||
$navigationPage = $params[self::NAVIGATION_PAGE_PARAM];
|
||||
}
|
||||
|
||||
@@ -197,12 +197,13 @@ class PhrasesLib
|
||||
{
|
||||
$_phrase = $this->_phrases[$i]; // single phrase
|
||||
|
||||
$trimedval = 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($trimedval)))
|
||||
{
|
||||
if (!is_array($parameters)) $parameters = array(); // if params is not an array
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
$APP = 'infocenter';
|
||||
$NOTBEFORE = '2018-03-01 18:00:00';
|
||||
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT
|
||||
@@ -219,12 +219,13 @@
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
/* NOTE: Dont use $this here for PHP Version compatibility */
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<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)
|
||||
|
||||
@@ -153,12 +153,13 @@
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
/* NOTE: Dont use $this here for PHP Version compatibility */
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<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)
|
||||
|
||||
Reference in New Issue
Block a user