mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # application/views/templates/FHC-Header.php
This commit is contained in:
@@ -2,25 +2,70 @@
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT p.person_id AS "PersonId",
|
||||
p.vorname AS "Vorname",
|
||||
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)
|
||||
(SELECT zeitpunkt
|
||||
FROM system.tbl_log
|
||||
WHERE app = \'aufnahme\'
|
||||
AND person_id = p.person_id
|
||||
ORDER BY zeitpunkt DESC
|
||||
LIMIT 1) AS "LastAction",
|
||||
(SELECT insertvon
|
||||
FROM system.tbl_log
|
||||
WHERE app = \'aufnahme\'
|
||||
AND person_id = p.person_id
|
||||
ORDER BY zeitpunkt DESC
|
||||
LIMIT 1) AS "User/Operator",
|
||||
(SELECT pss.studiensemester_kurzbz
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND pss.bestaetigtvon IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
|
||||
LIMIT 1) AS "Studiensemester",
|
||||
(SELECT pss.bewerbung_abgeschicktamum
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND pss.bestaetigtvon IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
|
||||
LIMIT 1) AS "SendDate"
|
||||
FROM public.tbl_person p
|
||||
WHERE p.aktiv = TRUE
|
||||
AND l.app = \'aufnahme\'
|
||||
AND p.person_id IN (
|
||||
SELECT person_id
|
||||
FROM public.tbl_prestudent
|
||||
INNER JOIN public.tbl_prestudentstatus USING(prestudent_id)
|
||||
WHERE status_kurzbz = \'Interessent\'
|
||||
AND bestaetigtam IS NULL
|
||||
AND bestaetigtvon IS NULL)
|
||||
GROUP BY 1, 2, 4, 5, 6, 7
|
||||
ORDER BY "LastAction" DESC
|
||||
) tbl_infocenter
|
||||
WHERE "Studiensemester" IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE (NOW() >= start AND NOW() <= ende)
|
||||
OR start > NOW()
|
||||
)
|
||||
',
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'additionalColumns' => array('Details'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
|
||||
$link = '<a href="%s%s" target="_blank">Details</a>';
|
||||
|
||||
if ($fieldName == 'Details')
|
||||
{
|
||||
$link = '<a href="%s%s" target="_blank">Details</a>';
|
||||
|
||||
$datasetRaw->{$fieldName} = sprintf(
|
||||
$link,
|
||||
base_url('index.ci.php/system/infocenter/infocenterDetails/showDetails/'),
|
||||
@@ -28,6 +73,30 @@
|
||||
);
|
||||
}
|
||||
|
||||
if ($fieldName == 'SendDate')
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '1970.01.01 01:00:00')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'Not sent';
|
||||
}
|
||||
}
|
||||
|
||||
if ($fieldName == 'LastAction')
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '1970.01.01 01:00:00')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'Not logged';
|
||||
}
|
||||
}
|
||||
|
||||
if ($fieldName == 'User/Operator')
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'NA';
|
||||
}
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -51,6 +51,8 @@ class FilterWidget extends Widget
|
||||
const OP_IS_FALSE = 'false';
|
||||
const OP_CONTAINS = 'contains';
|
||||
const OP_NOT_CONTAINS = 'ncontains';
|
||||
const OP_SET = 'set';
|
||||
const OP_NOT_SET = 'nset';
|
||||
|
||||
const OPT_DAYS = 'days';
|
||||
const OPT_MONTHS = 'months';
|
||||
@@ -95,9 +97,17 @@ class FilterWidget extends Widget
|
||||
*/
|
||||
public function display($widgetData)
|
||||
{
|
||||
//
|
||||
$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))
|
||||
|
||||
//
|
||||
if ($this->filterId == null && isset($filterSessionArray[self::FILTER_ID]))
|
||||
{
|
||||
$this->filterId = $filterSessionArray[self::FILTER_ID];
|
||||
}
|
||||
|
||||
//
|
||||
if ($filterSessionArray[self::FILTER_ID] != $this->filterId)
|
||||
{
|
||||
//
|
||||
$this->_loadFilter();
|
||||
@@ -281,6 +291,8 @@ class FilterWidget extends Widget
|
||||
<span>
|
||||
<select name="%s" class="select-filter-operation">
|
||||
<option value="'.self::OP_LESS_THAN.'" '.($activeFilterOperationValue == self::OP_LESS_THAN ? 'selected' : '').'>less than</option>
|
||||
<option value="'.self::OP_SET.'" '.($activeFilterOperationValue == self::OP_SET ? 'selected' : '').'>is set</option>
|
||||
<option value="'.self::OP_NOT_SET.'" '.($activeFilterOperationValue == self::OP_NOT_SET ? 'selected' : '').'>is not set</option>
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
@@ -492,6 +504,11 @@ class FilterWidget extends Widget
|
||||
$filterSessionArray[self::ADDITIONAL_COLUMNS] = array();
|
||||
}
|
||||
|
||||
if (!isset($filterSessionArray[self::FILTER_ID]))
|
||||
{
|
||||
$filterSessionArray[self::FILTER_ID] = -1;
|
||||
}
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
}
|
||||
|
||||
@@ -962,6 +979,8 @@ class FilterWidget extends Widget
|
||||
$filterSessionArray[self::ACTIVE_FILTERS_OPTION]
|
||||
);
|
||||
|
||||
$filterSessionArray[self::FILTER_ID] = $this->filterId;
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
}
|
||||
|
||||
@@ -1001,61 +1020,68 @@ class FilterWidget extends Widget
|
||||
|
||||
foreach ($activeFilters as $field => $activeFilterValue)
|
||||
{
|
||||
if (trim($activeFilterValue) != '')
|
||||
if ($first)
|
||||
{
|
||||
if ($first)
|
||||
$first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= ' AND ';
|
||||
}
|
||||
|
||||
if (isset($activeFiltersOperation[$field]))
|
||||
{
|
||||
$where .= '"'.$field.'"';
|
||||
$condition = '';
|
||||
|
||||
switch ($activeFiltersOperation[$field])
|
||||
{
|
||||
$first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$where .= ' AND ';
|
||||
case self::OP_EQUAL:
|
||||
if (!is_numeric($activeFilterValue)) $activeFilterValue = 0;
|
||||
$condition = ' = '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_NOT_EQUAL:
|
||||
if (!is_numeric($activeFilterValue)) $activeFilterValue = 0;
|
||||
$condition = ' != '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_GREATER_THAN:
|
||||
if (!is_numeric($activeFilterValue)) $activeFilterValue = 0;
|
||||
$condition = ' > '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_LESS_THAN:
|
||||
if (!is_numeric($activeFilterValue)) $activeFilterValue = 0;
|
||||
if (isset($activeFiltersOption[$field])
|
||||
&& ($activeFiltersOption[$field] == self::OPT_DAYS
|
||||
|| $activeFiltersOption[$field] == self::OPT_MONTHS))
|
||||
{
|
||||
$condition = ' < (NOW() - \''.$activeFilterValue.' '.$activeFiltersOption[$field].'\'::interval)';
|
||||
}
|
||||
else
|
||||
{
|
||||
$condition = ' < '.$activeFilterValue;
|
||||
}
|
||||
break;
|
||||
case self::OP_CONTAINS:
|
||||
$condition = ' ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_NOT_CONTAINS:
|
||||
$condition = ' NOT ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_IS_TRUE:
|
||||
$condition = ' IS TRUE';
|
||||
break;
|
||||
case self::OP_IS_FALSE:
|
||||
$condition = ' IS FALSE';
|
||||
break;
|
||||
case self::OP_SET:
|
||||
$condition = ' IS NOT NULL';
|
||||
break;
|
||||
case self::OP_NOT_SET:
|
||||
$condition = ' IS NULL';
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($activeFiltersOperation[$field]))
|
||||
{
|
||||
$where .= '"'.$field.'"';
|
||||
$condition = '';
|
||||
|
||||
switch ($activeFiltersOperation[$field])
|
||||
{
|
||||
case self::OP_EQUAL:
|
||||
$condition = ' = '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_NOT_EQUAL:
|
||||
$condition = ' != '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_GREATER_THAN:
|
||||
$condition = ' > '.$activeFilterValue;
|
||||
break;
|
||||
case self::OP_LESS_THAN:
|
||||
if (isset($activeFiltersOption[$field])
|
||||
&& ($activeFiltersOption[$field] == self::OPT_DAYS
|
||||
|| $activeFiltersOption[$field] == self::OPT_MONTHS))
|
||||
{
|
||||
$condition = ' < (NOW() - \''.$activeFilterValue.' '.$activeFiltersOption[$field].'\'::interval)';
|
||||
}
|
||||
else
|
||||
{
|
||||
$condition = ' < '.$activeFilterValue;
|
||||
}
|
||||
break;
|
||||
case self::OP_CONTAINS:
|
||||
$condition = ' ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_NOT_CONTAINS:
|
||||
$condition = ' NOT ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_IS_TRUE:
|
||||
$condition = ' IS TRUE';
|
||||
break;
|
||||
case self::OP_IS_FALSE:
|
||||
$condition = ' IS FALSE';
|
||||
break;
|
||||
}
|
||||
|
||||
$where .= $condition;
|
||||
}
|
||||
$where .= $condition;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user