Files
FHC-Core/application/views/person/bpk/bpkData.php
T
Paolo fa9976ec66 - FilterWidget can represents the retrieved data with tablesorter or pivotUI
- Added new constants to FiltersLib
- Added new parameter pivotui to FHC-Header to load JS and CSS for pivotUI
- Renamed constat WIDGET_URL_TABLE_DATASET to WIDGET_URL_DATASET_TABLESORTER in FilterWidget
- Added new constat WIDGET_URL_DATASET_PIVOTUI to FilterWidget
- Added new private properties _datasetRepresentation and _datasetRepresentationOptions to FilterWidget
- Renamed FilterWidget->loadViewTableDataset to loadViewDataset
- FilterWidget->loadViewDataset loads tablesorter or pivotUI view depending on the value of property _datasetRepresentation
- FilterWidget accepts two new parameter: datasetRepresentation and datasetRepOptions
- datasetRepresentation is required
- FilterWidget stores in session the _datasetRepresentation and _datasetRepresentationOptions properties
- Adapted view views/widgets/filter/filter to use loadViewDataset
- All views using FilterWidget have been adapted to use the required parameter datasetRepresentation
- Added new constats DATASET_REP_TABLESORTER and DATASET_REP_PIVOTUI to public/js/FilterWidget.js
- Added new private property _datasetRepresentation to FHC_FilterWidget in public/js/FilterWidget.js
- Based on property _datasetRepresentation FilterWidget.js will represent the FilterWidget data with tablesorter or pivotUI
- Added new private method _renderDataset to FHC_FilterWidget in public/js/FilterWidget.js
- Renamed method _renderTableDataset to _renderDatasetTablesorter in FHC_FilterWidget in public/js/FilterWidget.js
- Added new method _renderDatasetPivotUI to FHC_FilterWidget in public/js/FilterWidget.js
- Added bew method _setDatasetRepresentation to FHC_FilterWidget in public/js/FilterWidget.js
2019-01-11 15:14:53 +01:00

60 lines
1.8 KiB
PHP

<?php
$filterWidgetArray = array(
'query' => '
SELECT
person_id, vorname, nachname, geschlecht, svnr, ersatzkennzeichen, matr_nr,
staatsbuergerschaft, gebdatum
FROM
public.tbl_person
WHERE
matr_nr is not null
AND bpk is null
AND EXISTS(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) AND
person_id=tbl_person.person_id AND tbl_benutzer.aktiv=true)
',
'requiredPermissions' => 'admin',
'datasetRepresentation' => 'tablesorter',
'additionalColumns' => array('Details'),
'columnsAliases' => array(
'PersonID',
ucfirst($this->p->t('person', 'vorname')) ,
ucfirst($this->p->t('person', 'nachname')),
ucfirst($this->p->t('person', 'geschlecht')),
ucfirst($this->p->t('person', 'svnr')),
ucfirst($this->p->t('person', 'ersatzkennzeichen')),
ucfirst($this->p->t('person', 'matrikelnummer')),
ucfirst($this->p->t('person', 'staatsbuergerschaft')),
ucfirst($this->p->t('person', 'geburtsdatum')),
),
'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('person/BPKWartung/showDetails'),
$datasetRaw->{'person_id'},
'index',
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
);
if ($datasetRaw->{'ersatzkennzeichen'} == null)
{
$datasetRaw->{'ersatzkennzeichen'} = '-';
}
if ($datasetRaw->{'svnr'} == null)
{
$datasetRaw->{'svnr'} = '-';
}
return $datasetRaw;
}
);
$filterWidgetArray['app'] = 'core';
$filterWidgetArray['datasetName'] = 'overview';
$filterWidgetArray['filterKurzbz'] = 'BPKWartung';
$filterWidgetArray['filter_id'] = $this->input->get('filter_id');
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>