original codebase from it_itt11h_23
This commit is contained in:
commit
5e2a7fe255
71
README.md
Normal file
71
README.md
Normal file
@ -0,0 +1,71 @@
|
||||
# Schulanmeldung
|
||||
|
||||
## Install project
|
||||
|
||||
1. Projekt klonen https://git-scm.com: `git clone https://github.com/SimonHaas/schulanmeldung.git`
|
||||
2. `cd schulanmeldung`
|
||||
3. PHP-Fremdbibliotheken installieren mit Hilfe von https://getcomposer.org `composer install`
|
||||
4. .env.dist nach .env kopieren: `cp .env.dist .env`
|
||||
3. .env Datei bearbeiten:
|
||||
* APP_ENV=prod
|
||||
* DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
|
||||
- Die Datenbank muss zu diesem Zeitpunkt noch nicht angelegt sein!
|
||||
* EINTRITTSDATUM_ERSTE_HAELFTE=2019-09-10
|
||||
- Bei Anmeldungen vor diesem Datum wird das als Eintrittsdatum gespeichert, bei Anmeldungen danach das folgende:
|
||||
* EINTRITTSDATUM_ZWEITE_HAELFTE=2020-09-11
|
||||
* ADMIN_EMAIL=admin@test.de
|
||||
* ADMIN_PASSWORD=1234
|
||||
- Mit diesen Daten kann ein neuer Admin-Account erstellt werden. Einfach Schritt 8 ausführen und es wird ein neuer User in der Datenbank angelegt. Dann können diese zwei Variablen theoretischer Weise wieder gelöscht werden.
|
||||
- Den Adminbereich erreicht man über `/admin`.
|
||||
4. `php bin/console doctrine:database:create`
|
||||
* Das legt die in der .env Datei konfigurierte Datenbank an.
|
||||
5. `php bin/console migrate`
|
||||
* Das führt die unter `src/Migrations` liegenden Datenbank-Migrationen aus um die Tabellen zu erstellen.
|
||||
6. In der PHP-ini muss die Extension `intl` aktiviert sein um die richtigen Länder bei der Auswahl des Herkunftslandes anzeigen zu können.
|
||||
6. Im Browser `/user`aufrufen.
|
||||
* Das legt einen neuen Admin-Account mit den Zugangsdaten aus der .env Datei an.
|
||||
|
||||
|
||||
## Datenmigration
|
||||
|
||||
In den JSON-Export dürfen keine Kommentare sein. In der Ersten Zeile muss es gleich mit dem Inhalt losgehen.
|
||||
|
||||
### Berufe
|
||||
1. Tabelle `berufekennungen` im Format `JSON` exportieren.
|
||||
2. Datei `berufekennungen.json` in das Root-Verzeichnis der Schulanmeldung legen.
|
||||
3. `/migration/berufe` im Browser aufrufen
|
||||
|
||||
### Berufe
|
||||
1. Tabelle `betriebedaten` im Format `JSON` exportieren.
|
||||
2. Datei `betriebedaten.json` in das Root-Verzeichnis der Schulanmeldung legen.
|
||||
3. `/migration/betriebe` im Browser aufrufen
|
||||
|
||||
### Schulen
|
||||
1. Tabelle `herkunftsschulen` im Format `JSON` exportieren.
|
||||
2. Datei `herkunftsschulen.json` in das Root-Verzeichnis der Schulanmeldung legen.
|
||||
3. `/migration/schulen` im Browser aufrufen.
|
||||
|
||||
## Apache virtual host config
|
||||
|
||||
```
|
||||
<VirtualHost *>
|
||||
DocumentRoot "<Projekt-Verzeichnis>/public"
|
||||
ServerName <URL>
|
||||
DirectoryIndex index.php
|
||||
<Directory "<Projekt-Verzeichnis>/public">
|
||||
AllowOverride All
|
||||
Allow from All
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
Options -MultiViews
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
```
|
||||
Es empfiehlt sich die Schulanmeldung unter einer Subdomain zu installieren.
|
||||
|
||||
|
||||
|
||||
39
bin/console
Normal file
39
bin/console
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
if (!class_exists(Application::class)) {
|
||||
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
|
||||
}
|
||||
|
||||
if (!isset($_SERVER['APP_ENV'])) {
|
||||
if (!class_exists(Dotenv::class)) {
|
||||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
||||
}
|
||||
(new Dotenv())->load(__DIR__.'/../.env');
|
||||
}
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev', true);
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption('--no-debug', true);
|
||||
|
||||
if ($debug) {
|
||||
umask(0000);
|
||||
|
||||
if (class_exists(Debug::class)) {
|
||||
Debug::enable();
|
||||
}
|
||||
}
|
||||
|
||||
$kernel = new Kernel($env, $debug);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
||||
1
bin/infophp.php
Normal file
1
bin/infophp.php
Normal file
@ -0,0 +1 @@
|
||||
<?php phpinfo(); ?>
|
||||
90
composer.json
Normal file
90
composer.json
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"type": "project",
|
||||
"license": "proprietary",
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-json": "*",
|
||||
"ext-xml": "*",
|
||||
"doctrine/cache": "^2.2",
|
||||
"doctrine/common": "^3.4",
|
||||
"doctrine/doctrine-bundle": "^2.10.2",
|
||||
"doctrine/doctrine-fixtures-bundle": "^3.4.4",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.2.4",
|
||||
"doctrine/orm": "^2.16.2",
|
||||
"dompdf/dompdf": "^2.0",
|
||||
"phpmailer/phpmailer": "^6.9",
|
||||
"phpoffice/phpspreadsheet": "^2.0",
|
||||
"sensio/framework-extra-bundle": "^6.2.10",
|
||||
"symfony/asset": "^6.3.0",
|
||||
"symfony/cache": "^6.3.4",
|
||||
"symfony/config": "^6.3.2",
|
||||
"symfony/console": "^6.3.4",
|
||||
"symfony/debug-bundle": "^6.3.2",
|
||||
"symfony/dotenv": "^6.3.0",
|
||||
"symfony/error-handler": "^6.3.2",
|
||||
"symfony/form": "^6.3.2",
|
||||
"symfony/framework-bundle": "^6.3.4",
|
||||
"symfony/http-kernel": "^6.3.4",
|
||||
"symfony/intl": "^7.0",
|
||||
"symfony/mailer": "^6.3.0",
|
||||
"symfony/maker-bundle": "^1.51.1",
|
||||
"symfony/monolog-bundle": "^3.10",
|
||||
"symfony/profiler-pack": "^1.0.6",
|
||||
"symfony/requirements-checker": "^2.0",
|
||||
"symfony/routing": "^6.3.3",
|
||||
"symfony/security-bundle": "^6.3.4",
|
||||
"symfony/translation": "^6.3.3",
|
||||
"symfony/twig-bundle": "^6.3.0",
|
||||
"symfony/validator": "^6.3.4",
|
||||
"symfony/web-profiler-bundle": "^6.3.12",
|
||||
"symfony/yaml": "^6.3.3",
|
||||
"twig/extensions": "^1.5.4"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": {
|
||||
"*": "dist"
|
||||
},
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"symfony/flex": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"App\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": [
|
||||
"vendor/bin/requirements-checker php-script",
|
||||
"symfony console cache:clear"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"@auto-scripts"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@auto-scripts"
|
||||
]
|
||||
},
|
||||
"replace": {
|
||||
"paragonie/random_compat": "2.*",
|
||||
"symfony/polyfill-ctype": "*",
|
||||
"symfony/polyfill-iconv": "*",
|
||||
"symfony/polyfill-php71": "*",
|
||||
"symfony/polyfill-php70": "*",
|
||||
"symfony/polyfill-php56": "*"
|
||||
},
|
||||
"extra": {
|
||||
"symfony": {
|
||||
"allow-contrib": false,
|
||||
"require": "6.3.*"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
config/bundles.php
Normal file
16
config/bundles.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
//Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
|
||||
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
||||
];
|
||||
5
config/packages/debug.yaml
Normal file
5
config/packages/debug.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
when@dev:
|
||||
debug:
|
||||
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
|
||||
# See the "server:dump" command to start a new server.
|
||||
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
|
||||
57
config/packages/doctrine.yaml
Normal file
57
config/packages/doctrine.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
parameters:
|
||||
# Adds a fallback DATABASE_URL if the env var is not set.
|
||||
# This allows you to run cache:warmup even if your
|
||||
# environment variables are not available yet.
|
||||
# You should not need to change this value.
|
||||
env(DATABASE_URL): ''
|
||||
|
||||
doctrine:
|
||||
dbal:
|
||||
# configure these for your database server
|
||||
driver: 'pdo_mysql'
|
||||
server_version: '5.7'
|
||||
charset: utf8mb4
|
||||
default_table_options:
|
||||
charset: utf8mb4
|
||||
collate: utf8mb4_unicode_ci
|
||||
|
||||
url: '%env(resolve:DATABASE_URL)%'
|
||||
orm:
|
||||
auto_generate_proxy_classes: '%kernel.debug%'
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||
auto_mapping: true
|
||||
mappings:
|
||||
App:
|
||||
is_bundle: false
|
||||
type: attribute
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
|
||||
when@prod:
|
||||
services:
|
||||
doctrine.result_cache_provider:
|
||||
class: Doctrine\Common\Cache\Psr6\DoctrineProvider
|
||||
factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
|
||||
public: false
|
||||
arguments:
|
||||
- '@doctrine.result_cache_pool'
|
||||
tags:
|
||||
- { name: 'kernel.reset', method: 'reset' }
|
||||
doctrine.system_cache_provider:
|
||||
class: Doctrine\Common\Cache\Psr6\DoctrineProvider
|
||||
factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
|
||||
public: false
|
||||
arguments:
|
||||
- '@doctrine.system_cache_pool'
|
||||
tags:
|
||||
- { name: 'kernel.reset', method: 'reset' }
|
||||
|
||||
framework:
|
||||
cache:
|
||||
pools:
|
||||
doctrine.result_cache_pool:
|
||||
adapter: cache.app
|
||||
doctrine.system_cache_pool:
|
||||
adapter: cache.system
|
||||
|
||||
3
config/packages/doctrine_migrations.yaml
Normal file
3
config/packages/doctrine_migrations.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
doctrine_migrations:
|
||||
migrations_paths:
|
||||
'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'
|
||||
17
config/packages/easy_log_handler.yaml
Normal file
17
config/packages/easy_log_handler.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
when@dev:
|
||||
services:
|
||||
EasyCorp\EasyLog\EasyLogHandler:
|
||||
public: false
|
||||
arguments: [ '%kernel.logs_dir%/%kernel.environment%.log' ]
|
||||
|
||||
#// FIXME: How to add this configuration automatically without messing up with the monolog configuration?
|
||||
#monolog:
|
||||
# handlers:
|
||||
# buffered:
|
||||
# type: buffer
|
||||
# handler: easylog
|
||||
# channels: ['!event']
|
||||
# level: debug
|
||||
# easylog:
|
||||
# type: service
|
||||
# id: EasyCorp\EasyLog\EasyLogHandler
|
||||
36
config/packages/framework.yaml
Normal file
36
config/packages/framework.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
#default_locale: en
|
||||
#csrf_protection: true
|
||||
#http_method_override: true
|
||||
|
||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||
# Remove or comment this section to explicitly disable session support.
|
||||
session:
|
||||
handler_id: ~
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
cache:
|
||||
# Put the unique name of your app here: the prefix seed
|
||||
# is used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The app cache caches to the filesystem by default.
|
||||
# Other options include:
|
||||
|
||||
# Redis
|
||||
#app: cache.adapter.redis
|
||||
#default_redis_provider: redis://localhost
|
||||
|
||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||
#app: cache.adapter.apcu
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_id: session.storage.mock_file
|
||||
3
config/packages/mailer.yaml
Normal file
3
config/packages/mailer.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
framework:
|
||||
mailer:
|
||||
dsn: '%env(MAILER_DSN)%'
|
||||
56
config/packages/monolog.yaml
Normal file
56
config/packages/monolog.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
when@prod:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
excluded_404s:
|
||||
# regex: exclude all 404 errors from the logs
|
||||
- ^/
|
||||
nested:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: [ "!event", "!doctrine" ]
|
||||
deprecation:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
|
||||
deprecation_filter:
|
||||
type: filter
|
||||
handler: deprecation
|
||||
max_level: info
|
||||
channels: [ "php" ]
|
||||
|
||||
when@dev:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
channels: [ "!event" ]
|
||||
# uncomment to get logging in your browser
|
||||
# you may have to allow bigger header sizes in your Web server configuration
|
||||
#firephp:
|
||||
# type: firephp
|
||||
# level: info
|
||||
#chromephp:
|
||||
# type: chromephp
|
||||
# level: info
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: [ "!event", "!doctrine", "!console" ]
|
||||
|
||||
when@test:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
channels: [ "!event" ]
|
||||
4
config/packages/routing.yaml
Normal file
4
config/packages/routing.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
when@test:
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: true
|
||||
58
config/packages/security.yaml
Normal file
58
config/packages/security.yaml
Normal file
@ -0,0 +1,58 @@
|
||||
security:
|
||||
password-hashers:
|
||||
App\Entity\AdminUser: auto
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||
algorithm: 'auto'
|
||||
cost: 15
|
||||
|
||||
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
|
||||
providers:
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: App\Entity\AdminUser
|
||||
property: email
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: app_user_provider
|
||||
#anonymous: true
|
||||
#guard:
|
||||
#custom_authenticators:
|
||||
# - App\Security\AdminAuthenticator
|
||||
# entry_point: App\Security\AdminAuthenticator
|
||||
form-login:
|
||||
login-path: app_login
|
||||
check-path: app_login
|
||||
enable-csrf: true
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
|
||||
custom_authenticator: App\Security\AdminAuthenticator
|
||||
entry-point: App\Security\AdminAuthenticator
|
||||
|
||||
remember_me:
|
||||
secret: '%kernel.secret%'
|
||||
lifetime: 604800
|
||||
path: /
|
||||
always_remember_me: true
|
||||
|
||||
|
||||
# activate different ways to authenticate
|
||||
|
||||
# http_basic: true
|
||||
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
|
||||
|
||||
# form_login: true
|
||||
# https://symfony.com/doc/current/security/form_login_setup.html
|
||||
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||
- { path: ^/eintrittsdatum, roles: ROLE_ADMIN }
|
||||
3
config/packages/sensio_framework_extra.yaml
Normal file
3
config/packages/sensio_framework_extra.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
sensio_framework_extra:
|
||||
router:
|
||||
annotations: false
|
||||
6
config/packages/translation.yaml
Normal file
6
config/packages/translation.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
framework:
|
||||
default_locale: '%locale%'
|
||||
translator:
|
||||
default_path: '%kernel.project_dir%/translations'
|
||||
fallbacks:
|
||||
- '%locale%'
|
||||
4
config/packages/twig.yaml
Normal file
4
config/packages/twig.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
twig:
|
||||
default_path: '%kernel.project_dir%/templates'
|
||||
debug: '%kernel.debug%'
|
||||
strict_variables: '%kernel.debug%'
|
||||
11
config/packages/twig_extensions.yaml
Normal file
11
config/packages/twig_extensions.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
services:
|
||||
_defaults:
|
||||
public: false
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
# Uncomment any lines below to activate that Twig extension
|
||||
#Twig\Extensions\ArrayExtension: ~
|
||||
#Twig\Extensions\DateExtension: ~
|
||||
#Twig\Extensions\IntlExtension: ~
|
||||
#Twig\Extensions\TextExtension: ~
|
||||
3
config/packages/validator.yaml
Normal file
3
config/packages/validator.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
framework:
|
||||
validation:
|
||||
email_validation_mode: html5
|
||||
15
config/packages/web_profiler.yaml
Normal file
15
config/packages/web_profiler.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
when@dev:
|
||||
web_profiler:
|
||||
toolbar: true
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { only_exceptions: false }
|
||||
|
||||
when@test:
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { collect: false }
|
||||
9
config/routes/attributes.yaml
Normal file
9
config/routes/attributes.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
controllers:
|
||||
resource:
|
||||
path: ../../src/Controller/
|
||||
namespace: App\Controller
|
||||
type: attribute
|
||||
|
||||
kernel:
|
||||
resource: App\Kernel
|
||||
type: attribute
|
||||
7
config/routes/dev/web_profiler.yaml
Normal file
7
config/routes/dev/web_profiler.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
web_profiler_wdt:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||
prefix: /_wdt
|
||||
|
||||
web_profiler_profiler:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||
prefix: /_profiler
|
||||
30
config/services.yaml
Normal file
30
config/services.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
# This file is the entry point to configure your own services.
|
||||
# Files in the packages/ subdirectory configure your dependencies.
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
parameters:
|
||||
locale: 'de'
|
||||
dir.downloads: '%kernel.project_dir%/download'
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
public: false # Allows optimizing the container by removing unused services; this also means
|
||||
# fetching services directly from the container via $container->get() won't work.
|
||||
# The best practice is to be explicit about your dependencies anyway.
|
||||
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
App\:
|
||||
resource: '../src/*'
|
||||
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
twig.extension.intl:
|
||||
class: Twig_Extensions_Extension_Intl
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
26
docker/nginx/nginx.conf
Normal file
26
docker/nginx/nginx.conf
Normal file
@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 80 default;
|
||||
|
||||
client_max_body_size 108M;
|
||||
|
||||
access_log /var/log/nginx/application.access.log;
|
||||
|
||||
|
||||
root /application/public;
|
||||
index index.php;
|
||||
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^.*$ /index.php last;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
}
|
||||
22
docker/php/Dockerfile
Normal file
22
docker/php/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
FROM php:8.2-fpm
|
||||
|
||||
RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++
|
||||
RUN docker-php-ext-configure intl
|
||||
RUN docker-php-ext-install intl
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
RUN apt-get install -y \
|
||||
libzip-dev \
|
||||
zip \
|
||||
&& docker-php-ext-configure zip --with-libzip \
|
||||
&& docker-php-ext-install zip
|
||||
|
||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
||||
&& php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
|
||||
&& php composer-setup.php --filename=composer \
|
||||
&& php -r "unlink('composer-setup.php');" \
|
||||
&& mv composer /usr/local/bin/composer
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
EXPOSE 9000
|
||||
3
docker_setup_composer/.env.dist
Normal file
3
docker_setup_composer/.env.dist
Normal file
@ -0,0 +1,3 @@
|
||||
REPO_DIR=/Users/paulbaumgartner/WebstormProjects/AnmeldungBS1Bayreuth
|
||||
TMP_DIR=/Users/paulbaumgartner/tmp
|
||||
MYSQL_ROOT_PASSWORD=example
|
||||
16
docker_setup_composer/Dockerfile
Normal file
16
docker_setup_composer/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Berlin
|
||||
|
||||
RUN mkdir /home/composer
|
||||
RUN apt-get update -y --fix-missing && apt-get upgrade -y
|
||||
RUN apt install -y software-properties-common
|
||||
RUN add-apt-repository -y ppa:ondrej/php
|
||||
RUN apt-get install -y composer php8.2 php-mbstring php-xml php-mysql php-fpm php-gd php-zip php-intl php8.2-intl php8.2-xml php8.2-pdo php8.2-mysql wget apache2
|
||||
RUN wget https://get.symfony.com/cli/installer -O - | bash
|
||||
COPY ./symfony-httpd.conf /etc/apache2/sites-available/000-default.conf
|
||||
RUN a2enmod rewrite
|
||||
RUN service apache2 restart
|
||||
ENV PATH="/root/.symfony5/bin:$PATH".
|
||||
WORKDIR /var/www/app
|
||||
4
docker_setup_composer/db-entrypoint.sql
Normal file
4
docker_setup_composer/db-entrypoint.sql
Normal file
@ -0,0 +1,4 @@
|
||||
CREATE DATABASE db_anmeldung;
|
||||
CREATE USER 'anmeldung'@'%' IDENTIFIED BY 'ABS12019_691';
|
||||
GRANT ALL PRIVILEGES ON db_anmeldung.* TO 'anmeldung'@'%';
|
||||
FLUSH PRIVILEGES;
|
||||
44
docker_setup_composer/docker-compose.yaml
Normal file
44
docker_setup_composer/docker-compose.yaml
Normal file
@ -0,0 +1,44 @@
|
||||
version: "3.3"
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
image: mysql:latest
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./data:/var/lib/mysql
|
||||
- ./db-entrypoint.sql:/docker-entrypoint-initdb.d/db_entrypoint.sql:ro
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
|
||||
composer:
|
||||
stdin_open: true
|
||||
tty: true
|
||||
image: bs1anmeldung
|
||||
restart: on-failure
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ${REPO_DIR}/docker_setup_composer/Dockerfile
|
||||
container_name: composer_symfony
|
||||
depends_on:
|
||||
- db
|
||||
volumes:
|
||||
- ${REPO_DIR}:/var/www/app
|
||||
- ${TMP_DIR}:/tmp
|
||||
ports:
|
||||
- "8000:8000" #Port Symfony
|
||||
- "8080:80" #Port Apache2
|
||||
#Command für Testzwecke sinnvoll: Startet Symfony Testserver
|
||||
#command: symfony server:start
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- "8282:8282"
|
||||
command:
|
||||
- 'php'
|
||||
- '-S'
|
||||
- '[::]:8282'
|
||||
- '-t'
|
||||
- '/var/www/html'
|
||||
16
docker_setup_composer/symfony-httpd.conf
Normal file
16
docker_setup_composer/symfony-httpd.conf
Normal file
@ -0,0 +1,16 @@
|
||||
<VirtualHost *>
|
||||
DocumentRoot "/var/www/app/public"
|
||||
ServerName 127.0.0.1
|
||||
DirectoryIndex index.php
|
||||
<Directory "/var/www/app/public">
|
||||
AllowOverride All
|
||||
Allow from All
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
Options -MultiViews
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
0
download/bestaetigungen/.gitkeep
Normal file
0
download/bestaetigungen/.gitkeep
Normal file
199
export-asv-xml-tmp.txt
Normal file
199
export-asv-xml-tmp.txt
Normal file
@ -0,0 +1,199 @@
|
||||
<schuelerin>
|
||||
<zielklasse-name>%beruf_klasse%</zielklasse-name>
|
||||
<zielklassengruppe-kennung>ORG</zielklassengruppe-kennung>
|
||||
<schuelerstammdaten>
|
||||
<name>
|
||||
<familienname>%schueler_nachname%</familienname>
|
||||
<vornamen>%schueler_vorname%</vornamen>
|
||||
<rufname>%schueler_rufname%</rufname>
|
||||
<namensbestandteil_vorangestellt></namensbestandteil_vorangestellt>
|
||||
<namensbestandteil_nachgestellt></namensbestandteil_nachgestellt>
|
||||
<geburtsname></geburtsname>
|
||||
<anrede>%schueler_anrede%</anrede>
|
||||
</name>
|
||||
<geburtsdatum>%schueler_geburtsdatum%</geburtsdatum>
|
||||
<geburtsdatum-art>G</geburtsdatum-art>
|
||||
<geschlecht>%schueler_geschlecht%</geschlecht>
|
||||
<geburtsort>%schueler_geburtsort%</geburtsort>
|
||||
<staatsangehoerigkeit>%schueler_staat%</staatsangehoerigkeit>
|
||||
<weitere_staatsangehoerigkeit></weitere_staatsangehoerigkeit>
|
||||
<migrationshintergrund>
|
||||
<geburtsland>%schueler_geburtsland%</geburtsland>
|
||||
<zuzug_art>AYB</zuzug_art>
|
||||
<verkehrssprache></verkehrssprache>
|
||||
<zuzug_datum>%schueler_zuzug%</zuzug_datum>
|
||||
</migrationshintergrund>
|
||||
<anschriftreiter_daten_liste>
|
||||
<!-- Anschrift des Vaters -->
|
||||
<anschriftreiterdaten>
|
||||
<reiter>01</reiter>
|
||||
<art></art>
|
||||
<anschrift>
|
||||
<strasse>%kontakt_person_1_strasse%</strasse>
|
||||
<hausnummer>%kontakt_person_1_hausnummer%</hausnummer>
|
||||
<postleitzahl>%kontakt_person_1_plz%</postleitzahl>
|
||||
<ortsbezeichnung>%kontakt_person_1_ort%</ortsbezeichnung>
|
||||
<ortsbezeichnung_zusatz></ortsbezeichnung_zusatz>
|
||||
<ortsteil></ortsteil>
|
||||
<ortsteil_zusatz></ortsteil_zusatz>
|
||||
<gemeindekennzahl></gemeindekennzahl>
|
||||
<postfach></postfach>
|
||||
<postleitzahl_postfach></postleitzahl_postfach>
|
||||
<staat></staat>
|
||||
</anschrift>
|
||||
<person>
|
||||
<personentyp>%kontakt_person_1_art%</personentyp>
|
||||
<familienname>%kontakt_person_1_nachname%</familienname>
|
||||
<vornamen>%kontakt_person_1_vorname%</vornamen>
|
||||
<namensbestandteil_vorangestellt></namensbestandteil_vorangestellt>
|
||||
<namensbestandteil_nachgestellt></namensbestandteil_nachgestellt>
|
||||
<akad_grad></akad_grad>
|
||||
<anrede>%kontakt_person_1_anrede%</anrede>
|
||||
<!-- <geschlecht></geschlecht> -->
|
||||
<!-- <staat></staat> -->
|
||||
<kommunikationsdaten>
|
||||
<kommunikation>
|
||||
<typ>01</typ>
|
||||
<nummer_adresse>%kontakt_person_1_telefonnummer%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
<kommunikation>
|
||||
<typ>04</typ>
|
||||
<nummer_adresse>%kontakt_person_1__email%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
</kommunikationsdaten>
|
||||
</person>
|
||||
<auskunftsberechtigt></auskunftsberechtigt>
|
||||
<imverteilerschriftverkehr></imverteilerschriftverkehr>
|
||||
<hauptansprechpartner></hauptansprechpartner>
|
||||
</anschriftreiterdaten>
|
||||
<!-- Anschrift der Mutter -->
|
||||
<anschriftreiterdaten>
|
||||
<reiter>02</reiter>
|
||||
<art></art> <!-- 02 == Anschrift wie 1. Erziehungsberechtigter; 03 == eigene Anschrift -->
|
||||
<anschrift>
|
||||
<strasse>%kontakt_person_2_strasse%</strasse>
|
||||
<hausnummer>%kontakt_person_2_hausnummer%</hausnummer>
|
||||
<postleitzahl>%kontakt_person_2_plz%</postleitzahl>
|
||||
<ortsbezeichnung>%kontakt_person_2_ort%</ortsbezeichnung>
|
||||
<ortsbezeichnung_zusatz></ortsbezeichnung_zusatz>
|
||||
<ortsteil></ortsteil>
|
||||
<ortsteil_zusatz></ortsteil_zusatz>
|
||||
<gemeindekennzahl></gemeindekennzahl>
|
||||
<postfach></postfach>
|
||||
<postleitzahl_postfach></postleitzahl_postfach>
|
||||
<staat></staat>
|
||||
</anschrift>
|
||||
<person>
|
||||
<personentyp>%kontakt_person_2_art%</personentyp>
|
||||
<familienname>%kontakt_person_2_nachname%</familienname>
|
||||
<vornamen>%kontakt_person_2_vorname%</vornamen>
|
||||
<namensbestandteil_vorangestellt></namensbestandteil_vorangestellt>
|
||||
<namensbestandteil_nachgestellt></namensbestandteil_nachgestellt>
|
||||
<akad_grad></akad_grad>
|
||||
<anrede>%kontakt_person_2_anrede%</anrede>
|
||||
<!-- <geschlecht></geschlecht> -->
|
||||
<!-- <staat></staat> -->
|
||||
<kommunikationsdaten>
|
||||
<kommunikation>
|
||||
<typ>01</typ>
|
||||
<nummer_adresse>%kontakt_person_2_telefonnummer%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
<kommunikation>
|
||||
<typ>04</typ>
|
||||
<nummer_adresse>%kontakt_person_2__email%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
</kommunikationsdaten>
|
||||
</person>
|
||||
<auskunftsberechtigt></auskunftsberechtigt>
|
||||
<imverteilerschriftverkehr></imverteilerschriftverkehr>
|
||||
<hauptansprechpartner></hauptansprechpartner>
|
||||
</anschriftreiterdaten>
|
||||
<!-- Anschrift der Tochter -->
|
||||
<anschriftreiterdaten>
|
||||
<reiter>03</reiter>
|
||||
<art></art> <!-- eigene Anschrift -->
|
||||
<anschrift>
|
||||
<strasse>%schueler_str%</strasse>
|
||||
<hausnummer>%schueler_hausnr%</hausnummer>
|
||||
<postleitzahl>%schueler_plz%</postleitzahl>
|
||||
<ortsbezeichnung>%schueler_ort%</ortsbezeichnung>
|
||||
<ortsbezeichnung_zusatz></ortsbezeichnung_zusatz>
|
||||
<ortsteil></ortsteil>
|
||||
<ortsteil_zusatz></ortsteil_zusatz>
|
||||
<gemeindekennzahl></gemeindekennzahl>
|
||||
<staat></staat>
|
||||
</anschrift>
|
||||
<person>
|
||||
<kommunikationsdaten>
|
||||
<kommunikation>
|
||||
<typ>01</typ>
|
||||
<nummer_adresse>%schueler_tel%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
<kommunikation>
|
||||
<typ>04</typ>
|
||||
<nummer_adresse>%schueler_email%</nummer_adresse>
|
||||
<bemerkung></bemerkung>
|
||||
<sortierung></sortierung>
|
||||
</kommunikation>
|
||||
</kommunikationsdaten>
|
||||
</person>
|
||||
</anschriftreiterdaten>
|
||||
</anschriftreiter_daten_liste>
|
||||
<religionszugehoerigkeit>%schueler_bekenntnis%</religionszugehoerigkeit>
|
||||
</schuelerstammdaten>
|
||||
<stoerungschwaecheliste>
|
||||
<stoerungschwaeche>
|
||||
<art></art>
|
||||
<attest_bis></attest_bis>
|
||||
</stoerungschwaeche>
|
||||
</stoerungschwaecheliste>
|
||||
<ganztaegigeBetreuung></ganztaegigeBetreuung>
|
||||
<organisationsFormSVE></organisationsFormSVE>
|
||||
<schullaufbahn>
|
||||
<eintritt>
|
||||
<eintrittsdatum>%registrierung_eintritt_am%</eintrittsdatum>
|
||||
<schulbesuch_stichtag_vor_eintritt>%von_schulart%</schulbesuch_stichtag_vor_eintritt>
|
||||
<von_schule>%von_schulnr%</von_schule>
|
||||
</eintritt>
|
||||
<austritt>
|
||||
<austrittsdatum></austrittsdatum>
|
||||
<abschlussart>%von_schulvorbildung%</abschlussart>
|
||||
<austrittsziel></austrittsziel>
|
||||
</austritt>
|
||||
</schullaufbahn>
|
||||
<sonderpaedagogische_foerderung>
|
||||
<foerderschwerpunkte>
|
||||
<foerderschwerpunkt>
|
||||
<foerder_art></foerder_art>
|
||||
<sortierung></sortierung>
|
||||
</foerderschwerpunkt>
|
||||
</foerderschwerpunkte>
|
||||
<foerderung_durch_msd></foerderung_durch_msd>
|
||||
<lehrplan></lehrplan>
|
||||
</sonderpaedagogische_foerderung>
|
||||
<gastschulverhaeltnis>
|
||||
<art>%gastschueler%</art>
|
||||
<auswaertige_unterbringung>%registrierung_wohnheim_ASV%</auswaertige_unterbringung>
|
||||
<unterbringung_art></unterbringung_art>
|
||||
</gastschulverhaeltnis>
|
||||
<unterrichtsdaten>
|
||||
<berufsausbildung>
|
||||
<beruf>%beruf_nummer%</beruf>
|
||||
<bis>%ausbildung_ende%</bis>
|
||||
<von>%ausbildung_beginn%</von>
|
||||
</berufsausbildung>
|
||||
<teilnahme_religionsunterricht>
|
||||
<besuchter_unterricht>%schueler_reliunterricht%</besuchter_unterricht>
|
||||
</teilnahme_religionsunterricht>
|
||||
</unterrichtsdaten>
|
||||
</schuelerin>
|
||||
78
export-asv.txt
Normal file
78
export-asv.txt
Normal file
@ -0,0 +1,78 @@
|
||||
"%beruf_klasse%",
|
||||
"%schueler_nachname%",
|
||||
"%schueler_vorname%",
|
||||
"%schueler_rufname%",
|
||||
"%schueler_geburtsdatum%",
|
||||
"G",
|
||||
"%schueler_geburtsort%",
|
||||
"%schueler_geburtsland%",
|
||||
"%schueler_geschlecht%",
|
||||
"%schueler_bekenntnis%",
|
||||
"%schueler_reliunterricht%",
|
||||
"%schueler_staat%",
|
||||
"",
|
||||
"%schueler_str%",
|
||||
"%schueler_hausnr%",
|
||||
"%schueler_plz%",
|
||||
"%schueler_ort%",
|
||||
"",
|
||||
"D",
|
||||
"%schueler_tel%",
|
||||
"",
|
||||
"%schueler_email%",
|
||||
"%schueler_muttersprache%",
|
||||
"%registrierung_eintritt_am%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%kontakt_person_1_art%",
|
||||
"%kontakt_person_1_anrede%",
|
||||
"%kontakt_person_1_nachname%",
|
||||
"%kontakt_person_1_vorname%",
|
||||
"%kontakt_person_1_strasse%",
|
||||
"%kontakt_person_1_hausnummer%",
|
||||
"%kontakt_person_1_plz%",
|
||||
"%kontakt_person_1_ort%",
|
||||
"",
|
||||
"%kontakt_person_1_telefonnummer%",
|
||||
"",
|
||||
"%kontakt_person_1_email%",
|
||||
"",
|
||||
"",
|
||||
"%Erz1Hauptansprechpartner%",
|
||||
"%kontakt_person_2_art%",
|
||||
"%kontakt_person_2_anrede%",
|
||||
"%kontakt_person_2_nachname%",
|
||||
"%kontakt_person_2_vorname%",
|
||||
"%kontakt_person_2_strasse%",
|
||||
"%kontakt_person_2_hausnummer%",
|
||||
"%kontakt_person_2_plz%",
|
||||
"%kontakt_person_2_ort%",
|
||||
"",
|
||||
"%kontakt_person_2_telefonnummer%",
|
||||
"",
|
||||
"%kontakt_person_2_email%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_zuzugsart%",
|
||||
"%von_schulnr%",
|
||||
"%ausbildung_dauer%",
|
||||
"%ausbildung_beginn%",
|
||||
"%ausbildung_ende%",
|
||||
"%betrieb_nummer%",
|
||||
"%beruf_nummer%0",
|
||||
"%art_der_beschaeftigung%",
|
||||
"%von_schulvorbildung%",
|
||||
"%von_schulvorbildung_an%",
|
||||
"%von_schulart%",
|
||||
"%art_wohnheim%",
|
||||
"",
|
||||
"%gastschueler%",
|
||||
"%schueler_zuzug%",
|
||||
"",
|
||||
"",
|
||||
223
export-kontrollausdruck-template.txt
Normal file
223
export-kontrollausdruck-template.txt
Normal file
@ -0,0 +1,223 @@
|
||||
<h2>Datenblatt %schueler_nachname%, %schueler_rufname% - %beruf_klasse%</h2>
|
||||
<h3>1. Schüler/-in - Exportdatum: %date%</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Nachname.......: </td>
|
||||
<td><b>%schueler_nachname%</b></td><td> </td>
|
||||
<td>Anrede.........: </td>
|
||||
<td><b>%schueler_anrede%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vornamen (alle): </td>
|
||||
<td><b>%schueler_vorname%</b></td><td></td>
|
||||
<td>Geschlecht.....: </td>
|
||||
<td><b>%schueler_geschlecht%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rufname........: </td>
|
||||
<td><b>%schueler_rufname%</b></td><td></td>
|
||||
<td>Bekenntnis.....: </td>
|
||||
<td><b>%schueler_bekenntnis%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Geburtsort.....: </td>
|
||||
<td><b>%schueler_geburtsort%</b></td><td></td>
|
||||
<td>Staatsanghörig.: </td>
|
||||
<td><b>%schueler_staat%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Geburtsdatum...: </td>
|
||||
<td><b>%schueler_geburtsdatum%</b></td><td></td>
|
||||
<td> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Straße, Nr.....: </td>
|
||||
<td colspan="3"><b>%schueler_str% %schueler_hausnr%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PLZ, Ort.......: </td>
|
||||
<td colspan="3"><b>%schueler_plz% %schueler_ort%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telefon........: </td>
|
||||
<td colspan="3"><b>%schueler_tel%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>E-Mail.........: </td>
|
||||
<td colspan="3"><b>%schueler_email%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><b>Bei nichtdeutschem Geburtsort!</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Geburtsland....: </td>
|
||||
<td><b>%schueler_geburtsland_ohne_de%</b></td><td></td>
|
||||
<td>Zuzugsjahr.....: </td>
|
||||
<td><b>%schueler_zuzug%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Art des Zuzugs.: </td>
|
||||
<td colspan="3"><b>%schueler_zuzugsart_read% (%schueler_zuzugsart%)</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>2. Kontaktpersonen</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th colspan="2">Kontaktperson 1 (<b>%kontakt_person_1_art%)</th>
|
||||
<th> </th>
|
||||
<th colspan="2">Kontaktperson 2 (<b>%kontakt_person_2_art%)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Anrede..: </td>
|
||||
<td><b>%kontakt_person_1_anrede%</b></td><td></td>
|
||||
<td>Anrede..: </td>
|
||||
<td><b>%kontakt_person_2_anrede%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nachname: </td>
|
||||
<td><b>%kontakt_person_1_nachname%</b></td><td></td>
|
||||
<td>Nachname: </td>
|
||||
<td><b>%kontakt_person_2_nachname%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vorname.: </td>
|
||||
<td><b>%kontakt_person_1_vorname%</b></td><td></td>
|
||||
<td>Vorname.: </td>
|
||||
<td><b>%kontakt_person_2_vorname%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telefon.: </td>
|
||||
<td><b>%kontakt_person_1__telefonnummer%</b></td><td></td>
|
||||
<td>Telefon.: </td>
|
||||
<td><b>%kontakt_person_2__telefonnummer%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>E-Mail..: </td>
|
||||
<td><b>%kontakt_person_1_email%</b></td><td></td>
|
||||
<td>E-Mail..: </td>
|
||||
<td><b>%kontakt_person_2_email%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PLZ, Ort: </td>
|
||||
<td><b>%kontakt_person_1_plz% %kontakt_person_1_ort%</b></td><td></td>
|
||||
<td>PLZ, Ort: </td>
|
||||
<td><b>%kontakt_person_2_plz% %kontakt_person_2_ort%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Str., Nr: </td>
|
||||
<td><b>%kontakt_person_1_strasse% %kontakt_person_1_hausnummer%</b></td><td></td>
|
||||
<td>Str., Nr: </td>
|
||||
<td><b>%kontakt_person_2_strasse% %kontakt_person_2_hausnummer%</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>3. Berufsausbildung / Berufstätigkeit / Maßnahmenträger</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Betrieb............: </td>
|
||||
<td colspan="4"><b>%betrieb_name% (Nr. %betrieb_nummer%)</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Anschrift..........: </td>
|
||||
<td colspan="4"><b>%betrieb_strasse% %betrieb_hausnr%, %betrieb_plz% %betrieb_ort%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telefon (Durchwahl): </td>
|
||||
<td><b>%betrieb_teldurchwahl%</b></td><th> </th>
|
||||
<td>Telefon (Zentrale).: </td>
|
||||
<td><b>%betrieb_telzentrale%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausbilder/Ansp.Part: </td>
|
||||
<td colspan="4"><b>%betrieb_anprechpartner%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausbilder-E-Mail...: </td>
|
||||
<td colspan="4"><b>%ausbildung_ausbilderemail%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausbildungsart.....: </td>
|
||||
<td colspan="4"><b>%registrierung_typtext% (%registrierung_typ%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausbildungsberuf...: </td>
|
||||
<td colspan="4"><b>%beruf_bezeichnung% (Nr. %beruf_nummer%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Beginn Ausbildung..: </td>
|
||||
<td><b>%ausbildung_beginn%</b></td><th> </th>
|
||||
<td>Ende Ausbildung....: </td>
|
||||
<td><b>%ausbildung_ende%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dauer Ausbildung...: </td>
|
||||
<td><b>%ausbildung_dauer%</b> Jahre</td><th> </th>
|
||||
<td>Kammer.............: </td>
|
||||
<td><b>%betrieb_kammerread%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gast-/FS-Schüler...: </td>
|
||||
<td><b>%gastschueler%</b></td><th> </th>
|
||||
<td>Umschüler..........: </td>
|
||||
<td><b>%umschueler%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Träger.............: </td>
|
||||
<td><b>%umschueler_traeger%</b></td><th> </th>
|
||||
<td>Fördernummer.......: </td>
|
||||
<td><b>%umschueler_foerderer_nr%</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<h3>4. Schulische Daten</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Eintrittsdatum........: </td>
|
||||
<td colspan="4"><b>%registrierung_eintritt_am%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Zuletzt besucht Schule: </td>
|
||||
<td colspan="4"><b>%von_schulname%, %von_schulort% (Nr.: %von_schulnr%)</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>letzte Schulart....: </td>
|
||||
<td><b>%von_schulart% %von_schulart_read%</b></td><th> </th>
|
||||
<td>höchster Absch.....: </td>
|
||||
<td><b>%von_schulvorbildung% %von_schulvorbildung_read%</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>erworben an........: </td>
|
||||
<td><b>%von_schulvorbildung_an% %von_schulvorbildung_an_read%</b></td><th> </th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"><b>Schullaufbahn (%anzahl_schulbesuche% Schulbesuche wurden angegeben)</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Schulname - Ort</td>
|
||||
<td>Eintritt</td>
|
||||
<td>Austritt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">%schulbesuch_1_schule_name% %schulbesuch_1_schule_ort%</td>
|
||||
<td>%schulbesuch_1_eintritt%</td>
|
||||
<td>%schulbesuch_1_austritt%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">%schulbesuch_2_schule_name% %schulbesuch_2_schule_ort%</td>
|
||||
<td>%schulbesuch_2_eintritt%</td>
|
||||
<td>%schulbesuch_2_austritt%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">%schulbesuch_3_schule_name% %schulbesuch_3_schule_ort%</td>
|
||||
<td>%schulbesuch_3_eintritt%</td>
|
||||
<td>%schulbesuch_3_austritt%</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>5. Mitteilungen an die Schule</h3>
|
||||
<p>Heimunterbringung: <b>%registrierung_wohnheim%</b><br>
|
||||
Mitteilung:<br>
|
||||
<b>%registierung_mitteilung%</b></p>
|
||||
<div style="page-break-after: always;"></div>
|
||||
7
export-template-vorschau.txt
Normal file
7
export-template-vorschau.txt
Normal file
@ -0,0 +1,7 @@
|
||||
'%registierung_datum%'(%registierung_id%) |
|
||||
%schueler_nachname% %schueler_rufname% |
|
||||
%beruf_klasse%: %beruf_bezeichnung%|
|
||||
Dauer: %ausbildung_dauer% |
|
||||
Betrieb: %betrieb_name% |
|
||||
Mitteilung: %registierung_mitteilung% |
|
||||
Wohnheim: %registrierung_wohnheim%
|
||||
275
export-template.txt
Normal file
275
export-template.txt
Normal file
@ -0,0 +1,275 @@
|
||||
"%schueler_nachname% %schueler_rufname%",
|
||||
"BS %beruf_klasse% %schueler_nachname% %schueler_rufname%",
|
||||
"",
|
||||
"%schueler_nachname%",
|
||||
"",
|
||||
"",
|
||||
"%schueler_vorname%",
|
||||
"%schueler_rufname%",
|
||||
"%schueler_geschlecht%",
|
||||
"%schueler_anrede%",
|
||||
"%schueler_geburtsdatum%",
|
||||
"%schueler_geburtsjahr%",
|
||||
"%schueler_geburtsort%",
|
||||
"%schueler_staat%",
|
||||
"%schueler_bekenntnis%",
|
||||
"%kontakt_person_1_nachname%",
|
||||
"%kontakt_person_1_vorname%",
|
||||
"%kontakt_person_1_anrede%",
|
||||
"%kontakt_person_1_art%",
|
||||
"%kontakt_person_1_telefonnummer%",
|
||||
"%kontakt_person_2_nachname%",
|
||||
"%kontakt_person_2_vorname%",
|
||||
"%kontakt_person_2_anrede%",
|
||||
"%kontakt_person_2_art%",
|
||||
"%kontakt_person_2_telefonnummer%",
|
||||
"%schueler_plz%",
|
||||
"%schueler_ort%",
|
||||
"%schueler_str% %schueler_hausnr%",
|
||||
"%schueler_tel%",
|
||||
"S",
|
||||
"%kontakt_person_1_art%",
|
||||
"%kontakt_person_1_plz%",
|
||||
"%kontakt_person_1_ort%",
|
||||
"%kontakt_person_1_strasse% %kontakt_person_1_hausnummer%",
|
||||
"%kontakt_person_1_telefonnummer%",
|
||||
"%kontakt_person_1_art%",
|
||||
"%kontakt_person_2_art%",
|
||||
"%gastschueler%",
|
||||
"",
|
||||
"%umschueler%",
|
||||
"%umschueler_traeger%",
|
||||
"%umschueler_foerderer_nr%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%beruf_klasse%",
|
||||
"10",
|
||||
"",
|
||||
"%registrierung_wohnheim%",
|
||||
"",
|
||||
"%schueler_schulpflicht%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_reliunterricht%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%registrierung_eintritt_am%",
|
||||
"",
|
||||
10,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%von_schulnr%",
|
||||
"%von_schulart%",
|
||||
0,
|
||||
"%von_schulvorbildung%",
|
||||
"",
|
||||
"%ausbildung_beginn%",
|
||||
"%ausbildung_ende%",
|
||||
"%registrierung_typ%",
|
||||
"%ausbildung_dauer%",
|
||||
"%beruf_nummer%",
|
||||
"%betrieb_nummer%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
" & & & &",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
"%art_wohnheim%",
|
||||
"O",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_zuzugsart%",
|
||||
"%schueler_zuzug%",
|
||||
"",
|
||||
"",
|
||||
"%von_schulvorbildung%",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
" & & & &",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%von_schulart%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_geburtsland_ohne_de%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_geburtsland_ohne_de%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%schueler_email%",
|
||||
"%ausbildung_ausbilderemail%",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"%betrieb_kammer%"
|
||||
39
phpunit.xml.dist
Normal file
39
phpunit.xml.dist
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<env name="KERNEL_CLASS" value="App\Kernel" />
|
||||
<env name="APP_ENV" value="test" />
|
||||
<env name="APP_DEBUG" value="1" />
|
||||
<env name="APP_SECRET" value="s$cretf0rt3st" />
|
||||
<env name="SHELL_VERBOSITY" value="-1" />
|
||||
<!-- define your env variables for the test env here -->
|
||||
|
||||
<!-- ###+ symfony/mailer ### -->
|
||||
<!-- MAILER_DSN=smtp://localhost -->
|
||||
<!-- ###- symfony/mailer ### -->
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
<listeners>
|
||||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
||||
</listeners>
|
||||
</phpunit>
|
||||
BIN
public/Logo_Berufsschule_4c.jpg
Normal file
BIN
public/Logo_Berufsschule_4c.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
public/SchulansichtInDenLogofarbenSlideFarbe.png
Normal file
BIN
public/SchulansichtInDenLogofarbenSlideFarbe.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
285
public/customStyle.css
Normal file
285
public/customStyle.css
Normal file
@ -0,0 +1,285 @@
|
||||
|
||||
html{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body{
|
||||
background-color: rgba(102, 155, 204, 0.05) !important;
|
||||
font-family: "Lato", sans-serif !important;
|
||||
font-size: 18px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Icon progressbar */
|
||||
#progressbar {
|
||||
margin-bottom: 30px;
|
||||
overflow: hidden;
|
||||
color: lightgrey;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#progressbar .active {
|
||||
color: #00377B;
|
||||
}
|
||||
|
||||
#progressbar li {
|
||||
font-size: 15px;
|
||||
width: 25%;
|
||||
float: left;
|
||||
position: relative;
|
||||
font-weight: 400;
|
||||
text-align: center; /* Zentriert den Text */
|
||||
}
|
||||
|
||||
/* Icons in der Progressbar */
|
||||
#progressbar li:before {
|
||||
font-family: FontAwesome;
|
||||
content: "\f13e"; /* Standardwert, falls kein anderes Icon spezifiziert ist */
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
line-height: 50px; /* Anpassung der Linie an die Höhe des Kreises */
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
background: lightgray;
|
||||
border-radius: 50%;
|
||||
margin: 0 auto 10px auto;
|
||||
padding: 2px;
|
||||
position: relative; /* Position relativ für den z-index */
|
||||
z-index: 1; /* Z-index erhöht, um über Hintergrundfarbe der Icons zu liegen */
|
||||
}
|
||||
|
||||
#progressbar #slot1:before {
|
||||
content: "\f07c"; /* Icon für Ausbildungsdaten */
|
||||
}
|
||||
|
||||
#progressbar #slot2:before {
|
||||
content: "\f007"; /* Icon für Persondaten */
|
||||
}
|
||||
|
||||
#progressbar #slot3:before {
|
||||
content: "\f129"; /* Icon für Sonstiges */
|
||||
}
|
||||
|
||||
#progressbar #slot4:before {
|
||||
content: "\f00c"; /* Icon für Abschluss */
|
||||
}
|
||||
|
||||
/* Progressbar-Connectors */
|
||||
#progressbar li:after {
|
||||
content: '';
|
||||
width: calc(100%);
|
||||
height: 2px;
|
||||
background: lightgray;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 25px;
|
||||
transform: translateX(-50%); /* Zentriert die Linie horizontal */
|
||||
z-index: 0; /* Z-index auf 0 gesetzt, um unter den Icons zu liegen */
|
||||
}
|
||||
|
||||
/* Farbe von Nummer und Connector */
|
||||
#progressbar li.active:before, #progressbar li.active:after {
|
||||
background: #00377B;
|
||||
}
|
||||
|
||||
/* Animiertes Fortschrittsbalken */
|
||||
.progress {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
background-color: #00377B;
|
||||
}
|
||||
|
||||
|
||||
.labelFont{
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 4%;
|
||||
}
|
||||
|
||||
.FontFirst{
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.headlineFont{
|
||||
font-weight: bold;
|
||||
color: #00377B;
|
||||
}
|
||||
|
||||
.buttonFont{
|
||||
font-weight: bolder!important;
|
||||
font-size: 20px!important;
|
||||
color: #00377B;
|
||||
}
|
||||
|
||||
.SpacingSides{
|
||||
padding: inherit;
|
||||
}
|
||||
|
||||
.containerColor{
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.containerFooter{
|
||||
background-color: #00377B;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.copyright{
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
.SpacingTop{
|
||||
padding-top: 2%;
|
||||
}
|
||||
|
||||
.blankLink{
|
||||
text-decoration: none!important;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.controlButton{
|
||||
border-color: #00377B!important;
|
||||
margin-bottom: 30px;
|
||||
color: #00377B!important;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.controlButton:hover{
|
||||
background-color: #00377B!important;
|
||||
color: white!important;
|
||||
}
|
||||
|
||||
.greyFooter{
|
||||
color: #7e7e7e;
|
||||
border-bottom-style: dotted;
|
||||
font-size: 15px!important;
|
||||
}
|
||||
|
||||
.table{
|
||||
table-layout:fixed;
|
||||
}
|
||||
|
||||
.blankLinkButton{
|
||||
color: black;
|
||||
}
|
||||
|
||||
.jumbotron{
|
||||
margin-bottom:0!important;
|
||||
}
|
||||
|
||||
.smallButtonDistance{
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
.RadioBtnSchool{
|
||||
margin-right: 10px;
|
||||
font-size: large;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
|
||||
.invisibleItems{
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.confirmButton{
|
||||
border-color: #00cc00;
|
||||
}
|
||||
|
||||
.confirmButton:hover{
|
||||
background-color: #00cc00;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.redHighlight{
|
||||
color: red;
|
||||
}
|
||||
|
||||
.headlineGlobal{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#copyright{
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#copyright a{
|
||||
text-decoration: none;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
|
||||
.optimizedPicture{
|
||||
background-image: url("/SchulansichtInDenLogofarbenSlideFarbe.png");
|
||||
background-size: cover;
|
||||
height: 120%;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.hidePictures{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 400px) {
|
||||
.hideLogo{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.copyrightLine{
|
||||
background-color: #a6a6a6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.labelFontData{
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
.containerData{
|
||||
background-color: #00377B;
|
||||
color: white;
|
||||
border-radius: 5px;
|
||||
padding-top: 1%!important;
|
||||
padding-bottom: 1%!important;
|
||||
}
|
||||
|
||||
.fixSize{
|
||||
transform: scale(1.2)!important;
|
||||
}
|
||||
|
||||
.dataLink{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.dataLink:hover{
|
||||
color: #5eb5e0;
|
||||
}
|
||||
|
||||
.required:after {
|
||||
content: "*";
|
||||
color: red;
|
||||
}
|
||||
.form-error>ul>li {
|
||||
font-size: .8em;
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.form-error>ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
.datenschutz {
|
||||
margin-right: 5px
|
||||
}
|
||||
|
||||
.importantInfo{
|
||||
color: red;
|
||||
}
|
||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
44
public/index.php
Normal file
44
public/index.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
use Symfony\Component\ErrorHandler\ErrorHandler;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
define('APPLICATION_PATH', realpath(__DIR__) . '/../');
|
||||
|
||||
|
||||
// The check is to ensure we don't use .env in production
|
||||
if (!isset($_SERVER['APP_ENV'])) {
|
||||
if (!class_exists(Dotenv::class)) {
|
||||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
||||
}
|
||||
(new Dotenv())->load(__DIR__.'/../.env');
|
||||
}
|
||||
|
||||
$env = $_SERVER['APP_ENV'] ?? 'dev';
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));
|
||||
|
||||
if ($debug) {
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
//ErrorHandler::register();
|
||||
}
|
||||
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
|
||||
Request::setTrustedHosts(explode(',', $trustedHosts));
|
||||
}
|
||||
|
||||
$kernel = new Kernel($env, $debug);
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
||||
0
src/Controller/.gitignore
vendored
Normal file
0
src/Controller/.gitignore
vendored
Normal file
34
src/Controller/AdminAuthenticatorController.php
Normal file
34
src/Controller/AdminAuthenticatorController.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
class AdminAuthenticatorController extends AbstractController
|
||||
{
|
||||
//TODO Admin Zeugs noch mergen
|
||||
#[Route(path: '/login', name: 'app_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
{
|
||||
// get the login error if there is one
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
// last email entered by the user
|
||||
$email = $authenticationUtils->getLastUsername();
|
||||
|
||||
return $this->render(
|
||||
'security/login.html.twig',
|
||||
['email' => $email, 'error' => $error,]);
|
||||
}
|
||||
|
||||
#[Route(path: '/logout', name: 'app_logout')]
|
||||
public function logout(Security $security): Response
|
||||
{
|
||||
$response = $security->logout();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
}
|
||||
70
src/Controller/AdminController.php
Normal file
70
src/Controller/AdminController.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\AdminUser;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/admin', name: 'admin')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function index()
|
||||
{
|
||||
return $this->render('admin/index.html.twig', [
|
||||
'controller_name' => 'AdminController',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/user')]
|
||||
public function user(Request $request, UserPasswordHasherInterface $passwordHasher, ManagerRegistry $doctrine)
|
||||
{
|
||||
|
||||
$user = new AdminUser();
|
||||
$user->setEmail($_ENV['ADMIN_EMAIL']);
|
||||
$user->setRoles($user->getRoles());
|
||||
|
||||
$user->setPassword($passwordHasher->hashPassword(
|
||||
$user, $_ENV['ADMIN_PASSWORD']
|
||||
));
|
||||
|
||||
$manager = $doctrine->getManager();
|
||||
$adminuser = $manager->getRepository(AdminUser::class)->findOneBy(['roles' => '["ROLE_USER","ROLE_ADMIN"]']);
|
||||
|
||||
if (!$adminuser)
|
||||
{
|
||||
$manager->persist($user);
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
#[Route(path: '/login', name: 'app_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
{
|
||||
if ($this->getUser()) {
|
||||
return $this->redirectToRoute('admin');
|
||||
}
|
||||
|
||||
// get the login error if there is one
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
// last username entered by the user
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
|
||||
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
|
||||
}
|
||||
|
||||
#[Route(path: '/logout', name: 'app_logout')]
|
||||
public function logout(): void
|
||||
{
|
||||
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||
}
|
||||
}
|
||||
750
src/Controller/AdminExport.php
Normal file
750
src/Controller/AdminExport.php
Normal file
@ -0,0 +1,750 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Registrierung;
|
||||
use App\Entity\Schueler;
|
||||
use DateTime;
|
||||
use Exception;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Dompdf\Dompdf;
|
||||
use Dompdf\Options;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* Class AdminExportController
|
||||
* @package App\Controller
|
||||
*/
|
||||
class AdminExport extends AbstractController
|
||||
{
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route(path: '/download', name: 'download')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function generateDownloads(ManagerRegistry $doctrine)
|
||||
{
|
||||
//get data from repository
|
||||
$doctrineRegistrations = $doctrine->getRepository(Registrierung::class)->findForExport();
|
||||
|
||||
$now = new DateTime();
|
||||
$manager = $doctrine->getManager();
|
||||
foreach ($doctrineRegistrations as $registration) {
|
||||
$registration->setExportedAt($now);
|
||||
$manager->persist($registration);
|
||||
}
|
||||
$manager->flush();
|
||||
|
||||
//build assoc array
|
||||
$assocRegistrations = $this->buildRegistrationsAsAssocArray($doctrineRegistrations);
|
||||
|
||||
// get array with year combo as key and return string as value
|
||||
$exportStringPerYear = $this->buildRegistrationStringPerYearASV($assocRegistrations);
|
||||
|
||||
//build kontrollausdruck
|
||||
$exportStringsKontrollausdruckPerYear = $this->buildKonrollausdruckStringsPerYear($assocRegistrations);
|
||||
|
||||
$dir = $this->getParameter('dir.downloads');
|
||||
|
||||
//create folder if not exists
|
||||
if (!file_exists($dir)) {
|
||||
mkdir($dir);
|
||||
}
|
||||
|
||||
// setup for the reader
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv();
|
||||
/* Set CSV parsing options */
|
||||
$reader->setDelimiter(',');
|
||||
$reader->setEnclosure('"');
|
||||
$reader->setSheetIndex(0);
|
||||
|
||||
// Path List
|
||||
$pathList = array();
|
||||
$pathListKontrollausruck = array();
|
||||
|
||||
foreach ($exportStringPerYear as $key => $exportString) {
|
||||
//generate file name for csv base files
|
||||
$fileNameASV = $this->buildExportFileASV($key);
|
||||
$pathASV = $dir . '/' . $fileNameASV;
|
||||
$handleASV = fopen($pathASV, "w");
|
||||
fwrite($handleASV, $exportString);
|
||||
fclose($handleASV);
|
||||
|
||||
/* Load a CSV file and save as a XLSX */
|
||||
//Generate file names for xlsx and set paths
|
||||
$fileNameASVxlsx = $this->buildExportFileXLSX($key);
|
||||
$pathASVxlsx = $dir . '/' . $fileNameASVxlsx;
|
||||
//Load csv for old registrations
|
||||
$spreadsheet = $reader->load($pathASV);
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer->save($pathASVxlsx);
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
unset($spreadsheet);
|
||||
|
||||
$pathList[$key] = $pathASVxlsx;
|
||||
}
|
||||
|
||||
foreach ($exportStringsKontrollausdruckPerYear as $key => $exportStringsKontrollausdruck) {
|
||||
$kontrollPDFPath = $this->kontrollaudruck($exportStringsKontrollausdruck, $dir, $key);
|
||||
$pathListKontrollausruck[$key] = $kontrollPDFPath;
|
||||
}
|
||||
$this->deleteOldExports();
|
||||
|
||||
ksort($pathList, $flags = SORT_REGULAR);
|
||||
ksort($pathListKontrollausruck, $flags = SORT_REGULAR);
|
||||
|
||||
return $this->render('admin_export/filedownload.html.twig', [
|
||||
'pathList' => $pathList,
|
||||
'pathListKontrollausruck' => $pathListKontrollausruck,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route(path: '/csvdownload', name: 'csvdownload')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function csvDownload(Request $request)
|
||||
{
|
||||
$csvpath = $request->query->get('csvpath');
|
||||
return $this->file($csvpath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route(path: '/asvdownload', name: 'asvdownload')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function asvDownload(Request $request)
|
||||
{
|
||||
$asvpath = $request->query->get('asvpath');
|
||||
return $this->file($asvpath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route(path: '/kontrollausdruck', name: 'kontrollausdruck')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function kontrollausdruckDownload(Request $request)
|
||||
{
|
||||
$kontrollausdruckpath = $request->query->get('kontrollausdruckpath');
|
||||
return $this->file($kontrollausdruckpath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
private function kontrollaudruck($htmlKontrollausdruckString, $dir, $key)
|
||||
{
|
||||
//https://ourcodeworld.com/articles/read/799/how-to-create-a-pdf-from-html-in-symfony-4-using-dompdf
|
||||
// Configure Dompdf according to your needs
|
||||
$pdfOptions = new Options();
|
||||
$pdfOptions->set('defaultFont', 'Arial');
|
||||
|
||||
// Instantiate Dompdf with our options
|
||||
$dompdf = new Dompdf($pdfOptions);
|
||||
|
||||
// Retrieve the HTML generated in our twig file
|
||||
//$html = $this->renderView('default/mypdf.html.twig', [
|
||||
// 'title' => "Welcome to our PDF Test"
|
||||
//]);
|
||||
|
||||
// Load HTML to Dompdf
|
||||
$dompdf->loadHtml($htmlKontrollausdruckString);
|
||||
|
||||
// (Optional) Setup the paper size and orientation 'portrait' or 'portrait'
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
|
||||
// Render the HTML as PDF
|
||||
$dompdf->render();
|
||||
|
||||
// Output the generated PDF to File
|
||||
$output = $dompdf->output();
|
||||
|
||||
$fileName = $this->buildExportFileNameKontrollausdruck($key);
|
||||
$path = $dir . '/' . $fileName;
|
||||
file_put_contents($path, $output);
|
||||
|
||||
return $path;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
private function deleteOldExports(): void
|
||||
{
|
||||
$finder = new Finder();
|
||||
$finder->files()->in($this->getParameter('dir.downloads') . '/');
|
||||
$fileSystem = new Filesystem();
|
||||
foreach ($finder as $file) {
|
||||
// Alle Dateien die älter als 30 Tag (* 24 Stunden * 60 Minuten * 60 Sekunden) sind werden gelöscht
|
||||
if ($file->getMTime() < time() - (30 * 24 * 60 * 60)) {
|
||||
$fileSystem->remove($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route(path: '/admin/export', name: 'admin_export')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function index(ManagerRegistry $doctrine)
|
||||
{
|
||||
//get data from repository
|
||||
$doctrineRegistrations = $doctrine->getRepository(Registrierung::class)->findForExport();
|
||||
|
||||
//build assoc array
|
||||
$assocRegistrations = $this->buildRegistrationsAsAssocArray($doctrineRegistrations);
|
||||
|
||||
//build export strings
|
||||
$exportStrings = $this->buildRegistrationStringsVorschau($assocRegistrations);
|
||||
|
||||
//render template
|
||||
return $this->render('admin_export/index.html.twig', [
|
||||
'controller_name' => 'AdminCreateImportController',
|
||||
'import_strings' => $exportStrings,
|
||||
]);
|
||||
}
|
||||
|
||||
private function buildRegistrationsAsAssocArray($doctrineRegistrations): array
|
||||
{
|
||||
$assocRegistrations = array();
|
||||
|
||||
/** @var Registrierung $registration */
|
||||
foreach ($doctrineRegistrations as $registration) {
|
||||
|
||||
//Schueler-Daten
|
||||
$schueler = $registration->getSchueler();
|
||||
|
||||
|
||||
//Umwandlung andere Religion als RK oder EV in ETH.
|
||||
$tmpReli = $schueler->getBekenntnis();
|
||||
if (!($tmpReli == 'RK' || $tmpReli == 'EV')) {
|
||||
$tmpReli = 'Eth';
|
||||
}
|
||||
|
||||
//Umwandlung DE in D ergänzt.
|
||||
$tmpStaat = $schueler->getStaatsangehoerigkeit();
|
||||
if ($tmpStaat == 'DE') {
|
||||
$tmpStaat = 'D';
|
||||
}
|
||||
|
||||
//Zuzug mit Jahr 01.01.?? ist ausreichend.
|
||||
$zuzug = '';
|
||||
if ($schueler->getZuzugAm() != null) {
|
||||
$zuzug = '01.01.' . $schueler->getZuzugAm()->format('Y');
|
||||
}
|
||||
|
||||
if ($registration->getWohnheim() == 'J' and $schueler->getGeschlecht() == 'm') {
|
||||
$artwohnheim = 'J';
|
||||
} elseif ($registration->getWohnheim() == 'J' and $schueler->getGeschlecht() == 'w') {
|
||||
$artwohnheim = 'M';
|
||||
} elseif ($registration->getWohnheim() == 'J' and $schueler->getGeschlecht() == 'd') {
|
||||
$artwohnheim = 'M';
|
||||
} else {
|
||||
$artwohnheim = 'N';
|
||||
}
|
||||
|
||||
$eintrittAm = $registration->getEintrittAm();
|
||||
if ($schueler->getAusbildung() != null) {
|
||||
if ($schueler->getAusbildung()->getBeginn() > $eintrittAm) {
|
||||
$eintrittAm = $schueler->getAusbildung()->getBeginn();
|
||||
}
|
||||
} else {
|
||||
if ($registration->getDatum() > $eintrittAm) {
|
||||
$eintrittAm = $registration->getDatum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$registrationData = array(
|
||||
'%registierung_id%' => $registration->getId(),
|
||||
'%registierung_datum%' => $registration->getDatum()->format('d.m.Y'),
|
||||
'%registierung_mitteilung%' => $registration->getMitteilung(),
|
||||
'%registrierung_wohnheim%' => $registration->getWohnheim() ? 'J' : 'N',
|
||||
'%registrierung_wohnheim_ASV%' => $registration->getWohnheim() ? 'true' : 'false',
|
||||
'%art_wohnheim%' => $artwohnheim,
|
||||
'%registrierung_eintritt_am%' => $eintrittAm->format('d.m.Y'),
|
||||
'%registrierung_eq_massnahme%' => $registration->getTyp() == 'EQ' ? 'J' : 'N',
|
||||
'%registrierung_typ%' => $registration->getTyp(),
|
||||
'%registrierung_typtext%' => $registration->getTypText($registration->getTyp()),
|
||||
'%schueler_nachname%' => $schueler->getNachname(),
|
||||
'%schueler_vorname%' => $schueler->getVorname(),
|
||||
'%schueler_rufname%' => $schueler->getRufname(),
|
||||
'%schueler_anrede%' => $schueler->getGeschlecht() == 'w' ? 'F' : 'H',
|
||||
'%schueler_email%' => $schueler->getEmail(),
|
||||
'%schueler_geburtsdatum%' => $schueler->getGeburtsdatum()->format('d.m.Y'),
|
||||
'%schueler_geburtsjahr%' => $schueler->getGeburtsdatum()->format('Y'),
|
||||
'%schueler_geschlecht%' => $schueler->getGeschlecht(),
|
||||
'%schueler_geburtsort%' => $schueler->getGeburtsort(),
|
||||
'%schueler_geburtsland%' => $schueler->getGeburtsland(),
|
||||
'%schueler_geburtsland_ohne_de%' => $schueler->getGeburtsland() == 'D' ? '' : $schueler->getGeburtsland(),
|
||||
'%schueler_muttersprache%' => $schueler->getGeburtsland() == 'D' ? 'D' : 'ND',
|
||||
'%schueler_zuzug%' => $zuzug,
|
||||
'%schueler_zuzugsart_read%' => $schueler->getZuzugsartReadable(),
|
||||
'%schueler_zuzugsart%' => $schueler->getZuzugsart(),
|
||||
'%schueler_umschueler%' => $schueler->getUmschueler() != null ? 'J' : 'N',
|
||||
'%schueler_plz%' => $schueler->getPlz(),
|
||||
'%schueler_ort%' => $schueler->getOrt(),
|
||||
'%schueler_str%' => $schueler->getStrasse(),
|
||||
'%schueler_hausnr%' => $schueler->getHsnr(),
|
||||
'%schueler_tel%' => $schueler->getTel(),
|
||||
'%schueler_bekenntnis%' => $schueler->getBekenntnis(),
|
||||
//Umwandlung alles ausser RK und EV in Eth und Übernahme in Zeile 64 Exprot
|
||||
'%schueler_reliunterricht%' => $tmpReli,
|
||||
//Umwandlung DE in D ergänzt.
|
||||
'%schueler_staat%' => $tmpStaat,
|
||||
//'%schueler_staat%' => $schueler->getStaatsangehoerigkeit(),
|
||||
'%schueler_schulpflicht%' => $this->getSchulPflicht($schueler),
|
||||
'%registrierung_schuljahr%' => $registration->getSchuljahr()
|
||||
);
|
||||
|
||||
//Umschueler
|
||||
$umschueler = $schueler->getUmschueler();
|
||||
|
||||
if (isset($umschueler)) {
|
||||
$registrationData['%umschueler%'] = 'J';
|
||||
$registrationData['%umschueler_foerderer_nr%'] = $umschueler->getFoerdererNr();
|
||||
$registrationData['%umschueler_traeger%'] = $umschueler->getTraeger();
|
||||
$registrationData['%umschueler_traeger_sitz%'] = $umschueler->getTraegerSitz();
|
||||
} else {
|
||||
$registrationData['%umschueler%'] = 'N';
|
||||
}
|
||||
|
||||
//Kontaktperson-Daten
|
||||
$kontaktPersonen = $schueler->getKontaktpersonen();
|
||||
|
||||
if (isset($kontaktPersonen) && sizeof($kontaktPersonen) > 0) {
|
||||
for ($i = 0; $i < sizeof($kontaktPersonen); $i++) {
|
||||
$baseKey = '%kontakt_person_' . ($i + 1);
|
||||
|
||||
$kontaktPerson = $kontaktPersonen[$i];
|
||||
|
||||
$registrationData[$baseKey . '_anrede%'] = $kontaktPerson->getAnrede();
|
||||
$registrationData[$baseKey . '_art%'] = $kontaktPerson->getArt();
|
||||
$registrationData[$baseKey . '_vorname%'] = $kontaktPerson->getVorname();
|
||||
$registrationData[$baseKey . '_nachname%'] = $kontaktPerson->getNachname();
|
||||
$registrationData[$baseKey . '_strasse%'] = $kontaktPerson->getStrasse();
|
||||
$registrationData[$baseKey . '_hausnummer%'] = $kontaktPerson->getHausnummer();
|
||||
$registrationData[$baseKey . '_plz%'] = $kontaktPerson->getPlz();
|
||||
$registrationData[$baseKey . '_ort%'] = $kontaktPerson->getOrt();
|
||||
$registrationData[$baseKey . '_telefonnummer%'] = $kontaktPerson->getTelefonnummer();
|
||||
$registrationData[$baseKey . '_email%'] = $kontaktPerson->getEmail();
|
||||
if ($i == 0) {
|
||||
$registrationData['%Erz1Hauptansprechpartner%'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Schulbesuche
|
||||
$schulBesuche = $schueler->getSchulbesuche();
|
||||
$registrationData['%anzahl_schulbesuche%'] = sizeof($schulBesuche);
|
||||
if (isset($schulBesuche) && sizeof($schulBesuche) > 0) {
|
||||
for ($i = 0; $i < sizeof($schulBesuche); $i++) {
|
||||
$baseKey = '%schulbesuch_' . ($i + 1);
|
||||
|
||||
$schulBesuch = $schulBesuche[$i];
|
||||
|
||||
$registrationData[$baseKey . '_eintritt%'] = $schulBesuch->getEintritt()->format('d.m.Y');
|
||||
$registrationData[$baseKey . '_austritt%'] = $schulBesuch->getAustritt()->format('d.m.Y');
|
||||
|
||||
$schule = $schulBesuch->getSchule();
|
||||
|
||||
if (isset($schule)) {
|
||||
$registrationData[$baseKey . '_schule_art%'] = $schule->getArt();
|
||||
$registrationData[$baseKey . '_schule_name%'] = $schule->getName();
|
||||
$registrationData[$baseKey . '_schule_strasse%'] = $schule->getStrasse();
|
||||
$registrationData[$baseKey . '_schule_ort%'] = $schule->getOrt();
|
||||
$registrationData[$baseKey . '_schule_plz%'] = $schule->getPlz();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Ausbildung
|
||||
$ausbildung = $schueler->getAusbildung();
|
||||
|
||||
if (isset($ausbildung)) {
|
||||
$registrationData['%ausbildung_ausbilderemail%'] = $ausbildung->getAusbilderemail();
|
||||
$registrationData['%ausbildung_beginn%'] = $ausbildung->getBeginn()->format('d.m.Y');
|
||||
$registrationData['%ausbildung_ende%'] = $ausbildung->getEnde()->format('d.m.Y');
|
||||
$registrationData['%ausbildung_dauer%'] = $this->getAusbildungDauer($ausbildung->getEnde(), $ausbildung->getBeginn());
|
||||
|
||||
//Beruf
|
||||
$beruf = $ausbildung->getBeruf();
|
||||
|
||||
$registrationData['%beruf_bezeichnung%'] = $beruf->getBezeichnung();
|
||||
$registrationData['%beruf_nummer%'] = $beruf->getNummer();
|
||||
|
||||
$wechselNklassenImportklassen = new DateTime(getenv('WECHSEL_NKLASSEN_IMPORTKLASSE'));
|
||||
//echo "Wechsel: ".$wechselNklassenImportklassen$eintrittAm->format('d.m.Y')." Eintritt am: ".$eintrittAm->format('d.m.Y');
|
||||
if ($eintrittAm < $wechselNklassenImportklassen) {
|
||||
$registrationData['%beruf_klasse%'] = "Import";
|
||||
} else {
|
||||
$registrationData['%beruf_klasse%'] = $beruf->getKlasse();
|
||||
}
|
||||
|
||||
|
||||
//Betrieb
|
||||
$betrieb = $ausbildung->getBetrieb();
|
||||
|
||||
$registrationData['%betrieb_name%'] = $betrieb->getName();
|
||||
$registrationData['%betrieb_nummer%'] = $betrieb->getKuerzel();
|
||||
$registrationData['%betrieb_kammer%'] = $betrieb->getKammer();
|
||||
$registrationData['%betrieb_kammerread%'] = "nicht in ASV hinterlegt"; //$betrieb->getKammerText($betrieb->getKammer());
|
||||
$registrationData['%betrieb_strasse%'] = $betrieb->getStrasse();
|
||||
$registrationData['%betrieb_hausnr%'] = $betrieb->getHsnr();
|
||||
$registrationData['%betrieb_plz%'] = $betrieb->getPlz();
|
||||
$registrationData['%betrieb_ort%'] = $betrieb->getOrt();
|
||||
$registrationData['%betrieb_teldurchwahl%'] = $betrieb->getTelDurchwahl();
|
||||
$registrationData['%betrieb_telzentrale%'] = $betrieb->getTelZentrale();
|
||||
$registrationData['%betrieb_anprechpartner%'] = $betrieb->getAnsprPartner();
|
||||
}
|
||||
|
||||
//BGJs Ausbildungsart hinzufügen und Registrierungsart
|
||||
$ausbArtBGJ = $registration->getTyp();
|
||||
|
||||
//Spalte 66 Exportfile Ausbildung mit oder ohne Vertrag
|
||||
if ($ausbArtBGJ == 'AUAU') {
|
||||
$registrationData['%art_der_beschaeftigung%'] = 'm';
|
||||
} elseif ($ausbArtBGJ == 'EQ') {
|
||||
$registrationData['%art_der_beschaeftigung%'] = 'e';
|
||||
} elseif ($ausbArtBGJ == 'UM') {
|
||||
$registrationData['%art_der_beschaeftigung%'] = 'u';
|
||||
} else {
|
||||
$registrationData['%art_der_beschaeftigung%'] = 'o';
|
||||
}
|
||||
|
||||
if ($ausbArtBGJ == 'BGJH') {
|
||||
$registrationData['%beruf_bezeichnung%'] = 'BGJ/s-Holztechnik';
|
||||
$registrationData['%beruf_nummer%'] = '99071';
|
||||
//$registrationData['%beruf_klasse%'] = 'HTE10n';
|
||||
$registrationData['%beruf_klasse%'] = 'Import';
|
||||
$registrationData['%registrierung_typ%'] = 'BGJs';
|
||||
} elseif ($ausbArtBGJ == 'BGJZ') {
|
||||
$registrationData['%beruf_bezeichnung%'] = 'BGJ/s-Zimmerer';
|
||||
$registrationData['%beruf_nummer%'] = '99061';
|
||||
//$registrationData['%beruf_klasse%'] = 'BZI10n';
|
||||
$registrationData['%beruf_klasse%'] = 'Import';
|
||||
$registrationData['%registrierung_typ%'] = 'BGJs';
|
||||
} elseif ($ausbArtBGJ == 'BIK') {
|
||||
$registrationData['%beruf_bezeichnung%'] = 'Unbegleitete Flüchtlinge';
|
||||
$registrationData['%beruf_nummer%'] = '99508';
|
||||
//$registrationData['%beruf_klasse%'] = 'BIKV10n';
|
||||
$registrationData['%beruf_klasse%'] = 'Import';
|
||||
}
|
||||
|
||||
//Gastschueler
|
||||
if ($ausbArtBGJ == 'AUAU' or $ausbArtBGJ == 'UM') {
|
||||
$registrationData['%gastschueler%'] = $this->getGastSchueler($registration);
|
||||
} else {
|
||||
$registrationData['%gastschueler%'] = '';
|
||||
}
|
||||
|
||||
|
||||
//Vorbildung
|
||||
$registrationData['%von_schulart%'] = $schueler->getLetzteSchulart();
|
||||
$registrationData['%von_schulart_read%'] = $schueler->getLetzteSchulartReadable();
|
||||
$registrationData['%von_schulvorbildung%'] = $schueler->getHoechsterAbschluss();
|
||||
$registrationData['%von_schulvorbildung_read%'] = $schueler->getHoechsterAbschlussReadable();
|
||||
$registrationData['%von_schulvorbildung_an%'] = $schueler->getHoechAbschlAn();
|
||||
$registrationData['%von_schulvorbildung_an_read%'] = $schueler->getHoechAbschlAnReadable();
|
||||
|
||||
//$registrationData['%von_schulnr%'] = $schueler->getSchulbesuche()->get(0)->getSchule()->getNummer();
|
||||
//ergänzt um Fehler bei Expot zu beheben (null wenn kein Schulbesuch eingetragen ist)
|
||||
if (isset($schulBesuche) && sizeof($schulBesuche) == 0) {
|
||||
$registrationData['%von_schulnr%'] = '';
|
||||
$registrationData['%von_schulname%'] = 'keine Angaben';
|
||||
} else {
|
||||
$schulnr = $schueler->getSchulbesuche()->get(0)->getSchule()->getNummer();
|
||||
if ($schulnr == 0) {
|
||||
$registrationData['%von_schulnr%'] = '';
|
||||
} elseif ($schulnr < 10) {
|
||||
$registrationData['%von_schulnr%'] = '000' . $schulnr;
|
||||
} elseif ($schulnr < 100) {
|
||||
$registrationData['%von_schulnr%'] = '00' . $schulnr;
|
||||
} elseif ($schulnr < 1000) {
|
||||
$registrationData['%von_schulnr%'] = '0' . $schulnr;
|
||||
} else {
|
||||
$registrationData['%von_schulnr%'] = $schulnr;
|
||||
}
|
||||
$registrationData['%von_schulname%'] = $schueler->getSchulbesuche()->get(0)->getSchule()->getName();
|
||||
$registrationData['%von_schulort%'] = $schueler->getSchulbesuche()->get(0)->getSchule()->getOrt();
|
||||
}
|
||||
|
||||
//Exportdatum
|
||||
$registrationData['%date%'] = date('d.m.Y H:i');
|
||||
|
||||
array_push($assocRegistrations, $registrationData);
|
||||
}
|
||||
|
||||
return $assocRegistrations;
|
||||
}
|
||||
|
||||
private function buildRegistrationStringsVorschau($assocRegistrations)
|
||||
{
|
||||
$exportTemplate = $this->getExportTemplateVorschau();
|
||||
|
||||
$importStrings = array();
|
||||
array_push($importStrings, "Anmeldedatum(ID) | Name Vorname | Klasse\Beruf | Ausbildungsdauer | Betrieb | Mitteilung | Wohnheim");
|
||||
|
||||
foreach ($assocRegistrations as $registration) {
|
||||
$exportString = $exportTemplate;
|
||||
|
||||
//apply parameters
|
||||
foreach ($registration as $parameter => $value) {
|
||||
$exportString = str_replace($parameter, $value, $exportString);
|
||||
}
|
||||
|
||||
//remove unmapped parameters
|
||||
$exportString = preg_replace('/%\w+%/', '', $exportString);
|
||||
$exportString = $exportString . "\r";
|
||||
array_push($importStrings, $exportString);
|
||||
}
|
||||
|
||||
return $importStrings;
|
||||
}
|
||||
|
||||
private function buildRegistrationStringPerYearASV($assocRegistrations)
|
||||
{
|
||||
$exportTemplate = $this->getExportTemplateASV();
|
||||
|
||||
$importStringsPerYear = array();
|
||||
$returnStringsPerYear = array();
|
||||
|
||||
foreach ($assocRegistrations as $registration) {
|
||||
$key = $registration['%registrierung_schuljahr%'];
|
||||
|
||||
$exportString = $exportTemplate;
|
||||
|
||||
//apply parameters
|
||||
foreach ($registration as $parameter => $value) {
|
||||
$exportString = str_replace($parameter, $value, $exportString);
|
||||
}
|
||||
|
||||
//remove unmapped parameters
|
||||
$exportString = preg_replace('/%\w+%/', '', $exportString);
|
||||
$exportString = $exportString . "\r";
|
||||
|
||||
// pro jahr ein array import strings -> return string pro jahr
|
||||
// Array list mit jahr als key und return string als value
|
||||
|
||||
#echo $key . ' ' . $importStringsPerYear[$key];
|
||||
if (!array_key_exists($key, $importStringsPerYear)) {
|
||||
$importStringsPerYear[$key] = array($exportString);
|
||||
} else {
|
||||
array_push($importStringsPerYear[$key], $exportString);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($importStringsPerYear as $key => $importString) {
|
||||
$returnString = "\"Klasse\",\"Name\",\"Vornamen\",\"Rufname\",\"Geburtstag\",\"Geburtsdatum Gültigkeit\",\"Geburtsort\",\"Geburtsland\",\"Geschlecht\",\"Konfession\",\"RU\",\"Land\",\"Land2\",\"Strasse\",\"HausNr\",\"PLZ\",\"Ort\",\"Teilort\",\"Staat\",\"Telefon\",\"Handy\",\"Email\",\"Muttersprache\",\"Schuleintrittam\",\"Einschulungam\",\"im Schriftverkehrverteiler\",\"auskunftsberechtigt\",\"Erz1Art\",\"Erz1Anrede\",\"Erz1Name\",\"Erz1Vorname\",\"Erz1Strasse\",\"Erz1Hausnr\",\"Erz1PLZ\",\"Erz1Ort\",\"Erz1Teilort\",\"Erz1Telefon\",\"Erz1Handy\",\"Erz1Email\",\"Erz1Schriftverkehrverteiler\",\"Erz1auskunftsberechtigt\",\"Erz1Hauptansprechpartner\",\"Erz2Art\",\"Erz2Anrede\",\"Erz2Name\",\"Erz2Vorname\",\"Erz2Strasse\",\"Erz2Hausnr\",\"Erz2PLZ\",\"Erz2Ort\",\"Erz2Teilort\",\"Erz2Telefon\",\"Erz2Handy\",\"Erz2Email\",\"Erz2Schriftverkehrverteiler\",\"Erz2auskunftsberechtigt\",\"Erz2Hauptansprechpartner\",\"Fremdsprache1\",\"Fremdsprache2\",\"Fremdsprache3\",\"Fremdsprache4\",\"Zuzugsart\",\"AbgebendeSchule\",\"Beschäftigungsdauer\",\"Ausbildungsbeginn\",\"Ausbildungsende\",\"Ausbildungsbetrieb\",\"Ausbild_beruf_id\",\"AusbArtDerBeschaeftigung\",\"VorbldgSchulischAbschluss\",\"VorbldgSchulart\",\"SchulbesuchAmStichtag\",\"ArtDerHeimunterbringung\",\"Unterbringung\",\"Gastschüler\",\"Zuzugsdatum\",\"Austrittsdatum\",\"BeruflicherAbschluss\",\r";
|
||||
$returnString = $returnString . implode(PHP_EOL, $importString);
|
||||
$returnStringsPerYear[$key] = $returnString;
|
||||
}
|
||||
|
||||
return $returnStringsPerYear;
|
||||
}
|
||||
|
||||
private function buildKonrollausdruckStringsPerYear($assocRegistrations)
|
||||
{
|
||||
$exportTemplate = $this->getExportKontrollausdruckTemplate();
|
||||
|
||||
$importStringsPerYear = array();
|
||||
$returnStringsPerYear = array();
|
||||
|
||||
foreach ($assocRegistrations as $registration) {
|
||||
$key = $registration['%registrierung_schuljahr%'];
|
||||
|
||||
$exportString = $exportTemplate;
|
||||
|
||||
//apply parameters
|
||||
foreach ($registration as $parameter => $value) {
|
||||
$exportString = str_replace($parameter, $value, $exportString);
|
||||
}
|
||||
|
||||
//remove unmapped parameters
|
||||
$exportString = preg_replace('/%\w+%/', '', $exportString);
|
||||
|
||||
if (!array_key_exists($key, $importStringsPerYear)) {
|
||||
$importStringsPerYear[$key] = array($exportString);
|
||||
} else {
|
||||
array_push($importStringsPerYear[$key], $exportString);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($importStringsPerYear as $key => $importString) {
|
||||
$returnString = '<!DOCTYPE html><html><head><meta charset="UTF-8">
|
||||
<title>Online-Export Kontrollausdrucke</title>
|
||||
<style>
|
||||
h2 { font-size: 18px; }
|
||||
h3 { font-size: 14px; }
|
||||
p { font-size: 12px; }
|
||||
td {
|
||||
font-family: Consolas,monaco,monospace;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
font-family: Consolas,monaco,monospace;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</head><body>';
|
||||
$returnString = $returnString . implode(PHP_EOL, $importString);
|
||||
$returnString .= '</body></html>';
|
||||
$returnStringsPerYear[$key] = $returnString;
|
||||
}
|
||||
|
||||
return $returnStringsPerYear;
|
||||
}
|
||||
|
||||
private function buildExportFileASV($key)
|
||||
{
|
||||
return date('Y-m-d H:i') . '-' . $key . ' Anmeldungen.csv';
|
||||
}
|
||||
|
||||
private function buildExportFileXLSX($key)
|
||||
{
|
||||
return date('Y-m-d H:i') . '-' . $key . ' Anmeldungen.xlsx';
|
||||
}
|
||||
|
||||
private function buildExportFileNameKontrollausdruck($key)
|
||||
{
|
||||
return date('Y-m-d H:i') . '-' . $key . ' Kontrollausdruck_Anmeldungen.pdf';
|
||||
}
|
||||
|
||||
private function getExportKontrollausdruckTemplate()
|
||||
{
|
||||
return preg_replace("/\r|\n/", "",
|
||||
file_get_contents(APPLICATION_PATH . '/export-kontrollausdruck-template.txt')
|
||||
);
|
||||
}
|
||||
|
||||
private function getExportTemplate()
|
||||
{
|
||||
return preg_replace("/\r|\n/", "",
|
||||
file_get_contents(APPLICATION_PATH . '/export-template.txt')
|
||||
);
|
||||
}
|
||||
|
||||
private function getExportTemplateVorschau()
|
||||
{
|
||||
return preg_replace("/\r|\n/", "",
|
||||
file_get_contents(APPLICATION_PATH . '/export-template-vorschau.txt')
|
||||
);
|
||||
}
|
||||
|
||||
private function getExportTemplateASV()
|
||||
{
|
||||
return preg_replace("/\r|\n/", "",
|
||||
file_get_contents(APPLICATION_PATH . '/export-asv.txt')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private function getGastSchueler(Registrierung $registrierung)
|
||||
{
|
||||
$schueler = $registrierung->getSchueler();
|
||||
$ausbildung = $schueler->getAusbildung();
|
||||
|
||||
$ausbArt = $registrierung->getTyp();
|
||||
|
||||
//Umschueler koennen die Schule frei waehlen, alle anderen sind ohne Ausbildungsbetrieb (Jungarbeiter + BGJs)
|
||||
if ($ausbArt == 'UM') {
|
||||
return 'U';
|
||||
}
|
||||
|
||||
$gemeindeSchluessel = $ausbildung->getBetrieb()->getGemeindeschluessel();
|
||||
|
||||
$B_GKennz1 = substr($gemeindeSchluessel, 0, 1); //erste Zahl der Gemeindekennzahl des Betriebes
|
||||
$B_GKennz3 = substr($gemeindeSchluessel, 0, 3); //ersten drei Zahlen der Gemeindekennzahl des Betriebes
|
||||
$klasse3 = substr($ausbildung->getBeruf()->getKlasse(), 0, 3);
|
||||
|
||||
switch ($klasse3) {
|
||||
case "EIE": //ganz Franken 4xxxxx - 6xxxxx
|
||||
if ($B_GKennz1 == '4' or $B_GKennz1 == '5' or $B_GKennz1 == '6')
|
||||
$GASTSCHUELER = 'S';
|
||||
else $GASTSCHUELER = '';
|
||||
break;
|
||||
case "BFT": //ganz Bayern 1xxxxx - 7xxxxx
|
||||
if ($B_GKennz1 == '1' or $B_GKennz1 == '2' or $B_GKennz1 == '3' or $B_GKennz1 == '4' or
|
||||
$B_GKennz1 == '5' or $B_GKennz1 == '6' or $B_GKennz1 == '7')
|
||||
$GASTSCHUELER = 'S';
|
||||
else $GASTSCHUELER = '';
|
||||
break;
|
||||
case "IIK":
|
||||
case "ITK":
|
||||
case "ITE":
|
||||
case "XFG": //ganz OFR 4xxxxx
|
||||
if ($B_GKennz1 == '4')
|
||||
$GASTSCHUELER = 'S';
|
||||
else $GASTSCHUELER = '';
|
||||
break;
|
||||
case "IFI":
|
||||
case "EME": //OFR-Ost Hof-Landkreis+Stadt, Kulmbach, Wunsiedel
|
||||
if ($B_GKennz3 == "475" or $B_GKennz3 == "464" or $B_GKennz3 == "477" or $B_GKennz3 == "479")
|
||||
$GASTSCHUELER = 'S';
|
||||
else $GASTSCHUELER = '';
|
||||
break;
|
||||
case "FML":
|
||||
case "KFR": //Kulmbach
|
||||
if ($B_GKennz3 == '477')
|
||||
$GASTSCHUELER = 'S';
|
||||
else $GASTSCHUELER = '';
|
||||
break;
|
||||
case "MKF":
|
||||
case "ETE":
|
||||
case "MFT":
|
||||
case "MIT":
|
||||
case "NBA":
|
||||
case "NFN":
|
||||
$GASTSCHUELER = ''; //falls diese Berufe hier auftauchen, sind sie falsch oder Gastschueler!!
|
||||
break;
|
||||
default: //alle Klassen, die oben noch nicht aufgefuehrt wurden - sollte nicht zur Anwendung kommen
|
||||
$GASTSCHUELER = '';
|
||||
break;
|
||||
}
|
||||
|
||||
return $GASTSCHUELER;
|
||||
}
|
||||
|
||||
private function getSchulPflicht(Schueler $schueler)
|
||||
{
|
||||
$schulbesuche = $schueler->getSchulbesuche();
|
||||
$jahre = 0;
|
||||
|
||||
foreach ($schulbesuche as $schulbesuch) {
|
||||
$jahre += (intval($schulbesuch->getAustritt()->format('Y'))
|
||||
- intval($schulbesuch->getEintritt()->format('Y')));
|
||||
}
|
||||
|
||||
return $jahre >= 12 ? 'J' : 'N';
|
||||
}
|
||||
|
||||
private function getAusbildungDauer(\DateTimeInterface $ende, \DateTimeInterface $beginn)
|
||||
{
|
||||
$dayDiff = $ende->diff($beginn)->days;
|
||||
$jahre = $dayDiff / 365;
|
||||
|
||||
//runden auf halbe jahre
|
||||
return floor($jahre * 2) / 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
47
src/Controller/AdminRegistrationsControllers.php
Normal file
47
src/Controller/AdminRegistrationsControllers.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Registrierung;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/admin')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
class AdminRegistrationsControllers extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/registrations', name: 'admin_registrations')]
|
||||
public function index(ManagerRegistry $doctrine)
|
||||
{
|
||||
|
||||
$registrations = $doctrine->getRepository(Registrierung::class)->findForExport();
|
||||
|
||||
return $this->render('admin_registrations/index.html.twig', [
|
||||
'controller_name' => 'AdminRegistrationController',
|
||||
'registrations' => $registrations
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Registrierung $registrierung
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/registration/{id}', name: 'registration_delete', methods: 'DELETE')]
|
||||
public function delete(Request $request, Registrierung $registrierung, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$registrierung->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($registrierung);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('admin');
|
||||
}
|
||||
|
||||
}
|
||||
88
src/Controller/AllgemeinController.php
Normal file
88
src/Controller/AllgemeinController.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Registrierung;
|
||||
use App\Form\AllgemeinType;
|
||||
use DateTime;
|
||||
use http\Env;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* Class AllgemeinController
|
||||
* @package App\Controller
|
||||
*/
|
||||
#[Route(path: '/allgemein')]
|
||||
class AllgemeinController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
#[Route(path: '/', name: 'allgemein_new')]
|
||||
public function new(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
$data = [];
|
||||
if(!empty($session->get('registrierung')->getEintrittAm())) {
|
||||
$data[] = $session->get('registrierung')->getEintrittAm();
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getWohnheim())) {
|
||||
$data[] = $session->get('registrierung')->getWohnheim();
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getMitteilung())) {
|
||||
$data[] = $session->get('registrierung')->getMitteilung();
|
||||
}
|
||||
|
||||
$form = $this->createForm(AllgemeinType::class, $data);
|
||||
$form->handleRequest($request);
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
/** @var Registrierung $registrierung */
|
||||
$registrierung = $session->get('registrierung');
|
||||
$registrierung->setWohnheim($data['wohnheim']);
|
||||
$registrierung->setMitteilung($data['mitteilung']);
|
||||
$datumErsteHaelfte = new DateTime(getenv('EINTRITTSDATUM_ERSTE_HAELFTE'));
|
||||
$datumZweiteHaelfte = new DateTime(getenv('EINTRITTSDATUM_ZWEITE_HAELFTE'));
|
||||
$heute = new DateTime();
|
||||
if($heute < $datumErsteHaelfte)
|
||||
$registrierung->setEintrittAm($datumErsteHaelfte);
|
||||
else
|
||||
$registrierung->setEintrittAm($datumZweiteHaelfte);
|
||||
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
return $this->render('allgemein/new.html.twig', [
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/update', name: 'allgemein_update')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
$session = $request->getSession();
|
||||
$registrierung = $session->get('registrierung');
|
||||
$form = $this->createForm(AllgemeinType::class, $registrierung);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$session->set('registrierung', $form->getData());
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('allgemein/update.html.twig', [
|
||||
'registrierung' => $registrierung,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
185
src/Controller/AnmeldungController.php
Normal file
185
src/Controller/AnmeldungController.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Beruf;
|
||||
use App\Entity\Betrieb;
|
||||
use App\Entity\Registrierung;
|
||||
use App\Entity\Schule;
|
||||
use App\Form\StartType;
|
||||
use App\Entity\Schueler;
|
||||
use DateTime;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Exception;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
class AnmeldungController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route('/', name: 'anmeldung_start', priority: 5)]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
if ($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
$session = new Session();
|
||||
}
|
||||
|
||||
|
||||
if ($session->has('registrierung')) {
|
||||
$registrierung = $session->get('registrierung');
|
||||
} else {
|
||||
$schueler = new Schueler();
|
||||
$registrierung = new Registrierung();
|
||||
$registrierung->setSchueler($schueler);
|
||||
$registrierung->setIp($request->getClientIp());
|
||||
$registrierung->setDatum(new DateTime());
|
||||
}
|
||||
|
||||
$form = $this->createForm(StartType::class, $registrierung);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$registrierung = $form->getData();
|
||||
$session->set('registrierung', $registrierung);
|
||||
switch ($registrierung->getTyp()) {
|
||||
case "AUAU":
|
||||
case "EQ":
|
||||
return $this->redirectToRoute('ausbildung_new');
|
||||
case "UM":
|
||||
return $this->redirectToRoute('umschueler_new');
|
||||
case "BIK":
|
||||
return $this->redirectToRoute('fluechtling_new');
|
||||
default:
|
||||
return $this->redirectToRoute('schueler_new');
|
||||
}
|
||||
}
|
||||
return $this->render('anmeldung/start.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/daten-pruefen', name: 'daten_pruefen')]
|
||||
public function check(Request $request)
|
||||
{
|
||||
//TODO sessionhandling ähnlich wie bei AnmeldungController-new
|
||||
//TODO sessionhandling in Filter auslagern, oder zumindest in eine einfache Funktion?!
|
||||
// https://symfony.com/doc/current/event_dispatcher/before_after_filters.html
|
||||
$session = $request->getSession();
|
||||
if(!$session->has('registrierung')) {
|
||||
$session->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
/** @var Registrierung $registrierung */
|
||||
$registrierung = $session->get('registrierung');
|
||||
$schueler = $registrierung->getSchueler();
|
||||
$ausbildung = $schueler->getAusbildung();
|
||||
$kontaktpersonen = $schueler->getKontaktpersonen();
|
||||
$fluechtling = $schueler->getFluechtling();
|
||||
$umschueler = $schueler->getUmschueler();
|
||||
$schulbesuche = $registrierung->getSchueler()->getSchulbesuche();
|
||||
if ($registrierung->getTyp()== 'BGJH') {
|
||||
$klasse = 'HTE10n';
|
||||
}elseif ($registrierung->getTyp()== 'BGJZ') {
|
||||
$klasse = 'BZI10n';
|
||||
}elseif ($registrierung->getTyp()=='BIK') {
|
||||
$klasse = 'BIKV10n';
|
||||
} else{
|
||||
$beruf = $ausbildung->getBeruf();
|
||||
$klasse = $beruf->getKlasse();
|
||||
}
|
||||
$vorname = mb_substr($schueler->getVorname(), 0, 3);
|
||||
$nachname = mb_substr($schueler->getNachname(), 0, 3);
|
||||
$untisbenutzer = $vorname.$nachname.$schueler->getGeburtsdatum()->format('Ymd');
|
||||
$unitspasswort = $schueler->getGeburtsdatum()->format('Ymd');
|
||||
|
||||
$templateOptions = [
|
||||
'registrierung' => $registrierung,
|
||||
'kontaktpersonen' => $kontaktpersonen,
|
||||
'fluechtling' => $fluechtling,
|
||||
'umschueler' => $umschueler,
|
||||
'schulbesuche' => $schulbesuche,
|
||||
'schueler' => $schueler,
|
||||
'ausbildung' => $ausbildung,
|
||||
'klasse' => $klasse,
|
||||
'untisbenutzer' => $untisbenutzer,
|
||||
'untispasswort' => $unitspasswort,
|
||||
];
|
||||
return $this->render('anmeldung/check.html.twig', $templateOptions);
|
||||
}
|
||||
|
||||
|
||||
#[Route('/beenden', name: 'anmeldung_beenden')]
|
||||
public function beenden(Request $request, ManagerRegistry $doctrine)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
//TODO sicherstellen, dass man vorher auf den 'Abschliessen'-Button gedrueckt hat
|
||||
|
||||
$em = $doctrine->getManager();
|
||||
$registrierung = $session->get('registrierung');
|
||||
$schueler = $registrierung->getSchueler();
|
||||
if(!empty($schueler->getAusbildung())) {
|
||||
// Handle Ausbildung-Entity related stuff
|
||||
$ausbildung = $schueler->getAusbildung();
|
||||
$beruf = $doctrine->getRepository(Beruf::class)->find($ausbildung->getBeruf()->getId());
|
||||
$betrieb = $ausbildung->getBetrieb();
|
||||
if(empty($betrieb->getId())) {
|
||||
// new betrieb, let's persist it!
|
||||
$doctrine->getManager()->persist($betrieb);
|
||||
} else {
|
||||
// betrieb is canned, so search for it again and reassign it, because doctrine is really strange
|
||||
$betrieb = $doctrine->getRepository(Betrieb::class)->find($betrieb->getId());
|
||||
}
|
||||
|
||||
$ausbildung->setBeruf($beruf);
|
||||
$ausbildung->setBetrieb($betrieb);
|
||||
$schueler->setAusbildung($ausbildung);
|
||||
}
|
||||
$schulbesuche = $registrierung->getSchueler()->getSchulbesuche();
|
||||
|
||||
foreach ($schulbesuche as $schulbesuch) {
|
||||
if(empty($schulbesuch->getSchule()->getId())) {
|
||||
// New Schule added, let's persist it!
|
||||
$em->persist($schulbesuch->getSchule());
|
||||
} else {
|
||||
// Schule is canned, so search for it again and reassign it
|
||||
|
||||
// First, let's remove the "old" schulbesuch from schueler
|
||||
$registrierung->getSchueler()->removeSchulbesuch($schulbesuch);
|
||||
// Then, let's search 'n' replace
|
||||
$schule = $doctrine->getRepository(Schule::class)->find($schulbesuch->getSchule()->getId());
|
||||
$schulbesuch->setSchule($schule);
|
||||
// Last, re-add schulbesuch to schueler
|
||||
$registrierung->getSchueler()->addSchulbesuch($schulbesuch);
|
||||
}
|
||||
}
|
||||
$registrierung->setSchueler($schueler);
|
||||
|
||||
$em->persist($registrierung);
|
||||
$em->flush();
|
||||
|
||||
|
||||
|
||||
//$session->invalidate();
|
||||
|
||||
return $this->redirectToRoute('mailer');
|
||||
|
||||
//return $this->render('anmeldung/beendet.html.twig');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
138
src/Controller/AusbildungController.php
Normal file
138
src/Controller/AusbildungController.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Ausbildung;
|
||||
use App\Entity\Beruf;
|
||||
use App\Entity\Betrieb;
|
||||
use App\Form\AusbildungType;
|
||||
use App\Repository\BetriebRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* Class AusbildungController
|
||||
* @package App\Controller
|
||||
*/
|
||||
#[Route(path: '/ausbildung')]
|
||||
class AusbildungController extends AbstractController
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param BetriebRepository $betriebRepository
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse|Response
|
||||
*/
|
||||
#[Route(path: '/', name: 'ausbildung_new')]
|
||||
public function new(Request $request, BetriebRepository $betriebRepository, ManagerRegistry $doctrine)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getAusbildung())) {
|
||||
$ausbildung = $session->get('registrierung')->getSchueler()->getAusbildung();
|
||||
if(!empty($ausbildung->getBetrieb())) {
|
||||
$doctrine->getManager()->persist($ausbildung->getBetrieb());
|
||||
}
|
||||
if(!empty($ausbildung->getBeruf())) {
|
||||
$doctrine->getManager()->persist($ausbildung->getBeruf());
|
||||
}
|
||||
} else {
|
||||
$ausbildung = new Ausbildung();
|
||||
}
|
||||
$betriebe[] = $betriebRepository->findAllVerified();
|
||||
|
||||
if($session->has('betrieb')) {
|
||||
$betriebNeu = $session->get('betrieb');
|
||||
$doctrine->getManager()->persist($betriebNeu);
|
||||
$betriebe[] = $betriebNeu;
|
||||
} else {
|
||||
$betriebNeu = null;
|
||||
}
|
||||
|
||||
|
||||
$form = $this->createForm(AusbildungType::class, $ausbildung, ['betriebe' => $betriebe, 'betriebNeu' => $betriebNeu]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$this->saveToSession($form->getData(), $session);
|
||||
return $this->redirectToRoute('schueler_new');
|
||||
}
|
||||
return $this->render('ausbildung/new.html.twig', [
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'ausbildung_update', methods: 'GET|POST')]
|
||||
public function update(Request $request, ManagerRegistry $doctrine)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getAusbildung())) {
|
||||
$ausbildung = $session->get('registrierung')->getSchueler()->getAusbildung();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
$session->set('update', true);
|
||||
|
||||
$beruf = $doctrine->getRepository(Beruf::class)->find($ausbildung->getBeruf()->getId());
|
||||
$betriebe[] = $doctrine->getRepository(Betrieb::class)->findAllVerified();
|
||||
$betrieb = $ausbildung->getBetrieb();
|
||||
if($session->has('betrieb')) {
|
||||
$betrieb = $session->get('betrieb');
|
||||
}
|
||||
if(empty($betrieb->getId())) {
|
||||
$doctrine->getManager()->persist($betrieb);
|
||||
} else {
|
||||
$betrieb = $doctrine->getRepository(Betrieb::class)->find($betrieb->getId());
|
||||
}
|
||||
$betriebe[] = $betrieb;
|
||||
$ausbildung->setBetrieb($betrieb);
|
||||
$ausbildung->setBeruf($beruf);
|
||||
$form = $this->createForm(AusbildungType::class, $ausbildung, ['betriebe' => $betriebe, 'betriebNeu' => $betrieb]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->saveToSession($form->getData(), $session);
|
||||
$session->remove('update');
|
||||
$session->remove('betrieb');
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('ausbildung/update.html.twig', [
|
||||
'ausbildung' => $ausbildung,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function saveToSession(Ausbildung $ausbildung, Session $session): void {
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
$schueler->setAusbildung($ausbildung);
|
||||
$session->get('registrierung')->setSchueler($schueler);
|
||||
}
|
||||
}
|
||||
87
src/Controller/BerufController.php
Normal file
87
src/Controller/BerufController.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Beruf;
|
||||
use App\Form\BerufType;
|
||||
use App\Repository\BerufRepository;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/beruf')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
class BerufController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'beruf_index', methods: ['GET'])]
|
||||
public function index(BerufRepository $berufRepository): Response
|
||||
{
|
||||
return $this->render('beruf/index.html.twig', [
|
||||
'berufs' => $berufRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/new', name: 'beruf_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$beruf = new Beruf();
|
||||
$form = $this->createForm(BerufType::class, $beruf);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager = $doctrine->getManager();
|
||||
$entityManager->persist($beruf);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('beruf_index');
|
||||
}
|
||||
|
||||
return $this->render('beruf/new.html.twig', [
|
||||
'beruf' => $beruf,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'beruf_show', methods: ['GET'])]
|
||||
public function show(Beruf $beruf): Response
|
||||
{
|
||||
return $this->render('beruf/show.html.twig', [
|
||||
'beruf' => $beruf,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'beruf_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Beruf $beruf, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(BerufType::class, $beruf);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('beruf_index', [
|
||||
'id' => $beruf->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->render('beruf/edit.html.twig', [
|
||||
'beruf' => $beruf,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'beruf_delete', methods: ['DELETE'])]
|
||||
public function delete(Request $request, Beruf $beruf, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$beruf->getId(), $request->request->get('_token'))) {
|
||||
$entityManager = $doctrine->getManager();
|
||||
$entityManager->remove($beruf);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('beruf_index');
|
||||
}
|
||||
}
|
||||
230
src/Controller/BetriebController.php
Normal file
230
src/Controller/BetriebController.php
Normal file
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Betrieb;
|
||||
use App\Form\BetriebType;
|
||||
use App\Form\BetriebAdminType;
|
||||
use App\Repository\BetriebRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/betrieb')]
|
||||
class BetriebController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/index', name: 'betrieb_index', methods: 'GET')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function index(BetriebRepository $betriebRepository): Response
|
||||
{
|
||||
return $this->render('betrieb/index.html.twig', ['betriebs' => $betriebRepository->findAll()]);
|
||||
}
|
||||
|
||||
#[Route(path: '/neu', name: 'betrieb_ausbildung')]
|
||||
#[Route(path: '/new', name: 'betrieb_new', methods: ['GET', 'POST'])]
|
||||
public function betriebNeu(Request $request) {
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
if($session->has('betrieb')) {
|
||||
$betrieb = $session->get('betrieb');
|
||||
} else {
|
||||
$betrieb = new Betrieb();
|
||||
}
|
||||
|
||||
$form = $this->createForm(BetriebType::class, $betrieb);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$betrieb = $form->getData();
|
||||
$betrieb->setIstVerifiziert(false);
|
||||
$betrieb->setASVImport(false);
|
||||
$session->set('betrieb', $betrieb);
|
||||
|
||||
if($session->has('update') && $session->get('update') == true) {
|
||||
return $this->redirectToRoute('ausbildung_update');
|
||||
} else {
|
||||
return $this->redirectToRoute('ausbildung_new');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('betrieb/new.html.twig', [
|
||||
'betrieb' => $betrieb,
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/adminupdate', name: 'betrieb_admin_update', methods: 'GET|POST')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function adminUpdate(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('admin');
|
||||
}
|
||||
$betrieb = new Betrieb();
|
||||
$form = $this->createForm(BetriebAdminType::class, $betrieb);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$betrieb = $form->getData();
|
||||
$session->get('registrierung')->getSchueler()->getAusbildung()->setBetrieb($betrieb);
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('betrieb/update_verifiziert.html.twig', [
|
||||
'betrieb' => $betrieb,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'betrieb_update', methods: 'GET|POST')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(empty($session->get('registrierung')->getSchueler()->getAusbildung()->getBetrieb()->getId())) {
|
||||
$betrieb = $session->get('registrierung')->getSchueler()->getAusbildung()->getBetrieb();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
$form = $this->createForm(BetriebType::class, $betrieb);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$betrieb = $form->getData();
|
||||
$betrieb->setIstVerifiziert(false);
|
||||
$session->get('registrierung')->getSchueler()->getAusbildung()->setBetrieb($betrieb);
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('betrieb/update.html.twig', [
|
||||
'betrieb' => $betrieb,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
#[Route(path: '/{id}', name: 'betrieb_nichtverifiziert_admin_show', methods: 'GET')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function adminNotVerifiedShow(Betrieb $betrieb): Response
|
||||
{
|
||||
return $this->render('betrieb/_nichtverifiziert_admin_show.html.twig', ['betrieb' => $betrieb]);
|
||||
}
|
||||
|
||||
|
||||
#[Route(path: '/{id}', name: 'betrieb_admin_show', methods: 'GET')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function adminShow(Betrieb $betrieb): Response
|
||||
{
|
||||
return $this->render('betrieb/_admin_show.html.twig', ['betrieb' => $betrieb]);
|
||||
}
|
||||
|
||||
|
||||
#[Route(path: '/{id}', name: 'betrieb_show', methods: 'GET')]
|
||||
public function show(Betrieb $betrieb): Response
|
||||
{
|
||||
return $this->render('betrieb/_show.html.twig', ['betrieb' => $betrieb]);
|
||||
}
|
||||
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'betrieb_nichtverifiziert_edit', methods: 'GET|POST')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function notVerifiedEdit(Request $request, Betrieb $betrieb, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(BetriebAdminType::class, $betrieb);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('betrieb_nichtverifiziert_edit', ['id' => $betrieb->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('betrieb/_nichtverifiziert_edit.html.twig', [
|
||||
'betrieb' => $betrieb,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'betrieb_edit', methods: 'GET|POST')]
|
||||
public function edit(Request $request, Betrieb $betrieb, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(BetriebType::class, $betrieb);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('betrieb_edit', ['id' => $betrieb->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('betrieb/edit.html.twig', [
|
||||
'betrieb' => $betrieb,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'betrieb_delete', methods: 'DELETE')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function delete(Request $request, Betrieb $betrieb, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$betrieb->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($betrieb);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('betrieb_index');
|
||||
}
|
||||
|
||||
|
||||
#[Route(name: 'betrieb_showNotVerified', methods: 'GET')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function showNotVerified(BetriebRepository $betriebRepository): Response
|
||||
{
|
||||
return $this->render('betrieb/_admin_nicht_verifiziert.html.twig', ['betriebs' => $betriebRepository->findAllNotVerified()]);
|
||||
}
|
||||
|
||||
#[Route(path: '/showImportInASV', name: 'betrieb_showImportInASV', methods: 'GET')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
public function showImportInASV(BetriebRepository $betriebRepository): Response
|
||||
{
|
||||
return $this->render('betrieb/_admin_import_in_asv.html.twig', ['betriebs' => $betriebRepository->findAllToImportInASV()]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
73
src/Controller/EintrittsdatumController.php
Normal file
73
src/Controller/EintrittsdatumController.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Form\EintrittsdatumType;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
#[Route(path: '/eintrittsdatum')]
|
||||
#[IsGranted("ROLE_ADMIN")]
|
||||
class EintrittsdatumController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'eintrittsdatum')]
|
||||
public function index(): Response
|
||||
{
|
||||
$eintrittErsteHaelfte = $_ENV['EINTRITTSDATUM_ERSTE_HAELFTE'];
|
||||
$eintrittZweiteHaelfte = $_ENV['EINTRITTSDATUM_ZWEITE_HAELFTE'];
|
||||
$wechselNklassenImportklassen = $_ENV['WECHSEL_NKLASSEN_IMPORTKLASSE'];
|
||||
return $this->render('eintrittsdatum/index.html.twig', [
|
||||
'ersteHaelfte' => $eintrittErsteHaelfte,
|
||||
'zweiteHaelfte' => $eintrittZweiteHaelfte,
|
||||
'wechselImportNKlassen' => $wechselNklassenImportklassen
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
#[Route(path: '/edit', name: 'eintrittsdatum_edit')]
|
||||
public function edit(Request $request): Response
|
||||
{
|
||||
$form = $this->createForm(EintrittsdatumType::class);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->changeEnv('EINTRITTSDATUM_ERSTE_HAELFTE', $form->get('ersteHaelfte')->getViewData());
|
||||
$this->changeEnv('EINTRITTSDATUM_ZWEITE_HAELFTE', $form->get('zweiteHaelfte')->getViewData());
|
||||
$this->changeEnv('WECHSEL_NKLASSEN_IMPORTKLASSE', $form->get('wechselImportNKlassen')->getViewData());
|
||||
|
||||
return $this->redirectToRoute('eintrittsdatum');
|
||||
}
|
||||
|
||||
return $this->render('eintrittsdatum/edit.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function changeEnv($key,$value): void
|
||||
{
|
||||
$path = APPLICATION_PATH . '/.env';
|
||||
|
||||
if(is_bool($_ENV[$key]))
|
||||
{
|
||||
$old = $_ENV[$key]? 'true' : 'false';
|
||||
}
|
||||
elseif($_ENV[$key]===null){
|
||||
$old = 'null';
|
||||
}
|
||||
else{
|
||||
$old = $_ENV[$key];
|
||||
}
|
||||
|
||||
if (file_exists($path)) {
|
||||
file_put_contents($path, str_replace(
|
||||
"$key=".$old, "$key=".$value, file_get_contents($path)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
132
src/Controller/FluechtlingController.php
Normal file
132
src/Controller/FluechtlingController.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Fluechtling;
|
||||
use App\Form\FluechtlingType;
|
||||
use App\Repository\FluechtlingRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/fluechtling')]
|
||||
class FluechtlingController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/index', name: 'fluechtling_index', methods: 'GET')]
|
||||
public function view(FluechtlingRepository $fluechtlingRepository): Response
|
||||
{
|
||||
return $this->render('fluechtling/index.html.twig', ['fluechtlings' => $fluechtlingRepository->findAll()]);
|
||||
}
|
||||
|
||||
#[Route(path: '/', name: 'fluechtling_new', methods: 'GET|POST')]
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getFluechtling())) {
|
||||
$fluechtling = $session->get('registrierung')->getSchueler()->getFluechtling();
|
||||
} else {
|
||||
$fluechtling = new Fluechtling();
|
||||
}
|
||||
|
||||
$form = $this->createForm(FluechtlingType::class, $fluechtling);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$fluechtling = $form->getData();
|
||||
|
||||
$fluechtling->setSchueler($session->get('registrierung')->getSchueler());
|
||||
$session->get('registrierung')->getSchueler()->setFluechtling($fluechtling);
|
||||
|
||||
return $this->redirectToRoute('schueler_new');
|
||||
}
|
||||
|
||||
return $this->render('fluechtling/new.html.twig', [
|
||||
'fluechtling' => $fluechtling,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'fluechtling_update', methods: 'GET|POST')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getFluechtling())) {
|
||||
$fluechtling = $session->get('registrierung')->getSchueler()->getFluechtling();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$form = $this->createForm(FluechtlingType::class, $fluechtling);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->getSchueler()->setFluechtling($form->getData());
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('fluechtling/update.html.twig', [
|
||||
'fluechtling' => $fluechtling,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'fluechtling_show', methods: 'GET')]
|
||||
public function show(Fluechtling $fluechtling): Response
|
||||
{
|
||||
return $this->render('fluechtling/show.html.twig', ['fluechtling' => $fluechtling]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'fluechtling_edit', methods: 'GET|POST')]
|
||||
public function edit(Request $request, Fluechtling $fluechtling, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(FluechtlingType::class, $fluechtling);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
|
||||
return $this->redirectToRoute('fluechtling_edit', ['id' => $fluechtling->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('fluechtling/edit.html.twig', [
|
||||
'fluechtling' => $fluechtling,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'fluechtling_delete', methods: 'DELETE')]
|
||||
public function delete(Request $request, Fluechtling $fluechtling, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$fluechtling->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($fluechtling);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('fluechtling_index');
|
||||
}
|
||||
}
|
||||
103
src/Controller/KontaktpersonController.php
Normal file
103
src/Controller/KontaktpersonController.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Kontaktperson;
|
||||
use App\Entity\Schueler;
|
||||
use App\Form\KontaktpersonType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Validator\Constraints\Date;
|
||||
|
||||
#[Route(path: '/kontaktperson')]
|
||||
class KontaktpersonController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'kontaktperson_index', methods: ['GET'])]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
$heute = new \DateTime('now');
|
||||
$geburtstag = $schueler->getGeburtsdatum();
|
||||
$alter = $geburtstag->diff($heute)->format('%y');
|
||||
$minderjaehrig = $alter<18?true:false;
|
||||
return $this->render('kontaktperson/index.html.twig', [
|
||||
'kontaktpeople' => $schueler->getKontaktpersonen(),
|
||||
'minderjaehrig' => $minderjaehrig,
|
||||
'alter' => $alter
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/neu', name: 'kontaktperson_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
|
||||
$kontaktperson = new Kontaktperson();
|
||||
$form = $this->createForm(KontaktpersonType::class, $kontaktperson);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$kontaktperson = $form->getData();
|
||||
if($kontaktperson->getArt() == "ET") {
|
||||
if($kontaktperson->getAnrede() == "H") {
|
||||
$kontaktperson->setArt("VA");
|
||||
} elseif ($kontaktperson->getAnrede() == "F") {
|
||||
$kontaktperson->setArt("MU");
|
||||
}
|
||||
}
|
||||
$session->get('registrierung')->getSchueler()->addKontaktperson($kontaktperson);
|
||||
|
||||
return $this->redirectToRoute('kontaktperson_index');
|
||||
}
|
||||
|
||||
return $this->render('kontaktperson/new.html.twig', [
|
||||
'kontaktperson' => $kontaktperson,
|
||||
'form' => $form->createView(),
|
||||
'buttonPath' => 'kontaktperson_index'
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/update', name: 'kontaktperson_update', methods: ['GET', 'POST'])]
|
||||
public function update(Request $request): Response
|
||||
{
|
||||
$session = $request->getSession();
|
||||
$kontaktperson = new Kontaktperson();
|
||||
$form = $this->createForm(KontaktpersonType::class, $kontaktperson);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$kontaktperson = $form->getData();
|
||||
/*if($kontaktperson->getArt() == "ET") {
|
||||
if($kontaktperson->getAnrede() == "H") {
|
||||
$kontaktperson->setArt("VA");
|
||||
} elseif ($kontaktperson->getAnrede() == "F") {
|
||||
$kontaktperson->setArt("MU");
|
||||
}
|
||||
}*/
|
||||
$session->get('registrierung')->getSchueler()->addKontaktperson($kontaktperson);
|
||||
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('kontaktperson/new.html.twig', [
|
||||
'kontaktperson' => $kontaktperson,
|
||||
'form' => $form->createView(),
|
||||
'buttonPath' => 'daten_pruefen'
|
||||
]);
|
||||
}
|
||||
}
|
||||
192
src/Controller/MailerController.php
Normal file
192
src/Controller/MailerController.php
Normal file
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use DateTime;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use Dompdf\Dompdf;
|
||||
use Dompdf\Options;
|
||||
|
||||
require __DIR__.'/../../vendor/autoload.php';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class MailerController
|
||||
*/
|
||||
#[Route(path: '/')]
|
||||
class MailerController extends AbstractController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return string
|
||||
*/
|
||||
#[Route(path: '/mailer', name: 'mailer')]
|
||||
public function sendEmail(MailerInterface $mailer, Request $request)
|
||||
{
|
||||
|
||||
$session = $request->getSession();
|
||||
if(!$session->has('registrierung')) {
|
||||
$session->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
/** @var Registrierung $registrierung */
|
||||
$registrierung = $session->get('registrierung');
|
||||
$regtype = $registrierung->getTyp();
|
||||
$schueler = $registrierung->getSchueler();
|
||||
$ausbildung = $schueler->getAusbildung();
|
||||
$kontaktpersonen = $schueler->getKontaktpersonen();
|
||||
$fluechtling = $schueler->getFluechtling();
|
||||
$umschueler = $schueler->getUmschueler();
|
||||
$schulbesuche = $registrierung->getSchueler()->getSchulbesuche();
|
||||
if ($registrierung->getTyp()== 'BGJH') {
|
||||
$klasse = 'HTE10n';
|
||||
}elseif ($registrierung->getTyp()== 'BGJZ') {
|
||||
$klasse = 'BZI10n';
|
||||
}elseif ($registrierung->getTyp()=='BIK') {
|
||||
$klasse = 'BIKV10n';
|
||||
} else{
|
||||
$beruf = $ausbildung->getBeruf();
|
||||
$klasse = $beruf->getKlasse();
|
||||
}
|
||||
$vorname = mb_substr($schueler->getVorname(), 0, 3);
|
||||
$nachname = mb_substr($schueler->getNachname(), 0, 3);
|
||||
$untisbenutzer = $vorname.$nachname.$schueler->getGeburtsdatum()->format('Ymd');
|
||||
$untispasswort = $schueler->getGeburtsdatum()->format('Ymd');
|
||||
|
||||
|
||||
|
||||
//HTML-Mail für PHP-Mailer und DOM-PDF erzeugen
|
||||
$templateOptions = [
|
||||
'registrierung' => $registrierung,
|
||||
'kontaktpersonen' => $kontaktpersonen,
|
||||
'fluechtling' => $fluechtling,
|
||||
'umschueler' => $umschueler,
|
||||
'schulbesuche' => $schulbesuche,
|
||||
'schueler' => $schueler,
|
||||
'ausbildung' => $ausbildung,
|
||||
'klasse' => $klasse,
|
||||
'untisbenutzer' => $untisbenutzer,
|
||||
'untispasswort' => $untispasswort,
|
||||
];
|
||||
$htmlMail = $this->renderView('mailer/mail.html.twig', $templateOptions);
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
//Server settings
|
||||
$mail->isSMTP(); // Send using SMTP
|
||||
$mail->Host = $_ENV['MAIL_HOST']; // Set the SMTP server to send through
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $_ENV['MAIL_USERNAME']; // SMTP username
|
||||
$mail->Password = $_ENV['MAIL_PASSWORD']; // SMTP password
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
|
||||
$mail->Port = $_ENV['MAIL_PORT']; // TCP port to connect to
|
||||
|
||||
$mail->setFrom($_ENV['MAIL_SENT_FROM_ADDRESS'], $_ENV['MAIL_SENT_FROM_NAME']);
|
||||
|
||||
$mail->addAddress($schueler->getEmail()); // Email Schüler
|
||||
if ($regtype == 'BIK' or $regtype == 'BGJZ' or $regtype == 'BGJH') {
|
||||
} else{
|
||||
$mail->addCC($ausbildung->getAusbilderemail());
|
||||
}
|
||||
$mail->isHTML(true);
|
||||
$mail->CharSet ="UTF-8";
|
||||
$mail->Subject = 'Online-Anmeldung Staatl. Berufsschule I Bayreuth';
|
||||
$mail->Body = $htmlMail;
|
||||
$mail->send();
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo 'Message could not be sent.';
|
||||
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Bestätigungs-PDF generieren.
|
||||
//https://ourcodeworld.com/articles/read/799/how-to-create-a-pdf-from-html-in-symfony-4-using-dompdf
|
||||
// Configure Dompdf according to your needs
|
||||
$pdfOptions = new Options();
|
||||
$pdfOptions -> set('defaultFont', 'Arial');
|
||||
|
||||
// Instantiate Dompdf with our options
|
||||
$dompdf = new Dompdf($pdfOptions);
|
||||
|
||||
// Retrieve the HTML generated in our twig file
|
||||
//$html = $this->renderView('default/mypdf.html.twig', [
|
||||
// 'title' => "Welcome to our PDF Test"
|
||||
//]);
|
||||
|
||||
// Load HTML to Dompdf
|
||||
$dompdf->loadHtml($htmlMail);
|
||||
|
||||
// (Optional) Setup the paper size and orientation 'portrait' or 'portrait'
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
|
||||
// Render the HTML as PDF
|
||||
$dompdf->render();
|
||||
|
||||
// Output the generated PDF to Browser (force download)
|
||||
$output = $dompdf->output();
|
||||
$now = new DateTime();
|
||||
//$filename = "./pdfdownload/AnmeldungBS1BT-".$untispasswort."-".$now->format('UY-m-dHis').".pdf";
|
||||
$dir = $this->getParameter('dir.downloads');
|
||||
$filename = $dir . "/bestaetigungen/AnmeldungBS1BT-".$untispasswort."-".$now->format('UY-m-dHis').".pdf";
|
||||
file_put_contents($filename, $output);
|
||||
|
||||
|
||||
|
||||
|
||||
//// Terminierung der Session und Anzeige der letzen Seite mit Link zum Download der Bestätigung
|
||||
if ($regtype == 'BIK' or $regtype == 'BGJZ' or $regtype == 'BGJH') {
|
||||
$templateOptions = [
|
||||
'pdffile' => $filename,
|
||||
'emailschueler' => $schueler-> getEmail(),
|
||||
'emailausbilder' => NULL,
|
||||
'bestaetigungpath' => $filename,
|
||||
];
|
||||
} else{
|
||||
$templateOptions = [
|
||||
'pdffile' => $filename,
|
||||
'emailschueler' => $schueler-> getEmail(),
|
||||
'emailausbilder' => $ausbildung-> getAusbilderemail(),
|
||||
'bestaetigungpath' => $filename,
|
||||
];
|
||||
}
|
||||
$session->invalidate();
|
||||
return $this->render('anmeldung/beendet.html.twig', $templateOptions);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @throws Exception
|
||||
* @return BinaryFileResponse
|
||||
*/
|
||||
#[Route(path: '/bestaetigung', name: 'bestaetigung')]
|
||||
public function bestaetigungDownload(Request $request) {
|
||||
$bestaetigungPath = $request->query->get('bestaetigungpath');
|
||||
return $this->file($bestaetigungPath);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
155
src/Controller/MigrationController.php
Normal file
155
src/Controller/MigrationController.php
Normal file
@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Beruf;
|
||||
use App\Entity\Betrieb;
|
||||
use App\Entity\Schule;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/migration')]
|
||||
class MigrationController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/berufe')]
|
||||
public function berufe(ManagerRegistry $doctrine)
|
||||
{
|
||||
$path = APPLICATION_PATH . '/berufekennungen.json';
|
||||
|
||||
$entries = self::parseFile($path);
|
||||
|
||||
$entityManager = $doctrine->getManager();
|
||||
$migrationCount = 0;
|
||||
foreach ($entries as $entry)
|
||||
{
|
||||
$item = json_decode($entry, true);
|
||||
|
||||
$beruf = new Beruf();
|
||||
$beruf->setBezeichnung($item['AB_BEZEICHNG']);
|
||||
$beruf->setNummer($item['AB_NR']);
|
||||
$beruf->setKlasse($item['Klasse']);
|
||||
$entityManager->persist($beruf);
|
||||
|
||||
$migrationCount++;
|
||||
}
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->render('migration/index.html.twig', [
|
||||
'tabelle' => 'berufe',
|
||||
'count' => $migrationCount
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/betriebe')]
|
||||
public function betriebe(ManagerRegistry $doctrine)
|
||||
{
|
||||
$path = APPLICATION_PATH . '/betriebedaten.json';
|
||||
|
||||
$entries = self::parseFile($path);
|
||||
|
||||
$entityManager = $doctrine->getManager();
|
||||
$migrationCount = 0;
|
||||
foreach ($entries as $entry)
|
||||
{
|
||||
$item = json_decode($entry, true);
|
||||
|
||||
$betrieb = new Betrieb();
|
||||
$betrieb
|
||||
->setName($item['name1'] . ' ' . $item['name2'] . ' ' . $item['name3'] . ' ' . $item['name4'])
|
||||
->setStrasse($item['strasse'])
|
||||
->setHsnr($item['hausnummer'])
|
||||
->setPlz($item['postleitzahl'])
|
||||
->setOrt($item['ortsbezeichnung'])
|
||||
->setTelZentrale($item['telNummer'])
|
||||
->setTelDurchwahl($item['mobilNummer'])
|
||||
->setFax($item['faxNummer'])
|
||||
->setEmail($item['emailAdresse'])
|
||||
->setGemeindeschluessel($item['gkz'])
|
||||
->setKuerzel($item['kuerzel'])
|
||||
->setIstVerifiziert(1)
|
||||
->setAsvImport(1);
|
||||
/*
|
||||
->setName($item['B_NAME1'] . ' ' . $item['B_NAME2'])
|
||||
->setStrasse($item['B_STRASSE'])
|
||||
->setPlz($item['B_PLZ'])
|
||||
->setOrt($item['B_ORT'])
|
||||
->setTelZentrale($item['B_TELEFON1'])
|
||||
->setTelDurchwahl($item['B_TELEFON2'])
|
||||
->setFax($item['B_TELEFON3'])
|
||||
->setEmail($item['B_E_MAIL'])
|
||||
->setGemeindeschluessel($item['B_GEMEINDEKZ'])
|
||||
->setKammer($item['B_BBIG'])
|
||||
->setAnsprPartner($item['B_NAME4'])
|
||||
->setKuerzel($item['B_SCHLUESSEL'])
|
||||
->setIstVerifiziert(true);
|
||||
*/
|
||||
$entityManager->persist($betrieb);
|
||||
|
||||
$migrationCount++;
|
||||
}
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->render('migration/index.html.twig', [
|
||||
'tabelle' => 'betriebe',
|
||||
'count' => $migrationCount
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/schulen')]
|
||||
public function schulen(ManagerRegistry $doctrine)
|
||||
{
|
||||
$path = APPLICATION_PATH . '/herkunftsschulen.json';
|
||||
|
||||
$entries = self::parseFile($path);
|
||||
|
||||
$entityManager = $doctrine->getManager();
|
||||
$migrationCount = 0;
|
||||
foreach ($entries as $entry)
|
||||
{
|
||||
$item = json_decode($entry, true);
|
||||
|
||||
$schule = new Schule();
|
||||
$schule
|
||||
->setNummer($item['HKS_NUMMER'])
|
||||
->setName($item['HKS_NAME'])
|
||||
->setStrasse($item['HKS_STRASSE'])
|
||||
->setPlz($item['HKS_PLZ'])
|
||||
->setOrt($item['HKS_ORT'])
|
||||
->setArt('noch nicht definiert')
|
||||
->setIstVerifiziert(true);
|
||||
|
||||
$entityManager->persist($schule);
|
||||
$migrationCount++;
|
||||
}
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->render('migration/index.html.twig', [
|
||||
'tabelle' => 'schulen',
|
||||
'count' => $migrationCount
|
||||
]);
|
||||
}
|
||||
|
||||
private static function parseFile($path)
|
||||
{
|
||||
$content = file_get_contents($path);
|
||||
|
||||
// Der Export ist kein valides JSON, deshalb das komplizierte Parsing.
|
||||
$entries = explode('}', $content);
|
||||
|
||||
// 1. entry
|
||||
$entries[0] = $entries[0] . '}';
|
||||
$entries[0] = substr($entries[0], 1);
|
||||
|
||||
// other entries
|
||||
for($i = 1; $i < sizeof($entries); $i++) {
|
||||
$entries[$i] = substr($entries[$i], 1);
|
||||
$entries[$i] = $entries[$i] . '}';
|
||||
}
|
||||
|
||||
// last element is only a square bracket
|
||||
array_pop($entries);
|
||||
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
101
src/Controller/RegistrierungController.php
Normal file
101
src/Controller/RegistrierungController.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Registrierung;
|
||||
use App\Form\RegistrierungType;
|
||||
use App\Repository\RegistrierungRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/registrierung')]
|
||||
class RegistrierungController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'registrierung_index', methods: 'GET')]
|
||||
public function index(RegistrierungRepository $registrierungRepository): Response
|
||||
{
|
||||
return $this->render('registrierung/index.html.twig', ['registrierungs' => $registrierungRepository->findAll()]);
|
||||
}
|
||||
|
||||
#[Route(path: '/new', name: 'registrierung_new', methods: 'GET|POST')]
|
||||
public function new(Request $request, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$registrierung = new Registrierung();
|
||||
$form = $this->createForm(RegistrierungType::class, $registrierung);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->persist($registrierung);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('registrierung_index');
|
||||
}
|
||||
|
||||
return $this->render('registrierung/new.html.twig', [
|
||||
'registrierung' => $registrierung,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'registrierung_update', methods: 'GET|POST')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
$session = $request->getSession();
|
||||
$registrierung = $session->get('registrierung');
|
||||
$form = $this->createForm(RegistrierungType::class, $registrierung);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('registrierung/update.html.twig', [
|
||||
'registrierung' => $registrierung,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'registrierung_show', methods: 'GET')]
|
||||
public function show(Registrierung $registrierung): Response
|
||||
{
|
||||
return $this->render('registrierung/show.html.twig', ['registrierung' => $registrierung]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'registrierung_edit', methods: 'GET|POST')]
|
||||
public function edit(Request $request, Registrierung $registrierung, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(RegistrierungType::class, $registrierung);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('registrierung_edit', ['id' => $registrierung->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('registrierung/edit.html.twig', [
|
||||
'registrierung' => $registrierung,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'registrierung_delete', methods: 'DELETE')]
|
||||
public function delete(Request $request, Registrierung $registrierung, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$registrierung->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($registrierung);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('registrierung_index');
|
||||
}
|
||||
}
|
||||
124
src/Controller/SchuelerController.php
Normal file
124
src/Controller/SchuelerController.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Schueler;
|
||||
use App\Form\SchuelerType;
|
||||
use App\Repository\SchuelerRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/schueler')]
|
||||
class SchuelerController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/view', name: 'schueler_view', methods: 'GET')]
|
||||
public function view(SchuelerRepository $schuelerRepository): Response
|
||||
{
|
||||
return $this->render('schueler/index.html.twig', ['schuelers' => $schuelerRepository->findAll()]);
|
||||
}
|
||||
|
||||
#[Route(path: '/', name: 'schueler_new', methods: 'GET|POST')]
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getSchueler())) {
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
} else {
|
||||
$schueler = new Schueler();
|
||||
}
|
||||
$form = $this->createForm(SchuelerType::class, $schueler);
|
||||
$form->handleRequest($request);
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$schueler = $form->getData();
|
||||
|
||||
$session->get('registrierung')->setSchueler($schueler);
|
||||
return $this->redirectToRoute('kontaktperson_index');
|
||||
}
|
||||
return $this->render('schueler/new.html.twig', [
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'schueler_update', methods: 'GET|POST')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getSchueler())) {
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$form = $this->createForm(SchuelerType::class, $schueler);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->setSchueler($form->getData());
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
|
||||
return $this->render('schueler/update.html.twig', [
|
||||
'schueler' => $schueler,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'schueler_show', methods: 'GET')]
|
||||
public function show(Schueler $schueler): Response
|
||||
{
|
||||
return $this->render('schueler/show.html.twig', ['schueler' => $schueler]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'schueler_edit', methods: 'GET|POST')]
|
||||
public function edit(Request $request, Schueler $schueler, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(SchuelerType::class, $schueler);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('schueler_edit', ['id' => $schueler->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('schueler/edit.html.twig', [
|
||||
'schueler' => $schueler,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'schueler_delete', methods: 'DELETE')]
|
||||
public function delete(Request $request, Schueler $schueler, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$schueler->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($schueler);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('schueler_index');
|
||||
}
|
||||
}
|
||||
104
src/Controller/SchulbesuchController.php
Normal file
104
src/Controller/SchulbesuchController.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Schulbesuch;
|
||||
use App\Entity\Schule;
|
||||
use App\Form\SchulbesuchType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/schulbesuch')]
|
||||
class SchulbesuchController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/neu', name: 'schulbesuch_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$schulen[] = $this->getVerified($doctrine);
|
||||
$schulbesuch = new Schulbesuch();
|
||||
if($session->has('schule')) {
|
||||
$schule = $session->get('schule');
|
||||
$schulen[] = $schule;
|
||||
$doctrine->getManager()->persist($schule);
|
||||
} else {
|
||||
$schule = null;
|
||||
}
|
||||
|
||||
$form = $this->createForm(SchulbesuchType::class, $schulbesuch, ['schulen' => $schulen, 'schule' => $schule]);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$schulbesuch = $form->getData();
|
||||
if($session->has('schule')) {
|
||||
$schulbesuch->setSchule($session->get('schule'));
|
||||
$session->remove('schule');
|
||||
}
|
||||
$session->get('registrierung')->getSchueler()->addSchulbesuch($form->getData());
|
||||
|
||||
return $this->redirectToRoute('vorbildung_index');
|
||||
}
|
||||
|
||||
return $this->render('schulbesuch/new.html.twig', [
|
||||
'schulbesuch' => $schulbesuch,
|
||||
'form' => $form->createView(),
|
||||
'buttonPath' => 'vorbildung_index'
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/update', name: 'schulbesuch_update', methods: ['GET', 'POST'])]
|
||||
public function update(Request $request, ManagerRegistry $doctrine): Response {
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$schulbesuch = new Schulbesuch();
|
||||
$session->set('update', true);
|
||||
$schulen[] = $this->getVerified($doctrine);
|
||||
if($session->has('schule')) {
|
||||
$schule = $session->get('schule');
|
||||
$doctrine->getManager()->persist($schule);
|
||||
$schulen[] = $schule;
|
||||
} else {
|
||||
$schule = null;
|
||||
}
|
||||
$form = $this->createForm(SchulbesuchType::class, new Schulbesuch(), [
|
||||
'schule' => $schule,
|
||||
'schulen' => $schulen
|
||||
]);
|
||||
$form->handleRequest($request);
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$schulbesuch = $form->getData();
|
||||
if($session->has('schule')) {
|
||||
$schulbesuch->setSchule($session->get('schule'));
|
||||
$session->remove('schule');
|
||||
}
|
||||
$session->remove('update');
|
||||
$session->get('registrierung')->getSchueler()->addSchulbesuch($schulbesuch);
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
return $this->render('schulbesuch/new.html.twig', [
|
||||
'schulbesuch' => $schulbesuch,
|
||||
'form' => $form->createView(),
|
||||
'buttonPath' => 'daten_pruefen'
|
||||
]);
|
||||
}
|
||||
|
||||
private function getVerified(ManagerRegistry $doctrine) {
|
||||
return $doctrine->getRepository(Schule::class)->findAllVerified();
|
||||
}
|
||||
}
|
||||
95
src/Controller/SchuleController.php
Normal file
95
src/Controller/SchuleController.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Schule;
|
||||
use App\Form\SchuleType;
|
||||
use App\Repository\SchuleRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/schule')]
|
||||
class SchuleController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'schule_index', methods: ['GET'])]
|
||||
public function index(SchuleRepository $schuleRepository): Response
|
||||
{
|
||||
return $this->render('schule/index.html.twig', [
|
||||
'schules' => $schuleRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/neu', name: 'schule_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$schule = new Schule();
|
||||
$form = $this->createForm(SchuleType::class, $schule);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$schule = $form->getData();
|
||||
$schule->setIstVerifiziert(false);
|
||||
$session->set('schule', $schule);
|
||||
if($session->has('update')) {
|
||||
return $this->redirectToRoute('schulbesuch_update');
|
||||
} else {
|
||||
return $this->redirectToRoute('schulbesuch_new');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('schule/new.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'schule_show', methods: ['GET'])]
|
||||
public function show(Schule $schule): Response
|
||||
{
|
||||
return $this->render('schule/show.html.twig', [
|
||||
'schule' => $schule,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}/edit', name: 'schule_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Schule $schule, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(SchuleType::class, $schule);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('schule_index', [
|
||||
'id' => $schule->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->render('schule/edit.html.twig', [
|
||||
'schule' => $schule,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{id}', name: 'schule_delete', methods: ['DELETE'])]
|
||||
public function delete(Request $request, Schule $schule, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$schule->getId(), $request->request->get('_token'))) {
|
||||
$entityManager = $doctrine->getManager();
|
||||
$entityManager->remove($schule);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('schule_index');
|
||||
}
|
||||
}
|
||||
111
src/Controller/UmschuelerController.php
Normal file
111
src/Controller/UmschuelerController.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Umschueler;
|
||||
use App\Form\UmschuelerType;
|
||||
use App\Repository\UmschuelerRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
#[Route(path: '/umschueler')]
|
||||
class UmschuelerController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/index', name: 'umschueler_index', methods: 'GET')]
|
||||
public function view(UmschuelerRepository $umschuelerRepository): Response
|
||||
{
|
||||
return $this->render('umschueler/index.html.twig', ['umschuelers' => $umschuelerRepository->findAll()]);
|
||||
}
|
||||
#[Route(path: '/', name: 'umschueler_new', methods: 'GET|POST')]
|
||||
public function new(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getUmschueler())) {
|
||||
$umschueler = $session->get('registrierung')->getSchueler()->getUmschueler();
|
||||
} else {
|
||||
$umschueler = new Umschueler();
|
||||
}
|
||||
|
||||
$form = $this->createForm(UmschuelerType::class, $umschueler);
|
||||
$form->handleRequest($request);
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->getSchueler()->setUmschueler($umschueler);
|
||||
//return $this->redirectToRoute('schueler_new');
|
||||
return $this->redirectToRoute('ausbildung_new');
|
||||
}
|
||||
return $this->render('umschueler/new.html.twig', [
|
||||
'form' => $form->createView()
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/update', name: 'umschueler_update', methods: 'GET|POST')]
|
||||
public function update(Request $request)
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getSchueler()->getUmschueler())) {
|
||||
$umschueler = $session->get('registrierung')->getSchueler()->getUmschueler();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$form = $this->createForm(UmschuelerType::class, $umschueler);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->getSchueler()->setUmschueler($form->getData());
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
return $this->render('umschueler/update.html.twig', [
|
||||
'umschueler' => $umschueler,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/{id}', name: 'umschueler_show', methods: 'GET')]
|
||||
public function show(Umschueler $umschueler): Response
|
||||
{
|
||||
return $this->render('umschueler/show.html.twig', ['umschueler' => $umschueler]);
|
||||
}
|
||||
#[Route(path: '/{id}/edit', name: 'umschueler_edit', methods: 'GET|POST')]
|
||||
public function edit(Request $request, Umschueler $umschueler, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
$form = $this->createForm(UmschuelerType::class, $umschueler);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$doctrine->getManager()->flush();
|
||||
return $this->redirectToRoute('umschueler_edit', ['id' => $umschueler->getId()]);
|
||||
}
|
||||
return $this->render('umschueler/edit.html.twig', [
|
||||
'umschueler' => $umschueler,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/{id}', name: 'umschueler_delete', methods: 'DELETE')]
|
||||
public function delete(Request $request, Umschueler $umschueler, ManagerRegistry $doctrine): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$umschueler->getId(), $request->request->get('_token'))) {
|
||||
$em = $doctrine->getManager();
|
||||
$em->remove($umschueler);
|
||||
$em->flush();
|
||||
}
|
||||
return $this->redirectToRoute('umschueler_view');
|
||||
}
|
||||
}
|
||||
68
src/Controller/VorbildungController.php
Normal file
68
src/Controller/VorbildungController.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Form\VorbildungType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
#[Route(path: '/vorbildung')]
|
||||
class VorbildungController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'vorbildung_index', methods: ['GET|POST'])]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
$form = $this->createForm(VorbildungType::class, $schueler);
|
||||
$form->handleRequest($request);
|
||||
if($form->get('save')->isClicked() || $form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->setSchueler($form->getData());
|
||||
|
||||
return $this->redirectToRoute('allgemein_new');
|
||||
}
|
||||
return $this->render('vorbildung/index.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'schulbesuche' => $session->get('registrierung')->getSchueler()->getSchulbesuche(),
|
||||
]);
|
||||
}
|
||||
#[Route(path: '/update', name: 'vorbildung_update', methods: ['GET|POST'])]
|
||||
public function update(Request $request): Response
|
||||
{
|
||||
if($request->hasSession() && $request->getSession()->has('registrierung')) {
|
||||
$session = $request->getSession();
|
||||
} else {
|
||||
if($request->hasSession()) {
|
||||
$request->getSession()->invalidate();
|
||||
}
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
if(!empty($session->get('registrierung')->getSchueler())) {
|
||||
$schueler = $session->get('registrierung')->getSchueler();
|
||||
} else {
|
||||
$request->getSession()->invalidate();
|
||||
return $this->redirectToRoute('anmeldung_start');
|
||||
}
|
||||
$form = $this->createForm(VorbildungType::class, $schueler);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
$session->get('registrierung')->setSchueler($form->getData());
|
||||
|
||||
return $this->redirectToRoute('daten_pruefen');
|
||||
}
|
||||
return $this->render('vorbildung/update.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'schulbesuche' => $session->get('registrierung')->getSchueler()->getSchulbesuche(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
36
src/DataFixtures/AdminUserFixtures.php
Normal file
36
src/DataFixtures/AdminUserFixtures.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\AdminUser;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
|
||||
class AdminUserFixtures extends Fixture
|
||||
{
|
||||
|
||||
private $passwordEncoder;
|
||||
|
||||
public function __construct(UserPasswordHasherInterface $passwordEncoder)
|
||||
{
|
||||
$this->passwordEncoder = $passwordEncoder;
|
||||
}
|
||||
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
|
||||
$user = new AdminUser(1);
|
||||
$user->setEmail('admin@bs1-bt.de');
|
||||
$user->setRoles($user->getRoles());
|
||||
|
||||
$user->setPassword($this->passwordEncoder->hashPassword(
|
||||
$user, 'test123'
|
||||
));
|
||||
|
||||
$manager->persist($user);
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
17
src/DataFixtures/AppFixtures.php
Normal file
17
src/DataFixtures/AppFixtures.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class AppFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
// $product = new Product();
|
||||
// $manager->persist($product);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
0
src/Entity/.gitignore
vendored
Normal file
0
src/Entity/.gitignore
vendored
Normal file
108
src/Entity/AdminUser.php
Normal file
108
src/Entity/AdminUser.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\AdminUserRepository::class)]
|
||||
class AdminUser implements UserInterface,PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'email', type: 'string', length: 180, unique: true)]
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
#[ORM\Column(name: 'roles', type: 'string', nullable: true)]
|
||||
private $roles;
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
*/
|
||||
#[ORM\Column(type: 'string')]
|
||||
private $password;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A visual identifier that represents this user.
|
||||
*
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getUsername(): string
|
||||
{
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
return array('ROLE_USER', 'ROLE_ADMIN');
|
||||
}
|
||||
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = json_encode($roles);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getPassword(): string
|
||||
{
|
||||
return (string) $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): self
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUserIdentifier(): string {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getSalt(): void
|
||||
{
|
||||
// not needed when using the "bcrypt" algorithm in security.yaml
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// If you store any temporary, sensitive data on the user, clear it here
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
}
|
||||
118
src/Entity/Ausbildung.php
Normal file
118
src/Entity/Ausbildung.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'ausbildung')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\AusbildungRepository::class)]
|
||||
class Ausbildung
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $beginn;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $ende;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ausbilderemail;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Schueler::class, mappedBy: 'ausbildung', cascade: ['persist', 'remove'])]
|
||||
private $schueler;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\ManyToOne(targetEntity: \App\Entity\Betrieb::class, cascade: ['persist'])]
|
||||
private $betrieb;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\ManyToOne(targetEntity: \App\Entity\Beruf::class, cascade: ['persist'])]
|
||||
private $beruf;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getBeginn(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->beginn;
|
||||
}
|
||||
|
||||
public function setBeginn(\DateTimeInterface $beginn): self
|
||||
{
|
||||
$this->beginn = $beginn;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEnde(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->ende;
|
||||
}
|
||||
|
||||
public function setEnde(\DateTimeInterface $ende): self
|
||||
{
|
||||
$this->ende = $ende;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAusbilderemail(): ?string
|
||||
{
|
||||
return $this->ausbilderemail;
|
||||
}
|
||||
|
||||
public function setAusbilderemail(string $ausbilderemail): self
|
||||
{
|
||||
$this->ausbilderemail = $ausbilderemail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(?Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
// set (or unset) the owning side of the relation if necessary
|
||||
$newAusbildung = $schueler === null ? null : $this;
|
||||
if ($newAusbildung !== $schueler->getAusbildung()) {
|
||||
$schueler->setAusbildung($newAusbildung);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBetrieb(): ?Betrieb
|
||||
{
|
||||
return $this->betrieb;
|
||||
}
|
||||
|
||||
public function setBetrieb(?Betrieb $betrieb): self
|
||||
{
|
||||
$this->betrieb = $betrieb;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBeruf(): ?Beruf
|
||||
{
|
||||
return $this->beruf;
|
||||
}
|
||||
|
||||
public function setBeruf(?Beruf $beruf): self
|
||||
{
|
||||
$this->beruf = $beruf;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
72
src/Entity/Beruf.php
Normal file
72
src/Entity/Beruf.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'berufsdaten')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\BerufRepository::class)]
|
||||
class Beruf
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $bezeichnung;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $klasse;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $nummer;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getBezeichnung(): ?string
|
||||
{
|
||||
return $this->bezeichnung;
|
||||
}
|
||||
|
||||
public function setBezeichnung(string $bezeichnung): self
|
||||
{
|
||||
$this->bezeichnung = $bezeichnung;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getBezeichnung();
|
||||
}
|
||||
|
||||
public function getKlasse(): ?string
|
||||
{
|
||||
return $this->klasse;
|
||||
}
|
||||
|
||||
public function setKlasse(?string $klasse): self
|
||||
{
|
||||
$this->klasse = $klasse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNummer(): ?int
|
||||
{
|
||||
return $this->nummer;
|
||||
}
|
||||
|
||||
public function setNummer(int $nummer): self
|
||||
{
|
||||
$this->nummer = $nummer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
319
src/Entity/Betrieb.php
Normal file
319
src/Entity/Betrieb.php
Normal file
@ -0,0 +1,319 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use PhpParser\Node\Expr\Cast\String_;
|
||||
|
||||
#[ORM\Table(name: 'betriebedaten')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\BetriebRepository::class)]
|
||||
class Betrieb
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $name;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $ansprPartner;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $strasse;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 10)]
|
||||
private $hsnr;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
private $plz;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ort;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $telZentrale;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $telDurchwahl;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $fax;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $email;
|
||||
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => false])]
|
||||
private $istVerifiziert;
|
||||
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => false])]
|
||||
private $asv_import;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 8, nullable: true)]
|
||||
private $gemeindeschluessel;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $kammer;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $kuerzel = '';
|
||||
|
||||
private $kammerReadable = '';
|
||||
|
||||
private const KAMMERN = [
|
||||
'HWK Bayreuth' => 102,
|
||||
'IHK Bayreuth' => 153,
|
||||
'IHK Coburg' => 154,
|
||||
'IHK Aschaffenburg' => 151,
|
||||
'HWK Augsburg' => 101,
|
||||
'IHK Augsburg' => 152,
|
||||
'IHK Lindau' => 155,
|
||||
'IHK München' => 156,
|
||||
'HWK Nürnberg' => 105,
|
||||
'IHK Nürnberg' => 157,
|
||||
'HWK Passau' => 106,
|
||||
'IHK Passau' => 158,
|
||||
'HWK Regensburg' => 107,
|
||||
'IHK Regensburg' => 159,
|
||||
'HWK Würzburg' => 108,
|
||||
'IHK Würzburg-Schweinfurt' => 160,
|
||||
'sonstige' => 000,
|
||||
];
|
||||
|
||||
private const KAMMERNREAD = [
|
||||
102 => 'HWK Bayreuth',
|
||||
153 => 'IHK Bayreuth',
|
||||
154 => 'IHK Coburg',
|
||||
151 => 'IHK Aschaffenburg',
|
||||
101 => 'HWK Augsburg',
|
||||
152 => 'IHK Augsburg',
|
||||
155 => 'IHK Lindau',
|
||||
156 => 'IHK München',
|
||||
105 => 'HWK Nürnberg',
|
||||
157 => 'IHK Nürnberg',
|
||||
106 => 'HWK Passau',
|
||||
158 => 'IHK Passau',
|
||||
107 => 'HWK Regensburg',
|
||||
159 => 'IHK Regensburg',
|
||||
108 => 'HWK Würzburg',
|
||||
160 => 'IHK Würzburg-Schweinfurt',
|
||||
000 => 'sonstige',
|
||||
];
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAnsprPartner(): ?string
|
||||
{
|
||||
return $this->ansprPartner;
|
||||
}
|
||||
|
||||
public function setAnsprPartner(?string $ansprPartner): self
|
||||
{
|
||||
$this->ansprPartner = $ansprPartner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStrasse(): ?string
|
||||
{
|
||||
return $this->strasse;
|
||||
}
|
||||
|
||||
public function setStrasse(string $strasse): self
|
||||
{
|
||||
$this->strasse = $strasse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHsnr(): ?string
|
||||
{
|
||||
return $this->hsnr;
|
||||
}
|
||||
|
||||
public function setHsnr(string $hsnr): self
|
||||
{
|
||||
$this->hsnr = $hsnr;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlz(): ?string
|
||||
{
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
public function setPlz(string $plz): self
|
||||
{
|
||||
$this->plz = $plz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrt(): ?string
|
||||
{
|
||||
return $this->ort;
|
||||
}
|
||||
|
||||
public function setOrt(string $ort): self
|
||||
{
|
||||
$this->ort = $ort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTelZentrale(): ?string
|
||||
{
|
||||
return $this->telZentrale;
|
||||
}
|
||||
|
||||
public function setTelZentrale(string $telZentrale): self
|
||||
{
|
||||
$this->telZentrale = $telZentrale;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTelDurchwahl(): ?string
|
||||
{
|
||||
return $this->telDurchwahl;
|
||||
}
|
||||
|
||||
public function setTelDurchwahl(?string $telDurchwahl): self
|
||||
{
|
||||
$this->telDurchwahl = $telDurchwahl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFax(): ?string
|
||||
{
|
||||
return $this->fax;
|
||||
}
|
||||
|
||||
public function setFax(?string $fax): self
|
||||
{
|
||||
$this->fax = $fax;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIstVerifiziert(): ?bool
|
||||
{
|
||||
return $this->istVerifiziert;
|
||||
}
|
||||
|
||||
public function setIstVerifiziert(bool $istVerifiziert): self
|
||||
{
|
||||
$this->istVerifiziert = $istVerifiziert;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAsvImport(): ?bool
|
||||
{
|
||||
return $this->asv_import;
|
||||
}
|
||||
|
||||
public function setAsvImport(bool $asv_import): self
|
||||
{
|
||||
$this->asv_import = $asv_import;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGemeindeschluessel(): ?string
|
||||
{
|
||||
return $this->gemeindeschluessel;
|
||||
}
|
||||
|
||||
public function setGemeindeschluessel(string $gemeindeschluessel): self
|
||||
{
|
||||
$this->gemeindeschluessel = $gemeindeschluessel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getName() . ', ' . $this->getStrasse() .' ' . $this->getHsnr() ;
|
||||
}
|
||||
|
||||
public function getKammer(): ?int
|
||||
{
|
||||
return $this->kammer;
|
||||
}
|
||||
|
||||
public function getKammerReadable()
|
||||
{
|
||||
return $this->kammerReadable;
|
||||
}
|
||||
|
||||
public function getKammerText(int $kammerNr)
|
||||
{
|
||||
return self::KAMMERNREAD[$kammerNr];
|
||||
}
|
||||
|
||||
public static function getKammern()
|
||||
{
|
||||
return self::KAMMERN;
|
||||
}
|
||||
|
||||
private function setKammerReadable(int $kammer): void
|
||||
{
|
||||
$kammerReadable = array_search($kammer, self::KAMMERN);
|
||||
if($kammerReadable === false)
|
||||
$kammerReadable = 'Fehler';
|
||||
$this->kammerReadable = $kammerReadable;
|
||||
}
|
||||
|
||||
public function setKammer(int $kammer): self
|
||||
{
|
||||
$this->kammer = $kammer;
|
||||
$this->setKammerReadable($kammer);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getKuerzel(): ?string
|
||||
{
|
||||
return $this->kuerzel;
|
||||
}
|
||||
|
||||
public function setKuerzel(string $kuerzel): self
|
||||
{
|
||||
$this->kuerzel = $kuerzel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
103
src/Entity/Fluechtling.php
Normal file
103
src/Entity/Fluechtling.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use phpDocumentor\Reflection\Types\Integer;
|
||||
|
||||
#[ORM\Table(name: 'fluechtling')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\FluechtlingRepository::class)]
|
||||
class Fluechtling
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $anmeldeStelle;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ansprechPartner;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $tel;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Schueler::class, mappedBy: 'fluechtling', cascade: ['persist', 'remove'])]
|
||||
private $schueler;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $deutschKenntnis;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getAnmeldeStelle(): ?string
|
||||
{
|
||||
return $this->anmeldeStelle;
|
||||
}
|
||||
|
||||
public function setAnmeldeStelle(string $anmeldeStelle): self
|
||||
{
|
||||
$this->anmeldeStelle = $anmeldeStelle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAnsprechPartner(): ?string
|
||||
{
|
||||
return $this->ansprechPartner;
|
||||
}
|
||||
|
||||
public function setAnsprechPartner(string $ansprechPartner): self
|
||||
{
|
||||
$this->ansprechPartner = $ansprechPartner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTel(): ?string
|
||||
{
|
||||
return $this->tel;
|
||||
}
|
||||
|
||||
public function setTel(string $tel): self
|
||||
{
|
||||
$this->tel = $tel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(?Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
// set (or unset) the owning side of the relation if necessary
|
||||
$newFluechtlingDaten = $schueler === null ? null : $this;
|
||||
if ($newFluechtlingDaten !== $schueler->getFluechtling()) {
|
||||
$schueler->setFluechtling($newFluechtlingDaten);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDeutschKenntnis(): ?int
|
||||
{
|
||||
return $this->deutschKenntnis;
|
||||
}
|
||||
|
||||
public function setDeutschKenntnis(int $deutschKenntnis): self
|
||||
{
|
||||
$this->deutschKenntnis = $deutschKenntnis;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
186
src/Entity/Kontaktperson.php
Normal file
186
src/Entity/Kontaktperson.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'kontaktperson')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\KontaktpersonRepository::class)]
|
||||
class Kontaktperson
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 1)]
|
||||
private $anrede;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $vorname;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $nachname;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $strasse;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 10)]
|
||||
private $hausnummer;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
private $plz;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ort;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 30, nullable: true)]
|
||||
private $telefonnummer;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $email;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\ManyToOne(targetEntity: \App\Entity\Schueler::class, inversedBy: 'kontaktpersonen')]
|
||||
private $schueler;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 2)]
|
||||
private $art;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getAnrede(): ?string
|
||||
{
|
||||
return $this->anrede;
|
||||
}
|
||||
|
||||
public function setAnrede(string $anrede): self
|
||||
{
|
||||
$this->anrede = $anrede;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVorname(): ?string
|
||||
{
|
||||
return $this->vorname;
|
||||
}
|
||||
|
||||
public function setVorname(string $vorname): self
|
||||
{
|
||||
$this->vorname = $vorname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNachname(): ?string
|
||||
{
|
||||
return $this->nachname;
|
||||
}
|
||||
|
||||
public function setNachname(string $nachname): self
|
||||
{
|
||||
$this->nachname = $nachname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStrasse(): ?string
|
||||
{
|
||||
return $this->strasse;
|
||||
}
|
||||
|
||||
public function setStrasse(string $strasse): self
|
||||
{
|
||||
$this->strasse = $strasse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHausnummer(): ?string
|
||||
{
|
||||
return $this->hausnummer;
|
||||
}
|
||||
|
||||
public function setHausnummer(string $hausnummer): self
|
||||
{
|
||||
$this->hausnummer = $hausnummer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlz(): ?string
|
||||
{
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
public function setPlz(string $plz): self
|
||||
{
|
||||
$this->plz = $plz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrt(): ?string
|
||||
{
|
||||
return $this->ort;
|
||||
}
|
||||
|
||||
public function setOrt(string $ort): self
|
||||
{
|
||||
$this->ort = $ort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTelefonnummer(): ?string
|
||||
{
|
||||
return $this->telefonnummer;
|
||||
}
|
||||
|
||||
public function setTelefonnummer(?string $telefonnummer): self
|
||||
{
|
||||
$this->telefonnummer = $telefonnummer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(?string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(?Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getArt(): ?string
|
||||
{
|
||||
return $this->art;
|
||||
}
|
||||
|
||||
public function setArt(?string $art): self
|
||||
{
|
||||
$this->art = $art;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
195
src/Entity/Registrierung.php
Normal file
195
src/Entity/Registrierung.php
Normal file
@ -0,0 +1,195 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'registrierung')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\RegistrierungRepository::class)]
|
||||
class Registrierung
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'datetime')]
|
||||
private $datum;
|
||||
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
private $mitteilung;
|
||||
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
private $wohnheim;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $eintrittAm;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ip;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 4)]
|
||||
private $typ;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Schueler::class, inversedBy: 'registrierung', cascade: ['persist', 'remove'])]
|
||||
private $schueler;
|
||||
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
private $datenschutz;
|
||||
|
||||
#[ORM\Column(type: 'datetime', nullable: true)]
|
||||
private $exportedAt;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $schuljahr;
|
||||
|
||||
private const AUSBART = [
|
||||
'AUAU' => 'Ausbildung mit Ausbildungsvertrag',
|
||||
'EQ' => 'EQ-Maßnahme',
|
||||
'UM' => 'Umschüler mit Vertrag',
|
||||
'BGJH' => 'Berufsgrundschuljahr Bautechnik: Holztechnik (Schreiner/Holzmechaniker)',
|
||||
'BGJZ' => 'Berufsgrundschuljahr Bautechnik: Zimmerer',
|
||||
'OBA' => 'ohne Berufstätigkeit und arbeitslos',
|
||||
'UAR' => 'ungelernte Arbeitskräfte',
|
||||
'MF' => 'Mithelfende Familienangehörige',
|
||||
'AUPR' => 'Ausbildung mit Praktikumsvertrag',
|
||||
'BVJ' => 'Berufsvorbereitungsjahr',
|
||||
'BIK' => 'Klasse für Flüchtlinge und Asylbewerber',
|
||||
];
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getDatum(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->datum;
|
||||
}
|
||||
|
||||
public function setDatum(\DateTimeInterface $datum): self
|
||||
{
|
||||
$this->datum = $datum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMitteilung(): ?string
|
||||
{
|
||||
return $this->mitteilung;
|
||||
}
|
||||
|
||||
public function setMitteilung(?string $mitteilung): self
|
||||
{
|
||||
$this->mitteilung = $mitteilung;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWohnheim(): ?bool
|
||||
{
|
||||
return $this->wohnheim;
|
||||
}
|
||||
|
||||
public function setWohnheim(bool $wohnheim): self
|
||||
{
|
||||
$this->wohnheim = $wohnheim;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEintrittAm(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->eintrittAm;
|
||||
}
|
||||
|
||||
public function setEintrittAm(\DateTimeInterface $eintrittAm): self
|
||||
{
|
||||
$this->eintrittAm = $eintrittAm;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIp(): ?string
|
||||
{
|
||||
return $this->ip;
|
||||
}
|
||||
|
||||
public function setIp(string $ip): self
|
||||
{
|
||||
$this->ip = $ip;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTyp(): ?string
|
||||
{
|
||||
return $this->typ;
|
||||
}
|
||||
|
||||
public function getTypText(string $typ)
|
||||
{
|
||||
return self::AUSBART[$typ];
|
||||
}
|
||||
|
||||
public function setTyp(string $typ): self
|
||||
{
|
||||
$this->typ = $typ;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return (string)$this->getId();
|
||||
}
|
||||
|
||||
public function getDatenschutz(): ?bool
|
||||
{
|
||||
return $this->datenschutz;
|
||||
}
|
||||
|
||||
public function setDatenschutz(bool $datenschutz): self
|
||||
{
|
||||
$this->datenschutz = $datenschutz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getExportedAt(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->exportedAt;
|
||||
}
|
||||
|
||||
public function setExportedAt(?\DateTimeInterface $exportedAt): self
|
||||
{
|
||||
$this->exportedAt = $exportedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchuljahr(): ?string
|
||||
{
|
||||
return $this->schuljahr;
|
||||
}
|
||||
|
||||
public function setSchuljahr($schuljahr): self
|
||||
{
|
||||
$this->schuljahr = $schuljahr;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
666
src/Entity/Schueler.php
Normal file
666
src/Entity/Schueler.php
Normal file
@ -0,0 +1,666 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Intl\Countries;
|
||||
|
||||
#[ORM\Table(name: 'schueler')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\SchuelerRepository::class)]
|
||||
class Schueler
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $vorname;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $nachname;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $rufname;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $geburtsdatum;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $geburtsort;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: \App\Entity\Kontaktperson::class, mappedBy: 'schueler', orphanRemoval: true, cascade: ['persist', 'remove'])]
|
||||
private $kontaktpersonen;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: \App\Entity\Schulbesuch::class, mappedBy: 'schueler', orphanRemoval: true, cascade: ['persist', 'remove'])]
|
||||
private $schulbesuche;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Registrierung::class, mappedBy: 'schueler', cascade: ['persist', 'remove'])]
|
||||
private $registrierung;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Ausbildung::class, inversedBy: 'schueler', cascade: ['persist', 'remove'])]
|
||||
private $ausbildung;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Fluechtling::class, inversedBy: 'schueler', cascade: ['persist', 'remove'])]
|
||||
private $fluechtling;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Umschueler::class, inversedBy: 'schueler', cascade: ['persist', 'remove'])]
|
||||
private $umschueler;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 1)]
|
||||
private $geschlecht;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $strasse;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
private $hsnr;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
private $plz;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ort;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $tel;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $email;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $geburtsland;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $staatsangehoerigkeit;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $bekenntnis;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $letzteSchulart;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $hoechsterAbschluss;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $hoechAbschlAn;
|
||||
|
||||
#[ORM\Column(type: 'date', nullable: true)]
|
||||
private $zuzugAm;
|
||||
|
||||
#[ORM\Column(type: 'string', nullable: true, length: 255)]
|
||||
private $zuzugsart;
|
||||
|
||||
|
||||
private $geburtslandReadable;
|
||||
private $staatsangehoerigkeitReadable;
|
||||
private $laenderCodes = array("AF"=>"AFG","EG"=>"ET","AL"=>"AL","DZ"=>"DZ","AD"=>"AND","AO"=>"ANG","AQ"=>"ARK","AG"=>"AG","GQ"=>"GQ","SY"=>"SYR","AR"=>"RA","AM"=>"AM","AZ"=>"AZ","ET"=>"ETH","AU"=>"AUS","BS"=>"BS","BH"=>"BRN","BD"=>"BD","BB"=>"BDS","BE"=>"B","BZ"=>"BH","BJ"=>"DY","BT"=>"BHT","VE"=>"YV","BA"=>"BIH","BW"=>"BW","BR"=>"BR","BN"=>"BRU","BG"=>"BG","DE"=>"D","BF"=>"BF","BI"=>"RU","CV"=>"CV","CL"=>"RCH","CN"=>"RC","HK"=>"HKG","MO"=>"MAC","CK"=>"COI","CR"=>"CR","CI"=>"CI","DK"=>"DK","CD"=>"ZRE","KP"=>"NOK","LA"=>"LAO","DM"=>"WD","DO"=>"DOM","DJ"=>"DJI","EC"=>"EC","SV"=>"ES","ER"=>"ER","EE"=>"EST","SZ"=>"SD","FJ"=>"FJI","FI"=>"FIN","FM"=>"FSM","FR"=>"F","GA"=>"G","GM"=>"WAG","GE"=>"GE","GH"=>"GH","GI"=>"GBZ","GD"=>"WG","GR"=>"GR","GT"=>"GCA","GN"=>"RG","GW"=>"GUB","GY"=>"GUY","HT"=>"RH","HN"=>"HN","IN"=>"IND","ID"=>"RI","IQ"=>"IRQ","IE"=>"IRL","IR"=>"IR","IS"=>"IS","IL"=>"IL","IT"=>"I","JM"=>"JA","JP"=>"J","YE"=>"YAR","JO"=>"HKJ","KH"=>"K","CM"=>"CAM","CA"=>"CDN","KZ"=>"KZ","QA"=>"Q","KE"=>"EAK","KG"=>"KS","KI"=>"KIR","CO"=>"CO","KM"=>"COM","CG"=>"RCB","XK"=>"XK","HR"=>"HR","CU"=>"CU","KW"=>"KWT","LS"=>"LS","LV"=>"LV","LB"=>"RL","LR"=>"LB","LY"=>"LAR","LI"=>"FL","LT"=>"LT","LU"=>"L","MG"=>"RM","MW"=>"MW","MY"=>"MAL","MV"=>"MV","ML"=>"RMM","MT"=>"M","MA"=>"MA","MH"=>"MH","MR"=>"RIM","MU"=>"MS","MX"=>"MEX","MC"=>"MC","MN"=>"MGL","ME"=>"MNE","MZ"=>"MOC","MM"=>"BUR","NA"=>"NAM","NR"=>"NAU","NP"=>"NEP","NZ"=>"NZ","NI"=>"NIC","NL"=>"NL","NE"=>"RN","NG"=>"WAN","NU"=>"NIU","MK"=>"MK","NO"=>"N","OM"=>"OM","AT"=>"A","PK"=>"PK","PW"=>"PAL","PA"=>"PA","PG"=>"PNG","PY"=>"PY","PE"=>"PE","PH"=>"RP","BO"=>"BOL","PL"=>"PL","PT"=>"P","KR"=>"ROK","MD"=>"MD","RW"=>"RWA","RO"=>"RO","RU"=>"RUS","SB"=>"SOL","ZM"=>"RNR","WS"=>"WS","SM"=>"RSM","ST"=>"STP","SA"=>"SA","SE"=>"S","CH"=>"CH","SN"=>"SN","RS"=>"SRB","SC"=>"SY","SL"=>"WAL","ZW"=>"ZW","SG"=>"SGP","SK"=>"SK","SI"=>"SLO","SO"=>"SO","ES"=>"E","LK"=>"CL","KN"=>"KAN","LC"=>"WL","VC"=>"WV","ZA"=>"ZA","SD"=>"SUD","SS"=>"SSD","SR"=>"SME","TJ"=>"TJ","TW"=>"TWN","TH"=>"T","TL"=>"TL","TG"=>"TG","TO"=>"TON","TT"=>"TT","TD"=>"TD","CZ"=>"CZ","TN"=>"TN","TR"=>"TR","TM"=>"TM","TV"=>"TUV","UG"=>"EAU","UA"=>"UA","HU"=>"H","UY"=>"ROU","UZ"=>"UZ","VU"=>"VAN","VA"=>"SCV","AE"=>"UAE","TZ"=>"EAT","US"=>"USA","GB"=>"GB","VN"=>"VN","BY"=>"BY","CF"=>"RCA","CY"=>"CY");
|
||||
private $zuzugsartReadable;
|
||||
private $hoechsterAbschlussReadable;
|
||||
private $letzteSchulartReadable;
|
||||
private $hoechAbschlAnReadable;
|
||||
private $bekenntnisReadable;
|
||||
private const BEKENNTNISSE = [
|
||||
'römisch-katholisch' => 'RK',
|
||||
'evangelisch' => 'EV',
|
||||
'islamisch' => 'IL',
|
||||
'orthodox' => 'OX',
|
||||
'syrisch-orthodox' => 'SO',
|
||||
'alevitisch' => 'AL',
|
||||
'israelitisch' => 'IS',
|
||||
'neuapostolisch' => 'NA',
|
||||
'Sieben Tags-Adven.' => 'ST',
|
||||
'alt-katholisch' => 'AK',
|
||||
'sonstige' => 'SR',
|
||||
'ohne Religionszugehörigkeit' => 'OR'
|
||||
];
|
||||
private const LETZTE_SCHULARTEN = [
|
||||
'Mittelschule/Hauptschule' => 'MS',
|
||||
'Förderzentrum' => 'FZ',
|
||||
'Realschule' => 'RS',
|
||||
'Realschule z. sp. F.' => 'RSF',
|
||||
'Gymnasium' => 'GY',
|
||||
'Integrierte Gesamtschule' => 'IGS',
|
||||
'Freie Waldorfschule' => 'FWS',
|
||||
'Wirtschaftsschule' => 'WS',
|
||||
'Wirtschaftsschule z. sp. F.' => 'WSF',
|
||||
'Fachoberschule' => 'FOS',
|
||||
'Berufsoberschule' => 'BOS',
|
||||
'Berufsschule' => 'BS',
|
||||
'Berufsschule z. sp. F.' => 'BSF',
|
||||
'Berufsfachschule' => 'BFS',
|
||||
'Berufsfachschule Ges.W.' => 'BFG',
|
||||
'Fachschule' => 'FS',
|
||||
'Fachakademie' => 'FAK',
|
||||
'Abendrealschule' => 'ARS',
|
||||
'Abendgymnasium' => 'AGY',
|
||||
'Kolleg' => 'KOL',
|
||||
'andere Schulart' => 'AN',
|
||||
'Maßnahme Arbeitsverwaltung' => 'AV',
|
||||
'Zuzug Aussiedler' => 'AS',
|
||||
'Zuzug Ausländer' => 'AL',
|
||||
'keine Schule' => ''
|
||||
];
|
||||
|
||||
private const HOECHSTE_ABSCHLUESSE = [
|
||||
'erfüllte Schulpflicht ohne Abschluss' => 'OM',
|
||||
'Mittelschulabschluss ohne Quali' => 'MSOQ',
|
||||
'Qualifizierter Mittelschulabschluss' => 'QUAL',
|
||||
'mittlerer Schulabschluss' => 'M',
|
||||
'Fachhochschulreife' => 'FHSR',
|
||||
'Fachgebundene Fachhochschulreife' => 'F',
|
||||
'Allgemeine Hochschulreife' => 'A',
|
||||
'Fachgebundene Hochschulreife' => 'FGHS',
|
||||
'Abschluss Bildungsgang FS Lernen' => 'AL',
|
||||
'sonstiger Abschluss' => 'SONS'
|
||||
];
|
||||
private const HOECHSTE_ABSCHLUESSE_AN = [
|
||||
'Mittelschule/Hauptschule' => 'MS',
|
||||
'Realschule' => 'RS',
|
||||
'Wirtschaftsschule' => 'WS',
|
||||
'Gymnasium' => 'GY',
|
||||
'Berufsschule' => 'BS',
|
||||
'Fachoberschule' => 'FOS',
|
||||
'Berufsoberschule' => 'BOS',
|
||||
'Berufsfachschule Gesundheitsw.' => 'BFG',
|
||||
'Berufsfachschule' => 'BFS',
|
||||
'Berufsschule z. sp. F.' => 'BSF',
|
||||
'Fachakademie' => 'FAK',
|
||||
'Fachschule' => 'FS',
|
||||
'Freie Waldorfschule' => 'FWS',
|
||||
'Förderzentrum' => 'FZ',
|
||||
'Gymnasium z. sp. F.' => 'GYF',
|
||||
'Integrierte Gesamtschule' => 'IGS',
|
||||
'Realschule z. sp. F.' => 'RSF',
|
||||
'Begabtenprüfung (am StMUK)' => 'SNB_Begabt',
|
||||
'Telekolleg' => 'SNB_TelKol',
|
||||
'andere Schulart' => 'AN'
|
||||
];
|
||||
|
||||
private const ZUZUGSARTEN = [
|
||||
'Aussiedler' => 'AU',
|
||||
'Asylberechtigter' => 'AY',
|
||||
'Asylbewerber' => 'AYB',
|
||||
'Kriegsflüchtling' => 'KF',
|
||||
'Ausländer (nicht Asylbew.)' => 'AS',
|
||||
'sonstiger Zuzug' => 'SO'
|
||||
];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->kontaktpersonen = new ArrayCollection();
|
||||
$this->schulbesuche = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getVorname(): ?string
|
||||
{
|
||||
return $this->vorname;
|
||||
}
|
||||
|
||||
public function setVorname(string $vorname, bool $uppercase = true): self
|
||||
{
|
||||
if($uppercase)
|
||||
$this->vorname = ucwords($vorname);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNachname(): ?string
|
||||
{
|
||||
return $this->nachname;
|
||||
}
|
||||
|
||||
public function setNachname(string $nachname, bool $uppercase = true): self
|
||||
{
|
||||
if($uppercase)
|
||||
$this->nachname = ucwords($nachname);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRufname(): ?string
|
||||
{
|
||||
return $this->rufname;
|
||||
}
|
||||
|
||||
public function setRufname(string $rufname, bool $uppercase = true): self
|
||||
{
|
||||
if($uppercase)
|
||||
$this->rufname = ucwords($rufname);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGeburtsdatum(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->geburtsdatum;
|
||||
}
|
||||
|
||||
public function setGeburtsdatum(\DateTimeInterface $geburtsdatum): self
|
||||
{
|
||||
$this->geburtsdatum = $geburtsdatum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGeburtsort(): ?string
|
||||
{
|
||||
return $this->geburtsort;
|
||||
}
|
||||
|
||||
public function setGeburtsort(string $geburtsort): self
|
||||
{
|
||||
$this->geburtsort = $geburtsort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Kontaktperson[]
|
||||
*/
|
||||
public function getKontaktpersonen(): Collection
|
||||
{
|
||||
return $this->kontaktpersonen;
|
||||
}
|
||||
|
||||
public function addKontaktperson(Kontaktperson $kontaktperson): self
|
||||
{
|
||||
if (!$this->kontaktpersonen->contains($kontaktperson)) {
|
||||
$this->kontaktpersonen[] = $kontaktperson;
|
||||
$kontaktperson->setSchueler($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeKontaktperson(Kontaktperson $kontaktperson): self
|
||||
{
|
||||
if ($this->kontaktpersonen->contains($kontaktperson)) {
|
||||
$this->kontaktpersonen->removeElement($kontaktperson);
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($kontaktperson->getSchueler() === $this) {
|
||||
$kontaktperson->setSchueler(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Schulbesuch[]
|
||||
*/
|
||||
public function getSchulbesuche(): Collection
|
||||
{
|
||||
return $this->schulbesuche;
|
||||
}
|
||||
|
||||
public function addSchulbesuch(Schulbesuch $schulbesuch): self
|
||||
{
|
||||
if (!$this->schulbesuche->contains($schulbesuch)) {
|
||||
$this->schulbesuche[] = $schulbesuch;
|
||||
$schulbesuch->setSchueler($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSchulbesuch(Schulbesuch $schulbesuch): self
|
||||
{
|
||||
if ($this->schulbesuche->contains($schulbesuch)) {
|
||||
$this->schulbesuche->removeElement($schulbesuch);
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($schulbesuch->getSchueler() === $this) {
|
||||
$schulbesuch->setSchueler(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRegistrierung(): ?Registrierung
|
||||
{
|
||||
return $this->registrierung;
|
||||
}
|
||||
|
||||
public function setRegistrierung(Registrierung $registrierung): self
|
||||
{
|
||||
$this->registrierung = $registrierung;
|
||||
|
||||
// set the owning side of the relation if necessary
|
||||
if ($this !== $registrierung->getSchueler()) {
|
||||
$registrierung->setSchueler($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAusbildung(): ?Ausbildung
|
||||
{
|
||||
return $this->ausbildung;
|
||||
}
|
||||
|
||||
public function setAusbildung(?Ausbildung $ausbildung): self
|
||||
{
|
||||
$this->ausbildung = $ausbildung;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFluechtling(): ?Fluechtling
|
||||
{
|
||||
return $this->fluechtling;
|
||||
}
|
||||
|
||||
public function setFluechtling(?Fluechtling $fluechtling): self
|
||||
{
|
||||
$this->fluechtling = $fluechtling;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUmschueler(): ?Umschueler
|
||||
{
|
||||
return $this->umschueler;
|
||||
}
|
||||
|
||||
public function setUmschueler(?Umschueler $umschueler): self
|
||||
{
|
||||
$this->umschueler = $umschueler;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGeschlecht(): ?string
|
||||
{
|
||||
return $this->geschlecht;
|
||||
}
|
||||
|
||||
public function setGeschlecht(string $geschlecht): self
|
||||
{
|
||||
$this->geschlecht = $geschlecht;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStrasse(): ?string
|
||||
{
|
||||
return $this->strasse;
|
||||
}
|
||||
|
||||
public function setStrasse(string $strasse): self
|
||||
{
|
||||
$this->strasse = $strasse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHsnr(): ?string
|
||||
{
|
||||
return $this->hsnr;
|
||||
}
|
||||
|
||||
public function setHsnr(string $hsnr): self
|
||||
{
|
||||
$this->hsnr = $hsnr;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlz(): ?string
|
||||
{
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
public function setPlz(string $plz): self
|
||||
{
|
||||
$this->plz = $plz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrt(): ?string
|
||||
{
|
||||
return $this->ort;
|
||||
}
|
||||
|
||||
public function setOrt(string $ort): self
|
||||
{
|
||||
$this->ort = $ort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTel(): ?string
|
||||
{
|
||||
return $this->tel;
|
||||
}
|
||||
|
||||
public function setTel(string $tel): self
|
||||
{
|
||||
$this->tel = $tel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGeburtsland(): ?string
|
||||
{
|
||||
return $this->geburtsland;
|
||||
}
|
||||
|
||||
public function setGeburtsland(string $geburtsland): self
|
||||
{
|
||||
//$this->geburtsland = $geburtsland;
|
||||
if(array_key_exists($geburtsland, $this->laenderCodes)){
|
||||
$this->geburtsland = $this->laenderCodes[$geburtsland];
|
||||
$this->geburtslandReadable = Countries::getName($geburtsland);
|
||||
}else{
|
||||
$this->geburtsland = "U";
|
||||
$this->geburtslandReadable = "Ungeklärt";
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGeburtslandReadable()
|
||||
{
|
||||
return $this->geburtslandReadable;
|
||||
}
|
||||
|
||||
public function getStaatsangehoerigkeit(): ?string
|
||||
{
|
||||
return $this->staatsangehoerigkeit;
|
||||
}
|
||||
|
||||
public function setStaatsangehoerigkeit(string $staatsangehoerigkeit): self
|
||||
{
|
||||
//$this->staatsangehoerigkeit = $staatsangehoerigkeit;
|
||||
if(array_key_exists($staatsangehoerigkeit, $this->laenderCodes)){
|
||||
$this->staatsangehoerigkeit = $this->laenderCodes[$staatsangehoerigkeit];
|
||||
$this->staatsangehoerigkeitReadable = Countries::getName($staatsangehoerigkeit);
|
||||
}else{
|
||||
$this->staatsangehoerigkeit = "U";
|
||||
$this->staatsangehoerigkeitReadable = "Ungeklärt";
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStaatsangehoerigkeitReadable(): ?string
|
||||
{
|
||||
return $this->staatsangehoerigkeitReadable;
|
||||
}
|
||||
|
||||
public function getBekenntnis(): ?string
|
||||
{
|
||||
return $this->bekenntnis;
|
||||
}
|
||||
|
||||
public function getBekenntnisReadable(): ?string
|
||||
{
|
||||
return $this->bekenntnisReadable;
|
||||
|
||||
}
|
||||
|
||||
public function setBekenntnis(string $bekenntnis): self
|
||||
{
|
||||
$this->bekenntnis = $bekenntnis;
|
||||
|
||||
$bekenntnisReadable = array_search($bekenntnis, $this->getBekenntnisse());
|
||||
if($bekenntnisReadable === false)
|
||||
$bekenntnisReadable = 'Fehler';
|
||||
$this->bekenntnisReadable = $bekenntnisReadable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLetzteSchulart(): ?string
|
||||
{
|
||||
return $this->letzteSchulart;
|
||||
}
|
||||
|
||||
public function setLetzteSchulart(string $letzteSchulart): self
|
||||
{
|
||||
$this->letzteSchulart = $letzteSchulart;
|
||||
|
||||
$letzteSchulartReadable = array_search($letzteSchulart, self::LETZTE_SCHULARTEN);
|
||||
if($letzteSchulartReadable === false)
|
||||
$letzteSchulartReadable = 'Fehler';
|
||||
$this->letzteSchulartReadable = $letzteSchulartReadable;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLetzteSchulartReadable(): ?string
|
||||
{
|
||||
return $this->letzteSchulartReadable;
|
||||
}
|
||||
|
||||
public function getHoechsterAbschluss(): ?string
|
||||
{
|
||||
return $this->hoechsterAbschluss;
|
||||
}
|
||||
|
||||
public function setHoechsterAbschluss(string $hoechsterAbschluss): self
|
||||
{
|
||||
$this->hoechsterAbschluss = $hoechsterAbschluss;
|
||||
|
||||
$hoechsterAbschlussReadable = array_search($hoechsterAbschluss, self::HOECHSTE_ABSCHLUESSE);
|
||||
if($hoechsterAbschlussReadable === false)
|
||||
$hoechsterAbschlussReadable = 'Fehler';
|
||||
$this->hoechsterAbschlussReadable = $hoechsterAbschlussReadable;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHoechsterAbschlussReadable(): ?string
|
||||
{
|
||||
return $this->hoechsterAbschlussReadable;
|
||||
}
|
||||
|
||||
public function getHoechAbschlAn(): ?string
|
||||
{
|
||||
return $this->hoechAbschlAn;
|
||||
}
|
||||
|
||||
public function setHoechAbschlAn(string $hoechAbschlAn): self
|
||||
{
|
||||
$this->hoechAbschlAn = $hoechAbschlAn;
|
||||
|
||||
$hoechAbschlAnReadable = array_search($hoechAbschlAn, self::HOECHSTE_ABSCHLUESSE_AN);
|
||||
if($hoechAbschlAnReadable === false)
|
||||
$hoechAbschlAnReadable = 'Fehler';
|
||||
$this->hoechAbschlAnReadable = $hoechAbschlAnReadable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHoechAbschlAnReadable(): ?string
|
||||
{
|
||||
return $this->hoechAbschlAnReadable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getVorname() . ' ' . $this->getNachname();
|
||||
}
|
||||
|
||||
public function getZuzugAm(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->zuzugAm;
|
||||
}
|
||||
|
||||
public function setZuzugAm(?\DateTimeInterface $zuzugAm): self
|
||||
{
|
||||
$this->zuzugAm = $zuzugAm;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getZuzugsart(): ?string
|
||||
{
|
||||
return $this->zuzugsart;
|
||||
|
||||
}
|
||||
|
||||
public function getZuzugsartReadable(): ?string
|
||||
{
|
||||
return $this->zuzugsartReadable;
|
||||
|
||||
}
|
||||
|
||||
public function setZuzugsart(string $zuzugsart): self
|
||||
{
|
||||
$this->zuzugsart = $zuzugsart;
|
||||
|
||||
$zuzugsartReadable = array_search($zuzugsart, $this->getZuzugsarten());
|
||||
if($zuzugsartReadable === false)
|
||||
$zuzugsartReadable = 'Fehler';
|
||||
$this->zuzugsartReadable = $zuzugsartReadable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function getZuzugsarten() {
|
||||
return self::ZUZUGSARTEN;
|
||||
}
|
||||
|
||||
public static function getBekenntnisse() {
|
||||
return self::BEKENNTNISSE;
|
||||
}
|
||||
public static function getLetzteSchularten() {
|
||||
return self::LETZTE_SCHULARTEN;
|
||||
}
|
||||
public static function getHoechsteAbschluesse() {
|
||||
return self::HOECHSTE_ABSCHLUESSE;
|
||||
}
|
||||
public static function getHoechsteAbschluesseAn() {
|
||||
return self::HOECHSTE_ABSCHLUESSE_AN;
|
||||
}
|
||||
}
|
||||
82
src/Entity/Schulbesuch.php
Normal file
82
src/Entity/Schulbesuch.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'schulbesuch')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\SchulbesuchRepository::class)]
|
||||
class Schulbesuch
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\ManyToOne(targetEntity: \App\Entity\Schueler::class, inversedBy: 'schulbesuche')]
|
||||
private $schueler;
|
||||
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\ManyToOne(targetEntity: \App\Entity\Schule::class)]
|
||||
private $schule;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $eintritt;
|
||||
|
||||
#[ORM\Column(type: 'date')]
|
||||
private $austritt;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getSchule(): ?Schule
|
||||
{
|
||||
return $this->schule;
|
||||
}
|
||||
|
||||
public function setSchule(?Schule $schule): self
|
||||
{
|
||||
$this->schule = $schule;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEintritt(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->eintritt;
|
||||
}
|
||||
|
||||
public function setEintritt(\DateTimeInterface $eintritt): self
|
||||
{
|
||||
$this->eintritt = $eintritt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAustritt(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->austritt;
|
||||
}
|
||||
|
||||
public function setAustritt(\DateTimeInterface $austritt): self
|
||||
{
|
||||
$this->austritt = $austritt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(?Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
145
src/Entity/Schule.php
Normal file
145
src/Entity/Schule.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
#[ORM\Table(name: 'schuldaten')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\SchuleRepository::class)]
|
||||
class Schule
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
private $nummer;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $name;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $art;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $strasse;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $ort;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
private $plz;
|
||||
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
private $istVerifiziert;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getArt(): ?string
|
||||
{
|
||||
return $this->art;
|
||||
}
|
||||
|
||||
public function setArt(string $art): self
|
||||
{
|
||||
$this->art = $art;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStrasse(): ?string
|
||||
{
|
||||
return $this->strasse;
|
||||
}
|
||||
|
||||
public function setStrasse(string $strasse): self
|
||||
{
|
||||
$this->strasse = $strasse;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrt(): ?string
|
||||
{
|
||||
return $this->ort;
|
||||
}
|
||||
|
||||
public function setOrt(string $ort): self
|
||||
{
|
||||
$this->ort = $ort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlz(): ?string
|
||||
{
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
public function setPlz(string $plz): self
|
||||
{
|
||||
$this->plz = $plz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $nummer
|
||||
* @return Schule
|
||||
*/
|
||||
public function setNummer($nummer)
|
||||
{
|
||||
$this->nummer = $nummer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNummer()
|
||||
{
|
||||
return $this->nummer;
|
||||
}
|
||||
|
||||
public function getIstVerifiziert(): ?bool
|
||||
{
|
||||
return $this->istVerifiziert;
|
||||
}
|
||||
|
||||
public function setIstVerifiziert(bool $istVerifiziert): self
|
||||
{
|
||||
$this->istVerifiziert = $istVerifiziert;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getName() . ', ' . $this->getStrasse();
|
||||
}
|
||||
/*
|
||||
public static function loadValidatorMetadata(ClassMetadata $metadata)
|
||||
{
|
||||
$metadata->addConstraint(new Callback('validate'));
|
||||
}
|
||||
*/
|
||||
}
|
||||
87
src/Entity/Umschueler.php
Normal file
87
src/Entity/Umschueler.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'umschueler')]
|
||||
#[ORM\Entity(repositoryClass: \App\Repository\UmschuelerRepository::class)]
|
||||
class Umschueler
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $traeger;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $traegerSitz;
|
||||
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
private $foerdererNr;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: \App\Entity\Schueler::class, mappedBy: 'umschueler', cascade: ['persist', 'remove'])]
|
||||
private $schueler;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTraeger(): ?string
|
||||
{
|
||||
return $this->traeger;
|
||||
}
|
||||
|
||||
public function setTraeger(string $traeger): self
|
||||
{
|
||||
$this->traeger = $traeger;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTraegerSitz(): ?string
|
||||
{
|
||||
return $this->traegerSitz;
|
||||
}
|
||||
|
||||
public function setTraegerSitz(string $traegerSitz): self
|
||||
{
|
||||
$this->traegerSitz = $traegerSitz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFoerdererNr(): ?int
|
||||
{
|
||||
return $this->foerdererNr;
|
||||
}
|
||||
|
||||
public function setFoerdererNr(?int $foerdererNr): self
|
||||
{
|
||||
$this->foerdererNr = $foerdererNr;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchueler(): ?Schueler
|
||||
{
|
||||
return $this->schueler;
|
||||
}
|
||||
|
||||
public function setSchueler(?Schueler $schueler): self
|
||||
{
|
||||
$this->schueler = $schueler;
|
||||
|
||||
// set (or unset) the owning side of the relation if necessary
|
||||
$newUmschuelerDaten = $schueler === null ? null : $this;
|
||||
if ($newUmschuelerDaten !== $schueler->getUmschueler()) {
|
||||
$schueler->setUmschueler($newUmschuelerDaten);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
28
src/Form/AllgemeinType.php
Normal file
28
src/Form/AllgemeinType.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AllgemeinType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
||||
$builder
|
||||
->add('wohnheim', CheckboxType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('mitteilung', TextareaType::class, [
|
||||
'required' => false
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{}
|
||||
}
|
||||
72
src/Form/AusbildungType.php
Normal file
72
src/Form/AusbildungType.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Ausbildung;
|
||||
use App\Entity\Beruf;
|
||||
use App\Entity\Betrieb;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AusbildungType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('ausbilderemail', EmailType::class)
|
||||
->add('beginn', DateType::class, [
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
'html5' => false,
|
||||
'format' => 'dd.MM.yyyy'
|
||||
])
|
||||
->add('ende', DateType::class, [
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
'html5' => false,
|
||||
'format' => 'dd.MM.yyyy'
|
||||
]);
|
||||
if(!empty($options['betriebNeu'])) {
|
||||
$builder->add('betrieb', EntityType::class, [
|
||||
'class' => Betrieb::class,
|
||||
'choices' => $options['betriebe'],
|
||||
'data' => $options['betriebNeu'],
|
||||
'group_by' => 'ort',
|
||||
'placeholder' => 'Auswählen...',
|
||||
'attr' => ['onchange' => 'toggle()']
|
||||
]);
|
||||
} else {
|
||||
$builder->add('betrieb', EntityType::class, [
|
||||
'class' => Betrieb::class,
|
||||
'choices' => $options['betriebe'],
|
||||
'group_by' => 'ort',
|
||||
'placeholder' => 'Auswählen...',
|
||||
'attr' => ['onchange' => 'toggle()']
|
||||
]);
|
||||
}
|
||||
|
||||
$builder->add('beruf', EntityType::class, [
|
||||
'class' => Beruf::class,
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('u')
|
||||
->orderBy('u.bezeichnung', 'ASC');
|
||||
},
|
||||
'placeholder' => 'Auswählen...'
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Ausbildung::class,
|
||||
])
|
||||
->setRequired(["betriebe", "betriebNeu"])
|
||||
;
|
||||
}
|
||||
}
|
||||
27
src/Form/BerufType.php
Normal file
27
src/Form/BerufType.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Beruf;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class BerufType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('bezeichnung')
|
||||
->add('klasse')
|
||||
->add('nummer')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Beruf::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
73
src/Form/BetriebAdminType.php
Normal file
73
src/Form/BetriebAdminType.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Betrieb;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class BetriebAdminType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', null, [
|
||||
|
||||
])
|
||||
->add('strasse', null, [
|
||||
|
||||
])
|
||||
->add('hsnr', null, [
|
||||
|
||||
])
|
||||
->add('plz', null, [
|
||||
|
||||
])
|
||||
->add('ort', null, [
|
||||
|
||||
])
|
||||
->add('telZentrale', TelType::class, [
|
||||
|
||||
])
|
||||
->add('ansprPartner', null, [
|
||||
|
||||
])
|
||||
->add('telDurchwahl', TelType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('fax', TelType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'required' => true
|
||||
])
|
||||
->add('kammer', ChoiceType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => Betrieb::getKammern()
|
||||
])
|
||||
->add('asv_import', CheckboxType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('ist_verifiziert', CheckboxType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('kuerzel', null, [
|
||||
'required' => true
|
||||
])
|
||||
->add('gemeindeschluessel', null, [
|
||||
'required' => true
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Betrieb::class
|
||||
]);
|
||||
}
|
||||
}
|
||||
60
src/Form/BetriebType.php
Normal file
60
src/Form/BetriebType.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Betrieb;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class BetriebType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', null, [
|
||||
|
||||
])
|
||||
->add('strasse', null, [
|
||||
|
||||
])
|
||||
->add('hsnr', null, [
|
||||
|
||||
])
|
||||
->add('plz', null, [
|
||||
|
||||
])
|
||||
->add('ort', null, [
|
||||
|
||||
])
|
||||
->add('telZentrale', TelType::class, [
|
||||
|
||||
])
|
||||
->add('ansprPartner', null, [
|
||||
|
||||
])
|
||||
->add('telDurchwahl', TelType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('fax', TelType::class, [
|
||||
'required' => false
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
|
||||
])
|
||||
->add('kammer', ChoiceType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => Betrieb::getKammern()
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Betrieb::class
|
||||
]);
|
||||
}
|
||||
}
|
||||
39
src/Form/EintrittsdatumType.php
Normal file
39
src/Form/EintrittsdatumType.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class EintrittsdatumType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('ersteHaelfte', DateType::class, [
|
||||
'label' => 'Eintrittsdatum bei Registrierungen am Jahres Anfang',
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
])
|
||||
->add('zweiteHaelfte', DateType::class, [
|
||||
'label' => 'Eintrittsdatum bei Registrierungen am Jahres Ende',
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
])
|
||||
->add('wechselImportNKlassen', DateType::class, [
|
||||
'label' => 'Eintrittsdatum bei Registrierungen am Jahres Ende',
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
// Configure your form options here
|
||||
]);
|
||||
}
|
||||
}
|
||||
41
src/Form/FluechtlingType.php
Normal file
41
src/Form/FluechtlingType.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Fluechtling;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FluechtlingType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('deutschKenntnis', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'keine' => 0,
|
||||
'sehr schlecht' => 1,
|
||||
'eher schlecht' => 2,
|
||||
'durchschnittlich' => 3,
|
||||
'eher gut' => 4,
|
||||
'sehr gut' => 5
|
||||
],
|
||||
'placeholder' => 'Auswählen...',
|
||||
'expanded' => true
|
||||
])
|
||||
->add('anmeldeStelle')
|
||||
->add('ansprechPartner')
|
||||
->add('tel', TelType::class)
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Fluechtling::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
55
src/Form/KontaktpersonType.php
Normal file
55
src/Form/KontaktpersonType.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Kontaktperson;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class KontaktpersonType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('art', ChoiceType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => [
|
||||
//'Elternteil' => 'EL',
|
||||
'Mutter' => 'Mu',
|
||||
'Vater' => 'Va',
|
||||
'Vormund' => 'Vo',
|
||||
'Verwandter' => 'Vw',
|
||||
'Pflegeeltern' => 'Pf',
|
||||
'Schüler außerh. Unterbr.' => 'SU'
|
||||
]
|
||||
])
|
||||
->add('anrede', ChoiceType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => [
|
||||
'Herr' => 'H',
|
||||
'Frau' => 'F',
|
||||
'keine' => 'K'
|
||||
]
|
||||
])
|
||||
->add('vorname')
|
||||
->add('nachname')
|
||||
->add('strasse')
|
||||
->add('hausnummer')
|
||||
->add('plz')
|
||||
->add('ort')
|
||||
->add('telefonnummer', TelType::class)
|
||||
->add('email', EmailType::class)
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Kontaktperson::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
30
src/Form/RegistrierungType.php
Normal file
30
src/Form/RegistrierungType.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Registrierung;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RegistrierungType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('datum')
|
||||
->add('mitteilung')
|
||||
->add('wohnheim')
|
||||
->add('eintrittAm')
|
||||
->add('ip')
|
||||
->add('typ')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Registrierung::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
83
src/Form/SchuelerType.php
Normal file
83
src/Form/SchuelerType.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Schueler;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CountryType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SchuelerType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('vorname', null, [
|
||||
'label' => 'Vornamen',
|
||||
'help' => 'Alle Vornamen'
|
||||
])
|
||||
->add('rufname')
|
||||
->add('nachname')
|
||||
->add('geschlecht', ChoiceType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => [
|
||||
'männlich' => 'm',
|
||||
'weiblich' => 'w',
|
||||
'divers' => 'd'
|
||||
]
|
||||
])
|
||||
->add('strasse')
|
||||
->add('hsnr')
|
||||
->add('plz')
|
||||
->add('ort')
|
||||
->add('tel', TelType::class)
|
||||
->add('email', EmailType::class)
|
||||
->add('geburtsdatum', BirthdayType::class, [
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
'html5' => false,
|
||||
'format' => 'dd.MM.yyyy'
|
||||
])
|
||||
->add('geburtsort')
|
||||
->add('geburtsland', CountryType::class, [
|
||||
'placeholder' => 'Geburtsland...',
|
||||
'choice_translation_locale' => 'de',
|
||||
'preferred_choices' => ['Deutschland' => "DE"]
|
||||
])
|
||||
->add('zuzugAm', DateType::class, [
|
||||
'widget' => 'single_text',
|
||||
'html5' => false,
|
||||
'input' => 'datetime',
|
||||
'format' => 'yyyy',
|
||||
'required' => false,
|
||||
])
|
||||
->add('zuzugsart', ChoiceType::class, [
|
||||
'placeholder' => 'Zuzugsart...',
|
||||
'required' => false,
|
||||
'choices' => Schueler::getZuzugsarten()
|
||||
]);
|
||||
$builder->add('staatsangehoerigkeit', CountryType::class, [
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choice_translation_locale' => 'de',
|
||||
'preferred_choices' => ['Deutschland' => "DE"]
|
||||
])
|
||||
->add('bekenntnis', ChoiceType::class, [
|
||||
'placeholder' => 'Bekenntnis...',
|
||||
'choices' => Schueler::getBekenntnisse()
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Schueler::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
56
src/Form/SchulbesuchType.php
Normal file
56
src/Form/SchulbesuchType.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Schulbesuch;
|
||||
use App\Entity\Schule;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SchulbesuchType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
if(!empty($options['schule'])) {
|
||||
$builder->add('schule', EntityType::class, [
|
||||
'class' => Schule::class,
|
||||
'choices' => $options['schulen'],
|
||||
'data' => $options['schule'],
|
||||
'group_by' => 'ort',
|
||||
'placeholder' => 'Auswählen...'
|
||||
]);
|
||||
} else {
|
||||
$builder->add('schule', EntityType::class, [
|
||||
'class' => Schule::class,
|
||||
'choices' => $options['schulen'],
|
||||
'group_by' => 'ort',
|
||||
'placeholder' => 'Auswählen...'
|
||||
]);
|
||||
}
|
||||
$builder
|
||||
->add('eintritt', DateType::class, [
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
'html5' => false,
|
||||
'format' => 'dd.MM.yyyy'
|
||||
])
|
||||
->add('austritt', DateType::class, [
|
||||
'widget' => 'single_text',
|
||||
'input' => 'datetime',
|
||||
'html5' => false,
|
||||
'format' => 'dd.MM.yyyy'
|
||||
])
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Schulbesuch::class,
|
||||
])->setRequired(["schulen", "schule"]);
|
||||
}
|
||||
}
|
||||
44
src/Form/SchuleType.php
Normal file
44
src/Form/SchuleType.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Schule;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class SchuleType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
->add('art', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'Hauptschule oder Mittelschule' => 'VS',
|
||||
'Volksschule zur sonderpäd. Förderung' => 'SVS',
|
||||
'Realschule' => 'RS',
|
||||
'Wirtschaftsschule' => 'WS',
|
||||
'Gymnasium' => 'GY',
|
||||
'Berufsschule' => 'BS',
|
||||
'Berufsschule zur sonderpäd. Förderung' => 'SBS',
|
||||
'Fachoberschule' => 'FOS',
|
||||
'Grundschule' => 'G',
|
||||
'Sonstige Schule' => 'SO'
|
||||
],
|
||||
'placeholder' => 'Auswählen...'
|
||||
])
|
||||
->add('strasse')
|
||||
->add('plz')
|
||||
->add('ort')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Schule::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
55
src/Form/StartType.php
Normal file
55
src/Form/StartType.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
class StartType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('typ', ChoiceType::class, [
|
||||
'label' => 'Art der Beschäftigung',
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => [
|
||||
'Ausbildung mit Ausbildungsvertrag' => 'AUAU',
|
||||
'EQ-Maßnahme' => 'EQ',
|
||||
'Umschüler mit Vertrag' => 'UM',
|
||||
'Berufsgrundschuljahr: Holztechnik (Schreiner/Holzmechaniker)' => 'BGJH',
|
||||
'Berufsgrundschuljahr: Zimmerer' => 'BGJZ',
|
||||
//'ohne Berufstätigkeit und arbeitslos' => 'OBA',
|
||||
//'ungelernte Arbeitskräfte' => 'UAR',
|
||||
//'Mithelfende Familienangehörige' => 'MF',
|
||||
//'Ausbildung mit Praktikumsvertrag' => 'AUPR',
|
||||
//'Berufsvorbereitungsjahr' => 'BVJ',
|
||||
'Berufsintegrationsklasse (BIK)' => 'BIK'
|
||||
]
|
||||
])
|
||||
->add('datenschutz', CheckboxType::class, [
|
||||
'label' => 'Ich akzeptiere die Datenschutzbestimmungen.',
|
||||
'required' => true,
|
||||
'value' => true,
|
||||
])
|
||||
->add('schuljahr', ChoiceType::class, [
|
||||
'label' => 'Schuljahr',
|
||||
'placeholder' => 'Auswählen...',
|
||||
'choices' => [
|
||||
'für das kommende Schuljahr (ab 01.08.' . (intval(date("m")) < 8 ? date("Y") : (date("Y")+1)) . ')' => (intval(date("m")) < 8 ? date("Y") . "_" . (date("Y")+1) : (date("Y")+1) . "_" . (date("Y")+2)),
|
||||
'für das laufende Schuljahr (bis 31.07.' . (intval(date("m")) < 8 ? date("Y") : (date("Y")+1)) . ')' => (intval(date("m")) < 8 ? date("Y") . "_" . (date("Y")+1) : (date("Y")+1) . "_" . (date("Y")+2))
|
||||
],
|
||||
'expanded' => true
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
// Configure your form options here
|
||||
]);
|
||||
}
|
||||
}
|
||||
27
src/Form/UmschuelerType.php
Normal file
27
src/Form/UmschuelerType.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Umschueler;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class UmschuelerType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('traeger')
|
||||
->add('traegerSitz')
|
||||
->add('foerdererNr')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Umschueler::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
39
src/Form/VorbildungType.php
Normal file
39
src/Form/VorbildungType.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Schueler;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class VorbildungType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('letzteSchulart', ChoiceType::class, [
|
||||
'choices' => Schueler::getLetzteSchularten(),
|
||||
'placeholder' => 'Auswählen...'
|
||||
])
|
||||
->add('hoechsterAbschluss', ChoiceType::class, [
|
||||
'choices' => Schueler::getHoechsteAbschluesse(),
|
||||
'placeholder' => 'Auswählen...'
|
||||
])
|
||||
->add('hoechAbschlAn', ChoiceType::class, [
|
||||
'choices' => Schueler::getHoechsteAbschluesseAn(),
|
||||
'placeholder' => 'Auswählen...'
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'attr' => ['class' => 'save btn controlButton buttonFont btn-block blankLinkButton'],
|
||||
'label' => 'Weiter'
|
||||
]);;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
63
src/Kernel.php
Normal file
63
src/Kernel.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
|
||||
|
||||
class Kernel extends BaseKernel
|
||||
{
|
||||
use MicroKernelTrait;
|
||||
|
||||
const CONFIG_EXTS = '.{php,xml,yaml,yml}';
|
||||
|
||||
public function getCacheDir() : string
|
||||
{
|
||||
return $this->getProjectDir().'/var/cache/'.$this->environment;
|
||||
}
|
||||
|
||||
public function getLogDir() : string
|
||||
{
|
||||
return $this->getProjectDir().'/var/log';
|
||||
}
|
||||
|
||||
public function registerBundles() : iterable
|
||||
{
|
||||
$contents = require $this->getProjectDir().'/config/bundles.php';
|
||||
foreach ($contents as $class => $envs) {
|
||||
if (isset($envs['all']) || isset($envs[$this->environment])) {
|
||||
yield new $class();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
|
||||
{
|
||||
$container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
|
||||
// Feel free to remove the "container.autowiring.strict_mode" parameter
|
||||
// if you are using symfony/dependency-injection 4.0+ as it's the default behavior
|
||||
$container->setParameter('container.dumper.inline_class_loader', true);
|
||||
$confDir = $this->getProjectDir().'/config';
|
||||
|
||||
$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
|
||||
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
|
||||
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
|
||||
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
|
||||
}
|
||||
|
||||
protected function configureRoutes(RoutingConfigurator $routes): void
|
||||
{
|
||||
$confDir = $this->getProjectDir().'/config';
|
||||
|
||||
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
|
||||
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
|
||||
|
||||
$routes->import($confDir.'/{routes}/'.$this->environment.'/*.yaml', 'glob');
|
||||
$routes->import(__DIR__.'/Controller/', 'attribute');
|
||||
}
|
||||
}
|
||||
73
src/Migrations/Version20190228183925.php
Normal file
73
src/Migrations/Version20190228183925.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190228183925 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('CREATE TABLE kontaktperson (id INT AUTO_INCREMENT NOT NULL, schueler_id INT NOT NULL, anrede VARCHAR(1) NOT NULL, vorname VARCHAR(255) NOT NULL, nachname VARCHAR(255) NOT NULL, strasse VARCHAR(255) NOT NULL, hausnummer VARCHAR(10) NOT NULL, plz VARCHAR(5) NOT NULL, ort VARCHAR(255) NOT NULL, telefonnummer VARCHAR(30) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, art VARCHAR(2) NOT NULL, INDEX IDX_1A28E53D9AC0A64E (schueler_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ausbildung (id INT AUTO_INCREMENT NOT NULL, betrieb_id INT NOT NULL, beruf_id INT NOT NULL, beginn DATE NOT NULL, ende DATE NOT NULL, INDEX IDX_E482F6FE587A3BD (betrieb_id), ausbilderemail VARCHAR(255) NOT NULL, INDEX IDX_E482F6FEDEF76C65 (beruf_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE schuldaten (id INT AUTO_INCREMENT NOT NULL, nummer INT NOT NULL, name VARCHAR(255) NOT NULL, art VARCHAR(255) NOT NULL, strasse VARCHAR(255) NOT NULL, ort VARCHAR(255) NOT NULL, plz VARCHAR(5) NOT NULL, ist_verifiziert TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE schulbesuch (id INT AUTO_INCREMENT NOT NULL, schueler_id INT NOT NULL, schule_id INT NOT NULL, eintritt DATE NOT NULL, austritt DATE NOT NULL, INDEX IDX_4B6D821F9AC0A64E (schueler_id), INDEX IDX_4B6D821F5BCF5349 (schule_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE betriebedaten (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, anspr_partner VARCHAR(255) DEFAULT NULL, strasse VARCHAR(255) NOT NULL, plz VARCHAR(5) NOT NULL, ort VARCHAR(255) NOT NULL, tel_zentrale VARCHAR(255) NOT NULL, tel_durchwahl VARCHAR(255) DEFAULT NULL, fax VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, ist_verifiziert TINYINT(1) NOT NULL, gemeindeschluessel VARCHAR(8) NOT NULL, kammer INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE berufsdaten (id INT AUTO_INCREMENT NOT NULL, bezeichnung VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE schueler (id INT AUTO_INCREMENT NOT NULL, ausbildung_id INT DEFAULT NULL, fluechtling_id INT DEFAULT NULL, umschueler_id INT DEFAULT NULL, vorname VARCHAR(255) NOT NULL, nachname VARCHAR(255) NOT NULL, rufname VARCHAR(255) NOT NULL, geburtsdatum DATE NOT NULL, geburtsort VARCHAR(255) NOT NULL, geschlecht VARCHAR(1) NOT NULL, strasse VARCHAR(255) NOT NULL, hsnr VARCHAR(5) NOT NULL, plz VARCHAR(5) NOT NULL, ort VARCHAR(255) NOT NULL, tel VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, geburtsland VARCHAR(255) NOT NULL, staatsangehoerigkeit VARCHAR(255) NOT NULL, bekenntnis VARCHAR(255) NOT NULL, letzte_schulart VARCHAR(255) NOT NULL, hoechster_abschluss VARCHAR(255) NOT NULL, hoech_abschl_an VARCHAR(255) NOT NULL, zuzug_am DATE DEFAULT NULL, UNIQUE INDEX UNIQ_C382476D984B3F39 (ausbildung_id), UNIQUE INDEX UNIQ_C382476D23E87371 (fluechtling_id), UNIQUE INDEX UNIQ_C382476DEF15F351 (umschueler_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE admin_user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_AD8A54A9E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE umschueler (id INT AUTO_INCREMENT NOT NULL, traeger VARCHAR(255) NOT NULL, traeger_sitz VARCHAR(255) NOT NULL, foerderer_nr INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE fluechtling (id INT AUTO_INCREMENT NOT NULL, anmelde_stelle VARCHAR(255) NOT NULL, ansprech_partner VARCHAR(255) NOT NULL, tel VARCHAR(255) NOT NULL, deutsch_kenntnis INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE registrierung (id INT AUTO_INCREMENT NOT NULL, schueler_id INT NOT NULL, datum DATETIME NOT NULL, mitteilung LONGTEXT DEFAULT NULL, wohnheim TINYINT(1) NOT NULL, eintritt_am DATE NOT NULL, ip VARCHAR(255) NOT NULL, typ VARCHAR(4) NOT NULL, UNIQUE INDEX UNIQ_6E7E4FFD9AC0A64E (schueler_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE kontaktperson ADD CONSTRAINT FK_1A28E53D9AC0A64E FOREIGN KEY (schueler_id) REFERENCES schueler (id)');
|
||||
$this->addSql('ALTER TABLE ausbildung ADD CONSTRAINT FK_E482F6FE587A3BD FOREIGN KEY (betrieb_id) REFERENCES betriebedaten (id)');
|
||||
$this->addSql('ALTER TABLE ausbildung ADD CONSTRAINT FK_E482F6FEDEF76C65 FOREIGN KEY (beruf_id) REFERENCES berufsdaten (id)');
|
||||
$this->addSql('ALTER TABLE schulbesuch ADD CONSTRAINT FK_4B6D821F9AC0A64E FOREIGN KEY (schueler_id) REFERENCES schueler (id)');
|
||||
$this->addSql('ALTER TABLE schulbesuch ADD CONSTRAINT FK_4B6D821F5BCF5349 FOREIGN KEY (schule_id) REFERENCES schuldaten (id)');
|
||||
$this->addSql('ALTER TABLE schueler ADD CONSTRAINT FK_C382476D984B3F39 FOREIGN KEY (ausbildung_id) REFERENCES ausbildung (id)');
|
||||
$this->addSql('ALTER TABLE schueler ADD CONSTRAINT FK_C382476D23E87371 FOREIGN KEY (fluechtling_id) REFERENCES fluechtling (id)');
|
||||
$this->addSql('ALTER TABLE schueler ADD CONSTRAINT FK_C382476DEF15F351 FOREIGN KEY (umschueler_id) REFERENCES umschueler (id)');
|
||||
$this->addSql('ALTER TABLE registrierung ADD CONSTRAINT FK_6E7E4FFD9AC0A64E FOREIGN KEY (schueler_id) REFERENCES schueler (id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE schueler DROP FOREIGN KEY FK_C382476D984B3F39');
|
||||
$this->addSql('ALTER TABLE schulbesuch DROP FOREIGN KEY FK_4B6D821F5BCF5349');
|
||||
$this->addSql('ALTER TABLE ausbildung DROP FOREIGN KEY FK_E482F6FE587A3BD');
|
||||
$this->addSql('ALTER TABLE ausbildung DROP FOREIGN KEY FK_E482F6FEDEF76C65');
|
||||
$this->addSql('ALTER TABLE kontaktperson DROP FOREIGN KEY FK_1A28E53D9AC0A64E');
|
||||
$this->addSql('ALTER TABLE schulbesuch DROP FOREIGN KEY FK_4B6D821F9AC0A64E');
|
||||
$this->addSql('ALTER TABLE registrierung DROP FOREIGN KEY FK_6E7E4FFD9AC0A64E');
|
||||
$this->addSql('ALTER TABLE schueler DROP FOREIGN KEY FK_C382476DEF15F351');
|
||||
$this->addSql('ALTER TABLE schueler DROP FOREIGN KEY FK_C382476D23E87371');
|
||||
$this->addSql('DROP TABLE kontaktperson');
|
||||
$this->addSql('DROP TABLE ausbildung');
|
||||
$this->addSql('DROP TABLE schuldaten');
|
||||
$this->addSql('DROP TABLE schulbesuch');
|
||||
$this->addSql('DROP TABLE betriebedaten');
|
||||
$this->addSql('DROP TABLE berufsdaten');
|
||||
$this->addSql('DROP TABLE schueler');
|
||||
$this->addSql('DROP TABLE admin_user');
|
||||
$this->addSql('DROP TABLE umschueler');
|
||||
$this->addSql('DROP TABLE fluechtling');
|
||||
$this->addSql('DROP TABLE registrierung');
|
||||
}
|
||||
}
|
||||
39
src/Migrations/Version20190301080544.php
Normal file
39
src/Migrations/Version20190301080544.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190301080544 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE schuldaten CHANGE nummer nummer INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE betriebedaten CHANGE gemeindeschluessel gemeindeschluessel VARCHAR(8) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE berufsdaten ADD klasse VARCHAR(255) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE berufsdaten DROP klasse');
|
||||
$this->addSql('ALTER TABLE betriebedaten CHANGE gemeindeschluessel gemeindeschluessel VARCHAR(8) NOT NULL COLLATE utf8mb4_unicode_ci');
|
||||
$this->addSql('ALTER TABLE schuldaten CHANGE nummer nummer INT NOT NULL');
|
||||
}
|
||||
}
|
||||
37
src/Migrations/Version20190308181800.php
Normal file
37
src/Migrations/Version20190308181800.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190308181800 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE betriebedaten ADD kuerzel VARCHAR(255) NOT NULL');
|
||||
$this->addSql('ALTER TABLE berufsdaten ADD nummer INT NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE berufsdaten DROP nummer');
|
||||
$this->addSql('ALTER TABLE betriebedaten DROP kuerzel');
|
||||
}
|
||||
}
|
||||
35
src/Migrations/Version20190312140553.php
Normal file
35
src/Migrations/Version20190312140553.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190312140553 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung ADD datenschutz INT NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung DROP datenschutz');
|
||||
}
|
||||
}
|
||||
35
src/Migrations/Version20190316101523.php
Normal file
35
src/Migrations/Version20190316101523.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190316101523 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung CHANGE datenschutz datenschutz TINYINT(1) NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung CHANGE datenschutz datenschutz INT NOT NULL');
|
||||
}
|
||||
}
|
||||
35
src/Migrations/Version20190317153627.php
Normal file
35
src/Migrations/Version20190317153627.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20190317153627 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung ADD exported_at DATETIME DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE registrierung DROP exported_at');
|
||||
}
|
||||
}
|
||||
38
src/Migrations/Version20230921082200.php
Normal file
38
src/Migrations/Version20230921082200.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20230921082200 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
$this->addSql('ALTER TABLE betriebedaten ADD hsnr VARCHAR(255)');
|
||||
$this->addSql('ALTER TABLE betriebedaten ADD asv_import INT');
|
||||
$this->addSql('ALTER TABLE schueler ADD zuzugsart VARCHAR(255)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE betriebedaten DROP hsnr');
|
||||
$this->addSql('ALTER TABLE betriebedaten DROP asv_import');
|
||||
$this->addSql('ALTER TABLE schueler DROP zuzugsart VARCHAR(255)');
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user