From 1254e8d6188bd8399c0a0f0ce0537673d5e6da59 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 9 May 2018 12:36:35 +0200 Subject: [PATCH 01/13] 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/13] 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/13] 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 6a671837385df67b025fa9c0ccc58cf2ec969c44 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 May 2018 20:00:19 +0200 Subject: [PATCH 04/13] 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 05/13] 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 06/13] - 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 07/13] 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 08/13] 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 09/13] 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 10/13] 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 11/13] - 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 12/13] 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 13/13] =?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!

    ';
    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] + '