Merge branch 'master' into 2fa

This commit is contained in:
Jan Böhmer 2019-12-26 15:07:32 +01:00
commit ac0928426b
40 changed files with 13330 additions and 5929 deletions

View file

@ -21,6 +21,7 @@
"ocramius/proxy-manager": "2.1.*", "ocramius/proxy-manager": "2.1.*",
"omines/datatables-bundle": "^0.3.1", "omines/datatables-bundle": "^0.3.1",
"r/u2f-two-factor-bundle": "^0.7.0", "r/u2f-two-factor-bundle": "^0.7.0",
"php-translation/symfony-bundle": "^0.9.1",
"s9e/text-formatter": "^2.1", "s9e/text-formatter": "^2.1",
"scheb/two-factor-bundle": "^4.11", "scheb/two-factor-bundle": "^4.11",
"sensio/framework-extra-bundle": "^5.1", "sensio/framework-extra-bundle": "^5.1",

385
composer.lock generated
View file

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "addae3263b772b9d16dce2392f8af0e7", "content-hash": "d47b430dcf83d23e3fb046457877da76",
"packages": [ "packages": [
{ {
"name": "beberlei/assert", "name": "beberlei/assert",
"version": "v3.2.6", "version": "v3.2.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/beberlei/assert.git", "url": "https://github.com/beberlei/assert.git",
"reference": "99508be011753690fe108ded450f5caaae180cfa" "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/beberlei/assert/zipball/99508be011753690fe108ded450f5caaae180cfa", "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf",
"reference": "99508be011753690fe108ded450f5caaae180cfa", "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -66,7 +66,7 @@
"assertion", "assertion",
"validation" "validation"
], ],
"time": "2019-10-10T10:33:57+00:00" "time": "2019-12-19T17:51:41+00:00"
}, },
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
@ -2106,6 +2106,58 @@
], ],
"time": "2019-12-20T14:15:16+00:00" "time": "2019-12-20T14:15:16+00:00"
}, },
{
"name": "nikic/php-parser",
"version": "v4.3.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "0.0.5",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2019-11-08T13:50:10+00:00"
},
{ {
"name": "nikolaposa/version", "name": "nikolaposa/version",
"version": "3.0.2", "version": "3.0.2",
@ -2159,6 +2211,53 @@
], ],
"time": "2018-05-28T18:15:22+00:00" "time": "2018-05-28T18:15:22+00:00"
}, },
{
"name": "nyholm/nsa",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/Nyholm/NSA.git",
"reference": "213a70dee2dd04433d31a187e24e92c8b59d1655"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Nyholm/NSA/zipball/213a70dee2dd04433d31a187e24e92c8b59d1655",
"reference": "213a70dee2dd04433d31a187e24e92c8b59d1655",
"shasum": ""
},
"require": {
"php": "^5.3 || ^7.0",
"webmozart/assert": "^1.1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Nyholm\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
}
],
"description": "See everything and do whatever you want. No privacy rule will stop us. Used in tests, debugging and fixtures to access properties and methods.",
"homepage": "http://tnyholm.se",
"keywords": [
"Fixture",
"debug",
"reflection",
"test"
],
"time": "2017-04-13T17:21:01+00:00"
},
{ {
"name": "nyholm/psr7", "name": "nyholm/psr7",
"version": "1.2.1", "version": "1.2.1",
@ -2710,6 +2809,218 @@
], ],
"time": "2016-01-26T13:27:02+00:00" "time": "2016-01-26T13:27:02+00:00"
}, },
{
"name": "php-translation/common",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-translation/common.git",
"reference": "ceac357a7ad0582d0a6be7b7f2db178c87f229fd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-translation/common/zipball/ceac357a7ad0582d0a6be7b7f2db178c87f229fd",
"reference": "ceac357a7ad0582d0a6be7b7f2db178c87f229fd",
"shasum": ""
},
"require": {
"php": "^5.4 || ^7.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.4 || ^4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Translation\\Common\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
}
],
"description": "Common translation stuff",
"time": "2018-06-14T16:18:37+00:00"
},
{
"name": "php-translation/extractor",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/php-translation/extractor.git",
"reference": "82fc51a07fb626c0bfb31fb3f041baa88fee6acb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-translation/extractor/zipball/82fc51a07fb626c0bfb31fb3f041baa88fee6acb",
"reference": "82fc51a07fb626c0bfb31fb3f041baa88fee6acb",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1.2",
"nikic/php-parser": "^3.0 || ^4.0",
"php": "^5.5 || ^7.0",
"symfony/finder": "^2.7 || ^3.0 || ^4.0",
"twig/twig": "^1.27 || ^2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.4 || ^4.0",
"symfony/translation": "^3.0 || ^4.0",
"symfony/twig-bridge": "^3.0 || ^4.0",
"symfony/validator": "^3.0 || ^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"Translation\\Extractor\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
}
],
"description": "Extract translations form the source code",
"time": "2018-07-09T17:05:17+00:00"
},
{
"name": "php-translation/symfony-bundle",
"version": "0.9.1",
"source": {
"type": "git",
"url": "https://github.com/php-translation/symfony-bundle.git",
"reference": "584b8b99ed97cc56a309c28cdd6e9c7bbf98bebb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-translation/symfony-bundle/zipball/584b8b99ed97cc56a309c28cdd6e9c7bbf98bebb",
"reference": "584b8b99ed97cc56a309c28cdd6e9c7bbf98bebb",
"shasum": ""
},
"require": {
"nyholm/nsa": "^1.1",
"php": "^7.1",
"php-translation/common": "^1.0",
"php-translation/extractor": "^1.6",
"php-translation/symfony-storage": "^1.0",
"symfony/finder": "^3.4 || ^4.0",
"symfony/framework-bundle": "^3.4 || ^4.0",
"symfony/intl": "^3.4 || ^4.0",
"symfony/translation": "^3.4 || ^4.0",
"symfony/twig-bundle": "^3.4 || ^4.0",
"symfony/validator": "^3.4 || ^4.0",
"twig/twig": "^1.42 || ^2.11"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^3.1",
"nyholm/psr7": "^1.1",
"nyholm/symfony-bundle-test": "^1.4",
"php-http/curl-client": "^1.7",
"php-http/message": "^1.6",
"php-http/message-factory": "^1.0.2",
"php-translation/translator": "^1.0",
"symfony/asset": "^3.4 || ^4.0",
"symfony/console": "^3.4 || ^4.0",
"symfony/dependency-injection": "^3.4 || ^4.0",
"symfony/phpunit-bridge": "^4.2",
"symfony/templating": "^3.4 || ^4.0",
"symfony/twig-bridge": "^3.4 || ^4.0",
"symfony/web-profiler-bundle": "^3.4 || ^4.0"
},
"suggest": {
"php-http/httplug-bundle": "To easier configure your httplug clients."
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "0.10-dev"
}
},
"autoload": {
"psr-4": {
"Translation\\Bundle\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
}
],
"time": "2019-09-06T07:39:54+00:00"
},
{
"name": "php-translation/symfony-storage",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-translation/symfony-storage.git",
"reference": "8d7b1ea6bf22bee0c7dc9b228cf9437312373a27"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-translation/symfony-storage/zipball/8d7b1ea6bf22bee0c7dc9b228cf9437312373a27",
"reference": "8d7b1ea6bf22bee0c7dc9b228cf9437312373a27",
"shasum": ""
},
"require": {
"nyholm/nsa": "^1.1",
"php": "^5.5 || ^7.0",
"php-translation/common": "^1.0",
"symfony/translation": "^2.7 || ^3.0 || ^4.0"
},
"require-dev": {
"symfony/framework-bundle": "^2.7.39 || ^3.0 || ^4.0",
"symfony/phpunit-bridge": "^3.4 || ^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.3-dev"
}
},
"autoload": {
"psr-4": {
"Translation\\SymfonyStorage\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com"
}
],
"description": "A translation file storage using Symfony translation component.",
"time": "2018-07-10T10:32:01+00:00"
},
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "2.0.0", "version": "2.0.0",
@ -3421,16 +3732,16 @@
}, },
{ {
"name": "scheb/two-factor-bundle", "name": "scheb/two-factor-bundle",
"version": "v4.11.0", "version": "v4.11.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/scheb/two-factor-bundle.git", "url": "https://github.com/scheb/two-factor-bundle.git",
"reference": "eadac02014233ab45dac215d42fd06aaf629b09a" "reference": "f9198cfcd5b2a92691926fd10406e8817232ac16"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/scheb/two-factor-bundle/zipball/eadac02014233ab45dac215d42fd06aaf629b09a", "url": "https://api.github.com/repos/scheb/two-factor-bundle/zipball/f9198cfcd5b2a92691926fd10406e8817232ac16",
"reference": "eadac02014233ab45dac215d42fd06aaf629b09a", "reference": "f9198cfcd5b2a92691926fd10406e8817232ac16",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3485,7 +3796,7 @@
"two-factor", "two-factor",
"two-step" "two-step"
], ],
"time": "2019-12-08T16:03:05+00:00" "time": "2019-12-19T12:07:42+00:00"
}, },
{ {
"name": "sensio/framework-extra-bundle", "name": "sensio/framework-extra-bundle",
@ -8799,58 +9110,6 @@
"description": "Map nested JSON structures onto PHP classes", "description": "Map nested JSON structures onto PHP classes",
"time": "2019-08-15T19:41:25+00:00" "time": "2019-08-15T19:41:25+00:00"
}, },
{
"name": "nikic/php-parser",
"version": "v4.3.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "0.0.5",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2019-11-08T13:50:10+00:00"
},
{ {
"name": "openlss/lib-array2xml", "name": "openlss/lib-array2xml",
"version": "1.0.0", "version": "1.0.0",

View file

@ -23,4 +23,5 @@ return [
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Scheb\TwoFactorBundle\SchebTwoFactorBundle::class => ['all' => true], Scheb\TwoFactorBundle\SchebTwoFactorBundle::class => ['all' => true],
R\U2FTwoFactorBundle\RU2FTwoFactorBundle::class => ['all' => true], R\U2FTwoFactorBundle\RU2FTwoFactorBundle::class => ['all' => true],
Translation\Bundle\TranslationBundle::class => ['all' => true],
]; ];

View file

@ -0,0 +1,5 @@
translation:
symfony_profiler:
enabled: true
webui:
enabled: true

View file

@ -0,0 +1,11 @@
translation:
locales: ["en", "de"]
edit_in_place:
enabled: false
config_name: app
configs:
app:
dirs: ["%kernel.project_dir%/templates", "%kernel.project_dir%/src"]
output_dir: "%kernel.project_dir%/translations"
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs]

View file

@ -0,0 +1,6 @@
_translation_webui:
resource: "@TranslationBundle/Resources/config/routing_webui.yml"
prefix: /admin
_translation_profiler:
resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yml'

View file

@ -0,0 +1,3 @@
_translation_edit_in_place:
resource: '@TranslationBundle/Resources/config/routing_edit_in_place.yml'
prefix: /admin

View file

@ -107,13 +107,13 @@ abstract class BaseAdminController extends AbstractController
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
$this->addFlash('success', $this->translator->trans('entity.edit_flash')); $this->addFlash('success', 'entity.edit_flash');
//Rebuild form, so it is based on the updated data. Important for the parent field! //Rebuild form, so it is based on the updated data. Important for the parent field!
//We can not use dynamic form events here, because the parent entity list is build from database! //We can not use dynamic form events here, because the parent entity list is build from database!
$form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]); $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]);
} elseif ($form->isSubmitted() && !$form->isValid()) { } elseif ($form->isSubmitted() && !$form->isValid()) {
$this->addFlash('error', $this->translator->trans('entity.edit_flash.invalid')); $this->addFlash('error', 'entity.edit_flash.invalid');
} }
return $this->render($this->twig_template, [ return $this->render($this->twig_template, [
@ -163,13 +163,13 @@ abstract class BaseAdminController extends AbstractController
$em->persist($new_entity); $em->persist($new_entity);
$em->flush(); $em->flush();
$this->addFlash('success', $this->translator->trans('entity.created_flash')); $this->addFlash('success', 'entity.created_flash');
return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]);
} }
if ($form->isSubmitted() && !$form->isValid()) { if ($form->isSubmitted() && !$form->isValid()) {
$this->addFlash('error', $this->translator->trans('entity.created_flash.invalid')); $this->addFlash('error', 'entity.created_flash.invalid');
} }
//Import form //Import form

View file

@ -1,82 +0,0 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Class DebugController.
*/
class DebugController extends AbstractController
{
/**
* @Route("/debug/flash_test")
*/
public function flashTest()
{
$this->addFlash('success', 'Success Flash Message!');
$this->addFlash('error', 'Error Flash Message!');
$this->addFlash('warning', 'Warning Flash Message!');
$this->addFlash('notice', 'Notice Flash Message!');
$this->addFlash('info', 'Info Flash Message! <b>Test</b>');
$this->addFlash('testkjfd', 'Blabla. This message type should be not know to template!');
return $this->render('base.html.twig');
}
/**
* @Route("/debug/dummy")
*/
public function dummy(TranslatorInterface $translator)
{
//Here we collect translation keys automatically created, so they can be extracted easily
//Validators:
$translator->trans('validator.noneofitschild.self');
$translator->trans('validator.noneofitschild.children');
$translator->trans('validator.isSelectable');
$translator->trans('validator.part_lot.location_full.no_increasment');
$translator->trans('validator.part_lot.location_full');
$translator->trans('validator.part_lot.only_existing');
$translator->trans('validator.part_lot.single_part');
//Manufacturer status
$translator->trans('m_status.active.help');
$translator->trans('m_status.announced.help');
$translator->trans('m_status.discontinued.help');
$translator->trans('m_status.eol.help');
$translator->trans('m_status.nrfnd.help');
$translator->trans('m_status.unknown.help');
//Flash titles
$translator->trans('flash.success');
$translator->trans('flash.error');
$translator->trans('flash.warning');
$translator->trans('flash.notice');
$translator->trans('flash.info');
$translator->trans('validator.noLockout');
}
}

View file

@ -97,11 +97,11 @@ class PartController extends AbstractController
$em->persist($part); $em->persist($part);
$em->flush(); $em->flush();
$this->addFlash('info', $translator->trans('part.edited_flash')); $this->addFlash('info', 'part.edited_flash');
//Reload form, so the SIUnitType entries use the new part unit //Reload form, so the SIUnitType entries use the new part unit
$form = $this->createForm(PartBaseType::class, $part); $form = $this->createForm(PartBaseType::class, $part);
} elseif ($form->isSubmitted() && !$form->isValid()) { } elseif ($form->isSubmitted() && !$form->isValid()) {
$this->addFlash('error', $translator->trans('part.edited_flash.invalid')); $this->addFlash('error', 'part.edited_flash.invalid');
} }
return $this->render('Parts/edit/edit_part_info.html.twig', return $this->render('Parts/edit/edit_part_info.html.twig',
@ -180,13 +180,13 @@ class PartController extends AbstractController
$em->persist($new_part); $em->persist($new_part);
$em->flush(); $em->flush();
$this->addFlash('success', $translator->trans('part.created_flash')); $this->addFlash('success', 'part.created_flash');
return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
} }
if ($form->isSubmitted() && !$form->isValid()) { if ($form->isSubmitted() && !$form->isValid()) {
$this->addFlash('error', $translator->trans('part.created_flash.invalid')); $this->addFlash('error', 'part.created_flash.invalid');
} }
return $this->render('Parts/edit/new_part.html.twig', return $this->render('Parts/edit/new_part.html.twig',
@ -216,7 +216,7 @@ class PartController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$em->persist($new_part); $em->persist($new_part);
$em->flush(); $em->flush();
$this->addFlash('success', $translator->trans('part.created_flash')); $this->addFlash('success', 'part.created_flash');
return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
} }

View file

@ -99,7 +99,7 @@ class SecurityController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$passwordReset->request($form->getData()['user']); $passwordReset->request($form->getData()['user']);
$this->addFlash('success', $this->translator->trans('pw_reset.request.success')); $this->addFlash('success', 'pw_reset.request.success');
return $this->redirectToRoute('login'); return $this->redirectToRoute('login');
} }
@ -152,9 +152,9 @@ class SecurityController extends AbstractController
//Try to set the new password //Try to set the new password
$success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']); $success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']);
if (!$success) { if (!$success) {
$this->addFlash('error', $this->translator->trans('pw_reset.new_pw.error')); $this->addFlash('error', 'pw_reset.new_pw.error');
} else { } else {
$this->addFlash('success', $this->translator->trans('pw_reset.new_pw.success')); $this->addFlash('success', 'pw_reset.new_pw.success');
return $this->redirectToRoute('login'); return $this->redirectToRoute('login');
} }
} }

View file

@ -34,10 +34,10 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
{ {
protected $filterTools; protected $filterTools;
public function __construct(Security $security, ParameterBagInterface $params, TranslatorInterface $trans, FileTypeFilterTools $filterTools) public function __construct(Security $security, ParameterBagInterface $params, FileTypeFilterTools $filterTools)
{ {
$this->filterTools = $filterTools; $this->filterTools = $filterTools;
parent::__construct($security, $params, $trans); parent::__construct($security, $params);
} }
protected function additionalFormElements(FormBuilderInterface $builder, array $options, NamedDBElement $entity) protected function additionalFormElements(FormBuilderInterface $builder, array $options, NamedDBElement $entity)
@ -45,9 +45,9 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
$is_new = null === $entity->getID(); $is_new = null === $entity->getID();
$builder->add('filetype_filter', TextType::class, ['required' => false, $builder->add('filetype_filter', TextType::class, ['required' => false,
'label' => $this->trans->trans('attachment_type.edit.filetype_filter'), 'label' => 'attachment_type.edit.filetype_filter',
'help' => $this->trans->trans('attachment_type.edit.filetype_filter.help'), 'help' => 'attachment_type.edit.filetype_filter.help',
'attr' => ['placeholder' => $this->trans->trans('attachment_type.edit.filetype_filter.placeholder')], 'attr' => ['placeholder' => 'attachment_type.edit.filetype_filter.placeholder'],
'empty_data' => '', 'empty_data' => '',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);

View file

@ -44,13 +44,11 @@ class BaseEntityAdminForm extends AbstractType
{ {
protected $security; protected $security;
protected $params; protected $params;
protected $trans;
public function __construct(Security $security, ParameterBagInterface $params, TranslatorInterface $trans) public function __construct(Security $security, ParameterBagInterface $params)
{ {
$this->security = $security; $this->security = $security;
$this->params = $params; $this->params = $params;
$this->trans = $trans;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
@ -66,23 +64,23 @@ class BaseEntityAdminForm extends AbstractType
$is_new = null === $entity->getID(); $is_new = null === $entity->getID();
$builder $builder
->add('name', TextType::class, ['empty_data' => '', 'label' => $this->trans->trans('name.label'), ->add('name', TextType::class, ['empty_data' => '', 'label' => 'name.label',
'attr' => ['placeholder' => $this->trans->trans('part.name.placeholder')], 'attr' => ['placeholder' =>'part.name.placeholder'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ])
->add('parent', StructuralEntityType::class, ['class' => \get_class($entity), ->add('parent', StructuralEntityType::class, ['class' => \get_class($entity),
'required' => false, 'label' => $this->trans->trans('parent.label'), 'required' => false, 'label' => 'parent.label',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]) 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ])
->add('not_selectable', CheckboxType::class, ['required' => false, ->add('not_selectable', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('entity.edit.not_selectable'), 'label' => 'entity.edit.not_selectable',
'help' => $this->trans->trans('entity.edit.not_selectable.help'), 'help' => 'entity.edit.not_selectable.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ])
->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '', ->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '',
'label' => $this->trans->trans('comment.label'), 'label' => 'comment.label',
'attr' => ['rows' => 4], 'help' => $this->trans->trans('bbcode.hint'), 'attr' => ['rows' => 4], 'help' => 'bbcode.hint',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$this->additionalFormElements($builder, $options, $entity); $this->additionalFormElements($builder, $options, $entity);
@ -103,13 +101,13 @@ class BaseEntityAdminForm extends AbstractType
$builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'label' => $this->trans->trans('part.edit.master_attachment'), 'label' => 'part.edit.master_attachment',
'entity' => $entity, 'entity' => $entity,
]); ]);
//Buttons //Buttons
$builder->add('save', SubmitType::class, [ $builder->add('save', SubmitType::class, [
'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), 'label' => $is_new ? 'entity.create' : 'entity.edit.save',
'attr' => ['class' => $is_new ? 'btn-success' : ''], 'attr' => ['class' => $is_new ? 'btn-success' : ''],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ])
->add('reset', ResetType::class, ['label' => 'entity.edit.reset', ->add('reset', ResetType::class, ['label' => 'entity.edit.reset',

View file

@ -33,46 +33,46 @@ class CategoryAdminForm extends BaseEntityAdminForm
$is_new = null === $entity->getID(); $is_new = null === $entity->getID();
$builder->add('disable_footprints', CheckboxType::class, ['required' => false, $builder->add('disable_footprints', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('category.edit.disable_footprints'), 'label' => 'category.edit.disable_footprints',
'help' => $this->trans->trans('category.edit.disable_footprints.help'), 'help' => 'category.edit.disable_footprints.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('disable_manufacturers', CheckboxType::class, ['required' => false, $builder->add('disable_manufacturers', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('category.edit.disable_manufacturers'), 'label' => 'category.edit.disable_manufacturers',
'help' => $this->trans->trans('category.edit.disable_manufacturers.help'), 'help' => 'category.edit.disable_manufacturers.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('disable_autodatasheets', CheckboxType::class, ['required' => false, $builder->add('disable_autodatasheets', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('category.edit.disable_autodatasheets'), 'label' => 'category.edit.disable_autodatasheets',
'help' => $this->trans->trans('category.edit.disable_autodatasheets.help'), 'help' => 'category.edit.disable_autodatasheets.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('disable_properties', CheckboxType::class, ['required' => false, $builder->add('disable_properties', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('category.edit.disable_properties'), 'label' => 'category.edit.disable_properties',
'help' => $this->trans->trans('category.edit.disable_properties.help'), 'help' => 'category.edit.disable_properties.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('partname_hint', TextType::class, ['required' => false, 'empty_data' => '', $builder->add('partname_hint', TextType::class, ['required' => false, 'empty_data' => '',
'label' => $this->trans->trans('category.edit.partname_hint'), 'label' => 'category.edit.partname_hint',
'attr' => ['placeholder' => $this->trans->trans('category.edit.partname_hint.placeholder')], 'attr' => ['placeholder' => 'category.edit.partname_hint.placeholder'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('partname_regex', TextType::class, ['required' => false, 'empty_data' => '', $builder->add('partname_regex', TextType::class, ['required' => false, 'empty_data' => '',
'label' => $this->trans->trans('category.edit.partname_regex'), 'label' => 'category.edit.partname_regex',
'attr' => ['placeholder' => 'category.edit.partname_regex.placeholder'], 'attr' => ['placeholder' => 'category.edit.partname_regex.placeholder'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('default_description', TextType::class, ['required' => false, 'empty_data' => '', $builder->add('default_description', TextType::class, ['required' => false, 'empty_data' => '',
'label' => $this->trans->trans('category.edit.default_description'), 'label' => 'category.edit.default_description',
'attr' => ['placeholder' => $this->trans->trans('category.edit.default_description.placeholder')], 'attr' => ['placeholder' => 'category.edit.default_description.placeholder'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('default_comment', TextType::class, ['required' => false, 'empty_data' => '', $builder->add('default_comment', TextType::class, ['required' => false, 'empty_data' => '',
'label' => $this->trans->trans('category.edit.default_comment'), 'label' => 'category.edit.default_comment',
'attr' => ['placeholder' => $this->trans->trans('category.edit.default_comment.placeholder')], 'attr' => ['placeholder' => $this->trans->trans('category.edit.default_comment.placeholder')],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
} }

View file

@ -35,46 +35,46 @@ class CompanyForm extends BaseEntityAdminForm
$is_new = null === $entity->getID(); $is_new = null === $entity->getID();
$builder->add('address', TextareaType::class, [ $builder->add('address', TextareaType::class, [
'label' => $this->trans->trans('company.edit.address'), 'label' => 'company.edit.address',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => $this->trans->trans('company.edit.address.placeholder')], 'required' => false, 'attr' => ['placeholder' => 'company.edit.address.placeholder'], 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('phone_number', TelType::class, [ $builder->add('phone_number', TelType::class, [
'label' => $this->trans->trans('company.edit.phone_number'), 'label' => 'company.edit.phone_number',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => $this->trans->trans('company.edit.phone_number.placeholder')], 'attr' => ['placeholder' => 'company.edit.phone_number.placeholder'],
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('fax_number', TelType::class, [ $builder->add('fax_number', TelType::class, [
'label' => $this->trans->trans('company.edit.fax_number'), 'label' => 'company.edit.fax_number',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => 'company.fax_number.placeholder'], 'required' => false, 'attr' => ['placeholder' => 'company.fax_number.placeholder'], 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('email_address', EmailType::class, [ $builder->add('email_address', EmailType::class, [
'label' => $this->trans->trans('company.edit.email'), 'label' => 'company.edit.email',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => $this->trans->trans('company.edit.email.placeholder')], 'required' => false, 'attr' => ['placeholder' => 'company.edit.email.placeholder'], 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('website', UrlType::class, [ $builder->add('website', UrlType::class, [
'label' => $this->trans->trans('company.edit.website'), 'label' => 'company.edit.website',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => $this->trans->trans('company.edit.website.placeholder')], 'required' => false, 'attr' => ['placeholder' => 'company.edit.website.placeholder'], 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('auto_product_url', UrlType::class, [ $builder->add('auto_product_url', UrlType::class, [
'label' => $this->trans->trans('company.edit.auto_product_url'), 'label' => 'company.edit.auto_product_url',
'help' => $this->trans->trans('company.edit.auto_product_url.help'), 'help' => 'company.edit.auto_product_url.help',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'attr' => ['placeholder' => $this->trans->trans('company.edit.auto_product_url.placeholder')], 'attr' => ['placeholder' => 'company.edit.auto_product_url.placeholder'],
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);

View file

@ -34,14 +34,14 @@ class CurrencyAdminForm extends BaseEntityAdminForm
$builder->add('iso_code', CurrencyType::class, [ $builder->add('iso_code', CurrencyType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('currency.edit.iso_code'), 'label' => 'currency.edit.iso_code',
'preferred_choices' => ['EUR', 'USD', 'GBP', 'JPY', 'CNY'], 'preferred_choices' => ['EUR', 'USD', 'GBP', 'JPY', 'CNY'],
'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker', 'data-live-search' => true],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('exchange_rate', MoneyType::class, [ $builder->add('exchange_rate', MoneyType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('currency.edit.exchange_rate'), 'label' => 'currency.edit.exchange_rate',
'currency' => $this->params->get('default_currency'), 'currency' => $this->params->get('default_currency'),
'scale' => 6, 'scale' => 6,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);

View file

@ -32,7 +32,7 @@ class FootprintAdminForm extends BaseEntityAdminForm
$builder->add('footprint_3d', MasterPictureAttachmentType::class, [ $builder->add('footprint_3d', MasterPictureAttachmentType::class, [
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted(null === $entity->getID() ? 'create' : 'edit', $entity), 'disabled' => !$this->security->isGranted(null === $entity->getID() ? 'create' : 'edit', $entity),
'label' => $this->trans->trans('footprint.edit.3d_model'), 'label' => 'footprint.edit.3d_model',
'filter' => '3d_model', 'filter' => '3d_model',
'entity' => $entity, 'entity' => $entity,
]); ]);

View file

@ -36,12 +36,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ImportType extends AbstractType class ImportType extends AbstractType
{ {
protected $security; protected $security;
protected $trans;
public function __construct(Security $security, TranslatorInterface $trans) public function __construct(Security $security)
{ {
$this->security = $security; $this->security = $security;
$this->trans = $trans;
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -57,33 +55,33 @@ class ImportType extends AbstractType
->add('format', ChoiceType::class, [ ->add('format', ChoiceType::class, [
'choices' => ['JSON' => 'json', 'XML' => 'xml', 'CSV' => 'csv', 'YAML' => 'yaml'], 'choices' => ['JSON' => 'json', 'XML' => 'xml', 'CSV' => 'csv', 'YAML' => 'yaml'],
'label' => $this->trans->trans('export.format'), 'label' => 'export.format',
'disabled' => $disabled, ]) 'disabled' => $disabled, ])
->add('csv_separator', TextType::class, ['data' => ';', ->add('csv_separator', TextType::class, ['data' => ';',
'label' => $this->trans->trans('import.csv_separator'), 'label' => 'import.csv_separator',
'disabled' => $disabled, ]); 'disabled' => $disabled, ]);
if ($entity instanceof StructuralDBElement) { if ($entity instanceof StructuralDBElement) {
$builder->add('parent', StructuralEntityType::class, [ $builder->add('parent', StructuralEntityType::class, [
'class' => $data['entity_class'], 'class' => $data['entity_class'],
'required' => false, 'required' => false,
'label' => $this->trans->trans('parent.label'), 'label' => 'parent.label',
'disabled' => $disabled, 'disabled' => $disabled,
]); ]);
} }
$builder->add('file', FileType::class, [ $builder->add('file', FileType::class, [
'label' => $this->trans->trans('import.file'), 'label' => 'import.file',
'attr' => ['class' => 'file', 'data-show-preview' => 'false', 'data-show-upload' => 'false'], 'attr' => ['class' => 'file', 'data-show-preview' => 'false', 'data-show-upload' => 'false'],
'disabled' => $disabled, 'disabled' => $disabled,
]) ])
->add('preserve_children', CheckboxType::class, ['data' => true, 'required' => false, ->add('preserve_children', CheckboxType::class, ['data' => true, 'required' => false,
'label' => $this->trans->trans('import.preserve_children'), 'label' => 'import.preserve_children',
'label_attr' => ['class' => 'checkbox-custom'], 'disabled' => $disabled, ]) 'label_attr' => ['class' => 'checkbox-custom'], 'disabled' => $disabled, ])
->add('abort_on_validation_error', CheckboxType::class, ['data' => true, 'required' => false, ->add('abort_on_validation_error', CheckboxType::class, ['data' => true, 'required' => false,
'label' => $this->trans->trans('import.abort_on_validation'), 'label' => 'import.abort_on_validation',
'help' => $this->trans->trans('import.abort_on_validation.help'), 'help' => 'import.abort_on_validation.help',
'label_attr' => ['class' => 'checkbox-custom'], 'disabled' => $disabled, ]) 'label_attr' => ['class' => 'checkbox-custom'], 'disabled' => $disabled, ])
//Buttons //Buttons

View file

@ -33,12 +33,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class MassCreationForm extends AbstractType class MassCreationForm extends AbstractType
{ {
protected $security; protected $security;
protected $translator;
public function __construct(Security $security, TranslatorInterface $translator) public function __construct(Security $security)
{ {
$this->security = $security; $this->security = $security;
$this->translator = $translator;
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@ -52,10 +50,10 @@ class MassCreationForm extends AbstractType
$builder $builder
->add('lines', TextareaType::class, ['data' => '', ->add('lines', TextareaType::class, ['data' => '',
'label' => $this->translator->trans('mass_creation.lines'), 'label' => 'mass_creation.lines',
'disabled' => $disabled, 'required' => true, 'disabled' => $disabled, 'required' => true,
'attr' => [ 'attr' => [
'placeholder' => $this->translator->trans('mass_creation.lines.placeholder'), 'placeholder' => 'mass_creation.lines.placeholder',
'rows' => 10, 'rows' => 10,
], ],
]); ]);
@ -63,13 +61,13 @@ class MassCreationForm extends AbstractType
$builder->add('parent', StructuralEntityType::class, [ $builder->add('parent', StructuralEntityType::class, [
'class' => $data['entity_class'], 'class' => $data['entity_class'],
'required' => false, 'required' => false,
'label' => $this->translator->trans('parent.label'), 'label' => 'parent.label',
'disabled' => $disabled, ]); 'disabled' => $disabled, ]);
} }
//Buttons //Buttons
$builder->add('create', SubmitType::class, [ $builder->add('create', SubmitType::class, [
'label' => $this->translator->trans('entity.mass_creation.btn'), 'label' => 'entity.mass_creation.btn',
'disabled' => $disabled, 'disabled' => $disabled,
]); ]);
} }

View file

@ -33,20 +33,20 @@ class MeasurementUnitAdminForm extends BaseEntityAdminForm
$is_new = null === $entity->getID(); $is_new = null === $entity->getID();
$builder->add('is_integer', CheckboxType::class, ['required' => false, $builder->add('is_integer', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('measurement_unit.edit.is_integer'), 'label' => 'measurement_unit.edit.is_integer',
'help' => $this->trans->trans('measurement_unit.edit.is_integer.help'), 'help' => 'measurement_unit.edit.is_integer.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('use_si_prefix', CheckboxType::class, ['required' => false, $builder->add('use_si_prefix', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('measurement_unit.edit.use_si_prefix'), 'label' => 'measurement_unit.edit.use_si_prefix',
'help' => $this->trans->trans('measurement_unit.edit.use_si_prefix.help'), 'help' => 'measurement_unit.edit.use_si_prefix.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
$builder->add('unit', TextType::class, ['required' => false, $builder->add('unit', TextType::class, ['required' => false,
'label' => $this->trans->trans('measurement_unit.edit.unit_symbol'), 'label' => 'measurement_unit.edit.unit_symbol',
'attr' => ['placeholder' => $this->trans->trans('measurement_unit.edit.unit_symbol.placeholder')], 'attr' => ['placeholder' => 'measurement_unit.edit.unit_symbol.placeholder'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]);
} }
} }

View file

@ -35,29 +35,29 @@ class StorelocationAdminForm extends BaseEntityAdminForm
$builder->add('is_full', CheckboxType::class, [ $builder->add('is_full', CheckboxType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('storelocation.edit.is_full.label'), 'label' => 'storelocation.edit.is_full.label',
'help' => $this->trans->trans('storelocation.edit.is_full.help'), 'help' => 'storelocation.edit.is_full.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]);
$builder->add('limit_to_existing_parts', CheckboxType::class, [ $builder->add('limit_to_existing_parts', CheckboxType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('storelocation.limit_to_existing.label'), 'label' => 'storelocation.limit_to_existing.label',
'help' => $this->trans->trans('storelocation.limit_to_existing.help'), 'help' => 'storelocation.limit_to_existing.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]);
$builder->add('only_single_part', CheckboxType::class, [ $builder->add('only_single_part', CheckboxType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('storelocation.only_single_part.label'), 'label' => 'storelocation.only_single_part.label',
'help' => $this->trans->trans('storelocation.only_single_part.help'), 'help' => 'storelocation.only_single_part.help',
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]);
$builder->add('storage_type', StructuralEntityType::class, [ $builder->add('storage_type', StructuralEntityType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('storelocation.storage_type.label'), 'label' => 'storelocation.storage_type.label',
'help' => $this->trans->trans('storelocation.storage_type.help'), 'help' => 'storelocation.storage_type.help',
'class' => MeasurementUnit::class, 'disable_not_selectable' => true, 'class' => MeasurementUnit::class, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]);
} }

View file

@ -38,7 +38,7 @@ class SupplierForm extends CompanyForm
$builder->add('default_currency', StructuralEntityType::class, [ $builder->add('default_currency', StructuralEntityType::class, [
'class' => Currency::class, 'class' => Currency::class,
'required' => false, 'required' => false,
'label' => $this->trans->trans('supplier.edit.default_currency'), 'label' => 'supplier.edit.default_currency',
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]);
@ -46,7 +46,7 @@ class SupplierForm extends CompanyForm
'required' => false, 'required' => false,
'currency' => $this->params->get('default_currency'), 'currency' => $this->params->get('default_currency'),
'scale' => 3, 'scale' => 3,
'label' => $this->trans->trans('supplier.shipping_costs.label'), 'label' => 'supplier.shipping_costs.label',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
]); ]);
} }

View file

@ -43,15 +43,13 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class AttachmentFormType extends AbstractType class AttachmentFormType extends AbstractType
{ {
protected $attachment_helper; protected $attachment_helper;
protected $trans;
protected $urlGenerator; protected $urlGenerator;
protected $allow_attachments_download; protected $allow_attachments_download;
public function __construct(AttachmentManager $attachmentHelper, TranslatorInterface $trans, public function __construct(AttachmentManager $attachmentHelper,
UrlGeneratorInterface $urlGenerator, bool $allow_attachments_downloads) UrlGeneratorInterface $urlGenerator, bool $allow_attachments_downloads)
{ {
$this->attachment_helper = $attachmentHelper; $this->attachment_helper = $attachmentHelper;
$this->trans = $trans;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;
$this->allow_attachments_download = $allow_attachments_downloads; $this->allow_attachments_download = $allow_attachments_downloads;
} }
@ -59,50 +57,50 @@ class AttachmentFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->add('name', TextType::class, [ $builder->add('name', TextType::class, [
'label' => $this->trans->trans('attachment.edit.name'), 'label' => 'attachment.edit.name',
]) ])
->add('attachment_type', StructuralEntityType::class, [ ->add('attachment_type', StructuralEntityType::class, [
'label' => $this->trans->trans('attachment.edit.attachment_type'), 'label' => 'attachment.edit.attachment_type',
'class' => AttachmentType::class, 'class' => AttachmentType::class,
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'attr' => ['class' => 'attachment_type_selector'], 'attr' => ['class' => 'attachment_type_selector'],
]); ]);
$builder->add('showInTable', CheckboxType::class, ['required' => false, $builder->add('showInTable', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('attachment.edit.show_in_table'), 'label' => 'attachment.edit.show_in_table',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'label_attr' => ['class' => 'checkbox-custom'], ]); 'label_attr' => ['class' => 'checkbox-custom'], ]);
$builder->add('secureFile', CheckboxType::class, ['required' => false, $builder->add('secureFile', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('attachment.edit.secure_file'), 'label' => 'attachment.edit.secure_file',
'mapped' => false, 'mapped' => false,
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'help' => $this->trans->trans('attachment.edit.secure_file.help'), 'help' => 'attachment.edit.secure_file.help',
'label_attr' => ['class' => 'checkbox-custom'], ]); 'label_attr' => ['class' => 'checkbox-custom'], ]);
$builder->add('url', TextType::class, [ $builder->add('url', TextType::class, [
'label' => $this->trans->trans('attachment.edit.url'), 'label' => 'attachment.edit.url',
'required' => false, 'required' => false,
'attr' => [ 'attr' => [
'data-autocomplete' => $this->urlGenerator->generate('typeahead_builtInRessources', ['query' => 'QUERY']), 'data-autocomplete' => $this->urlGenerator->generate('typeahead_builtInRessources', ['query' => 'QUERY']),
//Disable browser autocomplete //Disable browser autocomplete
'autocomplete' => 'off', 'autocomplete' => 'off',
], ],
'help' => $this->trans->trans('attachment.edit.url.help'), 'help' => 'attachment.edit.url.help',
'constraints' => [ 'constraints' => [
$options['allow_builtins'] ? new UrlOrBuiltin() : new Url(), $options['allow_builtins'] ? new UrlOrBuiltin() : new Url(),
], ],
]); ]);
$builder->add('downloadURL', CheckboxType::class, ['required' => false, $builder->add('downloadURL', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('attachment.edit.download_url'), 'label' => 'attachment.edit.download_url',
'mapped' => false, 'mapped' => false,
'disabled' => !$this->allow_attachments_download, 'disabled' => !$this->allow_attachments_download,
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'label_attr' => ['class' => 'checkbox-custom'], ]); 'label_attr' => ['class' => 'checkbox-custom'], ]);
$builder->add('file', FileType::class, [ $builder->add('file', FileType::class, [
'label' => $this->trans->trans('attachment.edit.file'), 'label' => 'attachment.edit.file',
'mapped' => false, 'mapped' => false,
'required' => false, 'required' => false,
'attr' => ['class' => 'file', 'data-show-preview' => 'false', 'data-show-upload' => 'false'], 'attr' => ['class' => 'file', 'data-show-preview' => 'false', 'data-show-upload' => 'false'],

View file

@ -40,12 +40,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class OrderdetailType extends AbstractType class OrderdetailType extends AbstractType
{ {
protected $trans;
protected $security; protected $security;
public function __construct(TranslatorInterface $trans, Security $security) public function __construct( Security $security)
{ {
$this->trans = $trans;
$this->security = $security; $this->security = $security;
} }
@ -55,27 +53,27 @@ class OrderdetailType extends AbstractType
$orderdetail = $builder->getData(); $orderdetail = $builder->getData();
$builder->add('supplierpartnr', TextType::class, [ $builder->add('supplierpartnr', TextType::class, [
'label' => $this->trans->trans('orderdetails.edit.supplierpartnr'), 'label' => 'orderdetails.edit.supplierpartnr',
'attr' => ['placeholder' => $this->trans->trans('orderdetails.edit.supplierpartnr.placeholder')], 'attr' => ['placeholder' => 'orderdetails.edit.supplierpartnr.placeholder'],
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
]); ]);
$builder->add('supplier', StructuralEntityType::class, [ $builder->add('supplier', StructuralEntityType::class, [
'class' => Supplier::class, 'disable_not_selectable' => true, 'class' => Supplier::class, 'disable_not_selectable' => true,
'label' => $this->trans->trans('orderdetails.edit.supplier'), 'label' => 'orderdetails.edit.supplier',
]); ]);
$builder->add('supplier_product_url', UrlType::class, [ $builder->add('supplier_product_url', UrlType::class, [
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('orderdetails.edit.url'), 'label' => 'orderdetails.edit.url',
]); ]);
$builder->add('obsolete', CheckboxType::class, [ $builder->add('obsolete', CheckboxType::class, [
'required' => false, 'required' => false,
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'label' => $this->trans->trans('orderdetails.edit.obsolete'), 'label' => 'orderdetails.edit.obsolete',
]); ]);
//Add pricedetails after we know the data, so we can set the default currency //Add pricedetails after we know the data, so we can set the default currency

View file

@ -54,10 +54,9 @@ class PartBaseType extends AbstractType
protected $trans; protected $trans;
protected $urlGenerator; protected $urlGenerator;
public function __construct(Security $security, TranslatorInterface $trans, UrlGeneratorInterface $urlGenerator) public function __construct(Security $security, UrlGeneratorInterface $urlGenerator)
{ {
$this->security = $security; $this->security = $security;
$this->trans = $trans;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;
} }
@ -67,52 +66,52 @@ class PartBaseType extends AbstractType
$part = $builder->getData(); $part = $builder->getData();
$status_choices = [ $status_choices = [
$this->trans->trans('m_status.unknown') => '', 'm_status.unknown' => '',
$this->trans->trans('m_status.announced') => 'announced', 'm_status.announced' => 'announced',
$this->trans->trans('m_status.active') => 'active', 'm_status.active' => 'active',
$this->trans->trans('m_status.nrfnd') => 'nrfnd', 'm_status.nrfnd' => 'nrfnd',
$this->trans->trans('m_status.eol') => 'eol', 'm_status.eol' => 'eol',
$this->trans->trans('m_status.discontinued') => 'discontinued', 'm_status.discontinued' => 'discontinued',
]; ];
//Common section //Common section
$builder $builder
->add('name', TextType::class, [ ->add('name', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('part.edit.name'), 'label' => 'part.edit.name',
'attr' => ['placeholder' => $this->trans->trans('part.edit.name.placeholder')], 'attr' => ['placeholder' => 'part.edit.name.placeholder'],
'disabled' => !$this->security->isGranted('name.edit', $part), 'disabled' => !$this->security->isGranted('name.edit', $part),
]) ])
->add('description', CKEditorType::class, [ ->add('description', CKEditorType::class, [
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('part.edit.description'), 'label' => 'part.edit.description',
'config_name' => 'description_config', 'config_name' => 'description_config',
'attr' => ['placeholder' => $this->trans->trans('part.edit.description.placeholder'), 'rows' => 2], 'attr' => ['placeholder' => 'part.edit.description.placeholder', 'rows' => 2],
'disabled' => !$this->security->isGranted('description.edit', $part), 'disabled' => !$this->security->isGranted('description.edit', $part),
]) ])
->add('minAmount', SIUnitType::class, [ ->add('minAmount', SIUnitType::class, [
'attr' => ['min' => 0, 'placeholder' => $this->trans->trans('part.editmininstock.placeholder')], 'attr' => ['min' => 0, 'placeholder' => 'part.editmininstock.placeholder'],
'label' => $this->trans->trans('part.edit.mininstock'), 'label' => 'part.edit.mininstock',
'measurement_unit' => $part->getPartUnit(), 'measurement_unit' => $part->getPartUnit(),
'disabled' => !$this->security->isGranted('minamount.edit', $part), 'disabled' => !$this->security->isGranted('minamount.edit', $part),
]) ])
->add('category', StructuralEntityType::class, [ ->add('category', StructuralEntityType::class, [
'class' => Category::class, 'class' => Category::class,
'label' => $this->trans->trans('part.edit.category'), 'label' => 'part.edit.category',
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted('category.edit', $part), 'disabled' => !$this->security->isGranted('category.edit', $part),
]) ])
->add('footprint', StructuralEntityType::class, [ ->add('footprint', StructuralEntityType::class, [
'class' => Footprint::class, 'class' => Footprint::class,
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.footprint'), 'label' => 'part.edit.footprint',
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted('footprint.edit', $part), 'disabled' => !$this->security->isGranted('footprint.edit', $part),
]) ])
->add('tags', TextType::class, [ ->add('tags', TextType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.tags'), 'label' => 'part.edit.tags',
'empty_data' => '', 'empty_data' => '',
'attr' => [ 'attr' => [
'class' => 'tagsinput', 'class' => 'tagsinput',
@ -124,23 +123,23 @@ class PartBaseType extends AbstractType
$builder->add('manufacturer', StructuralEntityType::class, [ $builder->add('manufacturer', StructuralEntityType::class, [
'class' => Manufacturer::class, 'class' => Manufacturer::class,
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.manufacturer.label'), 'label' => 'part.edit.manufacturer.label',
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted('manufacturer.edit', $part), 'disabled' => !$this->security->isGranted('manufacturer.edit', $part),
]) ])
->add('manufacturer_product_url', UrlType::class, [ ->add('manufacturer_product_url', UrlType::class, [
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('part.edit.manufacturer_url.label'), 'label' => 'part.edit.manufacturer_url.label',
'disabled' => !$this->security->isGranted('mpn.edit', $part), 'disabled' => !$this->security->isGranted('mpn.edit', $part),
]) ])
->add('manufacturer_product_number', TextType::class, [ ->add('manufacturer_product_number', TextType::class, [
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('part.edit.mpn'), 'label' => 'part.edit.mpn',
'disabled' => !$this->security->isGranted('mpn.edit', $part), ]) 'disabled' => !$this->security->isGranted('mpn.edit', $part), ])
->add('manufacturing_status', ChoiceType::class, [ ->add('manufacturing_status', ChoiceType::class, [
'label' => $this->trans->trans('part.edit.manufacturing_status'), 'label' => 'part.edit.manufacturing_status',
'choices' => $status_choices, 'choices' => $status_choices,
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('status.edit', $part), 'disabled' => !$this->security->isGranted('status.edit', $part),
@ -150,18 +149,18 @@ class PartBaseType extends AbstractType
$builder->add('needsReview', CheckboxType::class, [ $builder->add('needsReview', CheckboxType::class, [
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.needs_review'), 'label' => 'part.edit.needs_review',
'disabled' => !$this->security->isGranted('edit', $part), 'disabled' => !$this->security->isGranted('edit', $part),
]) ])
->add('favorite', CheckboxType::class, [ ->add('favorite', CheckboxType::class, [
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.is_favorite'), 'label' => 'part.edit.is_favorite',
'disabled' => !$this->security->isGranted('change_favorite', $part), 'disabled' => !$this->security->isGranted('change_favorite', $part),
]) ])
->add('mass', SIUnitType::class, [ ->add('mass', SIUnitType::class, [
'unit' => 'g', 'unit' => 'g',
'label' => $this->trans->trans('part.edit.mass'), 'label' => 'part.edit.mass',
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('mass.edit', $part), 'disabled' => !$this->security->isGranted('mass.edit', $part),
]) ])
@ -169,14 +168,14 @@ class PartBaseType extends AbstractType
'class' => MeasurementUnit::class, 'class' => MeasurementUnit::class,
'required' => false, 'required' => false,
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'label' => $this->trans->trans('part.edit.partUnit'), 'label' => 'part.edit.partUnit',
'disabled' => !$this->security->isGranted('unit.edit', $part), 'disabled' => !$this->security->isGranted('unit.edit', $part),
]); ]);
//Comment section //Comment section
$builder->add('comment', CKEditorType::class, [ $builder->add('comment', CKEditorType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('part.edit.comment'), 'label' => 'part.edit.comment',
'attr' => ['rows' => 4], 'attr' => ['rows' => 4],
'disabled' => !$this->security->isGranted('comment.edit', $part), 'empty_data' => '', 'disabled' => !$this->security->isGranted('comment.edit', $part), 'empty_data' => '',
]); ]);
@ -210,7 +209,7 @@ class PartBaseType extends AbstractType
$builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('attachments.edit', $part), 'disabled' => !$this->security->isGranted('attachments.edit', $part),
'label' => $this->trans->trans('part.edit.master_attachment'), 'label' => 'part.edit.master_attachment',
'entity' => $part, 'entity' => $part,
]); ]);
@ -230,8 +229,8 @@ class PartBaseType extends AbstractType
$builder $builder
//Buttons //Buttons
->add('save', SubmitType::class, ['label' => $this->trans->trans('part.edit.save')]) ->add('save', SubmitType::class, ['label' => 'part.edit.save'])
->add('reset', ResetType::class, ['label' => $this->trans->trans('part.edit.reset')]); ->add('reset', ResetType::class, ['label' => 'part.edit.reset']);
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)

View file

@ -37,26 +37,24 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class PartLotType extends AbstractType class PartLotType extends AbstractType
{ {
protected $trans;
protected $security; protected $security;
public function __construct(TranslatorInterface $trans, Security $security) public function __construct(Security $security)
{ {
$this->trans = $trans;
$this->security = $security; $this->security = $security;
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->add('description', TextType::class, [ $builder->add('description', TextType::class, [
'label' => $this->trans->trans('part_lot.edit.description'), 'label' => 'part_lot.edit.description',
'required' => false, 'required' => false,
'empty_data' => '', 'empty_data' => '',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
]); ]);
$builder->add('storage_location', StructuralEntityType::class, ['class' => Storelocation::class, $builder->add('storage_location', StructuralEntityType::class, ['class' => Storelocation::class,
'label' => $this->trans->trans('part_lot.edit.location'), 'label' => 'part_lot.edit.location',
'required' => false, 'required' => false,
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'attr' => ['class' => 'selectpicker form-control-sm', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker form-control-sm', 'data-live-search' => true],
@ -64,29 +62,29 @@ class PartLotType extends AbstractType
$builder->add('amount', SIUnitType::class, [ $builder->add('amount', SIUnitType::class, [
'measurement_unit' => $options['measurement_unit'], 'measurement_unit' => $options['measurement_unit'],
'label' => $this->trans->trans('part_lot.edit.amount'), 'label' => 'part_lot.edit.amount',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
]); ]);
$builder->add('instock_unknown', CheckboxType::class, ['required' => false, $builder->add('instock_unknown', CheckboxType::class, ['required' => false,
'label' => $this->trans->trans('part_lot.edit.instock_unknown'), 'label' => 'part_lot.edit.instock_unknown',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
]); ]);
$builder->add('needs_refill', CheckboxType::class, ['label_attr' => ['class' => 'checkbox-custom'], $builder->add('needs_refill', CheckboxType::class, ['label_attr' => ['class' => 'checkbox-custom'],
'label' => $this->trans->trans('part_lot.edit.needs_refill'), 'label' => 'part_lot.edit.needs_refill',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'required' => false, 'required' => false,
]); ]);
$builder->add('expirationDate', DateTimeType::class, [ $builder->add('expirationDate', DateTimeType::class, [
'label' => $this->trans->trans('part_lot.edit.expiration_date'), 'label' => 'part_lot.edit.expiration_date',
'attr' => [], 'attr' => [],
'required' => false, ]); 'required' => false, ]);
$builder->add('comment', TextType::class, [ $builder->add('comment', TextType::class, [
'label' => $this->trans->trans('part_lot.edit.comment'), 'label' => 'part_lot.edit.comment',
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
'required' => false, 'empty_data' => '', 'required' => false, 'empty_data' => '',
]); ]);

View file

@ -36,19 +36,25 @@ class PricedetailType extends AbstractType
{ {
//No labels needed, we define translation in templates //No labels needed, we define translation in templates
$builder->add('min_discount_quantity', SIUnitType::class, [ $builder->add('min_discount_quantity', SIUnitType::class, [
'label' => false,
'measurement_unit' => $options['measurement_unit'], 'measurement_unit' => $options['measurement_unit'],
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
]); ]);
$builder->add('price_related_quantity', SIUnitType::class, [ $builder->add('price_related_quantity', SIUnitType::class, [
'label' => false,
'measurement_unit' => $options['measurement_unit'], 'measurement_unit' => $options['measurement_unit'],
'attr' => ['class' => 'form-control-sm'], 'attr' => ['class' => 'form-control-sm'],
]); ]);
$builder->add('price', NumberType::class, [ $builder->add('price', NumberType::class, [
'label' => false,
'scale' => 5, 'scale' => 5,
'html5' => true, 'html5' => true,
'attr' => ['min' => 0, 'step' => 'any'], 'attr' => ['min' => 0, 'step' => 'any'],
]); ]);
$builder->add('currency', CurrencyEntityType::class, ['required' => false]); $builder->add('currency', CurrencyEntityType::class, [
'required' => false,
'label' => false
]);
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)

View file

@ -102,6 +102,7 @@ class SIUnitType extends AbstractType implements DataMapperInterface
{ {
$builder $builder
->add('value', NumberType::class, [ ->add('value', NumberType::class, [
'label' => false,
'html5' => $options['html5'], 'html5' => $options['html5'],
'attr' => [ 'attr' => [
'min' => (string) $options['min'], 'min' => (string) $options['min'],
@ -112,6 +113,7 @@ class SIUnitType extends AbstractType implements DataMapperInterface
if ($options['show_prefix']) { if ($options['show_prefix']) {
$builder->add('prefix', ChoiceType::class, [ $builder->add('prefix', ChoiceType::class, [
'label' => 'false',
'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3, 'µ' => -6], 'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3, 'µ' => -6],
]); ]);
} }

View file

@ -49,12 +49,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class UserAdminForm extends AbstractType class UserAdminForm extends AbstractType
{ {
protected $security; protected $security;
protected $trans;
public function __construct(Security $security, TranslatorInterface $trans) public function __construct(Security $security)
{ {
$this->security = $security; $this->security = $security;
$this->trans = $trans;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
@ -72,44 +70,44 @@ class UserAdminForm extends AbstractType
$builder $builder
->add('name', TextType::class, [ ->add('name', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('user.username.label'), 'label' => 'user.username.label',
'attr' => ['placeholder' => $this->trans->trans('user.username.placeholder')], 'attr' => ['placeholder' => 'user.username.placeholder'],
'disabled' => !$this->security->isGranted('edit_username', $entity), 'disabled' => !$this->security->isGranted('edit_username', $entity),
]) ])
->add('group', StructuralEntityType::class, [ ->add('group', StructuralEntityType::class, [
'class' => Group::class, 'class' => Group::class,
'required' => false, 'required' => false,
'label' => $this->trans->trans('group.label'), 'label' => 'group.label',
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted('change_group', $entity), ]) 'disabled' => !$this->security->isGranted('change_group', $entity), ])
->add('first_name', TextType::class, [ ->add('first_name', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('user.firstName.label'), 'label' => 'user.firstName.label',
'attr' => ['placeholder' => $this->trans->trans('user.firstName.placeholder')], 'required' => false, 'attr' => ['placeholder' => 'user.firstName.placeholder'], 'required' => false,
'disabled' => !$this->security->isGranted('edit_infos', $entity), 'disabled' => !$this->security->isGranted('edit_infos', $entity),
]) ])
->add('last_name', TextType::class, [ ->add('last_name', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('user.lastName.label'), 'label' => 'user.lastName.label',
'attr' => ['placeholder' => $this->trans->trans('user.lastName.placeholder')], 'attr' => ['placeholder' => 'user.lastName.placeholder'],
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('edit_infos', $entity), 'disabled' => !$this->security->isGranted('edit_infos', $entity),
]) ])
->add('email', TextType::class, [ ->add('email', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('user.email.label'), 'label' => 'user.email.label',
'attr' => ['placeholder' => $this->trans->trans('user.email.placeholder')], 'attr' => ['placeholder' => 'user.email.placeholder'],
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('edit_infos', $entity), ]) 'disabled' => !$this->security->isGranted('edit_infos', $entity), ])
->add('department', TextType::class, [ ->add('department', TextType::class, [
'empty_data' => '', 'empty_data' => '',
'label' => $this->trans->trans('user.department.label'), 'label' => 'user.department.label',
'attr' => ['placeholder' => $this->trans->trans('user.department.placeholder')], 'attr' => ['placeholder' => 'user.department.placeholder'],
'required' => false, 'required' => false,
'disabled' => !$this->security->isGranted('edit_infos', $entity), 'disabled' => !$this->security->isGranted('edit_infos', $entity),
]) ])
@ -118,16 +116,16 @@ class UserAdminForm extends AbstractType
->add('language', LanguageType::class, [ ->add('language', LanguageType::class, [
'required' => false, 'required' => false,
'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker', 'data-live-search' => true],
'placeholder' => $this->trans->trans('user_settings.language.placeholder'), 'placeholder' => 'user_settings.language.placeholder',
'label' => $this->trans->trans('user.language_select'), 'label' => 'user.language_select',
'preferred_choices' => ['en', 'de'], 'preferred_choices' => ['en', 'de'],
'disabled' => !$this->security->isGranted('change_user_settings', $entity), 'disabled' => !$this->security->isGranted('change_user_settings', $entity),
]) ])
->add('timezone', TimezoneType::class, [ ->add('timezone', TimezoneType::class, [
'required' => false, 'required' => false,
'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker', 'data-live-search' => true],
'placeholder' => $this->trans->trans('user_settings.timezone.placeholder'), 'placeholder' => 'user_settings.timezone.placeholder',
'label' => $this->trans->trans('user.timezone.label'), 'label' => 'user.timezone.label',
'preferred_choices' => ['Europe/Berlin'], 'preferred_choices' => ['Europe/Berlin'],
'disabled' => !$this->security->isGranted('change_user_settings', $entity), 'disabled' => !$this->security->isGranted('change_user_settings', $entity),
]) ])
@ -138,20 +136,20 @@ class UserAdminForm extends AbstractType
return $value; return $value;
}, },
'attr' => ['class' => 'selectpicker'], 'attr' => ['class' => 'selectpicker'],
'placeholder' => $this->trans->trans('user_settings.theme.placeholder'), 'placeholder' => 'user_settings.theme.placeholder',
'label' => $this->trans->trans('user.theme.label'), 'label' => 'user.theme.label',
'disabled' => !$this->security->isGranted('change_user_settings', $entity), 'disabled' => !$this->security->isGranted('change_user_settings', $entity),
]) ])
->add('currency', CurrencyEntityType::class, [ ->add('currency', CurrencyEntityType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.currency.label'), 'label' => 'user.currency.label',
'disabled' => !$this->security->isGranted('change_user_settings', $entity), 'disabled' => !$this->security->isGranted('change_user_settings', $entity),
]) ])
->add('new_password', RepeatedType::class, [ ->add('new_password', RepeatedType::class, [
'type' => PasswordType::class, 'type' => PasswordType::class,
'first_options' => ['label' => $this->trans->trans('user.settings.pw_new.label')], 'first_options' => ['label' => 'user.settings.pw_new.label'],
'second_options' => ['label' => $this->trans->trans('user.settings.pw_confirm.label')], 'second_options' => ['label' => 'user.settings.pw_confirm.label'],
'invalid_message' => 'password_must_match', 'invalid_message' => 'password_must_match',
'required' => false, 'required' => false,
'mapped' => false, 'mapped' => false,
@ -165,14 +163,14 @@ class UserAdminForm extends AbstractType
->add('need_pw_change', CheckboxType::class, [ ->add('need_pw_change', CheckboxType::class, [
'required' => false, 'required' => false,
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'label' => $this->trans->trans('user.edit.needs_pw_change'), 'label' => 'user.edit.needs_pw_change',
'disabled' => !$this->security->isGranted('set_password', $entity), 'disabled' => !$this->security->isGranted('set_password', $entity),
]) ])
->add('disabled', CheckboxType::class, [ ->add('disabled', CheckboxType::class, [
'required' => false, 'required' => false,
'label_attr' => ['class' => 'checkbox-custom'], 'label_attr' => ['class' => 'checkbox-custom'],
'label' => $this->trans->trans('user.edit.user_disabled'), 'label' => 'user.edit.user_disabled',
'disabled' => !$this->security->isGranted('set_password', $entity) 'disabled' => !$this->security->isGranted('set_password', $entity)
|| $entity === $this->security->getUser(), || $entity === $this->security->getUser(),
]) ])
@ -205,11 +203,11 @@ class UserAdminForm extends AbstractType
//Buttons //Buttons
$builder->add('save', SubmitType::class, [ $builder->add('save', SubmitType::class, [
'label' => $is_new ? $this->trans->trans('user.create') : $this->trans->trans('user.edit.save'), 'label' => $is_new ? 'user.create' : 'user.edit.save',
'attr' => ['class' => $is_new ? 'btn-success' : ''], 'attr' => ['class' => $is_new ? 'btn-success' : ''],
]) ])
->add('reset', ResetType::class, [ ->add('reset', ResetType::class, [
'label' => $this->trans->trans('entity.edit.reset'), 'label' => 'entity.edit.reset',
]); ]);
} }

View file

@ -39,15 +39,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class UserSettingsType extends AbstractType class UserSettingsType extends AbstractType
{ {
protected $security; protected $security;
protected $trans;
protected $demo_mode; protected $demo_mode;
public function __construct(Security $security, TranslatorInterface $trans, bool $demo_mode) public function __construct(Security $security, bool $demo_mode)
{ {
$this->security = $security; $this->security = $security;
$this->trans = $trans;
$this->demo_mode = $demo_mode; $this->demo_mode = $demo_mode;
} }
@ -55,43 +51,43 @@ class UserSettingsType extends AbstractType
{ {
$builder $builder
->add('name', TextType::class, [ ->add('name', TextType::class, [
'label' => $this->trans->trans('user.username.label'), 'label' => 'user.username.label',
'disabled' => !$this->security->isGranted('edit_username', $options['data']) || $this->demo_mode, 'disabled' => !$this->security->isGranted('edit_username', $options['data']) || $this->demo_mode,
]) ])
->add('first_name', TextType::class, [ ->add('first_name', TextType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.firstName.label'), 'label' => 'user.firstName.label',
'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
]) ])
->add('last_name', TextType::class, [ ->add('last_name', TextType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.lastName.label'), 'label' => 'user.lastName.label',
'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
]) ])
->add('department', TextType::class, [ ->add('department', TextType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.department.label'), 'label' => 'user.department.label',
'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
]) ])
->add('email', EmailType::class, [ ->add('email', EmailType::class, [
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.email.label'), 'label' => 'user.email.label',
'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode,
]) ])
->add('language', LanguageType::class, [ ->add('language', LanguageType::class, [
'disabled' => $this->demo_mode, 'disabled' => $this->demo_mode,
'required' => false, 'required' => false,
'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker', 'data-live-search' => true],
'placeholder' => $this->trans->trans('user_settings.language.placeholder'), 'placeholder' => 'user_settings.language.placeholder',
'label' => $this->trans->trans('user.language_select'), 'label' => 'user.language_select',
'preferred_choices' => ['en', 'de'], 'preferred_choices' => ['en', 'de'],
]) ])
->add('timezone', TimezoneType::class, [ ->add('timezone', TimezoneType::class, [
'disabled' => $this->demo_mode, 'disabled' => $this->demo_mode,
'required' => false, 'required' => false,
'attr' => ['class' => 'selectpicker', 'data-live-search' => true], 'attr' => ['class' => 'selectpicker', 'data-live-search' => true],
'placeholder' => $this->trans->trans('user_settings.timezone.placeholder'), 'placeholder' => 'user_settings.timezone.placeholder',
'label' => $this->trans->trans('user.timezone.label'), 'label' => 'user.timezone.label',
'preferred_choices' => ['Europe/Berlin'], 'preferred_choices' => ['Europe/Berlin'],
]) ])
->add('theme', ChoiceType::class, [ ->add('theme', ChoiceType::class, [
@ -102,13 +98,13 @@ class UserSettingsType extends AbstractType
'choice_label' => function ($entity, $key, $value) { 'choice_label' => function ($entity, $key, $value) {
return $value; return $value;
}, },
'placeholder' => $this->trans->trans('user_settings.theme.placeholder'), 'placeholder' => 'user_settings.theme.placeholder',
'label' => $this->trans->trans('user.theme.label'), 'label' => 'user.theme.label',
]) ])
->add('currency', CurrencyEntityType::class, [ ->add('currency', CurrencyEntityType::class, [
'disabled' => $this->demo_mode, 'disabled' => $this->demo_mode,
'required' => false, 'required' => false,
'label' => $this->trans->trans('user.currency.label'), 'label' => 'user.currency.label',
]) ])
//Buttons //Buttons

View file

@ -53,9 +53,11 @@ final class Version20190913141126 extends AbstractMigration
perms_parts_unit = 9, perms_parts_mass = 9, perms_parts_status = 9, perms_parts_mpn = 9, perms_parts_unit = 9, perms_parts_mass = 9, perms_parts_status = 9, perms_parts_mpn = 9,
perms_currencies = 9897, perms_measurement_units = 9897, perms_parts_attachements = 681, perms_currencies = 9897, perms_measurement_units = 9897, perms_parts_attachements = 681,
perms_parts_orderdetails = 681, perms_parts_prices = 681 perms_parts_orderdetails = 681, perms_parts_prices = 681
WHERE id = 2 AND name = "readonly"; WHERE id = 2 AND name = "readonly";';
UPDATE `groups` $this->addSql($sql);
$sql = 'UPDATE `groups`
SET perms_parts_category = 5, perms_parts_minamount = 5, perms_parts_lots = 85, perms_parts_tags= 5, SET perms_parts_category = 5, perms_parts_minamount = 5, perms_parts_lots = 85, perms_parts_tags= 5,
perms_parts_unit = 5, perms_parts_mass = 5, perms_parts_status = 5, perms_parts_mpn = 5, perms_parts_unit = 5, perms_parts_mass = 5, perms_parts_status = 5, perms_parts_mpn = 5,
perms_currencies = 5461, perms_measurement_units = 5461, perms_parts_attachements = 341, perms_currencies = 5461, perms_measurement_units = 5461, perms_parts_attachements = 341,

View file

@ -52,7 +52,7 @@ class GitVersionInfo
/** /**
* Get hash of the last git commit (on remote "origin"!). * Get hash of the last git commit (on remote "origin"!).
* *
* @note If this method does not work, try to make a "git pull" first! * If this method does not work, try to make a "git pull" first!
* *
* @param int $length if this is smaller than 40, only the first $length characters will be returned * @param int $length if this is smaller than 40, only the first $length characters will be returned
* *

View file

@ -202,6 +202,9 @@
"nikolaposa/version": { "nikolaposa/version": {
"version": "2.2.2" "version": "2.2.2"
}, },
"nyholm/nsa": {
"version": "1.1.0"
},
"nyholm/psr7": { "nyholm/psr7": {
"version": "1.0", "version": "1.0",
"recipe": { "recipe": {
@ -250,6 +253,30 @@
"php-http/promise": { "php-http/promise": {
"version": "v1.0.0" "version": "v1.0.0"
}, },
"php-translation/common": {
"version": "1.0.0"
},
"php-translation/extractor": {
"version": "1.7.1"
},
"php-translation/symfony-bundle": {
"version": "0.4",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "0.4",
"ref": "ee15ad002114fba7b694a7fe429419b518d43bc4"
},
"files": [
"./config/packages/dev/php_translation.yaml",
"./config/packages/php_translation.yaml",
"./config/routes/dev/php_translation.yaml",
"./config/routes/php_translation.yaml"
]
},
"php-translation/symfony-storage": {
"version": "1.0.1"
},
"phpdocumentor/reflection-common": { "phpdocumentor/reflection-common": {
"version": "1.0.1" "version": "1.0.1"
}, },

View file

@ -23,7 +23,7 @@
</button> </button>
</div> </div>
<div class="toast-body {{ flash_bg }}"> <div class="toast-body {{ flash_bg }}">
{{ message}} {{ message | trans}}
</div> </div>
</div> </div>
{% endfor %} {% endfor %}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,70 +1,140 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> <xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de">
<file source-language="en" target-language="de" datatype="plaintext" original="file.ext"> <file id="security.de">
<header> <unit id="baI_ZxO" name="An authentication exception occurred.">
<tool tool-id="symfony" tool-name="Symfony"/> <notes>
</header> <note category="state" priority="1">obsolete</note>
<body> </notes>
<trans-unit id="baI_ZxO" resname="An authentication exception occurred."> <segment>
<source>An authentication exception occurred.</source> <source>An authentication exception occurred.</source>
<target>Es ist ein Fehler bei der Authentifikation aufgetreten.</target> <target>Es ist ein Fehler bei der Authentifikation aufgetreten.</target>
</trans-unit> </segment>
<trans-unit id="OETylMq" resname="Authentication credentials could not be found."> </unit>
<unit id="OETylMq" name="Authentication credentials could not be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Authentication credentials could not be found.</source> <source>Authentication credentials could not be found.</source>
<target>Es konnten keine Zugangsdaten gefunden werden.</target> <target>Es konnten keine Zugangsdaten gefunden werden.</target>
</trans-unit> </segment>
<trans-unit id="3RJINQ0" resname="Authentication request could not be processed due to a system problem."> </unit>
<unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Authentication request could not be processed due to a system problem.</source> <source>Authentication request could not be processed due to a system problem.</source>
<target>Die Authentifikation konnte wegen eines Systemproblems nicht bearbeitet werden.</target> <target>Die Authentifikation konnte wegen eines Systemproblems nicht bearbeitet werden.</target>
</trans-unit> </segment>
<trans-unit id="qr0aiUo" resname="Invalid credentials."> </unit>
<unit id="qr0aiUo" name="Invalid credentials.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Invalid credentials.</source> <source>Invalid credentials.</source>
<target>Fehlerhafte Zugangsdaten.</target> <target>Fehlerhafte Zugangsdaten.</target>
</trans-unit> </segment>
<trans-unit id="zrJWK0F" resname="Cookie has already been used by someone else."> </unit>
<unit id="zrJWK0F" name="Cookie has already been used by someone else.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Cookie has already been used by someone else.</source> <source>Cookie has already been used by someone else.</source>
<target>Cookie wurde bereits von jemand anderem verwendet.</target> <target>Cookie wurde bereits von jemand anderem verwendet.</target>
</trans-unit> </segment>
<trans-unit id="blC0fXX" resname="Not privileged to request the resource."> </unit>
<unit id="blC0fXX" name="Not privileged to request the resource.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Not privileged to request the resource.</source> <source>Not privileged to request the resource.</source>
<target>Keine Rechte, um die Ressource anzufragen.</target> <target>Keine Rechte, um die Ressource anzufragen.</target>
</trans-unit> </segment>
<trans-unit id="dLzMRPR" resname="Invalid CSRF token."> </unit>
<unit id="dLzMRPR" name="Invalid CSRF token.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Invalid CSRF token.</source> <source>Invalid CSRF token.</source>
<target>Ungültiges CSRF-Token.</target> <target>Ungültiges CSRF-Token.</target>
</trans-unit> </segment>
<trans-unit id="PhhlLem" resname="No authentication provider found to support the authentication token."> </unit>
<unit id="PhhlLem" name="No authentication provider found to support the authentication token.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No authentication provider found to support the authentication token.</source> <source>No authentication provider found to support the authentication token.</source>
<target>Es wurde kein Authentifizierungs-Provider gefunden, der das Authentifizierungs-Token unterstützt.</target> <target>Es wurde kein Authentifizierungs-Provider gefunden, der das Authentifizierungs-Token unterstützt.</target>
</trans-unit> </segment>
<trans-unit id="v_RS21A" resname="No session available, it either timed out or cookies are not enabled."> </unit>
<unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No session available, it either timed out or cookies are not enabled.</source> <source>No session available, it either timed out or cookies are not enabled.</source>
<target>Keine Session verfügbar, entweder ist diese abgelaufen oder Cookies sind nicht aktiviert.</target> <target>Keine Session verfügbar, entweder ist diese abgelaufen oder Cookies sind nicht aktiviert.</target>
</trans-unit> </segment>
<trans-unit id="EYCKpDH" resname="No token could be found."> </unit>
<unit id="EYCKpDH" name="No token could be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No token could be found.</source> <source>No token could be found.</source>
<target>Es wurde kein Token gefunden.</target> <target>Es wurde kein Token gefunden.</target>
</trans-unit> </segment>
<trans-unit id="z3cOUZo" resname="Username could not be found."> </unit>
<unit id="z3cOUZo" name="Username could not be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Username could not be found.</source> <source>Username could not be found.</source>
<target>Der Benutzername wurde nicht gefunden.</target> <target>Der Benutzername wurde nicht gefunden.</target>
</trans-unit> </segment>
<trans-unit id="By5eLYM" resname="Account has expired."> </unit>
<unit id="By5eLYM" name="Account has expired.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account has expired.</source> <source>Account has expired.</source>
<target>Der Account ist abgelaufen.</target> <target>Der Account ist abgelaufen.</target>
</trans-unit> </segment>
<trans-unit id="YfZhiuA" resname="Credentials have expired."> </unit>
<unit id="YfZhiuA" name="Credentials have expired.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Credentials have expired.</source> <source>Credentials have expired.</source>
<target>Die Zugangsdaten sind abgelaufen.</target> <target>Die Zugangsdaten sind abgelaufen.</target>
</trans-unit> </segment>
<trans-unit id="NrSSfLs" resname="Account is disabled."> </unit>
<unit id="NrSSfLs" name="Account is disabled.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account is disabled.</source> <source>Account is disabled.</source>
<target>Der Account ist deaktiviert.</target> <target>Der Account ist deaktiviert.</target>
</trans-unit> </segment>
<trans-unit id="O5ZyxHr" resname="Account is locked."> </unit>
<unit id="O5ZyxHr" name="Account is locked.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account is locked.</source> <source>Account is locked.</source>
<target>Der Account ist gesperrt.</target> <target>Der Account ist gesperrt.</target>
</trans-unit> </segment>
</body> </unit>
</file> </file>
</xliff> </xliff>

View file

@ -1,70 +1,140 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> <xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext"> <file id="security.en">
<header> <unit id="baI_ZxO" name="An authentication exception occurred.">
<tool tool-id="symfony" tool-name="Symfony"/> <notes>
</header> <note category="state" priority="1">obsolete</note>
<body> </notes>
<trans-unit id="baI_ZxO" resname="An authentication exception occurred."> <segment>
<source>An authentication exception occurred.</source> <source>An authentication exception occurred.</source>
<target>An authentication exception occurred.</target> <target>An authentication exception occurred.</target>
</trans-unit> </segment>
<trans-unit id="OETylMq" resname="Authentication credentials could not be found."> </unit>
<unit id="OETylMq" name="Authentication credentials could not be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Authentication credentials could not be found.</source> <source>Authentication credentials could not be found.</source>
<target>Authentication credentials could not be found.</target> <target>Authentication credentials could not be found.</target>
</trans-unit> </segment>
<trans-unit id="3RJINQ0" resname="Authentication request could not be processed due to a system problem."> </unit>
<unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Authentication request could not be processed due to a system problem.</source> <source>Authentication request could not be processed due to a system problem.</source>
<target>Authentication request could not be processed due to a system problem.</target> <target>Authentication request could not be processed due to a system problem.</target>
</trans-unit> </segment>
<trans-unit id="qr0aiUo" resname="Invalid credentials."> </unit>
<unit id="qr0aiUo" name="Invalid credentials.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Invalid credentials.</source> <source>Invalid credentials.</source>
<target>Invalid credentials.</target> <target>Invalid credentials.</target>
</trans-unit> </segment>
<trans-unit id="zrJWK0F" resname="Cookie has already been used by someone else."> </unit>
<unit id="zrJWK0F" name="Cookie has already been used by someone else.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Cookie has already been used by someone else.</source> <source>Cookie has already been used by someone else.</source>
<target>Cookie has already been used by someone else.</target> <target>Cookie has already been used by someone else.</target>
</trans-unit> </segment>
<trans-unit id="blC0fXX" resname="Not privileged to request the resource."> </unit>
<unit id="blC0fXX" name="Not privileged to request the resource.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Not privileged to request the resource.</source> <source>Not privileged to request the resource.</source>
<target>Not privileged to request the resource.</target> <target>Not privileged to request the resource.</target>
</trans-unit> </segment>
<trans-unit id="dLzMRPR" resname="Invalid CSRF token."> </unit>
<unit id="dLzMRPR" name="Invalid CSRF token.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Invalid CSRF token.</source> <source>Invalid CSRF token.</source>
<target>Invalid CSRF token.</target> <target>Invalid CSRF token.</target>
</trans-unit> </segment>
<trans-unit id="PhhlLem" resname="No authentication provider found to support the authentication token."> </unit>
<unit id="PhhlLem" name="No authentication provider found to support the authentication token.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No authentication provider found to support the authentication token.</source> <source>No authentication provider found to support the authentication token.</source>
<target>No authentication provider found to support the authentication token.</target> <target>No authentication provider found to support the authentication token.</target>
</trans-unit> </segment>
<trans-unit id="v_RS21A" resname="No session available, it either timed out or cookies are not enabled."> </unit>
<unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No session available, it either timed out or cookies are not enabled.</source> <source>No session available, it either timed out or cookies are not enabled.</source>
<target>No session available, it either timed out or cookies are not enabled.</target> <target>No session available, it either timed out or cookies are not enabled.</target>
</trans-unit> </segment>
<trans-unit id="EYCKpDH" resname="No token could be found."> </unit>
<unit id="EYCKpDH" name="No token could be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>No token could be found.</source> <source>No token could be found.</source>
<target>No token could be found.</target> <target>No token could be found.</target>
</trans-unit> </segment>
<trans-unit id="z3cOUZo" resname="Username could not be found."> </unit>
<unit id="z3cOUZo" name="Username could not be found.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Username could not be found.</source> <source>Username could not be found.</source>
<target>Username could not be found.</target> <target>Username could not be found.</target>
</trans-unit> </segment>
<trans-unit id="By5eLYM" resname="Account has expired."> </unit>
<unit id="By5eLYM" name="Account has expired.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account has expired.</source> <source>Account has expired.</source>
<target>Account has expired.</target> <target>Account has expired.</target>
</trans-unit> </segment>
<trans-unit id="YfZhiuA" resname="Credentials have expired."> </unit>
<unit id="YfZhiuA" name="Credentials have expired.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Credentials have expired.</source> <source>Credentials have expired.</source>
<target>Credentials have expired.</target> <target>Credentials have expired.</target>
</trans-unit> </segment>
<trans-unit id="NrSSfLs" resname="Account is disabled."> </unit>
<unit id="NrSSfLs" name="Account is disabled.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account is disabled.</source> <source>Account is disabled.</source>
<target>Account is disabled.</target> <target>Account is disabled.</target>
</trans-unit> </segment>
<trans-unit id="O5ZyxHr" resname="Account is locked."> </unit>
<unit id="O5ZyxHr" name="Account is locked.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>Account is locked.</source> <source>Account is locked.</source>
<target>Account is locked.</target> <target>Account is locked.</target>
</trans-unit> </segment>
</body> </unit>
</file> </file>
</xliff> </xliff>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff