From 1254e8d6188bd8399c0a0f0ce0537673d5e6da59 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 9 May 2018 12:36:35 +0200 Subject: [PATCH 01/62] Added translation using phrases . added translation functionality by -- adding loadPhrases-method in Controllers -- replacing hardcoded html-text with $this->p->t(...) --- application/controllers/system/Messages.php | 7 + .../system/infocenter/InfoCenter.php | 12 +- .../views/system/infocenter/addNotiz.php | 8 +- .../infocenter/anmerkungenZurBewerbung.php | 2 +- .../views/system/infocenter/dokpruefung.php | 20 +- .../views/system/infocenter/infocenter.php | 2 +- .../system/infocenter/infocenterData.php | 20 +- .../system/infocenter/infocenterDetails.php | 14 +- application/views/system/infocenter/logs.php | 36 ++-- .../views/system/infocenter/notizen.php | 4 +- .../views/system/infocenter/stammdaten.php | 36 ++-- .../views/system/infocenter/zgvpruefungen.php | 86 +++----- application/views/system/messageList.php | 192 +++++++++--------- application/views/system/messageWrite.php | 16 +- application/views/widgets/filter/filter.php | 2 +- application/widgets/Nation_widget.php | 41 ++-- application/widgets/Vorlage_widget.php | 3 +- application/widgets/Zgv_widget.php | 41 ++-- 18 files changed, 274 insertions(+), 268 deletions(-) diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index dd112d204..9d66dac4d 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -20,6 +20,13 @@ class Messages extends VileSci_Controller $this->load->library('WidgetLib'); $this->load->model('person/Person_model', 'PersonModel'); + + $this->loadPhrases(array( + 'global', + 'person', + 'lehre', + 'ui', + 'infocenter')); $this->_setAuthUID(); // sets property uid } diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 4bafe591b..835cac464 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -74,6 +74,14 @@ class InfoCenter extends VileSci_Controller $this->load->library('PersonLogLib'); $this->load->library('WidgetLib'); + $this->loadPhrases(array( + 'global', + 'person', + 'lehre', + 'ui', + 'infocenter', + 'filter')); + $this->_setAuthUID(); // sets property uid $this->load->library('PermissionLib'); @@ -591,13 +599,13 @@ class InfoCenter extends VileSci_Controller $filtersarray = array( 'abgeschickt' => array( 'link' => '#', - 'description' => 'Abgeschickt', + 'description' => ucfirst($this->p->t('global', 'abgeschickt')), 'expand' => true, 'children' => array() ), 'nichtabgeschickt' => array( 'link' => '#', - 'description' => 'Nicht abgeschickt', + 'description' => ucfirst($this->p->t('global', 'nichtAbgeschickt')), 'expand' => true, 'children' => array() ) diff --git a/application/views/system/infocenter/addNotiz.php b/application/views/system/infocenter/addNotiz.php index a8396fe40..f8f02570a 100644 --- a/application/views/system/infocenter/addNotiz.php +++ b/application/views/system/infocenter/addNotiz.php @@ -2,11 +2,11 @@
- +
- +
@@ -21,8 +21,8 @@
- - + +
\ No newline at end of file diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php index 565db79db..ee21b55e8 100644 --- a/application/views/system/infocenter/anmerkungenZurBewerbung.php +++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php @@ -5,7 +5,7 @@ - + diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 8261a2ebd..b599b6b06 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -2,11 +2,11 @@
Anmerkungen zur Bewerbungp->t('infocenter','anmerkungenZurBewerbung')) ?>
- - - - - + + + + + @@ -35,14 +35,14 @@ 0): ?>
-

Nachzureichende Dokumente:

+

p->t('infocenter','nachzureichendeDokumente')) ?>

NameTypUploaddatumAusstellungsnationFormal geprüftp->t('global','name')) ?>p->t('global','typ')) ?>p->t('global','uploaddatum')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('infocenter','formalGeprueft')) ?>
- - - - + + + + diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index ab9746a8e..38268aa4d 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -24,7 +24,7 @@
- +
diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 2d9d30cf2..6dd10b4ef 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -189,8 +189,22 @@ 'fhc_controller_id' => $fhc_controller_id, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), - 'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Nation', 'Letzte Aktion','Letzter Bearbeiter', - 'StSem','GesendetAm','NumAbgeschickt','StgSent','StgNotSent','StgAktiv', 'Sperrdatum','GesperrtVon'), + 'columnsAliases' => array( + 'PersonID', + ucfirst($this->p->t('person','vorname')) , + ucfirst($this->p->t('person','nachname')), + ucfirst($this->p->t('person','geburtsdatum')), + ucfirst($this->p->t('person','nation')), + ucfirst($this->p->t('global','letzteAktion')), + ucfirst($this->p->t('global','letzterBearbeiter')), + ucfirst($this->p->t('lehre','studiensemester')), + ucfirst($this->p->t('global','gesendetAm')), + ucfirst($this->p->t('global','abgeschickt')) . ' (' . $this->p->t('global','anzahl') . ')', + ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','gesendet') . ')', + ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','nichtGesendet') . ')', + ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','aktiv') . ')', + ucfirst($this->p->t('global','sperrdatum')), + ucfirst($this->p->t('global','gesperrtVon'))), 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( @@ -259,7 +273,7 @@ } } ); - + $filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null; if (isset($filterId) && is_numeric($filterId)) diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 7038031a0..0abe9b6b1 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -40,14 +40,14 @@
- wird bearbeitet von: + p->t('global', 'wirdBearbeitetVon') . ' :' ?>     Freigeben + class="fa fa-sign-out"> p->t('ui', 'freigeben')) ?>
@@ -57,7 +57,7 @@
-

Stammdaten

+

p->t('global','stammdaten')) ?>

load->view('system/infocenter/stammdaten.php'); ?> load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> @@ -71,7 +71,7 @@
-

Dokumentenprüfung

+

p->t('infocenter','dokumentenpruefung')) ?>

load->view('system/infocenter/dokpruefung.php'); ?>
@@ -85,7 +85,7 @@
-

ZGV-Prüfung

+

p->t('infocenter', 'zgv') . ' - ' . ucfirst($this->p->t('lehre','pruefung'))?>

load->view('system/infocenter/zgvpruefungen.php'); ?> @@ -100,7 +100,7 @@
-

Nachrichten

+

p->t('global','nachrichten')) ?>

@@ -119,7 +119,7 @@
-

Notizen & Aktivitäten

+

p->t('global','notizen')) . ' & ' . ucfirst($this->p->t('global','aktivitaeten')) ?>

diff --git a/application/views/system/infocenter/logs.php b/application/views/system/infocenter/logs.php index 65b67624e..a45034818 100644 --- a/application/views/system/infocenter/logs.php +++ b/application/views/system/infocenter/logs.php @@ -1,19 +1,19 @@ -
TypNachzureichen amAusstellungsnationAnmerkungp->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
- - - - - - - - - - - - - - - - +
DatumAktivitätUser
zeitpunkt), 'd.m.Y H:i:s') ?>logdata->name) ? $log->logdata->name : '' ?>insertvon ?>
+ + + + + + + + + + + + + + + +
p->t('global', 'datum')) ?>p->t('global', 'aktivitaet')) ?>User
zeitpunkt), 'd.m.Y H:i:s') ?>logdata->name) ? $log->logdata->name : '' ?>insertvon ?>
\ No newline at end of file diff --git a/application/views/system/infocenter/notizen.php b/application/views/system/infocenter/notizen.php index 683a9b3d9..f0d155f82 100644 --- a/application/views/system/infocenter/notizen.php +++ b/application/views/system/infocenter/notizen.php @@ -1,8 +1,8 @@ - - + + diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index daf0b7d24..45c2326e9 100755 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -2,41 +2,41 @@
DatumNotizp->t('global', 'datum')) ?>p->t('global', 'notiz')) ?> User
- + - + - + - + - + - + - + - +
Vornamep->t('person','vorname')) ?> vorname ?>
Nachnamep->t('person','nachname')) ?> nachname ?>
Geburtsdatump->t('person','geburtsdatum')) ?> gebdatum), 'd.m.Y') ?>
Sozialversicherungsnrp->t('person','svnr')) ?> svnr ?>
Staatsbürgerschaftp->t('person','staatsbuergerschaft')) ?> staatsbuergerschaft ?>
Geschlechtp->t('person','geschlecht')) ?> geschlecht ?>
Geburtsnationp->t('person','geburtsnation')) ?> geburtsnation ?>
Geburtsortp->t('person','geburtsort')) ?> gebort ?>
@@ -45,18 +45,22 @@ - + - - - + + + kontakte as $kontakt): ?> - + kontakttyp === 'email'): ?> + + kontakttyp === 'telefon'): ?> + +
Kontaktep->t('global','kontakt')) ?>
TypKontaktAnmerkungp->t('global','typ')) ?>p->t('global','kontakt')) ?>p->t('global','anmerkung')) ?>
kontakttyp); ?>p->t('person','email')) ?>p->t('person','telefon')) ?> kontakttyp.'">';?> kontakttyp === 'email'): ?> @@ -76,7 +80,7 @@ adressen as $adresse): ?>
- Adresse + p->t('person','adresse')) ?> strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?> @@ -97,13 +101,13 @@  Nachricht senden + class="fa fa-envelope"> p->t('ui','nachrichtSenden') ?> zugangscode)): ?>
 Zugang Bewerbung + target='_blank'> p->t('infocenter','zugangBewerbung') ?>
diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index c8091a5dc..08624e62c 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -21,14 +21,14 @@ prestudentstatus->bestaetigtam)): ?>
- An Studiengang freigegeben + p->t('global', 'anStudiengangFreigegeben') ?>
- prestudentstatus->bewerbung_abgeschicktamum) ? '' : ''); ?> - prestudentstatus->bewerbungsnachfrist) ? ' | Nachfrist: '. date_format(date_create($zgvpruefung->prestudentstatus->bewerbungsnachfrist), 'd.m.Y') : ''); ?> - prestudentstatus->bewerbungstermin) ? ' | Bewerbungsfrist: '. date_format(date_create($zgvpruefung->prestudentstatus->bewerbungstermin), 'd.m.Y') : ''); ?> + p->t('infocenter','bewerbung')) . ' ' . $this->p->t('global','abgeschickt') . ': '.(isset($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum) ? '' : ''); ?> + prestudentstatus->bewerbungsnachfrist) ? ' | ' . $this->p->t('infocenter', 'nachfrist') . ': ' . date_format(date_create($zgvpruefung->prestudentstatus->bewerbungsnachfrist), 'd.m.Y') : ''); ?> + prestudentstatus->bewerbungstermin) ? ' | ' . $this->p->t('infocenter', 'bewerbungsfrist') . ': ' . date_format(date_create($zgvpruefung->prestudentstatus->bewerbungstermin), 'd.m.Y') : ''); ?>
@@ -43,7 +43,7 @@
- + prestudentstatus->status_kurzbz)) { @@ -54,7 +54,7 @@
- + prestudentstatus->studiensemester_kurzbz) ? $zgvpruefung->prestudentstatus->studiensemester_kurzbz : '' ?>
@@ -67,7 +67,7 @@
- + prestudentstatus->orgform)) ? ', ' : ''; @@ -84,18 +84,18 @@
- + zgv_bez; ?>
- +
- + zgvort); else: @@ -121,7 +121,7 @@
- + zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y'); if ($infoonly): @@ -137,7 +137,7 @@
- + zgvnation_bez; else @@ -153,7 +153,7 @@ studiengangtyp === 'm') : ?>
-
+
zgvmas_bez; @@ -167,7 +167,7 @@
- + zgvmaort; else: @@ -180,7 +180,7 @@
- + zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y'); if ($infoonly): @@ -195,8 +195,7 @@
-
+
zgvmanation_bez; @@ -215,12 +214,12 @@
@@ -243,8 +242,7 @@ class="d-inline float-right" required> @@ -255,7 +253,7 @@ class="btn btn-default" data-toggle="modal" data-target="#absageModal_prestudent_id ?>"> - Absage + p->t('ui', 'absagen') ?>
@@ -274,33 +272,20 @@ × + id="absageModalLabel">p->t('infocenter', 'absageBestaetigen') ?>
@@ -331,7 +316,7 @@ data-toggle="modal" data-target="#freigabeModal_prestudent_id ?>" data-toggle="tooltip" title=""> - Freigabe an Studiengang + p->t('ui', 'freigabeAnStudiengang') ?>
@@ -348,29 +333,20 @@ + p->t('global', 'freigabeBestaetigen') ?>
@@ -384,7 +360,7 @@
prestudentstatus->bestaetigtam) ? '' : '' ?> - +
diff --git a/application/views/system/messageList.php b/application/views/system/messageList.php index d549d68a4..44779ad2c 100644 --- a/application/views/system/messageList.php +++ b/application/views/system/messageList.php @@ -1,97 +1,97 @@ - 0; -$widthColumn = $msgExists === true ? 8 : 12; -?> -
- - - - - - - - - - - - - - - - - - - - - -
Gesendet amSenderEmpfängerBetreffGelesen am
insertamum) ? date_format(date_create($message->insertamum), 'd.m.Y H:i:s') : '' ?>sevorname.' '.$message->senachname ?>revorname.' '.$message->renachname ?>subject ?>statusamum) ? date_format(date_create($message->statusamum), 'd.m.Y H:i:s') : '' ?>
-
- -
-
-
-
- -
-
- - \ No newline at end of file diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 3f9ed5254..85c003cfd 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -32,14 +32,14 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
- +
- +
- +
 
- +
- + 1) diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index 5fbff4953..d3dbb1918 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -168,7 +168,7 @@
diff --git a/application/widgets/Nation_widget.php b/application/widgets/Nation_widget.php index 8337a92c1..79059c84f 100644 --- a/application/widgets/Nation_widget.php +++ b/application/widgets/Nation_widget.php @@ -1,22 +1,21 @@ -load->model('codex/nation_model', 'NationModel'); - $this->NationModel->addOrder('nation_code'); - - $this->addSelectToModel($this->NationModel, 'nation_code', 'kurztext'); - - $this->setElementsArray( - $this->NationModel->load(), - true, - 'Nation wählen...', - 'keine Nation gefunden' - ); - - $this->loadDropDownView($widgetData); - } +load->model('codex/nation_model', 'NationModel'); + $this->NationModel->addOrder('nation_code'); + + $this->addSelectToModel($this->NationModel, 'nation_code', 'kurztext'); + + $this->setElementsArray( + $this->NationModel->load(), + true, + $this->p->t('ui', 'bitteEintragWaehlen') + ); + + $this->loadDropDownView($widgetData); + } } \ No newline at end of file diff --git a/application/widgets/Vorlage_widget.php b/application/widgets/Vorlage_widget.php index 2bf8f95dc..9c9abe430 100644 --- a/application/widgets/Vorlage_widget.php +++ b/application/widgets/Vorlage_widget.php @@ -27,8 +27,7 @@ class Vorlage_widget extends DropdownWidget $this->setElementsArray( $vorlage, true, - 'Select a vorlage...', - 'No vorlage found' + $this->p->t('ui', 'vorlageWaehlen') ); $this->loadDropDownView($widgetData); diff --git a/application/widgets/Zgv_widget.php b/application/widgets/Zgv_widget.php index a2500a1e9..b34bb27b6 100644 --- a/application/widgets/Zgv_widget.php +++ b/application/widgets/Zgv_widget.php @@ -1,22 +1,21 @@ -load->model('codex/zgv_model', 'ZgvModel'); - $this->ZgvModel->addOrder('zgv_bez'); - - $this->addSelectToModel($this->ZgvModel, 'zgv_code', 'zgv_bez'); - - $this->setElementsArray( - $this->ZgvModel->load(), - true, - 'Zgv wählen...', - 'keine Zgv gefunden' - ); - - $this->loadDropDownView($widgetData); - } +load->model('codex/zgv_model', 'ZgvModel'); + $this->ZgvModel->addOrder('zgv_bez'); + + $this->addSelectToModel($this->ZgvModel, 'zgv_code', 'zgv_bez'); + + $this->setElementsArray( + $this->ZgvModel->load(), + true, + $this->p->t('ui', 'bitteEintragWaehlen') + ); + + $this->loadDropDownView($widgetData); + } } \ No newline at end of file From 03b298f1f5767078eccf7efb1ef7f161236c44bf Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 9 May 2018 12:39:19 +0200 Subject: [PATCH 02/62] Added translation fallback . fallback 1: if no entry or empty entry in user's language --> fallback to default language . fallback 2: if empty entry at all (even in default langage) --> fallback to phrasename --- application/libraries/PhrasesLib.php | 61 +++++++++++++++++++--- application/models/system/Phrase_model.php | 13 ++++- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index 99b73732b..1194e769c 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -187,22 +187,67 @@ class PhrasesLib { for ($i = 0; $i < count($this->_phrases); $i++) { + $_phrase = $this->_phrases[$i]; - + if ($_phrase->category == $category && $_phrase->phrase == $phrase && $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz - && $_phrase->orgform_kurzbz== $orgform_kurzbz) - { - if ($parameters == null) $parameters = array(); + && $_phrase->orgform_kurzbz== $orgform_kurzbz + && (!empty($_phrase->text))) + { + if ($parameters == null) + $parameters = array(); + + return $this->_ci->parser->parse_string($_phrase->text, $parameters, true); + } + } + + //fallback 1: if phrase not found in phrases-array, try with default language + $default_language = DEFAULT_LANGUAGE; + $categories = $this->_ci->PhraseModel->getCategories(); + + if (hasData($categories)) + { + $categories = $categories->retval; + foreach($categories as $cat) + $all_categories[] = $cat->category; + } + + $phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($all_categories, $default_language); + + if (hasData($phrases)) + { + $default_phrases = $phrases->retval; + } - echo $this->_ci->parser->parse_string($_phrase->text, $parameters, true)."\n"; - break; + if (isset($default_phrases) && is_array($default_phrases)) + { + for ($i = 0; $i < count($default_phrases); $i++) + { + $_phrase = $default_phrases[$i]; +// var_dump($_phrase); + +// echo $phrase . "
"; +// echo $_phrase->phrase . "

"; + + if ($_phrase->category == $category + && $_phrase->phrase == $phrase + && $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz + && $_phrase->orgform_kurzbz== $orgform_kurzbz) + { + if ($parameters == null) + $parameters = array(); + return $this->_ci->parser->parse_string($_phrase->text, $parameters, true); + } } } - } + + //fallback 2: if phrase not found at all, return phrasename + $phrase = '<< PHRASE ' . $phrase . ' >>'; + return $this->_ci->parser->parse_string($phrase, $parameters, true); + } } - // ----------------------------------------------------------------------------------------------------------------- // Private methods diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index a0363eb5a..dff8bebaf 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -77,4 +77,15 @@ class Phrase_model extends DB_Model return $this->execQuery($query, array($categories, $language)); } -} + + /** + * Loads all categories + */ + public function getCategories() + { + $query = 'SELECT DISTINCT category + FROM system.tbl_phrase'; + + return $this->execQuery($query); + } +} \ No newline at end of file From eafa89ce1097eac77ac8055f45503e8239349749 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 9 May 2018 13:13:38 +0200 Subject: [PATCH 03/62] Added phrases update script called by checksystem . assoc array of phrases . new phrases are inserted into system.phrase_tbl . new phrasen-texte in different languages are inserted into system.phrasentext_tbl --- system/checksystem.php | 12 + system/phrasesupdate.php | 2562 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 2574 insertions(+) create mode 100644 system/phrasesupdate.php diff --git a/system/checksystem.php b/system/checksystem.php index 6bdd83f54..5e4daa1d4 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -62,6 +62,18 @@ echo '
'; require_once($dbupdStr); echo '
'; + +// ******** phrasenupdate ************/ +echo '

Phrasen-Updates!

'; + +echo '
'; + echo 'phrasesupdate.php wird aufgerufen...'; +echo '
'; +echo '
'; + require_once('phrasesupdate.php'); +echo '
'; + + // ******** Berechtigungen Prüfen ************/ echo '

Berechtigungen pruefen

'; $neue=false; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php new file mode 100644 index 000000000..b5df746a5 --- /dev/null +++ b/system/phrasesupdate.php @@ -0,0 +1,2562 @@ + + * + * Beschreibung: + * The script checks phrases and phrase-texts for actuality in the database. + * Missing attributes are inserted. + */ + +//flag for at least one new phrase +$new = false; + + +$phrases = array( + //******************* CORE/global + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'alle', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'alle', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'all', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'titel', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Titel', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'title', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'uebersicht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Übersicht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'overview', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'details', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Details', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'details', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'waehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'wählen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'select', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'vollstaendig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'vollständig', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'complete', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'unvollstaendig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'unvollständig', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'incomplete', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'betreff', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Betreff', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'subject', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'sender', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Sender', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'sender', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'empfaenger', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Empfänger', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'receiver', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'gesendetAm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'gesendet am', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'sent on', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'gelesenAm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'gelesen am', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'read on', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'datum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Datum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'freigeben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'freigeben', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'approve', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'letzterBearbeiter', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'letzter Bearbeiter', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => 'last editor', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'letzteAktion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'letzte Aktion', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'last action', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'gesperrtVon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'gesperrt von', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'locked by', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'sperrdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'sperrdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'locking date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'anzahl', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anzahl', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'amount', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'abgeschickt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'abgeschickt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'sent', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'inaktiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'inaktiv', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'inactive', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'aktiv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'aktiv', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'active', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'gesendet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'gesendet', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'sent', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'nichtGesendet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'nicht gesendet', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'not sent', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'kontakt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kontakt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'contact', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'typ', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Typ', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'type', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'anmerkung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anmerkung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'name', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Name', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'name', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'stammdaten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Stammdaten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'master data', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'uploaddatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Uploaddatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'upload date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'letzterStatus', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'letzter Status', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'last status', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'nachrichten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachrichten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'messages', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'aktivitaeten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Aktivitäten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'activities', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'notizen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notizen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'notes', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'notiz', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notiz', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'aktivitaet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Aktivität', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'activity', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'hinzufuegen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'hinzufügen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'add', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'wirdBearbeitetVon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'wird bearbeitet von', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'nichtAbgeschickt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'nicht abgeschickt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'not sent', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'anStudiengangFreigegeben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'an Studiengang freigegeben', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'nachricht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachricht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'message', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'vorschau', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Vorschau', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'preview', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'vorlage', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Vorlage', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'template', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + + + //******************************* CORE/ui + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'speichern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Speichern', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Save', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'abbrechen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Abbrechen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Break', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'loeschen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Löschen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Delete', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'entfernen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Entfernen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Remove', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'freigeben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Freigeben', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'freigabeAnStudiengang', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Freigabe an Studiengang', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nachrichtSenden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachricht senden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Send message', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'senden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Senden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Send', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'anwenden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anwenden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Apply', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'hinzufuegen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hinzufügen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Add', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'absagen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Absagen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'bitteWaehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bitte wählen...', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Please select...', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'bitteEintragWaehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bitte Eintrag wählen...', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Please select entry...', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'keineEintraegeGefunden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Keine Einträge gefunden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No entries found', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'felder', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Felder', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'fields', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'vorlageWaehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Vorlage wählen...', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Select template', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + + //*************************** CORE/filter + array( + 'app' => 'core', + 'category' => 'filter', + 'phrase' => 'filterEinstellungen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Filter Einstellungen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'filter settings', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + + + //**************************** CORE/person + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'student', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Student', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'student', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'vorname', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Vorname', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'first name', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'nachname', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachname', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'last name', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'username', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Username', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'username', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'anrede', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anrede', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'uid', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'UID', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'UID', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'mann', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mann', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'frau', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Frau', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'staatsbuergerschaft', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Staatsbürgerschaft', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'citizenship', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'geburtsdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Geburtsdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'date of birth', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'svnr', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Sozialversicherungsnummer', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => 'social security number', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'geschlecht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Geschlecht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'gender', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'geburtsnation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Geburtsnation', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'country of birth', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'geburtsort', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Geburtsort', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'place of birth', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'email', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'eMail', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'email', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'telefon', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Telefon', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'phone', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'adresse', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Adresse', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'address', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'nation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nation', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'nation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'ort', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ort', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'place', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + //**************** CORE/lehre + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'studiensemester', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Studiensemester', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'semester', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'ausbildungssemester', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ausbildungssemester', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'organisationsform', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Organisationsform', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'organisational form', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'organisationseinheit', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Organisationseinheit', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'organisation unit', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'studiengang', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Studiengang', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'degree-program', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'studienrichtung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Studienrichtung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'degree-program', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'pruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'master', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Master', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Master', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + + + + //********************** INFOCENTER/infocenter + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'infocenter', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Infocenter', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Infocenter', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'dokumentenpruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumentenprüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'document check', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvPruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvOrt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Ort', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvDatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Datum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvNation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Nation', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'bewerbung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bewerbung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'reifepruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Reifeprüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'reifepruefungszeugnis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Reifeprüfungszeugnis', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'bewerbungAbgeschickt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bewerbung abgeschickt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'application sent', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'ausstellungsnation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ausstellungsnation', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'issuing country', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'formalGeprueft', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'formal geprüft', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'formally checked', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'nachzureichendeDokumente', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'nachzureichende Dokumente', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'documents to be hand in later', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'nachzureichenAm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'nachzureichen am', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'to be delivered on', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'anmerkungenZurBewerbung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anmerkungen zur Bewerbung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => 'notes on the application', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zugangBewerbung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zugang Bewerbung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Access application', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zugangsvoraussetzung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zugangsvoraussetzung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'letzteZgvUebernehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'letzte ZGV übernehmen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'absagegrund', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Absagegrund', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'reason for cancellation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'absage', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Absage', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Cancellation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'absageBestaetigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Absage bestätigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm cancellation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'absageBestaetigenTxt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bei Absage von InteressentInnen erhalten diese den Status "Abgewiesener" und deren ' + . 'ZGV-Daten können im Infocenter nicht mehr bearbeitet oder freigegeben werden. ' + . 'Alle nicht gespeicherten ZGV-Daten gehen verloren. Fortfahren?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'notizHinzufuegen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notiz hinzufügen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Add note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'tageKeineAktion', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Tage keine Aktion', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'days no action', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'anAusgewaehlte', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'an Ausgewählte', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'to selected ones', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'interessentAbweisen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'InteressentIn abweisen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'interessentFreigeben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'InteressentIn freigeben', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'interessentFreigebenTxt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bei Freigabe von InteressentInnen wird deren Interessentenstatus bestätigt + und deren Zgvdaten können im Infocenter nicht mehr bearbeitet oder freigegeben werden.
+ Alle nicht gespeicherten Zgvdaten gehen verloren.
+ Fortfahren?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'freigabeBestaetigen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Freigabe bestätigen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Confirm approval', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'nachfrist', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nachfrist', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ),array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'bewerbungsfrist', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bewerbungsfrist', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => '', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'notizAendern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notiz ändern', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'change note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) + +); + + +//***** CHECK PHRASES & PHRASENTEXTE in German and English. +//***** INSERT into phrase_tbl if new app + category + phrase found in phrasen-array. +//***** INSERT into phrasentext_tbl if new text found in phrasen-phrases-array, conciders every language apart. + +foreach($phrases as $phrase) +{ + $qry = "SELECT phrase_id + FROM system.tbl_phrase + WHERE + app=" . $db->db_add_param($phrase['app']) . " AND + category=" . $db->db_add_param($phrase['category']) . " AND + phrase=" . $db->db_add_param($phrase['phrase']); + + //*** CHECK PHRASE + if($result = $db->db_query($qry)) + { + $phrase_id = ''; + + //phrase not existing -> insert phrase and get last inserted phrase_id + if($db->db_num_rows($result) === 0) + { + $qry_insert = "INSERT INTO system.tbl_phrase( + app, + phrase, + insertamum, + insertvon, + category) + VALUES(". + $db->db_add_param($phrase['app']) . ','. + $db->db_add_param($phrase['phrase']) . ','. + ' now(),'. + $db->db_add_param($phrase['insertvon']) . ','. + $db->db_add_param($phrase['category']) . ');'; + + if($db->db_query($qry_insert)) + { + $new = true; + + $qry_lastId = "SELECT currval('system.tbl_phrase_phrase_id_seq') as id"; + if($db->db_query($qry_lastId)) + { + if($obj = $db->db_fetch_object()) + { + $phrase_id = $obj->id; + } + } + echo 'Kategorie/Phrase: ' . $phrase['category'] . '/' . $phrase['phrase'] . ' hinzugefügt
'; + } + else + echo 'Fehler: ' . $phrase['category'] . '/' . $phrase['phrase'] . ' hinzufügen nicht möglich
'; + + } + //phrase existing -> get phrase_id + else + { + if ($obj = $db->db_fetch_object($result)) + { + $phrase_id = $obj->phrase_id; + } + echo 'Kategorie/Phrase: ' . $phrase['category'] . '/' . $phrase['phrase'] . ' vorhanden.
'; + } + + + //*** CHECK PHRASENTEXT + //loop through languages + foreach($phrase['phrases'] as $phrase_phrases) + { + $language = $phrase_phrases['sprache']; + + //query phrasentext in certain language + $qry_language = + "SELECT * + FROM system.tbl_phrasentext + WHERE + phrase_id=" . $phrase_id . " AND + sprache='" . $language . "'"; + + + if($result_language = $db->db_query($qry_language)) + { + //if phrasentext not existing in certain language -> insert + if($db->db_num_rows($result_language) === 0 && !empty($phrase_phrases['text'])) + { + $qry_insert = "INSERT INTO system.tbl_phrasentext( + phrase_id, + sprache, + orgeinheit_kurzbz, + orgform_kurzbz, + text, + description, + insertamum, + insertvon) + VALUES(". + $db->db_add_param($phrase_id, FHC_INTEGER) . ','. + $db->db_add_param($phrase_phrases['sprache']) . ','. + ' NULL,'. + ' NULL,'. + $db->db_add_param($phrase_phrases['text']) . ','. + $db->db_add_param($phrase_phrases['description']) . ','. + ' now(),'. + $db->db_add_param($phrase_phrases['insertvon']) . ');'; + + if($db->db_query($qry_insert)) + { + echo '-- Phrasentext ' . strtoupper(substr($phrase_phrases['sprache'], 0, 3)) . ': ' . $phrase_phrases['text'] . ' hinzugefügt
'; + } + else + { + echo 'Fehler: Phrasentext ' . strtoupper(substr($phrase_phrases['sprache'], 0, 3)) . ': '. $phrase_phrases['text'] . ' hinzufügen nicht möglich
'; + } + } + } + } + } +} + +if(!$new) + echo 'Keine neuen Phrasen
'; + + From 4aa0f81278d35407be12e87715814b1cd5dfa8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 14 May 2018 14:05:11 +0200 Subject: [PATCH 04/62] Document Conversion Bugfix --- application/libraries/DocumentLib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index 204b1d30f..6def51ab5 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -57,8 +57,15 @@ class DocumentLib case 'application/vnd.ms-word': case 'application/vnd.oasis.opendocument.text': case 'text/plain': - $this->convert($filename, $outFile, 'pdf'); - return success($outFile); + $ret = $this->convert($filename, $outFile, 'pdf'); + if(isSuccess($ret)) + { + return success($outFile); + } + else + { + return $ret; + } case 'application/pdf': return success($filename); default: From f7196a7c6089a81ba21a00def219aa84c52dd975 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 15 May 2018 13:52:31 +0200 Subject: [PATCH 05/62] =?UTF-8?q?Funktion=20deleteParked=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Logtype ist nun "Processstate" - json-name ist "parked" --- include/personlog.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/personlog.class.php b/include/personlog.class.php index 55e69c90a..5eb75512b 100644 --- a/include/personlog.class.php +++ b/include/personlog.class.php @@ -79,13 +79,18 @@ class personlog extends basis_db } /** - * Löscht alle Logeinträge vom Typ "Parked" der übergebenen Person_id die in der Zukunft liegen. + * Löscht alle Logeinträge vom Typ "Precessstate" mit Namen "Parked" der übergebenen Person_id, die in der Zukunft liegen. * @param integer $person_id ID der Person, deren geparkter Logeintrag gelöscht werden soll. * @return boolean true wenn erfolgreich, false im Fehlerfall. */ public function deleteParked($person_id) { - $qry = "DELETE FROM system.tbl_log WHERE logtype_kurzbz='Parked' AND person_id=".$this->db_add_param($person_id)." AND zeitpunkt>=now();"; + $qry = "DELETE + FROM system.tbl_log + WHERE logtype_kurzbz = 'Processstate' + AND person_id = ".$this->db_add_param($person_id)." + AND logdata ->> 'name' = 'Parked' + AND zeitpunkt >= now();"; if($this->db_query($qry)) { From 5a10eada1da56d4b7d8d56647ee960ef87de211b Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 15 May 2018 13:53:23 +0200 Subject: [PATCH 06/62] Studiengang_edit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nur berechtigte Studiengänge im DropDown --- vilesci/stammdaten/studiengang_edit.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vilesci/stammdaten/studiengang_edit.php b/vilesci/stammdaten/studiengang_edit.php index 658d9d300..308c65899 100644 --- a/vilesci/stammdaten/studiengang_edit.php +++ b/vilesci/stammdaten/studiengang_edit.php @@ -49,7 +49,7 @@ $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); if(!$rechte->isBerechtigt('assistenz')) - die('Sie haben keine Berechtigung fuer diese Seite'); + die($rechte->errormsg); if(isset($_GET['studiengang_kz'])) $stg_kz = $_GET['studiengang_kz']; @@ -62,7 +62,7 @@ if(isset($_GET['action']) && $_GET['action']=='save') $studiengang = new studiengang(); $studiengang->load($studiengang_kz); if(!$rechte->isBerechtigt('assistenz', $studiengang->oe_kurzbz, 'suid')) - die('Sie haben keine Berechtigung fuer diese Seite'); + die($rechte->errormsg); $bezeichnung = $_POST['bezeichnung']; $english = $_POST['english']; @@ -127,15 +127,18 @@ echo ' Studiengang: '; From 37650f4d30e1651196648e054020d8eb8b01b701 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 15 May 2018 16:30:47 +0200 Subject: [PATCH 07/62] BugFix Function getStudiengaengeDokument Added db_num_rows before while-loop --- include/dokument.class.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/dokument.class.php b/include/dokument.class.php index 361599382..d4356be85 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -832,16 +832,21 @@ class dokument extends basis_db if($result = $this->db_query($qry)) { - $stg_obj = new basis_db(); - while($row = $this->db_fetch_object($result)) + if ($this->db_num_rows($result) > 0) { - $stg_obj->kuerzel = $row->kuerzel; - $stg_obj->bezeichnung = $row->bezeichnung; - $stg_obj->studiengang_kz = $row->studiengang_kz; - - $this->result[] = $stg_obj; + while($row = $this->db_fetch_object($result)) + { + $stg_obj = new basis_db(); + $stg_obj->kuerzel = $row->kuerzel; + $stg_obj->bezeichnung = $row->bezeichnung; + $stg_obj->studiengang_kz = $row->studiengang_kz; + + $this->result[] = $stg_obj; + } + return $stg_obj; } - return $stg_obj; + else + return false; } else { From 6f57c46cc34b621d9c2639722cc563ba71b2a4af Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Tue, 15 May 2018 17:15:03 +0200 Subject: [PATCH 08/62] =?UTF-8?q?bei=20Anzeige=20der=20vergebenen=20Lehrau?= =?UTF-8?q?ftr=C3=A4ge=20werden=20Lehrg=C3=A4nge=20exkludiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/zeitaufzeichnung.class.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/include/zeitaufzeichnung.class.php b/include/zeitaufzeichnung.class.php index 422cde18c..07c87cf50 100755 --- a/include/zeitaufzeichnung.class.php +++ b/include/zeitaufzeichnung.class.php @@ -634,24 +634,37 @@ or not exists FROM lehre.tbl_lehreinheitmitarbeiter m, lehre.tbl_lehreinheit l + JOIN + lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id) + JOIN + public.tbl_studiengang s using (studiengang_kz) WHERE $where AND $where_sem AND l.lehreinheit_id = m.lehreinheit_id AND - m.stundensatz * m.semesterstunden > 0 + m.stundensatz * m.semesterstunden > 0 AND + s.typ not in ('l') AND + lv.studiengang_kz > 0 UNION SELECT sum(pb.stunden) AS semstunden FROM lehre.tbl_projektarbeit pa, lehre.tbl_projektbetreuer pb, - lehre.tbl_lehreinheit l, - public.tbl_benutzer b + public.tbl_benutzer b, + lehre.tbl_lehreinheit l + JOIN + lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id) + JOIN + public.tbl_studiengang s using (studiengang_kz) + WHERE pa.lehreinheit_id = l.lehreinheit_id AND pb.projektarbeit_id = pa.projektarbeit_id AND pb.person_id = b.person_id AND b.uid = ".$this->db_add_param($user)." AND pb.stunden * pb.stundensatz > 0 AND + s.typ not in ('l') AND + lv.studiengang_kz > 0 AND $where_sem ) AS semstunden "; From a075cc26b379e388e25f18e7c7eb0e40805711b4 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 15 May 2018 18:33:01 +0200 Subject: [PATCH 09/62] - Removed place holders where not needed - Added public/js/AjaxLib.js to perform Ajax calls via JS - Added public/css/AjaxLib.css to configure the veil used in AjaxLib via CSS - Added public/images/loader.gif to be used with the veil in AjaxLib - Added to FHC-Header the possibility to include the AjaxLib (ajaxlib = true) --- application/views/templates/FHC-Header.php | 27 +- public/css/.placeholder | 0 public/css/AjaxLib.css | 14 + public/images/.placeholder | 0 public/images/loader.gif | Bin 0 -> 17490 bytes public/js/AjaxLib.js | 449 +++++++++++++++++++++ public/js/bootstrapper.js | 10 +- 7 files changed, 484 insertions(+), 16 deletions(-) delete mode 100644 public/css/.placeholder create mode 100644 public/css/AjaxLib.css delete mode 100644 public/images/.placeholder create mode 100644 public/images/loader.gif create mode 100644 public/js/AjaxLib.js diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 52ed50dbd..853eb8de7 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -2,7 +2,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -// Retrives the URL path of the called controller + controller method +// Retrives the URL path of the called controller + called controller method // NOTE: placed here because it doesn't work inside functions $calledPath = $this->router->directory.$this->router->class; $calledMethod = $this->router->method; @@ -15,6 +15,7 @@ $customJSs = isset($customJSs) ? $customJSs : null; // By default set the parameters to false $jquery = isset($jquery) ? $jquery : false; $jqueryui = isset($jqueryui) ? $jqueryui : false; +$ajaxlib = isset($ajaxlib) ? $ajaxlib : false; $bootstrap = isset($bootstrap) ? $bootstrap : false; $fontawesome = isset($fontawesome) ? $fontawesome : false; $tablesorter = isset($tablesorter) ? $tablesorter : false; @@ -141,12 +142,15 @@ function _generateAddonsJSsInclude($calledFrom) // jQuery UI CSS if ($jqueryui === true) _generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); - // bootstrap CSS + // Bootstrap CSS if ($bootstrap === true) _generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css'); - // font awesome CSS + // Font Awesome CSS if ($fontawesome === true) _generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); + // AjaxLib CSS + if ($ajaxlib === true) _generateCSSsInclude('public/css/AjaxLib.css'); + // Table sorter CSS if ($tablesorter === true) { @@ -154,7 +158,7 @@ function _generateAddonsJSsInclude($calledFrom) _generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } - // sb admin template CSS + // SB Admin 2 template CSS if ($sbadmintemplate === true) { _generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css'); @@ -164,10 +168,11 @@ function _generateAddonsJSsInclude($calledFrom) // Eventually required CSS _generateCSSsInclude($customCSSs); // Eventually required CSS + // -------------------------------------------------------------------------------------------------------- // Javascripts - // Generates the global object to pass useful parms to the other javascripts + // Generates the global object to pass useful parameters to other javascripts // NOTE: must be called before any other JS include _generateJSDataStorageObject($calledPath, $calledMethod); @@ -178,11 +183,13 @@ function _generateAddonsJSsInclude($calledFrom) if ($jqueryui === true) { _generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js'); - //datepicker german language file - _generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); + _generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file } - // bootstrap JS + // AjaxLib JS + if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js'); + + // Bootstrap JS if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); // Table sorter JS @@ -193,10 +200,10 @@ function _generateAddonsJSsInclude($calledFrom) _generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } - //tinymce JS + // Tinymce JS if($tinymce === true) _generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js') ; - // sb admin template JS + // SB Admin 2 template JS if ($sbadmintemplate === true) { _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js'); diff --git a/public/css/.placeholder b/public/css/.placeholder deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/css/AjaxLib.css b/public/css/AjaxLib.css new file mode 100644 index 000000000..d80ab95a6 --- /dev/null +++ b/public/css/AjaxLib.css @@ -0,0 +1,14 @@ +.veil { + position: absolute; + top: 0; + left: 0; + height: 98%; + width: 99%; + background-color: white; + border-width: 1px; + border-style: solid; + border-color: black; + background-image: url("/public/imgages/loader.gif"); + background-repeat: no-repeat; + background-position: center; +} diff --git a/public/images/.placeholder b/public/images/.placeholder deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/images/loader.gif b/public/images/loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..a718bd89be7fe9716a503b979ee99eb59c2e49cb GIT binary patch literal 17490 zcmb5VXHb(1yZwEqk_1pdx~QRtrgUjyK%|2x9RcYb1O%j$gcf@5E%YkADnh7I1W`na zbZJrq8=@lo*?T|dJ^P&V>CMN?B$Ju^X5H&r*Sb{Hl%=FCJ3ySEZvb$5db+u}IX*t# z)z#J5*qEK29UmW0AP~I0y&WALjg5`(-o2}!pm5{H4QXj<2?>c45E%IX^J4!Ag~HB0 zz}vo7~ge*FP}$VrY0|^yS$2tBKcdCf`oIo1U4Sdq2OhxU{^o z`eAK-V{_}{_Rj9!r~QM^U%r0(e)!|)=da(#e@;#T2#QU$p41bHxWI2ZRA1N^NyDk0 ztJ+XB5W_6yG(Xf({2~E;E1FHMv1B*}bD~>iI^0+~njvgGlB?EKHkKpxXnTIRsr*#| zHWYP9y}9D`br6`%m79zO!*pnAjQsg=pbDb~9vZB-9so7&Q@k`GL2uMx)seoZ1PGZx zooSI63({3ksZjn?1`Wwiq%s7UQdtK#fP3yheZ(NXOkREgKPbZBj9dr6tC7!>oJKt{cu?x@1C~w?D*k5MQ%rh^0>J6RIpqj{+8hChc(8KAVy-11wiho!~ zLzb`Jy#VrMTEe}YVp0Zjj89(Vp+F@OQ=pGYiDVr8RZ;=|!Myzf=vxOb0D@A{up^;* zMk|iYK9=T=oEyT0QIOuWRi>wDK0x#h1YjM0X`DC!Y+Ta8Cdj0=f4~X-^1Tg!#f_Cf zD(8sB$)Q*l?m*ppEW~(2LPkk?AasJ;*Fr{N?E*#Y&j(p5auf?0>h6B)SuTeY7G}PR zD)w}6(+-O~MWeJ$(ye>1H{(OVtWdL1I+O4;hWPR=8ZC*rt$a0c<^piIwmP&peS^=D zK@)|mESCwJb116##9mS5+c?MXQ9mdnfF|{3uRrnCGuf%^989V%Er#dhR1L5OxD*fb zU)%s-O0q!x_=$n@UdxPK^2p@P&=kl5HSmtG_V z`@6By?JG%go;yQ@^SQVZel58B@0ugUwqkBd2Ie|rrf z@3$@`&R5i%pS-Uny_pxOE%i~>VO(lk6Cp3NBb}N}zuP?R_Is~=v-bC=&L5wC?~^I6 z9Ut^FJv{zA#9Md#<>mGL3pPv+nfd_{aX~DL_R6C{)Q{)&m?ulLTfOBEw}4@HDX` zD6eV{%H)8+Ol5&MQ?CCgm|#6%1(*T%f&V2}!YovS9?VKK`+;@mh+*!Tn4@@ABm9si zo7ZrKmy(0z`ANZh7A>qTx*)tTu9eEHnq`-BX7M^mAhDHhrVC4b?zF7kTQk^KBp}fJ zaR^=$9wzG+8R^W8i%|@Xf0UGzDVlyODoY5Qlf+L^fb=X9N-T9x;er$x34p*52)IGF zwobB>vm&O4ql9v37(So^>8|GoDR@KpVZ$@Sg}R_ul5wpL28e15e0Ga6Pc5QuN@!dO z0ecDk_;G*!)$%pa$x9CKyhaAFe9pd(>Q}oY&4MH!;=ItKR1*7Bs0)}zSdYYZ8PE7y z`pXLx4wtxfLZ2?@NyjajCJ=!0iW0Odix#Jy@v=#<>ym~b=+X7gyp*}@-cM;vNR^WX z%394-m2WEb%g+~&pg!J(O;#H`bGoFkxp;vIM6SA&!*RJ03hzJBp)|Pqp6kI!$#DPc z(TmlAzd44huh&~#0iVc(`}xMNmc`wlXSFu$2L@ti!H(oCu~3K)GBPfgpuIVn=d7lm zV_c1WTYr&WNrcmIr-9Pyg@IOfBxvDj(_uQ5=?}t+EQ)^GjOAw(bkw@;Q9MDxYev1Y zsr}r=VjsqL9goLPZos@g=ay$&DP#)@-PnP&-|Pw=c=)+@Cu1lm@A@n$b%Alpd2~#9 zm>F?zlyS-L=}&u20!=T|tX;VXb{xs7fGEV(Mk%~K&#GLpM9J5;bSOP0oOggUmY^wMgU>FhF1WeneEIcW1y=Gdzrt!BG#tlD9{^RtXooiYbQ%OWQN209kN-tvo%VRMb*tx_Fq_>k}Wjr1wNsAOWr7p%Os6fG_TcgSWND! zqY*Q3gG~il26`$7@g4!Ousj#fSm3J5Nc8&++rLsJ_xVWa6R#-@2`-dSeD`z~6R% z?0c`Wi%!(#$n$NWFl-ZU>P>`kufl8uu-c?c&uiipAyQoKcQM3INgrJT#&e#mLxpD( zl>iXrX-SE~#A=TMlz!V(ObpIWykt!^p{8f~G@mp0jRw5BVlrJ!!~a$#N4aj1UQ)WM z?=lvord7u{B{LjrRHQQuX7M+$H)+wFdm8@x&L^#>>NWYW7$yT*Hv6VS?lcP!1WrkV zklab#T&{{ZuOZ)wHd8DLypkg<+|gvy16VyD7@ci$oXEDN5+2L$*?P-K-z@2RzBLYL z(z@oG_Y~_ksp49IJ$NtXw8BMXDhOoq`?8*rAWN})@z=`oq@j_@OW78et(K;0BkJd} zyKlOiy4I}BcktiVP1@aibmRbV(v53FE^b{RFIH)Fm~EpA50*l*Y_pgs1t?CY^WDMX zTUUGz)6fNBP#vQcN#?Hl6)IYvBa-VM%OiGbc1bA?PrhGmMUSqv&`iegzH|5xC$&-W zAztoqtN70DYvR1WDgDo4joUoK14$g1%96xv>B_YvCG|>6=^~_IY3fblMyaboCDCYZrskC=+KB+YLKdc)6i&Yu8V)b9f zao++h zZiv3@UDHEq`iWCG?6IGAK%l%Q?vW3lZ&*a6sAP0VqF$J^TM{uf1i}x_lp^Ga=Y_;# z;vb}!@|Sy6@|uM;HbIrVpWLgD5eAz-DB*`82VV^K-EV*H$Pa=UP!znP7@9^>JX5<> zKhh0_!JuakznK~M!5G?dou3$R-6;3ktzmv^2*>K17Il+*089e z!mdPa@ETim3NKZ`7aIh(`r9o^i;vpz?ZaLet#XCRbBXFj{JJ%f>HcF##-*7;+a=oO7Gx$#1K1}3p^|jIwLXcK@Ak7XRAdH_{$#FtFi57-(bD70X2H#NkM{&3?Ro7(LGUX-@sWd_`YUNF=IQ_vo+5-P zO6w8pG4eywym>jh?Q4&8cRTEIgrUp438t61Fa*^RA+tD$?_LF{Kq{GMVMj*6r=o`4;tRn%2c==ZdF{{7x$D|FR(ei1fd~ zSBK-b&%o~nS+e=EzYN^(gXHQMIsAzqVzC^OV~!oJNab>nq@1j2ws2K!c}>P)83Xn4 zZYe-I9qOR{T!kI$+;E$zysyyCEngM?08d%|5S$c29uyw#!ml4qVH7I|NeH*+xgH&q zp`INO$)|vOd^S0Gl=7K+*Ybh=p}EFkHI2OSPNZZCWN#nEvwPqg4^c?IQX4m{?@eEl z#W1W}{t@mF)w3DRpZqR!TzFi10crXI!r zy=>-+TAS#NYAvDrEX~U_?P?ky=W0<*TMIc@E1avqSQmqWXWh#4LpZO3d;4dCUUUMp z`|gp0jce*9f%br(*o~2l0L;<+kV_!EhWwt))edIRU zseu@JE`1a;T!+7SEeZP_BtD818_)F($L&l@+m8iEDHs7E4c627-m#|LtCJ}Sd0jzX zZ}%p4}YreS-&_{JpDeA#cV-llY2Y8=>MC(p&o!xNw#CX|IC)pxKkU9_ zqzc2?MB8x|+)@n2PM3Vz0fGy=j#X6RXC`vAK+%joNI1R1)Sds`kY&tQJ`!gn@_?6+ zaMOUfBoRq(yz)qqm1Gl2W5>=(1(q9LP8E>)p31Mp=vTsM;#4^T+#wiQWODfHt;IPM zX4zr1-!a=VyLA~)5iapt*q!&DV;KQrMJmXkC9T)I=^5YoxPlz6MrUWnEAxLWNsV9x z|7A2_Fn|USY&CV>9m;?4E<)Gq_Z{l#!K7E2FfZ+^6YT7~Vw3bMlGNS;Va<^s54 zvf2~Hu!&9bh%H^?grlMH1u7`W0|i8&1~oy2N(k}yucX=9Z_k>6eU<$KZan0>cU7C9 z6c#Q5#PbI6#l)s2XkClqe-ImzB^((Y9h+RppP620t5whq7dY|_cC|`1Y;oloMmq~)ur@M=3SB!4-E6`nUN|m5W$uO3>nqW zp>TF5aH<(bx*Sk&U3P`ZEZxOnw?4O@m6b$t2jr*48moO0FS&@zB@Y(SdWV7Ya-^S3%TS+~l@x^#ZU-fm77Nk62Yh+~Q>o}2LHzUWxH)Zwr+ zh&gDhCy)uUERwMjB6008rySUABPf0-R^SB|*KwdcmLPj70kGz5byKKE$_r&QZ`0=* z3mhHK_1n(IIYV%Q{+_N%HIGgsuMHHI8h(9|FC){GL?>6vRae zgwZ+R0tmDd7NNaqa2)soqc7SQY%^mK{7`L+9Zz($BNL%-Bb>!kUK))Jmz* zoIz+s0u6BeDhUYNSL?Tm5&s3)7&8|geemP(B3i{OM69iap|HsQBvb0y0<&MzHhmfh zB|NvErh&+YyS+)fqU%4J`d>WSobhP>FCI~#USR~D|15>?dpg*))bHo+E#>4D zjK%x=h{7I4ia(5Uj}MDUkVs1Q6a$6JNdhLpS=p(WJYGl{k06Yqj^c)^Mm97^R1hi) zgM^mX*7rcGRlzL^z_28|XN)4wP&&EG6*@j{cK40n+XtZO=>=8LAoN=QgLlhgkc>|p zz{{PU{Qbwk*D?6kq0Z6I`or%5T<0yG;|Qe}uH(QLf3eh0C^ItCxnergwP2J? z=rNmIc9I1)g6{-dC3l@JqX7(a`7H3-%62Hd*rhf%N=%hG4?Xam{@w+Ly25jDPqD08 zmHcG}(R1{u?=MtxII7EQp19KgmpqQ4KHC&l)!Im8tcv250}e7aaiTxZpu6b@A$BgVUM3E zBx3RUpC_gbefEw?%NEp&2j~YEk^u{SCXTImk(UP?eW2@zqX9MqT|EwhDVxC&dG(~0 zIOBe%t;X_QoiLV@n0egK?*?<{h{MXbbAq!Rw<5s`JW+J={7N?ANi_6{HpwVbA|#0$ zO?sE2axBH2NIOU|bQduuPR>vxNTo)=Ni1t%O?DzKN5LFXEGo{0P2;A=u&8^3}|A|-4vXJ89Dww#38=k*iH^i;K z)vpMF5PU6S7g~E8e=spVLmJGm#Oc=g?X|s+&z}7GSVYp_Uqr!63NP;$X5}G4gh8Tj z#Q7)iMLL}2t!|lo!M8}c*YXR*vZZf}f=uAfu=l>*@5;SSX?>sJ8$%@7P<3kJV6fBk-Fb>{Ai^{&w^{Ps?#*{A)_&%b_ies)OF z^Yaeq=#tcreN|Av5lS@19*2%%M8VRW9Vl~eN5WjWsu}uT@uig0pQDB!3iV+~k~_D?1aiNK(tKB;6 zghr7FgmP11F5iJERak~0*A#IfyB&|n5nQ4q>{ZzEW|ks6)o3;9X+;K>xCLDO9&PMbnn8jcET^e|g4v~5zmo*=x}PNCVkrBO*}#}WMP7kl(S`qE5&q)U>|c`1 z4|e%`zN^3z`)U5-6`!NF{EH=_-XfalBBKUaI{m1*Tv>&0;isX3;#V~QPGZ}QeT%Wd zcx(G_nq#%2L)V&)4fjK=-7xn8#Jz%@@w|7jVUCgBQM|r{v;6?^F~K8^KO!;-qt2!2 z4l;+9IDj&ob1*=eg*XTXZ*7B;RDhb4IB;7}E9|LCLRT25cNA8u4CD_Ow2bzec-Dg~ zb2&z)ddKGH$xFR&R<$APy+d0L+dFN0pA6PM!#BUZ`T<}06#)G-_WK7EXnE*wC&lT| zi|!5AsduqH0?#QxD$w!7)P$neD3q>4$7CcQ#n8qpAnV)EK$sZU5mEJGCI$KrmOci3o zGJKRRiKMRAxYOub4aONWJAAwseOLcs8}p+-W#p&#-1F)6sJ}`qH#5)YC?^r#RvsCz zkA4fY3KsDED)5RV;CT5nb6Ff1CR$d~naTvd5T%-d`t^*=WV|5RaodV-iXA4R{q?=h0*cU z>rf6z5P(R!%R_Vkm->v^ePkJeImAdHXW4kR6xgt?EGp3*|m@hU(=kq-Pj9^Qoy#DWDs|m0LjLtH#|IT|^5l|6? z<5?nhw|YjpYBih1&BzwKMphs@v(8opDn2@!ZEh$v2ivD7B`%41qmc+XQqki z-vqdA=hZmDR5iJNB;0Vu zD~D}y+*cJ)o=n#FTy_96k;4(fTKdt`A+}VePdW{hR`#}%uWGzA`g_>DCtAnJxrDJ&m4PKm?W zj3!9!V8}Cj`U4>oA)1MSVikMr{c+EYoV?%6WbD(&ABOLK8?2SCIS*Rs4l$fSi2sDv zL1+x?PO!x@GkX{Lu-&I34o6dZ363+M$lky|L4$^7NSNUAa_G5ihCc5$$4Di@HzATD zn8v3a2i{1sAiGk2iC_;ZaNjD7Jcxa4LXgA zk(4MMYjXRVQG)tg^Q0PsQP~gYh94C8?p0-ZZ+Qv5ygUhisAwu*UH5}m!&Ey^(knPj zR97!tJ~CJ`Mh1e5<0o3(5R`^QrAuVG78pTbWw$*OoQpZYWp#D=I#rF~we{_37S>N6 zfZEB>n&MJ&drP0;V9#*eXnXHi;H&!AZycd-%ao@b+ulB3z|OvUw`$lu>c3gJHnqZK zysNHTq;CA>Yvs|=FUR9Q$HpLLon=A7PbwaTBSlO4h;vuKu~PNuftYDlt3Zx^oC;(| z@&tX*Py%w}IB}*Ic6?*1&cJ1yt#s(A1Y`+PzU>T4;qHtR2?#DR7OT*KC_P|h$QCcf z6<-Ol>O|^qj?-({N{x79c_K`zRmr^NS=T;rx{%>&DL!l zi=C;Q0La%geo->0hd@m;=*#S3)edEoJsdR>wSu@ojC?w!VDS(XJs0+u8riNt?+(2Y znbhJ8N9l}+1j)E>`y$PE++4kVT;E&J?_Q42diC%*MKT-nxM^$S2O9+u`&ukg8muL8 z+9hQ5^V^CV40le;T;Urn#7S4V=hyE~s~A*jK^=gv{gysW;dxU|0rm6Sn0*1N8*KnQ zzITw&cHi3$#*7Zkp9)2rqqYZ0$Pdy|OJOQ{M<$*;2+~UE0%DUL@;nJxCVut4MUJA{ zwFF|mc_6}~P>QOG5#kYcAI?McDgdf-`*@`dAK>H707o_LqAA4gd0x?BSz>%^9h1e663MyBEWSh zR4G0gmq`Q4EiFyEL*lG(EUSgaISA1-xB+#wkfLWa;P%>@P8~>hS$J>6z~E5)Na>50 z5BtZ@q<0+pE@HBKYR*Ev8`82=*;NZ(6E@ynZw96AC2@cGq!Rc2@YipFWJDT!ifz%f>>`&pNcV!AUG=8 zab$~G)+o`Iq$odbv&s##w&)2hR$(&LB&u^oft8cggX%3R6mq7hG#C7v*Aze+1*?4I zmYONTc~0%)3nZ6W*v(N9@g%bAY`yUNx%H<2Zx|?GbdaG!;^1A=mGjJt+YGiV1F9Dj zxB%mAix7W-AM4j2E9(uxzrpw{$XL9GE&t8-W94Dc1q#d{7GSB909rN3(X?3n3iObx z0LvEMx-kD5+!^74{eXLQ@4^f{58G{T1t=ApFc#;11sJtvwvY~mDNW{64RBu*?;-p+ zU}8Qv*LchT-2Sj*DE!CVcVo8@R}c*Cnl7Ln%G-5cI1i;aB7wj4xG!T2pv$Dt!eR6< z0Inz8r;=58y&MiJqQioaB^76neP|*(>Vw(JG7?3nQ)O&nPn-JljN|T1R@mTG7j`9$eF5E!=oSv zR$l_(av8}Z`l>Js%L#p3`2l1*LgYyg`c=sR#w)Ve#`dvPt%l4Ygt}P3j6h#T~tjO{4={ecV zuz$t8|KR_BHq8eth-R98-`XbcYrAB$+eS4qK~=Bev4%`SKlh#*wb7G?iq!2+f6F;; zrjJ71y@>j)OaBoP(K`5DtrtZs=ZBZvD^n5hKjkW~*FdJN)9c?q3L&cc6 zHW*zXM`Ubmt{M>W*G!EYFiHZ23XSxz z+aiVX3w3m-pF6}a{%h?eCBS`ioOUfj1dv|4I^7_9b9qSCix<&f{h+gmCgxLT%!i6f zb2)>{FdD9z5Zu$X*^@mTlc3d)_g)1fILcJnC>w1D^JzZP63uKt%!$k4zlSNXcfuI3 zWFH}6-oi)cqji7?W~b>`A}7kQ2*4Con2MlVF!LsigG6?s9*u>yyLKUoGn$(~hxO$g zpP5Kxh9jaAg!m8C0ZsD?E@26EBd#=kj;#_t3UCc zFoGVp5n&h1XOOn0FAfIXI{dha0H^vD=2LjkpHC3}2i*VCZM*+(iTsaln}G2%RcE^0 z{44qKlYO~@AAdKxiU7%C&oFw4nC|s2(y{7kdPax*3%}Ye(yrT5hrY03n-jeM6>x7g zji*X|_UJv1tNr4Foo%q6DJXz9GVBo$#S4y3#6WOKilH>AY1oXc?1#cB`4$O|MW(UI zd1bN@JaN^A05}o?uByM`?$Q3g8(kuTKA^VIMkp6F_hshW_!*Hp?vi=l>6KcM7El?XB5`1FqdAzNaG@t56Cg3JF)dRL#4}RtBb|G+Y2)6)gum9)Oz=*=DC4vg;kO{w;K8jn%z0U8fgHeQY(xk<%&!e| z8v}>}kFRn^Up>Djaf?*9f)lg3WRb0d$2VioUop@Zz@hkTmbAKr&{hqiwo^|8l$dG zSL#DEkot)f=865Dk3B^zx*>!+U0k4KoRpuD`u?*-XkNTl&spXe^OSrjbfVgJAhTHTA#I{3io*`cDStj-GGR z*blt&UMhE7Meq|&A=hJAk2|HWEcGXqa`_lzj3I+n`P{n(fg|<4RkI&XJVldYC2eDY z5B4@twfO#fYAC_zb8v3UGAo84d+mY&VA!u+JVK zjauhBzNXWqauexpS1CK*E#u1D?nJiq1C_#+2A4b-oL@c>hWf4}4+mzjP!ux;o9?Jx z=>ldm!nS=PK~%t^Jw<(O>;F0b>!upn<@x^m+H% zjs8m_x+hf37wu?^)uttaWLmbLmEZOaevbCC1~-3nvi3=rL{hYVTO8V(-#=eHl96gq*0oQC9=qIv>WQV*YGmCV9>|@{U#K@m8)a zw!oVNeC9q}cx)PcjS9Djr&t~Nt^$BLR4mjH%EZMGC2?OiMtL>NN~j2y7acBwAQeW` zw7f<$!ec8|Lc&|VgG0Y~_!6R7%`;R%$Di%VA(!2LgcHS;jfy0t8U4rs+G`ULcm)nA z8xCdGjztVsGAkb?rEFXhYi#640`Z-VYe}m41YE{)sW3THxi+ORt;lAWC&X0J1D9qS zkKW8hZBLcN`F|OHaKp0_fiWb!p`!uW%lv#$q-$491pJ;z^JacKn=y0IiY@j@c?J^Z z@o=T=kBGzx+P?#{zst3PwZQ*|`|l=gJ2yT&y4G`>RPSE`xTUtlzE=xJnH8_^AET$l$Xd`a!`DaXO)H{^7SH zU85dAppf`zLU0NO1Vd5f<|1Ly+_BfdlzHX3DDOfb&F?C-qA|C+ur^Ex()6sQ)kY}i zStGJWx}moTGH@L^)I>2VIo?G1S{OXpl<|&dX13z}JQrwbc~xjV549f z`4`OC(!>v$p7EVyBdBn=rb4@w3!I9~{Q)Nop)gk9z$O(v_khu5njG*I^+%&QVV#Vk zYXeCtC+g`+d^)zO2_RTI6q)h>m&M?`_$(>~&|nm`&!WZIgEi=woYI>+Xxg`cdTq^Xc*b^9om zb#JtmWx3IaIAF6g-Wd)!sg1&S)BpIdxzEN*T*bo-#5Z*7KG!eOeScM}#bh zw#-d@Se#qk5&FNGzvCBl8VF3H z1(X1m4f&&_s?3N2i}tL&|Ixn?<9l6!mAE2aJ;9>3Zk*OIwS!3Dt;q_fdHdP~v18Z# zT$*X~ezVOY7%Th%t0&iG^Y*#)Vfd0U2%`+WuLlEn-unf+ppxB@*~`rL*X<(V7`f(6f2=1aMBVYvebPg^rGF}OcY(PFDcC2 zg*b&gmpydF--^Z_FbA~{U5S1`@2N;Qm>n`FKB5{(44I*|;7oW)wZ@UiJaxn#e;uX+ zglW>1(SnS+%9Z|=cGaC}qY3ceotfyfstlYq_pdDB#s&4_{jtw;WD*T=ndKstqA=Oz zTtRQYhY28AH?g}bym!vYu*S!f)$19hd#0LOOvz@YXRF<_7x=S3r26!ev7Nt)V~{1z z8WyS>;^jj$j*d}|OHAj2rYL9Ra)YyF!}E$MN!0qqm^8QK?CL~kBB(TlqB59R5QAz9 zt~1HQ73o=DBH46S}psP6HCFh_5KN5+6KX`v@K|+dhdxsJUURP|F zfbV|at~iivkboVYJo+h!JW!c1A@d>;znZ*hCa~crRFciF&llamU3j6?WOV+4vd~58 z+OJ2ns2fR~CmKA89p{SG9|=yW1tK}QR3PFlP#v_Vk+ucL@Sm58KoPj`maT&TEqUXq zlUf>z8S71!W#&UUc+=`TPSru|e8NG8J5vpJz^Q-u8TW{l&XxJzlw5989bV4lxR~qL zE5>6WY_OA60 z!4reEKb@d^q!tZ3+a7IITM@Z{*{4@TVX^GFr> zL)xyb%YyvEJ~-?5T&kpC5vt|oa6ui1aKak9A`pRga_9q4tnE-DdRsD@K&-)WM69qY zS_RA}y?z_RTs1=hx}T-0XyX~>+Z!om<)CF?!i`+fP-6VJEC#~xttWF!d@MOHrYT*T z=&I+#Z7qf=D@_*Zee@xXt4Fdd)il|XJN{M8@P@|KRUNT!_}@Us_mJTBf1S;|P$(3Z z%BMLi&~*23sJv~!4RO^A3o$Pt^j^)DD#R&OP|IUwrwH|-( zy1a3eO!}m^b_xUpDh12tTbTtJp^rQBshkM}*Mu5KvyeOG;>ZZhomV$jv^{ zuk?uv2>H+h_oUWE(-2kM+*05Pf>NN)CZ)Sc&$}{Whx6pgu-6c$QPJTWAb8*VKG@r- ztIuyhknXY_pZ;bvEuBX~C*-+={I-7*(pzOmi zqh?o#Ws3|BXV$7S#xDV)!Y_3rjt8h81ND} ziV~)P*}_Ebms=%)^t6DrkAb;bsf>vU#yrE2P*Q}4lBY^CbT<0Z9+@j!7b`n6&RU(7 z0ev?u_~iU-Yv}j14kf0D@pvkJyw1pfskY{#Zb#m?IF5 zbhoISih&pAW4?Nk-c%dXdQCZf;GAg!4a&HLeW-sbNQ?||S35zgbxr%E)f14k;!8Pu7aqQUuc*_7Oub)#BdiPW}K#Dcgs=#3+mQ2Y>L#1uElc9kX~V1agoddhkMv(*0?DhMik2jeRbJ_>q>{JD!G|_c&eJ287_D zz>w}FCtC#aANx7v5-u~{D)=MkUv73W$tSeb<5SvV@|MS3Z;?)iLIvU~W&=~6lpK0L z9zrxJ&Z-$#-zkh5H@J{{ZRTlOzWBf6hJVQar^4`Gal_wD-D+s>eC)lyT8lL;j*BRrT&b73yUc}2m$PG`%Pk|oN}?(n1)eE%jw1v?2duOopyvfz(+*B9ZR03W z5I%i>Eu$c@5IjDNS2I#8S`-==hw|lcPQINg4D!stKj4O+T{&J&FUF&IBPyh;uEsvW zIdX#>~I(OkjygRB1ikX-g?<7)EP|*Oi zXSa>NWC*E7#hL^N^h7ECSOmZiXCM%@nu^P%W1@j}{FQ!R%QW*&Ob?r9&u^X2zvXH! z{;L=JCZ{xW(AU4I;%%kg1C!^!6dm5Bm}UeDU661=fvhhai#roE4InO-q_HZ|tGJF^ z)^l;RWTDqj15^+gcam^6nbW8qJAbRedhmozAmUiD(Po5S@aABw;#Zq-Ub$=V=ZfMV zC$jGpckO}?rp6Qy7tPg8aQNPK>Syr+=(hb{XOB)m@nt6`j_R4J^yh8p8`1;8(={j#n;GdmWV({OCn`XE_zZXtjm0k&v|D3W_ zDuZzV3PT8iu2$Gv5MZdG<&c7U8j|$+xfc(dq0o{Q&mi;=i6hhz!x7Xa=euIeS>|gM zh~!VUir#&_x)Sy_H*RjfLC&w>L4AD_hl6D#QegV5Pot_TSS zhAYx-O^K*0LeI`}7l(}Agac{9v}_i$_XZL&h3(&+tw8NxM#x$p^{a_(A;7n+lf|=( zu=g^tSyfv<#clN}F}Vh}{TQmFK=T~-(VSB>R#W44q<2ARr0v~Gx zn*7*hvHMsU1)o=}Un%lAf04&U_p`-d7@Kt%o3W_vg=AV@pTOA{E8{9)Dva(jm4g$z zZj783ti)*w&hjkyiNC8kvDwktPDb{z(|eDg&9Ypbqn**g1l>@Phy>7M+)Zl968^e33xCiC-y z^M^k#3^JE+hhp-t{YiU#7l%x4MGH}%BlbGbDm$#4i@B6(89^TS{yLI%o0|;$NE7FX zDq-+m1%wCN3mF9(Rqs+>8?3Na5uGtowv>TKS*ggUM-(S2_~?CzyozR7i`BI_vb?Lk zjaa7-xUC9U>5mxc`afIW;tDqF%E)j~%|;d^I?*vMrSbiHweZ*V<$twt{#h;XgTZ&1 z2WTqJj>V4V!#v3N*oWkrb62)shXoAQ#Qo;P&Xr3LkW0ZDW1w7JLWU-FwLSYhr3E>phdhrE3?#RA`!{ zWisHv!H5uVBdd!++m3;mOh=9zt{;hMidgqixrFHxLg_`U`YU{_9#>K4yU|~Xn860Cyd!roc?68G@=ij1)#xmyLvQzN;M z*T7j^zP3V@ioh3IAR^^4qH+;1wDn6%(!$c_)$0yGW0es0t1SQQo#`7r4y5Qh^h85T<|QJ z!d&ixC_`S&5=1#)N~KpiZwbnY4-AV#Az)?L#wPm~9%xn_28^T{e>INik?((0jVTVD zgib8H%8`dp*)12jBG(~{J5=l9kPjmo&ui+Y*)j-A}6yF(2*&qW|72xhMgn8L6di)EC@&o9QBSw>WE z1AXZ1>Ahv&571%XmM4%wyScFsl0bWQZfx`3`e6Zgy=*VAP<>-Rorcs%2ErUq%^7mJ8?4F@EYt4C%+WS{ z8doU(UjQKi-u}MqqiSWboMi;?t9Wy08v-6jK21XaX~3&l*AU3G0BG4iV&mS;ySMM( zz=I1PPQ1AB_^Z3TR(Z~^_|BbaPWyYUvL4+poiZwDY>BC76TRs;e-pGFd>B% zj&R|H8H%tWh8cbcVTW3X7~u@d5p`k`CQ6hN0WcD9pb{d&@m!2J@^#9FHsa_b0XiZ_ z*pE1_xEql^9yp?GNaE-obIcj3QIjw>2PKqJit%ETw_SPVX+t(iLyBIic-odf>PBXn qGe&}DjLofCrfe+4INfAyGS^|AFLWp;lq3ScW}qHoNvKvK0028J#nnsz literal 0 HcmV?d00001 diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js new file mode 100644 index 000000000..2ee8d458e --- /dev/null +++ b/public/js/AjaxLib.js @@ -0,0 +1,449 @@ +/** + * FH-Complete + * + * @package + * @author + * @copyright Copyright (c) 2016 fhcomplete.org + * @license GPLv3 + * @link https://fhcomplete.org + * @since Version 1.0.0 + */ + +//-------------------------------------------------------------------------------------------------------------------- +// Configs + +// To see debug messages into the browser console set this parameter as true +const DEBUG = false; + +// Default veil timeout (milliseconds) +const VEIL_TIMEOUT = 1000; + +//-------------------------------------------------------------------------------------------------------------------- +// Constants + +// Success +const SUCCESS = 0; + +// Properties present in a response +const CODE = "error"; +const RESPONSE = "retval"; + +// HTTP method parameters +const HTTP_GET_METHOD = "GET"; +const HTTP_POST_METHOD = "POST"; + +const REMOTE_CONTROLLER = "remoteController"; + +const FHC_CONTROLLER_ID = "fhc_controller_id"; + +/** + * Definition and initialization of object FHC_Ajax_Client + */ +var FHC_Ajax_Client = { + //------------------------------------------------------------------------------------------------------------------ + // Properties + + _veilCallersCounter: 0, // count the number of callers that want to activate the veil + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Performs a call using the HTTP GET method + * controllerParameters is an object + * ajaxCallParameters is an object + */ + ajaxCallGet: function(remoteController, controllerParameters, ajaxCallParameters) { + FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_GET_METHOD, ajaxCallParameters); + }, + + /** + * Performs a call using the HTTP POST method + * controllerParameters is an object + * ajaxCallParameters is an object + */ + ajaxCallPost: function(remoteController, controllerParameters, ajaxCallParameters) { + FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_POST_METHOD, ajaxCallParameters); + }, + + /** + * Checks if the response is a success + */ + isSuccess: function(response) { + var isSuccess = false; + + if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE) && response.hasOwnProperty(RESPONSE)) + { + if (response.error == SUCCESS) + { + isSuccess = true; + } + } + + return isSuccess; + }, + + /** + * Checks if the response is an error + */ + isError: function(response) { + return !FHC_Ajax_Client.isSuccess(response); + }, + + /** + * Checks if the response has data + */ + hasData: function(response) { + var hasData = false; + + if (FHC_Ajax_Client.isSuccess(response)) + { + if ((jQuery.type(response.retval) == "object" && !jQuery.isEmptyObject(response.retval)) + || (jQuery.isArray(response.retval) && response.retval.length > 0) + || (jQuery.type(response.retval) == "string" && response.retval.trim() != "") + || jQuery.type(response.retval) == "number") + { + hasData = true; + } + } + + return hasData; + }, + + /** + * Retrives data from response object + */ + getData: function(response) { + var data = null; + + if (FHC_Ajax_Client.hasData(response)) + { + data = response.retval; + } + + return data; + }, + + /** + * Retrives code from response object + */ + getCode: function(response) { + var code = 1; // Generic error + + if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE)) + { + if (response.error == SUCCESS) + { + isSuccess = true; + } + } + + return code; + }, + + /** + * Show a veil + */ + showVeil: function(veilTimeout) { + if (typeof veilTimeout == "number") + { + FHC_Ajax_Client._veilTimeout = veilTimeout; + } + else + { + FHC_Ajax_Client._veilTimeout = VEIL_TIMEOUT; + } + FHC_Ajax_Client._showVeil(); + }, + + /** + * Hide a veil that was shown before + */ + hideVeil: function() { + FHC_Ajax_Client._hideVeil(); + }, + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Generate the router URI using the connection parameters + */ + _generateRouterURI: function(remoteController) { + var uri = null; + + // Checks if global JS object FHC_JS_DATA_STORAGE_OBJECT exists + if (typeof FHC_JS_DATA_STORAGE_OBJECT !== "undefined") + { + uri = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + remoteController; + } + + return uri; + }, + + /** + * Method to print debug info after a controller has been called + */ + _printDebug: function(parameters, response, errorThrown) { + + if (DEBUG === true) // If global const DEBUG is true, but really true! + { + // Print info about called controller + console.log("Called controller: " + parameters.remoteController); + console.log("Call parameters:"); // parameters given to this call + console.log(parameters); + + if (response != null) // if there is a response... + { + console.log("Controller Response:"); + console.log(response); // ...print it + } + if (errorThrown != null) // if there is a jQuery error... + { + console.log("jQuery error:"); + console.log(errorThrown); // ...print it + } + console.log("--------------------------------------------------------------------------------------------"); + } + }, + + /** + * Method to call if the ajax call has succeeded + */ + _onSuccess: function(response, textStatus, jqXHR) { + + FHC_Ajax_Client._printDebug(this._data, response); // debug time! + + // Call the success callback saved in _successCallback property + // NOTE: this is not referred to FHC_Ajax_Client but to the ajax object + this._successCallback(response); + }, + + /** + * Method to call if the ajax call has raised an error + */ + _onError: function(jqXHR, textStatus, errorThrown) { + + FHC_Ajax_Client._printDebug(this._data, null, errorThrown); // debug time! + + // Call the error callback saved in _errorCallback property + // NOTE: this is not referred to FHC_Ajax_Client but to the ajax object + this._errorCallback(jqXHR, textStatus, errorThrown); + }, + + /** + * Instantiate a new object and copy in it the properties from the parameter + */ + _cpObjProps: function(obj) { + var returnObj = {}; + + for (var prop in obj) + { + returnObj[prop] = obj[prop]; + } + + return returnObj; + }, + + /** + * Method to show the veil + */ + _showVeil: function() { + if (FHC_Ajax_Client._veilCallersCounter == 0) + { + $("
").appendTo('body'); + } + + FHC_Ajax_Client._veilCallersCounter++; + }, + + /** + * Method to hide the veil + */ + _hideVeil: function() { + window.setTimeout(function() { + if (FHC_Ajax_Client._veilCallersCounter >= 0) + { + if (FHC_Ajax_Client._veilCallersCounter > 0) + { + FHC_Ajax_Client._veilCallersCounter--; + } + + if (FHC_Ajax_Client._veilCallersCounter == 0) + { + $(".veil").remove(); + } + } + }, + this._veilTimeout); + }, + + /** + * Retrives parameters from URL query string (HTTP GET parameters) + */ + _getUrlParameter: function(sParam) { + var sPageURL = decodeURIComponent(window.location.search.substring(1)), + sURLVariables = sPageURL.split('&'), + sParameterName, + i; + + for (i = 0; i < sURLVariables.length; i++) + { + sParameterName = sURLVariables[i].split('='); + + if (sParameterName[0] === sParam) + { + return sParameterName[1]; + } + } + }, + + /** + * Checks call parameters, if they are present and are valid + * It generates and returns all the parameters needed to perform an ajax remote call + * NOTE: console.error is used here because those are not messages for the final user, + * but for the web interface developer + */ + _checkAndGenerateAjaxParams: function(remoteController, controllerParameters, type, ajaxCallParameters) { + + var valid = true; // by default they are ok (we want to trust you, please do not betray it) + + // Returned parameters + var ajaxParameters = { + cache: false, // data are never cached by the browser + dataType: "json", // always json! + type: type // set HTTP method, GET or POST + }; + + // remoteController must be a NON-empty string + if (typeof remoteController == "string" && remoteController.trim() != "") + { + // Is it possible to generate the URL + if ((url = FHC_Ajax_Client._generateRouterURI(remoteController)) != null) + { + ajaxParameters.url = url; + } + else // but it could fail + { + console.error("FHC_JS_DATA_STORAGE_OBJECT is not present"); + valid = false; + } + } + else // otherwise is NOT possible to generate the URL + { + console.error("Invalid remoteController parameter"); + valid = false; + } + + // controllerParameters must be an object + if (typeof controllerParameters == "object") + { + // Copy the properties of controllerParameters into a new object + var data = FHC_Ajax_Client._cpObjProps(controllerParameters); + // Remote controller + data[REMOTE_CONTROLLER] = remoteController; + // fhc_controller_id is given if present + data[FHC_CONTROLLER_ID] = FHC_Ajax_Client._getUrlParameter(FHC_CONTROLLER_ID); + + // Stores them into ajaxParameters + // NOTE: property data is not possible to get later, + // so the variable data is saved also in _data and it will be used later + ajaxParameters.data = data; + ajaxParameters._data = data; + } + else + { + console.error("Invalid controller parameters, must be an object"); + valid = false; + } + + + // Checks if ajaxCallParameters is an object + if (typeof ajaxCallParameters == "object") + { + // If present, errorCallback must be a function + if (ajaxCallParameters.hasOwnProperty("errorCallback")) + { + if (typeof ajaxCallParameters.errorCallback == "function") + { + ajaxParameters._errorCallback = ajaxCallParameters.errorCallback; // save as property the callback error + ajaxParameters.error = FHC_Ajax_Client._onError; // function to call if an error occurred + } + else + { + console.error("Invalid errorCallback, it must be a function"); + valid = false; + } + } + + // If present, successCallback must be a function + if (ajaxCallParameters.hasOwnProperty("successCallback")) + { + if (typeof ajaxCallParameters.successCallback == "function") + { + ajaxParameters._successCallback = ajaxCallParameters.successCallback; // save as property the callback success + ajaxParameters.success = FHC_Ajax_Client._onSuccess; // function to call if succeeded + } + else + { + console.error("Invalid successCallback, it must be a function"); + valid = false; + } + } + + // If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000 + if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number") + { + if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000) + { + ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout; + ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil; + ajaxParameters.complete = FHC_Ajax_Client._hideVeil; + } + else if(ajaxCallParameters.veilTimeout == 0) + { + // veil is disabled + } + else + { + console.error("Invalid veilTimeout parameter, must be a number >= 0 and <= 60000"); + valid = false; + } + } + else // is not present or the value is invalid + { + ajaxParameters._veilTimeout = VEIL_TIMEOUT; + ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil; + ajaxParameters.complete = FHC_Ajax_Client._hideVeil; + } + } + + if (valid === false) + { + ajaxParameters = null; + } + + return ajaxParameters; + }, + + /** + * Performs a call to the server were the CI PHP layer is running + * - remoteController: alias of the core controller to call + * - controllerParameters: parameters to give to the called controller + * - type: POST or GET HTTP method + * - ajaxCallParameters is an object and could contains: + * - errorCallback: function to call after an error has been raised + * - successCallback: function to call after succeeded + * - veilTimeout: veil timeout + */ + _ajaxCall: function(remoteController, controllerParameters, type, ajaxCallParameters) { + // Retrives the parameters for the ajax call + var ajaxParameters = FHC_Ajax_Client._checkAndGenerateAjaxParams(remoteController, controllerParameters, type, ajaxCallParameters); + + // Checks the given parameters if they are present and are valid + if (ajaxParameters != null) + { + $.ajax(ajaxParameters); // ajax call + } + } +}; diff --git a/public/js/bootstrapper.js b/public/js/bootstrapper.js index 8697e17ad..290749c11 100644 --- a/public/js/bootstrapper.js +++ b/public/js/bootstrapper.js @@ -1,10 +1,8 @@ -/* -file for adding bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page -AVOID USING THIS IF POSSIBLE +/** + * To add bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page + * NOTE: avoid using this if possible */ -$(document).ready( - function() - { +$(document).ready(function() { $("input[type=text], select").addClass("form-control"); $("button, input[type=button]").addClass("btn btn-default"); $("table").addClass("table-condensed"); From 748ab6fac3205eebace69a0a433d6c13d9cd3bf2 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 15 May 2018 19:19:29 +0200 Subject: [PATCH 10/62] Unique ID for each call to a controller - Added constant FHC_CONTROLLER_ID to FHC_Controller - Added private property _controllerId to FHC_Controller - Added protected method setControllerId to FHC_Controller - Added protected method getControllerId to FHC_Controller --- application/core/FHC_Controller.php | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index f6f138441..815c03da2 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -4,6 +4,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class FHC_Controller extends CI_Controller { + const FHC_CONTROLLER_ID = 'fhc_controller_id'; // name of the parameter used to identify uniquely a call to a controller + + private $_controllerId; // contains the unique identifier of a call to a controller + /** * Standard construct for all the controllers, loads the authentication system */ @@ -11,6 +15,8 @@ class FHC_Controller extends CI_Controller { parent::__construct(); + $this->_controllerId = null; // set _controllerId as null by default + $this->load->helper('fhcauth'); } @@ -23,4 +29,34 @@ class FHC_Controller extends CI_Controller { $this->load->library('PhrasesLib', array($categories, $language), 'p'); } + + /** + * Sets the unique id for the called controller + * NOTE: it is only working with HTTP GET request, not neeaded with POST + * because the first call to the controller is via HTTP GET, + * therefore a fhc_controller_id is already generated + */ + protected function setControllerId() + { + if ($_SERVER['REQUEST_METHOD'] === 'GET') + { + $this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID); + + if (!isset($this->_controllerId) || empty($this->_controllerId)) + { + $this->_controllerId = uniqid(); // generate a unique id + // Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter + header(sprintf('Location: %s?%s=%s', $_SERVER['REQUEST_URI'], self::FHC_CONTROLLER_ID, $this->_controllerId)); + exit; // terminate immediately the execution of this controller + } + } + } + + /** + * Return the value of the property _controllerId + */ + protected function getControllerId() + { + return $this->_controllerId; + } } From 087299cf8473b07a6872e8019e3f0b465187b4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 16 May 2018 08:48:37 +0200 Subject: [PATCH 11/62] Added Unoconv 0.6 switch because converting text documents to pdf fails --- application/libraries/DocumentLib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index 6def51ab5..ed87a9f38 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -57,6 +57,10 @@ class DocumentLib case 'application/vnd.ms-word': case 'application/vnd.oasis.opendocument.text': case 'text/plain': + // Unoconv Version 0.6 seems to fail on converting TXT Files + if ($this->unoconv_version == '0.6') + return error(); + $ret = $this->convert($filename, $outFile, 'pdf'); if(isSuccess($ret)) { @@ -64,7 +68,7 @@ class DocumentLib } else { - return $ret; + return error($ret->retval); } case 'application/pdf': return success($filename); From 024bb06b0f2e2cd4c15211852641ad0500208e1d Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 May 2018 11:52:37 +0200 Subject: [PATCH 12/62] improved currgeschaeftsjahrquery --- application/models/organisation/Geschaeftsjahr_model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/organisation/Geschaeftsjahr_model.php b/application/models/organisation/Geschaeftsjahr_model.php index e806058ae..9c856f40e 100644 --- a/application/models/organisation/Geschaeftsjahr_model.php +++ b/application/models/organisation/Geschaeftsjahr_model.php @@ -21,7 +21,9 @@ class Geschaeftsjahr_model extends DB_Model $query = 'SELECT * FROM public.tbl_geschaeftsjahr WHERE start <= now() - AND ende >= now()'; + AND ende >= now() + ORDER BY start DESC + LIMIT 1'; return $this->execQuery($query); } From ebab4c64c8e6e87edd563a0e9ad941325efd1d8e Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Wed, 16 May 2018 13:38:13 +0200 Subject: [PATCH 13/62] Rechte BugFix --- vilesci/stammdaten/reihungstest_administration.php | 12 ++++++------ vilesci/stammdaten/reihungstestverwaltung.php | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/vilesci/stammdaten/reihungstest_administration.php b/vilesci/stammdaten/reihungstest_administration.php index 3f17f02ce..cec0074f2 100644 --- a/vilesci/stammdaten/reihungstest_administration.php +++ b/vilesci/stammdaten/reihungstest_administration.php @@ -151,12 +151,12 @@ echo 'Reihungstest - Administration'; if(!$rechte->isBerechtigt('basis/testtool', null, 's')) - die('Sie haben keine Berechtigung für diese Seite'); + die($rechte->errormsg.'  Seite neu laden'); if(isset($_POST['personzuteilen'])) { if(!$rechte->isBerechtigt('basis/testtool', null, 'sui')) - die('Sie haben keine Berechtigung für diese Aktion. Seite neu laden'); + die($rechte->errormsg.'  Seite neu laden'); $prestudent = new prestudent(); if($prestudent->load($_POST['prestudent_id'])) @@ -333,7 +333,7 @@ echo '    Sie haben keine Berechtigung für diese Aktion. Seite neu laden'); + die($rechte->errormsg.'  Seite neu laden'); if(isset($_POST['prestudent']) && isset($_POST['gebiet']) && is_numeric($_POST['prestudent']) && is_numeric($_POST['gebiet'])) @@ -591,7 +591,7 @@ echo '

isBerechtigt('basis/testtool', null, 'suid')) - die('Sie haben keine Berechtigung für diese Aktion. Seite neu laden'); + die($rechte->errormsg.'  Seite neu laden'); $qry = "DELETE FROM testtool.tbl_antwort WHERE pruefling_id=(SELECT pruefling_id FROM testtool.tbl_pruefling WHERE prestudent_id=".$db->db_add_param(PRESTUDENT_ID_DUMMY_STUDENT)."); DELETE FROM testtool.tbl_pruefling_frage where pruefling_id=(SELECT pruefling_id FROM testtool.tbl_pruefling WHERE prestudent_id=".$db->db_add_param(PRESTUDENT_ID_DUMMY_STUDENT).");"; @@ -606,7 +606,7 @@ echo '

'; if(isset($_POST['savedummystg']) && isset($_POST['stg'])) { if(!$rechte->isBerechtigt('basis/testtool', null, 'su')) - die('Sie haben keine Berechtigung für diese Aktion. Seite neu laden'); + die($rechte->errormsg.'  Seite neu laden'); $qry = "UPDATE public.tbl_prestudent SET studiengang_kz=".$db->db_add_param($_POST['stg'])." WHERE prestudent_id=".$db->db_add_param(PRESTUDENT_ID_DUMMY_STUDENT)."; UPDATE testtool.tbl_pruefling SET studiengang_kz=".$db->db_add_param($_POST['stg'])." WHERE prestudent_id=".$db->db_add_param(PRESTUDENT_ID_DUMMY_STUDENT).";"; @@ -859,7 +859,7 @@ echo 'Freigeschaltene Reihungstests:'; if(isset($_GET['action']) && $_GET['action']=='sperren') { if(!$rechte->isBerechtigt('basis/testtool', null, 'su')) - die('Sie haben keine Berechtigung für diese Aktion. Seite neu laden'); + die($rechte->errormsg.'  Seite neu laden'); $rt = new reihungstest(); if($rt->load($_GET['reihungstest_id'])) diff --git a/vilesci/stammdaten/reihungstestverwaltung.php b/vilesci/stammdaten/reihungstestverwaltung.php index 1afcc0c3c..0f43094c2 100644 --- a/vilesci/stammdaten/reihungstestverwaltung.php +++ b/vilesci/stammdaten/reihungstestverwaltung.php @@ -2169,8 +2169,10 @@ if($reihungstest_id!='') if ($item->prestudent_id == $row->prestudent_id && $rt_letztes_login < $rt_antrittstermin) { - $rt_in_anderen_stg .= '(Letzter '.$studiengang->kuerzel_arr[$pruefling->studiengang_kz].'-Antritt: '.$datum_obj->formatDatum($rt_letztes_login, 'd.m.Y').',
'; - $rt_in_anderen_stg .= 'absolvierte RT-Gebiete entsperren)
'; + $rt_in_anderen_stg .= '(Letzter '.$studiengang->kuerzel_arr[$pruefling->studiengang_kz].'-Antritt: '.$datum_obj->formatDatum($rt_letztes_login, 'd.m.Y'); + if($rechte->isBerechtigt('basis/testtool', null, 'suid')) + $rt_in_anderen_stg .= ',
absolvierte RT-Gebiete entsperren'; + $rt_in_anderen_stg .= ')
'; } } } From 6a671837385df67b025fa9c0ccc58cf2ec969c44 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 May 2018 20:00:19 +0200 Subject: [PATCH 14/62] added Parking feauture to infocenter --- .../system/infocenter/InfoCenter.php | 93 +++++++++-- application/libraries/PersonLogLib.php | 99 ++++++++++++ .../models/organisation/Studienjahr_model.php | 17 ++ application/models/system/PersonLog_model.php | 32 ++++ .../system/infocenter/infocenterData.php | 25 ++- .../system/infocenter/infocenterDetails.php | 5 +- public/js/infocenter/infocenterDetails.js | 148 ++++++++++++++++-- .../js/infocenter/infocenterPersonDataset.js | 14 +- 8 files changed, 400 insertions(+), 33 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index d5ef7854d..0fd192120 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -6,7 +6,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); * Also shows infocenter-related data for a person and its prestudents, enables document and zgv checks, * displays and saves Notizen for a person, logs infocenter-related actions for a person */ -class InfoCenter extends VileSci_Controller +class InfoCenter extends FHC_Controller { // App and Verarbeitungstaetigkeit name for logging const APP = 'infocenter'; @@ -21,12 +21,14 @@ class InfoCenter extends VileSci_Controller 'saveformalgep' => array( 'logtype' => 'Action', 'name' => 'Document formally checked', - 'message' => 'Document %s formally checked, set to %s' + 'message' => 'Document %s formally checked, set to %s', + 'success' => null ), 'savezgv' => array( 'logtype' => 'Action', 'name' => 'ZGV saved', - 'message' => 'ZGV saved for degree program %s, prestudentid %s' + 'message' => 'ZGV saved for degree program %s, prestudentid %s', + 'success' => null ), 'abgewiesen' => array( 'logtype' => 'Processstate', @@ -41,12 +43,14 @@ class InfoCenter extends VileSci_Controller 'savenotiz' => array( 'logtype' => 'Action', 'name' => 'Note added', - 'message' => 'Note with title %s was added' + 'message' => 'Note with title %s was added', + 'success' => null ), 'updatenotiz' => array( 'logtype' => 'Action', 'name' => 'Note updated', - 'message' => 'Note with title %s was updated' + 'message' => 'Note with title %s was updated', + 'success' => null ) ); private $uid; // contains the UID of the logged user @@ -473,12 +477,11 @@ class InfoCenter extends VileSci_Controller ) ); - - $json = FALSE; + $json = false; if (isSuccess($result)) { - $json = TRUE; + $json = true; //set log "Notiz updated" $this->_log($person_id, 'updatenotiz', array($titel)); @@ -543,6 +546,61 @@ class InfoCenter extends VileSci_Controller ->_display(); } + /** + * Gets the date until which a person is parked + * @param $person_id + */ + public function getParkedDate($person_id) + { + $result = $this->personloglib->getParkedDate($person_id); + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode($result)); + } + + /** + * Initializes parking of a person, i.e. a person is not expected to do any actions while it is parked + */ + public function park() + { + $person_id = $this->input->post('person_id'); + $date = $this->input->post('parkdate'); + + $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->uid); + } + + /** + * Removes parking of a person + */ + public function unPark() + { + $person_id = $this->input->post('person_id'); + + $this->personloglib->unPark($person_id); + } + + /** + * Gets the End date of the current Studienjahr + */ + public function getStudienjahrEnd() + { + $this->load->model('organisation/studienjahr_model', 'StudienjahrModel'); + + $result = $this->StudienjahrModel->getCurrStudienjahr(); + + $json = false; + + if (hasData($result)) + { + $json = $result->retval[0]->ende; + } + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode($json)); + } + // ----------------------------------------------------------------------------------------------------------------- // Private methods @@ -762,7 +820,7 @@ class InfoCenter extends VileSci_Controller show_error($user_person->retval); } - $messagelink = base_url('/index.ci.php/system/Messages/write/'.$user_person->retval[0]->person_id); + $messagelink = site_url('/system/Messages/write/'.$user_person->retval[0]->person_id); $data = array ( 'lockedby' => $lockedby, @@ -898,15 +956,20 @@ class InfoCenter extends VileSci_Controller { $logdata = $this->logparams[$logname]; + $datatolog = array( + 'name' => $logdata['name'] + ); + + if (isset($logdata['message'])) + $datatolog['message'] = vsprintf($logdata['message'], $messageparams); + + if (array_key_exists('success', $logdata)) + $datatolog['success'] = true; + $this->personloglib->log( $person_id, $logdata['logtype'], - array( - 'name' => $logdata['name'], - 'message' => vsprintf($logdata['message'], - $messageparams), - 'success' => 'true' - ), + $datatolog, self::TAETIGKEIT, self::APP, null, diff --git a/application/libraries/PersonLogLib.php b/application/libraries/PersonLogLib.php index cf713825d..8145b88ac 100644 --- a/application/libraries/PersonLogLib.php +++ b/application/libraries/PersonLogLib.php @@ -7,6 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); */ class PersonLogLib { + const PARKED_LOGNAME = 'Parked'; + /** * Constructor */ @@ -79,4 +81,101 @@ class PersonLogLib else show_error($result->retval); } + + /** + * Parks a person, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent) + * Done by adding a logentry in the future + * @param $person_id + * @param $date + * @param $taetigkeit_kurzbz + * @param string $app + * @param null $oe_kurzbz + * @param null $user + * @return bool wether parking was successfull + */ + public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null) + { + $logdata = array( + 'name' => self::PARKED_LOGNAME + ); + + $data = array( + 'person_id' => $person_id, + 'zeitpunkt' => $date, + 'taetigkeit_kurzbz' => $taetigkeit_kurzbz, + 'app' => $app, + 'oe_kurzbz' => $oe_kurzbz, + 'logtype_kurzbz' => 'Processstate', + 'logdata' => json_encode($logdata), + 'insertvon' => $user + ); + + $result = $this->ci->PersonLogModel->insert($data); + if (isSuccess($result)) + return true; + else + show_error($result->retval); + } + + /** + * Unparks a person, i.e. removes all log entries in the future + * @param $person_id + */ + public function unPark($person_id) + { + $result = $this->ci->PersonLogModel->getLogsInFuture($person_id); + + $deleted = array(); + + if (isSuccess($result)) + { + if (count($result->retval) > 0) + { + foreach ($result->retval as $log) + { + $logdata = json_decode($log->logdata); + if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) + { + $delresult = $this->ci->PersonLogModel->deleteLog($log->log_id); + if (isSuccess($delresult)) + $deleted[] = $log->log_id; + } + } + } + } + else + show_error($result->retval); + } + + /** + * Gets date until which a person is parked + * @param $person_id + * @return the date if person is parked, null otherwise + */ + public function getParkedDate($person_id) + { + $result = $this->ci->PersonLogModel->getLogsInFuture($person_id); + + $parkeddate = null; + + if (isSuccess($result)) + { + if (count($result->retval) > 0) + { + foreach ($result->retval as $log) + { + $logdata = json_decode($log->logdata); + if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) + { + $parkeddate = $log->zeitpunkt; + break; + } + } + } + } + else + show_error($result->retval); + + return $parkeddate; + } } diff --git a/application/models/organisation/Studienjahr_model.php b/application/models/organisation/Studienjahr_model.php index ace9c1525..36784a280 100644 --- a/application/models/organisation/Studienjahr_model.php +++ b/application/models/organisation/Studienjahr_model.php @@ -12,4 +12,21 @@ class Studienjahr_model extends DB_Model $this->pk = 'studienjahr_kurzbz'; $this->hasSequence = false; } + + /** + * Gets current Studienjahr, as determined by its start and enddate + * @return array|null + */ + public function getCurrStudienjahr() + { + $query = 'SELECT * + FROM public.tbl_studienjahr + JOIN public.tbl_studiensemester using(studienjahr_kurzbz) + WHERE start <= now() + AND ende >= now() + ORDER by start DESC + LIMIT 1'; + + return $this->execQuery($query); + } } diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index 02f52008c..777c6eeeb 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -90,4 +90,36 @@ class PersonLog_model extends CI_Model return success($result->result()); } + + /** + * Gets all logs with zeitpunkt > today + * @param $person_id + * @return array + */ + public function getLogsInFuture($person_id) + { + $this->db->order_by('zeitpunkt', 'DESC'); + $this->db->order_by('log_id', 'DESC'); + + $result = $this->db->get_where($this->dbTable, "person_id=".$this->db->escape($person_id)." AND zeitpunkt > now()"); + + return success($result->result()); + } + + /** + * Deletes a log + * @param $log_id + * @return array + */ + public function deleteLog($log_id) + { + $this->load->library('PermissionLib'); + if(!$this->permissionlib->isEntitled('system.tbl_log', PermissionLib::DELETE_RIGHT)) + show_error('Permission denied - You need Access to system.tbl_log'); + + $this->db->where('log_id', $log_id); + $result = $this->db->delete($this->dbTable); + + return success($result); + } } diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index e880068b2..68b7d28a9 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -151,9 +151,16 @@ ),\', \' ) AS "StgAktiv", pl.zeitpunkt AS "LockDate", - pl.lockuser as "LockUser" + pl.lockuser as "LockUser", + pd.parkdate AS "ParkDate" FROM public.tbl_person p LEFT JOIN (SELECT person_id, zeitpunkt, uid as lockuser FROM system.tbl_person_lock WHERE app = \''.$APP.'\') pl USING(person_id) + LEFT JOIN ( + SELECT person_id, zeitpunkt as parkdate + FROM system.tbl_log + WHERE logdata->>\'name\' = \'Parked\' + AND zeitpunkt > now() + ) pd USING(person_id) WHERE EXISTS( SELECT 1 @@ -204,7 +211,9 @@ ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','nichtGesendet') . ')', ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','aktiv') . ')', ucfirst($this->p->t('global','sperrdatum')), - ucfirst($this->p->t('global','gesperrtVon'))), + ucfirst($this->p->t('global','gesperrtVon')), + "ParkedDate" + ), 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( @@ -267,10 +276,20 @@ }, 'markRow' => function($datasetRaw) { + $mark = ''; + if ($datasetRaw->LockDate != null) { - return FilterWidget::DEFAULT_MARK_ROW_CLASS; + $mark = FilterWidget::DEFAULT_MARK_ROW_CLASS; } + + if ($datasetRaw->ParkDate != null) + { + //parking has prio over locking + $mark = "text-info"; + } + + return $mark; } ); diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 0abe9b6b1..e8221d576 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -131,8 +131,11 @@ load->view('system/infocenter/notizen.php'); ?>
-
+
+
+
load->view('system/infocenter/logs.php'); ?> +
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index e5c966f7b..90509e288 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -20,6 +20,7 @@ function getUrlParameter(sParam) } var fhc_controller_id = getUrlParameter("fhc_controller_id"); +const CONTROLLER_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"+FHC_JS_DATA_STORAGE_OBJECT.called_path; /** * javascript file for infocenterDetails page @@ -42,6 +43,8 @@ $(document).ready( "dateFormat": "dd.mm.yy" }); + var personid = $("#hiddenpersonid").val(); + //add submit event to message send link $("#sendmsglink").click( function () @@ -54,7 +57,6 @@ $(document).ready( $(".prchbox").click(function () { var boxid = this.id; - var personid = $("#hiddenpersonid").val(); var akteid = boxid.substr(boxid.indexOf("_") + 1); var checked = this.checked; saveFormalGeprueft(personid, akteid, checked) @@ -64,7 +66,6 @@ $(document).ready( $(".zgvUebernehmen").click(function () { var btn = $(this); - var personid = $("#hiddenpersonid").val(); var prestudentid = this.id.substr(this.id.indexOf("_") + 1); $('#zgvUebernehmenNotice').remove(); zgvUebernehmen(personid, prestudentid, btn) @@ -118,11 +119,11 @@ $(document).ready( if (notizId !== '') { - updateNotiz(notizId, personId, data); + updateNotiz(notizId, personid, data); } else { - saveNotiz(personId, data); + saveNotiz(personid, data); } } ); @@ -150,6 +151,9 @@ $(document).ready( } ); + //check if person is parked and display it + getParkedDateAjax(personid); + }); function openZgvInfoForPrestudent(prestudent_id) @@ -169,7 +173,7 @@ function saveFormalGeprueft(personid, akteid, checked) $.ajax({ type: "POST", dataType: "json", - url: "../saveFormalGeprueft/" + personid + '?fhc_controller_id=' + fhc_controller_id, + url: CONTROLLER_URL+"/saveFormalGeprueft/" + personid + '?fhc_controller_id=' + fhc_controller_id, data: {"akte_id": akteid, "formal_geprueft": checked}, success: function (data, textStatus, jqXHR) { @@ -197,9 +201,9 @@ function saveFormalGeprueft(personid, akteid, checked) function zgvUebernehmen(personid, prestudentid, btn) { $.ajax({ - type: "POST", + type: "GET", dataType: "json", - url: "../getLastPrestudentWithZgvJson/" + personid + '?fhc_controller_id=' + fhc_controller_id, + url: CONTROLLER_URL+"/getLastPrestudentWithZgvJson/" + personid + '?fhc_controller_id=' + fhc_controller_id, success: function (data, textStatus, jqXHR) { if (data !== null) @@ -239,7 +243,7 @@ function saveZgv(data) type: "POST", dataType: "json", data: data, - url: "../saveZgvPruefung/" + prestudentid + '?fhc_controller_id=' + fhc_controller_id, + url: CONTROLLER_URL+"/saveZgvPruefung/" + prestudentid + '?fhc_controller_id=' + fhc_controller_id, success: function (data, textStatus, jqXHR) { if (data === prestudentid) @@ -265,7 +269,7 @@ function saveNotiz(personid, data) type: "POST", dataType: "json", data: data, - url: "../saveNotiz/" + personid + '?fhc_controller_id=' + fhc_controller_id, + url: CONTROLLER_URL+"/saveNotiz/" + personid + '?fhc_controller_id=' + fhc_controller_id, success: function (data, textStatus, jqXHR) { refreshNotizen(); @@ -284,7 +288,7 @@ function updateNotiz(notizId, personId, data) type: "POST", dataType: "json", data: data, - url: "../updateNotiz/" + notizId + "/" + personId + '?fhc_controller_id=' + fhc_controller_id, + url: CONTROLLER_URL+"/updateNotiz/" + notizId + "/" + personId + '?fhc_controller_id=' + fhc_controller_id, success: function (data, textStatus, jqXHR) { if (data) @@ -301,6 +305,86 @@ function updateNotiz(notizId, personId, data) }); } +function getStudienjahrEndAjax() +{ + $.ajax({ + url: CONTROLLER_URL+"/getStudienjahrEnd?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + method: "GET", + success: function(data, textStatus, jqXHR) + { + console.log(data); + //var gerdate = data.substring(8, 10) + "."+data.substring(5, 7) + "." + data.substring(0, 4); + var engdate = $.datepicker.parseDate("yy-mm-dd", data); + var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); + $("#parkdate").val(gerdate); + }, + error: function (jqXHR, textStatus, errorThrown) + { + alert(textStatus); + } + }); +} + +function getParkedDateAjax(personid) +{ + $.ajax({ + url: CONTROLLER_URL+"/getParkedDate/"+personid+"?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + method: "GET", + success: function(data, textStatus, jqXHR) + { + console.log(data); + refreshParking(data); + refreshLog(); + getStudienjahrEndAjax(); + }, + error: function (jqXHR, textStatus, errorThrown) + { + alert(textStatus); + } + }); +} + +function parkPersonAjax(personid, date) +{ + $.ajax({ + url: CONTROLLER_URL+"/park?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + method: "POST", + data: + { + "person_id": personid, + "parkdate": date + }, + success: function(data, textStatus, jqXHR) + { + getParkedDateAjax(personid); + }, + error: function (jqXHR, textStatus, errorThrown) + { + alert(textStatus); + } + }); +} + +function unparkPersonAjax(personid) +{ + $.ajax({ + url: CONTROLLER_URL+"/unpark?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + method: "POST", + data: + { + "person_id": personid + }, + success: function(data, textStatus, jqXHR) + { + getParkedDateAjax(personid); + }, + error: function (jqXHR, textStatus, errorThrown) + { + alert(textStatus); + } + }); +} + // ----------------------------------------------------------------------------------------------------------------- // methods executed after ajax (refreshers) @@ -336,6 +420,50 @@ function refreshNotizen() ); } +function refreshParking(date) +{ + if (date === null) + { + $("#parking").html( + '
'+ + '     '+ + 'bis  '+ + ''+ + '
'); + + $("#parkdate").datepicker({ + "dateFormat": "dd.mm.yy", + "minDate": 0 + }); + + $("#parklink").click( + function () + { + var personid = $("#hiddenpersonid").val(); + var date = $("#parkdate").val(); + + parkPersonAjax(personid, date); + } + ); + } + else + { + var parkdate = $.datepicker.parseDate("yy-mm-dd", date); + var gerparkdate = $.datepicker.formatDate("dd.mm.yy", parkdate); + $("#parking").html( + 'BewerberIn geparkt bis '+gerparkdate+'     '+ + ' '); + + $("#unparklink").click( + function () + { + var personid = $("#hiddenpersonid").val(); + unparkPersonAjax(personid, date); + } + ); + } +} + function formatNotizTable() { addTablesorter("notiztable", [[0, 1]], ["filter"], 2); diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 7f99b6fc6..02e693314 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -25,10 +25,13 @@ function appendTableActionsHtml() '' + ' Keinen    '; - var messageHtml = 'Mit Ausgewählten:  ' + + var actionHtml = 'Mit Ausgewählten:  ' + '' + ' Nachricht senden'; + var legendHtml = ' Gesperrt    ' + + ' Geparkt'; + var personcount = 0; $.ajax({ @@ -51,9 +54,12 @@ function appendTableActionsHtml() var countHtml = personcount + " " + persontext; $("#datasetActionsTop, #datasetActionsBottom").append( - "
" + selectAllHtml + "  " + messageHtml + "
"+ - "
" + countHtml + "
"+ - "
" + "
"+ + "
" + selectAllHtml + "  " + actionHtml + "
"+ + "
" + legendHtml + "
"+ + "
" + countHtml + "
"+ + "
"+ + "
" ); $("#datasetActionsBottom").append("

"); } From 45c3aad94daff55e2bab7c538be49eb101efdad2 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 17 May 2018 17:46:00 +0200 Subject: [PATCH 15/62] Adapted query for infocenter parking, replaced null in parkdate with -, set min and max size for messages, increased msglist size, pager counts now only trs in tbody --- application/models/system/PersonLog_model.php | 10 +++++----- application/views/system/infocenter/infocenterData.php | 10 ++++++++-- application/views/system/messageList.php | 3 +++ public/js/infocenter/infocenterDetails.js | 6 +++--- public/js/tablesort/tablesort.js | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/application/models/system/PersonLog_model.php b/application/models/system/PersonLog_model.php index 777c6eeeb..e5f2c543d 100644 --- a/application/models/system/PersonLog_model.php +++ b/application/models/system/PersonLog_model.php @@ -101,7 +101,11 @@ class PersonLog_model extends CI_Model $this->db->order_by('zeitpunkt', 'DESC'); $this->db->order_by('log_id', 'DESC'); - $result = $this->db->get_where($this->dbTable, "person_id=".$this->db->escape($person_id)." AND zeitpunkt > now()"); + $where = "logtype_kurzbz = 'Processstate' + AND person_id=".$this->db->escape($person_id)." + AND zeitpunkt >= now()"; + + $result = $this->db->get_where($this->dbTable, $where); return success($result->result()); } @@ -113,10 +117,6 @@ class PersonLog_model extends CI_Model */ public function deleteLog($log_id) { - $this->load->library('PermissionLib'); - if(!$this->permissionlib->isEntitled('system.tbl_log', PermissionLib::DELETE_RIGHT)) - show_error('Permission denied - You need Access to system.tbl_log'); - $this->db->where('log_id', $log_id); $result = $this->db->delete($this->dbTable); diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 68b7d28a9..14ce21217 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -158,8 +158,9 @@ LEFT JOIN ( SELECT person_id, zeitpunkt as parkdate FROM system.tbl_log - WHERE logdata->>\'name\' = \'Parked\' - AND zeitpunkt > now() + WHERE logtype_kurzbz = \'Processstate\' + AND logdata->>\'name\' = \'Parked\' + AND zeitpunkt >= now() ) pd USING(person_id) WHERE EXISTS( @@ -255,6 +256,11 @@ $datasetRaw->{'LockUser'} = '-'; } + if ($datasetRaw->{'ParkDate'} == null) + { + $datasetRaw->{'ParkDate'} = '-'; + } + if ($datasetRaw->{'StgAbgeschickt'} == null) { $datasetRaw->{'StgAbgeschickt'} = '-'; diff --git a/application/views/system/messageList.php b/application/views/system/messageList.php index 44779ad2c..6edd4f4b1 100644 --- a/application/views/system/messageList.php +++ b/application/views/system/messageList.php @@ -43,6 +43,9 @@ $widthColumn = $msgExists === true ? 8 : 12; selector: "#msgbody", statusbar: false, plugins: "autoresize", + autoresize_bottom_margin: 10, + autoresize_min_height: 140, + autoresize_max_height: 495, //callback to avoid conflict with ajax (for getting body of first message) init_instance_callback: "initMsgBody" }); diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 90509e288..f3b4839ca 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -32,7 +32,7 @@ $(document).ready( addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2); - tablesortAddPager("msgtable", "msgpager", 10); + tablesortAddPager("msgtable", "msgpager", 14); formatNotizTable(); formatLogTable(); @@ -403,7 +403,7 @@ function refreshLog() function formatLogTable() { addTablesorter("logtable", [[0, 1]], ["filter"], 2); - tablesortAddPager("logtable", "logpager", 23); + tablesortAddPager("logtable", "logpager", 22); $("#logtable").addClass("table-condensed"); } @@ -467,7 +467,7 @@ function refreshParking(date) function formatNotizTable() { addTablesorter("notiztable", [[0, 1]], ["filter"], 2); - tablesortAddPager("notiztable", "notizpager", 10); + tablesortAddPager("notiztable", "notizpager", 11); $("#notiztable").addClass("table-condensed"); } diff --git a/public/js/tablesort/tablesort.js b/public/js/tablesort/tablesort.js index 7ee70a002..ee386bb7d 100644 --- a/public/js/tablesort/tablesort.js +++ b/public/js/tablesort/tablesort.js @@ -46,7 +46,7 @@ function tablesortAddPager(tableid, pagerid, size) '' + '
'; - var rowcount = $("#" + tableid + " tr").length; + var rowcount = $("#" + tableid + " tbody tr").length; //not show pager if only one table page if (rowcount > size) From 13beae23ccb07e26e43397e5f992ad4f98c8134f Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 18 May 2018 12:10:14 +0200 Subject: [PATCH 16/62] - Added public/css/FilterWidget.css and public/css/NavigationWidget.css to define CSS for Filter and Navigation widgets - Added public/js/FilterWidget.js and public/js/NavigationWidget.js to collect all the JS for Filter and Navigation widgets - Added filterwidget and navigationwidget paramaters to FHC-Header to include the new CSS and JS for Filter and Navigation widgets - Removed all CSS and JS from the views used from Filter and Navigation widgets - Added method _getFilterUniqueId to controller Filters to generate a unique id for a filter based on fhc_controller_id and the current page - Adapted the code in controller Filters to use _getFilterUniqueId - Added method _getFilterUniqueId to widget FilterWidget to generate a unique id for a filter based on fhc_controller_id and the current page - Adapted the code in widget FilterWidget to use _getFilterUniqueId - Removed fhc_controller_id from menu generation in InfoCenter controller - InfoCenter controller now gives as parameter fhc_controller_id to view infocenterDetails - InfoCenter controller now gives as parameter fhc_controller_id to various redirect - Views infocenter, infocenterData, infocenterDetails and infocenterFreigegeben: - including new JS and CSS to work with Navigation and Filter widgets - including AjaxLib (required by FilterWidget.js and NavigationWidget.js) - using fhc_controller_id in Details and unlockPerson links - fhc_controller_id in not anymore a parameter for FilterWidget, adapted the code where FilterWidget is called - AjaxLib: renamed method _getUrlParameter to getUrlParameter - Removed function getUrlParameter from public/js/infocenter/infocenterDetails.js, now uses the method from AjaxLib - Added fhc_controller_id where needed into public/js/infocenter/infocenterDetails.js - public/js/infocenter/infocenterPersonDataset.js now uses getUrlParameter from AjaxLib - Added paramater filter_page in infocenterPersonDataset.js when calling Filters/rowNumber --- application/controllers/system/Filters.php | 117 +-- .../system/infocenter/InfoCenter.php | 44 +- .../views/system/infocenter/infocenter.php | 3 + .../system/infocenter/infocenterData.php | 51 +- .../system/infocenter/infocenterDetails.php | 4 +- .../infocenter/infocenterFreigegeben.php | 11 +- application/views/templates/FHC-Header.php | 14 + application/views/widgets/filter/filter.php | 161 ---- .../views/widgets/filter/saveFilter.php | 33 - .../views/widgets/filter/selectFields.php | 254 +----- .../views/widgets/filter/selectFilters.php | 279 ------- .../views/widgets/filter/tableDataset.php | 150 ---- application/views/widgets/navigation.php | 16 +- .../views/widgets/navigationHeader.php | 50 +- application/views/widgets/navigationMenu.php | 166 ---- application/widgets/FilterWidget.php | 26 +- public/css/FilterWidget.css | 107 +++ public/css/NavigationWidget.css | 35 + public/js/AjaxLib.js | 4 +- public/js/FilterWidget.js | 730 ++++++++++++++++++ public/js/NavigationWidget.js | 171 ++++ public/js/infocenter/infocenterDetails.js | 35 +- .../js/infocenter/infocenterPersonDataset.js | 3 +- 23 files changed, 1239 insertions(+), 1225 deletions(-) create mode 100644 public/css/FilterWidget.css create mode 100644 public/css/NavigationWidget.css create mode 100644 public/js/FilterWidget.js create mode 100644 public/js/NavigationWidget.js diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 738799747..fcf37f158 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -37,7 +37,7 @@ class Filters extends VileSci_Controller { $json = new stdClass(); - $session = $this->_readSession($this->input->get('fhc_controller_id')); + $session = $this->_readSession($this->_getFilterUniqueId()); $json->selectedFields = $session['selectedFields']; $json->columnsAliases = $session['columnsAliases']; @@ -55,7 +55,7 @@ class Filters extends VileSci_Controller { $json = new stdClass(); - $session = $this->_readSession($this->input->get('fhc_controller_id')); + $session = $this->_readSession($this->_getFilterUniqueId()); $json->allSelectedFields = $session['allSelectedFields']; $json->allColumnsAliases = $session['allColumnsAliases']; @@ -72,11 +72,12 @@ class Filters extends VileSci_Controller public function sortSelectedFields() { $selectedFieldsLst = $this->input->post('selectedFieldsLst'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + + $filterUniqueId = $this->_getFilterUniqueId(); $json = new stdClass(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $allSelectedFields = $session['allSelectedFields']; $allColumnsAliases = $session['allColumnsAliases']; @@ -105,8 +106,8 @@ class Filters extends VileSci_Controller } } - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $json->selectedFields; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $json->columnsAliases; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['selectedFields'] = $json->selectedFields; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['columnsAliases'] = $json->columnsAliases; $this->output->set_content_type('application/json')->set_output(json_encode($json)); } @@ -118,7 +119,7 @@ class Filters extends VileSci_Controller { $json = new stdClass(); - $session = $this->_readSession($this->input->get('fhc_controller_id')); + $session = $this->_readSession($this->_getFilterUniqueId()); $json->allSelectedFields = $session['allSelectedFields']; $json->allColumnsAliases = $session['allColumnsAliases']; @@ -175,19 +176,19 @@ class Filters extends VileSci_Controller */ public function saveFilter() { - $this->_saveFilter($this->input->post("customFilterDescription"), $this->input->post("fhc_controller_id")); + $this->_saveFilter($this->input->post("customFilterDescription"), $this->_getFilterUniqueId()); - $this->output->set_content_type('application/json')->set_output(json_encode('Tutto bene!!!')); + $this->output->set_content_type('application/json')->set_output(json_encode('Filter saved')); } /** * */ - private function _saveFilter($customFilterDescription, $fhc_controller_id) + private function _saveFilter($customFilterDescription, $filterUniqueId) { $objToBeSaved = new stdClass(); - $filterSessionArray = $this->_readSession($fhc_controller_id); + $filterSessionArray = $this->_readSession($filterUniqueId); $objToBeSaved->name = $customFilterDescription; @@ -240,8 +241,8 @@ class Filters extends VileSci_Controller $personId = $resultBenutzer->retval[0]->person_id; $result = $this->FiltersModel->loadWhere(array( - 'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'], - 'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'], + 'app' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['app'], + 'dataset_name' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['datasetName'], 'description' => $descPGArray, 'person_id' => $personId )); @@ -250,8 +251,8 @@ class Filters extends VileSci_Controller { $this->FiltersModel->update( array( - 'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'], - 'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'], + 'app' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['app'], + 'dataset_name' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['datasetName'], 'description' => $descPGArray, 'person_id' => $personId ), @@ -263,8 +264,8 @@ class Filters extends VileSci_Controller else { $this->FiltersModel->insert(array( - 'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'], - 'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'], + 'app' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['app'], + 'dataset_name' => $_SESSION[self::SESSION_NAME][$filterUniqueId]['datasetName'], 'filter_kurzbz' => uniqid($personId, true), 'person_id' => $personId, 'description' => $descPGArray, @@ -282,7 +283,6 @@ class Filters extends VileSci_Controller public function deleteCustomFilter() { $filter_id = $this->input->post('filter_id'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); if (is_numeric($filter_id)) { @@ -298,9 +298,9 @@ class Filters extends VileSci_Controller public function removeSelectedFields() { $fieldName = $this->input->post('fieldName'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + $filterUniqueId = $this->_getFilterUniqueId(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $allSelectedFields = $session['allSelectedFields']; $allColumnsAliases = $session['allColumnsAliases']; @@ -318,8 +318,8 @@ class Filters extends VileSci_Controller } } - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $selectedFields; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $columnsAliases; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['selectedFields'] = $selectedFields; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['columnsAliases'] = $columnsAliases; $json = new stdClass(); @@ -337,9 +337,9 @@ class Filters extends VileSci_Controller public function removeSelectedFilters() { $fieldName = $this->input->post('fieldName'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + $filterUniqueId = $this->_getFilterUniqueId(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $selectedFilters = $session['selectedFilters']; $selectedFiltersActiveFilters = $session['activeFilters']; @@ -354,10 +354,10 @@ class Filters extends VileSci_Controller array_splice($selectedFiltersActiveFiltersOption, $pos, 1); } - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFilters'] = $selectedFilters; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $selectedFiltersActiveFilters; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['selectedFilters'] = $selectedFilters; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFilters'] = $selectedFiltersActiveFilters; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption; $json = new stdClass(); @@ -375,9 +375,9 @@ class Filters extends VileSci_Controller public function addSelectedFields() { $fieldName = $this->input->post('fieldName'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + $filterUniqueId = $this->_getFilterUniqueId(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $allSelectedFields = $session['allSelectedFields']; $allColumnsAliases = $session['allColumnsAliases']; @@ -396,8 +396,8 @@ class Filters extends VileSci_Controller } } - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $selectedFields; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $columnsAliases; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['selectedFields'] = $selectedFields; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['columnsAliases'] = $columnsAliases; $json = new stdClass(); @@ -415,9 +415,9 @@ class Filters extends VileSci_Controller public function addSelectedFilters() { $fieldName = $this->input->post('fieldName'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + $filterUniqueId = $this->_getFilterUniqueId(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $selectedFilters = $session['selectedFilters']; $selectedFiltersActiveFilters = $session['activeFilters']; @@ -432,10 +432,10 @@ class Filters extends VileSci_Controller $selectedFiltersActiveFiltersOption[$fieldName] = ""; } - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFilters'] = $selectedFilters; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $selectedFiltersActiveFilters; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['selectedFilters'] = $selectedFilters; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFilters'] = $selectedFiltersActiveFilters; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption; $json = new stdClass(); @@ -456,17 +456,17 @@ class Filters extends VileSci_Controller $filterOperations = $this->input->post('filterOperations'); $filterOperationValues = $this->input->post('filterOperationValues'); $filterOptions = $this->input->post('filterOptions'); - $fhc_controller_id = $this->input->post('fhc_controller_id'); + $filterUniqueId = $this->_getFilterUniqueId(); - $session = $this->_readSession($fhc_controller_id); + $session = $this->_readSession($filterUniqueId); $activeFilters = array_combine($fieldNames, $filterOperationValues); $activeFiltersOperation = array_combine($fieldNames, $filterOperations); $activeFiltersOption = array_combine($fieldNames, $filterOptions); - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $activeFilters; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $activeFiltersOperation; - $_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $activeFiltersOption; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFilters'] = $activeFilters; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOperation'] = $activeFiltersOperation; + $_SESSION[self::SESSION_NAME][$filterUniqueId]['activeFiltersOption'] = $activeFiltersOption; $json = new stdClass(); @@ -485,7 +485,7 @@ class Filters extends VileSci_Controller { $json = new stdClass(); - $session = $this->_readSession($this->input->get('fhc_controller_id')); + $session = $this->_readSession($this->_getFilterUniqueId()); $dataset = $session['dataset']; @@ -500,10 +500,10 @@ class Filters extends VileSci_Controller /** * */ - private function _readSession($fhc_controller_id) + private function _readSession($filterUniqueId) { - if (isset($_SESSION[self::SESSION_NAME]) && isset($_SESSION[self::SESSION_NAME][$fhc_controller_id])) - return $_SESSION[self::SESSION_NAME][$fhc_controller_id]; + if (isset($_SESSION[self::SESSION_NAME]) && isset($_SESSION[self::SESSION_NAME][$filterUniqueId])) + return $_SESSION[self::SESSION_NAME][$filterUniqueId]; return array(); } @@ -511,7 +511,7 @@ class Filters extends VileSci_Controller /** * */ - private function _writeSession($data, $fhc_controller_id) + private function _writeSession($data, $filterUniqueId) { if (!isset($_SESSION[self::SESSION_NAME]) || (isset($_SESSION[self::SESSION_NAME]) && !is_array($_SESSION[self::SESSION_NAME]))) @@ -519,6 +519,25 @@ class Filters extends VileSci_Controller $_SESSION[self::SESSION_NAME] = array(); } - $_SESSION[self::SESSION_NAME][$fhc_controller_id] = $data; + $_SESSION[self::SESSION_NAME][$filterUniqueId] = $data; + } + + /** + * + */ + private function _getFilterUniqueId() + { + $_getFilterUniqueId = ''; + + if ($_SERVER['REQUEST_METHOD'] === 'POST') + { + $_getFilterUniqueId = $this->input->post('filter_page').'/'.$this->input->post('fhc_controller_id'); + } + elseif ($_SERVER['REQUEST_METHOD'] === 'GET') + { + $_getFilterUniqueId = $this->input->get('filter_page').'/'.$this->input->get('fhc_controller_id'); + } + + return $_getFilterUniqueId; } } diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 0fd192120..f4d22311e 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -78,14 +78,17 @@ class InfoCenter extends FHC_Controller $this->load->library('PersonLogLib'); $this->load->library('WidgetLib'); - $this->loadPhrases(array( - 'global', - 'person', - 'lehre', - 'ui', - 'infocenter', - 'filter')); - + $this->loadPhrases( + array( + 'global', + 'person', + 'lehre', + 'ui', + 'infocenter', + 'filter' + ) + ); + $this->_setAuthUID(); // sets property uid $this->load->library('PermissionLib'); @@ -139,13 +142,14 @@ class InfoCenter extends FHC_Controller $persondata = $this->_loadPersonData($person_id); $prestudentdata = $this->_loadPrestudentData($person_id); - $this->load->view( - 'system/infocenter/infocenterDetails.php', - array_merge( - $persondata, - $prestudentdata - ) + $data = array_merge( + $persondata, + $prestudentdata ); + + $data['fhc_controller_id'] = $this->fhc_controller_id; + + $this->load->view('system/infocenter/infocenterDetails.php', $data); } /** @@ -159,7 +163,7 @@ class InfoCenter extends FHC_Controller if(isError($result)) show_error($result->retval); - redirect(self::URL_PREFIX); + redirect(self::URL_PREFIX.'?fhc_controller_id='.$this->fhc_controller_id); } /** @@ -715,10 +719,10 @@ class InfoCenter extends FHC_Controller { foreach ($filters as $filterId => $description) { - $toPrint = "%s?%s=%s&%s=%s"; + $toPrint = "%s?%s=%s"; $tofill['children'][] = array( - 'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId, 'fhc_controller_id', $this->fhc_controller_id), + 'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId), 'description' => $description ); } @@ -728,10 +732,10 @@ class InfoCenter extends FHC_Controller { foreach ($filters as $filterId => $description) { - $toPrint = "%s?%s=%s&%s=%s"; + $toPrint = "%s?%s=%s"; $tofill['children'][] = array( - 'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId, 'fhc_controller_id', $this->fhc_controller_id), + 'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId), 'description' => $description, 'subscriptDescription' => 'Remove', 'subscriptLinkClass' => 'remove-filter', @@ -922,7 +926,7 @@ class InfoCenter extends FHC_Controller $this->PrestudentModel->addSelect('person_id'); $person_id = $this->PrestudentModel->load($prestudent_id)->retval[0]->person_id; - redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#'.$section); + redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'?fhc_controller_id='.$this->fhc_controller_id.'#'.$section); } /** diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 38268aa4d..9bc9ea20d 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -9,6 +9,9 @@ 'fontawesome' => true, 'sbadmintemplate' => true, 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 68b7d28a9..34b604d40 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -2,6 +2,7 @@ $APP = 'infocenter'; $NOTBEFORE = '2018-03-01 18:00:00'; + $filterWidgetArray = array( 'query' => ' SELECT @@ -160,7 +161,7 @@ FROM system.tbl_log WHERE logdata->>\'name\' = \'Parked\' AND zeitpunkt > now() - ) pd USING(person_id) + ) pd USING(person_id) WHERE EXISTS( SELECT 1 @@ -193,33 +194,33 @@ ) ORDER BY "LastAction" ASC ', - 'fhc_controller_id' => $fhc_controller_id, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array( - 'PersonID', - ucfirst($this->p->t('person','vorname')) , - ucfirst($this->p->t('person','nachname')), - ucfirst($this->p->t('person','geburtsdatum')), - ucfirst($this->p->t('person','nation')), - ucfirst($this->p->t('global','letzteAktion')), - ucfirst($this->p->t('global','letzterBearbeiter')), - ucfirst($this->p->t('lehre','studiensemester')), - ucfirst($this->p->t('global','gesendetAm')), - ucfirst($this->p->t('global','abgeschickt')) . ' (' . $this->p->t('global','anzahl') . ')', - ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','gesendet') . ')', - ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','nichtGesendet') . ')', - ucfirst($this->p->t('lehre','studiengang')) . ' (' . $this->p->t('global','aktiv') . ')', - ucfirst($this->p->t('global','sperrdatum')), - ucfirst($this->p->t('global','gesperrtVon')), - "ParkedDate" + 'PersonID', + ucfirst($this->p->t('person', 'vorname')) , + ucfirst($this->p->t('person', 'nachname')), + ucfirst($this->p->t('person', 'geburtsdatum')), + ucfirst($this->p->t('person', 'nation')), + ucfirst($this->p->t('global', 'letzteAktion')), + ucfirst($this->p->t('global', 'letzterBearbeiter')), + ucfirst($this->p->t('lehre', 'studiensemester')), + ucfirst($this->p->t('global', 'gesendetAm')), + ucfirst($this->p->t('global', 'abgeschickt')).' ('.$this->p->t('global', 'anzahl').')', + ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', + ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', + ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', + ucfirst($this->p->t('global', 'sperrdatum')), + ucfirst($this->p->t('global', 'gesperrtVon')), + 'ParkedDate' ), 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( - 'Details', - site_url('system/infocenter/InfoCenter/showDetails/'), - $datasetRaw->{'PersonId'} + 'Details', + site_url('system/infocenter/InfoCenter/showDetails'), + $datasetRaw->{'PersonId'}, + $this->input->get('fhc_controller_id') ); if ($datasetRaw->{'SendDate'} == null) @@ -228,7 +229,7 @@ } else { - $datasetRaw->{'SendDate'} = date_format(date_create($datasetRaw->{'SendDate'}),'Y-m-d H:i'); + $datasetRaw->{'SendDate'} = date_format(date_create($datasetRaw->{'SendDate'}), 'Y-m-d H:i'); } if ($datasetRaw->{'LastAction'} == null) @@ -237,7 +238,7 @@ } else { - $datasetRaw->{'LastAction'} = date_format(date_create($datasetRaw->{'LastAction'}),'Y-m-d H:i'); + $datasetRaw->{'LastAction'} = date_format(date_create($datasetRaw->{'LastAction'}), 'Y-m-d H:i'); } if ($datasetRaw->{'User/Operator'} == '') @@ -285,14 +286,14 @@ if ($datasetRaw->ParkDate != null) { - //parking has prio over locking + // Parking has priority over locking $mark = "text-info"; } return $mark; } ); - + $filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null; if (isset($filterId) && is_numeric($filterId)) diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index e8221d576..ae628f927 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -11,6 +11,8 @@ 'tinymce' => true, 'sbadmintemplate' => true, 'addons' => true, + 'ajaxlib' => true, + 'navigationwidget' => true, 'customCSSs' => array( 'public/css/sbadmin2/admintemplate.css', @@ -46,7 +48,7 @@ echo $lockedby; ?>    -  p->t('ui', 'freigeben')) ?>
diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 03da9b718..03733efe1 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -9,6 +9,9 @@ 'fontawesome' => true, 'sbadmintemplate' => true, 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ) @@ -170,7 +173,6 @@ ) ORDER BY "LastAction" ASC ', - 'fhc_controller_id' => $fhc_controller_id, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), 'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Nation','Letzte Aktion','Letzter Bearbeiter', @@ -178,9 +180,10 @@ 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( - 'Details', - base_url('index.ci.php/system/infocenter/InfoCenter/showDetails/'), - $datasetRaw->{'PersonId'} + 'Details', + site_url('system/infocenter/InfoCenter/showDetails'), + $datasetRaw->{'PersonId'}, + $this->input->get('fhc_controller_id') ); if ($datasetRaw->{'SendDate'} == null) diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 853eb8de7..8b4dc058a 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -22,6 +22,8 @@ $tablesorter = isset($tablesorter) ? $tablesorter : false; $tinymce = isset($tinymce) ? $tinymce : false; $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; $addons = isset($addons) ? $addons : false; +$filterwidget = isset($filterwidget) ? $filterwidget : false; +$navigationwidget = isset($navigationwidget) ? $navigationwidget : false; /** * Print the given title of the page @@ -165,6 +167,12 @@ function _generateAddonsJSsInclude($calledFrom) _generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css'); } + // FilterWidget CSS + if ($filterwidget === true) _generateCSSsInclude('public/css/FilterWidget.css'); + + // NavigationWidget CSS + if ($navigationwidget === true) _generateCSSsInclude('public/css/NavigationWidget.css'); + // Eventually required CSS _generateCSSsInclude($customCSSs); // Eventually required CSS @@ -210,6 +218,12 @@ function _generateAddonsJSsInclude($calledFrom) _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); } + // FilterWidget JS + if($filterwidget === true) _generateJSsInclude('public/js/FilterWidget.js') ; + + // NavigationWidget JS + if($navigationwidget === true) _generateJSsInclude('public/js/NavigationWidget.js') ; + // Load addon hooks JS if ($addons === true) _generateAddonsJSsInclude($calledPath.'/'.$calledMethod); diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index d3dbb1918..ac29efe30 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -1,164 +1,3 @@ - -
diff --git a/application/views/widgets/filter/saveFilter.php b/application/views/widgets/filter/saveFilter.php index ce2d454ca..c1f09a413 100644 --- a/application/views/widgets/filter/saveFilter.php +++ b/application/views/widgets/filter/saveFilter.php @@ -1,36 +1,3 @@ - -
diff --git a/application/views/widgets/filter/selectFields.php b/application/views/widgets/filter/selectFields.php index a011e5555..73461840a 100644 --- a/application/views/widgets/filter/selectFields.php +++ b/application/views/widgets/filter/selectFields.php @@ -1,247 +1,11 @@ - - -
- -
- - Add field: - - - - - -
+ + + +
diff --git a/application/views/widgets/filter/selectFilters.php b/application/views/widgets/filter/selectFilters.php index cf5443069..ffb93dfe5 100644 --- a/application/views/widgets/filter/selectFilters.php +++ b/application/views/widgets/filter/selectFilters.php @@ -1,282 +1,3 @@ - -
diff --git a/application/views/widgets/filter/tableDataset.php b/application/views/widgets/filter/tableDataset.php index 1a19876f4..ca917503a 100644 --- a/application/views/widgets/filter/tableDataset.php +++ b/application/views/widgets/filter/tableDataset.php @@ -1,153 +1,3 @@ - -
diff --git a/application/views/widgets/navigation.php b/application/views/widgets/navigation.php index 8a57dab57..efc953f5f 100644 --- a/application/views/widgets/navigation.php +++ b/application/views/widgets/navigation.php @@ -1,9 +1,9 @@ - diff --git a/application/views/widgets/navigationHeader.php b/application/views/widgets/navigationHeader.php index 0d050df2a..8e2a936a4 100644 --- a/application/views/widgets/navigationHeader.php +++ b/application/views/widgets/navigationHeader.php @@ -1,39 +1,11 @@ - - - + diff --git a/application/views/widgets/navigationMenu.php b/application/views/widgets/navigationMenu.php index 9ef727083..42dd901fb 100644 --- a/application/views/widgets/navigationMenu.php +++ b/application/views/widgets/navigationMenu.php @@ -1,169 +1,3 @@ - - - - "); + } + + var arrayFieldsToDisplay = []; + + if (data.columnsAliases != null && $.isArray(data.columnsAliases) && data.columnsAliases.length > 0) + { + arrayFieldsToDisplay = data.columnsAliases; + } + else if (data.selectedFields != null && $.isArray(data.selectedFields)) + { + arrayFieldsToDisplay = data.selectedFields; + } + + /* ------------------------------------------------------------------------------------------------ */ + if (data.checkboxes != null && data.checkboxes != "") + { + $("#filterTableDataset > thead > tr").html(""); + } + + for (var i = 0; i < arrayFieldsToDisplay.length; i++) + { + var th = arrayFieldsToDisplay[i]; + + $("#filterTableDataset > thead > tr").append(""); + } + + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + for (var i = 0; i < data.additionalColumns.length; i++) + { + var th = data.additionalColumns[i]; + + $("#filterTableDataset > thead > tr").append(""); + } + } + /* ------------------------------------------------------------------------------------------------ */ + + if (arrayFieldsToDisplay.length > 0) + { + if (data.dataset != null && $.isArray(data.dataset)) + { + for (var i = 0; i < data.dataset.length; i++) + { + var record = data.dataset[i]; + var strHtml = ''; + + if (data.checkboxes != null && data.checkboxes != "") + { + strHtml += ''; + } + + $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + + if (record.hasOwnProperty(data.selectedFields[i])) + { + strHtml += ''; + } + }); + + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + $.each(data.additionalColumns, function(i, additionalColumn) { + + if (record.hasOwnProperty(additionalColumn)) + { + strHtml += ''; + } + + }); + } + + strHtml += ''; + + $("#filterTableDataset > tbody").append(strHtml); + } + } + else + { + // console.log("No dataset!!!"); + } + } + else + { + console.log("No fields to display!!!"); + } + } + else + { + console.log("No data!!!"); + } + + callTableSorter(); + + }) + .fail(function(jqXHR, textStatus, errorThrown) { + // alert(textStatus); + }); +} + +function resetTableDataset() +{ + $("#filterTableDataset > thead > tr").html(""); + $("#filterTableDataset > tbody").html(""); +} + +$(document).ready(function() { + + $("[data-toggle='collapse']").click(function() { + + var filterOptionsStatus = sessionStorage.getItem('filter-options-status'); + + if (filterOptionsStatus != null && filterOptionsStatus == 'closed') + { + sessionStorage.setItem('filter-options-status', 'open'); + } + else + { + sessionStorage.setItem('filter-options-status', 'closed'); + } + + }); + + var filterOptionsStatus = sessionStorage.getItem('filter-options-status'); + if (filterOptionsStatus != null && filterOptionsStatus == 'open') + { + $('.collapse').collapse("show"); + } + + $("#saveCustomFilterButton").click(function() { + if ($("#customFilterDescription").val() != '') + { + $.ajax({ + url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/saveFilter', + method: "POST", + data: { + customFilterDescription: $("#customFilterDescription").val(), + fhc_controller_id: fhc_controller_id, + filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method + } + }) + .done(function(data, textStatus, jqXHR) { + + refreshSideMenu() + + }).fail(function(jqXHR, textStatus, errorThrown) { + // alert(textStatus); + }); + } + else + { + alert("Please fill te description of this filter"); + } + }); + + renderSelectedFields(); + + renderSelectedFilters(); + + renderTableDataset(); + +}); diff --git a/public/js/NavigationWidget.js b/public/js/NavigationWidget.js new file mode 100644 index 000000000..4c1bc8aa1 --- /dev/null +++ b/public/js/NavigationWidget.js @@ -0,0 +1,171 @@ +/** + * Used by the NavigationWidget + */ + +var fhc_controller_id = FHC_Ajax_Client.getUrlParameter('fhc_controller_id'); + +/** + * + */ +function printNavItem(item, depth = 1) +{ + strMenu = ""; + var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : ''; + + strMenu += '
  • '; + + if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') + { + strMenu += ''; + } + + // Handle fhc_controller_id + if (fhc_controller_id != null && fhc_controller_id != '' && item['link'] != '#') + { + if (item['link'].indexOf('?') != -1) + { + item['link'] += '&'; + } + else + { + item['link'] += '?'; + } + + item['link'] += 'fhc_controller_id=' + fhc_controller_id; + } + + strMenu += ''; + + if (item['icon'] != 'undefined') + { + strMenu += ' '; + } + + strMenu += item['description']; + + if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) + { + strMenu += ''; + } + + strMenu += ''; + + if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') + { + strMenu += ' (' + item['subscriptDescription'] + ')'; + strMenu += ''; + } + + if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) + { + var level = ''; + if (depth === 1) + { + level = 'second'; + } + else if (depth > 1) + { + level = 'third'; + } + + strMenu += ''; + } + + strMenu += '
  • '; + + return strMenu; +} + +function renderSideMenu() +{ + $.ajax({ + url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Navigation/menu', + method: "GET", + data: { + navigation_widget_called: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method + } + }) + .done(function(data, textStatus, jqXHR) { + + if (data != null) + { + var strMenu = ''; + + printCollapseIcon(); + + jQuery.each(data, function(i, e) { + strMenu += printNavItem(e); + }); + + $("#side-menu").html(strMenu); + $("#side-menu").metisMenu(); + } + + if (typeof sideMenuHook == 'function') + { + sideMenuHook(); + } + + }).fail(function(jqXHR, textStatus, errorThrown) { + // alert(textStatus); + }); +} + + +function printCollapseIcon() +{ + // Hiding/showing navigation menu - works only with sb admin 2 template!! + if(!$("#collapseicon").length) + $("#side-menu").parent().append('
    '); + + $("#collapseicon").click(function() { + $("#page-wrapper").css('margin-left', '0px'); + $("#side-menu").hide(); + $("#collapseicon").hide(); + $("#collapseinicon").show(); + }); + + $("#collapseinicon").click(function() { + $("#page-wrapper").css('margin-left', '250px'); + $("#side-menu").show(); + $("#collapseicon").show(); + $("#collapseinicon").hide(); + }); +} + +function renderHeaderMenu() +{ + $.ajax({ + url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Navigation/header', + method: "GET", + data: { + navigation_widget_called: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method + } + }) + .done(function(data, textStatus, jqXHR) { + + if (data != null) + { + jQuery.each(data, function(i, e) { + $(".menu-header-items").append('' + i + ''); + }); + } + + }).fail(function(jqXHR, textStatus, errorThrown) { + // alert(textStatus); + }); +} + +$(document).ready(function() { + + renderHeaderMenu(); + + renderSideMenu(); + +}); diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 90509e288..c4233f67e 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -1,25 +1,5 @@ -/** - * - */ -function getUrlParameter(sParam) -{ - var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), - sParameterName, - i; - for (i = 0; i < sURLVariables.length; i++) - { - sParameterName = sURLVariables[i].split('='); - - if (sParameterName[0] === sParam) - { - return sParameterName[1]; - } - } -} - -var fhc_controller_id = getUrlParameter("fhc_controller_id"); +var fhc_controller_id = FHC_Ajax_Client.getUrlParameter('fhc_controller_id'); const CONTROLLER_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"+FHC_JS_DATA_STORAGE_OBJECT.called_path; /** @@ -161,7 +141,6 @@ function openZgvInfoForPrestudent(prestudent_id) var screenwidth = screen.width; var popupwidth = 760; var marginleft = screenwidth - popupwidth; - console.log(marginleft); window.open("../getZgvInfoForPrestudent/" + prestudent_id, "_blank","resizable=yes,scrollbars=yes,width="+popupwidth+",height="+screen.height+",left="+marginleft); } @@ -308,11 +287,10 @@ function updateNotiz(notizId, personId, data) function getStudienjahrEndAjax() { $.ajax({ - url: CONTROLLER_URL+"/getStudienjahrEnd?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + url: CONTROLLER_URL+"/getStudienjahrEnd?fhc_controller_id="+fhc_controller_id, method: "GET", success: function(data, textStatus, jqXHR) { - console.log(data); //var gerdate = data.substring(8, 10) + "."+data.substring(5, 7) + "." + data.substring(0, 4); var engdate = $.datepicker.parseDate("yy-mm-dd", data); var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); @@ -328,11 +306,10 @@ function getStudienjahrEndAjax() function getParkedDateAjax(personid) { $.ajax({ - url: CONTROLLER_URL+"/getParkedDate/"+personid+"?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + url: CONTROLLER_URL+"/getParkedDate/"+personid+"?fhc_controller_id="+fhc_controller_id, method: "GET", success: function(data, textStatus, jqXHR) { - console.log(data); refreshParking(data); refreshLog(); getStudienjahrEndAjax(); @@ -347,7 +324,7 @@ function getParkedDateAjax(personid) function parkPersonAjax(personid, date) { $.ajax({ - url: CONTROLLER_URL+"/park?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + url: CONTROLLER_URL+"/park?fhc_controller_id="+fhc_controller_id, method: "POST", data: { @@ -368,7 +345,7 @@ function parkPersonAjax(personid, date) function unparkPersonAjax(personid) { $.ajax({ - url: CONTROLLER_URL+"/unpark?fhc_controller_id="+getUrlParameter("fhc_controller_id"), + url: CONTROLLER_URL+"/unpark?fhc_controller_id="+fhc_controller_id, method: "POST", data: { @@ -391,7 +368,7 @@ function unparkPersonAjax(personid) function refreshLog() { var personid = $("#hiddenpersonid").val(); - $("#logs").load('../reloadLogs/' + personid, + $("#logs").load('../reloadLogs/' + personid + '?fhc_controller_id=' + fhc_controller_id, function () { //readd tablesorter diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 02e693314..5e96edd66 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -38,7 +38,8 @@ function appendTableActionsHtml() url: window.location.pathname.replace('infocenter/InfoCenter', 'Filters/rowNumber'), method: "GET", data: { - fhc_controller_id: getUrlParameter("fhc_controller_id") + fhc_controller_id: getUrlParameter("fhc_controller_id"), + filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method }, dataType: "json" }) From 4b1eacff21856e12240bae18e8829446eb739791 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 18 May 2018 14:07:11 +0200 Subject: [PATCH 17/62] Added includes for ajaxlib and navigationwidget into home.php --- application/views/home.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/home.php b/application/views/home.php index cd032bc71..598413c32 100644 --- a/application/views/home.php +++ b/application/views/home.php @@ -5,7 +5,9 @@ $this->load->view('templates/FHC-Header', 'jquery' => true, 'bootstrap' => true, 'fontawesome' => true, - 'sbadmintemplate' => true + 'sbadmintemplate' => true, + 'ajaxlib' => true, + 'navigationwidget' => true ) ); ?> From 459f1a3be14fd07c4fbf59cc1c2c6993f7887075 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 22 May 2018 14:46:23 +0200 Subject: [PATCH 18/62] error is now not shown if no documents to accept during freigabe --- application/controllers/system/infocenter/InfoCenter.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index f4d22311e..353d9d18c 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -421,7 +421,8 @@ class InfoCenter extends FHC_Controller $result = $this->DokumentprestudentModel->setAcceptedDocuments($prestudent_id, $dokument_kurzbzs); - if (isError($result)) + //returns null if no documents to accept + if ($result !== null && isError($result)) { show_error($result->retval); } @@ -1079,7 +1080,7 @@ class InfoCenter extends FHC_Controller if (!empty($receiver)) { //Freigabeinformationmail sent from default system mail to studiengang mail(s) - $sent = $this->maillib->send('', $receiver, $subject, $email); + $sent = $this->maillib->send('', $receiver, $subject, $email, '', null, null, 'noHtml'); if (!$sent) $this->loglib->logError('Error when sending Freigabe mail'); From cecda9e51247f959b7f1c10497f733c8d35dff6d Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 22 May 2018 15:57:48 +0200 Subject: [PATCH 19/62] added alternative Text to Freigabemail (e.g. when not viewed as HTML) --- application/controllers/system/infocenter/InfoCenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 353d9d18c..35b4d2879 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1080,7 +1080,7 @@ class InfoCenter extends FHC_Controller if (!empty($receiver)) { //Freigabeinformationmail sent from default system mail to studiengang mail(s) - $sent = $this->maillib->send('', $receiver, $subject, $email, '', null, null, 'noHtml'); + $sent = $this->maillib->send('', $receiver, $subject, $email, '', null, null, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Inhalt vollständig darzustellen.'); if (!$sent) $this->loglib->logError('Error when sending Freigabe mail'); From ae052ec212c18587b78ee52ffdd9622047cdbf6f Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 22 May 2018 17:17:09 +0200 Subject: [PATCH 20/62] updated phrases for infocenter, layoutchanges phrasesupdate --- .../system/infocenter/infocenterData.php | 2 +- .../system/infocenter/infocenterDetails.php | 2 +- system/phrasesupdate.php | 196 +++++++++++++++--- 3 files changed, 165 insertions(+), 35 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index f15ece66a..d33b33bd4 100755 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -213,7 +213,7 @@ ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', ucfirst($this->p->t('global', 'sperrdatum')), ucfirst($this->p->t('global', 'gesperrtVon')), - 'ParkedDate' + ucfirst($this->p->t('global', 'parkdatum')) ), 'formatRaw' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index ae628f927..5da3dc1c1 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -42,7 +42,7 @@
    - p->t('global', 'wirdBearbeitetVon') . ' :' ?> + p->t('global', 'wirdBearbeitetVon') . ':' ?> 'core', + 'category' => 'global', + 'phrase' => 'bis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'bis', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'until', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), //******************************* CORE/ui @@ -1925,6 +1944,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'bewerber', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'BewerberIn', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'applicant', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'infocenter', 'category' => 'infocenter', @@ -2164,7 +2203,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'absagegrund', @@ -2183,7 +2223,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'absage', @@ -2202,7 +2243,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'absageBestaetigen', @@ -2221,7 +2263,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'absageBestaetigenTxt', @@ -2242,7 +2285,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'notizHinzufuegen', @@ -2261,7 +2305,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'tageKeineAktion', @@ -2280,7 +2325,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'anAusgewaehlte', @@ -2299,7 +2345,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'interessentAbweisen', @@ -2318,7 +2365,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'interessentFreigeben', @@ -2337,7 +2385,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'interessentFreigebenTxt', @@ -2359,7 +2408,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'freigabeBestaetigen', @@ -2378,7 +2428,8 @@ $phrases = array( 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'nachfrist', @@ -2392,12 +2443,13 @@ $phrases = array( ), array( 'sprache' => 'English', - 'text' => '', + 'text' => 'extended deadline', 'description' => '', 'insertvon' => 'system' ) ) - ),array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'bewerbungsfrist', @@ -2411,12 +2463,13 @@ $phrases = array( ), array( 'sprache' => 'English', - 'text' => '', + 'text' => 'application deadline', 'description' => '', 'insertvon' => 'system' ) ) - ), array( + ), + array( 'app' => 'infocenter', 'category' => 'infocenter', 'phrase' => 'notizAendern', @@ -2435,8 +2488,87 @@ $phrases = array( 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'parken', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'parken', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'park', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'ausparken', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ausparken', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'unpark', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'geparkt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'geparkt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'parked', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'parkdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'parkdatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'parking date', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) - ); @@ -2444,7 +2576,7 @@ $phrases = array( //***** INSERT into phrase_tbl if new app + category + phrase found in phrasen-array. //***** INSERT into phrasentext_tbl if new text found in phrasen-phrases-array, conciders every language apart. -foreach($phrases as $phrase) +foreach ($phrases as $phrase) { $qry = "SELECT phrase_id FROM system.tbl_phrase @@ -2454,12 +2586,12 @@ foreach($phrases as $phrase) phrase=" . $db->db_add_param($phrase['phrase']); //*** CHECK PHRASE - if($result = $db->db_query($qry)) + if ($result = $db->db_query($qry)) { $phrase_id = ''; //phrase not existing -> insert phrase and get last inserted phrase_id - if($db->db_num_rows($result) === 0) + if ($db->db_num_rows($result) === 0) { $qry_insert = "INSERT INTO system.tbl_phrase( app, @@ -2474,18 +2606,18 @@ foreach($phrases as $phrase) $db->db_add_param($phrase['insertvon']) . ','. $db->db_add_param($phrase['category']) . ');'; - if($db->db_query($qry_insert)) + if ($db->db_query($qry_insert)) { $new = true; $qry_lastId = "SELECT currval('system.tbl_phrase_phrase_id_seq') as id"; - if($db->db_query($qry_lastId)) + if ($db->db_query($qry_lastId)) { - if($obj = $db->db_fetch_object()) + if ($obj = $db->db_fetch_object()) { $phrase_id = $obj->id; } - } + } echo 'Kategorie/Phrase: ' . $phrase['category'] . '/' . $phrase['phrase'] . ' hinzugefügt
    '; } else @@ -2493,19 +2625,19 @@ foreach($phrases as $phrase) } //phrase existing -> get phrase_id - else + else { if ($obj = $db->db_fetch_object($result)) { $phrase_id = $obj->phrase_id; - } + } echo 'Kategorie/Phrase: ' . $phrase['category'] . '/' . $phrase['phrase'] . ' vorhanden.
    '; } //*** CHECK PHRASENTEXT //loop through languages - foreach($phrase['phrases'] as $phrase_phrases) + foreach ($phrase['phrases'] as $phrase_phrases) { $language = $phrase_phrases['sprache']; @@ -2518,10 +2650,10 @@ foreach($phrases as $phrase) sprache='" . $language . "'"; - if($result_language = $db->db_query($qry_language)) + if ($result_language = $db->db_query($qry_language)) { //if phrasentext not existing in certain language -> insert - if($db->db_num_rows($result_language) === 0 && !empty($phrase_phrases['text'])) + if ($db->db_num_rows($result_language) === 0 && !empty($phrase_phrases['text'])) { $qry_insert = "INSERT INTO system.tbl_phrasentext( phrase_id, @@ -2542,7 +2674,7 @@ foreach($phrases as $phrase) ' now(),'. $db->db_add_param($phrase_phrases['insertvon']) . ');'; - if($db->db_query($qry_insert)) + if ($db->db_query($qry_insert)) { echo '-- Phrasentext ' . strtoupper(substr($phrase_phrases['sprache'], 0, 3)) . ': ' . $phrase_phrases['text'] . ' hinzugefügt
    '; } @@ -2558,5 +2690,3 @@ foreach($phrases as $phrase) if(!$new) echo 'Keine neuen Phrasen
    '; - - From 3c7fc4bdbdf44c49b1b603b63e638d0a86282b9d Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 22 May 2018 18:08:54 +0200 Subject: [PATCH 21/62] - AjaxLib.css: better veil - AjaxLib.js: - Renamed object FHC_Ajax_Client to FHC_AjaxClient - Removed REMOTE_CONTROLLER property from object data used as ajax call parameter - Adapted FilterWidget.js to use AjaxLib.js - Adapted NavigationWidget.js to use AjaxLib.js - Introduced fhc_controller_id in method _printNavItem of NavigationWidget.js - Adapted infocenterDetails.js and infocenterPersonDataset.js to use changed libraries --- public/css/AjaxLib.css | 11 +- public/js/AjaxLib.js | 65 +- public/js/FilterWidget.js | 1271 +++++++++-------- public/js/NavigationWidget.js | 325 +++-- public/js/infocenter/infocenterDetails.js | 2 +- .../js/infocenter/infocenterPersonDataset.js | 2 +- 6 files changed, 856 insertions(+), 820 deletions(-) diff --git a/public/css/AjaxLib.css b/public/css/AjaxLib.css index d80ab95a6..61c9f9234 100644 --- a/public/css/AjaxLib.css +++ b/public/css/AjaxLib.css @@ -1,14 +1,13 @@ .veil { position: absolute; + z-index: 9999; top: 0; left: 0; - height: 98%; - width: 99%; + height: 100%; + width: 100%; background-color: white; - border-width: 1px; - border-style: solid; - border-color: black; - background-image: url("/public/imgages/loader.gif"); + border-width: 0px; + background-image: url("../images/loader.gif"); background-repeat: no-repeat; background-position: center; } diff --git a/public/js/AjaxLib.js b/public/js/AjaxLib.js index 3597af7ac..abd079635 100644 --- a/public/js/AjaxLib.js +++ b/public/js/AjaxLib.js @@ -37,9 +37,9 @@ const REMOTE_CONTROLLER = "remoteController"; const FHC_CONTROLLER_ID = "fhc_controller_id"; /** - * Definition and initialization of object FHC_Ajax_Client + * Definition and initialization of object FHC_AjaxClient */ -var FHC_Ajax_Client = { +var FHC_AjaxClient = { //------------------------------------------------------------------------------------------------------------------ // Properties @@ -54,7 +54,7 @@ var FHC_Ajax_Client = { * ajaxCallParameters is an object */ ajaxCallGet: function(remoteController, controllerParameters, ajaxCallParameters) { - FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_GET_METHOD, ajaxCallParameters); + FHC_AjaxClient._ajaxCall(remoteController, controllerParameters, HTTP_GET_METHOD, ajaxCallParameters); }, /** @@ -63,7 +63,7 @@ var FHC_Ajax_Client = { * ajaxCallParameters is an object */ ajaxCallPost: function(remoteController, controllerParameters, ajaxCallParameters) { - FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_POST_METHOD, ajaxCallParameters); + FHC_AjaxClient._ajaxCall(remoteController, controllerParameters, HTTP_POST_METHOD, ajaxCallParameters); }, /** @@ -87,7 +87,7 @@ var FHC_Ajax_Client = { * Checks if the response is an error */ isError: function(response) { - return !FHC_Ajax_Client.isSuccess(response); + return !FHC_AjaxClient.isSuccess(response); }, /** @@ -96,7 +96,7 @@ var FHC_Ajax_Client = { hasData: function(response) { var hasData = false; - if (FHC_Ajax_Client.isSuccess(response)) + if (FHC_AjaxClient.isSuccess(response)) { if ((jQuery.type(response.retval) == "object" && !jQuery.isEmptyObject(response.retval)) || (jQuery.isArray(response.retval) && response.retval.length > 0) @@ -116,7 +116,7 @@ var FHC_Ajax_Client = { getData: function(response) { var data = null; - if (FHC_Ajax_Client.hasData(response)) + if (FHC_AjaxClient.hasData(response)) { data = response.retval; } @@ -147,20 +147,20 @@ var FHC_Ajax_Client = { showVeil: function(veilTimeout) { if (typeof veilTimeout == "number") { - FHC_Ajax_Client._veilTimeout = veilTimeout; + FHC_AjaxClient._veilTimeout = veilTimeout; } else { - FHC_Ajax_Client._veilTimeout = VEIL_TIMEOUT; + FHC_AjaxClient._veilTimeout = VEIL_TIMEOUT; } - FHC_Ajax_Client._showVeil(); + FHC_AjaxClient._showVeil(); }, /** * Hide a veil that was shown before */ hideVeil: function() { - FHC_Ajax_Client._hideVeil(); + FHC_AjaxClient._hideVeil(); }, //------------------------------------------------------------------------------------------------------------------ @@ -212,10 +212,10 @@ var FHC_Ajax_Client = { */ _onSuccess: function(response, textStatus, jqXHR) { - FHC_Ajax_Client._printDebug(this._data, response); // debug time! + FHC_AjaxClient._printDebug(this._data, response); // debug time! // Call the success callback saved in _successCallback property - // NOTE: this is not referred to FHC_Ajax_Client but to the ajax object + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object this._successCallback(response); }, @@ -224,10 +224,10 @@ var FHC_Ajax_Client = { */ _onError: function(jqXHR, textStatus, errorThrown) { - FHC_Ajax_Client._printDebug(this._data, null, errorThrown); // debug time! + FHC_AjaxClient._printDebug(this._data, null, errorThrown); // debug time! // Call the error callback saved in _errorCallback property - // NOTE: this is not referred to FHC_Ajax_Client but to the ajax object + // NOTE: this is not referred to FHC_AjaxClient but to the ajax object this._errorCallback(jqXHR, textStatus, errorThrown); }, @@ -249,12 +249,12 @@ var FHC_Ajax_Client = { * Method to show the veil */ _showVeil: function() { - if (FHC_Ajax_Client._veilCallersCounter == 0) + if (FHC_AjaxClient._veilCallersCounter == 0) { $("
    ").appendTo('body'); } - FHC_Ajax_Client._veilCallersCounter++; + FHC_AjaxClient._veilCallersCounter++; }, /** @@ -262,14 +262,14 @@ var FHC_Ajax_Client = { */ _hideVeil: function() { window.setTimeout(function() { - if (FHC_Ajax_Client._veilCallersCounter >= 0) + if (FHC_AjaxClient._veilCallersCounter >= 0) { - if (FHC_Ajax_Client._veilCallersCounter > 0) + if (FHC_AjaxClient._veilCallersCounter > 0) { - FHC_Ajax_Client._veilCallersCounter--; + FHC_AjaxClient._veilCallersCounter--; } - if (FHC_Ajax_Client._veilCallersCounter == 0) + if (FHC_AjaxClient._veilCallersCounter == 0) { $(".veil").remove(); } @@ -319,7 +319,7 @@ var FHC_Ajax_Client = { if (typeof remoteController == "string" && remoteController.trim() != "") { // Is it possible to generate the URL - if ((url = FHC_Ajax_Client._generateRouterURI(remoteController)) != null) + if ((url = FHC_AjaxClient._generateRouterURI(remoteController)) != null) { ajaxParameters.url = url; } @@ -339,11 +339,10 @@ var FHC_Ajax_Client = { if (typeof controllerParameters == "object") { // Copy the properties of controllerParameters into a new object - var data = FHC_Ajax_Client._cpObjProps(controllerParameters); - // Remote controller - data[REMOTE_CONTROLLER] = remoteController; + var data = FHC_AjaxClient._cpObjProps(controllerParameters); + // fhc_controller_id is given if present - data[FHC_CONTROLLER_ID] = FHC_Ajax_Client.getUrlParameter(FHC_CONTROLLER_ID); + data[FHC_CONTROLLER_ID] = FHC_AjaxClient.getUrlParameter(FHC_CONTROLLER_ID); // Stores them into ajaxParameters // NOTE: property data is not possible to get later, @@ -367,7 +366,7 @@ var FHC_Ajax_Client = { if (typeof ajaxCallParameters.errorCallback == "function") { ajaxParameters._errorCallback = ajaxCallParameters.errorCallback; // save as property the callback error - ajaxParameters.error = FHC_Ajax_Client._onError; // function to call if an error occurred + ajaxParameters.error = FHC_AjaxClient._onError; // function to call if an error occurred } else { @@ -382,7 +381,7 @@ var FHC_Ajax_Client = { if (typeof ajaxCallParameters.successCallback == "function") { ajaxParameters._successCallback = ajaxCallParameters.successCallback; // save as property the callback success - ajaxParameters.success = FHC_Ajax_Client._onSuccess; // function to call if succeeded + ajaxParameters.success = FHC_AjaxClient._onSuccess; // function to call if succeeded } else { @@ -397,8 +396,8 @@ var FHC_Ajax_Client = { if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000) { ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout; - ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil; - ajaxParameters.complete = FHC_Ajax_Client._hideVeil; + ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; + ajaxParameters.complete = FHC_AjaxClient._hideVeil; } else if(ajaxCallParameters.veilTimeout == 0) { @@ -413,8 +412,8 @@ var FHC_Ajax_Client = { else // is not present or the value is invalid { ajaxParameters._veilTimeout = VEIL_TIMEOUT; - ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil; - ajaxParameters.complete = FHC_Ajax_Client._hideVeil; + ajaxParameters.beforeSend = FHC_AjaxClient._showVeil; + ajaxParameters.complete = FHC_AjaxClient._hideVeil; } } @@ -438,7 +437,7 @@ var FHC_Ajax_Client = { */ _ajaxCall: function(remoteController, controllerParameters, type, ajaxCallParameters) { // Retrives the parameters for the ajax call - var ajaxParameters = FHC_Ajax_Client._checkAndGenerateAjaxParams(remoteController, controllerParameters, type, ajaxCallParameters); + var ajaxParameters = FHC_AjaxClient._checkAndGenerateAjaxParams(remoteController, controllerParameters, type, ajaxCallParameters); // Checks the given parameters if they are present and are valid if (ajaxParameters != null) diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 2cf63d9ef..190eb30ea 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -1,677 +1,695 @@ -var fhc_controller_id = FHC_Ajax_Client.getUrlParameter('fhc_controller_id'); +/** + * FH-Complete + * + * @package + * @author + * @copyright Copyright (c) 2016 fhcomplete.org + * @license GPLv3 + * @link https://fhcomplete.org + * @since Version 1.0.0 + */ +/** + * Global function used by MavigationWidget JS + */ function sideMenuHook() { $(".remove-filter").click(function() { - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/deleteCustomFilter', - method: "POST", - data: { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/deleteCustomFilter', + { filter_id: $(this).attr('value') + }, + { + successCallback: refreshSideMenu // NOTE: to be checked } - }) - .done(function(data, textStatus, jqXHR) { - - refreshSideMenu(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - + ); }); } -function dndSF() -{ - $(".filter-select-field-dnd-span").draggable({ - containment: "parent", - cursor: "move", - opacity: 0.4, - revert: "invalid", - revertDuration: 200, - drag: function(event, ui) { +/** + * FHC_FilterWidget + */ +var FHC_FilterWidget = { + //------------------------------------------------------------------------------------------------------------------ + // Public methods - var padding = 20; - var draggedElement = $(this); + /** + * + */ + renderSelectedFields: function() { + // + FHC_AjaxClient.ajaxCallGet( + 'system/Filters/selectFields', + { + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { - $(".filter-select-field-dnd-span").each(function(i, e) { + FHC_FilterWidget._resetEventsSF(); - if ($(this).attr('id') != draggedElement.attr('id')) - { - $(this).removeClass("selection-after"); - $(this).removeClass("selection-before"); - - var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); - - if (event.pageX > ($(this).offset().left - (padding / 2)) - && event.pageX < ($(this).offset().left + $(this).width() + (padding / 2))) + if (data != null) { - if (event.pageX > elementCenter) + var arrayFieldsToDisplay = []; + + if (data.columnsAliases != null && $.isArray(data.columnsAliases)) { - $(this).addClass("selection-after"); - $(this).removeClass("selection-before"); + arrayFieldsToDisplay = data.columnsAliases; } - else if (event.pageX < elementCenter) + else if (data.selectedFields != null && $.isArray(data.selectedFields)) { - $(this).addClass("selection-before"); - $(this).removeClass("selection-after"); + arrayFieldsToDisplay = data.selectedFields; + } + + for (var i = 0; i < arrayFieldsToDisplay.length; i++) + { + var fieldToDisplay = arrayFieldsToDisplay[i]; + var fieldName = data.selectedFields[i]; + + var strHtml = ''; + + strHtml += ''; + strHtml += fieldToDisplay; + strHtml += ''; + strHtml += ' X '; + strHtml += ''; + $("#filterSelectFieldsDnd").append(strHtml); + } + + var strDropDown = ''; + $("#addField").append(strDropDown); + + for (var i = 0; i < data.allSelectedFields.length; i++) + { + var fieldName = data.allSelectedFields[i]; + var fieldToDisplay = data.allSelectedFields[i]; + + if (data.selectedFields.indexOf(fieldName) < 0) + { + if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + { + fieldToDisplay = data.allColumnsAliases[i]; + } + + strDropDown = ''; + $("#addField").append(strDropDown); + } } } + + FHC_FilterWidget._dndSF(); + FHC_FilterWidget._addEventsSF(); } + } + ); + }, - }); - - } - }); - - $(".filter-select-field-dnd-span").droppable({ - accept: ".filter-select-field-dnd-span", - drop: function(event, ui) { - - var padding = 20; - var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); - var draggedElement = ui.helper; - - if (event.pageX > elementCenter) + /** + * + */ + renderSelectedFilters: function() { + // + FHC_AjaxClient.ajaxCallGet( + 'system/Filters/selectFilters', { - draggedElement.insertAfter($(this)); - } - else if (event.pageX < elementCenter) + filter_page: FHC_FilterWidget._getFilterPage() + }, { - draggedElement.insertBefore($(this)); - } + successCallback: function(data, textStatus, jqXHR) { - $(this).removeClass("selection-before"); - $(this).removeClass("selection-after"); + FHC_FilterWidget._resetEventsSFilters(); - draggedElement.css({left: '0px', top: '10px'}); - - var arrayDndId = []; - - $(".filter-select-field-dnd-span").each(function(i, e) { - - arrayDndId[i] = $(this).attr('id').replace('dnd', ''); - - }); - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/sortSelectedFields', - method: "POST", - data: { - selectedFieldsLst: arrayDndId, - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - resetSelectedFields(); - renderSelectedFields(); - - renderTableDataset(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - - } - }); -} - -function resetEventsSF() -{ - $("#addField").off('change'); - $(".remove-field").off('click'); -} - -function addEventsSF() -{ - $("#addField").change(function(event) { - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/addSelectedFields', - method: "POST", - data: { - fieldName: $(this).val(), - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - resetSelectedFields(); - renderSelectedFields(); - - renderTableDataset(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - - }); - - $(".remove-field").click(function(event) { - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/removeSelectedFields', - method: "POST", - data: { - fieldName: $(this).attr('fieldToRemove'), - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - resetSelectedFields(); - renderSelectedFields(); - - renderTableDataset(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - - }); -} - -function renderSelectedFields() -{ - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/selectFields', - method: "GET", - data: { - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - }, - dataType: "json" - }) - .done(function(data, textStatus, jqXHR) { - - resetEventsSF(); - - if (data != null) - { - var arrayFieldsToDisplay = []; - - if (data.columnsAliases != null && $.isArray(data.columnsAliases)) - { - arrayFieldsToDisplay = data.columnsAliases; - } - else if (data.selectedFields != null && $.isArray(data.selectedFields)) - { - arrayFieldsToDisplay = data.selectedFields; - } - - for (var i = 0; i < arrayFieldsToDisplay.length; i++) - { - var fieldToDisplay = arrayFieldsToDisplay[i]; - var fieldName = data.selectedFields[i]; - - var strHtml = ''; - - strHtml += ''; - strHtml += fieldToDisplay; - strHtml += ''; - strHtml += ' X '; - strHtml += ''; - $("#filterSelectFieldsDnd").append(strHtml); - } - - var strDropDown = ''; - $("#addField").append(strDropDown); - - for (var i = 0; i < data.allSelectedFields.length; i++) - { - var fieldName = data.allSelectedFields[i]; - var fieldToDisplay = data.allSelectedFields[i]; - - if (data.selectedFields.indexOf(fieldName) < 0) - { - if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + if (data != null) { - fieldToDisplay = data.allColumnsAliases[i]; + var strDropDown = ''; + $("#addFilter").append(strDropDown); + + for (var i = 0; i < data.selectedFilters.length; i++) + { + var selectedFilters = '
    '; + + selectedFilters += ''; + selectedFilters += data.selectedFiltersAliases[i]; + selectedFilters += ''; + + selectedFilters += FHC_FilterWidget._getSelectedFilterFields( + data.selectedFiltersMetaData[i], + data.selectedFiltersActiveFilters[i], + data.selectedFiltersActiveFiltersOperation[i], + data.selectedFiltersActiveFiltersOption[i] + ); + + selectedFilters += ''; + selectedFilters += ''; + selectedFilters += ''; + + selectedFilters += '
    '; + + $("#selectedFilters").append(selectedFilters); + } + + for (var i = 0; i < data.allSelectedFields.length; i++) + { + var fieldName = data.allSelectedFields[i]; + var fieldToDisplay = data.allSelectedFields[i]; + + if (data.selectedFilters.indexOf(fieldName) < 0) + { + if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + { + fieldToDisplay = data.allColumnsAliases[i]; + } + + strDropDown = ''; + $("#addFilter").append(strDropDown); + } + } } - strDropDown = ''; - $("#addField").append(strDropDown); + FHC_FilterWidget._addEventsSFilters(); } } - } + ); + }, - dndSF(); - addEventsSF(); - }) - .fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); -} - -function resetSelectedFields() -{ - $("#filterSelectFieldsDnd").html(""); - $("#addField").html(""); -} - -function resetEventsSFilters() -{ - $("#addFilter").off('change'); -} - -function addEventsSFilters() -{ - $("#addFilter").change(function(event) { - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/addSelectedFilters', - method: "POST", - data: { - fieldName: $(this).val(), - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - resetSelectedFilters(); - renderSelectedFilters(); - - renderTableDataset(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - - }); - - $(".select-filter-operation").change(function() { - - if ($(this).val() == "set" || $(this).val() == "nset") - { - $(this).parent().parent().find(".select-filter-operation-value").addClass("hidden-control"); - $(this).parent().parent().find(".select-filter-option").addClass("hidden-control"); - - $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', true); - $(this).parent().parent().find(".select-filter-option").prop('disabled', true); - } - else - { - $(this).parent().parent().find(".select-filter-operation-value").removeClass("hidden-control"); - $(this).parent().parent().find(".select-filter-option").removeClass("hidden-control"); - - $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', false); - $(this).parent().parent().find(".select-filter-option").prop('disabled', false); - } - - }); - - $("#applyFilter").click(function() { - - var selectFilterName = []; - var selectFilterOperation = []; - var selectFilterOperationValue = []; - var selectFilterOption = []; - - $("#selectedFilters > div").each(function(i, e) { - var tmpSelectFilterName = $(this).find('.hidden-field-name').val(); - var tmpSelectFilterOperation = $(this).find('.select-filter-operation').val(); - var tmpSelectFilterOperationValue = $(this).find('.select-filter-operation-value:enabled').val(); - var tmpSelectFilterOption = $(this).find('.select-filter-option:enabled').val(); - - selectFilterName.push(tmpSelectFilterName); - selectFilterOperation.push(tmpSelectFilterOperation); - selectFilterOperationValue.push(tmpSelectFilterOperationValue != null ? tmpSelectFilterOperationValue : ""); - selectFilterOption.push(tmpSelectFilterOption != null ? tmpSelectFilterOption : ""); - }); - - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/applyFilter', - method: "POST", - data: { - filterNames: selectFilterName, - filterOperations: selectFilterOperation, - filterOperationValues: selectFilterOperationValue, - filterOptions: selectFilterOption, - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - // Success - - }).fail(function(jqXHR, textStatus, errorThrown) { - - // Error - - }).always(function() { - - location.reload(); - - }); - - }); - - $(".remove-selected-filter").click(function(event) { - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/removeSelectedFilters', - method: "POST", - data: { - fieldName: $(this).attr('filterToRemove'), - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - resetSelectedFilters(); - renderSelectedFilters(); - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); - }); - -} - -function renderSelectedFilterFields(metaData, activeFilters, activeFiltersOperation, activeFiltersOption) -{ - var html = ''; - - if (metaData.type.toLowerCase().indexOf("int") >= 0) - { - html = ''; - html += ' '; - html += ''; - html += ''; - html += ' '; - html += ''; - } - if (metaData.type.toLowerCase().indexOf('varchar') >= 0 || metaData.type.toLowerCase() == 'text') - { - html = ''; - html += ' '; - html += ''; - html += ''; - html += ' '; - html += ''; - } - if (metaData.type.toLowerCase().indexOf('bool') >= 0) - { - html = ''; - html += ' '; - html += ''; - html += ''; - html += ' '; - html += ''; - } - if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0) - { - var classOperation = 'form-control select-filter-operation-value'; - var classOption = 'form-control select-filter-option'; - var disabled = ""; - - if (activeFiltersOperation == "set" || activeFiltersOperation == "nset") - { - classOperation += ' hidden-control'; - classOption += ' hidden-control'; - disabled = "disabled"; - } - - html = ''; - html += ' '; - html += ''; - html += ''; - html += ' '; - html += ''; - html += ''; - html += ' '; - html += ''; - } - - html += ''; - html += ' '; - html += ''; - - return html; -} - -function renderSelectedFilters() -{ - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/selectFilters', - method: "GET", - data: { - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - }, - dataType: "json" - }) - .done(function(data, textStatus, jqXHR) { - - resetEventsSFilters(); - - if (data != null) - { - var strDropDown = ''; - $("#addFilter").append(strDropDown); - - for (var i = 0; i < data.selectedFilters.length; i++) + /** + * + */ + renderTableDataset: function() { + // + FHC_AjaxClient.ajaxCallGet( + 'system/Filters/tableDataset', { - var selectedFilters = '
    '; - - selectedFilters += ''; - selectedFilters += data.selectedFiltersAliases[i]; - selectedFilters += ''; - - selectedFilters += renderSelectedFilterFields( - data.selectedFiltersMetaData[i], - data.selectedFiltersActiveFilters[i], - data.selectedFiltersActiveFiltersOperation[i], - data.selectedFiltersActiveFiltersOption[i] - ); - - selectedFilters += ''; - selectedFilters += ''; - selectedFilters += ''; - - selectedFilters += '
    '; - - $("#selectedFilters").append(selectedFilters); - } - - for (var i = 0; i < data.allSelectedFields.length; i++) + filter_page: FHC_FilterWidget._getFilterPage() + }, { - var fieldName = data.allSelectedFields[i]; - var fieldToDisplay = data.allSelectedFields[i]; + successCallback: function(data, textStatus, jqXHR) { - if (data.selectedFilters.indexOf(fieldName) < 0) - { - if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + FHC_FilterWidget._resetTableDataset(); + + if (data != null) { - fieldToDisplay = data.allColumnsAliases[i]; - } + if (data.checkboxes != null) + { + $("#filterTableDataset > thead > tr").append("
    "); + } - strDropDown = ''; - $("#addFilter").append(strDropDown); - } - } - } + var arrayFieldsToDisplay = []; - addEventsSFilters(); - }) - .fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); -} - -function resetSelectedFilters() -{ - $("#addFilter").html(""); - $("#selectedFilters").html(""); -} - -function callTableSorter() -{ - // Checks if the table contains data (rows) - if ($('#filterTableDataset').find('tbody:empty').length == 0 - && $('#filterTableDataset').find('tr:empty').length == 0 - && $('#filterTableDataset').hasClass('table-condensed')) - { - $("#filterTableDataset").tablesorter({ - widgets: ["zebra", "filter"] - }); - - var config = $('#filterTableDataset')[0].config; - $.tablesorter.updateAll(config, true, null); - } -} - -function renderTableDataset() -{ - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/tableDataset', - method: "GET", - data: { - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - }, - dataType: "json" - }) - .done(function(data, textStatus, jqXHR) { - - resetTableDataset(); - - if (data != null) - { - if (data.checkboxes != null) - { - $("#filterTableDataset > thead > tr").append(""); - } - - var arrayFieldsToDisplay = []; - - if (data.columnsAliases != null && $.isArray(data.columnsAliases) && data.columnsAliases.length > 0) - { - arrayFieldsToDisplay = data.columnsAliases; - } - else if (data.selectedFields != null && $.isArray(data.selectedFields)) - { - arrayFieldsToDisplay = data.selectedFields; - } - - /* ------------------------------------------------------------------------------------------------ */ - if (data.checkboxes != null && data.checkboxes != "") - { - $("#filterTableDataset > thead > tr").html(""); - } - - for (var i = 0; i < arrayFieldsToDisplay.length; i++) - { - var th = arrayFieldsToDisplay[i]; - - $("#filterTableDataset > thead > tr").append(""); - } - - if (data.additionalColumns != null && $.isArray(data.additionalColumns)) - { - for (var i = 0; i < data.additionalColumns.length; i++) - { - var th = data.additionalColumns[i]; - - $("#filterTableDataset > thead > tr").append(""); - } - } - /* ------------------------------------------------------------------------------------------------ */ - - if (arrayFieldsToDisplay.length > 0) - { - if (data.dataset != null && $.isArray(data.dataset)) - { - for (var i = 0; i < data.dataset.length; i++) - { - var record = data.dataset[i]; - var strHtml = ''; + if (data.columnsAliases != null && $.isArray(data.columnsAliases) && data.columnsAliases.length > 0) + { + arrayFieldsToDisplay = data.columnsAliases; + } + else if (data.selectedFields != null && $.isArray(data.selectedFields)) + { + arrayFieldsToDisplay = data.selectedFields; + } + /* ------------------------------------------------------------------------------------------------ */ if (data.checkboxes != null && data.checkboxes != "") { - strHtml += ''; + $("#filterTableDataset > thead > tr").html(""); } - $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + for (var i = 0; i < arrayFieldsToDisplay.length; i++) + { + var th = arrayFieldsToDisplay[i]; - if (record.hasOwnProperty(data.selectedFields[i])) - { - strHtml += ''; - } - }); + $("#filterTableDataset > thead > tr").append(""); + } if (data.additionalColumns != null && $.isArray(data.additionalColumns)) { - $.each(data.additionalColumns, function(i, additionalColumn) { + for (var i = 0; i < data.additionalColumns.length; i++) + { + var th = data.additionalColumns[i]; - if (record.hasOwnProperty(additionalColumn)) - { - strHtml += ''; - } - - }); + $("#filterTableDataset > thead > tr").append(""); + } } + /* ------------------------------------------------------------------------------------------------ */ - strHtml += ''; + if (arrayFieldsToDisplay.length > 0) + { + if (data.dataset != null && $.isArray(data.dataset)) + { + for (var i = 0; i < data.dataset.length; i++) + { + var record = data.dataset[i]; + var strHtml = ''; - $("#filterTableDataset > tbody").append(strHtml); + if (data.checkboxes != null && data.checkboxes != "") + { + strHtml += ''; + } + + $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + + if (record.hasOwnProperty(data.selectedFields[i])) + { + strHtml += ''; + } + }); + + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + $.each(data.additionalColumns, function(i, additionalColumn) { + + if (record.hasOwnProperty(additionalColumn)) + { + strHtml += ''; + } + + }); + } + + strHtml += ''; + + $("#filterTableDataset > tbody").append(strHtml); + } + } + else + { + // console.log("No dataset!!!"); + } + } + else + { + console.log("No fields to display!!!"); + } + } + else + { + console.log("No data!!!"); + } + + FHC_FilterWidget._callTableSorter(); + + } + } + ); + }, + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * + */ + _dndSF: function() { + $(".filter-select-field-dnd-span").draggable({ + containment: "parent", + cursor: "move", + opacity: 0.4, + revert: "invalid", + revertDuration: 200, + drag: function(event, ui) { + + var padding = 20; + var draggedElement = $(this); + + $(".filter-select-field-dnd-span").each(function(i, e) { + + if ($(this).attr('id') != draggedElement.attr('id')) + { + $(this).removeClass("selection-after"); + $(this).removeClass("selection-before"); + + var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); + + if (event.pageX > ($(this).offset().left - (padding / 2)) + && event.pageX < ($(this).offset().left + $(this).width() + (padding / 2))) + { + if (event.pageX > elementCenter) + { + $(this).addClass("selection-after"); + $(this).removeClass("selection-before"); + } + else if (event.pageX < elementCenter) + { + $(this).addClass("selection-before"); + $(this).removeClass("selection-after"); + } + } + } + + }); + + } + }); + + $(".filter-select-field-dnd-span").droppable({ + accept: ".filter-select-field-dnd-span", + drop: function(event, ui) { + + var padding = 20; + var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); + var draggedElement = ui.helper; + + if (event.pageX > elementCenter) + { + draggedElement.insertAfter($(this)); + } + else if (event.pageX < elementCenter) + { + draggedElement.insertBefore($(this)); + } + + $(this).removeClass("selection-before"); + $(this).removeClass("selection-after"); + + draggedElement.css({left: '0px', top: '10px'}); + + var arrayDndId = []; + + $(".filter-select-field-dnd-span").each(function(i, e) { + + arrayDndId[i] = $(this).attr('id').replace('dnd', ''); + + }); + + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/sortSelectedFields', + { + selectedFieldsLst: arrayDndId, + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFields(); + + FHC_FilterWidget.renderSelectedFields(); + FHC_FilterWidget.renderTableDataset(); + } + } + ); + } + }); + }, + + /** + * + */ + _resetEventsSF: function() { + $("#addField").off('change'); + $(".remove-field").off('click'); + }, + + /** + * + */ + _addEventsSF: function() { + $("#addField").change(function(event) { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/addSelectedFields', + { + fieldName: $(this).val(), + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFields(); + + FHC_FilterWidget.renderSelectedFields(); + FHC_FilterWidget.renderTableDataset(); } } - else + ); + }); + + $(".remove-field").click(function(event) { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/removeSelectedFields', { - // console.log("No dataset!!!"); + fieldName: $(this).attr('fieldToRemove'), + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFields(); + + FHC_FilterWidget.renderSelectedFields(); + FHC_FilterWidget.renderTableDataset(); + } } + ); + }); + }, + + /** + * + */ + _resetSelectedFields: function() { + $("#filterSelectFieldsDnd").html(""); + $("#addField").html(""); + }, + + /** + * + */ + _resetEventsSFilters: function() { + $("#addFilter").off('change'); + }, + + /** + * + */ + _addEventsSFilters: function() { + $("#addFilter").change(function(event) { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/addSelectedFilters', + { + fieldName: $(this).val(), + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFilters(); + + FHC_FilterWidget.renderSelectedFilters(); + FHC_FilterWidget.renderTableDataset(); + } + } + ); + }); + + $(".select-filter-operation").change(function() { + + if ($(this).val() == "set" || $(this).val() == "nset") + { + $(this).parent().parent().find(".select-filter-operation-value").addClass("hidden-control"); + $(this).parent().parent().find(".select-filter-option").addClass("hidden-control"); + + $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', true); + $(this).parent().parent().find(".select-filter-option").prop('disabled', true); } else { - console.log("No fields to display!!!"); + $(this).parent().parent().find(".select-filter-operation-value").removeClass("hidden-control"); + $(this).parent().parent().find(".select-filter-option").removeClass("hidden-control"); + + $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', false); + $(this).parent().parent().find(".select-filter-option").prop('disabled', false); } - } - else + + }); + + $("#applyFilter").click(function() { + + var selectFilterName = []; + var selectFilterOperation = []; + var selectFilterOperationValue = []; + var selectFilterOption = []; + + $("#selectedFilters > div").each(function(i, e) { + var tmpSelectFilterName = $(this).find('.hidden-field-name').val(); + var tmpSelectFilterOperation = $(this).find('.select-filter-operation').val(); + var tmpSelectFilterOperationValue = $(this).find('.select-filter-operation-value:enabled').val(); + var tmpSelectFilterOption = $(this).find('.select-filter-option:enabled').val(); + + selectFilterName.push(tmpSelectFilterName); + selectFilterOperation.push(tmpSelectFilterOperation); + selectFilterOperationValue.push(tmpSelectFilterOperationValue != null ? tmpSelectFilterOperationValue : ""); + selectFilterOption.push(tmpSelectFilterOption != null ? tmpSelectFilterOption : ""); + }); + + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/applyFilter', + { + filterNames: selectFilterName, + filterOperations: selectFilterOperation, + filterOperationValues: selectFilterOperationValue, + filterOptions: selectFilterOption, + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFilters(); + + location.reload(); + } + } + ); + }); + + $(".remove-selected-filter").click(function(event) { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/removeSelectedFilters', + { + fieldName: $(this).attr('filterToRemove'), + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFilters(); + + location.reload(); + } + } + ); + }); + + }, + + /** + * + */ + _getSelectedFilterFields: function(metaData, activeFilters, activeFiltersOperation, activeFiltersOption) { + var html = ''; + + if (metaData.type.toLowerCase().indexOf("int") >= 0) { - console.log("No data!!!"); + html = ''; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ''; + } + if (metaData.type.toLowerCase().indexOf('varchar') >= 0 || metaData.type.toLowerCase() == 'text') + { + html = ''; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ''; + } + if (metaData.type.toLowerCase().indexOf('bool') >= 0) + { + html = ''; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ''; + } + if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0) + { + var classOperation = 'form-control select-filter-operation-value'; + var classOption = 'form-control select-filter-option'; + var disabled = ""; + + if (activeFiltersOperation == "set" || activeFiltersOperation == "nset") + { + classOperation += ' hidden-control'; + classOption += ' hidden-control'; + disabled = "disabled"; + } + + html = ''; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ''; + html += ''; + html += ' '; + html += ''; } - callTableSorter(); + html += ''; + html += ' '; + html += ''; - }) - .fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); -} + return html; + }, -function resetTableDataset() -{ - $("#filterTableDataset > thead > tr").html(""); - $("#filterTableDataset > tbody").html(""); -} + /** + * + */ + _resetSelectedFilters: function() { + $("#addFilter").html(""); + $("#selectedFilters").html(""); + }, + /** + * + */ + _callTableSorter: function() { + // Checks if the table contains data (rows) + if ($('#filterTableDataset').find('tbody:empty').length == 0 + && $('#filterTableDataset').find('tr:empty').length == 0 + && $('#filterTableDataset').hasClass('table-condensed')) + { + $("#filterTableDataset").tablesorter({ + widgets: ["zebra", "filter"] + }); + + var config = $('#filterTableDataset')[0].config; + $.tablesorter.updateAll(config, true, null); + } + }, + + /** + * + */ + _resetTableDataset: function() { + $("#filterTableDataset > thead > tr").html(""); + $("#filterTableDataset > tbody").html(""); + }, + + /** + * + */ + _getFilterPage: function() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; + } +}; + + +/** + * When JQuery is up + */ $(document).ready(function() { $("[data-toggle='collapse']").click(function() { @@ -698,22 +716,17 @@ $(document).ready(function() { $("#saveCustomFilterButton").click(function() { if ($("#customFilterDescription").val() != '') { - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Filters/saveFilter', - method: "POST", - data: { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/saveFilter', + { customFilterDescription: $("#customFilterDescription").val(), - fhc_controller_id: fhc_controller_id, - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: refreshSideMenu // NOTE: to be checked } - }) - .done(function(data, textStatus, jqXHR) { - - refreshSideMenu() - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); + ); } else { @@ -721,10 +734,8 @@ $(document).ready(function() { } }); - renderSelectedFields(); - - renderSelectedFilters(); - - renderTableDataset(); + FHC_FilterWidget.renderSelectedFields(); + FHC_FilterWidget.renderSelectedFilters(); + FHC_FilterWidget.renderTableDataset(); }); diff --git a/public/js/NavigationWidget.js b/public/js/NavigationWidget.js index 4c1bc8aa1..8b3405c26 100644 --- a/public/js/NavigationWidget.js +++ b/public/js/NavigationWidget.js @@ -1,171 +1,198 @@ /** - * Used by the NavigationWidget - */ - -var fhc_controller_id = FHC_Ajax_Client.getUrlParameter('fhc_controller_id'); - -/** + * FH-Complete * + * @package + * @author + * @copyright Copyright (c) 2016 fhcomplete.org + * @license GPLv3 + * @link https://fhcomplete.org + * @since Version 1.0.0 */ -function printNavItem(item, depth = 1) -{ - strMenu = ""; - var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : ''; - strMenu += '
  • '; +/** + * FHC_NavigationWidget + */ +var FHC_NavigationWidget = { + //------------------------------------------------------------------------------------------------------------------ + // Public methods - if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') - { - strMenu += ''; - } + /** + * Renders the header menu (top horizontal menu) + */ + renderHeaderMenu: function() { + // + FHC_AjaxClient.ajaxCallGet( + 'system/Navigation/header', + { + navigation_widget_called: FHC_NavigationWidget._getNavigationWidgetCalled() + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (data != null) + { + jQuery.each(data, function(i, e) { + $(".menu-header-items").append('' + i + ''); + }); + } + } + } + ); + }, - // Handle fhc_controller_id - if (fhc_controller_id != null && fhc_controller_id != '' && item['link'] != '#') - { - if (item['link'].indexOf('?') != -1) - { - item['link'] += '&'; - } - else - { - item['link'] += '?'; - } + /** + * Renders the side left menu + */ + renderSideMenu: function() { + // + FHC_AjaxClient.ajaxCallGet( + 'system/Navigation/menu', + { + navigation_widget_called: FHC_NavigationWidget._getNavigationWidgetCalled() + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (data != null) + { + var strMenu = ''; - item['link'] += 'fhc_controller_id=' + fhc_controller_id; - } + FHC_NavigationWidget._printCollapseIcon(); - strMenu += ''; + jQuery.each(data, function(i, e) { + strMenu += FHC_NavigationWidget._printNavItem(e); + }); - if (item['icon'] != 'undefined') - { - strMenu += ' '; - } + $("#side-menu").html(strMenu); + $("#side-menu").metisMenu(); + } - strMenu += item['description']; + if (typeof sideMenuHook == 'function') + { + sideMenuHook(); + } + } + } + ); + }, - if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) - { - strMenu += ''; - } + //------------------------------------------------------------------------------------------------------------------ + // Private methods - strMenu += ''; + /** + * + */ + _printCollapseIcon: function() { + // Hiding/showing navigation menu - works only with sb admin 2 template!! + if(!$("#collapseicon").length) + $("#side-menu").parent().append('
    '); - if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') - { - strMenu += ' (' + item['subscriptDescription'] + ')'; - strMenu += '
    '; - } - - if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) - { - var level = ''; - if (depth === 1) - { - level = 'second'; - } - else if (depth > 1) - { - level = 'third'; - } - - strMenu += ''; + $("#collapseinicon").click(function() { + $("#page-wrapper").css('margin-left', '250px'); + $("#side-menu").show(); + $("#collapseicon").show(); + $("#collapseinicon").hide(); + }); + }, + + /** + * + */ + _printNavItem: function(item, depth = 1) { + strMenu = ""; + var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : ''; + + strMenu += '
  • '; + + if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') + { + strMenu += ''; + } + + // Handle fhc_controller_id + var fhc_controller_id = FHC_AjaxClient.getUrlParameter('fhc_controller_id'); + if (fhc_controller_id != null && fhc_controller_id != '' && item['link'] != '#') + { + if (item['link'].indexOf('?') != -1) + { + item['link'] += '&'; + } + else + { + item['link'] += '?'; + } + + item['link'] += 'fhc_controller_id=' + fhc_controller_id; + } + + strMenu += ''; + + if (item['icon'] != 'undefined') + { + strMenu += ' '; + } + + strMenu += item['description']; + + if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) + { + strMenu += ''; + } + + strMenu += ''; + + if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined') + { + strMenu += ' (' + item['subscriptDescription'] + ')'; + strMenu += ''; + } + + if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0) + { + var level = ''; + if (depth === 1) + { + level = 'second'; + } + else if (depth > 1) + { + level = 'third'; + } + + strMenu += ''; + } + + strMenu += '
  • '; + + return strMenu; + }, + + /** + * Returns the URI of the caller + */ + _getNavigationWidgetCalled: function() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; } +}; - strMenu += ''; - - return strMenu; -} - -function renderSideMenu() -{ - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Navigation/menu', - method: "GET", - data: { - navigation_widget_called: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - if (data != null) - { - var strMenu = ''; - - printCollapseIcon(); - - jQuery.each(data, function(i, e) { - strMenu += printNavItem(e); - }); - - $("#side-menu").html(strMenu); - $("#side-menu").metisMenu(); - } - - if (typeof sideMenuHook == 'function') - { - sideMenuHook(); - } - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); -} - - -function printCollapseIcon() -{ - // Hiding/showing navigation menu - works only with sb admin 2 template!! - if(!$("#collapseicon").length) - $("#side-menu").parent().append('
    '); - - $("#collapseicon").click(function() { - $("#page-wrapper").css('margin-left', '0px'); - $("#side-menu").hide(); - $("#collapseicon").hide(); - $("#collapseinicon").show(); - }); - - $("#collapseinicon").click(function() { - $("#page-wrapper").css('margin-left', '250px'); - $("#side-menu").show(); - $("#collapseicon").show(); - $("#collapseinicon").hide(); - }); -} - -function renderHeaderMenu() -{ - $.ajax({ - url: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + 'system/Navigation/header', - method: "GET", - data: { - navigation_widget_called: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - } - }) - .done(function(data, textStatus, jqXHR) { - - if (data != null) - { - jQuery.each(data, function(i, e) { - $(".menu-header-items").append('' + i + ''); - }); - } - - }).fail(function(jqXHR, textStatus, errorThrown) { - // alert(textStatus); - }); -} - +/** + * When JQuery is up + */ $(document).ready(function() { - renderHeaderMenu(); + FHC_NavigationWidget.renderHeaderMenu(); - renderSideMenu(); + FHC_NavigationWidget.renderSideMenu(); }); diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 58738fa18..445e667cd 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -1,5 +1,5 @@ -var fhc_controller_id = FHC_Ajax_Client.getUrlParameter('fhc_controller_id'); +var fhc_controller_id = FHC_AjaxClient.getUrlParameter('fhc_controller_id'); const CONTROLLER_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"+FHC_JS_DATA_STORAGE_OBJECT.called_path; /** diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 5e96edd66..2c063ac4d 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -145,7 +145,7 @@ function refreshSideMenu() }) .done(function(data, textStatus, jqXHR) { - renderSideMenu(); + FHC_NavigationWidget.renderSideMenu(); }).fail(function(jqXHR, textStatus, errorThrown) { alert(textStatus); From 4775908685706b6a8e582a0e6f2a52951bf3ba53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 23 May 2018 07:55:08 +0200 Subject: [PATCH 22/62] Filter hidden Contacts from FAS --- rdf/kontakt.rdf.php | 5 +++-- rdf/kontakttyp.rdf.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rdf/kontakt.rdf.php b/rdf/kontakt.rdf.php index f4ab8fce8..426c17fea 100644 --- a/rdf/kontakt.rdf.php +++ b/rdf/kontakt.rdf.php @@ -73,7 +73,8 @@ else function draw_rdf($row) { global $rdf_url; - + if($row->kontakttyp == 'hidden') + return; echo ' @@ -93,4 +94,4 @@ function draw_rdf($row) } ?> - \ No newline at end of file + diff --git a/rdf/kontakttyp.rdf.php b/rdf/kontakttyp.rdf.php index 9d7d373aa..c8bd02da3 100644 --- a/rdf/kontakttyp.rdf.php +++ b/rdf/kontakttyp.rdf.php @@ -49,6 +49,8 @@ if($kontakt->getKontakttyp()) { foreach ($kontakt->result as $row) { + if($row->kontakttyp == 'hidden') + continue; echo ' @@ -65,4 +67,4 @@ else } ?> - \ No newline at end of file + From 9925ff738a1d065e8025c14527fbbbc3080d0469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 23 May 2018 08:17:45 +0200 Subject: [PATCH 23/62] =?UTF-8?q?L=C3=B6schrechte=20f=C3=BCr=20Vilesci=20U?= =?UTF-8?q?ser=20auf=20system.tbl=5Flog=20erteilt=20zum=20Ausparken=20von?= =?UTF-8?q?=20Bewerbern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index c618b3535..4e58d232c 100755 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -2247,6 +2247,20 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } +// Berechtigungen fuer vilesci User erteilen auf system.tbl_log +if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_log' AND table_schema='system' AND grantee='vilesci' AND privilege_type='DELETE'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "GRANT DELETE ON system.tbl_log TO vilesci;"; + + if(!$db->db_query($qry)) + echo 'Permission Log: '.$db->db_last_error().'
    '; + else + echo 'Loeschrechte auf system.tbl_log für Vilesci User hinzugefügt'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From cd005940cfeb52f3200ad9a5ca0015eb2a35c214 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Wed, 23 May 2018 10:05:34 +0200 Subject: [PATCH 24/62] Delete-Berechtigungen fuer web User auf system.tbl_log --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index c618b3535..344517e83 100755 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -2247,6 +2247,20 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } +// Delete-Berechtigungen fuer web User erteilen auf system.tbl_log +if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_log' AND table_schema='system' AND grantee='web' AND privilege_type='DELETE'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "GRANT DELETE ON system.tbl_log TO web;"; + + if(!$db->db_query($qry)) + echo 'Permission Log: '.$db->db_last_error().'
    '; + else + echo 'Delete-Rechte auf system.tbl_log für Web User hinzugefügt'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From 77c8144e40f74a5ad3b752cd3e3b39965c9614df Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Wed, 23 May 2018 10:06:45 +0200 Subject: [PATCH 25/62] Datenschutz-Text in Incoming Tool --- cis/public/incoming/registration.php | 9 ++++++--- locale/de-AT/incoming.php | 12 +++++++++++- locale/en-US/incoming.php | 10 +++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cis/public/incoming/registration.php b/cis/public/incoming/registration.php index 71ff33a69..9dfb796a2 100644 --- a/cis/public/incoming/registration.php +++ b/cis/public/incoming/registration.php @@ -79,8 +79,11 @@ if(!isset($_POST['submit'])) echo '
    SelectSelect" + th + "" + th + "
    '; + strHtml += ''; + strHtml += '' + record[data.selectedFields[i]] + '' + record[additionalColumn] + '
    SelectSelectSelect" + th + "" + th + "
    '; - strHtml += ''; - strHtml += 'Select' + record[data.selectedFields[i]] + '" + th + "' + record[additionalColumn] + '" + th + "
    '; + strHtml += ''; + strHtml += '' + record[data.selectedFields[i]] + '' + record[additionalColumn] + '
    - - + + + + + @@ -137,7 +140,7 @@ echo ' - +
    '.$p->t('global/titel').' Pre'.$p->t('incoming/datenschutzHinweisRegistration').'
    '.$p->t('global/titel').' Pre
    '.$p->t('incoming/vorname').'*
    '.$p->t('incoming/nation').''.$p->t('incoming/nation').'*
    - +
    - +
    @@ -21,8 +21,8 @@
    - - + +
    - \ No newline at end of file + diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php index ee21b55e8..85682d2a4 100644 --- a/application/views/system/infocenter/anmerkungenZurBewerbung.php +++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php @@ -5,7 +5,7 @@ - + diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index b599b6b06..b7fbbd4a7 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -2,11 +2,11 @@
    p->t('infocenter','anmerkungenZurBewerbung')) ?>p->t('infocenter','anmerkungenZurBewerbung')) ?>
    - - - - - + + + + + @@ -35,14 +35,14 @@ 0): ?>
    -

    p->t('infocenter','nachzureichendeDokumente')) ?>

    +

    p->t('infocenter','nachzureichendeDokumente')) ?>

    p->t('global','name')) ?>p->t('global','typ')) ?>p->t('global','uploaddatum')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('infocenter','formalGeprueft')) ?>p->t('global','name')) ?>p->t('global','typ')) ?>p->t('global','uploaddatum')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('infocenter','formalGeprueft')) ?>
    - - - - + + + + diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 9bc9ea20d..f33abff79 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -27,7 +27,7 @@
    - +
    diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 5da3dc1c1..700c06569 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -42,14 +42,14 @@
    - p->t('global', 'wirdBearbeitetVon') . ':' ?> + p->t('global', 'wirdBearbeitetVon') . ':' ?>     p->t('ui', 'freigeben')) ?> + class="fa fa-sign-out"> p->t('ui', 'freigeben')) ?>
    @@ -59,7 +59,7 @@
    -

    p->t('global','stammdaten')) ?>

    +

    p->t('global','stammdaten')) ?>

    load->view('system/infocenter/stammdaten.php'); ?> load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> @@ -73,7 +73,7 @@
    -

    p->t('infocenter','dokumentenpruefung')) ?>

    +

    p->t('infocenter','dokumentenpruefung')) ?>

    load->view('system/infocenter/dokpruefung.php'); ?>
    @@ -87,7 +87,7 @@
    -

    p->t('infocenter', 'zgv') . ' - ' . ucfirst($this->p->t('lehre','pruefung'))?>

    +

    p->t('infocenter', 'zgv') . ' - ' . ucfirst($this->p->t('lehre','pruefung'))?>

    load->view('system/infocenter/zgvpruefungen.php'); ?> @@ -102,7 +102,7 @@
    -

    p->t('global','nachrichten')) ?>

    +

    p->t('global','nachrichten')) ?>

    @@ -121,7 +121,7 @@
    -

    p->t('global','notizen')) . ' & ' . ucfirst($this->p->t('global','aktivitaeten')) ?>

    +

    p->t('global','notizen')) . ' & ' . ucfirst($this->p->t('global','aktivitaeten')) ?>

    diff --git a/application/views/system/infocenter/logs.php b/application/views/system/infocenter/logs.php index a45034818..de97d5055 100644 --- a/application/views/system/infocenter/logs.php +++ b/application/views/system/infocenter/logs.php @@ -1,8 +1,8 @@
    p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
    - - + + diff --git a/application/views/system/infocenter/notizen.php b/application/views/system/infocenter/notizen.php index d0c13e5ee..53d289721 100644 --- a/application/views/system/infocenter/notizen.php +++ b/application/views/system/infocenter/notizen.php @@ -1,8 +1,8 @@
    p->t('global', 'datum')) ?>p->t('global', 'aktivitaet')) ?>p->t('global', 'datum')) ?>p->t('global', 'aktivitaet')) ?> User
    - - + + diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index 45c2326e9..709370012 100755 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -2,41 +2,41 @@
    p->t('global', 'datum')) ?>p->t('global', 'notiz')) ?>p->t('global', 'datum')) ?>p->t('global', 'notiz')) ?> User
    - + - + - + - + - + - + - + - +
    p->t('person','vorname')) ?>p->t('person','vorname')) ?> vorname ?>
    p->t('person','nachname')) ?>p->t('person','nachname')) ?> nachname ?>
    p->t('person','geburtsdatum')) ?>p->t('person','geburtsdatum')) ?> gebdatum), 'd.m.Y') ?>
    p->t('person','svnr')) ?>p->t('person','svnr')) ?> svnr ?>
    p->t('person','staatsbuergerschaft')) ?>p->t('person','staatsbuergerschaft')) ?> staatsbuergerschaft ?>
    p->t('person','geschlecht')) ?>p->t('person','geschlecht')) ?> geschlecht ?>
    p->t('person','geburtsnation')) ?>p->t('person','geburtsnation')) ?> geburtsnation ?>
    p->t('person','geburtsort')) ?>p->t('person','geburtsort')) ?> gebort ?>
    @@ -45,21 +45,21 @@ - + - - - + + + kontakte as $kontakt): ?> kontakttyp === 'email'): ?> - + kontakttyp === 'telefon'): ?> - +
    p->t('global','kontakt')) ?>p->t('global','kontakt')) ?>
    p->t('global','typ')) ?>p->t('global','kontakt')) ?>p->t('global','anmerkung')) ?>p->t('global','typ')) ?>p->t('global','kontakt')) ?>p->t('global','anmerkung')) ?>
    p->t('person','email')) ?>p->t('person','email')) ?> p->t('person','telefon')) ?>p->t('person','telefon')) ?> kontakttyp.'">';?> @@ -80,7 +80,7 @@ adressen as $adresse): ?>
    - p->t('person','adresse')) ?> + p->t('person','adresse')) ?> strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?> @@ -101,13 +101,13 @@  p->t('ui','nachrichtSenden') ?> + class="fa fa-envelope"> p->t('ui','nachrichtSenden') ?> zugangscode)): ?>
     p->t('infocenter','zugangBewerbung') ?> + target='_blank'> p->t('infocenter','zugangBewerbung') ?>
    diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 383dd5a62..7e9e142c0 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -27,7 +27,7 @@ prestudentstatus->bestaetigtam)): ?>
    - p->t('global', 'anStudiengangFreigegeben') ?> + p->t('global', 'anStudiengangFreigegeben') ?>
    @@ -49,7 +49,7 @@
    - + prestudentstatus->status_kurzbz)) { @@ -60,7 +60,7 @@
    - + prestudentstatus->studiensemester_kurzbz) ? $zgvpruefung->prestudentstatus->studiensemester_kurzbz : '' ?>
    @@ -73,7 +73,7 @@
    - + prestudentstatus->orgform)) ? ', ' : ''; @@ -90,18 +90,18 @@
    - + zgv_bez; ?>
    - +
    - + zgvort); else: @@ -127,7 +127,7 @@
    - + zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y'); if ($infoonly): @@ -143,7 +143,7 @@
    - + zgvnation_bez; else @@ -159,7 +159,7 @@ studiengangtyp === 'm') : ?>
    -
    +
    zgvmas_bez; @@ -173,7 +173,7 @@
    - + zgvmaort; else: @@ -186,7 +186,7 @@
    - + zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y'); if ($infoonly): @@ -201,7 +201,7 @@
    -
    +
    zgvmanation_bez; @@ -220,12 +220,12 @@
    @@ -248,7 +248,7 @@ class="d-inline float-right" required> @@ -259,7 +259,7 @@ class="btn btn-default" data-toggle="modal" data-target="#absageModal_prestudent_id ?>"> - p->t('ui', 'absagen') ?> + p->t('ui', 'absagen') ?>
    @@ -278,20 +278,20 @@ × + id="absageModalLabel">p->t('infocenter', 'absageBestaetigen') ?>
    @@ -322,7 +322,7 @@ data-toggle="modal" data-target="#freigabeModal_prestudent_id ?>" data-toggle="tooltip" title=""> - p->t('ui', 'freigabeAnStudiengang') ?> + p->t('ui', 'freigabeAnStudiengang') ?>
    @@ -339,20 +339,20 @@ + p->t('global', 'freigabeBestaetigen') ?>
    @@ -366,7 +366,7 @@
    prestudentstatus->bestaetigtam) ? '' : '' ?> - +
    diff --git a/application/views/system/messageList.php b/application/views/system/messageList.php index 6edd4f4b1..7a28478d8 100644 --- a/application/views/system/messageList.php +++ b/application/views/system/messageList.php @@ -6,11 +6,11 @@ $widthColumn = $msgExists === true ? 8 : 12; - - - - - + + + + + diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 85c003cfd..6b7b1a4ae 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -32,14 +32,14 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
    - +
    - +
    - +
     
    - +
    - + 1) diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index 4e513ad3e..ef5da3c6c 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -11,7 +11,7 @@
    From 9f1ea4c882a4286db7c7ea9a9f2a7ac0da2ff68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 23 May 2018 17:27:14 +0200 Subject: [PATCH 31/62] PHP Version Bugfix --- application/views/system/infocenter/infocenterFreigegeben.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 03733efe1..81d2adb34 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -183,7 +183,7 @@ 'Details', site_url('system/infocenter/InfoCenter/showDetails'), $datasetRaw->{'PersonId'}, - $this->input->get('fhc_controller_id') + (isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'') ); if ($datasetRaw->{'SendDate'} == null) From e691dc857899af0c0aac45ba78c31305189c768d Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 23 May 2018 18:57:39 +0200 Subject: [PATCH 32/62] - Removed _setControllerId method from controller InfoCenter - InfoCenter controller now uses setControllerId and getControllerId from FHC_Controller - Fixed URL query string character in method FHC_Controller->setControllerId --- .../system/infocenter/InfoCenter.php | 21 +++---------------- application/core/FHC_Controller.php | 10 ++++++++- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 35b4d2879..7fab61736 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -95,7 +95,9 @@ class InfoCenter extends FHC_Controller if(!$this->permissionlib->isBerechtigt('basis/person')) show_error('You have no Permission! You need Infocenter Role'); - $this->_setControllerId(); // sets the controller id + $this->setControllerId(); // sets the controller id + + $this->fhc_controller_id = $this->getControllerId(); $this->setNavigationMenuArray(); // sets property navigationMenuArray } @@ -1090,21 +1092,4 @@ class InfoCenter extends FHC_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } - - /** - * Sets the unique id for the called controller - */ - private function _setControllerId() - { - $fhc_controller_id = $this->input->get('fhc_controller_id'); - - if (!isset($fhc_controller_id) || empty($fhc_controller_id)) - { - $fhc_controller_id = uniqid(); - header('Location: '.$_SERVER['REQUEST_URI'].'?fhc_controller_id='.$fhc_controller_id); - exit; - } - - $this->fhc_controller_id = $fhc_controller_id; - } } diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 815c03da2..fc200d935 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -46,7 +46,15 @@ class FHC_Controller extends CI_Controller { $this->_controllerId = uniqid(); // generate a unique id // Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter - header(sprintf('Location: %s?%s=%s', $_SERVER['REQUEST_URI'], self::FHC_CONTROLLER_ID, $this->_controllerId)); + header( + sprintf( + 'Location: %s%s%s=%s', + $_SERVER['REQUEST_URI'], + strpos($_SERVER['REQUEST_URI'], '?') === false ? '?' : '&', // place the corret character to divide parameters + self::FHC_CONTROLLER_ID, + $this->_controllerId + ) + ); exit; // terminate immediately the execution of this controller } } From 45677d0ec4ec85f560e3756e0c23c3289e5d8965 Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Thu, 24 May 2018 10:31:51 +0200 Subject: [PATCH 33/62] Reversed order of list --- application/views/system/infocenter/infocenterFreigegeben.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 application/views/system/infocenter/infocenterFreigegeben.php diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php old mode 100644 new mode 100755 index 81d2adb34..8c0d5a6a8 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -171,7 +171,7 @@ ) ) ) - ORDER BY "LastAction" ASC + ORDER BY "LastAction" DESC ', 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), From 15e350ea3aa243c9b72749e164a78b0ab4c7db89 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 24 May 2018 12:37:50 +0200 Subject: [PATCH 34/62] FilterWidget: extended the functionality of the default_filter flag If only the "app" and "dataset_name" parameters are given, at the first loading of the FilterWidget: 1. Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name" that is set as default filter (default_filter = true) 2. Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as default filter (default_filter = true) 3. Do not load anything to avoid to retrive too many data from DB --- application/controllers/system/Filters.php | 86 ++++++----- application/models/system/Filters_model.php | 1 - application/widgets/FilterWidget.php | 155 +++++++++++--------- public/js/FilterWidget.js | 87 ++++++----- 4 files changed, 186 insertions(+), 143 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index fcf37f158..648868d61 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -39,11 +39,11 @@ class Filters extends VileSci_Controller $session = $this->_readSession($this->_getFilterUniqueId()); - $json->selectedFields = $session['selectedFields']; - $json->columnsAliases = $session['columnsAliases']; - $json->additionalColumns = $session['additionalColumns']; - $json->checkboxes = $session['checkboxes']; - $json->dataset = $session['dataset']; + $json->selectedFields = $this->_getFromSession('selectedFields'); + $json->columnsAliases = $this->_getFromSession('columnsAliases'); + $json->additionalColumns = $this->_getFromSession('additionalColumns'); + $json->checkboxes = $this->_getFromSession('checkboxes'); + $json->dataset = $this->_getFromSession('dataset'); $this->output->set_content_type('application/json')->set_output(json_encode($json)); } @@ -57,11 +57,11 @@ class Filters extends VileSci_Controller $session = $this->_readSession($this->_getFilterUniqueId()); - $json->allSelectedFields = $session['allSelectedFields']; - $json->allColumnsAliases = $session['allColumnsAliases']; + $json->allSelectedFields = $this->_getFromSession('allSelectedFields'); + $json->allColumnsAliases = $this->_getFromSession('allColumnsAliases'); - $json->selectedFields = $session['selectedFields']; - $json->columnsAliases = $session['columnsAliases']; + $json->selectedFields = $this->_getFromSession('selectedFields'); + $json->columnsAliases = $this->_getFromSession('columnsAliases'); $this->output->set_content_type('application/json')->set_output(json_encode($json)); } @@ -79,11 +79,11 @@ class Filters extends VileSci_Controller $session = $this->_readSession($filterUniqueId); - $allSelectedFields = $session['allSelectedFields']; - $allColumnsAliases = $session['allColumnsAliases']; + $allSelectedFields = $this->_getFromSession('allSelectedFields'); + $allColumnsAliases = $this->_getFromSession('allColumnsAliases'); - $json->selectedFields = $session['selectedFields']; - $json->columnsAliases = $session['columnsAliases']; + $json->selectedFields = $this->_getFromSession('selectedFields'); + $json->columnsAliases = $this->_getFromSession('columnsAliases'); if (isset($selectedFieldsLst) && is_array($selectedFieldsLst)) { @@ -121,10 +121,10 @@ class Filters extends VileSci_Controller $session = $this->_readSession($this->_getFilterUniqueId()); - $json->allSelectedFields = $session['allSelectedFields']; - $json->allColumnsAliases = $session['allColumnsAliases']; + $json->allSelectedFields = $this->_getFromSession('allSelectedFields'); + $json->allColumnsAliases = $this->_getFromSession('allColumnsAliases'); - $json->selectedFilters = $session['selectedFilters']; + $json->selectedFilters = $this->_getFromSession('selectedFilters'); $json->selectedFiltersAliases = array(); $json->selectedFiltersMetaData = array(); @@ -132,10 +132,10 @@ class Filters extends VileSci_Controller $json->selectedFiltersActiveFiltersOperation = array(); $json->selectedFiltersActiveFiltersOption = array(); - $metaData = $session['metaData']; - $activeFilters = $session['activeFilters']; - $activeFiltersOperation = $session['activeFiltersOperation']; - $activeFiltersOption = $session['activeFiltersOption']; + $metaData = $this->_getFromSession('metaData'); + $activeFilters = $this->_getFromSession('activeFilters'); + $activeFiltersOperation = $this->_getFromSession('activeFiltersOperation'); + $activeFiltersOption = $this->_getFromSession('activeFiltersOption'); for ($i = 0; $i < count($json->selectedFilters); $i++) { @@ -302,11 +302,11 @@ class Filters extends VileSci_Controller $session = $this->_readSession($filterUniqueId); - $allSelectedFields = $session['allSelectedFields']; - $allColumnsAliases = $session['allColumnsAliases']; + $allSelectedFields = $this->_getFromSession('allSelectedFields'); + $allColumnsAliases = $this->_getFromSession('allColumnsAliases'); - $selectedFields = $session['selectedFields']; - $columnsAliases = $session['columnsAliases']; + $selectedFields = $this->_getFromSession('selectedFields'); + $columnsAliases = $this->_getFromSession('columnsAliases'); if (($pos = array_search($fieldName, $selectedFields)) !== false) { @@ -341,10 +341,10 @@ class Filters extends VileSci_Controller $session = $this->_readSession($filterUniqueId); - $selectedFilters = $session['selectedFilters']; - $selectedFiltersActiveFilters = $session['activeFilters']; - $selectedFiltersActiveFiltersOperation = $session['activeFiltersOperation']; - $selectedFiltersActiveFiltersOption = $session['activeFiltersOption']; + $selectedFilters = $this->_getFromSession('selectedFilters'); + $selectedFiltersActiveFilters = $this->_getFromSession('activeFilters'); + $selectedFiltersActiveFiltersOperation = $this->_getFromSession('activeFiltersOperation'); + $selectedFiltersActiveFiltersOption = $this->_getFromSession('activeFiltersOption'); if (($pos = array_search($fieldName, $selectedFilters)) !== false) { @@ -379,11 +379,11 @@ class Filters extends VileSci_Controller $session = $this->_readSession($filterUniqueId); - $allSelectedFields = $session['allSelectedFields']; - $allColumnsAliases = $session['allColumnsAliases']; + $allSelectedFields = $this->_getFromSession('allSelectedFields'); + $allColumnsAliases = $this->_getFromSession('allColumnsAliases'); - $selectedFields = $session['selectedFields']; - $columnsAliases = $session['columnsAliases']; + $selectedFields = $this->_getFromSession('selectedFields'); + $columnsAliases = $this->_getFromSession('columnsAliases'); if (($pos = array_search($fieldName, $allSelectedFields)) !== false && array_search($fieldName, $selectedFields) === false) @@ -419,10 +419,10 @@ class Filters extends VileSci_Controller $session = $this->_readSession($filterUniqueId); - $selectedFilters = $session['selectedFilters']; - $selectedFiltersActiveFilters = $session['activeFilters']; - $selectedFiltersActiveFiltersOperation = $session['activeFiltersOperation']; - $selectedFiltersActiveFiltersOption = $session['activeFiltersOption']; + $selectedFilters = $this->_getFromSession('selectedFilters'); + $selectedFiltersActiveFilters = $this->_getFromSession('activeFilters'); + $selectedFiltersActiveFiltersOperation = $this->_getFromSession('activeFiltersOperation'); + $selectedFiltersActiveFiltersOption = $this->_getFromSession('activeFiltersOption'); if (!in_array($fieldName, $selectedFilters)) { @@ -487,7 +487,7 @@ class Filters extends VileSci_Controller $session = $this->_readSession($this->_getFilterUniqueId()); - $dataset = $session['dataset']; + $dataset = $this->_getFromSession('dataset'); if (is_array($dataset)) { @@ -540,4 +540,16 @@ class Filters extends VileSci_Controller return $_getFilterUniqueId; } + + /** + * + */ + private function _getFromSession($el) + { + $_getFromSession = null; + + if (isset($_SESSION[$el])) return $_SESSION[$el]; + + return $_getFromSession; + } } diff --git a/application/models/system/Filters_model.php b/application/models/system/Filters_model.php index d84cddf80..eb81dbb32 100644 --- a/application/models/system/Filters_model.php +++ b/application/models/system/Filters_model.php @@ -44,7 +44,6 @@ class Filters_model extends DB_Model $filterParametersArray = array( 'app' => $app, 'dataset_name' => $dataset_name, - 'default_filter' => false, 'array_length(description, 1) >' => 0, 'uid' => $uid ); diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index c209ae16b..fe74a661f 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -131,7 +131,7 @@ class FilterWidget extends Widget } // - if ($filterSessionArray[self::FILTER_ID] != $this->filterId) + if ($this->filterId <= 0 || $filterSessionArray[self::FILTER_ID] != $this->filterId) { // $this->_loadFilter(); @@ -143,75 +143,79 @@ class FilterWidget extends Widget // $this->FiltersModel->resetQuery(); - // - $this->dataset = @$this->FiltersModel->execReadOnlyQuery($this->_generateQuery()); - - // - $this->listFields = $this->FiltersModel->getExecutedQueryListFields(); - - // - $selectedFields = array(); - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::SELECTED_FIELDS])) + $query = $this->_generateQuery(); + if ($query != null) { - $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; - } + // + $this->dataset = @$this->FiltersModel->execReadOnlyQuery($query); - // - if (count($selectedFields) == 0) - { - $filterSessionArray[self::SELECTED_FIELDS] = $this->listFields; - } + // + $this->listFields = $this->FiltersModel->getExecutedQueryListFields(); - // - if ($this->columnsAliases != null && count($this->listFields) != count($this->columnsAliases)) - { - show_error('Parameter columnsAliases does not have a number of items equal to those returned by the query'); - } - - $filterSessionArray[self::COLUMNS_ALIASES] = $this->_getColumnAliasesFromPost(); - $filterSessionArray[self::CHECKBOXES] = $this->checkboxes; - - if ($this->app != null) - { - $filterSessionArray[self::APP_PARAMETER] = $this->app; - } - - if ($this->datasetName != null) - { - $filterSessionArray[self::DATASET_NAME_PARAMETER] = $this->datasetName; - } - - $filterSessionArray[self::ALL_SELECTED_FIELDS] = $this->listFields; - $filterSessionArray[self::ALL_COLUMNS_ALIASES] = $this->columnsAliases; - - /* ------------------------------------------------------------ */ - - $tmpDataset = null; - if (hasData($this->dataset)) - { - $tmpDataset = array(); - - for ($resultsCounter = 0; $resultsCounter < count($this->dataset->retval); $resultsCounter++) + // + $selectedFields = array(); + $filterSessionArray = $this->_readSession(); + if (isset($filterSessionArray[self::SELECTED_FIELDS])) { - $result = $this->dataset->retval[$resultsCounter]; - - $class = $this->_markRow($result); - $formattedResult = $this->_formatRaw($result); - $formattedResult->FILTER_CLASS_MARK_ROW = $class; - $tmpDataset[] = $formattedResult; + $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; } + + // + if (count($selectedFields) == 0) + { + $filterSessionArray[self::SELECTED_FIELDS] = $this->listFields; + } + + // + if ($this->columnsAliases != null && count($this->listFields) != count($this->columnsAliases)) + { + show_error('Parameter columnsAliases does not have a number of items equal to those returned by the query'); + } + + $filterSessionArray[self::COLUMNS_ALIASES] = $this->_getColumnAliasesFromPost(); + $filterSessionArray[self::CHECKBOXES] = $this->checkboxes; + + if ($this->app != null) + { + $filterSessionArray[self::APP_PARAMETER] = $this->app; + } + + if ($this->datasetName != null) + { + $filterSessionArray[self::DATASET_NAME_PARAMETER] = $this->datasetName; + } + + $filterSessionArray[self::ALL_SELECTED_FIELDS] = $this->listFields; + $filterSessionArray[self::ALL_COLUMNS_ALIASES] = $this->columnsAliases; + + /* ------------------------------------------------------------ */ + + $tmpDataset = null; + if (hasData($this->dataset)) + { + $tmpDataset = array(); + + for ($resultsCounter = 0; $resultsCounter < count($this->dataset->retval); $resultsCounter++) + { + $result = $this->dataset->retval[$resultsCounter]; + + $class = $this->_markRow($result); + $formattedResult = $this->_formatRaw($result); + $formattedResult->FILTER_CLASS_MARK_ROW = $class; + $tmpDataset[] = $formattedResult; + } + } + + $filterSessionArray[self::DATASET_PARAMETER] = $tmpDataset; + + /* ------------------------------------------------------------ */ + + // + $this->metaData = $this->FiltersModel->getExecutedQueryMetaData(); + + $filterSessionArray[self::METADATA_PARAMETER] = $this->metaData; } - $filterSessionArray[self::DATASET_PARAMETER] = $tmpDataset; - - /* ------------------------------------------------------------ */ - - // - $this->metaData = $this->FiltersModel->getExecutedQueryMetaData(); - - $filterSessionArray[self::METADATA_PARAMETER] = $this->metaData; - $this->_writeSession($filterSessionArray); // @@ -631,12 +635,13 @@ class FilterWidget extends Widget $whereParameters = null; - if ($this->filterId == null) + if ($this->filterId <= 0) { + // Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name" + // that is set as default filter (default_filter = true) $whereParameters = array( 'app' => $this->app, 'dataset_name' => $this->datasetName, - 'filter_kurzbz' => $this->filterKurzbz, 'uid' => getAuthUID(), 'default_filter' => true ); @@ -660,6 +665,24 @@ class FilterWidget extends Widget $jsonEncodedFilter = json_decode($filter->retval[0]->filter); } } + else // Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as + // default filter (default_filter = true) + { + $whereParameters = array( + 'app' => $this->app, + 'dataset_name' => $this->datasetName, + 'default_filter' => true + ); + + $filter = $this->FiltersModel->loadWhere($whereParameters); + if (hasData($filter)) + { + if (isset($filter->retval[0]->filter) && trim($filter->retval[0]->filter) != '') + { + $jsonEncodedFilter = json_decode($filter->retval[0]->filter); + } + } + } if ($jsonEncodedFilter != null) { @@ -1053,7 +1076,7 @@ class FilterWidget extends Widget */ private function _generateQuery() { - $query = $this->query; + $query = null;//$this->query; $activeFilters = array(); $activeFiltersOperation = array(); diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 190eb30ea..004f4ddac 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -81,20 +81,23 @@ var FHC_FilterWidget = { var strDropDown = ''; $("#addField").append(strDropDown); - for (var i = 0; i < data.allSelectedFields.length; i++) + if (data.allSelectedFields != null) { - var fieldName = data.allSelectedFields[i]; - var fieldToDisplay = data.allSelectedFields[i]; - - if (data.selectedFields.indexOf(fieldName) < 0) + for (var i = 0; i < data.allSelectedFields.length; i++) { - if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) - { - fieldToDisplay = data.allColumnsAliases[i]; - } + var fieldName = data.allSelectedFields[i]; + var fieldToDisplay = data.allSelectedFields[i]; - strDropDown = ''; - $("#addField").append(strDropDown); + if (data.selectedFields.indexOf(fieldName) < 0) + { + if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + { + fieldToDisplay = data.allColumnsAliases[i]; + } + + strDropDown = ''; + $("#addField").append(strDropDown); + } } } } @@ -126,44 +129,50 @@ var FHC_FilterWidget = { var strDropDown = ''; $("#addFilter").append(strDropDown); - for (var i = 0; i < data.selectedFilters.length; i++) + if (data.selectedFilters != null) { - var selectedFilters = '
    '; + for (var i = 0; i < data.selectedFilters.length; i++) + { + var selectedFilters = '
    '; - selectedFilters += ''; - selectedFilters += data.selectedFiltersAliases[i]; - selectedFilters += ''; + selectedFilters += ''; + selectedFilters += data.selectedFiltersAliases[i]; + selectedFilters += ''; - selectedFilters += FHC_FilterWidget._getSelectedFilterFields( - data.selectedFiltersMetaData[i], - data.selectedFiltersActiveFilters[i], - data.selectedFiltersActiveFiltersOperation[i], - data.selectedFiltersActiveFiltersOption[i] - ); + selectedFilters += FHC_FilterWidget._getSelectedFilterFields( + data.selectedFiltersMetaData[i], + data.selectedFiltersActiveFilters[i], + data.selectedFiltersActiveFiltersOperation[i], + data.selectedFiltersActiveFiltersOption[i] + ); - selectedFilters += ''; - selectedFilters += ''; - selectedFilters += ''; + selectedFilters += ''; + selectedFilters += ''; + selectedFilters += ''; - selectedFilters += '
    '; + selectedFilters += '
    '; - $("#selectedFilters").append(selectedFilters); + $("#selectedFilters").append(selectedFilters); + } } - for (var i = 0; i < data.allSelectedFields.length; i++) + if (data.allSelectedFields != null) { - var fieldName = data.allSelectedFields[i]; - var fieldToDisplay = data.allSelectedFields[i]; - - if (data.selectedFilters.indexOf(fieldName) < 0) + for (var i = 0; i < data.allSelectedFields.length; i++) { - if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) - { - fieldToDisplay = data.allColumnsAliases[i]; - } + var fieldName = data.allSelectedFields[i]; + var fieldToDisplay = data.allSelectedFields[i]; - strDropDown = ''; - $("#addFilter").append(strDropDown); + if (data.selectedFilters.indexOf(fieldName) < 0) + { + if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + { + fieldToDisplay = data.allColumnsAliases[i]; + } + + strDropDown = ''; + $("#addFilter").append(strDropDown); + } } } } @@ -279,7 +288,7 @@ var FHC_FilterWidget = { } else { - console.log("No fields to display!!!"); + // console.log("No fields to display!!!"); } } else From 505c15f558602365133f63f37f4d3faf55088f0d Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Thu, 24 May 2018 15:13:32 +0200 Subject: [PATCH 35/62] Adapted base-sql --- .../system/infocenter/infocenterFreigegeben.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 8c0d5a6a8..f2c279b0f 100755 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -69,7 +69,6 @@ INNER JOIN public.tbl_prestudent ps USING(prestudent_id) JOIN public.tbl_studiengang USING(studiengang_kz) WHERE pss.status_kurzbz = \'Interessent\' - AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id AND tbl_studiengang.typ in(\'b\') AND studiensemester_kurzbz IN ( @@ -88,7 +87,6 @@ JOIN public.tbl_studiengang USING(studiengang_kz) WHERE pss.status_kurzbz = \'Interessent\' AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\') - AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id AND tbl_studiengang.typ in(\'b\') AND studiensemester_kurzbz IN ( @@ -107,7 +105,6 @@ JOIN public.tbl_studiengang USING(studiengang_kz) WHERE pss.status_kurzbz = \'Interessent\' AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\') - AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id AND tbl_studiengang.typ in(\'b\') AND studiensemester_kurzbz IN ( @@ -126,7 +123,6 @@ JOIN public.tbl_studiengang USING(studiengang_kz) WHERE pss.status_kurzbz = \'Interessent\' AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\') - AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id AND tbl_studiengang.typ in(\'b\') AND studiensemester_kurzbz IN ( @@ -150,11 +146,7 @@ WHERE person_id=p.person_id AND tbl_studiengang.typ in(\'b\') - AND \'Interessent\' = (SELECT status_kurzbz FROM public.tbl_prestudentstatus - WHERE prestudent_id=tbl_prestudent.prestudent_id - ORDER BY datum DESC, insertamum DESC, ext_id DESC - LIMIT 1 - ) + AND EXISTS ( SELECT 1 @@ -163,7 +155,7 @@ WHERE prestudent_id = tbl_prestudent.prestudent_id AND status_kurzbz = \'Interessent\' - AND (bestaetigtam IS NOT NULL AND (bewerbung_abgeschicktamum is null OR bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')) + AND (bestaetigtam IS NOT NULL AND bewerbung_abgeschicktamum >= \''.$NOTBEFORE.'\') AND studiensemester_kurzbz IN ( SELECT studiensemester_kurzbz FROM public.tbl_studiensemester From 282b822b631d5df5be1106c8fc2850f6cdc7d5da Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 25 May 2018 15:10:50 +0200 Subject: [PATCH 36/62] - adapted infocenterdetails to work with new ajaxlib - layout change infocenter dataset - wrapping objects around javascript code --- .../system/infocenter/InfoCenter.php | 182 ++--- application/libraries/PersonLogLib.php | 47 +- .../views/system/infocenter/addNotiz.php | 1 + public/js/infocenter/infocenterDetails.js | 683 ++++++++++-------- .../js/infocenter/infocenterPersonDataset.js | 6 +- public/js/tablesort/tablesort.js | 126 ++-- 6 files changed, 542 insertions(+), 503 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 7fab61736..b63bae0ac 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -155,7 +155,7 @@ class InfoCenter extends FHC_Controller } /** - * unlocks page from edit by a person, redirects to overview filter page + * Unlocks page from edit by a person, redirects to overview filter page * @param $person_id */ public function unlockPerson($person_id) @@ -169,7 +169,7 @@ class InfoCenter extends FHC_Controller } /** - * Saves if a document has been formal geprueft. saves current timestamp if checked as geprueft, or null if not. + * Saves if a document has been formal geprueft. Saves current timestamp if checked as geprueft, or null if not. * @param $person_id */ public function saveFormalGeprueft($person_id) @@ -177,37 +177,36 @@ class InfoCenter extends FHC_Controller $akte_id = $this->input->post('akte_id'); $formalgeprueft = $this->input->post('formal_geprueft'); - if (!isset($akte_id) || !isset($formalgeprueft) || !isset($person_id)) - show_error('Parameters not set!'); + $json = false; - $akte = $this->AkteModel->load($akte_id); - - if (isError($akte)) + if (isset($akte_id) && isset($formalgeprueft) && isset($person_id)) { - show_error($akte->retval); + $akte = $this->AkteModel->load($akte_id); + + if (hasData($akte)) + { + $timestamp = ($formalgeprueft === 'true') ? date('Y-m-d H:i:s') : null; + $result = $this->AkteModel->update($akte_id, array('formal_geprueft_amum' => $timestamp)); + + if (isSuccess($result)) + { + $json = $timestamp; + + $this->_log( + $person_id, + 'saveformalgep', + array( + empty($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel, + is_null($timestamp) ? 'NULL' : $timestamp + ) + ); + } + } } - $timestamp = ($formalgeprueft === 'true') ? date('Y-m-d H:i:s') : null; - $result = $this->AkteModel->update($akte_id, array('formal_geprueft_amum' => $timestamp)); - - if (isError($result)) - { - show_error($result->retval); - } - - //write person log - $this->_log( - $person_id, - 'saveformalgep', - array( - empty($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel, - is_null($timestamp) ? 'NULL' : $timestamp - ) - ); - $this->output ->set_content_type('application/json') - ->set_output(json_encode($timestamp)); + ->set_output(json_encode($json)); } /** @@ -218,20 +217,13 @@ class InfoCenter extends FHC_Controller { $prestudent = $this->PrestudentModel->getLastPrestudent($person_id, true); - if (isError($prestudent)) - { - show_error($prestudent->retval); - } - - $jsonoutput = count($prestudent->retval) > 0 ? $prestudent->retval[0] : null; - $this->output ->set_content_type('application/json') - ->set_output(json_encode($jsonoutput)); + ->set_output(json_encode($prestudent)); } /** - * Gets Zugangsvoraussetzungen for a prestudents as a description text + * Gets Zugangsvoraussetzungen for a prestudent as a description text and shows them in a view * @param $prestudent_id */ public function getZgvInfoForPrestudent($prestudent_id) @@ -242,7 +234,11 @@ class InfoCenter extends FHC_Controller $studiengangkurzbz = $prestudentdata['studiengang_kurzbz']; $studiengangbezeichnung = $prestudentdata['studiengang_bezeichnung']; - $data = array('studiengang_bezeichnung' => $studiengangbezeichnung, 'studiengang_kurzbz' => $studiengangkurzbz, 'data' => null); + $data = array( + 'studiengang_bezeichnung' => $studiengangbezeichnung, + 'studiengang_kurzbz' => $studiengangkurzbz, + 'data' => null + ); if (hasData($studienordnung)) { @@ -255,54 +251,58 @@ class InfoCenter extends FHC_Controller } /** - * Saves a zgv for a prestudent. includes Ort, Datum, Nation for bachelor and master. + * Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master * @param $prestudent_id */ - public function saveZgvPruefung($prestudent_id) + public function saveZgvPruefung() { - // zgvdata - // Check for string null, in case dropdown changed to default value - $zgv_code = $this->input->post('zgv') === 'null' ? null : $this->input->post('zgv'); - $zgvort = $this->input->post('zgvort'); - $zgvdatum = $this->input->post('zgvdatum'); - $zgvdatum = empty($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d'); - $zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation'); + $prestudent_id = $this->input->post('prestudentid'); - //zgvmasterdata - $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); - $zgvmaort = $this->input->post('zgvmaort'); - $zgvmadatum = $this->input->post('zgvmadatum'); - $zgvmadatum = empty($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d'); - $zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation'); - - $result = $this->PrestudentModel->update( - $prestudent_id, - array( - 'zgv_code' => $zgv_code, - 'zgvort' => $zgvort, - 'zgvdatum' => $zgvdatum, - 'zgvnation' => $zgvnation_code, - 'zgvmas_code' => $zgvmas_code, - 'zgvmaort' => $zgvmaort, - 'zgvmadatum' => $zgvmadatum, - 'zgvmanation' => $zgvmanation_code, - 'updateamum' => date('Y-m-d H:i:s') - ) - ); - - if (isError($result)) + if (empty($prestudent_id)) + $result = error('Prestudentid missing'); + else { - show_error($result->retval); + // zgvdata + // Check for string null, in case dropdown changed to default value + $zgv_code = $this->input->post('zgv') === 'null' ? null : $this->input->post('zgv'); + $zgvort = $this->input->post('zgvort'); + $zgvdatum = $this->input->post('zgvdatum'); + $zgvdatum = empty($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d'); + $zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation'); + + //zgvmasterdata + $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); + $zgvmaort = $this->input->post('zgvmaort'); + $zgvmadatum = $this->input->post('zgvmadatum'); + $zgvmadatum = empty($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d'); + $zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation'); + + $result = $this->PrestudentModel->update( + $prestudent_id, + array( + 'zgv_code' => $zgv_code, + 'zgvort' => $zgvort, + 'zgvdatum' => $zgvdatum, + 'zgvnation' => $zgvnation_code, + 'zgvmas_code' => $zgvmas_code, + 'zgvmaort' => $zgvmaort, + 'zgvmadatum' => $zgvmadatum, + 'zgvmanation' => $zgvmanation_code, + 'updateamum' => date('Y-m-d H:i:s') + ) + ); + + if (isSuccess($result)) + { + //get extended Prestudent data for logging + $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + $this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id)); + } } - - //get extended Prestudent data for logging - $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); - - $this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id)); - $this->output ->set_content_type('application/json') - ->set_output(json_encode($result->retval)); + ->set_output(json_encode($result)); } /** @@ -450,16 +450,14 @@ class InfoCenter extends FHC_Controller $result = $this->NotizModel->addNotizForPerson($person_id, $titel, $text, $erledigt, $this->uid); - if (isError($result)) + if (isSuccess($result)) { - show_error($result->retval); + $this->_log($person_id, 'savenotiz', array($titel)); } - $this->_log($person_id, 'savenotiz', array($titel)); - $this->output ->set_content_type('application/json') - ->set_output(json_encode($result->retval)); + ->set_output(json_encode($result)); } /** @@ -484,19 +482,15 @@ class InfoCenter extends FHC_Controller ) ); - $json = false; - if (isSuccess($result)) { - $json = true; - //set log "Notiz updated" $this->_log($person_id, 'updatenotiz', array($titel)); } $this->output ->set_content_type('application/json') - ->set_output(json_encode($json)); + ->set_output(json_encode($result)); } /** @@ -567,14 +561,18 @@ class InfoCenter extends FHC_Controller } /** - * Initializes parking of a person, i.e. a person is not expected to do any actions while it is parked + * Initializes parking of a person, i.e. a person is not expected to do any actions while parked */ public function park() { $person_id = $this->input->post('person_id'); $date = $this->input->post('parkdate'); - $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->uid); + $result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->uid); + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode($result)); } /** @@ -584,7 +582,11 @@ class InfoCenter extends FHC_Controller { $person_id = $this->input->post('person_id'); - $this->personloglib->unPark($person_id); + $result = $this->personloglib->unPark($person_id); + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode($result)); } /** diff --git a/application/libraries/PersonLogLib.php b/application/libraries/PersonLogLib.php index 8145b88ac..e933f532e 100644 --- a/application/libraries/PersonLogLib.php +++ b/application/libraries/PersonLogLib.php @@ -91,7 +91,7 @@ class PersonLogLib * @param string $app * @param null $oe_kurzbz * @param null $user - * @return bool wether parking was successfull + * @return insert object */ public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null) { @@ -110,16 +110,13 @@ class PersonLogLib 'insertvon' => $user ); - $result = $this->ci->PersonLogModel->insert($data); - if (isSuccess($result)) - return true; - else - show_error($result->retval); + return $this->ci->PersonLogModel->insert($data); } /** * Unparks a person, i.e. removes all log entries in the future * @param $person_id + * @return array with deleted logids */ public function unPark($person_id) { @@ -127,24 +124,21 @@ class PersonLogLib $deleted = array(); - if (isSuccess($result)) + if (hasData($result)) { - if (count($result->retval) > 0) + foreach ($result->retval as $log) { - foreach ($result->retval as $log) + $logdata = json_decode($log->logdata); + if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) { - $logdata = json_decode($log->logdata); - if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) - { - $delresult = $this->ci->PersonLogModel->deleteLog($log->log_id); - if (isSuccess($delresult)) - $deleted[] = $log->log_id; - } + $delresult = $this->ci->PersonLogModel->deleteLog($log->log_id); + if (isSuccess($delresult)) + $deleted[] = $log->log_id; } } } - else - show_error($result->retval); + + return $deleted; } /** @@ -158,23 +152,18 @@ class PersonLogLib $parkeddate = null; - if (isSuccess($result)) + if (hasData($result)) { - if (count($result->retval) > 0) + foreach ($result->retval as $log) { - foreach ($result->retval as $log) + $logdata = json_decode($log->logdata); + if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) { - $logdata = json_decode($log->logdata); - if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME) - { - $parkeddate = $log->zeitpunkt; - break; - } + $parkeddate = $log->zeitpunkt; + break; } } } - else - show_error($result->retval); return $parkeddate; } diff --git a/application/views/system/infocenter/addNotiz.php b/application/views/system/infocenter/addNotiz.php index bec09e62b..56bccbfaf 100644 --- a/application/views/system/infocenter/addNotiz.php +++ b/application/views/system/infocenter/addNotiz.php @@ -21,6 +21,7 @@
    +
    diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 445e667cd..60b461bc1 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -1,6 +1,7 @@ var fhc_controller_id = FHC_AjaxClient.getUrlParameter('fhc_controller_id'); const CONTROLLER_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"+FHC_JS_DATA_STORAGE_OBJECT.called_path; +const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; /** * javascript file for infocenterDetails page @@ -9,13 +10,13 @@ $(document).ready( function () { //initialise table sorter - addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); - addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); - addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2); - tablesortAddPager("msgtable", "msgpager", 14); + Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); + Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); + Tablesort.addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2); + Tablesort.tablesortAddPager("msgtable", "msgpager", 14); - formatNotizTable(); - formatLogTable(); + InfocenterDetails._formatNotizTable(); + InfocenterDetails._formatLogTable(); //initialise datepicker $.datepicker.setDefaults($.datepicker.regional['de']); @@ -39,7 +40,7 @@ $(document).ready( var boxid = this.id; var akteid = boxid.substr(boxid.indexOf("_") + 1); var checked = this.checked; - saveFormalGeprueft(personid, akteid, checked) + InfocenterDetails.saveFormalGeprueft(personid, akteid, checked) }); //zgv übernehmen @@ -48,15 +49,23 @@ $(document).ready( var btn = $(this); var prestudentid = this.id.substr(this.id.indexOf("_") + 1); $('#zgvUebernehmenNotice').remove(); - zgvUebernehmen(personid, prestudentid, btn) + InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn) }); //zgv speichern $(".zgvform").on('submit', function (e) { e.preventDefault(); - var data = $(this).serializeArray(); - saveZgv(data); + var formdata = $(this).serializeArray(); + + var data = {}; + + for (var i = 0; i < formdata.length; i++) + { + data[formdata[i].name] = formdata[i].value; + } + + InfocenterDetails.saveZgv(data); } ); @@ -64,7 +73,7 @@ $(document).ready( $(".zgvinfo").click(function () { var prestudentid = this.id.substr(this.id.indexOf("_") + 1); - openZgvInfoForPrestudent(prestudentid); + InfocenterDetails.openZgvInfoForPrestudent(prestudentid); } ); @@ -93,17 +102,24 @@ $(document).ready( $("#notizform").on("submit", function (e) { e.preventDefault(); - var personId = $("#hiddenpersonid").val(); var notizId = $("#notizform :input[name='hiddenNotizId']").val(); - var data = $(this).serializeArray(); + var formdata = $(this).serializeArray(); + var data = {}; + + for (var i = 0; i < formdata.length; i++) + { + data[formdata[i].name] = formdata[i].value; + } + + $("#notizmsg").empty(); if (notizId !== '') { - updateNotiz(notizId, personid, data); + InfocenterDetails.updateNotiz(notizId, personid, data); } else { - saveNotiz(personid, data); + InfocenterDetails.saveNotiz(personid, data); } } ); @@ -111,6 +127,8 @@ $(document).ready( //update notiz - autofill notizform $(document).on("click", "#notiztable tbody tr", function () { + $("#notizmsg").empty(); + var notizId = $(this).find("td:eq(3)").html(); var notizTitle = $(this).find("td:eq(1)").text(); var notizContent = this.title; @@ -127,330 +145,357 @@ $(document).ready( //update notiz - abbrechen-button: reset styles $("#notizform :input[type='reset']").click(function () { - resetNotizFields(); + InfocenterDetails._resetNotizFields(); } ); //check if person is parked and display it - getParkedDateAjax(personid); + InfocenterDetails.getParkedDate(personid); }); -function openZgvInfoForPrestudent(prestudent_id) -{ - var screenwidth = screen.width; - var popupwidth = 760; - var marginleft = screenwidth - popupwidth; - window.open("../getZgvInfoForPrestudent/" + prestudent_id, "_blank","resizable=yes,scrollbars=yes,width="+popupwidth+",height="+screen.height+",left="+marginleft); -} +var InfocenterDetails = { -// ----------------------------------------------------------------------------------------------------------------- -// ajax calls + genericSaveError: function() { + alert("error when saving"); + }, + openZgvInfoForPrestudent: function(prestudent_id) + { + var screenwidth = screen.width; + var popupwidth = 760; + var marginleft = screenwidth - popupwidth; + window.open(CONTROLLER_URL + "/getZgvInfoForPrestudent/" + encodeURIComponent(prestudent_id), "_blank","resizable=yes,scrollbars=yes,width="+popupwidth+",height="+screen.height+",left="+marginleft); + }, -function saveFormalGeprueft(personid, akteid, checked) -{ - $.ajax({ - type: "POST", - dataType: "json", - url: CONTROLLER_URL+"/saveFormalGeprueft/" + personid + '?fhc_controller_id=' + fhc_controller_id, - data: {"akte_id": akteid, "formal_geprueft": checked}, - success: function (data, textStatus, jqXHR) - { - if (data === null) + // ----------------------------------------------------------------------------------------------------------------- + // ajax calls + saveFormalGeprueft: function(personid, akteid, checked) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid), { - $("#formalgeprueftam_" + akteid).text(""); + akte_id: akteid, + formal_geprueft: checked + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (data !== false) + { + if (data === null) + { + $("#formalgeprueftam_" + akteid).text(""); + } + else + { + var fgdatum = $.datepicker.parseDate("yy-mm-dd", data); + var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); + $("#formalgeprueftam_" + akteid).text(gerfgdatum); + } + //refresh doctable tablesorter, formal geprueft changed! + $("#doctable").trigger("update"); + InfocenterDetails._refreshLog(); + } + else + { + InfocenterDetails.genericSaveError(); + } + }, + errorCallback: InfocenterDetails.genericSaveError, + veilTimeout: 0 } - else + ); + }, + zgvUebernehmen: function(personid, prestudentid, btn) + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getLastPrestudentWithZgvJson/" + encodeURIComponent(personid), { - fgdatum = $.datepicker.parseDate("yy-mm-dd", data); - gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); - $("#formalgeprueftam_" + akteid).text(gerfgdatum); + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + var prestudent = data.retval[0]; + var zgvcode = prestudent.zgv_code !== null ? prestudent.zgv_code : "null"; + var zgvort = prestudent.zgvort !== null ? prestudent.zgvort : ""; + var zgvdatum = prestudent.zgvdatum; + var gerzgvdatum = ""; + if (zgvdatum !== null) + { + zgvdatum = $.datepicker.parseDate("yy-mm-dd", prestudent.zgvdatum); + gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum); + } + var zgvnation = prestudent.zgvnation !== null ? prestudent.zgvnation : "null"; + $("#zgv_" + prestudentid).val(zgvcode); + $("#zgvort_" + prestudentid).val(zgvort); + $("#zgvdatum_" + prestudentid).val(gerzgvdatum); + $("#zgvnation_" + prestudentid).val(zgvnation); + } + else + { + btn.after("  keine ZGV vorhanden"); + } + }, + veilTimeout: 0 } - //refresh doctable tablesorter, formal geprueft changed! - $("#doctable").trigger("update"); - refreshLog(); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText); - } - }); -} + ); + }, + saveZgv: function (data) + { + var zgvError = function(){ + $("#zgvSpeichern_" + prestudentid).before("Fehler beim Speichern der ZGV!  "); + }; -function zgvUebernehmen(personid, prestudentid, btn) -{ - $.ajax({ - type: "GET", - dataType: "json", - url: CONTROLLER_URL+"/getLastPrestudentWithZgvJson/" + personid + '?fhc_controller_id=' + fhc_controller_id, - success: function (data, textStatus, jqXHR) - { - if (data !== null) + var prestudentid = data.prestudentid; + $("#zgvSpeichernNotice").remove(); + + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/saveZgvPruefung', + data, { - var zgvcode = data.zgv_code !== null ? data.zgv_code : "null"; - var zgvort = data.zgvort !== null ? data.zgvort : ""; - var zgvdatum = data.zgvdatum; - var gerzgvdatum = ""; - if (zgvdatum !== null) + successCallback: function(data, textStatus, jqXHR) { + + if (FHC_AjaxClient.hasData(data)) + { + InfocenterDetails._refreshLog(); + $("#zgvSpeichern_" + prestudentid).before("ZGV erfolgreich gespeichert!  "); + } + else + { + zgvError(); + } + }, + errorCallback: zgvError, + veilTimeout: 0 + } + ); + }, + saveNotiz: function (personid, data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), + data, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + InfocenterDetails._refreshNotizen(); + InfocenterDetails._refreshLog(); + } + else + { + InfocenterDetails._errorSaveNotiz(); + } + }, + errorCallback: InfocenterDetails._errorSaveNotiz, + veilTimeout: 0 + } + ); + }, + updateNotiz: function (notizId, personId, data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/updateNotiz/' + encodeURIComponent(notizId) + "/" + encodeURIComponent(personId), + data, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + InfocenterDetails._refreshNotizen(); + InfocenterDetails._refreshLog(); + InfocenterDetails._resetNotizFields(); + } + else + { + InfocenterDetails._errorSaveNotiz(); + } + }, + errorCallback: InfocenterDetails._errorSaveNotiz, + veilTimeout: 0 + } + ); + }, + getStudienjahrEnd: function() + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getStudienjahrEnd", + { + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (data) + { + console.log("studienjahr end executed"); + var engdate = $.datepicker.parseDate("yy-mm-dd", data); + var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); + $("#parkdate").val(gerdate); + } + }, + veilTimeout: 0 + } + ); + }, + getParkedDate: function(personid) + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getParkedDate/"+encodeURIComponent(personid), + { + }, + { + successCallback: function(data, textStatus, jqXHR) { + InfocenterDetails._refreshParking(data); + InfocenterDetails._refreshLog(); + if (data === null) + InfocenterDetails.getStudienjahrEnd(); + }, + veilTimeout: 0 + } + ); + }, + parkPerson: function(personid, date) + { + var parkError = function(){ + $("#parkmsg").text(" Fehler beim Parken!"); + }; + + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/park', + { + "person_id": personid, + "parkdate": date + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + InfocenterDetails.getParkedDate(personid); + else + { + parkError(); + } + }, + errorCallback: parkError, + veilTimeout: 0 + } + ); + }, + unparkPerson: function(personid) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/unpark', + { + "person_id": personid + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (Array.isArray(data)) + { + if (data.length > 0) + InfocenterDetails.getParkedDate(personid); + else + $("#unparkmsg").removeClass().addClass("text-warning").text(" Nichts zum Ausparken."); + } + }, + errorCallback: function(){ + $("#unparkmsg").removeClass().addClass("text-danger").text(" Fehler beim Ausparken!"); + }, + veilTimeout: 0 + } + ); + }, + + // ----------------------------------------------------------------------------------------------------------------- + // (private) methods executed after ajax (refreshers) + _refreshLog: function() + { + var personid = $("#hiddenpersonid").val(); + $("#logs").load(CONTROLLER_URL + '/reloadLogs/' + personid + '?fhc_controller_id=' + fhc_controller_id, + function () + { + //readd tablesorter + InfocenterDetails._formatLogTable() + } + ); + }, + _formatLogTable: function() + { + Tablesort.addTablesorter("logtable", [[0, 1]], ["filter"], 2); + Tablesort.tablesortAddPager("logtable", "logpager", 22); + $("#logtable").addClass("table-condensed"); + }, + _refreshNotizen: function() + { + $("#notizform").find("input[type=text], textarea").val(""); + var personid = $("#hiddenpersonid").val(); + $("#notizen").load(CONTROLLER_URL + '/reloadNotizen/' + personid, + function () + { + //readd tablesorter + InfocenterDetails._formatNotizTable() + } + ); + }, + _refreshParking: function(date) + { + if (date === null) + { + $("#parking").html( + '
    '+ + '     '+ + 'bis  '+ + ' '+ + ''+ + '
    '); + + $("#parkdate").datepicker({ + "dateFormat": "dd.mm.yy", + "minDate": 0 + }); + + $("#parklink").click( + + function () { - zgvdatum = $.datepicker.parseDate("yy-mm-dd", data.zgvdatum); - gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum); + var personid = $("#hiddenpersonid").val(); + var date = $("#parkdate").val(); + + InfocenterDetails.parkPerson(personid, date); } - var zgvnation = data.zgvnation !== null ? data.zgvnation : "null"; - $("#zgv_" + prestudentid).val(zgvcode); - $("#zgvort_" + prestudentid).val(zgvort); - $("#zgvdatum_" + prestudentid).val(gerzgvdatum); - $("#zgvnation_" + prestudentid).val(zgvnation); - } - else - { - btn.after("  keine ZGV vorhanden"); - } - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText); + ); } - }); -} + else + { + var parkdate = $.datepicker.parseDate("yy-mm-dd", date); + var gerparkdate = $.datepicker.formatDate("dd.mm.yy", parkdate); + $("#parking").html( + 'BewerberIn geparkt bis '+gerparkdate+'     '+ + ' '+ + '' + ); -function saveZgv(data) -{ - var prestudentid = data[0].value; - $("#zgvSpeichernNotice").remove(); - $.ajax({ - type: "POST", - dataType: "json", - data: data, - url: CONTROLLER_URL+"/saveZgvPruefung/" + prestudentid + '?fhc_controller_id=' + fhc_controller_id, - success: function (data, textStatus, jqXHR) - { - if (data === prestudentid) - { - refreshLog(); - $("#zgvSpeichern_" + prestudentid).before("ZGV erfolgreich gespeichert!  "); - } - else - { - $("#zgvSpeichern_" + prestudentid).before("Fehler beim Speichern der ZGV!  "); - } - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText); + $("#unparklink").click( + function () + { + var personid = $("#hiddenpersonid").val(); + InfocenterDetails.unparkPerson(personid, date); + } + ); } - }); -} - -function saveNotiz(personid, data) -{ - $.ajax({ - type: "POST", - dataType: "json", - data: data, - url: CONTROLLER_URL+"/saveNotiz/" + personid + '?fhc_controller_id=' + fhc_controller_id, - success: function (data, textStatus, jqXHR) - { - refreshNotizen(); - refreshLog(); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText); - } - }); -} - -function updateNotiz(notizId, personId, data) -{ - $.ajax({ - type: "POST", - dataType: "json", - data: data, - url: CONTROLLER_URL+"/updateNotiz/" + notizId + "/" + personId + '?fhc_controller_id=' + fhc_controller_id, - success: function (data, textStatus, jqXHR) - { - if (data) - { - refreshNotizen(); - refreshLog(); - resetNotizFields(); - } - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText); - } - }); -} - -function getStudienjahrEndAjax() -{ - $.ajax({ - url: CONTROLLER_URL+"/getStudienjahrEnd?fhc_controller_id="+fhc_controller_id, - method: "GET", - success: function(data, textStatus, jqXHR) - { - //var gerdate = data.substring(8, 10) + "."+data.substring(5, 7) + "." + data.substring(0, 4); - var engdate = $.datepicker.parseDate("yy-mm-dd", data); - var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); - $("#parkdate").val(gerdate); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus); - } - }); -} - -function getParkedDateAjax(personid) -{ - $.ajax({ - url: CONTROLLER_URL+"/getParkedDate/"+personid+"?fhc_controller_id="+fhc_controller_id, - method: "GET", - success: function(data, textStatus, jqXHR) - { - refreshParking(data); - refreshLog(); - getStudienjahrEndAjax(); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus); - } - }); -} - -function parkPersonAjax(personid, date) -{ - $.ajax({ - url: CONTROLLER_URL+"/park?fhc_controller_id="+fhc_controller_id, - method: "POST", - data: - { - "person_id": personid, - "parkdate": date - }, - success: function(data, textStatus, jqXHR) - { - getParkedDateAjax(personid); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus); - } - }); -} - -function unparkPersonAjax(personid) -{ - $.ajax({ - url: CONTROLLER_URL+"/unpark?fhc_controller_id="+fhc_controller_id, - method: "POST", - data: - { - "person_id": personid - }, - success: function(data, textStatus, jqXHR) - { - getParkedDateAjax(personid); - }, - error: function (jqXHR, textStatus, errorThrown) - { - alert(textStatus); - } - }); -} - -// ----------------------------------------------------------------------------------------------------------------- -// methods executed after ajax (refreshers) - -function refreshLog() -{ - var personid = $("#hiddenpersonid").val(); - $("#logs").load('../reloadLogs/' + personid + '?fhc_controller_id=' + fhc_controller_id, - function () - { - //readd tablesorter - formatLogTable() - } - ); -} - -function formatLogTable() -{ - addTablesorter("logtable", [[0, 1]], ["filter"], 2); - tablesortAddPager("logtable", "logpager", 22); - $("#logtable").addClass("table-condensed"); -} - -function refreshNotizen() -{ - $("#notizform").find("input[type=text], textarea").val(""); - var personid = $("#hiddenpersonid").val(); - $("#notizen").load('../reloadNotizen/' + personid, - function () - { - //readd tablesorter - formatNotizTable() - } - ); -} - -function refreshParking(date) -{ - if (date === null) + }, + _formatNotizTable: function() { - $("#parking").html( - '
    '+ - '     '+ - 'bis  '+ - ''+ - '
    '); - - $("#parkdate").datepicker({ - "dateFormat": "dd.mm.yy", - "minDate": 0 - }); - - $("#parklink").click( - function () - { - var personid = $("#hiddenpersonid").val(); - var date = $("#parkdate").val(); - - parkPersonAjax(personid, date); - } - ); - } - else + Tablesort.addTablesorter("notiztable", [[0, 1]], ["filter"], 2); + Tablesort.tablesortAddPager("notiztable", "notizpager", 11); + $("#notiztable").addClass("table-condensed"); + }, + _resetNotizFields: function() { - var parkdate = $.datepicker.parseDate("yy-mm-dd", date); - var gerparkdate = $.datepicker.formatDate("dd.mm.yy", parkdate); - $("#parking").html( - 'BewerberIn geparkt bis '+gerparkdate+'     '+ - ' '); - - $("#unparklink").click( - function () - { - var personid = $("#hiddenpersonid").val(); - unparkPersonAjax(personid, date); - } - ); + $("#notizmsg").empty(); + $("#notizform :input[name='hiddenNotizId']").val(""); + $("#notizform label:first").text("Notiz hinzufügen").css("color", "black"); + $("#notizform :input[type='reset']").css("display", "none"); + }, + _errorSaveNotiz: function() + { + $("#notizmsg").text("Fehler beim Speichern der Notiz! "); } -} - -function formatNotizTable() -{ - addTablesorter("notiztable", [[0, 1]], ["filter"], 2); - tablesortAddPager("notiztable", "notizpager", 11); - $("#notiztable").addClass("table-condensed"); -} - -function resetNotizFields() -{ - $("#notizform :input[name='hiddenNotizId']").val(""); - $("#notizform label:first").text("Notiz hinzufügen").css("color", "black"); - $("#notizform :input[type='reset']").css("display", "none"); -} +}; diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 2c063ac4d..4146edc9b 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -56,9 +56,9 @@ function appendTableActionsHtml() $("#datasetActionsTop, #datasetActionsBottom").append( "
    "+ - "
    " + selectAllHtml + "  " + actionHtml + "
    "+ - "
    " + legendHtml + "
    "+ - "
    " + countHtml + "
    "+ + "
    " + selectAllHtml + "  " + actionHtml + "
    "+ + "
    " + legendHtml + "
    "+ + "
    " + countHtml + "
    "+ "
    "+ "
    " ); diff --git a/public/js/tablesort/tablesort.js b/public/js/tablesort/tablesort.js index ee386bb7d..f45b55ca7 100644 --- a/public/js/tablesort/tablesort.js +++ b/public/js/tablesort/tablesort.js @@ -1,67 +1,69 @@ -/** - * adds tablesorter to specified tableid, german date format, default theme - * @param tableid - * @param sortList columns to sort by, as array of arrays (each array contains column number and 1/0 for asc/desc order) - * @param widgets optional widgets like zebra or filter - * @param minrows optional minimal amount of rows for filter row to be shown (only relevant for filter widget) - */ -function addTablesorter(tableid, sortList, widgets, minrows) -{ - $("#" + tableid).tablesorter( - { - theme: "default", - dateFormat: "ddmmyyyy", - sortList: sortList, - widgets: widgets - } - ); - - if($("#" + tableid + " tr.tablesorter-filter-row").length) +var Tablesort = { + /** + * adds tablesorter to specified tableid, german date format, default theme + * @param tableid + * @param sortList columns to sort by, as array of arrays (each array contains column number and 1/0 for asc/desc order) + * @param widgets optional widgets like zebra or filter + * @param minrows optional minimal amount of rows for filter row to be shown (only relevant for filter widget) + */ + addTablesorter: function (tableid, sortList, widgets, minrows) { - //hide filters if less than n datarows (+ 2 for headings and filter row itself), default 0 - var minrows = minrows || 0; - if ($("#" + tableid + " tr").length < minrows + 2) - { - $("#" + tableid + " tr.tablesorter-filter-row").hide(); - } - } -} - -/** - * adds pager for specified tableid. Assumes bootstap icons are available! - * @param tableid - * @param pagerid - * @param size number of rows for each page - */ -function tablesortAddPager(tableid, pagerid, size) -{ - var html = - '
    ' + - '' + - ' ' + - '' + - '' + - ' ' + - '' + - '' + - '
    '; - - var rowcount = $("#" + tableid + " tbody tr").length; - - //not show pager if only one table page - if (rowcount > size) - { - var table = $("#" + tableid); - table.after(html); - - table.tablesorterPager( + $("#" + tableid).tablesorter( { - container: $("#" + pagerid), - size: size, - cssDisabled: 'disabled', - savePages: false, - output: '{startRow} – {endRow} / {totalRows} Zeilen' + theme: "default", + dateFormat: "ddmmyyyy", + sortList: sortList, + widgets: widgets } ); + + if ($("#" + tableid + " tr.tablesorter-filter-row").length) + { + //hide filters if less than n datarows (+ 2 for headings and filter row itself), default 0 + var minrows = minrows || 0; + if ($("#" + tableid + " tr").length < minrows + 2) + { + $("#" + tableid + " tr.tablesorter-filter-row").hide(); + } + } + }, + + /** + * adds pager for specified tableid. Assumes bootstap icons are available! + * @param tableid + * @param pagerid + * @param size number of rows for each page + */ + tablesortAddPager: function (tableid, pagerid, size) + { + var html = + '
    ' + + '
    ' + + ' ' + + '' + + '' + + ' ' + + '' + + '' + + '
    '; + + var rowcount = $("#" + tableid + " tbody tr").length; + + //not show pager if only one table page + if (rowcount > size) + { + var table = $("#" + tableid); + table.after(html); + + table.tablesorterPager( + { + container: $("#" + pagerid), + size: size, + cssDisabled: 'disabled', + savePages: false, + output: '{startRow} – {endRow} / {totalRows} Zeilen' + } + ); + } } -} \ No newline at end of file +}; \ No newline at end of file From 5dccb8f6a75c4da345fecbb810e10a5f89baf83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 25 May 2018 17:01:50 +0200 Subject: [PATCH 37/62] =?UTF-8?q?Im=20CIS-Profil=20sind=20nun=20auch=20zuk?= =?UTF-8?q?=C3=BCnftige=20Funktionen=20von=20Personen=20sichtbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/index.php | 568 ++++++++++++++++++---------------- locale/de-AT/profil.php | 16 +- locale/en-US/profil.php | 8 +- 3 files changed, 322 insertions(+), 270 deletions(-) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index 40cefd67b..2ed3656c8 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -16,9 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * Authors: Christian Paminger , - * Andreas Oesterreicher , - * Rudolf Hangl and - * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at>. + * Andreas Oesterreicher , + * Rudolf Hangl and + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at>. */ require_once('../../../config/cis.config.inc.php'); require_once('../../../config/global.config.inc.php'); @@ -42,7 +42,7 @@ require_once('../../../include/gruppe.class.php'); require_once('../../../include/adresse.class.php'); $sprache = getSprache(); -$p=new phrasen($sprache); +$p = new phrasen($sprache); if (!$db = new basis_db()) die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); @@ -51,39 +51,39 @@ $uid = get_uid(); $datum_obj = new datum(); -$ansicht=false; //Wenn ein anderer User sich das Profil ansieht (Bei Personensuche) -if(isset($_GET['uid'])) +$ansicht = false; //Wenn ein anderer User sich das Profil ansieht (Bei Personensuche) +if (isset($_GET['uid'])) { - $uid=stripslashes($_GET['uid']); - $ansicht=true; + $uid = stripslashes($_GET['uid']); + $ansicht = true; } -if(!$ansicht && isset($_GET['action'])) +if (!$ansicht && isset($_GET['action'])) { switch($_GET['action']) { case 'foto_freigabe': $benutzer = new benutzer(); - if($benutzer->load($uid)) + if ($benutzer->load($uid)) { $person = new person(); - if($person->load($benutzer->person_id)) + if ($person->load($benutzer->person_id)) { - $person->foto_sperre=false; - $person->new=false; + $person->foto_sperre = false; + $person->new = false; $person->save(); } } break; case 'foto_sperre': $benutzer = new benutzer(); - if($benutzer->load($uid)) + if ($benutzer->load($uid)) { $person = new person(); - if($person->load($benutzer->person_id)) + if ($person->load($benutzer->person_id)) { - $person->foto_sperre=true; - $person->new=false; + $person->foto_sperre = true; + $person->new = false; $person->save(); } } @@ -98,9 +98,9 @@ $stg_obj->getAll('typ, kurzbz', false); $stg_arr = array(); foreach ($stg_obj->result as $row) - $stg_arr[$row->studiengang_kz]=$row->kurzbzlang; + $stg_arr[$row->studiengang_kz] = $row->kurzbzlang; -if(check_lektor($uid)) +if (check_lektor($uid)) { $user = new mitarbeiter(); $type = 'mitarbeiter'; @@ -108,13 +108,13 @@ if(check_lektor($uid)) else { $user = new student(); - $type='student'; + $type = 'student'; } -if(!$user->load($uid)) +if (!$user->load($uid)) die($p->t('profil/esWurdenKeineProfileGefunden')); -if ($type=='mitarbeiter') +if ($type == 'mitarbeiter') { $vorwahl = ''; $kontakt = new kontakt(); @@ -130,11 +130,11 @@ echo ' - - - - - + + + + + '; $toPrint .= "\n\n"; @@ -104,7 +104,6 @@ function _generateJSPhrasesStorageObject($phrases) echo $toPrint; } - /** * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings */ @@ -204,8 +203,9 @@ function _generateAddonsJSsInclude($calledFrom) // Generates the global object to pass useful parameters to other javascripts // NOTE: must be called before any other JS include _generateJSDataStorageObject($calledPath, $calledMethod); - + // Generates the global object to pass phrases to javascripts + // NOTE: must be called before including the PhrasesLib.js _generateJSPhrasesStorageObject($phrases); // JQuery V3 @@ -218,12 +218,6 @@ function _generateAddonsJSsInclude($calledFrom) _generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file } - // AjaxLib JS - if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js'); - -// // PhfrasesLib JS - if ($phrases != null) _generateJSsInclude('public/js/PhrasesLib.js'); - // Bootstrap JS if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); @@ -245,6 +239,13 @@ function _generateAddonsJSsInclude($calledFrom) _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); } + // AjaxLib JS + // NOTE: must be called before including others JS libraries that use it + if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js'); + + // PhrasesLib JS + if ($phrases != null) _generateJSsInclude('public/js/PhrasesLib.js'); + // FilterWidget JS if($filterwidget === true) _generateJSsInclude('public/js/FilterWidget.js') ; @@ -257,6 +258,6 @@ function _generateAddonsJSsInclude($calledFrom) // Eventually required JS _generateJSsInclude($customJSs); ?> - + diff --git a/public/js/PhrasesLib.js b/public/js/PhrasesLib.js index f21026553..a676bb7c8 100644 --- a/public/js/PhrasesLib.js +++ b/public/js/PhrasesLib.js @@ -12,104 +12,62 @@ /** * Definition and initialization of object FHC_PhraseLib */ - var FHC_PhraseLib = { - + //------------------------------------------------------------------------------------------------------------------ // Public methods /** - Returns the phrase-text in the user's language - * @param {String} category : phrase-category - * @param {String} phrase : phrase-name - * @param {array} params : String-parameters to be set in variables in phrasentext - * @returns {String} : phrase-text - */ - t: function(category, phrase, params = []) - { - var category_found = false; - var phrase_found = false; - - //check category and phrase first - if(typeof(category) == "undefined" || category === null - || typeof(phrase) == "undefined" || phrase === null) + * Returns the phrase-text in the user's language + * @param {String} category : phrase-category + * @param {String} phrase : phrase-name + * @param {array} params : String-parameters to be set in variables in phrasentext + * @returns {String} : phrase-text + */ + t: function(category, phrase, params = []) { + + // Checks if FHC_JS_PHRASES_STORAGE_OBJECT is an array + if ($.isArray(FHC_JS_PHRASES_STORAGE_OBJECT)) { - console.log('Category and/or phrase not found. \n\ - 1. Check params in PhrasesLib.js t-method\n\ - 2. Check params in FHC-Header.php phrases-array'); - return; - } - - //loop through global JS PHRASES STORAGE OBJECT and search for phrase - for(i in FHC_JS_PHRASES_STORAGE_OBJECT) - { - e = FHC_JS_PHRASES_STORAGE_OBJECT[i]; - if (e.category === category) + // loop through global JS PHRASES STORAGE OBJECT and search for phrase + for (var i in FHC_JS_PHRASES_STORAGE_OBJECT) { - category_found = true; - if (e.phrase === phrase) + var phraseObj = FHC_JS_PHRASES_STORAGE_OBJECT[i]; // Single phrase object + + // If the single phrase match the given parameters and is not an empty string + if (phraseObj.category == category + && phraseObj.phrase == phrase + && phraseObj.text != null + && phraseObj.text.trim() != '') { - phrase_found = true; - - //replace if params are set - if ($.isArray(params) && typeof params !== 'undefined' && params !== null) + // If params is null or not an array + if (params == null || (params != null && $.isArray(params))) { - if (params.length !== 0) - { - e.text = replacePhraseVariable(e.text, params); - } + params = []; } - else - { - console.log('Could not replace variable. \n\ - Replace-params should be an array.') - } - - return e.text; + + return = FHC_PhraseLib._replacePhraseVariable(phraseObj.text, params); // parsing } } } - - //show error messages for missing categories/phrases - if (!category_found) + + return '<< PHRASE ' + phraseObj.phrase + ' >>'; + }, + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Returns phrase with variables being replaced + * @param {String} phrase : phrasen-text (with one ore more variables) + * @param {array} replaceStringArr : String-array to be set in variables in phrasentext (order matters) + * @returns {String} : replaced phrasen-text + */ + _replacePhraseVariable: function(phrase, replaceStringArr) { + for (var i = 0; i < replaceStringArr.length; i++) { - console.log('Category not found. \n\ - 1. Check params in PhrasesLib.js t-method\n\ - 2. Check params in FHC-Header.php phrases-array'); + phrase = phrase.replace(/\{(.*?)\}/, replaceStringArr[i]); } - - if (category_found && !phrase_found) - { - console.log('Phrase not found. \n\ - 1. Check params in PhrasesLib.js t-method\n\ - 2. Check params in FHC-Header.php phrases-array'); - } - } -} - - -//------------------------------------------------------------------------------------------------------------------ -// Helper methods - -/** - Returns phrase with variables being replaced - * @param {String} phrase : phrasen-text (with one ore more variables) - * @param {array} replaceStringArr : String-array to be set in variables in phrasentext (order matters) - * @returns {String} : replaced phrasen-text - */ -function replacePhraseVariable(phrase, replaceStringArr) -{ - for (var i = 0; i < replaceStringArr.length; i++) - { - phrase = phrase.replace(/\{(.*?)\}/, replaceStringArr[i]); + return phrase; } - return phrase; -} - - - -//...TEST -console.log(FHC_PhraseLib.t('global', 'mailAnXversandt', new Array('c@yahoo.de', 'test'))); - - - +}; From dc580c95262abda4d476edf58c52f9671b93b206 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 29 May 2018 17:44:58 +0200 Subject: [PATCH 43/62] controllerid is also passed when freigegeben or abgesagt (important to keep filter!) --- application/controllers/system/infocenter/InfoCenter.php | 1 + application/views/system/infocenter/zgvpruefungen.php | 3 ++- public/js/infocenter/infocenterDetails.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index b63bae0ac..25a653eb1 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -313,6 +313,7 @@ class InfoCenter extends FHC_Controller public function saveAbsage($prestudent_id) { $statusgrund = $this->input->post('statusgrund'); + $this->fhc_controller_id = $this->input->post('fhc_controller_id'); $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id); diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 7e9e142c0..82cc8c85f 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -243,6 +243,7 @@
    +
    '; + selectedFilters += ''; + + selectedFilters += '
    '; + + $("#selectedFilters").append(selectedFilters); + } + } + + if (data.allSelectedFields != null) + { + for (var i = 0; i < data.allSelectedFields.length; i++) + { + var fieldName = data.allSelectedFields[i]; + var fieldToDisplay = data.allSelectedFields[i]; + + if (data.selectedFilters.indexOf(fieldName) < 0) + { + if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) + { + fieldToDisplay = data.allColumnsAliases[i]; + } + + strDropDown = ''; + $("#addFilter").append(strDropDown); + } + } + } + + $(".select-filter-operation").change(function() { + + if ($(this).val() == "set" || $(this).val() == "nset") + { + $(this).parent().parent().find(".select-filter-operation-value").addClass("hidden-control"); + $(this).parent().parent().find(".select-filter-option").addClass("hidden-control"); + + $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', true); + $(this).parent().parent().find(".select-filter-option").prop('disabled', true); + } + else + { + $(this).parent().parent().find(".select-filter-operation-value").removeClass("hidden-control"); + $(this).parent().parent().find(".select-filter-option").removeClass("hidden-control"); + + $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', false); + $(this).parent().parent().find(".select-filter-option").prop('disabled', false); + } + + }); + + $("#applyFilter").click(function() { + + var selectFilterName = []; + var selectFilterOperation = []; + var selectFilterOperationValue = []; + var selectFilterOption = []; + + $("#selectedFilters > div").each(function(i, e) { + var tmpSelectFilterName = $(this).find('.hidden-field-name').val(); + var tmpSelectFilterOperation = $(this).find('.select-filter-operation').val(); + var tmpSelectFilterOperationValue = $(this).find('.select-filter-operation-value:enabled').val(); + var tmpSelectFilterOption = $(this).find('.select-filter-option:enabled').val(); + + selectFilterName.push(tmpSelectFilterName); + selectFilterOperation.push(tmpSelectFilterOperation); + selectFilterOperationValue.push(tmpSelectFilterOperationValue != null ? tmpSelectFilterOperationValue : ""); + selectFilterOption.push(tmpSelectFilterOption != null ? tmpSelectFilterOption : ""); + }); + + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/applyFilter', + { + filterNames: selectFilterName, + filterOperations: selectFilterOperation, + filterOperationValues: selectFilterOperationValue, + filterOptions: selectFilterOption, + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFilters(); + + location.reload(); + } + } + ); + }); + + $(".remove-selected-filter").click(function(event) { + // + FHC_AjaxClient.ajaxCallPost( + 'system/Filters/removeSelectedFilters', + { + fieldName: $(this).attr('filterToRemove'), + filter_page: FHC_FilterWidget._getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._resetSelectedFilters(); + + location.reload(); + } + } + ); + }); + + }, + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * @@ -115,66 +378,16 @@ var FHC_FilterWidget = { renderSelectedFilters: function() { // FHC_AjaxClient.ajaxCallGet( - 'system/Filters/selectFilters', + 'system/Filters/getFilters', { filter_page: FHC_FilterWidget._getFilterPage() }, { successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetEventsSFilters(); - - if (data != null) + if (FHC_AjaxClient.hasData(data)) { - var strDropDown = ''; - $("#addFilter").append(strDropDown); - if (data.selectedFilters != null) - { - for (var i = 0; i < data.selectedFilters.length; i++) - { - var selectedFilters = '
    '; - - selectedFilters += ''; - selectedFilters += data.selectedFiltersAliases[i]; - selectedFilters += ''; - - selectedFilters += FHC_FilterWidget._getSelectedFilterFields( - data.selectedFiltersMetaData[i], - data.selectedFiltersActiveFilters[i], - data.selectedFiltersActiveFiltersOperation[i], - data.selectedFiltersActiveFiltersOption[i] - ); - - selectedFilters += ''; - selectedFilters += ''; - selectedFilters += ''; - - selectedFilters += '
    '; - - $("#selectedFilters").append(selectedFilters); - } - } - - if (data.allSelectedFields != null) - { - for (var i = 0; i < data.allSelectedFields.length; i++) - { - var fieldName = data.allSelectedFields[i]; - var fieldToDisplay = data.allSelectedFields[i]; - - if (data.selectedFilters.indexOf(fieldName) < 0) - { - if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases)) - { - fieldToDisplay = data.allColumnsAliases[i]; - } - - strDropDown = ''; - $("#addFilter").append(strDropDown); - } - } - } } FHC_FilterWidget._addEventsSFilters(); @@ -309,7 +522,7 @@ var FHC_FilterWidget = { /** * */ - _dndSF: function() { + _drangAndDropEvents: function() { $(".filter-select-field-dnd-span").draggable({ containment: "parent", cursor: "move", @@ -401,57 +614,6 @@ var FHC_FilterWidget = { }); }, - /** - * - */ - _resetEventsSF: function() { - $("#addField").off('change'); - $(".remove-field").off('click'); - }, - - /** - * - */ - _addEventsSF: function() { - $("#addField").change(function(event) { - // - FHC_AjaxClient.ajaxCallPost( - 'system/Filters/addSelectedFields', - { - fieldName: $(this).val(), - filter_page: FHC_FilterWidget._getFilterPage() - }, - { - successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetSelectedFields(); - - FHC_FilterWidget.renderSelectedFields(); - FHC_FilterWidget.renderTableDataset(); - } - } - ); - }); - - $(".remove-field").click(function(event) { - // - FHC_AjaxClient.ajaxCallPost( - 'system/Filters/removeSelectedFields', - { - fieldName: $(this).attr('fieldToRemove'), - filter_page: FHC_FilterWidget._getFilterPage() - }, - { - successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetSelectedFields(); - - FHC_FilterWidget.renderSelectedFields(); - FHC_FilterWidget.renderTableDataset(); - } - } - ); - }); - }, - /** * */ @@ -460,13 +622,6 @@ var FHC_FilterWidget = { $("#addField").html(""); }, - /** - * - */ - _resetEventsSFilters: function() { - $("#addFilter").off('change'); - }, - /** * */ @@ -490,83 +645,7 @@ var FHC_FilterWidget = { ); }); - $(".select-filter-operation").change(function() { - if ($(this).val() == "set" || $(this).val() == "nset") - { - $(this).parent().parent().find(".select-filter-operation-value").addClass("hidden-control"); - $(this).parent().parent().find(".select-filter-option").addClass("hidden-control"); - - $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', true); - $(this).parent().parent().find(".select-filter-option").prop('disabled', true); - } - else - { - $(this).parent().parent().find(".select-filter-operation-value").removeClass("hidden-control"); - $(this).parent().parent().find(".select-filter-option").removeClass("hidden-control"); - - $(this).parent().parent().find(".select-filter-operation-value").prop('disabled', false); - $(this).parent().parent().find(".select-filter-option").prop('disabled', false); - } - - }); - - $("#applyFilter").click(function() { - - var selectFilterName = []; - var selectFilterOperation = []; - var selectFilterOperationValue = []; - var selectFilterOption = []; - - $("#selectedFilters > div").each(function(i, e) { - var tmpSelectFilterName = $(this).find('.hidden-field-name').val(); - var tmpSelectFilterOperation = $(this).find('.select-filter-operation').val(); - var tmpSelectFilterOperationValue = $(this).find('.select-filter-operation-value:enabled').val(); - var tmpSelectFilterOption = $(this).find('.select-filter-option:enabled').val(); - - selectFilterName.push(tmpSelectFilterName); - selectFilterOperation.push(tmpSelectFilterOperation); - selectFilterOperationValue.push(tmpSelectFilterOperationValue != null ? tmpSelectFilterOperationValue : ""); - selectFilterOption.push(tmpSelectFilterOption != null ? tmpSelectFilterOption : ""); - }); - - // - FHC_AjaxClient.ajaxCallPost( - 'system/Filters/applyFilter', - { - filterNames: selectFilterName, - filterOperations: selectFilterOperation, - filterOperationValues: selectFilterOperationValue, - filterOptions: selectFilterOption, - filter_page: FHC_FilterWidget._getFilterPage() - }, - { - successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetSelectedFilters(); - - location.reload(); - } - } - ); - }); - - $(".remove-selected-filter").click(function(event) { - // - FHC_AjaxClient.ajaxCallPost( - 'system/Filters/removeSelectedFilters', - { - fieldName: $(this).attr('filterToRemove'), - filter_page: FHC_FilterWidget._getFilterPage() - }, - { - successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetSelectedFilters(); - - location.reload(); - } - } - ); - }); }, @@ -743,8 +822,11 @@ $(document).ready(function() { } }); - FHC_FilterWidget.renderSelectedFields(); - FHC_FilterWidget.renderSelectedFilters(); - FHC_FilterWidget.renderTableDataset(); + // FHC_FilterWidget.setFilterName(); + // FHC_FilterWidget.renderSelectedFields(); + // FHC_FilterWidget.renderSelectedFilters(); + // FHC_FilterWidget.renderTableDataset(); + + FHC_FilterWidget.display(); }); From 855be4abe5cd53003df1c3c8fd2da852d75f1743 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Mon, 4 Jun 2018 15:15:43 +0200 Subject: [PATCH 45/62] Zeitaufzeichnung Anpassung Link ins Moodle --- cis/private/tools/zeitaufzeichnung.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 98fdf4115..9507b0f89 100755 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -738,7 +738,11 @@ if($projekt->getProjekteMitarbeiter($user, true))
    "); - } - - var arrayFieldsToDisplay = []; - - if (data.columnsAliases != null && $.isArray(data.columnsAliases) && data.columnsAliases.length > 0) - { - arrayFieldsToDisplay = data.columnsAliases; - } - else if (data.selectedFields != null && $.isArray(data.selectedFields)) - { - arrayFieldsToDisplay = data.selectedFields; - } - - /* ------------------------------------------------------------------------------------------------ */ - if (data.checkboxes != null && data.checkboxes != "") - { - $("#filterTableDataset > thead > tr").html(""); - } - - for (var i = 0; i < arrayFieldsToDisplay.length; i++) - { - var th = arrayFieldsToDisplay[i]; - - $("#filterTableDataset > thead > tr").append(""); - } - - if (data.additionalColumns != null && $.isArray(data.additionalColumns)) - { - for (var i = 0; i < data.additionalColumns.length; i++) - { - var th = data.additionalColumns[i]; - - $("#filterTableDataset > thead > tr").append(""); - } - } - /* ------------------------------------------------------------------------------------------------ */ - - if (arrayFieldsToDisplay.length > 0) - { - if (data.dataset != null && $.isArray(data.dataset)) - { - for (var i = 0; i < data.dataset.length; i++) - { - var record = data.dataset[i]; - var strHtml = ''; - - if (data.checkboxes != null && data.checkboxes != "") - { - strHtml += ''; - } - - $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { - - if (record.hasOwnProperty(data.selectedFields[i])) - { - strHtml += ''; - } - }); - - if (data.additionalColumns != null && $.isArray(data.additionalColumns)) - { - $.each(data.additionalColumns, function(i, additionalColumn) { - - if (record.hasOwnProperty(additionalColumn)) - { - strHtml += ''; - } - - }); - } - - strHtml += ''; - - $("#filterTableDataset > tbody").append(strHtml); - } - } - else - { - // console.log("No dataset!!!"); - } - } - else - { - // console.log("No fields to display!!!"); - } - } - else - { - console.log("No data!!!"); - } - - FHC_FilterWidget._callTableSorter(); - - } - } - ); - }, - - //------------------------------------------------------------------------------------------------------------------ - // Private methods - - /** - * - */ - _drangAndDropEvents: function() { - $(".filter-select-field-dnd-span").draggable({ - containment: "parent", - cursor: "move", - opacity: 0.4, - revert: "invalid", - revertDuration: 200, - drag: function(event, ui) { - - var padding = 20; - var draggedElement = $(this); - - $(".filter-select-field-dnd-span").each(function(i, e) { - - if ($(this).attr('id') != draggedElement.attr('id')) - { - $(this).removeClass("selection-after"); - $(this).removeClass("selection-before"); - - var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); - - if (event.pageX > ($(this).offset().left - (padding / 2)) - && event.pageX < ($(this).offset().left + $(this).width() + (padding / 2))) - { - if (event.pageX > elementCenter) - { - $(this).addClass("selection-after"); - $(this).removeClass("selection-before"); - } - else if (event.pageX < elementCenter) - { - $(this).addClass("selection-before"); - $(this).removeClass("selection-after"); - } - } - } - - }); - - } - }); - - $(".filter-select-field-dnd-span").droppable({ - accept: ".filter-select-field-dnd-span", - drop: function(event, ui) { - - var padding = 20; - var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2); - var draggedElement = ui.helper; - - if (event.pageX > elementCenter) + for (var j = 0; j < data.filters.length; j++) { - draggedElement.insertAfter($(this)); - } - else if (event.pageX < elementCenter) - { - draggedElement.insertBefore($(this)); - } - - $(this).removeClass("selection-before"); - $(this).removeClass("selection-after"); - - draggedElement.css({left: '0px', top: '10px'}); - - var arrayDndId = []; - - $(".filter-select-field-dnd-span").each(function(i, e) { - - arrayDndId[i] = $(this).attr('id').replace('dnd', ''); - - }); - - // - FHC_AjaxClient.ajaxCallPost( - 'system/Filters/sortSelectedFields', + if (data.fields[i] == data.filters[j].name) { - selectedFieldsLst: arrayDndId, - filter_page: FHC_FilterWidget._getFilterPage() - }, - { - successCallback: function(data, textStatus, jqXHR) { - FHC_FilterWidget._resetSelectedFields(); - - FHC_FilterWidget.renderSelectedFields(); - FHC_FilterWidget.renderTableDataset(); - } + toBeDisplayed = false; + break; } - ); + } + + if (toBeDisplayed == true) + { + var fieldName = data.fields[i]; + var fieldToDisplay = data.fields[i]; + + if (data.hasOwnProperty('columnsAliases') && $.isArray(data.columnsAliases)) + { + fieldToDisplay = data.columnsAliases[i]; + } + + strDropDown = ''; + $("#addFilter").append(strDropDown); + } } - }); - }, + } - /** - * - */ - _resetSelectedFields: function() { - $("#filterSelectFieldsDnd").html(""); - $("#addField").html(""); - }, - - /** - * - */ - _addEventsSFilters: function() { $("#addFilter").change(function(event) { // FHC_AjaxClient.ajaxCallPost( @@ -645,61 +495,68 @@ var FHC_FilterWidget = { ); }); - - }, /** * */ - _getSelectedFilterFields: function(metaData, activeFilters, activeFiltersOperation, activeFiltersOption) { + _resetSelectedFields: function() { + $("#dragAndDropFieldsArea").html(""); + $("#addField").html(""); + }, + + /** + * + */ + _getSelectedFilterFields: function(metaData, appliedFilter) { + var html = ''; if (metaData.type.toLowerCase().indexOf("int") >= 0) { html = ''; - html += ' '; + html += ' '; + html += ' '; + html += ' '; + html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } if (metaData.type.toLowerCase().indexOf('varchar') >= 0 || metaData.type.toLowerCase() == 'text') { html = ''; - html += ' '; + html += ' '; + html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } if (metaData.type.toLowerCase().indexOf('bool') >= 0) { html = ''; - html += ' '; + html += ' '; + html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0) { - var classOperation = 'form-control select-filter-operation-value'; - var classOption = 'form-control select-filter-option'; + var classOperation = 'form-control applied-filter-condition'; + var classOption = 'form-control applied-filter-option'; var disabled = ""; - if (activeFiltersOperation == "set" || activeFiltersOperation == "nset") + if (appliedFilter.operation == "set" || appliedFilter.operation == "nset") { classOperation += ' hidden-control'; classOption += ' hidden-control'; @@ -707,20 +564,20 @@ var FHC_FilterWidget = { } html = ''; - html += ' '; + html += ' '; + html += ' '; + html += ' '; + html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; html += ''; html += ' '; html += ''; } @@ -732,6 +589,120 @@ var FHC_FilterWidget = { return html; }, + /** + * + */ + _renderTableDataset: function(data) { + + FHC_FilterWidget._resetTableDataset(); + + if (data.hasOwnProperty('checkboxes') && data.checkboxes.trim() != '') + { + $("#filterTableDataset > thead > tr").append(""); + } + + var arrayFieldsToDisplay = []; + + if (data.hasOwnProperty('selectedFields') && $.isArray(data.selectedFields)) + { + if (data.hasOwnProperty('columnsAliases') && $.isArray(data.columnsAliases)) + { + for (var i = 0; i < data.selectedFields.length; i++) + { + for (var j = 0; j < data.fields.length; j++) + { + if (data.selectedFields[i] == data.fields[j]) + { + arrayFieldsToDisplay[i] = data.columnsAliases[j]; + } + } + } + } + else + { + arrayFieldsToDisplay = data.selectedFields; + } + } + + for (var i = 0; i < arrayFieldsToDisplay.length; i++) + { + var th = arrayFieldsToDisplay[i]; + + $("#filterTableDataset > thead > tr").append(""); + } + + if (data.hasOwnProperty('additionalColumns') && $.isArray(data.additionalColumns)) + { + for (var i = 0; i < data.additionalColumns.length; i++) + { + var th = data.additionalColumns[i]; + + $("#filterTableDataset > thead > tr").append(""); + } + } + + if (arrayFieldsToDisplay.length > 0) + { + if (data.hasOwnProperty('dataset') && $.isArray(data.dataset)) + { + for (var i = 0; i < data.dataset.length; i++) + { + var record = data.dataset[i]; + var strHtml = ''; + + if (data.checkboxes != null && data.checkboxes != "") + { + strHtml += ''; + } + + $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + + if (record.hasOwnProperty(data.selectedFields[i])) + { + strHtml += ''; + } + }); + + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + $.each(data.additionalColumns, function(i, additionalColumn) { + + if (record.hasOwnProperty(additionalColumn)) + { + strHtml += ''; + } + + }); + } + + strHtml += ''; + + $("#filterTableDataset > tbody").append(strHtml); + } + } + else + { + // console.log("No dataset!!!"); + } + } + else + { + // console.log("No fields to display!!!"); + } + + FHC_FilterWidget._callTableSorter(); + + }, + + /** + * + */ + _getFilterPage: function() { + return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; + }, + /** * */ @@ -739,6 +710,44 @@ var FHC_FilterWidget = { $("#addFilter").html(""); $("#selectedFilters").html(""); }, + + /** + * + */ + _resetTableDataset: function() { + $("#filterTableDataset > thead > tr").html(""); + $("#filterTableDataset > tbody").html(""); + }, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /** * @@ -758,20 +767,9 @@ var FHC_FilterWidget = { } }, - /** - * - */ - _resetTableDataset: function() { - $("#filterTableDataset > thead > tr").html(""); - $("#filterTableDataset > tbody").html(""); - }, - /** - * - */ - _getFilterPage: function() { - return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; - } + + }; @@ -780,27 +778,37 @@ var FHC_FilterWidget = { */ $(document).ready(function() { - $("[data-toggle='collapse']").click(function() { - - var filterOptionsStatus = sessionStorage.getItem('filter-options-status'); - - if (filterOptionsStatus != null && filterOptionsStatus == 'closed') + if (typeof(Storage) !== "undefined") + { + if (sessionStorage.getItem('filter-options-status') && sessionStorage.getItem('filter-options-status') == 'open') { - sessionStorage.setItem('filter-options-status', 'open'); + $('.collapse').collapse("show"); } else { sessionStorage.setItem('filter-options-status', 'closed'); } + } + + $("[data-toggle='collapse']").click(function() { + + if (typeof(Storage) !== "undefined") + { + if (sessionStorage.getItem('filter-options-status')) + { + if (sessionStorage.getItem('filter-options-status') == 'closed') + { + sessionStorage.setItem('filter-options-status', 'open'); + } + else + { + sessionStorage.setItem('filter-options-status', 'closed'); + } + } + } }); - var filterOptionsStatus = sessionStorage.getItem('filter-options-status'); - if (filterOptionsStatus != null && filterOptionsStatus == 'open') - { - $('.collapse').collapse("show"); - } - $("#saveCustomFilterButton").click(function() { if ($("#customFilterDescription").val() != '') { From 9a6a420cb133abe430d3457278a801e4d7c9ea68 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 5 Jun 2018 17:28:56 +0200 Subject: [PATCH 48/62] Bescheid Tabelle statt Spalten im oberen Teil --- system/xsl/bescheid_0.xsl | 173 ++++++++++++++++++++++---------------- 1 file changed, 99 insertions(+), 74 deletions(-) diff --git a/system/xsl/bescheid_0.xsl b/system/xsl/bescheid_0.xsl index 3f7fde34d..02f4e4167 100644 --- a/system/xsl/bescheid_0.xsl +++ b/system/xsl/bescheid_0.xsl @@ -66,6 +66,18 @@ office:version="1.2"> + + + + + + + + + + + + @@ -174,80 +186,93 @@ office:version="1.2"> - - geboren am in - - - , - - - - - der - - - die - - - die/der - - - durch Ablegung der - - Bachelor - Master - Diplom - Lehrgang - Kurzstudium - prüfung am den - - Bachelor - Master - Diplom - Lehrgang - Kurzstudium - studiengang - - - - (Studiengangskennzahl ) - - ordnungsgemäß abgeschlossen hat, - gemäß § 6 Abs 1 FHStG, BGBl. Nr. 340/1993, idgF, den akademischen Grad - - - born on in - - - , - - - who, by taking the - - Bachelor - Master - Diploma - Course - Short study - examination on , has duly completed the - - Bachelor - Master - Diploma - Course - Short study - 's degree program - - - - - - - (Degree Program Code ) - - according to § 6 Abs 1 FHStG, BGBl. No. 340/1993, as amended, the academic degree of - - + + + + + + + geboren am in + + + , + + + + + der + + + die + + + die/der + + + durch Ablegung der + + Bachelor + Master + Diplom + Lehrgang + Kurzstudium + prüfung am den + + Bachelor + Master + Diplom + Lehrgang + Kurzstudium + studiengang + + + + born on in + + + , + + + who, by taking the + + Bachelor + Master + Diploma + Course + Short study + examination on , has duly completed the + + Bachelor + Master + Diploma + Course + Short study + 's degree program + + + + + + + (Studiengangskennzahl ) + + + + (Degree Program Code ) + + + + + + ordnungsgemäß abgeschlossen hat, + gemäß § 6 Abs 1 FHStG, BGBl. Nr. 340/1993, idgF, den akademischen Grad + + + + according to § 6 Abs 1 FHStG, BGBl. No. 340/1993, as amended, the academic degree of + + + () From 2b8782afe867b21a52b5064fe2eb0942767df36b Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 5 Jun 2018 17:31:07 +0200 Subject: [PATCH 49/62] Funktion getAkten mit neuen Parametern $returnInhalt und $order - Wenn $returnInhalt true ist, wird auch der Inhalt der Akte geladen. Default false - $order: Sortierreihenfolge der Spalten im SQL --- include/akte.class.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/include/akte.class.php b/include/akte.class.php index 9bc65eb2a..6c053f6a5 100644 --- a/include/akte.class.php +++ b/include/akte.class.php @@ -297,16 +297,21 @@ class akte extends basis_db * @param $stg_kz -> wenn gesetzt werden nur Akten angezeigt die ZUSÄTZLICH zum Studiengang abgegeben worden sind ohne Zeugnis * @param $prestudent_id -> gesetzt wenn auch stg_kz gesetzt ist um sicherzugehen, dass Akten, die er schon für seinen Studiengang abgegeben hat, * nicht mehr angezeigt werden + * @param boolean $returnInhalt Wenn true, wird auch den Inhalt (base64-Code) geladen, sonst nur allgemeine Informationen + * @param string $order Sortierreihenfolge im SQL * @return true wenn ok, sonst false */ - public function getAkten($person_id, $dokument_kurzbz=null, $stg_kz = null, $prestudent_id = null) + public function getAkten($person_id, $dokument_kurzbz=null, $stg_kz = null, $prestudent_id = null, $returnInhalt = false, $order = 'erstelltam') { $qry = "SELECT akte_id, person_id, dokument_kurzbz, mimetype, erstelltam, gedruckt, titel_intern, anmerkung_intern, titel, bezeichnung, updateamum, insertamum, updatevon, insertvon, uid, dms_id, anmerkung, nachgereicht, CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden, - nachgereicht_am, ausstellungsnation, formal_geprueft_amum, archiv, signiert, stud_selfservice - FROM public.tbl_akte WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER); + nachgereicht_am, ausstellungsnation, formal_geprueft_amum, archiv, signiert, stud_selfservice"; + if($returnInhalt === true) + $qry.=",inhalt "; + + $qry.=" FROM public.tbl_akte WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER); if($dokument_kurzbz!=null) $qry.=" AND dokument_kurzbz=".$this->db_add_param($dokument_kurzbz); if($stg_kz != null && $prestudent_id != null) @@ -315,7 +320,8 @@ class akte extends basis_db (SELECT dokument_kurzbz FROM public.tbl_dokumentprestudent JOIN public.tbl_dokument USING(dokument_kurzbz) WHERE prestudent_id=".$this->db_add_param($prestudent_id).")"; - $qry.=" ORDER BY erstelltam"; + if ($order != '') + $qry.=" ORDER BY ".$order; $this->errormsg = $qry; @@ -328,7 +334,9 @@ class akte extends basis_db $akten->akte_id = $row->akte_id; $akten->person_id = $row->person_id; $akten->dokument_kurzbz = $row->dokument_kurzbz; - //$akte->inhalt = $row->inhalt; + if($returnInhalt === true) + $akten->inhalt = $row->inhalt; + $akten->inhalt_vorhanden = $this->db_parse_bool($row->inhalt_vorhanden); $akten->mimetype = $row->mimetype; $akten->erstelltam = $row->erstelltam; From b9a1ad6b6cc02625be161cdf74b9965fe7e89ecc Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Tue, 5 Jun 2018 17:37:05 +0200 Subject: [PATCH 50/62] Mehrfach-Export von Archivdokumenten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Nach Rechtsklick auf Studierenden gibt es die Auswahl "Archivdokument exportieren" - Derzeit nur für Bescheid - Mehrfachmarkierung von Studierenden möglich --- content/pdfExport.php | 831 +++++++++++++---------- content/student/studentenoverlay.xul.php | 5 + content/student/studentoverlay.js.php | 37 + 3 files changed, 522 insertions(+), 351 deletions(-) diff --git a/content/pdfExport.php b/content/pdfExport.php index 44e30c7a0..2954dc276 100644 --- a/content/pdfExport.php +++ b/content/pdfExport.php @@ -45,6 +45,8 @@ require_once('../include/studiengang.class.php'); require_once('../include/studiensemester.class.php'); require_once('../include/studienordnung.class.php'); require_once('../include/dokument_export.class.php'); +require_once('../include/dokument.class.php'); +require_once('../include/pdf.class.php'); $user = get_uid(); $db = new basis_db(); @@ -52,414 +54,541 @@ $db = new basis_db(); $variable_obj = new variable(); $variable_obj->loadVariables($user); -//Parameter holen -if (isset($_GET['xml'])) - $xml = $_GET['xml']; -else - die('Fehlerhafte Parameteruebergabe'); -if (isset($_GET['xsl'])) - $xsl = $_GET['xsl']; -else - die('Fehlerhafte Parameteruebergabe'); +$archivdokument = ''; -if(isset($_GET['sign'])) - $sign = true; -else - $sign = false; - -// Studiengang ermitteln dessen Vorlage verwendet werden soll -$xsl_stg_kz = 0; -// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll -if (isset($_GET['xsl_stg_kz'])) - $xsl_stg_kz = $_GET['xsl_stg_kz']; -else +// Wenn der Parameter archivdokument übergeben wird, werden ein oder mehrere Dokumente aus dem Archiv zu einem PDF zusammengefügt und ausgegeben +// Ansonsten wird ein neues XML-Dokument erstellt +if (isset($_GET['archivdokument'])) { - // Wenn eine Studiengangskennzahl uebergeben wird, wird die Vorlage dieses Studiengangs verwendet - if (isset($_GET['stg_kz'])) - $xsl_stg_kz = $_GET['stg_kz']; - else - { - // Werden UIDs oder Prestudent_IDs uebergeben, wird die Vorlage des Studiengangs genommen - // in dem der 1. Studierende in der Liste ist - if (isset($_GET['uid']) && $_GET['uid']!='') - { - if (strstr($_GET['uid'],';')) - $uids = explode(';',$_GET['uid']); - else - $uids[1] = $_GET['uid']; + $archivdokument = $_GET['archivdokument']; + $allDocs = array(); + $errorText = ''; + + $dokument = new dokument(); + $dokument->loadDokumenttyp($archivdokument); + + $pdf = new pdf(); + + // Temporaeren Ordner fuer die Erstellung der Dokumente generieren + $tmpDir = sys_get_temp_dir() . "/fhc_archivexport_" . uniqid(); + + if (!file_exists($tmpDir)) + mkdir($tmpDir, 0777, true); - $student_obj = new student(); - if ($student_obj->load($uids[1])) + // Studierende für Rechteabfrage laden + if (isset($_GET['uid']) && $_GET['uid'] != '') + { + if (strstr($_GET['uid'],';')) + { + $uids = explode(';',$_GET['uid']); + } + else + $uids[1] = $_GET['uid']; + + $student_obj = new student(); + if ($student_obj->load($uids[1])) + { + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($user); + + if (!$rechte->isBerechtigt('admin', $student_obj->studiengang_kz, 'suid') + && !$rechte->isBerechtigt('assistenz', $student_obj->studiengang_kz, 'suid')) + die('Sie haben keine Berechtigung für diese Studierenden'); + else { - $xsl_stg_kz = $student_obj->studiengang_kz; + // Die jeweils letzte (aktuellste) Akte dieses Typs von jedem Studierenden laden und in eine temporäre Datei schreiben + foreach ($uids AS $value) + { + // Leere Einträge überspringen + if ($value == '') + continue; + + $student_obj = new student($value); + $person_id = $student_obj->person_id; + $akte = new akte(); + $akte->getAkten($person_id, $archivdokument, null, null, true, 'erstelltam DESC'); + + if (isset($akte->result[0])) + { + $filename = ''; + if($akte->result[0]->inhalt != '') + { + $filename = $tmpDir . "/" . uniqid(); + + $fileData = base64_decode($akte->result[0]->inhalt); + file_put_contents($filename, $fileData); + + $allDocs[] = $filename; + } + else + $errorText .= "Das Dokument ".$dokument->bezeichnung." bei ".$student_obj->nachname." ".$student_obj->vorname." (".$value.") ist leer\n"; + } + else + $errorText .= $student_obj->nachname." ".$student_obj->vorname." (".$value.") hat kein Dokument '".$dokument->bezeichnung."' im Archiv\n"; + } + if (count($allDocs) == 0) + { + rmdir($tmpDir); + die('Bei keinem der gewählten Studierenden ist einen Bescheid vorhanden'); + } + + // Textseite mit Errormessages generieren und in PDF umwandeln + if ($errorText != '') + { + $errorfile = $tmpDir . "/" . uniqid() . ".txt"; + file_put_contents($errorfile, $errorText); + + $newnameErrorfile = $tmpDir . "/" . uniqid(); + + $docExport = new dokument_export(); + $docExport->convert($errorfile, $newnameErrorfile, "pdf"); + unlink($errorfile); + + // Konvertiertes File an erste Position im Array hängen + array_unshift($allDocs, $newnameErrorfile); + } + + $finishedPdf = $tmpDir . "/".$archivdokument."_Album.pdf"; + $pdf->merge($allDocs, $finishedPdf); + + foreach ($allDocs as $doc) + unlink($doc); + + $fsize = filesize($finishedPdf); + + if(!$handle = fopen($finishedPdf,'r')) + die('load failed'); + + header('Content-type: application/pdf'); + header('Content-Disposition: attachment; filename="'.$archivdokument.'_Album.pdf"'); + header('Content-Length: '.$fsize); + + while (!feof($handle)) + { + echo fread($handle, 8192); + } + fclose($handle); + + unlink($finishedPdf); + rmdir($tmpDir); } } - elseif (isset($_GET['prestudent_id']) && $_GET['prestudent_id']!='') + else + die('Der/Die Studierenden konnte nicht geladen werden'); + } +} +else +{ + //Parameter holen + if (isset($_GET['xml'])) + $xml = $_GET['xml']; + else + die('Fehlerhafte Parameteruebergabe'); + + if (isset($_GET['xsl'])) + $xsl = $_GET['xsl']; + else + die('Fehlerhafte Parameteruebergabe'); + + if(isset($_GET['sign'])) + $sign = true; + else + $sign = false; + + // Studiengang ermitteln dessen Vorlage verwendet werden soll + $xsl_stg_kz = 0; + // Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll + if (isset($_GET['xsl_stg_kz'])) + $xsl_stg_kz = $_GET['xsl_stg_kz']; + else + { + // Wenn eine Studiengangskennzahl uebergeben wird, wird die Vorlage dieses Studiengangs verwendet + if (isset($_GET['stg_kz'])) + $xsl_stg_kz = $_GET['stg_kz']; + else { - if (strstr($_GET['prestudent_id'],';')) - $prestudent_ids = explode(';',$_GET['prestudent_id']); - else - $prestudent_ids[1] = $_GET['prestudent_id']; - - $prestudent_obj = new prestudent(); - if ($prestudent_obj->load($prestudent_ids[1])) + // Werden UIDs oder Prestudent_IDs uebergeben, wird die Vorlage des Studiengangs genommen + // in dem der 1. Studierende in der Liste ist + if (isset($_GET['uid']) && $_GET['uid']!='') { - $xsl_stg_kz = $prestudent_obj->studiengang_kz; + if (strstr($_GET['uid'],';')) + $uids = explode(';',$_GET['uid']); + else + $uids[1] = $_GET['uid']; + + $student_obj = new student(); + if ($student_obj->load($uids[1])) + { + $xsl_stg_kz = $student_obj->studiengang_kz; + } + } + elseif (isset($_GET['prestudent_id']) && $_GET['prestudent_id']!='') + { + if (strstr($_GET['prestudent_id'],';')) + $prestudent_ids = explode(';',$_GET['prestudent_id']); + else + $prestudent_ids[1] = $_GET['prestudent_id']; + + $prestudent_obj = new prestudent(); + if ($prestudent_obj->load($prestudent_ids[1])) + { + $xsl_stg_kz = $prestudent_obj->studiengang_kz; + } } } } -} -if (isset($_GET['xsl_oe_kurzbz'])) - $xsl_oe_kurzbz = $_GET['xsl_oe_kurzbz']; -else - $xsl_oe_kurzbz = ''; - -//Parameter setzen -$params = 'xmlformat=xml'; - -// GET Parameter die an XML durchgereicht werden -foreach ($_GET as $getkey=>$getvalue) -{ - if (in_array($getkey, - array('uid', 'stg_kz', 'person_id', 'id', 'prestudent_id', 'buchungsnummern', 'ss', 'abschlusspruefung_id', - 'typ', 'all', 'preoutgoing_id', 'lvid', 'projekt_kurzbz', 'von', 'bis', 'stundevon', 'stundebis', - 'sem', 'lehreinheit', 'mitarbeiter_uid', 'studienordnung_id', 'fixangestellt', 'standort', - 'abrechnungsmonat', 'form') + if (isset($_GET['xsl_oe_kurzbz'])) + $xsl_oe_kurzbz = $_GET['xsl_oe_kurzbz']; + else + $xsl_oe_kurzbz = ''; + + //Parameter setzen + $params = 'xmlformat=xml'; + + // GET Parameter die an XML durchgereicht werden + foreach ($_GET as $getkey=>$getvalue) + { + if (in_array($getkey, + array('uid', 'stg_kz', 'person_id', 'id', 'prestudent_id', 'buchungsnummern', 'ss', 'abschlusspruefung_id', + 'typ', 'all', 'preoutgoing_id', 'lvid', 'projekt_kurzbz', 'von', 'bis', 'stundevon', 'stundebis', + 'sem', 'lehreinheit', 'mitarbeiter_uid', 'studienordnung_id', 'fixangestellt', 'standort', + 'abrechnungsmonat', 'form') + ) ) - ) - { - $params .= '&'.$getkey.'='.urlencode($getvalue); + { + $params .= '&'.$getkey.'='.urlencode($getvalue); + } } -} - -if (isset($_GET['vertrag_id'])) -{ - foreach($_GET['vertrag_id'] as $id) + + if (isset($_GET['vertrag_id'])) { - $params .= '&vertrag_id[]='.urlencode($id); - } -} -if (isset($_GET['version']) && is_numeric($_GET['version'])) - $version = $_GET['version']; -else - $version = null; - -$output = (isset($_GET['output'])?$_GET['output']:'odt'); - -$rechte = new benutzerberechtigung(); -$rechte->getBerechtigungen($user); - -//OE fuer Output ermitteln - -if ($xsl_oe_kurzbz != '') -{ - $oe_kurzbz = $xsl_oe_kurzbz; -} -else -{ - if ($xsl_stg_kz == '') - $xsl_stg_kz = '0'; - $oe = new studiengang(); - $oe->load($xsl_stg_kz); - $oe_kurzbz = $oe->oe_kurzbz; -} - -//Darf der User Dokumente in einem NICHT-PDF-Format exportieren? -if (isset($_GET['output']) && $_GET['output'] != 'pdf') -{ - if (!$rechte->isBerechtigt('system/change_outputformat',$oe_kurzbz)) - { - $output = 'pdf'; + foreach($_GET['vertrag_id'] as $id) + { + $params .= '&vertrag_id[]='.urlencode($id); + } } + if (isset($_GET['version']) && is_numeric($_GET['version'])) + $version = $_GET['version']; else - $output = $_GET['output']; -} -else - $output = 'pdf'; - -$vorlage = new vorlage(); -if(!$vorlage->loadVorlage($xsl)) - die('Vorlage wurde nicht gefunden'); - -//Berechtigung pruefen -if ($xsl == 'AccountInfo') -{ - $isberechtigt = false; - - $uids = explode(';',$_GET['uid']); - foreach ($uids as $uid) - { - //Berechtigung fuer das Drucken des Accountinfoblattes pruefen - $ma = new mitarbeiter(); - if($ma->load($uid)) - { - //Mitarbeiterrechte erforderlich - if ($rechte->isBerechtigt('admin', 0, 'suid') || $rechte->isBerechtigt('mitarbeiter', 0, 'suid')) - { - $isberechtigt = true; - } - } - - $stud = new student(); - if ($stud->load($uid)) - { - //Rechte pruefen - if ($rechte->isBerechtigt('admin', $stud->studiengang_kz, 'suid') || - $rechte->isBerechtigt('admin', 0, 'suid') || - $rechte->isBerechtigt('assistenz', $stud->studiengang_kz, 'suid') || - $rechte->isBerechtigt('assistenz', 0, 'suid') || - $rechte->isBerechtigt('support', 0, 'suid')) - { - $isberechtigt=true; - } - } - } - - if (!$isberechtigt) - { - echo 'Sie haben keine Berechtigung um dieses AccountInfoBlatt zu drucken'; - exit; - } -} -else -{ - $vorlagestudiengang = new vorlage(); + $version = null; + + $output = (isset($_GET['output'])?$_GET['output']:'odt'); + + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($user); + + //OE fuer Output ermitteln + if ($xsl_oe_kurzbz != '') { - $vorlagestudiengang->getAktuelleVorlage($xsl_oe_kurzbz, $xsl, $version); + $oe_kurzbz = $xsl_oe_kurzbz; } else { if ($xsl_stg_kz == '') $xsl_stg_kz = '0'; - - $vorlagestudiengang->getAktuelleVorlage($xsl_stg_kz, $xsl, $version); + $oe = new studiengang(); + $oe->load($xsl_stg_kz); + $oe_kurzbz = $oe->oe_kurzbz; } - // Wenn Berechtigung direkt beim der Vorlage angegeben ist - if (count($vorlagestudiengang->berechtigung)>0) + + //Darf der User Dokumente in einem NICHT-PDF-Format exportieren? + if (isset($_GET['output']) && $_GET['output'] != 'pdf') { - $allowed = false; - foreach($vorlagestudiengang->berechtigung as $berechtigung_kurzbz) + if (!$rechte->isBerechtigt('system/change_outputformat',$oe_kurzbz)) { - if ($rechte->isBerechtigt($berechtigung_kurzbz)) - $allowed = true; + $output = 'pdf'; } - if (!$allowed) + else + $output = $_GET['output']; + } + else + $output = 'pdf'; + + $vorlage = new vorlage(); + if(!$vorlage->loadVorlage($xsl)) + die('Vorlage wurde nicht gefunden'); + + //Berechtigung pruefen + if ($xsl == 'AccountInfo') + { + $isberechtigt = false; + + $uids = explode(';',$_GET['uid']); + foreach ($uids as $uid) { - echo 'unbekanntes Dokument oder keine Berechtigung'; + //Berechtigung fuer das Drucken des Accountinfoblattes pruefen + $ma = new mitarbeiter(); + if($ma->load($uid)) + { + //Mitarbeiterrechte erforderlich + if ($rechte->isBerechtigt('admin', 0, 'suid') || $rechte->isBerechtigt('mitarbeiter', 0, 'suid')) + { + $isberechtigt = true; + } + } + + $stud = new student(); + if ($stud->load($uid)) + { + //Rechte pruefen + if ($rechte->isBerechtigt('admin', $stud->studiengang_kz, 'suid') || + $rechte->isBerechtigt('admin', 0, 'suid') || + $rechte->isBerechtigt('assistenz', $stud->studiengang_kz, 'suid') || + $rechte->isBerechtigt('assistenz', 0, 'suid') || + $rechte->isBerechtigt('support', 0, 'suid')) + { + $isberechtigt=true; + } + } + } + + if (!$isberechtigt) + { + echo 'Sie haben keine Berechtigung um dieses AccountInfoBlatt zu drucken'; exit; } } else { - echo 'unbekanntes Dokument oder keine Berechtigung'; - exit; - } -} - -//wenn uid gefunden wird, dann den Nachnamen zum Dateinamen dazuhaengen -$nachname = ''; -if (isset($_GET['uid']) && $_GET['uid']!='') -{ - $uid = str_replace(';','',$_GET['uid']); - $benutzer_obj = new benutzer(); - if ($benutzer_obj->load($uid)) - $nachname = '_'.convertProblemChars($benutzer_obj->nachname); - -} -$filename = $xsl.$nachname; - -if ($xsl_oe_kurzbz == '') -{ - if ($xsl_stg_kz == '') - $xsl_stg_kz = '0'; - $stg_obj = new studiengang(); - if (!$stg_obj->load($xsl_stg_kz)) - die($stg_obj->errormsg); - $xsl_oe_kurzbz = $stg_obj->oe_kurzbz; -} - -if($sign === true && $vorlage->signierbar === false) -{ - die('Diese Vorlage darf nicht signiert werden'); -} - -if (!isset($_REQUEST["archive"])) -{ - if (mb_strstr($vorlage->mimetype, 'application/vnd.oasis.opendocument')) - { - $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); - $dokument->addDataURL($xml, $params); - - /** - * Get Filename - * TODO cleanup - */ - if ($vorlage->bezeichnung!='') - $filename = $vorlage->bezeichnung.$nachname; - else - $filename = $vorlage->vorlage_kurzbz.$nachname; - - switch($xsl) + $vorlagestudiengang = new vorlage(); + if ($xsl_oe_kurzbz != '') { - case 'LV_Informationen': - $studiengang = new studiengang($_GET['stg_kz']); - $studiensemester = new studiensemester($_GET['ss']); - $filename = $filename.'_'.$studiengang->kurzbzlang.'_'.$studiensemester->studiensemester_kurzbz; - break; - case 'Honorarvertrag': - $filename = $filename.'_'.$benutzer_obj->nachname.'_'.$benutzer_obj->vorname; - break; - case 'Studienordnung': - $studienordnung = new studienordnung(); - $studienordnung->loadStudienordnung($_GET['studienordnung_id']); - $filename = 'Studienordnung-Studienplan-'. sprintf("%'.04d",$studienordnung->studiengang_kz).'-'.$studienordnung->studiengangkurzbzlang; - break; + $vorlagestudiengang->getAktuelleVorlage($xsl_oe_kurzbz, $xsl, $version); } - - $dokument->setFilename($filename); - - if ($sign === true) - { - $dokument->sign($user); - } - - if ($dokument->create($output)) - $dokument->output(); else - echo $dokument->errormsg; - - $dokument->close(); - } -} -else -{ - if(!$vorlage->archivierbar) - die('Dieses Dokument ist nicht archivierbar'); - - // Archivieren von Dokumenten - $uid = $_REQUEST["uid"]; - $heute = date('Y-m-d'); - - $student = new student(); - $student->load($uid); - - if (isset($_REQUEST['ss'])) - { - $ss = $_REQUEST["ss"]; - - $prestudent = new prestudent(); - $prestudent->getLastStatus($student->prestudent_id,$ss); - $semester = $prestudent->ausbildungssemester; - - $query = "SELECT - tbl_studiengang.studiengang_kz, tbl_studentlehrverband.semester, tbl_studiengang.typ, - tbl_studiengang.kurzbz, tbl_person.person_id FROM tbl_person, tbl_benutzer, - tbl_studentlehrverband, tbl_studiengang - WHERE - tbl_studentlehrverband.student_uid = tbl_benutzer.uid - AND tbl_benutzer.person_id = tbl_person.person_id - AND tbl_studentlehrverband.studiengang_kz = tbl_studiengang.studiengang_kz - AND tbl_studentlehrverband.student_uid = ".$db->db_add_param($uid)." - AND tbl_studentlehrverband.studiensemester_kurzbz = ".$db->db_add_param($ss); - - if ($result = $db->db_query($query)) { - if ($row = $db->db_fetch_object($result)) + if ($xsl_stg_kz == '') + $xsl_stg_kz = '0'; + + $vorlagestudiengang->getAktuelleVorlage($xsl_stg_kz, $xsl, $version); + } + // Wenn Berechtigung direkt beim der Vorlage angegeben ist + if (count($vorlagestudiengang->berechtigung)>0) + { + $allowed = false; + foreach($vorlagestudiengang->berechtigung as $berechtigung_kurzbz) { - $person_id = $row->person_id; - $titel = $xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester; - $bezeichnung = $xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester"; - $studiengang_kz = $row->studiengang_kz; + if ($rechte->isBerechtigt($berechtigung_kurzbz)) + $allowed = true; } + if (!$allowed) + { + echo 'unbekanntes Dokument oder keine Berechtigung'; + exit; + } + } + else + { + echo 'unbekanntes Dokument oder keine Berechtigung'; + exit; + } + } + + //wenn uid gefunden wird, dann den Nachnamen zum Dateinamen dazuhaengen + $nachname = ''; + if (isset($_GET['uid']) && $_GET['uid']!='') + { + $uid = str_replace(';','',$_GET['uid']); + $benutzer_obj = new benutzer(); + if ($benutzer_obj->load($uid)) + $nachname = '_'.convertProblemChars($benutzer_obj->nachname); + + } + $filename = $xsl.$nachname; + + if ($xsl_oe_kurzbz == '') + { + if ($xsl_stg_kz == '') + $xsl_stg_kz = '0'; + $stg_obj = new studiengang(); + if (!$stg_obj->load($xsl_stg_kz)) + die($stg_obj->errormsg); + $xsl_oe_kurzbz = $stg_obj->oe_kurzbz; + } + + if($sign === true && $vorlage->signierbar === false) + { + die('Diese Vorlage darf nicht signiert werden'); + } + + if (!isset($_REQUEST["archive"])) + { + if (mb_strstr($vorlage->mimetype, 'application/vnd.oasis.opendocument')) + { + $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); + $dokument->addDataURL($xml, $params); + + /** + * Get Filename + * TODO cleanup + */ + if ($vorlage->bezeichnung!='') + $filename = $vorlage->bezeichnung.$nachname; else + $filename = $vorlage->vorlage_kurzbz.$nachname; + + switch($xsl) { - die('Student hat keinen Status in diesem Semester'); + case 'LV_Informationen': + $studiengang = new studiengang($_GET['stg_kz']); + $studiensemester = new studiensemester($_GET['ss']); + $filename = $filename.'_'.$studiengang->kurzbzlang.'_'.$studiensemester->studiensemester_kurzbz; + break; + case 'Honorarvertrag': + $filename = $filename.'_'.$benutzer_obj->nachname.'_'.$benutzer_obj->vorname; + break; + case 'Studienordnung': + $studienordnung = new studienordnung(); + $studienordnung->loadStudienordnung($_GET['studienordnung_id']); + $filename = 'Studienordnung-Studienplan-'. sprintf("%'.04d",$studienordnung->studiengang_kz).'-'.$studienordnung->studiengangkurzbzlang; + break; } + + $dokument->setFilename($filename); + + if ($sign === true) + { + $dokument->sign($user); + } + + if ($dokument->create($output)) + $dokument->output(); + else + echo $dokument->errormsg; + + $dokument->close(); } } else { - $studiengang = new studiengang(); - $studiengang->load($student->studiengang_kz); - $studiengang_kz=$student->studiengang_kz; - $person_id = $student->person_id; - $titel = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; - $bezeichnung = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; - } - - if ($rechte->isBerechtigt('admin', $studiengang_kz, 'suid') - || $rechte->isBerechtigt('assistenz', $studiengang_kz, 'suid')) - { - $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); - $dokument->addDataURL($xml, $params); - - $dokument->setFilename($filename); - - $error = false; - - // Beim Archivieren wird das Dokument immer signiert wenn moeglich - if($vorlage->signierbar) - $sign = true; - - if ($sign === true) + if(!$vorlage->archivierbar) + die('Dieses Dokument ist nicht archivierbar'); + + // Archivieren von Dokumenten + $uid = $_REQUEST["uid"]; + $heute = date('Y-m-d'); + + $student = new student(); + $student->load($uid); + + if (isset($_REQUEST['ss'])) { - $dokument->sign($user); + $ss = $_REQUEST["ss"]; + + $prestudent = new prestudent(); + $prestudent->getLastStatus($student->prestudent_id,$ss); + $semester = $prestudent->ausbildungssemester; + + $query = "SELECT + tbl_studiengang.studiengang_kz, tbl_studentlehrverband.semester, tbl_studiengang.typ, + tbl_studiengang.kurzbz, tbl_person.person_id FROM tbl_person, tbl_benutzer, + tbl_studentlehrverband, tbl_studiengang + WHERE + tbl_studentlehrverband.student_uid = tbl_benutzer.uid + AND tbl_benutzer.person_id = tbl_person.person_id + AND tbl_studentlehrverband.studiengang_kz = tbl_studiengang.studiengang_kz + AND tbl_studentlehrverband.student_uid = ".$db->db_add_param($uid)." + AND tbl_studentlehrverband.studiensemester_kurzbz = ".$db->db_add_param($ss); + + if ($result = $db->db_query($query)) + { + if ($row = $db->db_fetch_object($result)) + { + $person_id = $row->person_id; + $titel = $xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester; + $bezeichnung = $xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester"; + $studiengang_kz = $row->studiengang_kz; + } + else + { + die('Student hat keinen Status in diesem Semester'); + } + } } - - if ($dokument->create($output)) - $doc = $dokument->output(false); else { - $errormsg = $dokument->errormsg; - $error = true; + $studiengang = new studiengang(); + $studiengang->load($student->studiengang_kz); + $studiengang_kz=$student->studiengang_kz; + $person_id = $student->person_id; + $titel = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; + $bezeichnung = $vorlage->bezeichnung.'_'.$studiengang->kuerzel; } - - $dokument->close(); - - if(!$error) + + if ($rechte->isBerechtigt('admin', $studiengang_kz, 'suid') + || $rechte->isBerechtigt('assistenz', $studiengang_kz, 'suid')) { - $hex = base64_encode($doc); - $akte = new akte(); - $akte->person_id = $person_id; - if($vorlage->dokument_kurzbz!='') - $akte->dokument_kurzbz = $vorlage->dokument_kurzbz; - else - $akte->dokument_kurzbz = 'Zeugnis'; - $akte->inhalt = $hex; - $akte->mimetype = 'application/pdf'; - $akte->erstelltam = $heute; - $akte->gedruckt = true; - $akte->titel = $titel.'.pdf'; - $akte->bezeichnung = $bezeichnung; - $akte->updateamum = ''; - $akte->updatevon = ''; - $akte->insertamum = date('Y-m-d H:i:s'); - $akte->insertvon = $user; - $akte->ext_id = ''; - $akte->uid = $uid; - $akte->new = true; - $akte->archiv = true; - $akte->signiert = $sign; - $akte->stud_selfservice = $vorlage->stud_selfservice; - - if (!$akte->save()) + $dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version); + $dokument->addDataURL($xml, $params); + + $dokument->setFilename($filename); + + $error = false; + + // Beim Archivieren wird das Dokument immer signiert wenn moeglich + if($vorlage->signierbar) + $sign = true; + + if ($sign === true) { - echo 'Erstellen Fehlgeschlagen: '.$akte->errormsg; + $dokument->sign($user); + } + + if ($dokument->create($output)) + $doc = $dokument->output(false); + else + { + $errormsg = $dokument->errormsg; + $error = true; + } + + $dokument->close(); + + if(!$error) + { + $hex = base64_encode($doc); + $akte = new akte(); + $akte->person_id = $person_id; + if($vorlage->dokument_kurzbz!='') + $akte->dokument_kurzbz = $vorlage->dokument_kurzbz; + else + $akte->dokument_kurzbz = 'Zeugnis'; + $akte->inhalt = $hex; + $akte->mimetype = 'application/pdf'; + $akte->erstelltam = $heute; + $akte->gedruckt = true; + $akte->titel = $titel.'.pdf'; + $akte->bezeichnung = $bezeichnung; + $akte->updateamum = ''; + $akte->updatevon = ''; + $akte->insertamum = date('Y-m-d H:i:s'); + $akte->insertvon = $user; + $akte->ext_id = ''; + $akte->uid = $uid; + $akte->new = true; + $akte->archiv = true; + $akte->signiert = $sign; + $akte->stud_selfservice = $vorlage->stud_selfservice; + + if (!$akte->save()) + { + echo 'Erstellen Fehlgeschlagen: '.$akte->errormsg; + return false; + } + else + { + return true; + } + } + else + { + echo $errormsg; return false; } - else - { - return true; - } } else - { - echo $errormsg; - return false; - } + echo 'Keine Berechtigung zum Speichern'; } - else - echo 'Keine Berechtigung zum Speichern'; } ?> diff --git a/content/student/studentenoverlay.xul.php b/content/student/studentenoverlay.xul.php index a9de22360..b329ee4d5 100644 --- a/content/student/studentenoverlay.xul.php +++ b/content/student/studentenoverlay.xul.php @@ -75,6 +75,11 @@ else "); + $("#filterTableDataset > thead > tr").append(""); } var arrayFieldsToDisplay = []; @@ -648,7 +698,7 @@ var FHC_FilterWidget = { for (var i = 0; i < data.dataset.length; i++) { var record = data.dataset[i]; - var strHtml = ''; + var strHtml = ''; if (data.checkboxes != null && data.checkboxes != "") { @@ -682,27 +732,12 @@ var FHC_FilterWidget = { $("#filterTableDataset > tbody").append(strHtml); } } - else - { - // console.log("No dataset!!!"); - } - } - else - { - // console.log("No fields to display!!!"); } FHC_FilterWidget._callTableSorter(); }, - /** - * - */ - _getFilterPage: function() { - return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; - }, - /** * */ @@ -719,36 +754,6 @@ var FHC_FilterWidget = { $("#filterTableDataset > tbody").html(""); }, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** * */ @@ -765,10 +770,7 @@ var FHC_FilterWidget = { var config = $('#filterTableDataset')[0].config; $.tablesorter.updateAll(config, true, null); } - }, - - - + } }; @@ -814,10 +816,10 @@ $(document).ready(function() { { // FHC_AjaxClient.ajaxCallPost( - 'system/Filters/saveFilter', + 'system/Filters/saveCustomFilter', { customFilterDescription: $("#customFilterDescription").val(), - filter_page: FHC_FilterWidget._getFilterPage() + filter_page: FHC_FilterWidget.getFilterPage() }, { successCallback: refreshSideMenu // NOTE: to be checked @@ -830,11 +832,6 @@ $(document).ready(function() { } }); - // FHC_FilterWidget.setFilterName(); - // FHC_FilterWidget.renderSelectedFields(); - // FHC_FilterWidget.renderSelectedFilters(); - // FHC_FilterWidget.renderTableDataset(); - FHC_FilterWidget.display(); }); From 20b824b816a55e6524ace1f87b3c5054067f11e3 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 6 Jun 2018 13:45:33 +0200 Subject: [PATCH 53/62] Changes to the FilterWidget IV --- application/controllers/system/Filters.php | 23 +-- application/libraries/FiltersLib.php | 166 ++++++++++++++------- 2 files changed, 124 insertions(+), 65 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index aaa48a2d2..b9b2b480d 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -26,7 +26,7 @@ class Filters extends FHC_Controller // Public methods /** - * + * Retrives data about the current filter from the session and will be written on the output in JSON format */ public function getFilter() { @@ -34,7 +34,7 @@ class Filters extends FHC_Controller } /** - * Retrives the number of records present in the dataset + * Retrives the number of records present in the current dataset and will be written on the output in JSON format */ public function rowNumber() { @@ -50,7 +50,8 @@ class Filters extends FHC_Controller } /** - * + * Change the sort of the selected fields of the current filter and + * its data will be written on the output in JSON format */ public function sortSelectedFields() { @@ -67,7 +68,8 @@ class Filters extends FHC_Controller } /** - * + * Remove a selected field from the current filter and + * its data will be written on the output in JSON format */ public function removeSelectedField() { @@ -84,7 +86,7 @@ class Filters extends FHC_Controller } /** - * + * Add a field to the current filter and its data will be written on the output in JSON format */ public function addSelectedField() { @@ -101,7 +103,7 @@ class Filters extends FHC_Controller } /** - * + * Remove an applied filter (SQL where condition) from the current filter */ public function removeAppliedFilter() { @@ -118,7 +120,7 @@ class Filters extends FHC_Controller } /** - * + * Apply all the applied filters (SQL where conditions) to the current filter */ public function applyFilters() { @@ -143,7 +145,7 @@ class Filters extends FHC_Controller } /** - * + * Add a filter (SQL where clause) to be applied to the current filter */ public function addFilter() { @@ -160,7 +162,7 @@ class Filters extends FHC_Controller } /** - * + * Save the current filter as a custom filter for this user with the given description */ public function saveCustomFilter() { @@ -177,7 +179,7 @@ class Filters extends FHC_Controller } /** - * + * Remove a custom filter by its filter_id */ public function removeCustomFilter() { @@ -221,6 +223,7 @@ class Filters extends FHC_Controller } else // Otherwise an error will be written in the output { + // NOTE: Used echo to speed up the output before the exit otherwise it's not shown echo 'Parameter "'.self::FILTER_PAGE_PARAM.'" not provided!'; exit; } diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 5c51281fc..afe6bf9a8 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -266,24 +266,26 @@ class FiltersLib { $datasetQuery = null; - // If the given query is valid and the json of the filter is valid + // If the given query is valid and the parameter filters is an array if (!empty(trim($query)) && $filters != null && is_array($filters)) { - $where = ''; + $where = ''; // starts building the SQL where clause + // Loops through the given applied filters for ($filtersCounter = 0; $filtersCounter < count($filters); $filtersCounter++) { - $filterDefinition = $filters[$filtersCounter]; + $filterDefinition = $filters[$filtersCounter]; // definition of one filter - if ($filtersCounter > 0) $where .= ' AND '; + if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one - if (!empty(trim($filterDefinition->name))) + if (!empty(trim($filterDefinition->name))) // if the name of the applied filter is valid { + // ...build the condition $where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition); } } - if ($where != '') + if ($where != '') // if the SQL where clause was built { $datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS.' WHERE '.$where; } @@ -301,6 +303,7 @@ class FiltersLib if ($datasetQuery != null) { + // Execute the given SQL statement suppressing error messages $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); } @@ -333,19 +336,22 @@ class FiltersLib } /** - * + * Change the sort of the selected fields of the current filter */ public function sortSelectedFields($selectedFields) { $sortSelectedFields = false; + // Checks the parameter selectedFields if (isset($selectedFields) && is_array($selectedFields) && count($selectedFields) > 0) { + // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); + // Checks that the given selected fields are present in all the used fields by the current filter if (!array_diff($selectedFields, $fields)) { - $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); + $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session $sortSelectedFields = true; } @@ -355,25 +361,31 @@ class FiltersLib } /** - * + * Remove a selected field from the current filter */ public function removeSelectedField($selectedField) { $removeSelectedField = false; + // Checks the parameter selectedField if (isset($selectedField) && !empty(trim($selectedField))) { + // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); + // Retrives the selected fields by the current filter $selectedFields = $this->getElementSession(self::SESSION_SELECTED_FIELDS); + // Checks that the given selected field is present in the list of all the used fields by the current filter if (in_array($selectedField, $fields)) { + // If the selected field is present in the list of the selected fields by the current filter if (($pos = array_search($selectedField, $selectedFields)) !== false) { + // Then remove it and shift the rest of elements by one if needed array_splice($selectedFields, $pos, 1); } - $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); + $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session $removeSelectedField = true; } @@ -383,22 +395,26 @@ class FiltersLib } /** - * + * Add a field to the current filter */ public function addSelectedField($selectedField) { $removeSelectedField = false; + // Checks the parameter selectedField if (isset($selectedField) && !empty(trim($selectedField))) { + // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); + // Retrives the selected fields by the current filter $selectedFields = $this->getElementSession(self::SESSION_SELECTED_FIELDS); + // Checks that the given selected field is present in the list of all the used fields by the current filter if (in_array($selectedField, $fields)) { - array_push($selectedFields, $selectedField); + array_push($selectedFields, $selectedField); // place the new filed at the end of the selected fields list - $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); + $this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session $removeSelectedField = true; } @@ -408,36 +424,33 @@ class FiltersLib } /** - * + * Remove an applied filter (SQL where condition) from the current filter */ public function removeAppliedFilter($appliedFilter) { $removeAppliedFilter = false; + // Checks the parameter appliedFilter if (isset($appliedFilter) && !empty(trim($appliedFilter))) { + // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); + // Retrives the applied filters by the current filter $filters = $this->getElementSession(self::SESSION_FILTERS); + // Checks that the given applied filter is present in the list of all the used fields by the current filter if (in_array($appliedFilter, $fields)) { - $pos = false; - for($i = 0; $i < count($filters); $i++) + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $appliedFilter); + if ($pos !== false) // If found { - if ($filters[$i]->name == $appliedFilter) - { - $pos = $i; - break; - } - } - - if ($pos !== false) - { - array_splice($filters, $pos, 1); + array_splice($filters, $pos, 1); // Then remove it and shift the rest of elements by one if needed } + // Write changes into the session $this->setElementSession(self::SESSION_FILTERS, $filters); - $this->setElementSession(self::SESSION_RELOAD_DATASET, true); + $this->setElementSession(self::SESSION_RELOAD_DATASET, true); // the dataset must be reloaded $removeAppliedFilter = true; } @@ -447,27 +460,31 @@ class FiltersLib } /** - * + * Apply all the applied filters (SQL where conditions) to the current filter */ public function applyFilters($appliedFilters, $appliedFiltersOperations, $appliedFiltersConditions, $appliedFiltersOptions) { $applyFilters = false; + // Checks the required parameters: appliedFilters and appliedFiltersOperations if (isset($appliedFilters) && is_array($appliedFilters) && isset($appliedFiltersOperations) && is_array($appliedFiltersOperations)) { - $fields = $this->getElementSession(self::SESSION_FIELDS); + $fields = $this->getElementSession(self::SESSION_FIELDS); // Retrives all the used fields by the current filter + // Checks that the given applied filters are present in all the used fields by the current filter if (!array_diff($appliedFilters, $fields)) { - $filters = array(); - for ($i = 0; $i < count($appliedFilters); $i++) + $filters = array(); // starts building the new applied filters list + for ($i = 0; $i < count($appliedFilters); $i++) // loops through the given applied filters { - $filterDefinition = new stdClass(); + $filterDefinition = new stdClass(); // new applied filter definition + // Sets the filter definition required properties $filterDefinition->name = $appliedFilters[$i]; $filterDefinition->operation = $appliedFiltersOperations[$i]; + // Sets the filter definition optional properties $filterDefinition->condition = null; if (isset($appliedFiltersConditions) && isset($appliedFiltersConditions[$i])) { @@ -480,11 +497,12 @@ class FiltersLib $filterDefinition->option = $appliedFiltersOptions[$i]; } - $filters[$i] = $filterDefinition; + $filters[$i] = $filterDefinition; // adds the new definition to the list } + // Write changes into the session $this->setElementSession(self::SESSION_FILTERS, $filters); - $this->setElementSession(self::SESSION_RELOAD_DATASET, true); + $this->setElementSession(self::SESSION_RELOAD_DATASET, true); // the dataset must be reloaded $applyFilters = true; } @@ -494,40 +512,40 @@ class FiltersLib } /** - * + * Add a filter (SQL where clause) to be applied to the current filter */ public function addFilter($filter) { $addFilter = false; + // Checks the parameter filter if (isset($filter) && !empty(trim($filter))) { + // Retrives all the used fields by the current filter $fields = $this->getElementSession(self::SESSION_FIELDS); + // Retrives the applied filters by the current filter $filters = $this->getElementSession(self::SESSION_FILTERS); + // Checks that the given applied filter is present in the list of all the used fields by the current filter if (in_array($filter, $fields)) { - $pos = false; - for($i = 0; $i < count($filters); $i++) - { - if ($filters[$i]->name == $filter) - { - $pos = $i; - break; - } - } - - if ($pos === false) + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $filter); + if ($pos === false) // If NOT found then add it { + // New filter definition $filterDefinition = new stdClass(); + // Sets filter definition required properties $filterDefinition->name = $filter; + // Sets filter definition optional properties $filterDefinition->operation = null; $filterDefinition->condition = null; $filterDefinition->option = null; + // Place the new applied filter at the end of the applied filters list array_push($filters, $filterDefinition); } - $this->setElementSession(self::SESSION_FILTERS, $filters); + $this->setElementSession(self::SESSION_FILTERS, $filters); // write changes into the session $addFilter = true; } @@ -537,13 +555,13 @@ class FiltersLib } /** - * + * Save the current filter as a custom filter for this user with the given description */ public function saveCustomFilter($customFilterDescription) { $saveCustomFilter = false; // by default returns a failure - // Checks parameter customFilterDescription + // Checks parameter customFilterDescription if not valid stop the execution if (!isset($customFilterDescription) || empty(trim($customFilterDescription))) { return $saveCustomFilter; @@ -631,12 +649,13 @@ class FiltersLib } /** - * + * Remove a custom filter by its filter_id */ public function removeCustomFilter($filterId) { $removeCustomFilter = false; + // Checks the parameter filterId if (isset($filterId) && is_numeric($filterId) && $filterId > 0) { $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to remove the filter definitions from DB @@ -688,23 +707,30 @@ class FiltersLib } /** - * + * Generates a condition for a SQL where clause using the given applied filter definition. + * By default an empty string is returned. */ private function _getDatasetQueryCondition($filterDefinition) { - $condition = ''; + $condition = ''; // starts building the condition + // "operation" is a required property for the applied filter definition if (!empty(trim($filterDefinition->operation))) { + // Checks what operation is required switch ($filterDefinition->operation) { + // comparison (==) case self::OP_EQUAL: if (is_numeric($filterDefinition->condition)) $condition = '= '.$filterDefinition->condition; break; + // not equal (!=) case self::OP_NOT_EQUAL: if (is_numeric($filterDefinition->condition)) $condition = '!= '.$filterDefinition->condition; break; + // greater than (>) case self::OP_GREATER_THAN: + // It it's a date type if (is_numeric($filterDefinition->condition) && isset($filterDefinition->option) && ($filterDefinition->option == self::OPT_DAYS @@ -712,12 +738,14 @@ class FiltersLib { $condition = '< (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; } - else + else // otherwise is a number { $condition = '> '.$filterDefinition->condition; } break; + // less than (<) case self::OP_LESS_THAN: + // It it's a date type if (is_numeric($filterDefinition->condition) && isset($filterDefinition->option) && ($filterDefinition->option == self::OPT_DAYS @@ -725,37 +753,65 @@ class FiltersLib { $condition = '> (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; } - else + else // otherwise is a number { $condition = '< '.$filterDefinition->condition; } break; + // contains (ILIKE) case self::OP_CONTAINS: $condition = 'ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; break; + // not contains (NOT ILIKE) case self::OP_NOT_CONTAINS: $condition = 'NOT ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; break; + // is true (=== true) case self::OP_IS_TRUE: $condition = 'IS TRUE'; break; + // is false (=== false) case self::OP_IS_FALSE: $condition = 'IS FALSE'; break; + // is set case self::OP_SET: $condition = 'IS NOT NULL'; break; + // is NOT set case self::OP_NOT_SET: $condition = 'IS NULL'; break; + // by default must not be null (!= null) default: $condition = 'IS NOT NULL'; break; } } - if (!empty(trim($condition))) $condition = ' '.$condition; + // if the condition is valid + if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before return $condition; } + + /** + * Search for a filter inside a list of filters by the given filter name + * Returns false if NOT found, otherwise the position inside the list + */ + private function _searchFilterByName($filters, $filterName) + { + $pos = false; + + for($i = 0; $i < count($filters); $i++) + { + if ($filters[$i]->name == $filterName) + { + $pos = $i; + break; + } + } + + return $pos; + } } From 894dc51e13e867ee0f5c08bf4fb732237e57e735 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 6 Jun 2018 14:53:24 +0200 Subject: [PATCH 54/62] Enhancements --- application/libraries/PhrasesLib.php | 148 +++++++++++---------- application/models/system/Phrase_model.php | 21 ++- 2 files changed, 84 insertions(+), 85 deletions(-) diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index be106e6af..bfc2f8493 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -226,7 +226,6 @@ class PhrasesLib * - could be a string or an array of strings. These are the categories used to load phrases * - could be an array of categories, and for each category there is an array of phrases * language: optional parameter must be a string. It's used to load phrases - * stores phrases-array in property $_phrases */ private function _extend_construct($params) { @@ -234,8 +233,7 @@ class PhrasesLib if (is_array($params) && count($params) > 0) { $parameters = $params[0]; // temporary variable - $indexArray = false; //flag for indexed array - $assocArray = false; //flag for associative array + $isIndexArray = false; //flag for indexed array // If there are parameters if (is_array($parameters) && count($parameters) > 0) @@ -259,83 +257,89 @@ class PhrasesLib $language = $this->_ci->PersonModel->getLanguage(getAuthUID()); } - // Checks if categories is associative or indexed array - if (ctype_digit(implode('', array_keys($categories)))) - { - // is indexed array -> Loads phrases - $indexArray = true; - $phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, $language); - } - else - { - // is assoc array -> Loads specific phrasentexte by category and phrases - $assocArray = true; - $phrases = $this->_ci->PhraseModel - ->getPhrasesByCategoryAndPhrasesAndLanguage($categories, $language); - } - - // If language is not default language and phrasentext is null -> fallback to default language - if ($language != DEFAULT_LANGUAGE) - { - // get array with phrasentexte in the default language - $defaultPhrases = array(); - if ($indexArray) - { - $defaultPhrases = $this->_ci->PhraseModel - ->getPhrasesByCategoryAndLanguage($categories, DEFAULT_LANGUAGE); - } - elseif ($assocArray) - { - $defaultPhrases = $this->_ci->PhraseModel - ->getPhrasesByCategoryAndPhrasesAndLanguage($categories, DEFAULT_LANGUAGE); - } + $this->_setPhrases($categories, $language); + } + } + } - // combine array with phrasentexte in users language and in default language - // (default used if phrasentext in users language is null or not set) - $phrasesArr = array(); - if (!empty($phrases->retval)) + /** + * + * stores phrases-array in property $_phrases + */ + private function _setPhrases($categories, $language) + { + $phrases = null; + // Checks if categories is associative or indexed array + if (ctype_digit(implode('', array_keys($categories)))) + { + // is indexed array -> Loads phrases + $isIndexArray = true; + $phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, $language); + } + else + { + // is assoc array -> Loads specific phrasentexte by category and phrases + $isIndexArray = false; + $phrases = $this->_ci->PhraseModel + ->getPhrasesByCategoryAndPhrasesAndLanguage($categories, $language); + } + + // If language is not default language and phrasentext is null -> fallback to default language + if ($language != DEFAULT_LANGUAGE) + { + // get array with phrasentexte in the default language + $defaultPhrases = null; + if ($isIndexArray) + { + $defaultPhrases = $this->_ci->PhraseModel + ->getPhrasesByCategoryAndLanguage($categories, DEFAULT_LANGUAGE); + } + else + { + $defaultPhrases = $this->_ci->PhraseModel + ->getPhrasesByCategoryAndPhrasesAndLanguage($categories, DEFAULT_LANGUAGE); + } + + // combine array with phrasentexte in users language and in default language + // (default used if phrasentext in users language is null or not set) + if (hasData($phrases) && hasData($defaultPhrases)) + { + // loop through phrases in default language + foreach ($defaultPhrases->retval as $defaultPhrase) + { + $found = false; // flag for found phrase + + // loop through phrases in users language + foreach ($phrases->retval as $phrase) { - // loop through phrases in default language - foreach ($defaultPhrases->retval as $defaultPhrase) + // if same phrase and category found and text is not null + // use phrase in users language + if ($phrase->phrase == $defaultPhrase->phrase + && $phrase->category == $defaultPhrase->category + && !is_null($phrase->text)) { - $phraseObj = new stdClass(); - $found = false; // flag for found phrase - - // loop through phrases in users language - foreach ($phrases->retval as $phrase) - { - // if same phrase and category found and text is not null - // use phrase in users language - if ($phrase->phrase === $defaultPhrase->phrase - && $phrase->category === $defaultPhrase->category - && !is_null($phrase->text)) - { - $found = true; - array_push($phrasesArr, $phrase); - break; - } - } - - // otherwise use phrase in default language - if (!$found) - { - array_push($phrasesArr, $defaultPhrase); - } + $found = true; + break; } - $phrases->retval = $phrasesArr; } - else - { - $phrases->retval = $defaultPhrases->retval; - } - } - // If there are phrases loaded then store them in the property _phrases - if (hasData($phrases)) - { - $this->_phrases = $phrases->retval; + // otherwise use phrase in default language + if (!$found) + { + array_push($phrases->retval, $defaultPhrase); + } } } + elseif (hasData($defaultPhrases)) + { + $phrases = $defaultPhrases; + } + } + + // If there are phrases loaded then store them in the property _phrases + if (hasData($phrases)) + { + $this->_phrases = $phrases->retval; } } diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index da9da1a7e..694605ae3 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -89,26 +89,21 @@ class Phrase_model extends DB_Model SELECT p.category, p.phrase, pt.orgeinheit_kurzbz, pt.orgform_kurzbz, pt.text FROM system.tbl_phrase p INNER JOIN system.tbl_phrasentext pt USING(phrase_id) - WHERE '; + WHERE pt.sprache = ? AND '; + + $parametersArray = array($language); foreach ($phrasesParams as $category => $phrases) { - $query .= ' - (p.category = \'' . $category . '\' - AND phrase IN ('; - foreach ($phrases as $phrase) - { - $query .= '\'' . $phrase . '\', '; - } - - $query = rtrim($query, ', '); - $query .= ')) AND pt.sprache = \'' . $language . '\' OR '; + $query .= '(category = ? AND phrase IN ?) OR '; + $parametersArray[] = $category; + $parametersArray[] = $phrases; } - $query = rtrim($query, 'OR '); + $query = rtrim($query, ' OR '); $query .= ' ORDER BY p.category, p.phrase, pt.orgeinheit_kurzbz DESC, pt.orgform_kurzbz DESC'; - return $this->execQuery($query, array($phrasesParams, $language)); + return $this->execQuery($query, $parametersArray); } } From 7facb7ab78a526744984c2ad8f68687ae051d328 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 6 Jun 2018 15:12:42 +0200 Subject: [PATCH 55/62] Improved PhrasesLib and Phrase_model . optimized code in PhrasesLib.php . secured method in Phrase_model with bindings --- application/libraries/PhrasesLib.php | 9 +++++++-- application/models/system/Phrase_model.php | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index bfc2f8493..e50fc4d22 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -263,8 +263,13 @@ class PhrasesLib } /** - * - * stores phrases-array in property $_phrases + * Retrieves phrases in the users language. + * If a phrase is not set in the users language it will be retrieved in the default language. + * Stores phrases-array in property $_phrases. + * @param array $categories Could be an: + * - indexed array: string or an array of strings. These are the categories used to load phrases. + * - associative array: of categories, and for each category there is an array of phrases. + * @param string User's language or default language. */ private function _setPhrases($categories, $language) { diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index 694605ae3..fd121758a 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -81,7 +81,6 @@ class Phrase_model extends DB_Model /** * Loads phrases using category(s) and language as keys using associative category array * that contains also phrases for each category - * They are ordered by p.category, p.phrase, pt.orgeinheit_kurzbz DESC and pt.orgform_kurzbz DESC' */ public function getPhrasesByCategoryAndPhrasesAndLanguage($phrasesParams, $language) { From 5f2b02c44150e5330cce3b285db6163240dd2fda Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 6 Jun 2018 15:54:39 +0200 Subject: [PATCH 56/62] - persondatasetjs works with ajaxlib - added js object to persondatasetjs - no locking when details accessed from freigegeben - tablesorter filter remains when getting back from details page --- .../system/infocenter/InfoCenter.php | 37 ++- .../system/infocenter/infocenterDetails.php | 15 +- .../infocenter/infocenterFreigegeben.php | 2 +- public/css/sbadmin2/admintemplate.css | 4 +- public/js/FilterWidget.js | 22 +- public/js/infocenter/infocenterDetails.js | 15 +- .../js/infocenter/infocenterPersonDataset.js | 254 ++++++++---------- 7 files changed, 177 insertions(+), 172 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 25a653eb1..16668f095 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -129,24 +129,31 @@ class InfoCenter extends FHC_Controller $personexists = $this->PersonModel->load($person_id); - if(isError($personexists)) + if (isError($personexists)) show_error($personexists->retval); if (empty($personexists->retval)) show_error('person does not exist!'); - //mark person as locked for editing - $result = $this->PersonLockModel->lockPerson($person_id, $this->uid, self::APP); + $show_lock_link_get = $this->input->get('show_lock_link'); + $show_lock_link = !isset($show_lock_link_get) || $show_lock_link_get === '1'; - if(isError($result)) - show_error($result->retval); + if ($show_lock_link) + { + //mark person as locked for editing + $result = $this->PersonLockModel->lockPerson($person_id, $this->uid, self::APP); + + if (isError($result)) + show_error($result->retval); + } $persondata = $this->_loadPersonData($person_id); $prestudentdata = $this->_loadPrestudentData($person_id); $data = array_merge( $persondata, - $prestudentdata + $prestudentdata, + array('show_lock_link' => $show_lock_link) ); $data['fhc_controller_id'] = $this->fhc_controller_id; @@ -162,7 +169,7 @@ class InfoCenter extends FHC_Controller { $result = $this->PersonLockModel->unlockPerson($person_id, self::APP); - if(isError($result)) + if (isError($result)) show_error($result->retval); redirect(self::URL_PREFIX.'?fhc_controller_id='.$this->fhc_controller_id); @@ -245,9 +252,7 @@ class InfoCenter extends FHC_Controller $data['data'] = $studienordnung->retval[0]->data; } - $this->load->view('system/infocenter/studiengangZgvInfo.php', - $data - ); + $this->load->view('system/infocenter/studiengangZgvInfo.php', $data); } /** @@ -721,6 +726,18 @@ class InfoCenter extends FHC_Controller ); } + /** + * Wrapper for setNavigationMenu, returns JSON message + */ + public function setNavigationMenuArrayJson() + { + $this->setNavigationMenuArray(); + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode(success('success'))); + } + private function _fillFilters($filters, &$tofill) { foreach ($filters as $filterId => $description) diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 069cd99c7..7ad0e47a0 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -69,17 +69,16 @@
    - p->t('global', 'wirdBearbeitetVon').':' ?> p->t('global', 'wirdBearbeitetVon') . ': '; echo $lockedby; - ?> -    - -   - p->t('ui', 'freigeben')) ?> - + if (!isset($show_lock_link) || $show_lock_link === true): ?> +    + +  p->t('ui', 'freigeben')) ?> + +
    diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index f2c279b0f..998e79fbc 100755 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -172,7 +172,7 @@ 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( - 'Details', + 'Details', site_url('system/infocenter/InfoCenter/showDetails'), $datasetRaw->{'PersonId'}, (isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'') diff --git a/public/css/sbadmin2/admintemplate.css b/public/css/sbadmin2/admintemplate.css index e47fdd3b2..a0064e5c2 100644 --- a/public/css/sbadmin2/admintemplate.css +++ b/public/css/sbadmin2/admintemplate.css @@ -23,7 +23,7 @@ } /*arrow toggle for panels*/ -.panel-heading .accordion-toggle:before{ +.panel-heading .accordion-toggle.arrowcollapse:before{ /* symbol for "opening" panels */ font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */ content: "\e114"; /* adjust as needed, taken from bootstrap.css */ @@ -32,7 +32,7 @@ color: grey; /* adjust as needed */ } -.panel-heading .accordion-toggle.collapsed:before{ +.panel-heading .accordion-toggle.collapsed.arrowcollapse:before{ /* symbol for "collapsed" panels */ content: "\e080"; /* adjust as needed, taken from bootstrap.css */ } diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 60ca22f2f..191b754ab 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -22,7 +22,7 @@ function sideMenuHook() filter_id: $(this).attr('value') }, { - successCallback: refreshSideMenu // NOTE: to be checked + successCallback: InfocenterPersonDataset.refreshSideMenu // NOTE: to be checked } ); }); @@ -390,6 +390,9 @@ var FHC_FilterWidget = { }, { successCallback: function(data, textStatus, jqXHR) { + //tablesorter filter local storage clean + $("#filterTableDataset").trigger("filterResetSaved"); + FHC_FilterWidget._resetSelectedFields(); FHC_FilterWidget.renderSelectedFields(); @@ -442,6 +445,9 @@ var FHC_FilterWidget = { }, { successCallback: function(data, textStatus, jqXHR) { + //tablesorter filter local storage clean + $("#filterTableDataset").trigger("filterResetSaved"); + FHC_FilterWidget._resetSelectedFields(); FHC_FilterWidget.renderSelectedFields(); @@ -671,9 +677,19 @@ var FHC_FilterWidget = { && $('#filterTableDataset').hasClass('table-condensed')) { $("#filterTableDataset").tablesorter({ - widgets: ["zebra", "filter"] + widgets: ["zebra", "filter"], + widgetOptions: { + filter_saveFilters : true + } }); + // reset filter storage if there is a filter id in url TODO: find better solution + var filter_id = FHC_AjaxClient.getUrlParameter("filter_id"); + if (typeof filter_id !== 'undefined') + { + $("#filterTableDataset").trigger("filterResetSaved"); + } + var config = $('#filterTableDataset')[0].config; $.tablesorter.updateAll(config, true, null); } @@ -733,7 +749,7 @@ $(document).ready(function() { filter_page: FHC_FilterWidget._getFilterPage() }, { - successCallback: refreshSideMenu // NOTE: to be checked + successCallback: InfocenterPersonDataset.refreshSideMenu // NOTE: to be checked } ); } diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 746b61da2..2fd8585f7 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -6,9 +6,8 @@ const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; /** * javascript file for infocenterDetails page */ -$(document).ready( - function () - { +$(document).ready(function () +{ //initialise table sorter Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); @@ -209,8 +208,7 @@ var InfocenterDetails = { { FHC_AjaxClient.ajaxCallGet( CALLED_PATH + "/getLastPrestudentWithZgvJson/" + encodeURIComponent(personid), - { - }, + null, { successCallback: function(data, textStatus, jqXHR) { if (FHC_AjaxClient.hasData(data)) @@ -319,13 +317,11 @@ var InfocenterDetails = { { FHC_AjaxClient.ajaxCallGet( CALLED_PATH + "/getStudienjahrEnd", - { - }, + null, { successCallback: function(data, textStatus, jqXHR) { if (data) { - console.log("studienjahr end executed"); var engdate = $.datepicker.parseDate("yy-mm-dd", data); var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); $("#parkdate").val(gerdate); @@ -339,8 +335,7 @@ var InfocenterDetails = { { FHC_AjaxClient.ajaxCallGet( CALLED_PATH + "/getParkedDate/"+encodeURIComponent(personid), - { - }, + null, { successCallback: function(data, textStatus, jqXHR) { InfocenterDetails._refreshParking(data); diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 4146edc9b..eb9f0f9c1 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -3,151 +3,129 @@ */ $(document).ready(function() { - appendTableActionsHtml(); + InfocenterPersonDataset.appendTableActionsHtml(); // setTableActions(); }); -/** - * adds person table additional actions html (above and beneath it) - */ -function appendTableActionsHtml() -{ - var currurl = window.location.href; - var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write"); +var InfocenterPersonDataset = { - var formHtml = ''; - $("#datasetActionsTop").before(formHtml); - - var selectAllHtml = - '' + - ' Alle  ' + - '' + - ' Keinen    '; - - var actionHtml = 'Mit Ausgewählten:  ' + - '' + - ' Nachricht senden'; - - var legendHtml = ' Gesperrt    ' + - ' Geparkt'; - - var personcount = 0; - - $.ajax({ - url: window.location.pathname.replace('infocenter/InfoCenter', 'Filters/rowNumber'), - method: "GET", - data: { - fhc_controller_id: getUrlParameter("fhc_controller_id"), - filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method - }, - dataType: "json" - }) - .done(function(data, textStatus, jqXHR) { - - if (data != null) - { - if (data.rowNumber != null) - { - personcount = data.rowNumber; - - var persontext = personcount === 1 ? "Person" : "Personen"; - var countHtml = personcount + " " + persontext; - - $("#datasetActionsTop, #datasetActionsBottom").append( - "
    "+ - "
    " + selectAllHtml + "  " + actionHtml + "
    "+ - "
    " + legendHtml + "
    "+ - "
    " + countHtml + "
    "+ - "
    "+ - "
    " - ); - $("#datasetActionsBottom").append("

    "); - } - - setTableActions(); - } - - }).fail(function(jqXHR, textStatus, errorThrown) { - alert(textStatus); - }); - -} - -/** - * sets functionality for the actions above and beneath the person table - */ -function setTableActions() -{ - $(".sendMsgsLink").click(function() { - var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); - if(idsel.length > 0) - { - var form = $("#sendMsgsForm"); - form.find("input[type=hidden]").remove(); - for (var i = 0; i < idsel.length; i++) - { - var id = $(idsel[i]).val(); - form.append(""); - } - form.submit(); - } - }); - - $(".selectAll").click(function() - { - //select only trs if not filtered by tablesorter - var trs = $("#filterTableDataset tbody tr").not(".filtered"); - trs.find("input[name=PersonId\\[\\]]").prop("checked", true); - } - ); - - $(".unselectAll").click(function() - { - var trs = $("#filterTableDataset tbody tr").not(".filtered"); - trs.find("input[name=PersonId\\[\\]]").prop("checked", false); - } - ); -} - -/** - * - */ -function getUrlParameter(sParam) -{ - var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), - sParameterName, - i; - - for (i = 0; i < sURLVariables.length; i++) + /** + * adds person table additional actions html (above and beneath it) + /* + */ + appendTableActionsHtml: function() { - sParameterName = sURLVariables[i].split('='); + var currurl = window.location.href; + var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write"); - if (sParameterName[0] === sParam) - { - return sParameterName[1]; - } - } -} + var formHtml = '
    '; + $("#datasetActionsTop").before(formHtml); -/** - * Refreshes the side menu - */ -function refreshSideMenu() -{ - $.ajax({ - url: window.location.pathname+"/setNavigationMenuArray", - method: "GET", - data: { - fhc_controller_id: getUrlParameter("fhc_controller_id") - } - }) - .done(function(data, textStatus, jqXHR) { + var selectAllHtml = + '' + + ' Alle  ' + + '' + + ' Keinen    '; - FHC_NavigationWidget.renderSideMenu(); + var actionHtml = 'Mit Ausgewählten:  ' + + '' + + ' Nachricht senden'; - }).fail(function(jqXHR, textStatus, errorThrown) { - alert(textStatus); - }); -} + var legendHtml = ' Gesperrt    ' + + ' Geparkt'; + + var personcount = 0; + + FHC_AjaxClient.ajaxCallGet( + 'system/Filters/rowNumber', + { + filter_page: FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (data != null) + { + if (data.rowNumber != null) + { + personcount = data.rowNumber; + + var persontext = personcount === 1 ? "Person" : "Personen"; + var countHtml = personcount + " " + persontext; + + $("#datasetActionsTop, #datasetActionsBottom").append( + "
    "+ + "
    " + selectAllHtml + "  " + actionHtml + "
    "+ + "
    " + legendHtml + "
    "+ + "
    " + countHtml + "
    "+ + "
    "+ + "
    " + ); + $("#datasetActionsBottom").append("

    "); + } + + InfocenterPersonDataset.setTableActions(); + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + alert(textStatus); + } + } + ); + }, + + /** + * sets functionality for the actions above and beneath the person table + */ + setTableActions: function() + { + $(".sendMsgsLink").click(function() { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + if(idsel.length > 0) + { + var form = $("#sendMsgsForm"); + form.find("input[type=hidden]").remove(); + for (var i = 0; i < idsel.length; i++) + { + var id = $(idsel[i]).val(); + form.append(""); + } + form.submit(); + } + }); + + $(".selectAll").click(function() + { + //select only trs if not filtered by tablesorter + var trs = $("#filterTableDataset tbody tr").not(".filtered"); + trs.find("input[name=PersonId\\[\\]]").prop("checked", true); + } + ); + + $(".unselectAll").click(function() + { + var trs = $("#filterTableDataset tbody tr").not(".filtered"); + trs.find("input[name=PersonId\\[\\]]").prop("checked", false); + } + ); + }, + + /** + * Refreshes the side menu + */ + refreshSideMenu: function() + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/setNavigationMenuArrayJson', + null, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_NavigationWidget.renderSideMenu(); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + alert(textStatus); + } + } + ); + } +}; From c00f6d26759977039b7a1c9966c950dc651b23b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 7 Jun 2018 07:58:30 +0200 Subject: [PATCH 57/62] Fixed Pruefungsanmeldung --- cis/private/lehre/pruefung/pruefung.js.php | 4 +--- cis/private/lehre/pruefung/pruefungsanmeldung.php | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cis/private/lehre/pruefung/pruefung.js.php b/cis/private/lehre/pruefung/pruefung.js.php index 99a53c107..a0fd685b1 100644 --- a/cis/private/lehre/pruefung/pruefung.js.php +++ b/cis/private/lehre/pruefung/pruefung.js.php @@ -370,14 +370,12 @@ function writePruefungsTable(e, data, anmeldung) { if(storno) { - //button = "

    Stornieren (bis "+frist+"):
    "; button = "

    "+frist+"'>

    "; } else { - //button = "

    Anmelden (bis "+frist+"):

    "; - button = "

    "+frist+"';>

    "; + button = "

    "+frist+"'>

    "; } } else diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.php b/cis/private/lehre/pruefung/pruefungsanmeldung.php index 71b427cf2..f6c058075 100644 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.php @@ -133,6 +133,10 @@ $studiensemester->getAll(); margin: 0; height: 24px; } + .ui-dialog + { + z-index: 101; + } @@ -140,11 +144,11 @@ $studiensemester->getAll(); + function GeburtsdatumEintragen() + { + svnr = document.getElementById('svnr').value; + gebdat = document.getElementById('geburtsdatum'); + + if (svnr.length==10 && gebdat.value=='') + { + var tag = svnr.substr(4,2); + var monat = svnr.substr(6,2); + var jahr = svnr.substr(8,2); + + gebdat.value='19'+jahr+'-'+monat+'-'+tag; + } + } + + function disablefields2(val) + { + document.getElementById('adresse').disabled=val; + document.getElementById('plz').disabled=val; + document.getElementById('ort').disabled=val; + } +

    Person Anlegen

    @@ -105,7 +101,10 @@ function disablefields2(val) $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); -if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('mitarbeiter') && !$rechte->isBerechtigt('assistenz') && !$rechte->isBerechtigt('basis/firma')) +if (!$rechte->isBerechtigt('admin') + && !$rechte->isBerechtigt('mitarbeiter') + && !$rechte->isBerechtigt('assistenz') + && !$rechte->isBerechtigt('basis/firma', null, 'sui')) die('Sie haben keine Berechtigung fuer diese Seite'); $where = ''; @@ -132,7 +131,7 @@ $ueberschreiben = (isset($_REQUEST['ueberschreiben'])?$_REQUEST['ueberschreiben' $geburtsdatum_error=false; // *** Speichern der Daten *** -if(isset($_POST['save'])) +if (isset($_POST['save'])) { //echo "Saving Data: Geburtsdatum: $geburtsdatum | Titel: $titel | Nachname: $nachname | Vorname: $vorname | // Geschlecht: $geschlecht | Adresse: $adresse | Plz: $plz | Ort: $ort | @@ -142,7 +141,10 @@ if(isset($_POST['save'])) $db->db_query('BEGIN'); //Wenn die person_id=0 dann wird eine neue Person angelegt //Sonst nicht - if($person_id=='0') + if ($person_id == '') + die('Es ist ein Fehler aufgetreten'); + + if ($person_id=='0') { $person->new = true; $person->anrede = $anrede; @@ -157,9 +159,9 @@ if(isset($_POST['save'])) $person->aktiv = true; $person->insertamum = date('Y-m-d H:i:s'); $person->insertvon = $user; - $person->zugangscode= uniqid(); - - if($person->save()) + $person->zugangscode= uniqid(); + + if ($person->save()) { $error=false; } @@ -169,16 +171,16 @@ if(isset($_POST['save'])) $errormsg = "Person konnte nicht gespeichert werden: $person->errormsg"; } } - + //Adresse anlegen - if($ueberschreiben!='' && !($plz=='' && $adresse=='' && $ort=='')) + if ($ueberschreiben!='' && !($plz=='' && $adresse=='' && $ort=='')) { - if($person_id=='0') + if ($person_id=='0') $ueberschreiben='Nein'; $adr = new adresse(); //Adresse neu anlegen - if($ueberschreiben=='Nein') + if ($ueberschreiben=='Nein') { $adr->new = true; $adr->insertamum = date('Y-m-d H:i:s'); @@ -190,10 +192,10 @@ if(isset($_POST['save'])) //Adressen der Peron laden $adr->load_pers($person->person_id); - if(isset($adr->result[0])) + if (isset($adr->result[0])) { //Erste Adresse laden - if($adr->load($adr->result[0]->adresse_id)) + if ($adr->load($adr->result[0]->adresse_id)) { $adr->new = false; $adr->updateamum = date('Y-m-d H:i:s'); @@ -214,7 +216,7 @@ if(isset($_POST['save'])) } } - if(!$error) + if (!$error) { //Adressdaten zuweisen und speichern $adr->person_id = $person->person_id; @@ -224,7 +226,7 @@ if(isset($_POST['save'])) $adr->typ = 'h'; $adr->heimatadresse = true; $adr->zustelladresse = true; - if(!$adr->save()) + if (!$adr->save()) { $error = true; $errormsg = $adr->errormsg; @@ -233,10 +235,10 @@ if(isset($_POST['save'])) } //Kontaktdaten anlegen - if(!$error) + if (!$error) { //EMail Adresse speichern - if($email!='') + if ($email!='') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -247,14 +249,14 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Email Adresse'; } } //Telefonnummer speichern - if($telefon!='') + if ($telefon!='') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -265,14 +267,14 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Telefonnummer'; } } //Mobiltelefonnummer speichern - if($mobil!='') + if ($mobil!='') { $kontakt = new kontakt(); $kontakt->person_id = $person->person_id; @@ -283,7 +285,7 @@ if(isset($_POST['save'])) $kontakt->insertvon = $user; $kontakt->new = true; - if(!$kontakt->save()) + if (!$kontakt->save()) { $error = true; $errormsg = 'Fehler beim Speichern der Mobiltelefonnummer'; @@ -291,7 +293,7 @@ if(isset($_POST['save'])) } } - if(!$error) + if (!$error) { $db->db_query('COMMIT'); die("'; $toPrint .= "\n\n"; diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index e7b2a11a9..6350e8057 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -283,15 +283,12 @@ class FilterWidget extends Widget // Save changes into session if data are valid if (!isError($dataset)) { - $formattedDataset = $this->_formatDataset($dataset); // format the dataset using markRow and formatRow + $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow - // Set the new dataset and it's attributes in the session - $this->filterslib->setElementSession( - FiltersLib::SESSION_DATASET_METADATA, - $this->FiltersModel->getExecutedQueryMetaData() - ); + // Set the new dataset and its attributes in the session + $this->filterslib->setElementSession(FiltersLib::SESSION_METADATA, $this->FiltersModel->getExecutedQueryMetaData()); $this->filterslib->setElementSession(FiltersLib::SESSION_ROW_NUMBER, count($dataset->retval)); - $this->filterslib->setElementSession(FiltersLib::SESSION_DATASET, $formattedDataset); + $this->filterslib->setElementSession(FiltersLib::SESSION_DATASET, $dataset->retval); } } } @@ -324,7 +321,7 @@ class FilterWidget extends Widget // Save changes into session if data are valid if (!isError($dataset)) { - $formattedDataset = $this->_formatDataset($dataset); // format the dataset using markRow and formatRow + $this->_formatDataset($dataset); // marks rows using markRow and format rowns using formatRow // Stores an array that contains all the data useful for $this->filterslib->setSession( @@ -341,90 +338,86 @@ class FilterWidget extends Widget FiltersLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // FiltersLib::SESSION_CHECKBOXES => $this->_checkboxes, // FiltersLib::SESSION_FILTERS => $parsedFilterJson->filters, // - FiltersLib::SESSION_DATASET_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // + FiltersLib::SESSION_METADATA => $this->FiltersModel->getExecutedQueryMetaData(), // FiltersLib::SESSION_ROW_NUMBER => count($dataset->retval), // - FiltersLib::SESSION_DATASET => $formattedDataset, // + FiltersLib::SESSION_DATASET => $dataset->retval, // FiltersLib::SESSION_RELOAD_DATASET => false // ) ); } } } - - // var_dump($this->filterslib->getSession()); } /** - * + * Calls the method _markRow and _formatRow to marks rows using markRow and format rowns using formatRow + * NOTE: this method operates directly on the retrived dataset: parameter passed by reference */ - private function _formatDataset($rawDataset) + private function _formatDataset(&$rawDataset) { - $formattedDataset = null; - if (hasData($rawDataset) && is_array($rawDataset->retval)) { - $formattedDataset = array(); - + // For each row of the data set for ($rowCounter = 0; $rowCounter < count($rawDataset->retval); $rowCounter++) { - $row = $rawDataset->retval[$rowCounter]; - - $formattedRow = $this->_formatRow($row); - $formattedRow->MARK_ROW_CLASS = $this->_markRow($row); - $formattedDataset[] = $formattedRow; + // Calls the methods to mark and to format a row + // NOTE: keep this order! the markRow function given as parameter is supposing to work + // on a raw dataset, NOT on a formatted one + $rawDataset->retval[$rowCounter]->MARK_ROW_CLASS = $this->_markRow($rawDataset->retval[$rowCounter]); + $this->_formatRow($rawDataset->retval[$rowCounter]); } } - - return $formattedDataset; } /** - * + * Formats the columns of all the rows of the entire dataset + * - converts booleans into strings "true" and "false" + * - format dates using the format string defined in DEFAULT_DATE_FORMAT + * Calls the parameter formatRow if it was given and if it is a valid funtion + * NOTE: this method operates directly on the retrived dataset: parameter passed by reference */ - private function _formatRow($datasetRaw) + private function _formatRow(&$rawDatasetRow) { - $tmpDatasetRaw = clone $datasetRaw; - - foreach ($tmpDatasetRaw as $columnName => $columnValue) + // For each column of the row + foreach ($rawDatasetRow as $columnName => $columnValue) { + // Basic conversions if (is_bool($columnValue)) { - $tmpDatasetRaw->{$columnValue} = $columnValue === true ? 'true' : 'false'; + $rawDatasetRow->{$columnValue} = $columnValue === true ? 'true' : 'false'; } elseif (DateTime::createFromFormat('Y-m-d G:i:s', $columnValue) !== false) { - $tmpDatasetRaw->{$columnValue} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue)); + $rawDatasetRow->{$columnValue} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue)); } } - if ($this->_formatRow != null) + // If a valid function call the given formatRow + if ($this->_formatRow != null && is_callable($this->_formatRow)) { - $formatRow = $this->_formatRow; - $tmpDatasetRaw = $formatRow($tmpDatasetRaw); + $formatRowFunction = $this->_formatRow; + $rawDatasetRow = $formatRowFunction($rawDatasetRow); } - - return $tmpDatasetRaw; } /** - * + * Returns a string that contains a class name used to mark rows in the dataset table + * Calls the parameter markRow if it was given and if it is a valid funtion */ - private function _markRow($datasetRaw) + private function _markRow($rawDatasetRow) { - if (is_object($datasetRaw)) + // If a valid function call the given markRow + if ($this->_markRow != null && is_callable($this->_markRow)) { - if ($this->_markRow != null) - { - $markRow = $this->_markRow; - $class = $markRow($datasetRaw); - } + $markRowFunction = $this->_markRow; + $class = $markRowFunction($rawDatasetRow); } return !isset($class) ? '' : $class; } /** - * + * Utility method that retrives the name of the columns present in a filter JSON definition */ private function _getColumnsNames($columns) { diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 621129ae8..c96a06590 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -60,11 +60,10 @@ var FHC_FilterWidget = { }, /** - * To refresh the whole FilterWidget GUI + * Alias call to method display only to inprove the readability of the code */ refresh: function() { - FHC_FilterWidget._resetFilterOptions(); FHC_FilterWidget.display(); }, @@ -114,19 +113,12 @@ var FHC_FilterWidget = { /** * To reset the Filter Options GUI */ - _resetFilterOptions: function() { + _resetGUI: function() { $("#dragAndDropFieldsArea").html(""); - $("#addField").html(""); + $("#addField").html(""); $("#appliedFilters").html(""); - $("#addFilter").html(""); - }, - - /** - * To reset the Filter Table GUI - */ - _resetTableDataset: function() { - + $("#addFilter").html(""); $("#filterTableDataset > thead > tr").html(""); $("#filterTableDataset > tbody").html(""); }, @@ -157,15 +149,13 @@ var FHC_FilterWidget = { * This method calls all the other methods needed to rendere the GUI for a FilterWidget * The parameter data contains all the data about the FilterWidget and it is given as parameter * to all the methods that here are called + * NOTE: think very carefully before changing the order of the calls */ _renderFilterWidget: function(data) { FHC_FilterWidget._initSessionStorage(); // initialize the session storage FHC_FilterWidget._turnOffEvents(); // turns all the events off - - // Reset the entire GUI - FHC_FilterWidget._resetFilterOptions(); - FHC_FilterWidget._resetTableDataset(); + FHC_FilterWidget._resetGUI(); // Reset the entire GUI // Render the GUI for this FilterWidget FHC_FilterWidget._setFilterName(data); // set the name in the GUI diff --git a/public/js/PhrasesLib.js b/public/js/PhrasesLib.js index 4818c7de4..d8c67d4f8 100644 --- a/public/js/PhrasesLib.js +++ b/public/js/PhrasesLib.js @@ -10,9 +10,9 @@ */ /** - * Definition and initialization of object FHC_PhraseLib + * Definition and initialization of object FHC_PhrasesLib */ -var FHC_PhraseLib = { +var FHC_PhrasesLib = { //------------------------------------------------------------------------------------------------------------------ // Public methods @@ -46,7 +46,7 @@ var FHC_PhraseLib = { params = []; } - return FHC_PhraseLib._replacePhraseVariable(phraseObj.text, params); // parsing + return FHC_PhrasesLib._replacePhraseVariable(phraseObj.text, params); // parsing } } } diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 2fd8585f7..d4efed894 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -132,7 +132,7 @@ $(document).ready(function () var notizTitle = $(this).find("td:eq(1)").text(); var notizContent = this.title; - $("#notizform label:first").text(FHC_PhraseLib.t('infocenter', 'notizAendern')).css("color", "red"); + $("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizAendern')).css("color", "red"); $("#notizform :input[type='reset']").css("display", "inline-block"); $("#notizform :input[name='hiddenNotizId']").val(notizId); @@ -241,7 +241,7 @@ var InfocenterDetails = { saveZgv: function(data) { var zgvError = function(){ - $("#zgvSpeichern_" + prestudentid).before("" + FHC_PhraseLib.t('ui', 'fehlerBeimSpeichern') + "  "); + $("#zgvSpeichern_" + prestudentid).before("" + FHC_PhrasesLib.t('ui', 'fehlerBeimSpeichern') + "  "); }; var prestudentid = data.prestudentid; @@ -256,7 +256,7 @@ var InfocenterDetails = { if (FHC_AjaxClient.hasData(data)) { InfocenterDetails._refreshLog(); - $("#zgvSpeichern_" + prestudentid).before("" + FHC_PhraseLib.t('ui', 'gespeichert') + "  "); + $("#zgvSpeichern_" + prestudentid).before("" + FHC_PhrasesLib.t('ui', 'gespeichert') + "  "); } else { @@ -387,11 +387,11 @@ var InfocenterDetails = { if (data.length > 0) InfocenterDetails.getParkedDate(personid); else - $("#unparkmsg").removeClass().addClass("text-warning").text(FHC_PhraseLib.t('infocenter', 'nichtsZumAusparken')); + $("#unparkmsg").removeClass().addClass("text-warning").text(FHC_PhrasesLib.t('infocenter', 'nichtsZumAusparken')); } }, errorCallback: function(){ - $("#unparkmsg").removeClass().addClass("text-danger").text(FHC_PhraseLib.t('infocenter', 'fehlerBeimAusparken')); + $("#unparkmsg").removeClass().addClass("text-danger").text(FHC_PhrasesLib.t('infocenter', 'fehlerBeimAusparken')); }, veilTimeout: 0 } @@ -435,8 +435,8 @@ var InfocenterDetails = { { $("#parking").html( '
    '+ - '     '+ - FHC_PhraseLib.t('global', 'bis') + '  '+ + '     '+ + FHC_PhrasesLib.t('global', 'bis') + '  '+ ' '+ ''+ '
    '); @@ -462,8 +462,8 @@ var InfocenterDetails = { var parkdate = $.datepicker.parseDate("yy-mm-dd", date); var gerparkdate = $.datepicker.formatDate("dd.mm.yy", parkdate); $("#parking").html( - FHC_PhraseLib.t('infocenter', 'bewerberGeparktBis')+'  '+gerparkdate+'     '+ - ' '+ + FHC_PhrasesLib.t('infocenter', 'bewerberGeparktBis')+'  '+gerparkdate+'     '+ + ' '+ '' ); @@ -486,11 +486,11 @@ var InfocenterDetails = { { $("#notizmsg").empty(); $("#notizform :input[name='hiddenNotizId']").val(""); - $("#notizform label:first").text(FHC_PhraseLib.t('infocenter', 'notizHinzufuegen')).css("color", "black"); + $("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizHinzufuegen')).css("color", "black"); $("#notizform :input[type='reset']").css("display", "none"); }, _errorSaveNotiz: function() { - $("#notizmsg").text(FHC_PhraseLib.t('ui', 'fehlerBeimSpeichern')); + $("#notizmsg").text(FHC_PhrasesLib.t('ui', 'fehlerBeimSpeichern')); } }; diff --git a/public/js/tablesort/tablesort.js b/public/js/tablesort/tablesort.js index 1f901e74c..597d9e4a1 100644 --- a/public/js/tablesort/tablesort.js +++ b/public/js/tablesort/tablesort.js @@ -61,7 +61,7 @@ var Tablesort = { size: size, cssDisabled: 'disabled', savePages: false, - output: '{startRow} – {endRow} / {totalRows} ' + FHC_PhraseLib.t('global', 'zeilen') + output: '{startRow} – {endRow} / {totalRows} ' + FHC_PhrasesLib.t('global', 'zeilen') } ); } From 936cca98e6a54bb88ccc7a8b761fe21341f50c86 Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 8 Jun 2018 15:28:29 +0200 Subject: [PATCH 62/62] Removed backup files --- application/widgets/FilterWidget.bak.php | 1231 ---------------------- 1 file changed, 1231 deletions(-) delete mode 100644 application/widgets/FilterWidget.bak.php diff --git a/application/widgets/FilterWidget.bak.php b/application/widgets/FilterWidget.bak.php deleted file mode 100644 index fe74a661f..000000000 --- a/application/widgets/FilterWidget.bak.php +++ /dev/null @@ -1,1231 +0,0 @@ -_initFilterWidget($args); // - - $this->_initSession(); // - - // - $this->load->model('system/Filters_model', 'FiltersModel'); - $this->load->model('person/Benutzer_model', 'BenutzerModel'); - - self::$FilterWidgetInstance = $this; - } - - /** - * - */ - public function display($widgetData) - { - // - $filterSessionArray = $this->_readSession(); - - // - if ($this->filterId == null && isset($filterSessionArray[self::FILTER_ID])) - { - $this->filterId = $filterSessionArray[self::FILTER_ID]; - } - - // - if ($this->filterName == null && isset($filterSessionArray[self::FILTER_NAME])) - { - $this->filterName = $filterSessionArray[self::FILTER_NAME]; - } - - if ($this->filterNamePhrase == null && isset($filterSessionArray[self::FILTER_NAME_PHRASE])) - { - $this->filterNamePhrase = $filterSessionArray[self::FILTER_NAME_PHRASE]; - } - - // - if ($this->filterId <= 0 || $filterSessionArray[self::FILTER_ID] != $this->filterId) - { - // - $this->_loadFilter(); - } - - // - $this->_setSessionFilterData(); - - // - $this->FiltersModel->resetQuery(); - - $query = $this->_generateQuery(); - if ($query != null) - { - // - $this->dataset = @$this->FiltersModel->execReadOnlyQuery($query); - - // - $this->listFields = $this->FiltersModel->getExecutedQueryListFields(); - - // - $selectedFields = array(); - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::SELECTED_FIELDS])) - { - $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; - } - - // - if (count($selectedFields) == 0) - { - $filterSessionArray[self::SELECTED_FIELDS] = $this->listFields; - } - - // - if ($this->columnsAliases != null && count($this->listFields) != count($this->columnsAliases)) - { - show_error('Parameter columnsAliases does not have a number of items equal to those returned by the query'); - } - - $filterSessionArray[self::COLUMNS_ALIASES] = $this->_getColumnAliasesFromPost(); - $filterSessionArray[self::CHECKBOXES] = $this->checkboxes; - - if ($this->app != null) - { - $filterSessionArray[self::APP_PARAMETER] = $this->app; - } - - if ($this->datasetName != null) - { - $filterSessionArray[self::DATASET_NAME_PARAMETER] = $this->datasetName; - } - - $filterSessionArray[self::ALL_SELECTED_FIELDS] = $this->listFields; - $filterSessionArray[self::ALL_COLUMNS_ALIASES] = $this->columnsAliases; - - /* ------------------------------------------------------------ */ - - $tmpDataset = null; - if (hasData($this->dataset)) - { - $tmpDataset = array(); - - for ($resultsCounter = 0; $resultsCounter < count($this->dataset->retval); $resultsCounter++) - { - $result = $this->dataset->retval[$resultsCounter]; - - $class = $this->_markRow($result); - $formattedResult = $this->_formatRaw($result); - $formattedResult->FILTER_CLASS_MARK_ROW = $class; - $tmpDataset[] = $formattedResult; - } - } - - $filterSessionArray[self::DATASET_PARAMETER] = $tmpDataset; - - /* ------------------------------------------------------------ */ - - // - $this->metaData = $this->FiltersModel->getExecutedQueryMetaData(); - - $filterSessionArray[self::METADATA_PARAMETER] = $this->metaData; - } - - $this->_writeSession($filterSessionArray); - - // - $this->loadViewFilters(); - } - - /** - * - */ - public static function getSelectedFilters() - { - return self::_getFromSession(self::SELECTED_FILTERS); - } - - /** - * - */ - public static function getColumnsAliases() - { - return self::_getFromSession(self::COLUMNS_ALIASES); - } - - /** - * - */ - public static function loadViewSelectFields() - { - if (self::$FilterWidgetInstance->hideHeader != true) - { - self::_loadView(self::WIDGET_URL_SELECT_FIELDS); - } - } - - /** - * - */ - public static function loadViewSelectFilters() - { - if (self::$FilterWidgetInstance->hideHeader != true) - { - self::_loadView(self::WIDGET_URL_SELECT_FILTERS); - } - } - - /** - * - */ - public static function loadViewSaveFilter() - { - if (self::$FilterWidgetInstance->hideSave != true) - { - self::_loadView(self::WIDGET_URL_SAVE_FILTER); - } - } - - /** - * - */ - public static function loadViewTableDataset() - { - self::_loadView(self::WIDGET_URL_TABLE_DATASET); - } - - /** - * - */ - private function _formatRaw($datasetRaw) - { - $tmpDatasetRaw = clone $datasetRaw; - - foreach ($tmpDatasetRaw as $columnName => $columnValue) - { - if (is_bool($columnValue)) - { - $tmpDatasetRaw->{$columnValue} = $columnValue === true ? 'true' : 'false'; - } - elseif (DateTime::createFromFormat('Y-m-d G:i:s', $columnValue) !== false) - { - $tmpDatasetRaw->{$columnValue} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue)); - } - } - - if ($this->formatRaw != null) - { - $formatRaw = $this->formatRaw; - $tmpDatasetRaw = $formatRaw($tmpDatasetRaw); - } - - return $tmpDatasetRaw; - } - - /** - * - */ - private function _markRow($datasetRaw) - { - if (is_object($datasetRaw)) - { - if ($this->markRow != null) - { - $markRow = $this->markRow; - $class = $markRow($datasetRaw); - } - } - - return $class == null ? '' : $class; - } - - /** - * - */ - public static function displayFilterName() - { - if (self::$FilterWidgetInstance->filterNamePhrase != null && self::$FilterWidgetInstance->filterNamePhrase != '') - { - echo self::$FilterWidgetInstance->filterNamePhrase; - } - elseif (self::$FilterWidgetInstance->filterName != null && self::$FilterWidgetInstance->filterName != '') - { - echo self::$FilterWidgetInstance->filterName; - } - } - - //------------------------------------------------------------------------------------------------------------------ - // Protected - - /** - * - */ - protected function loadViewFilters() - { - // Loads views - $this->view(self::WIDGET_URL_FILTER); - } - - //------------------------------------------------------------------------------------------------------------------ - // Private - - /** - * - */ - private static function _getFromSession($key) - { - $_getFromSession = null; - $ci =& get_instance(); - $filterSessionArray = $ci->session->userdata(self::SESSION_NAME); - - if (isset($filterSessionArray[$key])) - { - $_getFromSession = $filterSessionArray[$key]; - } - - return $_getFromSession; - } - - /** - * - */ - private static function _getActiveFilterValue($filterName) - { - $getActiveFilterValue = ''; - - $activeFields = self::_getFromSession(self::ACTIVE_FILTERS); - - if (isset($activeFields[$filterName])) - { - $getActiveFilterValue = $activeFields[$filterName]; - } - - return $getActiveFilterValue; - } - - /** - * - */ - private static function _getActiveFilterOperationValue($filterName) - { - $getActiveFilterOperationValue = ''; - - $activeFieldsOperation = self::_getFromSession(self::ACTIVE_FILTERS_OPERATION); - - if (isset($activeFieldsOperation[$filterName])) - { - $getActiveFilterOperationValue = $activeFieldsOperation[$filterName]; - } - - return $getActiveFilterOperationValue; - } - - /** - * - */ - private static function _getActiveFilterOptionValue($filterName) - { - $getActiveFilterOptionValue = ''; - - $activeFieldsOption = self::_getFromSession(self::ACTIVE_FILTERS_OPTION); - - if (isset($activeFieldsOption[$filterName])) - { - $getActiveFilterOptionValue = $activeFieldsOption[$filterName]; - } - - return $getActiveFilterOptionValue; - } - - /** - * - */ - private static function _loadView($viewName, $parameters = null) - { - $ci =& get_instance(); - $ci->load->view($viewName, $parameters); - } - - /** - * - */ - private function _initSession() - { - $filterSessionArray = array(); - - $session = $this->_readSession(); - - if (count($session) > 0) - { - $filterSessionArray = $session; - } - - if (!isset($filterSessionArray[self::SELECTED_FIELDS])) - { - $filterSessionArray[self::SELECTED_FIELDS] = array(); - } - - if (!isset($filterSessionArray[self::SELECTED_FILTERS])) - { - $filterSessionArray[self::SELECTED_FILTERS] = array(); - } - - if (!isset($filterSessionArray[self::ACTIVE_FILTERS])) - { - $filterSessionArray[self::ACTIVE_FILTERS] = array(); - } - - if (!isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION])) - { - $filterSessionArray[self::ACTIVE_FILTERS_OPERATION] = array(); - } - - if (!isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION])) - { - $filterSessionArray[self::ACTIVE_FILTERS_OPTION] = array(); - } - - if (!isset($filterSessionArray[self::ADDITIONAL_COLUMNS])) - { - $filterSessionArray[self::ADDITIONAL_COLUMNS] = array(); - } - - if (!isset($filterSessionArray[self::FILTER_ID])) - { - $filterSessionArray[self::FILTER_ID] = -1; - } - - if (!isset($filterSessionArray[self::COLUMNS_ALIASES])) - { - $filterSessionArray[self::COLUMNS_ALIASES] = array(); - } - - if (!isset($filterSessionArray[self::FILTER_NAME])) - { - $filterSessionArray[self::FILTER_NAME] = null; - } - - if (!isset($filterSessionArray[self::APP_PARAMETER])) - { - $filterSessionArray[self::APP_PARAMETER] = null; - } - - if (!isset($filterSessionArray[self::DATASET_NAME_PARAMETER])) - { - $filterSessionArray[self::DATASET_NAME_PARAMETER] = null; - } - - $this->_writeSession($filterSessionArray); - } - - /** - * - */ - private function _initFilterWidget($args) - { - $this->app = null; - $this->query = null; - $this->datasetName = null; - $this->filterKurzbz = null; - $this->filterId = null; - $this->additionalColumns = null; - $this->formatRaw = null; - $this->markRow = null; - $this->checkboxes = null; - $this->hideHeader = false; - $this->hideSave = false; - $this->columnsAliases = null; - $this->filterName = null; - $this->filterNamePhrase = null; - - $this->filterUniqueId = $this->_getFilterUniqueId(); - - if (!is_array($args) || (is_array($args) && count($args) == 0)) - { - show_error('Second parameter must be a not empty associative array'); - } - else - { - if (( - !isset($args[self::APP_PARAMETER]) - && !isset($args[self::DATASET_NAME_PARAMETER]) - && !isset($args[self::FILTER_KURZBZ]) - ) - && !isset($args[self::FILTER_ID])) - { - show_error('At least one parameters must be specified 1'); - } - else - { - if (!isset($args[self::QUERY_PARAMETER]) && !isset($args[self::DB_RESULT])) - { - show_error('At least one parameters must be specified 2'); - } - else - { - if (isset($args[self::APP_PARAMETER]) - && isset($args[self::DATASET_NAME_PARAMETER]) - && isset($args[self::FILTER_KURZBZ])) - { - $this->app = $args[self::APP_PARAMETER]; - $this->datasetName = $args[self::DATASET_NAME_PARAMETER]; - $this->filterKurzbz = $args[self::FILTER_KURZBZ]; - } - else - { - $this->filterId = $args[self::FILTER_ID]; - } - - if (isset($args[self::QUERY_PARAMETER])) - { - $this->query = $args[self::QUERY_PARAMETER]; - } - elseif (isset($args[self::DB_RESULT])) - { - $this->query = $args[self::DB_RESULT]; - } - } - } - - if (isset($args[self::ADDITIONAL_COLUMNS]) - && is_array($args[self::ADDITIONAL_COLUMNS]) - && count($args[self::ADDITIONAL_COLUMNS]) > 0) - { - $this->additionalColumns = $args[self::ADDITIONAL_COLUMNS]; - } - - if (isset($args[self::FORMAT_RAW]) && is_callable($args[self::FORMAT_RAW])) - { - $this->formatRaw = $args[self::FORMAT_RAW]; - } - - if (isset($args[self::MARK_ROW]) && is_callable($args[self::MARK_ROW])) - { - $this->markRow = $args[self::MARK_ROW]; - } - - if (isset($args[self::CHECKBOXES])) - { - $this->checkboxes = $args[self::CHECKBOXES]; - } - - if (isset($args[self::HIDE_HEADER]) && is_bool($args[self::HIDE_HEADER])) - { - $this->hideHeader = $args[self::HIDE_HEADER]; - } - - if (isset($args[self::HIDE_SAVE]) && is_bool($args[self::HIDE_SAVE])) - { - $this->hideSave = $args[self::HIDE_SAVE]; - } - - if (isset($args[self::COLUMNS_ALIASES]) - && is_array($args[self::COLUMNS_ALIASES]) - && count($args[self::COLUMNS_ALIASES]) > 0) - { - $this->columnsAliases = $args[self::COLUMNS_ALIASES]; - } - } - } - - /** - * - */ - private function _loadFilter() - { - // - $this->FiltersModel->resetQuery(); - - // - $this->FiltersModel->addJoin('public.tbl_benutzer', 'person_id', 'LEFT'); - - // - $this->FiltersModel->addSelect('system.tbl_filters.*'); - - // - $this->FiltersModel->addOrder('sort', 'ASC'); - - // - $this->FiltersModel->addLimit(1); - - $whereParameters = null; - - if ($this->filterId <= 0) - { - // Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name" - // that is set as default filter (default_filter = true) - $whereParameters = array( - 'app' => $this->app, - 'dataset_name' => $this->datasetName, - 'uid' => getAuthUID(), - 'default_filter' => true - ); - } - else - { - $whereParameters = array( - 'filter_id' => $this->filterId - ); - } - - // - $filter = $this->FiltersModel->loadWhere($whereParameters); - - $jsonEncodedFilter = null; - - if (hasData($filter)) - { - if (isset($filter->retval[0]->filter) && trim($filter->retval[0]->filter) != '') - { - $jsonEncodedFilter = json_decode($filter->retval[0]->filter); - } - } - else // Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as - // default filter (default_filter = true) - { - $whereParameters = array( - 'app' => $this->app, - 'dataset_name' => $this->datasetName, - 'default_filter' => true - ); - - $filter = $this->FiltersModel->loadWhere($whereParameters); - if (hasData($filter)) - { - if (isset($filter->retval[0]->filter) && trim($filter->retval[0]->filter) != '') - { - $jsonEncodedFilter = json_decode($filter->retval[0]->filter); - } - } - } - - if ($jsonEncodedFilter != null) - { - $selectedFields = array(); - $selectedFilters = array(); - $activeFilters = array(); - $activeFiltersOperation = array(); - $activeFiltersOption = array(); - $filterName = null; - $filterNamePhrase = null; - - if (isset($jsonEncodedFilter->columns)) - { - $columns = $jsonEncodedFilter->columns; - - for($columnsCounter = 0; $columnsCounter < count($columns); $columnsCounter++) - { - if (isset($columns[$columnsCounter]->name)) - { - $selectedFields[] = $columns[$columnsCounter]->name; - } - } - } - - if (isset($jsonEncodedFilter->filters)) - { - $filters = $jsonEncodedFilter->filters; - - for($filtersCounter = 0; $filtersCounter < count($filters); $filtersCounter++) - { - if (isset($filters[$filtersCounter]->name)) - { - $selectedFilters[] = $filters[$filtersCounter]->name; - $activeFilters[$filters[$filtersCounter]->name] = $filters[$filtersCounter]->condition; - $activeFiltersOperation[$filters[$filtersCounter]->name] = $filters[$filtersCounter]->operation; - if (isset($filters[$filtersCounter]->option)) - { - $activeFiltersOption[$filters[$filtersCounter]->name] = $filters[$filtersCounter]->option; - } - } - } - } - - if (isset($jsonEncodedFilter->name)) - { - $filterName = $jsonEncodedFilter->name; - } - - // Filter name from phrases system - if (isset($jsonEncodedFilter->namePhrase)) - { - $this->load->library('PhrasesLib', array('FilterWidget')); - $filterNamePhrase = $this->phraseslib->t('FilterWidget', $jsonEncodedFilter->namePhrase); - } - - $this->filterName = $filterName; - $this->filterNamePhrase = $filterNamePhrase; - $this->app = $filter->retval[0]->app; - - $filterSessionArray = array( - self::SELECTED_FIELDS => $selectedFields, - self::SELECTED_FILTERS => $selectedFilters, - self::ACTIVE_FILTERS => $activeFilters, - self::ACTIVE_FILTERS_OPERATION => $activeFiltersOperation, - self::ACTIVE_FILTERS_OPTION => $activeFiltersOption, - self::FILTER_NAME => $filterName, - self::APP_PARAMETER => $filter->retval[0]->app, - self::DATASET_NAME_PARAMETER => $filter->retval[0]->dataset_name - ); - - $this->_writeSession($filterSessionArray); - } - else - { - $filterSessionArray = array( - self::SELECTED_FIELDS => array(), - self::SELECTED_FILTERS => array(), - self::ACTIVE_FILTERS => array(), - self::ACTIVE_FILTERS_OPERATION => array(), - self::ACTIVE_FILTERS_OPTION => array(), - self::FILTER_NAME => null, - self::APP_PARAMETER => null, - self::DATASET_NAME_PARAMETER => null - ); - - $this->_writeSession($filterSessionArray); - } - } - - /** - * - */ - private function _saveFilter() - { - if (isset($_POST['saveCustomFilter']) && $_POST['saveCustomFilter'] == 'true') - { - $objToBeSaved = new stdClass(); - - $filterSessionArray = $this->_readSession(); - - if (isset($filterSessionArray[self::SELECTED_FIELDS])) - { - $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; - $objToBeSaved->columns = array(); - - for ($selectedFieldsCounter = 0; $selectedFieldsCounter < count($selectedFields); $selectedFieldsCounter++) - { - $objToBeSaved->columns[$selectedFieldsCounter] = new stdClass(); - $objToBeSaved->columns[$selectedFieldsCounter]->name = $selectedFields[$selectedFieldsCounter]; - } - } - - if (isset($filterSessionArray[self::SELECTED_FILTERS])) - { - $selectedFilters = $filterSessionArray[self::SELECTED_FILTERS]; - $objToBeSaved->filters = array(); - - for ($selectedFiltersCounter = 0; $selectedFiltersCounter < count($selectedFilters); $selectedFiltersCounter++) - { - $objToBeSaved->filters[$selectedFiltersCounter] = new stdClass(); - $objToBeSaved->filters[$selectedFiltersCounter]->name = $selectedFilters[$selectedFiltersCounter]; - - if (isset($filterSessionArray[self::ACTIVE_FILTERS]) - && isset($filterSessionArray[self::ACTIVE_FILTERS][$selectedFilters[$selectedFiltersCounter]])) - { - $objToBeSaved->filters[$selectedFiltersCounter]->condition = $filterSessionArray[self::ACTIVE_FILTERS][$selectedFilters[$selectedFiltersCounter]]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION]) - && isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION][$selectedFilters[$selectedFiltersCounter]])) - { - $objToBeSaved->filters[$selectedFiltersCounter]->operation = $filterSessionArray[self::ACTIVE_FILTERS_OPERATION][$selectedFilters[$selectedFiltersCounter]]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION]) - && isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION][$selectedFilters[$selectedFiltersCounter]])) - { - $objToBeSaved->filters[$selectedFiltersCounter]->option = $filterSessionArray[self::ACTIVE_FILTERS_OPTION][$selectedFilters[$selectedFiltersCounter]]; - } - } - } - - $desc = $_POST['customFilterDescription']; - $descPGArray = '{"'.$desc.'", "'.$desc.'", "'.$desc.'", "'.$desc.'"}'; - - $resultBenutzer = $this->BenutzerModel->load(getAuthUID()); - $personId = $resultBenutzer->retval[0]->person_id; - - $result = $this->FiltersModel->loadWhere(array( - 'app' => $this->app, - 'dataset_name' => $this->datasetName, - 'description' => $descPGArray, - 'person_id' => $personId - )); - - if (hasData($result)) - { - $this->FiltersModel->update( - array( - 'app' => $this->app, - 'dataset_name' => $this->datasetName, - 'description' => $descPGArray, - 'person_id' => $personId - ), - array( - 'filter' => json_encode($objToBeSaved) - ) - ); - } - else - { - $this->FiltersModel->insert(array( - 'app' => $this->app, - 'dataset_name' => $this->datasetName, - 'filter_kurzbz' => uniqid($personId, true), - 'person_id' => $personId, - 'description' => $descPGArray, - 'sort' => null, - 'default_filter' => false, - 'filter' => json_encode($objToBeSaved), - 'oe_kurzbz' => null - )); - } - } - } - - /** - * - */ - private function _getSelectedFieldsFromPost() - { - // Selected fields - $selectedFields = array(); - - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::SELECTED_FIELDS])) - { - $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; - } - - return $selectedFields; - } - - /** - * - */ - private function _getAppFromPost() - { - $app = $this->app; - - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::APP_PARAMETER])) - { - $app = $filterSessionArray[self::APP_PARAMETER]; - } - - return $app; - } - - /** - * - */ - private function _getDatasetFromPost() - { - $datasetName = $this->datasetName; - - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::DATASET_NAME_PARAMETER])) - { - $datasetName = $filterSessionArray[self::DATASET_NAME_PARAMETER]; - } - - return $datasetName; - } - - /** - * - */ - private function _getColumnAliasesFromPost() - { - $columnsAliases = $this->columnsAliases; - $selectedFields = array(); - - $filterSessionArray = $this->_readSession(); - - if (isset($filterSessionArray[self::SELECTED_FIELDS])) - { - $selectedFields = $filterSessionArray[self::SELECTED_FIELDS]; - } - - if (isset($this->listFields) && count($selectedFields) > 0 && is_array($this->columnsAliases) && count($this->columnsAliases) > 0) - { - $columnsAliases = array(); - - for ($i = 0; $i < count($selectedFields); $i++) - { - if (($pos = array_search($selectedFields[$i], $this->listFields)) !== false) - { - $columnsAliases[] = $this->columnsAliases[$pos]; - } - } - } - - return $columnsAliases; - } - - /** - * - */ - private function _getSelectedFiltersFromPost() - { - // Selected filters - $selectedFilters = array(); - - $filterSessionArray = $this->_readSession(); - if (isset($filterSessionArray[self::SELECTED_FILTERS])) - { - $selectedFilters = $filterSessionArray[self::SELECTED_FILTERS]; - } - - return $selectedFilters; - } - - /** - * - */ - private function _setActiveFiltersFromPost(&$activeFilters, &$activeFiltersOperation, &$activeFiltersOption) - { - $selectedFilters = array(); - $filterSessionArray = $this->_readSession(); - - if (isset($filterSessionArray[self::ACTIVE_FILTERS])) - { - $activeFilters = $filterSessionArray[self::ACTIVE_FILTERS]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION])) - { - $activeFiltersOperation = $filterSessionArray[self::ACTIVE_FILTERS_OPERATION]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION])) - { - $activeFiltersOption = $filterSessionArray[self::ACTIVE_FILTERS_OPTION]; - } - - if (isset($filterSessionArray[self::SELECTED_FILTERS])) - { - $selectedFilters = $filterSessionArray[self::SELECTED_FILTERS]; - } - - if (is_array($_POST)) - { - if (array_key_exists(self::CMD_REMOVE_FILTER, $_POST) && trim($_POST[self::CMD_REMOVE_FILTER]) != '') - { - if (isset($activeFilters[$_POST[self::CMD_REMOVE_FILTER]])) - { - unset($activeFilters[$_POST[self::CMD_REMOVE_FILTER]]); - } - - if (isset($activeFiltersOperation[$_POST[self::CMD_REMOVE_FILTER]])) - { - unset($activeFiltersOperation[$_POST[self::CMD_REMOVE_FILTER]]); - } - - if (isset($activeFiltersOption[$_POST[self::CMD_REMOVE_FILTER]])) - { - unset($activeFiltersOption[$_POST[self::CMD_REMOVE_FILTER]]); - } - } - else - { - for ($selectedFiltersCounter = 0; $selectedFiltersCounter < count($selectedFilters); $selectedFiltersCounter++) - { - $selectedFilter = $selectedFilters[$selectedFiltersCounter]; - - if (isset($_POST[$selectedFilter])) - { - $activeFilters[$selectedFilter] = $_POST[$selectedFilter]; - } - - if (isset($_POST[$selectedFilter.self::ACTIVE_FILTER_OPERATION_POSTFIX])) - { - $activeFiltersOperation[$selectedFilter] = $_POST[$selectedFilter.self::ACTIVE_FILTER_OPERATION_POSTFIX]; - } - - if (isset($_POST[$selectedFilter.self::ACTIVE_FILTER_OPTION_POSTFIX])) - { - $activeFiltersOption[$selectedFilter] = $_POST[$selectedFilter.self::ACTIVE_FILTER_OPTION_POSTFIX]; - } - } - } - } - } - - /** - * - */ - private function _setSessionFilterData() - { - $session = $this->_readSession(); - - $filterSessionArray = array( - self::SELECTED_FIELDS => $this->_getSelectedFieldsFromPost(), - self::SELECTED_FILTERS => $this->_getSelectedFiltersFromPost(), - self::ADDITIONAL_COLUMNS => $this->additionalColumns, - self::COLUMNS_ALIASES => $this->_getColumnAliasesFromPost(), - self::APP_PARAMETER => $this->_getAppFromPost(), - self::DATASET_NAME_PARAMETER => $this->_getDatasetFromPost() - ); - - $filterSessionArray[self::ACTIVE_FILTERS] = array(); - $filterSessionArray[self::ACTIVE_FILTERS_OPERATION] = array(); - $filterSessionArray[self::ACTIVE_FILTERS_OPTION] = array(); - - $this->_setActiveFiltersFromPost( - $filterSessionArray[self::ACTIVE_FILTERS], - $filterSessionArray[self::ACTIVE_FILTERS_OPERATION], - $filterSessionArray[self::ACTIVE_FILTERS_OPTION] - ); - - $filterSessionArray[self::FILTER_ID] = $this->filterId; - $filterSessionArray[self::FILTER_NAME] = $this->filterName; - $filterSessionArray[self::FILTER_NAME_PHRASE] = $this->filterNamePhrase; - - $this->_writeSession(array_merge($session, $filterSessionArray)); - } - - /** - * - */ - private function _generateQuery() - { - $query = null;//$this->query; - - $activeFilters = array(); - $activeFiltersOperation = array(); - $activeFiltersOption = array(); - - $filterSessionArray = $this->_readSession(); - - if (isset($filterSessionArray[self::ACTIVE_FILTERS])) - { - $activeFilters = $filterSessionArray[self::ACTIVE_FILTERS]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION])) - { - $activeFiltersOperation = $filterSessionArray[self::ACTIVE_FILTERS_OPERATION]; - } - - if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION])) - { - $activeFiltersOption = $filterSessionArray[self::ACTIVE_FILTERS_OPTION]; - } - - // - if (count($activeFilters) > 0) - { - $where = ''; - $first = true; - - foreach ($activeFilters as $field => $activeFilterValue) - { - if ($first) - { - $first = false; - } - else - { - $where .= ' AND '; - } - - if (isset($activeFiltersOperation[$field])) - { - $where .= '"'.$field.'"'; - $condition = ''; - - switch ($activeFiltersOperation[$field]) - { - 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; - 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_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: - $activeFilterValue = $this->FiltersModel->escapeLike($activeFilterValue); // escapes - $condition = ' ILIKE \'%'.$activeFilterValue.'%\''; - break; - case self::OP_NOT_CONTAINS: - $activeFilterValue = $this->FiltersModel->escapeLike($activeFilterValue); // escapes - $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; - default: - $condition = ' IS NOT NULL'; - break; - } - - $where .= $condition; - } - } - - if ($where != '') - { - $query = 'SELECT * FROM ('.$this->query.') tableFilters WHERE '.$where; - } - } - - return $query; - } - - /** - * - */ - private function _readSession() - { - if (isset($_SESSION[self::SESSION_NAME]) && isset($_SESSION[self::SESSION_NAME][$this->filterUniqueId])) - return $_SESSION[self::SESSION_NAME][$this->filterUniqueId]; - - return array(); - } - - /** - * - */ - private function _writeSession($data) - { - if (!isset($_SESSION[self::SESSION_NAME]) - || (isset($_SESSION[self::SESSION_NAME]) && !is_array($_SESSION[self::SESSION_NAME]))) - { - $_SESSION[self::SESSION_NAME] = array(); - } - - $_SESSION[self::SESSION_NAME][$this->filterUniqueId] = $data; - } - - /** - * - */ - private function _getFilterUniqueId() - { - return $this->router->directory.$this->router->class.'/'.$this->router->method.'/'.$this->input->get('fhc_controller_id'); - } -}
    p->t('global','gesendetAm')) ?>p->t('global','sender')) ?>p->t('global','empfaenger')) ?>p->t('global','betreff')) ?>p->t('global','gelesenAm')) ?>p->t('global','gesendetAm')) ?>p->t('global','sender')) ?>p->t('global','empfaenger')) ?>p->t('global','betreff')) ?>p->t('global','gelesenAm')) ?>
    SelectSelect" + th + "" + th + "
    '; - strHtml += ''; - strHtml += '' + record[data.selectedFields[i]] + '' + record[additionalColumn] + '
    Select" + th + "" + th + "
    '; + strHtml += ''; + strHtml += '' + record[data.selectedFields[i]] + '' + record[additionalColumn] + '
    SelectSelect