mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
- FilterWidget now loads filter from DB only the first time
- Changed the query statement to load data from logs and person data
This commit is contained in:
@@ -23,17 +23,9 @@ class InfoCenter extends VileSci_Controller
|
||||
$listFiltersSent = array();
|
||||
$listFiltersNotSent = array();
|
||||
|
||||
$personActionsArray = array(
|
||||
'app' => 'aufnahme',
|
||||
'dataset_name' => 'PersonActions',
|
||||
'person_id' => null,
|
||||
'default_filter' => false,
|
||||
'array_length(description, 1) >' => 0
|
||||
);
|
||||
$listFiltersSent = $this->_getFilterList('%InfoCenterSentApplication%');
|
||||
|
||||
$listFiltersSent = $this->_getFilterList($personActionsArray, '%InfoCenterSentApplication%');
|
||||
|
||||
$listFiltersNotSent = $this->_getFilterList($personActionsArray, '%InfoCenterNotSentApplication%');
|
||||
$listFiltersNotSent = $this->_getFilterList('%InfoCenterNotSentApplication%');
|
||||
|
||||
$this->load->view(
|
||||
'system/infocenter/infocenter.php',
|
||||
@@ -47,10 +39,18 @@ class InfoCenter extends VileSci_Controller
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getFilterList($personActionsArray, $filter_kurzbz)
|
||||
private function _getFilterList($filter_kurzbz)
|
||||
{
|
||||
$listFilters = array();
|
||||
|
||||
$personActionsArray = array(
|
||||
'app' => 'aufnahme',
|
||||
'dataset_name' => 'PersonActions',
|
||||
'person_id' => null,
|
||||
'default_filter' => false,
|
||||
'array_length(description, 1) >' => 0
|
||||
);
|
||||
|
||||
$this->FiltersModel->resetQuery();
|
||||
$this->FiltersModel->addSelect('filter_id, description');
|
||||
$this->FiltersModel->addOrder('sort', 'ASC');
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
<?php
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT p.person_id AS "PersonId",
|
||||
p.nachname AS "Nachname",
|
||||
p.vorname AS "Vorname",
|
||||
k.kontakt AS "Email",
|
||||
p.aktiv AS "Aktiv",
|
||||
k.updateamum AS "UpdateDate"
|
||||
FROM public.tbl_person p INNER JOIN public.tbl_kontakt k USING(person_id)
|
||||
p.nachname AS "Nachname",
|
||||
p.gebdatum AS "Gebdatum",
|
||||
l.zeitpunkt AS "LastAction",
|
||||
l.insertvon AS "User/Operator"
|
||||
FROM public.tbl_person p INNER JOIN system.tbl_log l USING(person_id)
|
||||
WHERE p.aktiv = TRUE
|
||||
AND p.person_id = k.person_id
|
||||
AND k.kontakttyp = \'email\'
|
||||
AND p.person_id < 1000
|
||||
AND l.app = \'aufnahme\'
|
||||
',
|
||||
'hideHeader' => true,
|
||||
'hideSave' => true,
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'additionalColumns' => array('Details'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
|
||||
@@ -41,9 +40,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['app'] = 'core';
|
||||
$filterWidgetArray['datasetName'] = 'kontakts';
|
||||
$filterWidgetArray['filterKurzbz'] = 'This filter filters';
|
||||
$filterWidgetArray['app'] = 'aufnahme';
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
$filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll';
|
||||
}
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
|
||||
@@ -95,8 +95,13 @@ class FilterWidget extends Widget
|
||||
*/
|
||||
public function display($widgetData)
|
||||
{
|
||||
//
|
||||
$this->_loadFilter();
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
if ((isset($filterSessionArray[self::SELECTED_FIELDS]) && count($filterSessionArray[self::SELECTED_FIELDS]) == 0)
|
||||
&& (isset($filterSessionArray[self::SELECTED_FILTERS]) && count($filterSessionArray[self::SELECTED_FILTERS]) == 0))
|
||||
{
|
||||
//
|
||||
$this->_loadFilter();
|
||||
}
|
||||
|
||||
//
|
||||
$this->_setSessionFilterData();
|
||||
|
||||
Reference in New Issue
Block a user