Commit 2053060d authored by Tobias Zeumer's avatar Tobias Zeumer

Fix calendar language

parent 45f12160
......@@ -6,7 +6,7 @@ $nocache = '?v='.time();
$admin_mode = true;
?>
<!DOCTYPE html>
<html lang="<?php echo strtolower($lang) ?>">
<html lang="<?php echo strtolower($LANG) ?>">
<head>
<title><?php __('admin_frm_title') ?></title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -23,3 +23,72 @@ Lokal eingebunden werden
03. Eine MySQL-Datenbank anlegen, den "Events"-Teil am Ende von config/database.sql für die automatische Löschung anpassen und dann die Abfrage ausführen
Im Prinzip war es das bereits. Anpassungen, siehe nächster Abschnitt: [02. Konfiguration](02_Konfiguration.md).
## Import aus "Braunschweiger Formular"
Wird bisher das Braunschweiger Formular verwendet, können die Daten rech leicht übernommen werden. Ein eigenes Script lohn nicht, dafür hier der Ansatz, es von Hand zu machen. Vor der Abfrage sollte man einzig darauf achten, dass bei den **Anredetiteln nur "erlaubte"** Werte im neuen Formular drin stehen. Ansonsten folgende Abfrage in der Braunschweig-DB durchführen:
```sql
# Ausgelassen: "for_the_attention_of1_FRONTEND":"TUHH \/ B-5","for_the_attention_of":["TUHH \/ B-5"],"c_o":["Geotechnik und Baubetrieb"]
SELECT
last_name, first_name, birthday 'date_of_birth',
CONCAT('{
"language_code":"', (CASE language_code WHEN 'DUI' THEN 'DE' ELSE 'EN' END),'",
"borrower_type":"', (select pica_user_group from usertypes where id= usertype_id),'",
"date_of_birth_FRONTEND":"', date_format(birthday, "%d.%m.%Y"),'",
"date_of_birth":"', birthday,'",
"agreeConfirm":"on","person_titles":"', title,'",
"gender":"', (CASE sex WHEN 'm' THEN '1' WHEN 'w' THEN '2' ELSE '0' END),'",
"first_name":"', first_name,'",
"last_name":"', last_name,'",
"email":["', email,'",""],
"registration_number":"', student_id,'",
"for_the_attention_of":[""],"c_o":[""],',
'"address_pob":["',
(SELECT CONCAT(street, ' ', house, (CASE room WHEN '' THEN '' ELSE concat(' (', room, ')') END))
FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","',
(SELECT CONCAT(street, (CASE street WHEN '' THEN '' ELSE ' ' END), house, (CASE room WHEN '' THEN '' ELSE concat(' (', room, ')') END))
FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],'
'"postal_code":["',
(SELECT zip
FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","',
(SELECT zip
FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],'
'"town":["',
(SELECT town
FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","',
(SELECT town
FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],'
'"telephone_number":["',
(SELECT phone
FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","',
(SELECT phone
FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],'
'"secondary_telephone_number":["',
(SELECT mobile_phone
FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","',
(SELECT mobile_phone
FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"]}'
) 'data',
CONCAT('i') 'input_type',
entry_date 'input_date'
FROM persons p
```
Bzw. kompakt
```sql
SELECT
last_name, first_name, birthday 'date_of_birth',
CONCAT('{"language_code":"', (CASE language_code WHEN 'DUI' THEN 'DE' ELSE 'EN' END),'", "borrower_type":"', (select pica_user_group from usertypes where id= usertype_id),'", "date_of_birth_FRONTEND":"', date_format(birthday, "%d.%m.%Y"),'", "date_of_birth":"', birthday,'", "agreeConfirm":"on","person_titles":"', title,'", "gender":"', (CASE sex WHEN 'm' THEN '1' WHEN 'w' THEN '2' ELSE '0' END),'", "first_name":"', first_name,'", "last_name":"', last_name,'", "email":["', email,'",""], "registration_number":"', student_id,'", "for_the_attention_of":[""],"c_o":[""],', '"address_pob":["', (SELECT CONCAT(street, ' ', house, (CASE room WHEN '' THEN '' ELSE concat(' (', room, ')') END)) FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","', (SELECT CONCAT(street, (CASE street WHEN '' THEN '' ELSE ' ' END), house, (CASE room WHEN '' THEN '' ELSE concat(' (', room, ')') END)) FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],' '"postal_code":["', (SELECT zip FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","', (SELECT zip FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],' '"town":["', (SELECT town FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","', (SELECT town FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],' '"telephone_number":["', (SELECT phone FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","', (SELECT phone FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"],' '"secondary_telephone_number":["', (SELECT mobile_phone FROM addresses WHERE person_id = p.id AND is_primary = 'true'), '","', (SELECT mobile_phone FROM addresses WHERE person_id = p.id AND is_primary = 'false'), '"]}'
) 'data',
CONCAT('i') 'input_type',
entry_date 'input_date'
FROM persons p
```
Weiter
* Abfrage ausführen (Braunschweig-DB)
* Ergebnis exportieren (z.B. phpMyAdmin)
* Ggf. einmal 'ALTER TABLE borrower AUTO_INCREMENT = 1;' in neuer DB (frischer Start)
* Obigen Export ggf. leicht modifizieren und dann importieren (neue DB)
* INSERT INTO `borrower` (`last_name`, `first_name`, `date_of_birth`, `data`, `input_type`, `input_date`) VALUES ...
\ No newline at end of file
......@@ -24,7 +24,7 @@ var param_underage;
var param_maildomain;
var requestUrl = 'request.php';
var lang = 'DE';
var lang = 'de';
var isOldBrowser = false;
var inIframe = (window.self !== window.top) ? true : false;
......@@ -175,7 +175,7 @@ window.addEventListener("load", function () {
// Pikaday https://github.com/dbushell/Pikaday
/* Requires Pikaday + Moment - pretty large... But no jQuery */
min_birthday.setFullYear( min_birthday.getFullYear() - tub_minage );
if (lang === 'DE') {
if (lang === 'de') {
picker_iln8n = {
previousMonth : 'Letzter Monat',
nextMonth : 'Nächster Monat',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment