Merge branch 'time_machine'

This commit is contained in:
Jan Böhmer 2020-03-07 22:36:34 +01:00
commit eb03d14b37
87 changed files with 7336 additions and 1265 deletions

14
.env
View file

@ -59,3 +59,17 @@ EMAIL_SENDER_EMAIL=noreply@partdb.changeme
# Set this to 1 to allow reset of a password per email # Set this to 1 to allow reset of a password per email
ALLOW_EMAIL_PW_RESET=0 ALLOW_EMAIL_PW_RESET=0
######################################################################################
# History/Eventlog related settings
######################################################################################
# If you want to use full timetrave functionality
# Save which fields were changed in a ElementEdited log entry
HISTORY_SAVE_CHANGED_FIELDS=1
# Save the old data in the ElementEdited log entry (warning this could increase the database size in short time)
HISTORY_SAVE_CHANGED_DATA=0
# Save the data of an element that gets removed into log entry. This allows to undelete an element
HISTORY_SAVE_REMOVED_DATA=0

View file

@ -242,6 +242,16 @@ showing the sidebar (on devices with md or higher)
* Bootstrap extensions * Bootstrap extensions
*****************************************/ *****************************************/
.bg-primary-striped {
background: repeating-linear-gradient(
-45deg,
var(--primary),
var(--primary) 10px,
var(--info) 10px,
var(--info) 20px
)
}
.form-group-sm { .form-group-sm {
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -310,6 +320,10 @@ showing the sidebar (on devices with md or higher)
} }
} }
.not-allowed {
cursor: not-allowed !important;
}
/************************************** /**************************************
btn-xs btn-xs
btn-xs btn-xs

View file

@ -1,5 +1,5 @@
translation: translation:
locales: ["en", "de", "ru"] locales: ["en", "de"]
edit_in_place: edit_in_place:
enabled: false enabled: false
config_name: app config_name: app

View file

@ -67,6 +67,10 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
show_history: show_history:
label: "perm.part.show_history" label: "perm.part.show_history"
bit: 30 bit: 30
revert_element:
label: "perm.revert_elements"
bit: 32
alsoSet: ["read", "edit", "create", "delete", "show_history"]
parts_name: &PART_ATTRIBUTE # We define a template here, that we can use for all part attributes. parts_name: &PART_ATTRIBUTE # We define a template here, that we can use for all part attributes.
label: "perm.part.name" label: "perm.part.name"
@ -154,8 +158,31 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
label: "perm.part.lots" label: "perm.part.lots"
parts_attachments: parts_attachments:
<<: *PART_MULTI_ATTRIBUTE group: "structures"
label: "perm.part.attachments" label: "perm.part.attachments"
operations:
read:
label: "perm.read"
bit: 0
edit:
label: "perm.edit"
bit: 2
alsoSet: 'read'
create:
label: "perm.create"
bit: 4
alsoSet: ['read', 'edit']
delete:
label: "perm.delete"
bit: 6
alsoSet: ['read']
show_history:
label: "perm.show_history"
bit: 8
revert_element:
label: "perm.revert_elements"
bit: 10
alsoSet: ["read", "edit", "create", "delete", "show_history"]
parts_order: parts_order:
<<: *PART_ATTRIBUTE <<: *PART_ATTRIBUTE
@ -189,6 +216,13 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
show_users: show_users:
label: "perm.show_users" label: "perm.show_users"
bit: 12 bit: 12
show_history:
label: "perm.show_history"
bit: 14
revert_element:
label: "perm.revert_elements"
bit: 16
alsoSet: ["read", "edit", "create", "delete", "show_history"]
footprints: footprints:
<<: *PART_CONTAINING <<: *PART_CONTAINING
@ -243,6 +277,12 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
statistics: statistics:
label: "perm.tools.statistics" label: "perm.tools.statistics"
bit: 10 bit: 10
lastActivity:
label: "perm.tools.lastActivity"
bit: 12
timetravel:
label: "perm.tools.timeTravel"
bit: 14
groups: groups:
label: "perm.groups" label: "perm.groups"
@ -270,6 +310,13 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
label: "perm.edit_permissions" label: "perm.edit_permissions"
alsoSet: ['read', 'edit'] alsoSet: ['read', 'edit']
bit: 10 bit: 10
show_history:
label: "perm.show_history"
bit: 12
revert_element:
label: "perm.revert_elements"
bit: 14
alsoSet: ["read", "edit", "create", "delete", "move", "edit_permissions", "show_history"]
users: users:
label: "perm.users" label: "perm.users"
@ -309,6 +356,13 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
change_user_settings: change_user_settings:
label: "perm.users.change_user_settings" label: "perm.users.change_user_settings"
bit: 16 bit: 16
show_history:
label: "perm.show_history"
bit: 18
revert_element:
label: "perm.revert_elements"
bit: 20
alsoSet: ["read", "edit", "create", "delete", "move", "edit_permissions", "show_history", "edit_infos", "change_group", "edit_username"]
database: database:
label: "perm.database" label: "perm.database"

View file

@ -74,6 +74,10 @@ services:
- { name: "doctrine.orm.entity_listener" } - { name: "doctrine.orm.entity_listener" }
App\EventSubscriber\EventLoggerSubscriber: App\EventSubscriber\EventLoggerSubscriber:
arguments:
$save_changed_fields: '%env(bool:HISTORY_SAVE_CHANGED_FIELDS)%'
$save_changed_data: '%env(bool:HISTORY_SAVE_CHANGED_DATA)%'
$save_removed_data: '%env(bool:HISTORY_SAVE_REMOVED_DATA)%'
tags: tags:
- { name: 'doctrine.event_subscriber' } - { name: 'doctrine.event_subscriber' }
@ -92,6 +96,11 @@ services:
tags: tags:
- name: doctrine.orm.entity_listener - name: doctrine.orm.entity_listener
# Dont use JSONSerializable Interface,
serializer.normalizer.json_serializable:
class: Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
tags:
- {name: serializer.normalizer, priority: -9000}
App\Controller\RedirectController: App\Controller\RedirectController:
arguments: arguments:

View file

@ -137,6 +137,7 @@ class ShowEventLogCommand extends Command
$headers = ['ID', 'Timestamp', 'Type', 'User', 'Target Type', 'Target']; $headers = ['ID', 'Timestamp', 'Type', 'User', 'Target Type', 'Target'];
if ($showExtra) { if ($showExtra) {
$headers[] = 'Extra data'; $headers[] = 'Extra data';
$table->setColumnMaxWidth(6, 50);
} }
$table->setHeaders($headers); $table->setHeaders($headers);
@ -144,6 +145,9 @@ class ShowEventLogCommand extends Command
$this->addTableRow($table, $entry, $showExtra); $this->addTableRow($table, $entry, $showExtra);
} }
$table->setColumnMaxWidth(3, 20);
$table->setColumnMaxWidth(5, 30);
$table->render(); $table->render();
} }

View file

@ -79,7 +79,7 @@ class AttachmentTypeController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="attachment_type_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="attachment_type_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @param AttachmentType $entity * @param AttachmentType $entity
@ -87,9 +87,9 @@ class AttachmentTypeController extends BaseAdminController
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(AttachmentType $entity, Request $request, EntityManagerInterface $em): Response public function edit(AttachmentType $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -42,6 +42,7 @@ declare(strict_types=1);
namespace App\Controller\AdminPages; namespace App\Controller\AdminPages;
use App\DataTables\LogDataTable;
use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
@ -52,9 +53,13 @@ use App\Services\Attachments\AttachmentManager;
use App\Services\Attachments\AttachmentSubmitHandler; use App\Services\Attachments\AttachmentSubmitHandler;
use App\Services\EntityExporter; use App\Services\EntityExporter;
use App\Services\EntityImporter; use App\Services\EntityImporter;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\LogSystem\HistoryHelper;
use App\Services\LogSystem\TimeTravel;
use App\Services\StructuralElementRecursionHelper; use App\Services\StructuralElementRecursionHelper;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use InvalidArgumentException; use InvalidArgumentException;
use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
@ -77,9 +82,16 @@ abstract class BaseAdminController extends AbstractController
protected $translator; protected $translator;
protected $attachmentHelper; protected $attachmentHelper;
protected $attachmentSubmitHandler; protected $attachmentSubmitHandler;
protected $commentHelper;
protected $historyHelper;
protected $timeTravel;
protected $dataTableFactory;
public function __construct(TranslatorInterface $translator, UserPasswordEncoderInterface $passwordEncoder, public function __construct(TranslatorInterface $translator, UserPasswordEncoderInterface $passwordEncoder,
AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler) AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler,
EventCommentHelper $commentHelper, HistoryHelper $historyHelper, TimeTravel $timeTravel,
DataTableFactory $dataTableFactory)
{ {
if ('' === $this->entity_class || '' === $this->form_class || '' === $this->twig_template || '' === $this->route_base) { if ('' === $this->entity_class || '' === $this->form_class || '' === $this->twig_template || '' === $this->route_base) {
throw new InvalidArgumentException('You have to override the $entity_class, $form_class, $route_base and $twig_template value in your subclasss!'); throw new InvalidArgumentException('You have to override the $entity_class, $form_class, $route_base and $twig_template value in your subclasss!');
@ -93,14 +105,54 @@ abstract class BaseAdminController extends AbstractController
$this->passwordEncoder = $passwordEncoder; $this->passwordEncoder = $passwordEncoder;
$this->attachmentHelper = $attachmentHelper; $this->attachmentHelper = $attachmentHelper;
$this->attachmentSubmitHandler = $attachmentSubmitHandler; $this->attachmentSubmitHandler = $attachmentSubmitHandler;
$this->commentHelper = $commentHelper;
$this->historyHelper = $historyHelper;
$this->timeTravel = $timeTravel;
$this->dataTableFactory = $dataTableFactory;
} }
protected function _edit(AbstractNamedDBElement $entity, Request $request, EntityManagerInterface $em) : Response protected function _edit(AbstractNamedDBElement $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null) : Response
{ {
$this->denyAccessUnlessGranted('read', $entity); $this->denyAccessUnlessGranted('read', $entity);
$form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]);
$timeTravel_timestamp = null;
if ($timestamp !== null) {
$this->denyAccessUnlessGranted('@tools.timeTravel');
$this->denyAccessUnlessGranted('show_history', $entity);
//If the timestamp only contains numbers interpret it as unix timestamp
if (ctype_digit($timestamp)) {
$timeTravel_timestamp = new \DateTime();
$timeTravel_timestamp->setTimestamp((int) $timestamp);
} else { //Try to parse it via DateTime
$timeTravel_timestamp = new \DateTime($timestamp);
}
$this->timeTravel->revertEntityToTimestamp($entity, $timeTravel_timestamp);
}
if ($this->isGranted('show_history', $entity) ) {
$table = $this->dataTableFactory->createFromType(
LogDataTable::class,
[
'filter_elements' => $this->historyHelper->getAssociatedElements($entity),
'mode' => 'element_history'
],
['pageLength' => 10]
)
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
}
} else {
$table = null;
}
$form = $this->createForm($this->form_class, $entity, [
'attachment_class' => $this->attachment_class,
'disabled' => $timeTravel_timestamp !== null ? true : null
]);
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
@ -131,6 +183,8 @@ abstract class BaseAdminController extends AbstractController
} }
} }
$this->commentHelper->setMessage($form['log_comment']->getData());
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
$this->addFlash('success', 'entity.edit_flash'); $this->addFlash('success', 'entity.edit_flash');
@ -146,6 +200,9 @@ abstract class BaseAdminController extends AbstractController
'entity' => $entity, 'entity' => $entity,
'form' => $form->createView(), 'form' => $form->createView(),
'attachment_helper' => $this->attachmentHelper, 'attachment_helper' => $this->attachmentHelper,
'route_base' => $this->route_base,
'datatable' => $table,
'timeTravel' => $timeTravel_timestamp
]); ]);
} }
@ -188,6 +245,8 @@ abstract class BaseAdminController extends AbstractController
} }
} }
$this->commentHelper->setMessage($form['log_comment']->getData());
$em->persist($new_entity); $em->persist($new_entity);
$em->flush(); $em->flush();
$this->addFlash('success', 'entity.created_flash'); $this->addFlash('success', 'entity.created_flash');
@ -215,6 +274,10 @@ abstract class BaseAdminController extends AbstractController
'csv_separator' => $data['csv_separator'], 'csv_separator' => $data['csv_separator'],
]; ];
$this->commentHelper->setMessage('Import ' . $file->getClientOriginalName());
$errors = $importer->fileToDBEntities($file, $this->entity_class, $options); $errors = $importer->fileToDBEntities($file, $this->entity_class, $options);
foreach ($errors as $name => $error) { foreach ($errors as $name => $error) {
@ -252,6 +315,7 @@ abstract class BaseAdminController extends AbstractController
'import_form' => $import_form->createView(), 'import_form' => $import_form->createView(),
'mass_creation_form' => $mass_creation_form->createView(), 'mass_creation_form' => $mass_creation_form->createView(),
'attachment_helper' => $this->attachmentHelper, 'attachment_helper' => $this->attachmentHelper,
'route_base' => $this->route_base,
]); ]);
} }
@ -280,6 +344,8 @@ abstract class BaseAdminController extends AbstractController
$entityManager->remove($entity); $entityManager->remove($entity);
} }
$this->commentHelper->setMessage($request->request->get('log_comment', null));
//Flush changes //Flush changes
$entityManager->flush(); $entityManager->flush();

View file

@ -79,7 +79,7 @@ class CategoryController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="category_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="category_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @param Category $entity * @param Category $entity
@ -87,9 +87,9 @@ class CategoryController extends BaseAdminController
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Category $entity, Request $request, EntityManagerInterface $em): Response public function edit(Category $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -81,7 +81,7 @@ class CurrencyController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="currency_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="currency_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @param Currency $entity * @param Currency $entity
@ -89,9 +89,9 @@ class CurrencyController extends BaseAdminController
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Currency $entity, Request $request, EntityManagerInterface $em): Response public function edit(Currency $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -79,7 +79,7 @@ class DeviceController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="device_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="device_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @param Device $entity * @param Device $entity
@ -87,9 +87,9 @@ class DeviceController extends BaseAdminController
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Device $entity, Request $request, EntityManagerInterface $em): Response public function edit(Device $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -78,16 +78,16 @@ class FootprintController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="footprint_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="footprint_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* @param Footprint $entity * @param Footprint $entity
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Footprint $entity, Request $request, EntityManagerInterface $em) public function edit(Footprint $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -77,16 +77,16 @@ class ManufacturerController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="manufacturer_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="manufacturer_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* @param Manufacturer $entity * @param Manufacturer $entity
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Manufacturer $entity, Request $request, EntityManagerInterface $em) public function edit(Manufacturer $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -78,16 +78,16 @@ class MeasurementUnitController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="measurement_unit_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="measurement_unit_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* @param MeasurementUnit $entity * @param MeasurementUnit $entity
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(MeasurementUnit $entity, Request $request, EntityManagerInterface $em) public function edit(MeasurementUnit $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -76,16 +76,16 @@ class StorelocationController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="store_location_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="store_location_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* @param Storelocation $entity * @param Storelocation $entity
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Storelocation $entity, Request $request, EntityManagerInterface $em) public function edit(Storelocation $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -77,16 +77,16 @@ class SupplierController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="supplier_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="supplier_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* @param Supplier $entity * @param Supplier $entity
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Supplier $entity, Request $request, EntityManagerInterface $em) public function edit(Supplier $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -67,7 +67,7 @@ class GroupController extends BaseAdminController
protected $attachment_class = GroupAttachment::class; protected $attachment_class = GroupAttachment::class;
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="group_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="group_edit")
* @Route("/{id}/", requirements={"id"="\d+"}) * @Route("/{id}/", requirements={"id"="\d+"})
* *
* @param Group $entity * @param Group $entity
@ -75,9 +75,9 @@ class GroupController extends BaseAdminController
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @return Response * @return Response
*/ */
public function edit(Group $entity, Request $request, EntityManagerInterface $em): Response public function edit(Group $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -42,7 +42,11 @@ declare(strict_types=1);
namespace App\Controller; namespace App\Controller;
use App\DataTables\LogDataTable;
use App\Services\GitVersionInfo; use App\Services\GitVersionInfo;
use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use const DIRECTORY_SEPARATOR; use const DIRECTORY_SEPARATOR;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
@ -53,11 +57,13 @@ class HomepageController extends AbstractController
{ {
protected $cache; protected $cache;
protected $kernel; protected $kernel;
protected $dataTable;
public function __construct(CacheInterface $cache, KernelInterface $kernel) public function __construct(CacheInterface $cache, KernelInterface $kernel, DataTableFactory $dataTable)
{ {
$this->cache = $cache; $this->cache = $cache;
$this->kernel = $kernel; $this->kernel = $kernel;
$this->dataTable = $dataTable;
} }
public function getBanner(): string public function getBanner(): string
@ -78,12 +84,30 @@ class HomepageController extends AbstractController
* @param GitVersionInfo $versionInfo * @param GitVersionInfo $versionInfo
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function homepage(GitVersionInfo $versionInfo): \Symfony\Component\HttpFoundation\Response public function homepage(Request $request, GitVersionInfo $versionInfo): Response
{ {
if ($this->isGranted("@tools.lastActivity")) {
$table = $this->dataTable->createFromType(
LogDataTable::class,
[
'mode' => 'last_activity'
],
['pageLength' => 10]
)
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
}
} else {
$table = null;
}
return $this->render('homepage.html.twig', [ return $this->render('homepage.html.twig', [
'banner' => $this->getBanner(), 'banner' => $this->getBanner(),
'git_branch' => $versionInfo->getGitBranchName(), 'git_branch' => $versionInfo->getGitBranchName(),
'git_commit' => $versionInfo->getGitCommitHash(), 'git_commit' => $versionInfo->getGitCommitHash(),
'datatable' => $table
]); ]);
} }
} }

View file

@ -43,9 +43,20 @@ declare(strict_types=1);
namespace App\Controller; namespace App\Controller;
use App\DataTables\LogDataTable; use App\DataTables\LogDataTable;
use App\Entity\Base\AbstractDBElement;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry;
use App\Entity\LogSystem\ElementEditedLogEntry;
use App\Services\LogSystem\EventUndoHelper;
use App\Services\LogSystem\TimeTravel;
use Doctrine\ORM\EntityManagerInterface;
use Omines\DataTablesBundle\DataTableFactory; use Omines\DataTablesBundle\DataTableFactory;
use phpDocumentor\Reflection\Element;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
@ -55,6 +66,18 @@ use Symfony\Component\Routing\Annotation\Route;
*/ */
class LogController extends AbstractController class LogController extends AbstractController
{ {
protected $entityManager;
protected $timeTravel;
protected $dbRepository;
public function __construct(EntityManagerInterface $entityManager, TimeTravel $timeTravel)
{
$this->entityManager = $entityManager;
$this->timeTravel = $timeTravel;
$this->dbRepository = $entityManager->getRepository(AbstractDBElement::class);
}
/** /**
* @Route("/", name="log_view") * @Route("/", name="log_view")
* *
@ -77,4 +100,107 @@ class LogController extends AbstractController
'datatable' => $table, 'datatable' => $table,
]); ]);
} }
/**
* @Route("/undo", name="log_undo", methods={"POST"})
* @param Request $request
*/
public function undoRevertLog(Request $request, EventUndoHelper $eventUndoHelper)
{
$mode = EventUndoHelper::MODE_UNDO;
$id = $request->request->get('undo');
//If no undo value was set check if a revert was set
if ($id === null) {
$id = $request->get('revert');
$mode = EventUndoHelper::MODE_REVERT;
}
$log_element = $this->entityManager->find(AbstractLogEntry::class, $id);
if ($log_element === null) {
throw new \InvalidArgumentException('No log entry with the given ID is existing!');
}
$this->denyAccessUnlessGranted('revert_element', $log_element->getTargetClass());
$eventUndoHelper->setMode($mode);
$eventUndoHelper->setUndoneEvent($log_element);
if ($mode === EventUndoHelper::MODE_UNDO) {
$this->undoLog($log_element);
} elseif ($mode === EventUndoHelper::MODE_REVERT) {
$this->revertLog($log_element);
}
$eventUndoHelper->clearUndoneEvent();
$redirect = $request->request->get('redirect_back');
return $this->redirect($redirect);
}
protected function revertLog(AbstractLogEntry $logEntry): void
{
$timestamp = $logEntry->getTimestamp();
$element = $this->entityManager->find($logEntry->getTargetClass(), $logEntry->getTargetID());
//If the element is not available in DB try to undelete it
if ($element === null) {
$element = $this->timeTravel->undeleteEntity($logEntry->getTargetClass(), $logEntry->getTargetID());
$this->entityManager->persist($element);
$this->entityManager->flush();
$this->dbRepository->changeID($element, $logEntry->getTargetID());
}
if (!$element instanceof AbstractDBElement) {
$this->addFlash('error', 'log.undo.target_not_found');
return;
}
$this->timeTravel->revertEntityToTimestamp($element, $timestamp);
$this->entityManager->flush();
$this->addFlash('success', 'log.undo.revert_success');
}
protected function undoLog(AbstractLogEntry $log_element): void
{
if ($log_element instanceof ElementDeletedLogEntry || $log_element instanceof CollectionElementDeleted) {
if ($log_element instanceof ElementDeletedLogEntry) {
$element_class = $log_element->getTargetClass();
$element_id = $log_element->getTargetID();
} else {
$element_class = $log_element->getDeletedElementClass();
$element_id = $log_element->getDeletedElementID();
}
//Check if the element we want to undelete already exits
if ($this->entityManager->find($element_class, $element_id) == null) {
$undeleted_element = $this->timeTravel->undeleteEntity($element_class, $element_id);
$this->entityManager->persist($undeleted_element);
$this->entityManager->flush();
$this->dbRepository->changeID($undeleted_element, $element_id);
$this->addFlash('success', 'log.undo.element_undelete_success');
} else {
$this->addFlash('warning', 'log.undo.element_element_already_undeleted');
}
} elseif ($log_element instanceof ElementCreatedLogEntry) {
$element = $this->entityManager->find($log_element->getTargetClass(), $log_element->getTargetID());
if ($element !== null) {
$this->entityManager->remove($element);
$this->entityManager->flush();
$this->addFlash('success', 'log.undo.element_delete_success');
} else {
$this->addFlash('warning', 'log.undo.element.element_already_delted');
}
} elseif ($log_element instanceof ElementEditedLogEntry) {
$element = $this->entityManager->find($log_element->getTargetClass(), $log_element->getTargetID());
if ($element instanceof AbstractDBElement) {
$this->timeTravel->applyEntry($element, $log_element);
$this->entityManager->flush();
$this->addFlash('success', 'log.undo.element_change_undone');
} else {
$this->addFlash('error', 'log.undo.do_undelete_before');
}
} else {
$this->addFlash('error', 'log.undo.log_type_invalid');
}
}
} }

View file

@ -42,6 +42,7 @@ declare(strict_types=1);
namespace App\Controller; namespace App\Controller;
use App\DataTables\LogDataTable;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use App\Exceptions\AttachmentDownloadException; use App\Exceptions\AttachmentDownloadException;
@ -49,8 +50,12 @@ use App\Form\Part\PartBaseType;
use App\Services\Attachments\AttachmentManager; use App\Services\Attachments\AttachmentManager;
use App\Services\Attachments\AttachmentSubmitHandler; use App\Services\Attachments\AttachmentSubmitHandler;
use App\Services\Attachments\PartPreviewGenerator; use App\Services\Attachments\PartPreviewGenerator;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\LogSystem\HistoryHelper;
use App\Services\LogSystem\TimeTravel;
use App\Services\PricedetailHelper; use App\Services\PricedetailHelper;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
@ -64,27 +69,70 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/ */
class PartController extends AbstractController class PartController extends AbstractController
{ {
protected $attachmentManager;
protected $pricedetailHelper;
protected $partPreviewGenerator;
protected $commentHelper;
public function __construct(AttachmentManager $attachmentManager, PricedetailHelper $pricedetailHelper,
PartPreviewGenerator $partPreviewGenerator, EventCommentHelper $commentHelper)
{
$this->attachmentManager = $attachmentManager;
$this->pricedetailHelper = $pricedetailHelper;
$this->partPreviewGenerator = $partPreviewGenerator;
$this->commentHelper = $commentHelper;
}
/** /**
* @Route("/{id}/info", name="part_info") * @Route("/{id}/info/{timestamp}", name="part_info")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @param Part $part * @param Part $part
* @param AttachmentManager $attachmentHelper
* @param PricedetailHelper $pricedetailHelper
* @param PartPreviewGenerator $previewGenerator
* @return Response * @return Response
* @throws \Exception
*/ */
public function show(Part $part, AttachmentManager $attachmentHelper, PricedetailHelper $pricedetailHelper, PartPreviewGenerator $previewGenerator): Response public function show(Part $part, Request $request, TimeTravel $timeTravel, HistoryHelper $historyHelper,
DataTableFactory $dataTable, ?string $timestamp = null): Response
{ {
$this->denyAccessUnlessGranted('read', $part); $this->denyAccessUnlessGranted('read', $part);
$timeTravel_timestamp = null;
if ($timestamp !== null) {
$this->denyAccessUnlessGranted('@tools.timeTravel');
$this->denyAccessUnlessGranted('show_history', $part);
//If the timestamp only contains numbers interpret it as unix timestamp
if (ctype_digit($timestamp)) {
$timeTravel_timestamp = new \DateTime();
$timeTravel_timestamp->setTimestamp((int) $timestamp);
} else { //Try to parse it via DateTime
$timeTravel_timestamp = new \DateTime($timestamp);
}
$timeTravel->revertEntityToTimestamp($part, $timeTravel_timestamp);
}
if ($this->isGranted('show_history', $part) ) {
$table = $dataTable->createFromType(LogDataTable::class, [
'filter_elements' => $historyHelper->getAssociatedElements($part),
'mode' => 'element_history'
], ['pageLength' => 10])
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
}
} else {
$table = null;
}
return $this->render( return $this->render(
'Parts/info/show_part_info.html.twig', 'Parts/info/show_part_info.html.twig',
[ [
'part' => $part, 'part' => $part,
'attachment_helper' => $attachmentHelper, 'datatable' => $table,
'pricedetail_helper' => $pricedetailHelper, 'attachment_helper' => $this->attachmentManager,
'pictures' => $previewGenerator->getPreviewAttachments($part), 'pricedetail_helper' => $this->pricedetailHelper,
'pictures' => $this->partPreviewGenerator->getPreviewAttachments($part),
'timeTravel' => $timeTravel_timestamp
] ]
); );
} }
@ -96,12 +144,11 @@ class PartController extends AbstractController
* @param Request $request * @param Request $request
* @param EntityManagerInterface $em * @param EntityManagerInterface $em
* @param TranslatorInterface $translator * @param TranslatorInterface $translator
* @param AttachmentManager $attachmentHelper
* @param AttachmentSubmitHandler $attachmentSubmitHandler * @param AttachmentSubmitHandler $attachmentSubmitHandler
* @return Response * @return Response
*/ */
public function edit(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator, public function edit(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler): Response AttachmentSubmitHandler $attachmentSubmitHandler): Response
{ {
$this->denyAccessUnlessGranted('edit', $part); $this->denyAccessUnlessGranted('edit', $part);
@ -128,6 +175,8 @@ class PartController extends AbstractController
} }
} }
$this->commentHelper->setMessage($form['log_comment']->getData());
$em->persist($part); $em->persist($part);
$em->flush(); $em->flush();
$this->addFlash('info', 'part.edited_flash'); $this->addFlash('info', 'part.edited_flash');
@ -141,7 +190,7 @@ class PartController extends AbstractController
[ [
'part' => $part, 'part' => $part,
'form' => $form->createView(), 'form' => $form->createView(),
'attachment_helper' => $attachmentHelper, 'attachment_helper' => $this->attachmentManager,
]); ]);
} }
@ -159,6 +208,8 @@ class PartController extends AbstractController
if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) { if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) {
$entityManager = $this->getDoctrine()->getManager(); $entityManager = $this->getDoctrine()->getManager();
$this->commentHelper->setMessage($request->request->get('log_comment', null));
//Remove part //Remove part
$entityManager->remove($part); $entityManager->remove($part);
@ -219,6 +270,8 @@ class PartController extends AbstractController
} }
} }
$this->commentHelper->setMessage($form['log_comment']->getData());
$em->persist($new_part); $em->persist($new_part);
$em->flush(); $em->flush();
$this->addFlash('success', 'part.created_flash'); $this->addFlash('success', 'part.created_flash');

View file

@ -69,7 +69,7 @@ class UserController extends AdminPages\BaseAdminController
protected $attachment_class = UserAttachment::class; protected $attachment_class = UserAttachment::class;
/** /**
* @Route("/{id}/edit", requirements={"id"="\d+"}, name="user_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="user_edit")
* @Route("/{id}/", requirements={"id"="\d+"}) * @Route("/{id}/", requirements={"id"="\d+"})
* @param User $entity * @param User $entity
* @param Request $request * @param Request $request
@ -77,7 +77,7 @@ class UserController extends AdminPages\BaseAdminController
* @return Response * @return Response
* @throws \Exception * @throws \Exception
*/ */
public function edit(User $entity, Request $request, EntityManagerInterface $em) public function edit(User $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null)
{ {
//Handle 2FA disabling //Handle 2FA disabling
@ -102,7 +102,7 @@ class UserController extends AdminPages\BaseAdminController
} }
} }
return $this->_edit($entity, $request, $em); return $this->_edit($entity, $request, $em, $timestamp);
} }
/** /**

View file

@ -0,0 +1,126 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\DataTables\Column;
use Omines\DataTablesBundle\Column\AbstractColumn;
use Symfony\Component\OptionsResolver\OptionsResolver;
class IconLinkColumn extends AbstractColumn
{
/**
* @inheritDoc
*/
public function normalize($value)
{
return $value;
}
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults([
'icon' => 'fas fa-fw fa-edit',
'title' => null,
'href' => null,
'disabled' => false,
]);
$resolver->setAllowedTypes('title', ['null', 'string', 'callable']);
$resolver->setAllowedTypes('icon', ['null', 'string', 'callable']);
$resolver->setAllowedTypes('href', ['null', 'string', 'callable']);
$resolver->setAllowedTypes('disabled', ['bool', 'callable']);
return $this;
}
public function render($value, $context)
{
$href = $this->getHref($value, $context);
$icon = $this->getIcon($value, $context);
$title = $this->getTitle($value, $context);
$disabled = $this->getDisabled($value, $context);
if ($href !== null) {
return sprintf(
'<a class="btn btn-primary btn-sm %s" href="%s" title="%s"><i class="%s"></i></a>',
$disabled ? 'disabled' : '',
$href,
$title,
$icon
);
}
return "";
}
protected function getDisabled($value, $context): bool
{
$provider = $this->options['disabled'];
if (is_bool($provider)) {
return $provider;
}
if (is_callable($provider)) {
return call_user_func($provider, $value, $context);
}
return false;
}
protected function getHref($value, $context): ?string
{
$provider = $this->options['href'];
if (is_string($provider)) {
return $provider;
}
if (is_callable($provider)) {
return call_user_func($provider, $value, $context);
}
return null;
}
protected function getIcon($value, $context): ?string
{
$provider = $this->options['icon'];
if (is_string($provider)) {
return $provider;
}
if (is_callable($provider)) {
return call_user_func($provider, $value, $context);
}
return null;
}
protected function getTitle($value, $context): ?string
{
$provider = $this->options['title'];
if (is_string($provider)) {
return $provider;
}
if (is_callable($provider)) {
return call_user_func($provider, $value, $context);
}
return null;
}
}

View file

@ -0,0 +1,93 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\DataTables\Column;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry;
use App\Entity\LogSystem\ElementEditedLogEntry;
use Omines\DataTablesBundle\Column\AbstractColumn;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
class RevertLogColumn extends AbstractColumn
{
protected $translator;
protected $security;
public function __construct(TranslatorInterface $translator, Security $security)
{
$this->translator = $translator;
$this->security = $security;
}
/**
* @inheritDoc
*/
public function normalize($value)
{
return $value;
}
public function render($value, $context)
{
$revertable = true;
if (
$context instanceof CollectionElementDeleted
|| ($context instanceof ElementDeletedLogEntry && $context->hasOldDataInformations())
) {
$icon = 'fa-trash-restore';
$title = $this->translator->trans('log.undo.undelete');
} elseif (
$context instanceof ElementCreatedLogEntry
|| ($context instanceof ElementEditedLogEntry && $context->hasOldDataInformations())
) {
$icon = 'fa-undo';
$title = $this->translator->trans('log.undo.undo');
} else {
return '';
}
$disabled = !$this->security->isGranted('revert_element', $context->getTargetClass());
$tmp = '<div class="btn-group btn-group-sm">';
$tmp .= sprintf(
'<button type="submit" class="btn btn-outline-secondary" name="undo" value="%d" %s><i class="fas fa-fw %s" title="%s"></i></button>',
$context->getID(),
$disabled ? 'disabled' : '',
$icon,
$title
);
$tmp .= sprintf(
'<button type="submit" class="btn btn-outline-secondary" name="revert" value="%d" %s><i class="fas fa-fw fa-backward" title="%s"></i></button>',
$context->getID(),
$disabled ? 'disabled' : '',
$this->translator->trans('log.undo.revert')
);
$tmp .= '</div>';
return $tmp;
}
}

View file

@ -42,36 +42,73 @@ declare(strict_types=1);
namespace App\DataTables; namespace App\DataTables;
use App\DataTables\Column\IconLinkColumn;
use App\DataTables\Column\LocaleDateTimeColumn; use App\DataTables\Column\LocaleDateTimeColumn;
use App\DataTables\Column\LogEntryExtraColumn; use App\DataTables\Column\LogEntryExtraColumn;
use App\DataTables\Column\LogEntryTargetColumn; use App\DataTables\Column\LogEntryTargetColumn;
use App\DataTables\Column\RevertLogColumn;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Contracts\TimeTravelInterface;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry;
use App\Entity\LogSystem\ElementEditedLogEntry;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User;
use App\Exceptions\EntityNotSupportedException;
use App\Services\ElementTypeNameGenerator; use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter; use Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter;
use Omines\DataTablesBundle\Column\TextColumn; use Omines\DataTablesBundle\Column\TextColumn;
use Omines\DataTablesBundle\DataTable; use Omines\DataTablesBundle\DataTable;
use Omines\DataTablesBundle\DataTableTypeInterface; use Omines\DataTablesBundle\DataTableTypeInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Flex\Options;
class LogDataTable implements DataTableTypeInterface class LogDataTable implements DataTableTypeInterface
{ {
protected $elementTypeNameGenerator; protected $elementTypeNameGenerator;
protected $translator; protected $translator;
protected $urlGenerator; protected $urlGenerator;
protected $entityURLGenerator;
protected $logRepo;
protected $security;
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator, public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator) UrlGeneratorInterface $urlGenerator, EntityURLGenerator $entityURLGenerator, EntityManagerInterface $entityManager, Security $security)
{ {
$this->elementTypeNameGenerator = $elementTypeNameGenerator; $this->elementTypeNameGenerator = $elementTypeNameGenerator;
$this->translator = $translator; $this->translator = $translator;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;
$this->entityURLGenerator = $entityURLGenerator;
$this->logRepo = $entityManager->getRepository(AbstractLogEntry::class);
$this->security = $security;
}
public function configureOptions(OptionsResolver $optionsResolver)
{
$optionsResolver->setDefaults([
'mode' => 'system_log',
'filter_elements' => [],
]);
$optionsResolver->setAllowedValues('mode', ['system_log', 'element_history', 'last_activity']);
} }
public function configure(DataTable $dataTable, array $options): void public function configure(DataTable $dataTable, array $options): void
{ {
$resolver = new OptionsResolver();
$this->configureOptions($resolver);
$options = $resolver->resolve($options);
$dataTable->add('symbol', TextColumn::class, [ $dataTable->add('symbol', TextColumn::class, [
'label' => '', 'label' => '',
'render' => function ($value, AbstractLogEntry $context) { 'render' => function ($value, AbstractLogEntry $context) {
@ -114,7 +151,11 @@ class LogDataTable implements DataTableTypeInterface
break; break;
} }
return sprintf('<i class="fas fa-fw %s"></i>', $symbol); return sprintf(
'<i class="fas fa-fw %s" title="%s"></i>',
$symbol,
$context->getLevelString()
);
}, },
]); ]);
@ -138,6 +179,7 @@ class LogDataTable implements DataTableTypeInterface
$dataTable->add('level', TextColumn::class, [ $dataTable->add('level', TextColumn::class, [
'label' => $this->translator->trans('log.level'), 'label' => $this->translator->trans('log.level'),
'visible' => $options['mode'] === 'system_log',
'propertyPath' => 'levelString', 'propertyPath' => 'levelString',
'render' => function (string $value, AbstractLogEntry $context) { 'render' => function (string $value, AbstractLogEntry $context) {
return $value; return $value;
@ -178,21 +220,77 @@ class LogDataTable implements DataTableTypeInterface
'label' => $this->translator->trans('log.extra'), 'label' => $this->translator->trans('log.extra'),
]); ]);
$dataTable->add('timeTravel', IconLinkColumn::class,[
'label' => '',
'icon' => 'fas fa-fw fa-eye',
'href' => function ($value, AbstractLogEntry $context) {
if (
($context instanceof TimeTravelInterface
&& $context->hasOldDataInformations())
|| $context instanceof CollectionElementDeleted
) {
try {
$target = $this->logRepo->getTargetElement($context);
if($target !== null) {
$str = $this->entityURLGenerator->timeTravelURL($target, $context->getTimestamp());
return $str;
}
} catch (EntityNotSupportedException $exception) {
return null;
}
}
return null;
},
'disabled' => function ($value, AbstractLogEntry $context) {
return
!$this->security->isGranted('@tools.timetravel')
|| !$this->security->isGranted('show_history', $context->getTargetClass());
}
]);
$dataTable->add('actionRevert', RevertLogColumn::class, [
'label' => ''
]);
$dataTable->addOrderBy('timestamp', DataTable::SORT_DESCENDING); $dataTable->addOrderBy('timestamp', DataTable::SORT_DESCENDING);
$dataTable->createAdapter(ORMAdapter::class, [ $dataTable->createAdapter(ORMAdapter::class, [
'entity' => AbstractLogEntry::class, 'entity' => AbstractLogEntry::class,
'query' => function (QueryBuilder $builder): void { 'query' => function (QueryBuilder $builder) use ($options): void {
$this->getQuery($builder); $this->getQuery($builder, $options);
}, },
]); ]);
} }
protected function getQuery(QueryBuilder $builder): void protected function getQuery(QueryBuilder $builder, array $options): void
{ {
$builder->distinct()->select('log') $builder->distinct()->select('log')
->addSelect('user') ->addSelect('user')
->from(AbstractLogEntry::class, 'log') ->from(AbstractLogEntry::class, 'log')
->leftJoin('log.user', 'user'); ->leftJoin('log.user', 'user');
if ($options['mode'] === 'last_activity') {
$builder->where('log INSTANCE OF ' . ElementCreatedLogEntry::class)
->orWhere('log INSTANCE OF ' . ElementDeletedLogEntry::class)
->orWhere('log INSTANCE OF ' . ElementEditedLogEntry::class)
->orWhere('log INSTANCE OF ' . CollectionElementDeleted::class)
->andWhere('log.target_type NOT IN (:disallowed)');;
$builder->setParameter('disallowed', [
AbstractLogEntry::targetTypeClassToID(User::class),
AbstractLogEntry::targetTypeClassToID(Group::class),
]);
}
if (!empty($options['filter_elements'])) {
foreach ($options['filter_elements'] as $element) {
/** @var AbstractDBElement $element */
$target_type = AbstractLogEntry::targetTypeClassToID(get_class($element));
$target_id = $element->getID();
$builder->orWhere("log.target_type = $target_type AND log.target_id = $target_id");
}
}
} }
} }

View file

@ -34,7 +34,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
* Every database table which are managed with this class (or a subclass of it) * Every database table which are managed with this class (or a subclass of it)
* must have the table row "id"!! The ID is the unique key to identify the elements. * must have the table row "id"!! The ID is the unique key to identify the elements.
* *
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass(repositoryClass="App\Repository\DBElementRepository")
* *
* @ORM\EntityListeners({"App\Security\EntityListeners\ElementPermissionListener"}) * @ORM\EntityListeners({"App\Security\EntityListeners\ElementPermissionListener"})
* *
@ -55,7 +55,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
* "user" = "App\Entity\User" * "user" = "App\Entity\User"
* }) * })
*/ */
abstract class AbstractDBElement abstract class AbstractDBElement implements \JsonSerializable
{ {
/** @var int|null The Identification number for this part. This value is unique for the element in this table. /** @var int|null The Identification number for this part. This value is unique for the element in this table.
* Null if the element is not saved to DB yet. * Null if the element is not saved to DB yet.
@ -92,4 +92,9 @@ abstract class AbstractDBElement
* @return string The ID as a string; * @return string The ID as a string;
*/ */
abstract public function getIDString(): string; abstract public function getIDString(): string;
public function jsonSerialize()
{
return ['@id' => $this->getID()];
}
} }

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace App\Entity\Base; namespace App\Entity\Base;
use App\Entity\Contracts\NamedElementInterface; use App\Entity\Contracts\NamedElementInterface;
use App\Entity\Contracts\TimeStampableInterface;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -30,10 +31,10 @@ use Symfony\Component\Validator\Constraints as Assert;
/** /**
* All subclasses of this class have an attribute "name". * All subclasses of this class have an attribute "name".
* *
* @ORM\MappedSuperclass(repositoryClass="App\Repository\UserRepository") * @ORM\MappedSuperclass(repositoryClass="App\Repository\NamedDBElement")
* @ORM\HasLifecycleCallbacks() * @ORM\HasLifecycleCallbacks()
*/ */
abstract class AbstractNamedDBElement extends AbstractDBElement implements NamedElementInterface abstract class AbstractNamedDBElement extends AbstractDBElement implements NamedElementInterface, TimeStampableInterface
{ {
use TimestampTrait; use TimestampTrait;

View file

@ -0,0 +1,45 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Entity\Contracts;
interface LogWithCommentInterface
{
/**
* Checks if this log entry has a user provided comment.
* @return bool
*/
public function hasComment(): bool;
/**
* Gets the user provided comment associated with this log entry.
* Returns null if not comment was set.
* @return string|null
*/
public function getComment(): ?string;
/**
* Sets the user provided comment associated with this log entry.
* @param string|null $new_comment
* @return $this
*/
public function setComment(?string $new_comment): self;
}

View file

@ -0,0 +1,55 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Entity\Contracts;
use App\Entity\LogSystem\AbstractLogEntry;
interface LogWithEventUndoInterface
{
/**
* Checks if this element undoes another event.
* @return bool
*/
public function isUndoEvent(): bool;
/**
* Returns the ID of the undone event or null if no event is undone.
* @return int|null
*/
public function getUndoEventID(): ?int;
/**
* Sets the event that is undone, and the undo mode.
* @param AbstractLogEntry $event
* @param string $mode
* @return $this
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): self;
/**
* Returns the mode how the event was undone:
* "undo" = Only a single event was applied to element
* "revert" = Element was reverted to the state it was to the timestamp of the log.
* @return string
*/
public function getUndoMode(): string;
}

View file

@ -0,0 +1,44 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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\Entity\Contracts;
use DateTime;
interface TimeStampableInterface
{
/**
* Returns the last time when the element was modified.
* Returns null if the element was not yet saved to DB yet.
*
* @return DateTime|null the time of the last edit
*/
public function getLastModified(): ?DateTime;
/**
* Returns the date/time when the element was created.
* Returns null if the element was not yet saved to DB yet.
*
* @return DateTime|null the creation time of the part
*/
public function getAddedDate(): ?DateTime;
}

View file

@ -0,0 +1,41 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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\Entity\Contracts;
interface TimeTravelInterface
{
/**
* Checks if this entry has informations which data has changed.
* @return bool True if this entry has informations about the changed data.
*/
public function hasOldDataInformations(): bool;
/** Returns the data the entity had before this log entry. */
public function getOldData(): array;
/**
* Returns the the timestamp associated with this change.
* @return \DateTime
*/
public function getTimestamp(): \DateTime;
}

View file

@ -81,7 +81,8 @@ use Psr\Log\LogLevel;
* 7 = "ElementEditedLogEntry", * 7 = "ElementEditedLogEntry",
* 8 = "ConfigChangedLogEntry", * 8 = "ConfigChangedLogEntry",
* 9 = "InstockChangedLogEntry", * 9 = "InstockChangedLogEntry",
* 10 = "DatabaseUpdatedLogEntry" * 10 = "DatabaseUpdatedLogEntry",
* 11 = "CollectionElementDeleted"
* }) * })
*/ */
abstract class AbstractLogEntry extends AbstractDBElement abstract class AbstractLogEntry extends AbstractDBElement
@ -367,6 +368,17 @@ abstract class AbstractLogEntry extends AbstractDBElement
return $this; return $this;
} }
/**
* Sets the target ID of the element associated with this element.
* @param int $target_id
* @return $this
*/
public function setTargetElementID(int $target_id): self
{
$this->target_id = $target_id;
return $this;
}
public function getExtraData(): array public function getExtraData(): array
{ {
return $this->extra; return $this->extra;

View file

@ -0,0 +1,136 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Entity\LogSystem;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Contracts\LogWithEventUndoInterface;
use App\Entity\Contracts\NamedElementInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
* This log entry is created when an element is deleted, that is used in a collection of an other entity.
* This is needed to signal time travel, that it has to undelete the deleted entity.
*/
class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventUndoInterface
{
protected $typeString = 'collection_element_deleted';
protected $level = self::LEVEL_INFO;
public function __construct(AbstractDBElement $changed_element, string $collection_name, AbstractDBElement $deletedElement)
{
parent::__construct();
$this->level = self::LEVEL_INFO;
$this->setTargetElement($changed_element);
$this->extra['n'] = $collection_name;
$this->extra['c'] = self::targetTypeClassToID(get_class($deletedElement));
$this->extra['i'] = $deletedElement->getID();
if ($deletedElement instanceof NamedElementInterface) {
$this->extra['o'] = $deletedElement->getName();
}
}
/**
* Get the name of the collection (on target element) that was changed.
* @return string
*/
public function getCollectionName(): string
{
return $this->extra['n'];
}
/**
* Gets the name of the element that was deleted.
* Return null, if the element did not have a name.
* @return string|null
*/
public function getOldName(): ?string
{
return $this->extra['o'] ?? null;
}
/**
* Returns the class of the deleted element.
* @return string
*/
public function getDeletedElementClass(): string
{
return self::targetTypeIdToClass($this->extra['c']);
}
/**
* Returns the ID of the deleted element.
* @return int
*/
public function getDeletedElementID(): int
{
return $this->extra['i'];
}
/**
* @inheritDoc
*/
public function isUndoEvent(): bool
{
return isset($this->extra['u']);
}
/**
* @inheritDoc
*/
public function getUndoEventID(): ?int
{
return $this->extra['u'] ?? null;
}
/**
* @inheritDoc
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): LogWithEventUndoInterface
{
$this->extra['u'] = $event->getID();
if ($mode === 'undo') {
$this->extra['um'] = 1;
} elseif ($mode === 'revert') {
$this->extra['um'] = 2;
} else {
throw new \InvalidArgumentException('Passed invalid $mode!');
}
return $this;
}
/**
* @inheritDoc
*/
public function getUndoMode(): string
{
$mode_int = $this->extra['um'] ?? 1;
if ($mode_int === 1) {
return 'undo';
} else {
return 'revert';
}
}
}

View file

@ -43,12 +43,16 @@ declare(strict_types=1);
namespace App\Entity\LogSystem; namespace App\Entity\LogSystem;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Contracts\LogWithCommentInterface;
use App\Entity\Contracts\LogWithEventUndoInterface;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* @ORM\Entity() * @ORM\Entity()
*/ */
class ElementCreatedLogEntry extends AbstractLogEntry class ElementCreatedLogEntry extends AbstractLogEntry implements LogWithCommentInterface, LogWithEventUndoInterface
{ {
protected $typeString = 'element_created'; protected $typeString = 'element_created';
@ -57,6 +61,11 @@ class ElementCreatedLogEntry extends AbstractLogEntry
parent::__construct(); parent::__construct();
$this->level = self::LEVEL_INFO; $this->level = self::LEVEL_INFO;
$this->setTargetElement($new_element); $this->setTargetElement($new_element);
//Creation of new users is maybe more interesting...
if ($new_element instanceof User || $new_element instanceof Group) {
$this->level = self::LEVEL_NOTICE;
}
} }
/** /**
@ -78,4 +87,76 @@ class ElementCreatedLogEntry extends AbstractLogEntry
{ {
return null !== $this->getCreationInstockValue(); return null !== $this->getCreationInstockValue();
} }
/**
* @inheritDoc
*/
public function hasComment(): bool
{
return isset($this->extra['m']);
}
/**
* @inheritDoc
*/
public function getComment(): ?string
{
return $this->extra['m'] ?? null;
}
/**
* @inheritDoc
*/
public function setComment(?string $new_comment): LogWithCommentInterface
{
$this->extra['m'] = $new_comment;
return $this;
}
/**
* @inheritDoc
*/
public function isUndoEvent(): bool
{
return isset($this->extra['u']);
}
/**
* @inheritDoc
*/
public function getUndoEventID(): ?int
{
return $this->extra['u'] ?? null;
}
/**
* @inheritDoc
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): LogWithEventUndoInterface
{
$this->extra['u'] = $event->getID();
if ($mode === 'undo') {
$this->extra['um'] = 1;
} elseif ($mode === 'revert') {
$this->extra['um'] = 2;
} else {
throw new \InvalidArgumentException('Passed invalid $mode!');
}
return $this;
}
/**
* @inheritDoc
*/
public function getUndoMode(): string
{
$mode_int = $this->extra['um'] ?? 1;
if ($mode_int === 1) {
return 'undo';
} else {
return 'revert';
}
}
} }

View file

@ -43,13 +43,18 @@ declare(strict_types=1);
namespace App\Entity\LogSystem; namespace App\Entity\LogSystem;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Contracts\LogWithCommentInterface;
use App\Entity\Contracts\LogWithEventUndoInterface;
use App\Entity\Contracts\NamedElementInterface; use App\Entity\Contracts\NamedElementInterface;
use App\Entity\Contracts\TimeTravelInterface;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* @ORM\Entity() * @ORM\Entity()
*/ */
class ElementDeletedLogEntry extends AbstractLogEntry class ElementDeletedLogEntry extends AbstractLogEntry implements TimeTravelInterface, LogWithCommentInterface, LogWithEventUndoInterface
{ {
protected $typeString = 'element_deleted'; protected $typeString = 'element_deleted';
@ -58,6 +63,11 @@ class ElementDeletedLogEntry extends AbstractLogEntry
parent::__construct(); parent::__construct();
$this->level = self::LEVEL_INFO; $this->level = self::LEVEL_INFO;
$this->setTargetElement($deleted_element); $this->setTargetElement($deleted_element);
//Deletion of a user is maybe more interesting...
if ($deleted_element instanceof User || $deleted_element instanceof Group) {
$this->level = self::LEVEL_NOTICE;
}
} }
/** /**
@ -83,4 +93,102 @@ class ElementDeletedLogEntry extends AbstractLogEntry
{ {
return $this->extra['n'] ?? null; return $this->extra['n'] ?? null;
} }
/**
* Sets the old data for this entry.
* @param array $old_data
* @return $this
*/
public function setOldData(array $old_data): self
{
$this->extra['o'] = $old_data;
return $this;
}
/**
* @inheritDoc
*/
public function hasOldDataInformations(): bool
{
return !empty($this->extra['o']);
}
/**
* @inheritDoc
*/
public function getOldData(): array
{
return $this->extra['o'] ?? [];
}
/**
* @inheritDoc
*/
public function hasComment(): bool
{
return isset($this->extra['m']);
}
/**
* @inheritDoc
*/
public function getComment(): ?string
{
return $this->extra['m'] ?? null;
}
/**
* @inheritDoc
*/
public function setComment(?string $new_comment): LogWithCommentInterface
{
$this->extra['m'] = $new_comment;
return $this;
}
/**
* @inheritDoc
*/
public function isUndoEvent(): bool
{
return isset($this->extra['u']);
}
/**
* @inheritDoc
*/
public function getUndoEventID(): ?int
{
return $this->extra['u'] ?? null;
}
/**
* @inheritDoc
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): LogWithEventUndoInterface
{
$this->extra['u'] = $event->getID();
if ($mode === 'undo') {
$this->extra['um'] = 1;
} elseif ($mode === 'revert') {
$this->extra['um'] = 2;
} else {
throw new \InvalidArgumentException('Passed invalid $mode!');
}
return $this;
}
/**
* @inheritDoc
*/
public function getUndoMode(): string
{
$mode_int = $this->extra['um'] ?? 1;
if ($mode_int === 1) {
return 'undo';
}
return 'revert';
}
} }

View file

@ -43,12 +43,15 @@ declare(strict_types=1);
namespace App\Entity\LogSystem; namespace App\Entity\LogSystem;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Contracts\LogWithCommentInterface;
use App\Entity\Contracts\LogWithEventUndoInterface;
use App\Entity\Contracts\TimeTravelInterface;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
* @ORM\Entity() * @ORM\Entity()
*/ */
class ElementEditedLogEntry extends AbstractLogEntry class ElementEditedLogEntry extends AbstractLogEntry implements TimeTravelInterface, LogWithCommentInterface, LogWithEventUndoInterface
{ {
protected $typeString = 'element_edited'; protected $typeString = 'element_edited';
@ -61,12 +64,138 @@ class ElementEditedLogEntry extends AbstractLogEntry
} }
/** /**
* Returns the message associated with this edit change. * Checks if this log contains infos about which fields has changed.
* * @return bool
* @return string
*/ */
public function getMessage(): string public function hasChangedFieldsInfo(): bool
{ {
return $this->extra['m'] ?? ''; return isset($this->extra['f']) || $this->hasOldDataInformations();
}
/**
* Return the names of all fields that were changed during the change.
* @return string[]
*/
public function getChangedFields(): array
{
if ($this->hasOldDataInformations()) {
return array_keys($this->getOldData());
}
if (isset($this->extra['f'])) {
return $this->extra['f'];
}
return [];
}
/**
* Set the fields that were changed during this element change.
* @param string[] $changed_fields The names of the fields that were changed during the elements
* @return $this
*/
public function setChangedFields(array $changed_fields): self
{
$this->extra['f'] = $changed_fields;
return $this;
}
/**
* Sets the old data for this entry.
* @param array $old_data
* @return $this
*/
public function setOldData(array $old_data): self
{
$this->extra['d'] = $old_data;
return $this;
}
/**
* @inheritDoc
*/
public function hasOldDataInformations(): bool
{
return !empty($this->extra['d']);
}
/**
* @inheritDoc
*/
public function getOldData(): array
{
return $this->extra['d'] ?? [];
}
/**
* @inheritDoc
*/
public function hasComment(): bool
{
return isset($this->extra['m']);
}
/**
* @inheritDoc
*/
public function getComment(): ?string
{
return $this->extra['m'] ?? null;
}
/**
* @inheritDoc
*/
public function setComment(?string $new_comment): LogWithCommentInterface
{
$this->extra['m'] = $new_comment;
return $this;
}
/**
* @inheritDoc
*/
public function isUndoEvent(): bool
{
return isset($this->extra['u']);
}
/**
* @inheritDoc
*/
public function getUndoEventID(): ?int
{
return $this->extra['u'] ?? null;
}
/**
* @inheritDoc
*/
public function setUndoneEvent(AbstractLogEntry $event, string $mode = 'undo'): LogWithEventUndoInterface
{
$this->extra['u'] = $event->getID();
if ($mode === 'undo') {
$this->extra['um'] = 1;
} elseif ($mode === 'revert') {
$this->extra['um'] = 2;
} else {
throw new \InvalidArgumentException('Passed invalid $mode!');
}
return $this;
}
/**
* @inheritDoc
*/
public function getUndoMode(): string
{
$mode_int = $this->extra['um'] ?? 1;
if ($mode_int === 1) {
return 'undo';
} else {
return 'revert';
}
} }
} }

View file

@ -85,7 +85,7 @@ class Part extends AttachmentContainingDBElement
/** /**
* TODO. * TODO.
*/ */
protected $devices; protected $devices = [];
/** /**
* @ColumnSecurity(type="datetime") * @ColumnSecurity(type="datetime")

View file

@ -44,6 +44,7 @@ namespace App\Entity\Parts;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\TimestampTrait; use App\Entity\Base\TimestampTrait;
use App\Entity\Contracts\TimeStampableInterface;
use App\Validator\Constraints\Selectable; use App\Validator\Constraints\Selectable;
use App\Validator\Constraints\ValidPartLot; use App\Validator\Constraints\ValidPartLot;
use DateTime; use DateTime;
@ -60,7 +61,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\HasLifecycleCallbacks() * @ORM\HasLifecycleCallbacks()
* @ValidPartLot() * @ValidPartLot()
*/ */
class PartLot extends AbstractDBElement class PartLot extends AbstractDBElement implements TimeStampableInterface
{ {
use TimestampTrait; use TimestampTrait;

View file

@ -52,6 +52,7 @@ namespace App\Entity\PriceInformations;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\TimestampTrait; use App\Entity\Base\TimestampTrait;
use App\Entity\Contracts\TimeStampableInterface;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use App\Entity\Parts\Supplier; use App\Entity\Parts\Supplier;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
@ -66,7 +67,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity() * @ORM\Entity()
* @ORM\HasLifecycleCallbacks() * @ORM\HasLifecycleCallbacks()
*/ */
class Orderdetail extends AbstractDBElement class Orderdetail extends AbstractDBElement implements TimeStampableInterface
{ {
use TimestampTrait; use TimestampTrait;

View file

@ -52,6 +52,7 @@ namespace App\Entity\PriceInformations;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\TimestampTrait; use App\Entity\Base\TimestampTrait;
use App\Entity\Contracts\TimeStampableInterface;
use App\Validator\Constraints\Selectable; use App\Validator\Constraints\Selectable;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
@ -65,7 +66,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\HasLifecycleCallbacks() * @ORM\HasLifecycleCallbacks()
* @UniqueEntity(fields={"orderdetail", "min_discount_quantity"}) * @UniqueEntity(fields={"orderdetail", "min_discount_quantity"})
*/ */
class Pricedetail extends AbstractDBElement class Pricedetail extends AbstractDBElement implements TimeStampableInterface
{ {
use TimestampTrait; use TimestampTrait;

View file

@ -481,7 +481,7 @@ class PermissionsEmbed
*/ */
final protected static function readBitPair($data, int $n): int final protected static function readBitPair($data, int $n): int
{ {
Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); //Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
if (0 !== $n % 2) { if (0 !== $n % 2) {
throw new InvalidArgumentException('$n must be dividable by 2, because we address bit pairs here!'); throw new InvalidArgumentException('$n must be dividable by 2, because we address bit pairs here!');
} }
@ -501,7 +501,7 @@ class PermissionsEmbed
*/ */
final protected static function writeBitPair(int $data, int $n, int $new): int final protected static function writeBitPair(int $data, int $n, int $new): int
{ {
Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.'); //Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
Assert::lessThanEq($new, 3, '$new must be smaller than 3, because a bit pair is written! Got %s.'); Assert::lessThanEq($new, 3, '$new must be smaller than 3, because a bit pair is written! Got %s.');
Assert::greaterThanEq($new, 0, '$new must not be negative, because a bit pair is written! Got %s.'); Assert::greaterThanEq($new, 0, '$new must not be negative, because a bit pair is written! Got %s.');

View file

@ -20,25 +20,71 @@
namespace App\EventSubscriber; namespace App\EventSubscriber;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractPartsContainingDBElement;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementCreatedLogEntry; use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry; use App\Entity\LogSystem\ElementDeletedLogEntry;
use App\Entity\LogSystem\ElementEditedLogEntry; use App\Entity\LogSystem\ElementEditedLogEntry;
use App\Entity\Parts\PartLot;
use App\Entity\PriceInformations\Orderdetail;
use App\Entity\PriceInformations\Pricedetail;
use App\Entity\UserSystem\User;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\LogSystem\EventLogger; use App\Services\LogSystem\EventLogger;
use App\Services\LogSystem\EventUndoHelper;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Event\PostFlushEventArgs; use Doctrine\ORM\Event\PostFlushEventArgs;
use Doctrine\ORM\Events; use Doctrine\ORM\Events;
use Doctrine\Persistence\Event\LifecycleEventArgs; use Doctrine\Persistence\Event\LifecycleEventArgs;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Serializer\SerializerInterface;
class EventLoggerSubscriber implements EventSubscriber class EventLoggerSubscriber implements EventSubscriber
{ {
protected $logger; /** @var array The given fields will not be saved, because they contain sensitive informations */
protected const FIELD_BLACKLIST = [
User::class => ['password', 'need_pw_change', 'googleAuthenticatorSecret', 'backupCodes', 'trustedDeviceCookieVersion', 'pw_reset_token', 'backupCodesGenerationDate'],
];
public function __construct(EventLogger $logger) /** @var array If elements of the given class are deleted, a log for the given fields will be triggered */
protected const TRIGGER_ASSOCIATION_LOG_WHITELIST = [
PartLot::class => ['part'],
Orderdetail::class => ['part'],
Pricedetail::class => ['orderdetail'],
Attachment::class => ['element'],
];
protected const MAX_STRING_LENGTH = 2000;
protected $logger;
protected $serializer;
protected $eventCommentHelper;
protected $eventUndoHelper;
protected $save_changed_fields;
protected $save_changed_data;
protected $save_removed_data;
protected $propertyAccessor;
public function __construct(EventLogger $logger, SerializerInterface $serializer, EventCommentHelper $commentHelper,
bool $save_changed_fields, bool $save_changed_data, bool $save_removed_data, PropertyAccessorInterface $propertyAccessor,
EventUndoHelper $eventUndoHelper)
{ {
$this->logger = $logger; $this->logger = $logger;
$this->serializer = $serializer;
$this->eventCommentHelper = $commentHelper;
$this->propertyAccessor = $propertyAccessor;
$this->eventUndoHelper = $eventUndoHelper;
$this->save_changed_fields = $save_changed_fields;
$this->save_changed_data = $save_changed_data;
$this->save_removed_data = $save_removed_data;
} }
public function onFlush(OnFlushEventArgs $eventArgs) public function onFlush(OnFlushEventArgs $eventArgs)
@ -53,30 +99,43 @@ class EventLoggerSubscriber implements EventSubscriber
foreach ($uow->getScheduledEntityUpdates() as $entity) { foreach ($uow->getScheduledEntityUpdates() as $entity) {
if ($this->validEntity($entity)) { if ($this->validEntity($entity)) {
$log = new ElementEditedLogEntry($entity); $this->logElementEdited($entity, $em);
$this->logger->log($log);
} }
} }
foreach ($uow->getScheduledEntityDeletions() as $entity) { foreach ($uow->getScheduledEntityDeletions() as $entity) {
if ($this->validEntity($entity)) { if ($this->validEntity($entity)) {
$log = new ElementDeletedLogEntry($entity); $this->logElementDeleted($entity, $em);
$this->logger->log($log);
} }
} }
$uow->computeChangeSets(); $uow->computeChangeSets();
} }
public function postPersist(LifecycleEventArgs $args) public function postPersist(LifecycleEventArgs $args)
{ {
//Create an log entry //Create an log entry, we have to do this post persist, cause we have to know the ID
/** @var AbstractDBElement $entity */ /** @var AbstractDBElement $entity */
$entity = $args->getObject(); $entity = $args->getObject();
if ($this->validEntity($entity)) { if ($this->validEntity($entity)) {
$log = new ElementCreatedLogEntry($entity); $log = new ElementCreatedLogEntry($entity);
//Add user comment to log entry
if ($this->eventCommentHelper->isMessageSet()) {
$log->setComment($this->eventCommentHelper->getMessage());
}
if ($this->eventUndoHelper->isUndo()) {
$undoEvent = $this->eventUndoHelper->getUndoneEvent();
$log->setUndoneEvent($undoEvent, $this->eventUndoHelper->getMode());
if($undoEvent instanceof ElementDeletedLogEntry && $undoEvent->getTargetClass() === $log->getTargetClass()) {
$log->setTargetElementID($undoEvent->getTargetID());
}
if($undoEvent instanceof CollectionElementDeleted && $undoEvent->getDeletedElementClass() === $log->getTargetClass()) {
$log->setTargetElementID($undoEvent->getDeletedElementID());
}
}
$this->logger->log($log); $this->logger->log($log);
} }
} }
@ -89,6 +148,158 @@ class EventLoggerSubscriber implements EventSubscriber
if ($uow->hasPendingInsertions()) { if ($uow->hasPendingInsertions()) {
$em->flush(); $em->flush();
} }
//Clear the message provided by user.
$this->eventCommentHelper->clearMessage();
$this->eventUndoHelper->clearUndoneEvent();
}
protected function logElementDeleted(AbstractDBElement $entity, EntityManagerInterface $em): void
{
$log = new ElementDeletedLogEntry($entity);
//Add user comment to log entry
if ($this->eventCommentHelper->isMessageSet()) {
$log->setComment($this->eventCommentHelper->getMessage());
}
if ($this->eventUndoHelper->isUndo()) {
$log->setUndoneEvent($this->eventUndoHelper->getUndoneEvent(), $this->eventUndoHelper->getMode());
}
if ($this->save_removed_data) {
//The 4th param is important here, as we delete the element...
$this->saveChangeSet($entity, $log, $em, true);
}
$this->logger->log($log);
//Check if we have to log CollectionElementDeleted entries
if ($this->save_changed_data) {
$metadata = $em->getClassMetadata(get_class($entity));
$mappings = $metadata->getAssociationMappings();
//Check if class is whitelisted for CollectionElementDeleted entry
foreach (static::TRIGGER_ASSOCIATION_LOG_WHITELIST as $class => $whitelist) {
if (is_a($entity, $class)) {
//Check names
foreach ($mappings as $field => $mapping) {
if (in_array($field, $whitelist)) {
$changed = $this->propertyAccessor->getValue($entity, $field);
$log = new CollectionElementDeleted($changed, $mapping['inversedBy'], $entity);
if ($this->eventUndoHelper->isUndo()) {
$log->setUndoneEvent($this->eventUndoHelper->getUndoneEvent(), $this->eventUndoHelper->getMode());
}
$this->logger->log($log);
}
}
}
}
}
}
protected function logElementEdited(AbstractDBElement $entity, EntityManagerInterface $em): void
{
$uow = $em->getUnitOfWork();
$log = new ElementEditedLogEntry($entity);
if ($this->save_changed_data) {
$this->saveChangeSet($entity, $log, $em);
} elseif ($this->save_changed_fields) {
$changed_fields = array_keys($uow->getEntityChangeSet($entity));
//Remove lastModified field, as this is always changed (gives us no additional info)
$changed_fields = array_diff($changed_fields, ['lastModified']);
$log->setChangedFields($changed_fields);
}
//Add user comment to log entry
if ($this->eventCommentHelper->isMessageSet()) {
$log->setComment($this->eventCommentHelper->getMessage());
}
if ($this->eventUndoHelper->isUndo()) {
$log->setUndoneEvent($this->eventUndoHelper->getUndoneEvent(), $this->eventUndoHelper->getMode());
}
$this->logger->log($log);
}
/**
* Check if the given element class has restrictions to its fields
* @param AbstractDBElement $element
* @return bool True if there are restrictions, and further checking is needed
*/
public function hasFieldRestrictions(AbstractDBElement $element): bool
{
foreach (static::FIELD_BLACKLIST as $class => $blacklist) {
if (is_a($element, $class)) {
return true;
}
}
return false;
}
/**
* Filter out every forbidden field and return the cleaned array.
* @param AbstractDBElement $element
* @param array $fields
* @return array
*/
protected function filterFieldRestrictions(AbstractDBElement $element, array $fields): array
{
unset($fields['lastModified']);
if (!$this->hasFieldRestrictions($element)) {
return $fields;
}
return array_filter($fields, function ($value, $key) use ($element) {
//Associative array (save changed data) case
if (is_string($key)) {
return $this->shouldFieldBeSaved($element, $key);
}
return $this->shouldFieldBeSaved($element, $value);
}, ARRAY_FILTER_USE_BOTH);
}
/**
* Checks if the field of the given element should be saved (if it is not blacklisted).
* @param AbstractDBElement $element
* @param string $field_name
* @return bool
*/
public function shouldFieldBeSaved(AbstractDBElement $element, string $field_name): bool
{
foreach (static::FIELD_BLACKLIST as $class => $blacklist) {
if (is_a($element, $class) && in_array($field_name, $blacklist)) {
return false;
}
}
//By default allow every field.
return true;
}
protected function saveChangeSet(AbstractDBElement $entity, AbstractLogEntry $logEntry, EntityManagerInterface $em, $element_deleted = false): void
{
$uow = $em->getUnitOfWork();
if (!$logEntry instanceof ElementEditedLogEntry && !$logEntry instanceof ElementDeletedLogEntry) {
throw new \InvalidArgumentException('$logEntry must be ElementEditedLogEntry or ElementDeletedLogEntry!');
}
if ($element_deleted) { //If the element was deleted we can use getOriginalData to save its content
$old_data = $uow->getOriginalEntityData($entity);
} else { //Otherwise we have to get it from entity changeset
$changeSet = $uow->getEntityChangeSet($entity);
$old_data = array_combine(array_keys($changeSet), array_column($changeSet, 0));
}
$old_data = $this->filterFieldRestrictions($entity, $old_data);
//Restrict length of string fields, to save memory...
$old_data = array_map(function ($value) {
if (is_string($value)) {
return mb_strimwidth($value, 0, self::MAX_STRING_LENGTH, '...');
}
return $value;
}, $old_data);
$logEntry->setOldData($old_data);
} }
/** /**

View file

@ -144,6 +144,13 @@ class BaseEntityAdminForm extends AbstractType
'entity' => $entity, 'entity' => $entity,
]); ]);
$builder->add('log_comment', TextType::class, [
'label' => 'edit.log_comment',
'mapped' => false,
'required' => false,
'empty_data' => null,
]);
//Buttons //Buttons
$builder->add('save', SubmitType::class, [ $builder->add('save', SubmitType::class, [
'label' => $is_new ? 'entity.create' : 'entity.edit.save', 'label' => $is_new ? 'entity.create' : 'entity.edit.save',

View file

@ -264,6 +264,13 @@ class PartBaseType extends AbstractType
], ],
]); ]);
$builder->add('log_comment', TextType::class, [
'label' => 'edit.log_comment',
'mapped' => false,
'required' => false,
'empty_data' => null,
]);
$builder $builder
//Buttons //Buttons
->add('save', SubmitType::class, ['label' => 'part.edit.save']) ->add('save', SubmitType::class, ['label' => 'part.edit.save'])

View file

@ -250,6 +250,13 @@ class UserAdminForm extends AbstractType
'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
]); ]);
$builder->add('log_comment', TextType::class, [
'label' => 'edit.log_comment',
'mapped' => false,
'required' => false,
'empty_data' => null,
]);
//Buttons //Buttons
$builder->add('save', SubmitType::class, [ $builder->add('save', SubmitType::class, [
'label' => $is_new ? 'user.create' : 'user.edit.save', 'label' => $is_new ? 'user.create' : 'user.edit.save',

View file

@ -23,7 +23,7 @@ namespace App\Repository;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
class AttachmentRepository extends EntityRepository class AttachmentRepository extends DBElementRepository
{ {
/** /**
* Gets the count of all private/secure attachments. * Gets the count of all private/secure attachments.

View file

@ -0,0 +1,56 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Repository;
use App\Entity\Base\AbstractDBElement;
use Doctrine\ORM\EntityRepository;
class DBElementRepository extends EntityRepository
{
/**
* Changes the ID of the given element to a new value.
* You should only use it to undelete former existing elements, everything else is most likely a bad idea!
* @param AbstractDBElement $element The element whose ID should be changed
* @param int $new_id The new ID
*/
public function changeID(AbstractDBElement $element, int $new_id): void
{
$qb = $this->createQueryBuilder('element');
$q = $qb->update(get_class($element), 'element')
->set('element.id', $new_id)
->where('element.id = ?1')
->setParameter(1, $element->getID())
->getQuery();
$p = $q->execute();
$this->setField($element, 'id', $new_id);
}
protected function setField(AbstractDBElement $element, string $field, $new_value)
{
$reflection = new \ReflectionClass(get_class($element));
$property = $reflection->getProperty($field);
$property->setAccessible(true);
$property->setValue($element, $new_value);
}
}

View file

@ -44,13 +44,15 @@ namespace App\Repository;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementCreatedLogEntry; use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry;
use App\Entity\LogSystem\ElementEditedLogEntry; use App\Entity\LogSystem\ElementEditedLogEntry;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
class LogEntryRepository extends EntityRepository class LogEntryRepository extends DBElementRepository
{ {
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{ {
@ -81,6 +83,93 @@ class LogEntryRepository extends EntityRepository
return $this->findBy(['element' => $element], ['timestamp' => $order], $limit, $offset); return $this->findBy(['element' => $element], ['timestamp' => $order], $limit, $offset);
} }
/**
* Try to get a log entry that contains the information to undete a given element
* @param string $class The class of the element that should be undeleted
* @param int $id The ID of the element that should be deleted
* @return ElementDeletedLogEntry
*/
public function getUndeleteDataForElement(string $class, int $id): ElementDeletedLogEntry
{
$qb = $this->createQueryBuilder('log');
$qb->select('log')
//->where('log INSTANCE OF App\Entity\LogSystem\ElementEditedLogEntry')
->where('log INSTANCE OF ' . ElementDeletedLogEntry::class)
->andWhere('log.target_type = :target_type')
->andWhere('log.target_id = :target_id')
->orderBy('log.timestamp', 'DESC')
->setMaxResults(1);
$qb->setParameters([
'target_type' => AbstractLogEntry::targetTypeClassToID($class),
'target_id' => $id,
]);
$query = $qb->getQuery();
$results = $query->execute();
if (empty($results)) {
throw new \RuntimeException("No undelete data could be found for this element");
}
return $results[0];
}
/**
* Gets all log entries that are related to time travelling
* @param AbstractDBElement $element The element for which the time travel data should be retrieved
* @param \DateTime $until Back to which timestamp should the data be get (including the timestamp)
* @return AbstractLogEntry[]
*/
public function getTimetravelDataForElement(AbstractDBElement $element, \DateTime $until): array
{
$qb = $this->createQueryBuilder('log');
$qb->select('log')
//->where('log INSTANCE OF App\Entity\LogSystem\ElementEditedLogEntry')
->where('log INSTANCE OF ' . ElementEditedLogEntry::class)
->orWhere('log INSTANCE OF ' . CollectionElementDeleted::class)
->andWhere('log.target_type = :target_type')
->andWhere('log.target_id = :target_id')
->andWhere('log.timestamp >= :until')
->orderBy('log.timestamp', 'DESC');
$qb->setParameters([
'target_type' => AbstractLogEntry::targetTypeClassToID(get_class($element)),
'target_id' => $element->getID(),
'until' => $until
]);
$query = $qb->getQuery();
return $query->execute();
}
/**
* Check if the given element has existed at the given timestamp
* @param AbstractDBElement $element
* @param \DateTime $timestamp
* @return bool True if the element existed at the given timestamp
*/
public function getElementExistedAtTimestamp(AbstractDBElement $element, \DateTime $timestamp): bool
{
$qb = $this->createQueryBuilder('log');
$qb->select('count(log)')
->where('log INSTANCE OF ' . ElementCreatedLogEntry::class)
->andWhere('log.target_type = :target_type')
->andWhere('log.target_id = :target_id')
->andWhere('log.timestamp >= :until')
->orderBy('log.timestamp', 'DESC');
$qb->setParameters([
'target_type' => AbstractLogEntry::targetTypeClassToID(get_class($element)),
'target_id' => $element->getID(),
'until' => $timestamp
]);
$query = $qb->getQuery();
$count = $query->getSingleScalarResult();
return !($count > 0);
}
/** /**
* Gets the last log entries ordered by timestamp. * Gets the last log entries ordered by timestamp.
* *

View file

@ -46,7 +46,7 @@ use App\Entity\Base\AbstractNamedDBElement;
use App\Helpers\Trees\TreeViewNode; use App\Helpers\Trees\TreeViewNode;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
class NamedDBElementRepository extends EntityRepository class NamedDBElementRepository extends DBElementRepository
{ {
/** /**
* Gets a tree of TreeViewNode elements. The root elements has $parent as parent. * Gets a tree of TreeViewNode elements. The root elements has $parent as parent.

View file

@ -46,7 +46,7 @@ use App\Entity\Parts\PartLot;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
class PartRepository extends EntityRepository class PartRepository extends NamedDBElementRepository
{ {
/** /**
* Gets the summed up instock of all parts (only parts without an measurent unit) * Gets the summed up instock of all parts (only parts without an measurent unit)

View file

@ -58,13 +58,9 @@ class AttachmentVoter extends ExtendedVoter
*/ */
protected function voteOnUser($attribute, $subject, User $user): bool protected function voteOnUser($attribute, $subject, User $user): bool
{ {
if ($subject instanceof Attachment) {
return $this->resolver->inherit($user, 'parts_attachments', $attribute) ?? false; return $this->resolver->inherit($user, 'parts_attachments', $attribute) ?? false;
} }
return false;
}
/** /**
* Determines if the attribute and subject are supported by this voter. * Determines if the attribute and subject are supported by this voter.
* *
@ -75,10 +71,11 @@ class AttachmentVoter extends ExtendedVoter
*/ */
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if ($subject instanceof Attachment) { if (is_a($subject, Attachment::class, true)) {
return in_array($attribute, $this->resolver->listOperationsForPermission('parts_attachments'), false); return in_array($attribute, $this->resolver->listOperationsForPermission('parts_attachments'), false);
} }
//Allow class name as subject
return false; return false;
} }
} }

View file

@ -57,13 +57,9 @@ class GroupVoter extends ExtendedVoter
*/ */
protected function voteOnUser($attribute, $subject, User $user): bool protected function voteOnUser($attribute, $subject, User $user): bool
{ {
if ($subject instanceof Group) {
return $this->resolver->inherit($user, 'groups', $attribute) ?? false; return $this->resolver->inherit($user, 'groups', $attribute) ?? false;
} }
return false;
}
/** /**
* Determines if the attribute and subject are supported by this voter. * Determines if the attribute and subject are supported by this voter.
* *
@ -74,7 +70,7 @@ class GroupVoter extends ExtendedVoter
*/ */
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if ($subject instanceof Group) { if (is_a($subject, Group::class, true)) {
return $this->resolver->isValidOperation('groups', $attribute); return $this->resolver->isValidOperation('groups', $attribute);
} }

View file

@ -51,7 +51,6 @@ class LogEntryVoter extends ExtendedVoter
protected function voteOnUser($attribute, $subject, User $user): bool protected function voteOnUser($attribute, $subject, User $user): bool
{ {
if ($subject instanceof AbstractLogEntry) {
if ('delete' === $attribute) { if ('delete' === $attribute) {
return $this->resolver->inherit($user, 'system', 'delete_logs') ?? false; return $this->resolver->inherit($user, 'system', 'delete_logs') ?? false;
} }
@ -67,7 +66,6 @@ class LogEntryVoter extends ExtendedVoter
return $this->resolver->inherit($user, 'system', 'show_logs') ?? false; return $this->resolver->inherit($user, 'system', 'show_logs') ?? false;
} }
}
return false; return false;
} }

View file

@ -0,0 +1,59 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Security\Voter;
use App\Entity\Parts\PartLot;
use App\Entity\PriceInformations\Orderdetail;
use App\Entity\UserSystem\User;
class OrderdetailVoter extends ExtendedVoter
{
/** @var string[] When this permsission are encountered, they are checked on part */
protected const PART_PERMS = ['show_history', 'revert_element'];
/**
* @inheritDoc
*/
protected function voteOnUser($attribute, $subject, User $user): bool
{
if (in_array($attribute, self::PART_PERMS, true)) {
return $this->resolver->inherit($user, 'parts', $attribute) ?? false;
}
return $this->resolver->inherit($user, 'parts_orderdetails', $attribute) ?? false;
}
/**
* @inheritDoc
*/
protected function supports($attribute, $subject)
{
if (is_a($subject, Orderdetail::class, true)) {
return in_array($attribute, array_merge(
self::PART_PERMS,
$this->resolver->listOperationsForPermission('parts_orderdetails')
), true);
}
return false;
}
}

View file

@ -0,0 +1,58 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Security\Voter;
use App\Entity\Parts\PartLot;
use App\Entity\UserSystem\User;
class PartLotVoter extends ExtendedVoter
{
/** @var string[] When this permsission are encountered, they are checked on part */
protected const PART_PERMS = ['show_history', 'revert_element'];
/**
* @inheritDoc
*/
protected function voteOnUser($attribute, $subject, User $user): bool
{
if (in_array($attribute, self::PART_PERMS, true)) {
return $this->resolver->inherit($user, 'parts', $attribute) ?? false;
}
return $this->resolver->inherit($user, 'parts_lots', $attribute) ?? false;
}
/**
* @inheritDoc
*/
protected function supports($attribute, $subject)
{
if (is_a($subject, PartLot::class, true)) {
return in_array($attribute, array_merge(
self::PART_PERMS,
$this->resolver->listOperationsForPermission('parts_lots')
), true);
}
return false;
}
}

View file

@ -57,11 +57,7 @@ class PartVoter extends ExtendedVoter
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
// replace with your own logic if (is_a($subject, Part::class, true)) {
// https://symfony.com/doc/current/security/voters.html
//return ($subject instanceof Part || in_array($subject, ['PERM_parts', 'PERM_parts_name']));
if ($subject instanceof Part) {
//Check if a sub permission should be checked -> $attribute has format name.edit //Check if a sub permission should be checked -> $attribute has format name.edit
if (false !== strpos($attribute, '.')) { if (false !== strpos($attribute, '.')) {
[$perm, $op] = explode('.', $attribute); [$perm, $op] = explode('.', $attribute);
@ -72,12 +68,12 @@ class PartVoter extends ExtendedVoter
return $this->resolver->isValidOperation('parts', $attribute); return $this->resolver->isValidOperation('parts', $attribute);
} }
//Allow class name as subject
return false; return false;
} }
protected function voteOnUser($attribute, $subject, User $user): bool protected function voteOnUser($attribute, $subject, User $user): bool
{ {
if ($subject instanceof Part) {
//Check for sub permissions //Check for sub permissions
if (false !== strpos($attribute, '.')) { if (false !== strpos($attribute, '.')) {
[$perm, $op] = explode('.', $attribute); [$perm, $op] = explode('.', $attribute);
@ -87,9 +83,6 @@ class PartVoter extends ExtendedVoter
//Null concealing operator means, that no //Null concealing operator means, that no
return $this->resolver->inherit($user, 'parts', $attribute) ?? false; return $this->resolver->inherit($user, 'parts', $attribute) ?? false;
}
//Deny access by default.
return false;
} }
} }

View file

@ -0,0 +1,59 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Security\Voter;
use App\Entity\Parts\PartLot;
use App\Entity\PriceInformations\Pricedetail;
use App\Entity\UserSystem\User;
class PricedetailVoter extends ExtendedVoter
{
/** @var string[] When this permsission are encountered, they are checked on part */
protected const PART_PERMS = ['show_history', 'revert_element'];
/**
* @inheritDoc
*/
protected function voteOnUser($attribute, $subject, User $user): bool
{
if (in_array($attribute, self::PART_PERMS, true)) {
return $this->resolver->inherit($user, 'parts', $attribute) ?? false;
}
return $this->resolver->inherit($user, 'parts_prices', $attribute) ?? false;
}
/**
* @inheritDoc
*/
protected function supports($attribute, $subject)
{
if (is_a($subject, Pricedetail::class, true)) {
return in_array($attribute, array_merge(
self::PART_PERMS,
$this->resolver->listOperationsForPermission('parts_prices')
), true);
}
return false;
}
}

View file

@ -43,11 +43,13 @@ declare(strict_types=1);
namespace App\Security\Voter; namespace App\Security\Voter;
use App\Entity\Attachments\AttachmentType; use App\Entity\Attachments\AttachmentType;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Devices\Device; use App\Entity\Devices\Device;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint; use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;
use App\Entity\Parts\MeasurementUnit; use App\Entity\Parts\MeasurementUnit;
use App\Entity\Parts\Part;
use App\Entity\Parts\Storelocation; use App\Entity\Parts\Storelocation;
use App\Entity\Parts\Supplier; use App\Entity\Parts\Supplier;
use App\Entity\PriceInformations\Currency; use App\Entity\PriceInformations\Currency;
@ -67,24 +69,29 @@ class StructureVoter extends ExtendedVoter
*/ */
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if (is_object($subject)) { if (is_object($subject) || is_string($subject)) {
$permission_name = $this->instanceToPermissionName($subject); $permission_name = $this->instanceToPermissionName($subject);
//If permission name is null, then the subject is not supported //If permission name is null, then the subject is not supported
return (null !== $permission_name) && $this->resolver->isValidOperation($permission_name, $attribute); return (null !== $permission_name) && $this->resolver->isValidOperation($permission_name, $attribute);
} }
return false; return false;
} }
/** /**
* Maps a instance type to the permission name. * Maps a instance type to the permission name.
* *
* @param mixed $subject The subject for which the permission name should be generated * @param object|string $subject The subject for which the permission name should be generated
* *
* @return string|null the name of the permission for the subject's type or null, if the subject is not supported * @return string|null the name of the permission for the subject's type or null, if the subject is not supported
*/ */
protected function instanceToPermissionName($subject): ?string protected function instanceToPermissionName($subject): ?string
{ {
if (!is_string($subject)) {
$class_name = get_class($subject); $class_name = get_class($subject);
} else {
$class_name = $subject;
}
switch ($class_name) { switch ($class_name) {
case AttachmentType::class: case AttachmentType::class:
return 'attachment_types'; return 'attachment_types';

View file

@ -57,7 +57,7 @@ class UserVoter extends ExtendedVoter
*/ */
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if ($subject instanceof User) { if (is_a($subject, User::class, true)) {
return in_array($attribute, array_merge( return in_array($attribute, array_merge(
$this->resolver->listOperationsForPermission('users'), $this->resolver->listOperationsForPermission('users'),
$this->resolver->listOperationsForPermission('self')), $this->resolver->listOperationsForPermission('self')),
@ -89,11 +89,12 @@ class UserVoter extends ExtendedVoter
return $tmp; return $tmp;
} }
} }
}
//Else just check users permission: //Else just check users permission:
if ($this->resolver->isValidOperation('users', $attribute)) { if ($this->resolver->isValidOperation('users', $attribute)) {
return $this->resolver->inherit($user, 'users', $attribute) ?? false; return $this->resolver->inherit($user, 'users', $attribute) ?? false;
} }
}
return false; return false;
} }

View file

@ -43,6 +43,14 @@ declare(strict_types=1);
namespace App\Services; namespace App\Services;
use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\AbstractNamedDBElement;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Encoder\YamlEncoder;
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use function in_array; use function in_array;
use InvalidArgumentException; use InvalidArgumentException;
use function is_array; use function is_array;
@ -62,6 +70,10 @@ class EntityExporter
public function __construct(SerializerInterface $serializer) public function __construct(SerializerInterface $serializer)
{ {
/*$encoders = [new XmlEncoder(), new JsonEncoder(), new CSVEncoder(), new YamlEncoder()];
$normalizers = [new ObjectNormalizer(), new DateTimeNormalizer()];
$this->serializer = new Serializer($normalizers, $encoders);
$this->serializer-> */
$this->serializer = $serializer; $this->serializer = $serializer;
} }
@ -120,13 +132,15 @@ class EntityExporter
$entity_array = [$entity]; $entity_array = [$entity];
} }
$response = new Response($this->serializer->serialize($entity_array, $format, $serialized_data = $this->serializer->serialize($entity_array, $format,
[ [
'groups' => $groups, 'groups' => $groups,
'as_collection' => true, 'as_collection' => true,
'csv_delimiter' => ';', //Better for Excel 'csv_delimiter' => ';', //Better for Excel
'xml_root_node_name' => 'PartDBExport', 'xml_root_node_name' => 'PartDBExport',
])); ]);
$response = new Response($serialized_data);
$response->headers->set('Content-Type', $content_type); $response->headers->set('Content-Type', $content_type);
@ -151,7 +165,8 @@ class EntityExporter
// Create the disposition of the file // Create the disposition of the file
$disposition = $response->headers->makeDisposition( $disposition = $response->headers->makeDisposition(
ResponseHeaderBag::DISPOSITION_ATTACHMENT, ResponseHeaderBag::DISPOSITION_ATTACHMENT,
$filename $filename,
$string = preg_replace('![^'.preg_quote('-').'a-z0-_9\s]+!', '', strtolower($filename))
); );
// Set the content disposition // Set the content disposition
$response->headers->set('Content-Disposition', $disposition); $response->headers->set('Content-Disposition', $disposition);

View file

@ -44,6 +44,7 @@ namespace App\Services;
use App\Entity\Attachments\Attachment; use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType; use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Devices\Device; use App\Entity\Devices\Device;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
@ -51,9 +52,12 @@ use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;
use App\Entity\Parts\MeasurementUnit; use App\Entity\Parts\MeasurementUnit;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use App\Entity\Parts\PartLot;
use App\Entity\Parts\Storelocation; use App\Entity\Parts\Storelocation;
use App\Entity\Parts\Supplier; use App\Entity\Parts\Supplier;
use App\Entity\PriceInformations\Currency; use App\Entity\PriceInformations\Currency;
use App\Entity\PriceInformations\Orderdetail;
use App\Entity\PriceInformations\Pricedetail;
use App\Entity\UserSystem\Group; use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use App\Exceptions\EntityNotSupportedException; use App\Exceptions\EntityNotSupportedException;
@ -120,6 +124,70 @@ class EntityURLGenerator
throw new InvalidArgumentException('Method is not supported!'); throw new InvalidArgumentException('Method is not supported!');
} }
/**
* Gets the URL to view the given element at a given timestamp
* @param AbstractDBElement $entity
* @param \DateTime $dateTime
* @return string
*/
public function timeTravelURL(AbstractDBElement $entity, \DateTime $dateTime): string
{
$map = [
Part::class => 'part_info',
//As long we does not have own things for it use edit page
AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit',
Device::class => 'device_edit',
Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit',
Footprint::class => 'footprint_edit',
User::class => 'user_edit',
Currency::class => 'currency_edit',
MeasurementUnit::class => 'measurement_unit_edit',
Group::class => 'group_edit',
];
try {
return $this->urlGenerator->generate(
$this->mapToController($map, $entity),
[
'id' => $entity->getID(),
'timestamp' => $dateTime->getTimestamp()
]
);
} catch (EntityNotSupportedException $exception) {
if ($entity instanceof PartLot) {
return $this->urlGenerator->generate('part_info', [
'id' => $entity->getPart()->getID(),
'timestamp' => $dateTime->getTimestamp()
]);
}
if ($entity instanceof PartAttachment) {
return $this->urlGenerator->generate('part_info', [
'id' => $entity->getElement()->getID(),
'timestamp' => $dateTime->getTimestamp()
]);
}
if ($entity instanceof Orderdetail) {
return $this->urlGenerator->generate('part_info', [
'id' => $entity->getPart()->getID(),
'timestamp' => $dateTime->getTimestamp()
]);
}
if ($entity instanceof Pricedetail) {
return $this->urlGenerator->generate('part_info', [
'id' => $entity->getOrderdetail()->getPart()->getID(),
'timestamp' => $dateTime->getTimestamp()
]);
}
}
//Otherwise throw an error
throw new EntityNotSupportedException('The given entity is not supported yet!');
}
public function viewURL($entity): string public function viewURL($entity): string
{ {
if ($entity instanceof Attachment) { if ($entity instanceof Attachment) {

View file

@ -0,0 +1,72 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Services\LogSystem;
class EventCommentHelper
{
protected const MAX_MESSAGE_LENGTH = 255;
protected $message;
public function __construct()
{
$message = null;
}
/**
* Set the message that will be saved for all ElementEdited/Created/Deleted messages during the next flush.
* Set to null if no message should be shown.
* After the flush this message is cleared.
* @param string|null $message
*/
public function setMessage(?string $message): void
{
//Restrict the length of the string
$this->message = mb_strimwidth($message, 0, self::MAX_MESSAGE_LENGTH, '...');
}
/**
* Returns the currently set message, or null if no message is set yet.
* @return string|null
*/
public function getMessage(): ?string
{
return $this->message;
}
/**
* Clear the currently set message.
*/
public function clearMessage(): void
{
$this->message = null;
}
/**
* Check if a message is currently set.
* @return bool
*/
public function isMessageSet(): bool
{
return is_string($this->message);
}
}

View file

@ -0,0 +1,90 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Services\LogSystem;
use App\Entity\LogSystem\AbstractLogEntry;
class EventUndoHelper
{
public const MODE_UNDO = 'undo';
public const MODE_REVERT = 'revert';
protected const ALLOWED_MODES = [self::MODE_REVERT, self::MODE_UNDO];
protected $undone_event;
protected $mode;
public function __construct()
{
$undone_event = null;
$this->mode = self::MODE_UNDO;
}
public function setMode(string $mode): void
{
if (!in_array($mode, self::ALLOWED_MODES)) {
throw new \InvalidArgumentException('Invalid mode passed!');
}
$this->mode = $mode;
}
public function getMode(): string
{
return $this->mode;
}
/**
* Set which event log is currently undone.
* After the flush this message is cleared.
* @param AbstractLogEntry|null $undone_event
*/
public function setUndoneEvent(?AbstractLogEntry $undone_event): void
{
$this->undone_event = $undone_event;
}
/**
* Returns event that is currently undone.
* @return AbstractLogEntry|null
*/
public function getUndoneEvent(): ?AbstractLogEntry
{
return $this->undone_event;
}
/**
* Clear the currently the set undone event.
*/
public function clearUndoneEvent(): void
{
$this->undone_event = null;
}
/**
* Check if a event is undone
* @return bool
*/
public function isUndo(): bool
{
return ($this->undone_event instanceof AbstractLogEntry);
}
}

View file

@ -0,0 +1,61 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Services\LogSystem;
use App\Entity\Attachments\AttachmentContainingDBElement;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Part;
class HistoryHelper
{
public function __construct()
{
}
/**
* Returns an array containing all elements that are associated with the argument.
* The returned array contains the given element.
* @param AbstractDBElement $element
* @return array
*/
public function getAssociatedElements(AbstractDBElement $element): array
{
$array = [$element];
if ($element instanceof AttachmentContainingDBElement) {
$array = array_merge($array, $element->getAttachments()->toArray());
}
if ($element instanceof Part) {
$array = array_merge(
$array,
$element->getPartLots()->toArray(),
$element->getOrderdetails()->toArray()
);
foreach ($element->getOrderdetails() as $orderdetail) {
$array = array_merge($array, $orderdetail->getPricedetails()->toArray());
}
}
return $array;
}
}

View file

@ -42,7 +42,10 @@ declare(strict_types=1);
namespace App\Services\LogSystem; namespace App\Services\LogSystem;
use App\Entity\Contracts\LogWithCommentInterface;
use App\Entity\Contracts\LogWithEventUndoInterface;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\DatabaseUpdatedLogEntry; use App\Entity\LogSystem\DatabaseUpdatedLogEntry;
use App\Entity\LogSystem\ElementCreatedLogEntry; use App\Entity\LogSystem\ElementCreatedLogEntry;
use App\Entity\LogSystem\ElementDeletedLogEntry; use App\Entity\LogSystem\ElementDeletedLogEntry;
@ -52,6 +55,8 @@ use App\Entity\LogSystem\InstockChangedLogEntry;
use App\Entity\LogSystem\UserLoginLogEntry; use App\Entity\LogSystem\UserLoginLogEntry;
use App\Entity\LogSystem\UserLogoutLogEntry; use App\Entity\LogSystem\UserLogoutLogEntry;
use App\Entity\LogSystem\UserNotAllowedLogEntry; use App\Entity\LogSystem\UserNotAllowedLogEntry;
use App\Services\ElementTypeNameGenerator;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
/** /**
@ -60,10 +65,15 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogEntryExtraFormatter class LogEntryExtraFormatter
{ {
protected $translator; protected $translator;
protected $elementTypeNameGenerator;
public function __construct(TranslatorInterface $translator) protected const CONSOLE_SEARCH = ['<i class="fas fa-long-arrow-alt-right"></i>', '<i>', '</i>', '<b>', '</b>', ];
protected const CONSOLE_REPLACE = ['→', '<info>', '</info>', '<error>', '</error>'];
public function __construct(TranslatorInterface $translator, ElementTypeNameGenerator $elementTypeNameGenerator)
{ {
$this->translator = $translator; $this->translator = $translator;
$this->elementTypeNameGenerator = $elementTypeNameGenerator;
} }
/** /**
@ -73,32 +83,33 @@ class LogEntryExtraFormatter
*/ */
public function formatConsole(AbstractLogEntry $logEntry): string public function formatConsole(AbstractLogEntry $logEntry): string
{ {
$tmp = $this->format($logEntry); $arr = $this->getInternalFormat($logEntry);
$tmp = [];
//Just a simple tweak to make the console output more pretty. //Make an array with entries in the form "<b>Key:</b> Value"
$search = ['<i>', '</i>', '<b>', '</b>', ' <i class="fas fa-long-arrow-alt-right">']; foreach ($arr as $key => $value) {
$replace = ['<info>', '</info>', '<error>', '</error>', '→']; $str = '';
if (is_string($key)) {
return str_replace($search, $replace, $tmp); $str .= '<error>' . $this->translator->trans($key) . '</error>: ';
}
$str .= $value;
if (!empty($str)) {
$tmp[] = $str;
}
} }
/** return str_replace(static::CONSOLE_SEARCH, static::CONSOLE_REPLACE, implode("; ", $tmp));
* Return a HTML formatted string containing a user viewable form of the Extra data. }
*
* @return string protected function getInternalFormat(AbstractLogEntry $context): array
*/
public function format(AbstractLogEntry $context): string
{ {
$array = [];
if ($context instanceof UserLoginLogEntry || $context instanceof UserLogoutLogEntry) { if ($context instanceof UserLoginLogEntry || $context instanceof UserLogoutLogEntry) {
return sprintf( $array['log.user_login.ip'] = htmlspecialchars($context->getIPAddress());
'<i>%s</i>: %s',
$this->translator->trans('log.user_login.ip'),
htmlspecialchars($context->getIPAddress())
);
} }
if ($context instanceof ExceptionLogEntry) { if ($context instanceof ExceptionLogEntry) {
return sprintf( $array[] = sprintf(
'<i>%s</i> %s:%d : %s', '<i>%s</i> %s:%d : %s',
htmlspecialchars($context->getExceptionClass()), htmlspecialchars($context->getExceptionClass()),
htmlspecialchars($context->getFile()), htmlspecialchars($context->getFile()),
@ -108,7 +119,7 @@ class LogEntryExtraFormatter
} }
if ($context instanceof DatabaseUpdatedLogEntry) { if ($context instanceof DatabaseUpdatedLogEntry) {
return sprintf( $array[] = sprintf(
'<i>%s</i> %s <i class="fas fa-long-arrow-alt-right"></i> %s', '<i>%s</i> %s <i class="fas fa-long-arrow-alt-right"></i> %s',
$this->translator->trans($context->isSuccessful() ? 'log.database_updated.success' : 'log.database_updated.failure'), $this->translator->trans($context->isSuccessful() ? 'log.database_updated.success' : 'log.database_updated.failure'),
$context->getOldVersion(), $context->getOldVersion(),
@ -116,42 +127,85 @@ class LogEntryExtraFormatter
); );
} }
if ($context instanceof LogWithEventUndoInterface) {
if ($context->isUndoEvent()) {
if ($context->getUndoMode() === 'undo') {
$array['log.undo_mode.undo'] = (string) $context->getUndoEventID();
} elseif ($context->getUndoMode() === 'revert') {
$array['log.undo_mode.revert'] = (string) $context->getUndoEventID();
}
}
}
if ($context instanceof LogWithCommentInterface && $context->hasComment()) {
$array[] = htmlspecialchars($context->getComment());
}
if ($context instanceof ElementCreatedLogEntry && $context->hasCreationInstockValue()) { if ($context instanceof ElementCreatedLogEntry && $context->hasCreationInstockValue()) {
return sprintf( $array['log.element_created.original_instock'] = (string) $context->getCreationInstockValue();
'<i>%s</i>: %s',
$this->translator->trans('log.element_created.original_instock'),
$context->getCreationInstockValue()
);
} }
if ($context instanceof ElementDeletedLogEntry) { if ($context instanceof ElementDeletedLogEntry) {
return sprintf( if ($context->getOldName() !== null) {
'<i>%s</i>: %s', $array['log.element_deleted.old_name'] = htmlspecialchars($context->getOldName());
$this->translator->trans('log.element_deleted.old_name'), } else {
$context->getOldName() ?? $this->translator->trans('log.element_deleted.old_name.unknown') $array['log.element_deleted.old_name'] = $this->translator->trans('log.element_deleted.old_name.unknown');
); }
} }
if ($context instanceof ElementEditedLogEntry && ! empty($context->getMessage())) { if ($context instanceof ElementEditedLogEntry && $context->hasChangedFieldsInfo()) {
return htmlspecialchars($context->getMessage()); $array['log.element_edited.changed_fields'] = htmlspecialchars(implode(', ', $context->getChangedFields()));
} }
if ($context instanceof InstockChangedLogEntry) { if ($context instanceof InstockChangedLogEntry) {
return sprintf( $array[] = $this->translator->trans($context->isWithdrawal() ? 'log.instock_changed.withdrawal' : 'log.instock_changed.added');
'<i>%s</i>; %s <i class="fas fa-long-arrow-alt-right"></i> %s (%s); %s: %s', $array[] = sprintf(
$this->translator->trans($context->isWithdrawal() ? 'log.instock_changed.withdrawal' : 'log.instock_changed.added'), '%s <i class="fas fa-long-arrow-alt-right"></i> %s (%s)',
$context->getOldInstock(), $context->getOldInstock(),
$context->getNewInstock(), $context->getNewInstock(),
(! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true), (! $context->isWithdrawal() ? '+' : '-').$context->getDifference(true)
$this->translator->trans('log.instock_changed.comment'), );
htmlspecialchars($context->getComment()) $array['log.instock_changed.comment'] = htmlspecialchars($context->getComment());
}
if ($context instanceof CollectionElementDeleted) {
$array['log.collection_deleted.deleted'] = sprintf(
'%s: %s (%s)',
$this->elementTypeNameGenerator->getLocalizedTypeLabel($context->getDeletedElementClass()),
$context->getOldName() ?? $context->getDeletedElementID(),
$context->getCollectionName()
); );
} }
if ($context instanceof UserNotAllowedLogEntry) { if ($context instanceof UserNotAllowedLogEntry) {
return htmlspecialchars($context->getMessage()); $array[] = htmlspecialchars($context->getMessage());
} }
return ''; return $array;
}
/**
* Return a HTML formatted string containing a user viewable form of the Extra data.
*
* @return string
*/
public function format(AbstractLogEntry $context): string
{
$arr = $this->getInternalFormat($context);
$tmp = [];
//Make an array with entries in the form "<b>Key:</b> Value"
foreach ($arr as $key => $value) {
$str = '';
if (is_string($key)) {
$str .= '<b>' . $this->translator->trans($key) . '</b>: ';
}
$str .= $value;
if (!empty($str)) {
$tmp[] = $str;
}
}
return implode("; ", $tmp);
} }
} }

View file

@ -0,0 +1,217 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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\Services\LogSystem;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Contracts\TimeStampableInterface;
use App\Entity\Contracts\TimeTravelInterface;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\LogSystem\CollectionElementDeleted;
use App\Entity\LogSystem\ElementEditedLogEntry;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
class TimeTravel
{
protected $em;
protected $repo;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
$this->repo = $em->getRepository(AbstractLogEntry::class);
}
/**
* Undeletes the element with the given ID.
* @param string $class The class name of the element that should be undeleted
* @param int $id The ID of the element that should be undeleted.
* @return AbstractDBElement
*/
public function undeleteEntity(string $class, int $id): AbstractDBElement
{
$log = $this->repo->getUndeleteDataForElement($class, $id);
$element = new $class();
$this->applyEntry($element, $log);
//Set internal ID so the element can be reverted
$this->setField($element, 'id', $id);
//Let database determine when it will be created
$this->setField($element,'addedDate', null);
return $element;
}
/**
* Revert the given element to the state it has on the given timestamp
* @param AbstractDBElement $element
* @param \DateTime $timestamp
* @param AbstractLogEntry[] $reverted_elements
* @throws \Exception
*/
public function revertEntityToTimestamp(AbstractDBElement $element, \DateTime $timestamp, array $reverted_elements = [])
{
if (!$element instanceof TimeStampableInterface) {
throw new \InvalidArgumentException('$element must have a Timestamp!');
}
if ($timestamp > new \DateTime('now')) {
throw new \InvalidArgumentException('You can not travel to the future (yet)...');
}
//Skip this process if already were reverted...
if (in_array($element, $reverted_elements)) {
return;
}
$reverted_elements[] = $element;
$history = $this->repo->getTimetravelDataForElement($element, $timestamp);
/*
if (!$this->repo->getElementExistedAtTimestamp($element, $timestamp)) {
$element = null;
return;
}*/
foreach ($history as $logEntry) {
if ($logEntry instanceof ElementEditedLogEntry) {
$this->applyEntry($element, $logEntry);
}
if ($logEntry instanceof CollectionElementDeleted) {
//Undelete element and add it to collection again
$undeleted = $this->undeleteEntity(
$logEntry->getDeletedElementClass(),
$logEntry->getDeletedElementID()
);
if ($this->repo->getElementExistedAtTimestamp($undeleted, $timestamp)) {
$this->revertEntityToTimestamp($undeleted, $timestamp, $reverted_elements);
$collection = $this->getField($element, $logEntry->getCollectionName());
if ($collection instanceof Collection) {
$collection->add($undeleted);
}
}
}
}
// Revert any of the associated elements
$metadata = $this->em->getClassMetadata(get_class($element));
$associations = $metadata->getAssociationMappings();
foreach ($associations as $field => $mapping) {
if (
($element instanceof AbstractStructuralDBElement && ($field === 'parts' || $field === 'children'))
|| ($element instanceof AttachmentType && $field === 'attachments')
) {
continue;
}
//Revert many to one association (one element in property)
if (
$mapping['type'] === ClassMetadata::MANY_TO_ONE
|| $mapping['type'] === ClassMetadata::ONE_TO_ONE
) {
$target_element = $this->getField($element, $field);
if ($target_element !== null && $element->getLastModified() > $timestamp) {
$this->revertEntityToTimestamp($target_element, $timestamp, $reverted_elements);
}
} elseif ( //Revert *_TO_MANY associations (collection properties)
($mapping['type'] === ClassMetadata::MANY_TO_MANY
|| $mapping['type'] === ClassMetadata::ONE_TO_MANY)
&& $mapping['isOwningSide'] === false
) {
$target_elements = $this->getField($element, $field);
if ($target_elements === null || count($target_elements) > 10) {
continue;
}
foreach ($target_elements as $target_element) {
if ($target_element !== null && $element->getLastModified() >= $timestamp) {
//Remove the element from collection, if it did not existed at $timestamp
if (!$this->repo->getElementExistedAtTimestamp($target_element, $timestamp)) {
if ($target_elements instanceof Collection) {
$target_elements->removeElement($target_element);
}
}
$this->revertEntityToTimestamp($target_element, $timestamp, $reverted_elements);
}
}
}
}
}
/**
* Apply the changeset in the given LogEntry to the element
* @param AbstractDBElement $element
* @param TimeTravelInterface $logEntry
* @throws \Doctrine\ORM\Mapping\MappingException
*/
public function applyEntry(AbstractDBElement $element, TimeTravelInterface $logEntry): void
{
//Skip if this does not provide any info...
if (!$logEntry->hasOldDataInformations()) {
return;
}
if (!$element instanceof TimeStampableInterface) {
return;
}
$metadata = $this->em->getClassMetadata(get_class($element));
$old_data = $logEntry->getOldData();
foreach ($old_data as $field => $data) {
if ($metadata->hasField($field)) {
$this->setField($element, $field, $data);
}
if ($metadata->hasAssociation($field)) {
$mapping = $metadata->getAssociationMapping($field);
$target_class = $mapping['targetEntity'];
//Try to extract the old ID:
if (is_array($data) && isset($data['@id'])) {
$entity = $this->em->getPartialReference($target_class, $data['@id']);
$this->setField($element, $field, $entity);
}
}
}
$this->setField($element, 'lastModified', $logEntry->getTimestamp());
}
protected function getField(AbstractDBElement $element, string $field)
{
$reflection = new \ReflectionClass(get_class($element));
$property = $reflection->getProperty($field);
$property->setAccessible(true);
return $property->getValue($element);
}
protected function setField(AbstractDBElement $element, string $field, $new_value)
{
$reflection = new \ReflectionClass(get_class($element));
$property = $reflection->getProperty($field);
$property->setAccessible(true);
$property->setValue($element, $new_value);
}
}

View file

@ -1,5 +1,15 @@
{% extends "main_card.html.twig" %} {% extends "main_card.html.twig" %}
{% block card_type %}
{% if timeTravel is defined and timeTravel is not null %}
bg-primary-striped text-white
{% else %}
bg-primary text-white
{% endif %}
{% endblock %}
{% form_theme form.log_comment 'bootstrap_4_layout.html.twig' %}
{% block card_content %} {% block card_content %}
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
@ -33,16 +43,25 @@
<legend> <legend>
{% if entity.ID %} {% if entity.ID %}
<strong>{% trans with {'%name': entity.name} %}edit.caption{% endtrans %}</strong> <strong>{% trans with {'%name': entity.name} %}edit.caption{% endtrans %}</strong>
{% if timeTravel is defined and timeTravel is not null %}
({{ timeTravel|format_datetime('short') }})
{% endif %}
{% else %} {% else %}
<strong>{% trans %}new.caption{% endtrans %}</strong> <strong>{% trans %}new.caption{% endtrans %}</strong>
{% endif %} {% endif %}
</legend> </legend>
{% if timeTravel is defined and timeTravel is not null %}
<b>{% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %}</b>
{% endif %}
{{ form_errors(form) }} {{ form_errors(form) }}
<ul class="nav nav-tabs mt-2"> <ul class="nav nav-tabs mt-2">
<li class="nav-item"><a class="link-anchor active nav-link" data-toggle="tab" href="#home">{% trans %}standard.label{% endtrans %}</a></li> <li class="nav-item"><a class="link-anchor active nav-link" data-toggle="tab" href="#home">{% trans %}standard.label{% endtrans %}</a></li>
<li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#info">{% trans %}infos.label{% endtrans %}</a></li> <li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#info">{% trans %}infos.label{% endtrans %}</a></li>
{% if datatable is defined %}
<li class="nav-item {% if datatable is null %}not-allowed{% endif %}"><a data-toggle="tab" class="link-anchor nav-link {% if datatable is null %}disabled{% endif %}" href="#history">{% trans %}history.label{% endtrans %}</a></li>
{% endif %}
{% if entity.id %} {% if entity.id %}
<li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#export">{% trans %}export.label{% endtrans %}</a> </li> <li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#export">{% trans %}export.label{% endtrans %}</a> </li>
{% else %} {% else %}
@ -96,7 +115,21 @@
</div> </div>
</div> </div>
{{ form_row(form.save) }} <div class="form-group row">
<div class="col-sm-9 offset-sm-3">
<div class="btn-group">
{{ form_widget(form.save) }}
<button type="button" class="btn {% if entity.id is not null %}btn-primary{% else %}btn-success{% endif %} dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu p-2">
{{ form_row(form.log_comment)}}
</div>
</div>
</div>
</div>
{{ form_row(form.reset) }} {{ form_row(form.reset) }}
{{ form_end(form) }} {{ form_end(form) }}
@ -112,11 +145,15 @@
{% include "AdminPages/_info.html.twig" %} {% include "AdminPages/_info.html.twig" %}
</div> </div>
{% if datatable is defined and datatable is not null %}
<div id="history" class="tab-pane fade">
{% include "LogSystem/_log_table.html.twig" %}
</div>
{% endif %}
{% if entity.id %} {% if entity.id %}
<div id="export" class="tab-pane fade"> <div id="export" class="tab-pane fade">
{% include 'AdminPages/_export_form.html.twig' with {'path' : path('attachment_type_export', {'id': entity.id})} %} {% include 'AdminPages/_export_form.html.twig' with {'path' : path(route_base ~ '_export', {'id': entity.id})} %}
</div> </div>
{% else %} {# For new element we have a combined import/export tab #} {% else %} {# For new element we have a combined import/export tab #}
<div id="import_export" class="tab-pane fade"> <div id="import_export" class="tab-pane fade">

View file

@ -7,7 +7,17 @@
<div class=""></div> <div class=""></div>
<div class="col-sm offset-sm-3 pl-2"> <div class="col-sm offset-sm-3 pl-2">
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) %} {% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) %}
<div class="btn-group">
<button class="btn btn-danger" {% if delete_disabled %}disabled{% endif %}>{% trans %}entity.delete{% endtrans %}</button> <button class="btn btn-danger" {% if delete_disabled %}disabled{% endif %}>{% trans %}entity.delete{% endtrans %}</button>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu p-2">
<div class="form-group"><label for="delete_log_comment">{% trans %}edit.log_comment{% endtrans %}</label>
<input type="text" id="delete_log_comment" name="log_comment" class="form-control">
</div>
</div>
</div>
{% if entity.parent is defined %} {% if entity.parent is defined %}
<div class="ml-2 custom-control custom-checkbox custom-control-inline"> <div class="ml-2 custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="recursive" name="delete_recursive"> <input type="checkbox" class="custom-control-input" id="recursive" name="delete_recursive">

View file

@ -0,0 +1,14 @@
<form method="post" action="{{ url("log_undo") }}" data-delete-form data-title="{% trans %}log.undo.confirm_title{% endtrans %}"
data-message="{% trans %}log.undo.confirm_message{% endtrans %}">
<input type="hidden" name="redirect_back" value="{{ app.request.uri }}">
<div id="part_list" class="" data-datatable data-settings='{{ datatable_settings(datatable) }}'>
<div class="card-body">
<div class="card">
<div class="card-body">
<h4>{% trans %}part_list.loading.caption{% endtrans %}</h4>
<h6>{% trans %}part_list.loading.message{% endtrans %}</h6>
</div>
</div>
</div>
</div>
</form>

View file

@ -3,14 +3,5 @@
{% block title %}{% trans %}log.list.title{% endtrans %}{% endblock %} {% block title %}{% trans %}log.list.title{% endtrans %}{% endblock %}
{% block content %} {% block content %}
<div id="part_list" class="" data-datatable data-settings='{{ datatable_settings(datatable) }}'> {% include "LogSystem/_log_table.html.twig" %}
<div class="card-body">
<div class="card">
<div class="card-body">
<h4>{% trans %}part_list.loading.caption{% endtrans %}</h4>
<h6>{% trans %}part_list.loading.message{% endtrans %}</h6>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}

View file

@ -84,11 +84,23 @@
<div class="tab-pane fade p-2" id="comment" role="tabpanel"> <div class="tab-pane fade p-2" id="comment" role="tabpanel">
{{ form_widget(form.comment)}} {{ form_widget(form.comment)}}
</div> </div>
</div>
<div class="form-group row">
<div class="col-sm-9 offset-sm-3">
<div class="btn-group">
{{ form_widget(form.save) }}
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu p-2">
{{ form_row(form.log_comment)}}
</div>
</div>
</div> </div>
{{ form_row(form.save) }} </div>
{{ form_row(form.reset) }} {{ form_row(form.reset) }}
{{ form_errors(form) }} {{ form_errors(form) }}
{{ form_end(form) }} {{ form_end(form) }}

View file

@ -0,0 +1,5 @@
<div class="mt-2">
{% if datatable is not null %}
{% include "LogSystem/_log_table.html.twig" %}
{% endif %}
</div>

View file

@ -23,7 +23,9 @@
</h5> </h5>
<h3>{{ part.name }} <h3>{{ part.name }}
{# You need edit permission to use the edit button #} {# You need edit permission to use the edit button #}
{% if is_granted('edit', part) %} {% if timeTravel is not null %}
<a href="{{ part|entityURL('info') }}"><i title="{% trans %}part.back_to_info{% endtrans %}" class="fas fa-fw fa-arrow-circle-left"></i></a>
{% elseif is_granted('edit', part) %}
<a href="{{ part|entityURL('edit') }}"><i class="fas fa-fw fa-sm fa-edit"></i></a> <a href="{{ part|entityURL('edit') }}"><i class="fas fa-fw fa-sm fa-edit"></i></a>
{% endif %} {% endif %}
</h3> </h3>

View file

@ -1,5 +1,9 @@
{% import "helper.twig" as helper %} {% import "helper.twig" as helper %}
{% if timeTravel is not null %}
<b class="mb-2">{% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %}</b>
{% endif %}
<div class="mb-3"> <div class="mb-3">
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}"> <span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
<i class="fas fa-history fa-fw"></i> {{ helper.date_user_combination(part, true) }} <i class="fas fa-history fa-fw"></i> {{ helper.date_user_combination(part, true) }}

View file

@ -31,9 +31,19 @@
<input type="hidden" name="_method" value="DELETE"> <input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ part.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ part.id) }}">
<div class="form-group"> <div class="form-group">
<div class="btn-group">
<button class="btn btn-danger" {% if not is_granted("delete", part) %}disabled{% endif %}> <button class="btn btn-danger" {% if not is_granted("delete", part) %}disabled{% endif %}>
<i class="fa fa-trash fa-fw"></i> <i class="fa fa-trash fa-fw"></i>
{% trans %}part.delete{% endtrans %} {% trans %}part.delete{% endtrans %}
</button> </button>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu p-2">
<div class="form-group"><label for="delete_log_comment">{% trans %}edit.log_comment{% endtrans %}</label>
<input type="text" id="delete_log_comment" name="log_comment" class="form-control">
</div>
</div>
</div>
</div> </div>
</form> </form>

View file

@ -4,16 +4,28 @@
{% trans %}part.info.title{% endtrans %} {{ part.name }} {% trans %}part.info.title{% endtrans %} {{ part.name }}
{% endblock %} {% endblock %}
{% block card_type %}
{% if timeTravel == null %}
bg-primary text-white
{% else %}
bg-primary-striped text-white
{% endif %}
{% endblock %}
{% block card_title %} {% block card_title %}
<i class="fa {{ part.favorite ? 'fa-star' : 'fa-info-circle'}} fa-fw" aria-hidden="true"></i> <i class="fa {{ part.favorite ? 'fa-star' : 'fa-info-circle'}} fa-fw" aria-hidden="true"></i>
{% trans %}part.info.title{% endtrans %} <b>"{{ part.name }}"</b> {% trans %}part.info.title{% endtrans %} <b>"{{ part.name }}"</b>
{% if timeTravel != null %}
<i>({{ timeTravel | format_datetime('short') }})</i>
{% endif %}
<div class="float-right"> <div class="float-right">
{% trans %}id.label{% endtrans %}: {{ part.id }} {% trans %}id.label{% endtrans %}: {{ part.id }}
</div> </div>
{% endblock %} {% endblock %}
{% block card_content %} {% block card_content %}
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
{% include "Parts/info/_main_infos.html.twig" %} {% include "Parts/info/_main_infos.html.twig" %}
@ -60,8 +72,8 @@
<span class="badge badge-secondary">{{ part.orderdetails | length }}</span> <span class="badge badge-secondary">{{ part.orderdetails | length }}</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item {% if datatable is null %}not-allowed{% endif %}">
<a class="nav-link" id="history-tab" data-toggle="tab" href="#history" role="tab"> <a class="nav-link {% if datatable is null %}disabled{% endif %}" id="history-tab" data-toggle="tab" href="#history" role="tab">
<i class="fas fa-history"></i> <i class="fas fa-history"></i>
{% trans %}vendor.partinfo.history{% endtrans %} {% trans %}vendor.partinfo.history{% endtrans %}
</a> </a>
@ -102,13 +114,11 @@
</div> </div>
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="history-tab"> <div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="history-tab">
TODO {% include "Parts/info/_history.html.twig" %}
</div> </div>
<div class="tab-pane fade" id="tools" role="tabpanel" aria-labelledby="tools-tab"> <div class="tab-pane fade" id="tools" role="tabpanel" aria-labelledby="tools-tab">
{% include "Parts/info/_tools.html.twig" %} {% include "Parts/info/_tools.html.twig" %}
</div> </div>
<div class="tab-pane fade" id="extended_info" role="tabpanel" aria-labelledby="extended_info-tab"> <div class="tab-pane fade" id="extended_info" role="tabpanel" aria-labelledby="extended_info-tab">

View file

@ -39,4 +39,13 @@
{% trans %} homepage.others {% endtrans %} {% trans %} homepage.others {% endtrans %}
</div> </div>
</div> </div>
{% if datatable is not null %}
<div class="card mt-3">
<div class="card-header"><i class="fas fa-fw fa-history"></i> {% trans %}homepage.last_activity{% endtrans %}</div>
<div class="card-body">
{% include "LogSystem/_log_table.html.twig" %}
</div>
</div>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -137,14 +137,6 @@ class PermissionsEmbedTest extends TestCase
$embed->getPermissionValue('parts', 1); $embed->getPermissionValue('parts', 1);
} }
public function testInvalidBit3(): void
{
$embed = new PermissionsEmbed();
//When encoutering an too high bit number it must throw an error.
$this->expectException(InvalidArgumentException::class);
$embed->getPermissionValue('parts', 32);
}
public function getStatesBINARY() public function getStatesBINARY()
{ {
return [ return [

View file

@ -0,0 +1,71 @@
<?php
/**
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 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 Affero General Public License as published
* by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Tests\Services\LogSystem;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\LogSystem\EventLogger;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class EventCommentHelperTest extends WebTestCase
{
/**
* @var EventCommentHelper
*/
protected $service;
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
//Get an service instance.
self::bootKernel();
$this->service = self::$container->get(EventCommentHelper::class);
}
public function testInitialState()
{
$this->assertNull($this->service->getMessage());
$this->assertFalse($this->service->isMessageSet());
}
public function testClearMessage()
{
$this->service->setMessage('Test');
$this->assertTrue($this->service->isMessageSet());
$this->service->clearMessage();
$this->assertFalse($this->service->isMessageSet());
}
public function testGetSetMessage()
{
$this->service->setMessage('Test');
$this->assertSame('Test', $this->service->getMessage());
}
public function testIsMessageSet()
{
$this->service->setMessage('Test');
$this->assertTrue($this->service->isMessageSet());
$this->service->clearMessage();
$this->assertFalse($this->service->isMessageSet());
}
}

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de"> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file id="SchebTwoFactorBundle.de"> <file source-language="en" target-language="de" datatype="plaintext" original="file.ext">
<unit id="QoghNQ6" name="login"> <header>
<segment> <tool tool-id="symfony" tool-name="Symfony"/>
</header>
<body>
<trans-unit id="QoghNQ6" resname="login">
<source>login</source> <source>login</source>
<target>Login</target> <target>Login</target>
</segment> </trans-unit>
</unit> </body>
</file> </file>
</xliff> </xliff>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="de">
<file id="SchebTwoFactorBundle.de">
<unit id="QoghNQ6" name="login">
<notes>
<note category="file-source" priority="1">Part-DB1\templates\security\2fa_base_form.html.twig:52</note>
</notes>
<segment>
<source>login</source>
<target>Login</target>
</segment>
</unit>
</file>
</xliff>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="SchebTwoFactorBundle.en">
<unit id="QoghNQ6" name="login">
<notes>
<note category="file-source" priority="1">Part-DB1\templates\security\2fa_base_form.html.twig:52</note>
</notes>
<segment>
<source>login</source>
<target>Login</target>
</segment>
</unit>
</file>
</xliff>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
<file id="security.de"> <file id="security.de">
<unit id="baI_ZxO" name="An authentication exception occurred."> <unit id="baI_ZxO" name="An authentication exception occurred.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -12,6 +13,7 @@
</unit> </unit>
<unit id="OETylMq" name="Authentication credentials could not be found."> <unit id="OETylMq" name="Authentication credentials could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -21,6 +23,7 @@
</unit> </unit>
<unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem."> <unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -30,6 +33,7 @@
</unit> </unit>
<unit id="qr0aiUo" name="Invalid credentials."> <unit id="qr0aiUo" name="Invalid credentials.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -39,6 +43,7 @@
</unit> </unit>
<unit id="zrJWK0F" name="Cookie has already been used by someone else."> <unit id="zrJWK0F" name="Cookie has already been used by someone else.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -48,6 +53,7 @@
</unit> </unit>
<unit id="blC0fXX" name="Not privileged to request the resource."> <unit id="blC0fXX" name="Not privileged to request the resource.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -57,6 +63,7 @@
</unit> </unit>
<unit id="dLzMRPR" name="Invalid CSRF token."> <unit id="dLzMRPR" name="Invalid CSRF token.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -66,6 +73,7 @@
</unit> </unit>
<unit id="PhhlLem" name="No authentication provider found to support the authentication token."> <unit id="PhhlLem" name="No authentication provider found to support the authentication token.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -75,6 +83,7 @@
</unit> </unit>
<unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled."> <unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -84,6 +93,7 @@
</unit> </unit>
<unit id="EYCKpDH" name="No token could be found."> <unit id="EYCKpDH" name="No token could be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -93,6 +103,7 @@
</unit> </unit>
<unit id="z3cOUZo" name="Username could not be found."> <unit id="z3cOUZo" name="Username could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -102,6 +113,7 @@
</unit> </unit>
<unit id="By5eLYM" name="Account has expired."> <unit id="By5eLYM" name="Account has expired.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -111,6 +123,7 @@
</unit> </unit>
<unit id="YfZhiuA" name="Credentials have expired."> <unit id="YfZhiuA" name="Credentials have expired.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -120,6 +133,7 @@
</unit> </unit>
<unit id="NrSSfLs" name="Account is disabled."> <unit id="NrSSfLs" name="Account is disabled.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -129,6 +143,7 @@
</unit> </unit>
<unit id="O5ZyxHr" name="Account is locked."> <unit id="O5ZyxHr" name="Account is locked.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>

View file

@ -3,6 +3,7 @@
<file id="security.en"> <file id="security.en">
<unit id="baI_ZxO" name="An authentication exception occurred."> <unit id="baI_ZxO" name="An authentication exception occurred.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -12,6 +13,7 @@
</unit> </unit>
<unit id="OETylMq" name="Authentication credentials could not be found."> <unit id="OETylMq" name="Authentication credentials could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -21,6 +23,7 @@
</unit> </unit>
<unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem."> <unit id="3RJINQ0" name="Authentication request could not be processed due to a system problem.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -30,6 +33,7 @@
</unit> </unit>
<unit id="qr0aiUo" name="Invalid credentials."> <unit id="qr0aiUo" name="Invalid credentials.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -39,6 +43,7 @@
</unit> </unit>
<unit id="zrJWK0F" name="Cookie has already been used by someone else."> <unit id="zrJWK0F" name="Cookie has already been used by someone else.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -48,6 +53,7 @@
</unit> </unit>
<unit id="blC0fXX" name="Not privileged to request the resource."> <unit id="blC0fXX" name="Not privileged to request the resource.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -57,6 +63,7 @@
</unit> </unit>
<unit id="dLzMRPR" name="Invalid CSRF token."> <unit id="dLzMRPR" name="Invalid CSRF token.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -66,6 +73,7 @@
</unit> </unit>
<unit id="PhhlLem" name="No authentication provider found to support the authentication token."> <unit id="PhhlLem" name="No authentication provider found to support the authentication token.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -75,6 +83,7 @@
</unit> </unit>
<unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled."> <unit id="v_RS21A" name="No session available, it either timed out or cookies are not enabled.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -84,6 +93,7 @@
</unit> </unit>
<unit id="EYCKpDH" name="No token could be found."> <unit id="EYCKpDH" name="No token could be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -93,6 +103,7 @@
</unit> </unit>
<unit id="z3cOUZo" name="Username could not be found."> <unit id="z3cOUZo" name="Username could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -102,6 +113,7 @@
</unit> </unit>
<unit id="By5eLYM" name="Account has expired."> <unit id="By5eLYM" name="Account has expired.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -111,6 +123,7 @@
</unit> </unit>
<unit id="YfZhiuA" name="Credentials have expired."> <unit id="YfZhiuA" name="Credentials have expired.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -120,6 +133,7 @@
</unit> </unit>
<unit id="NrSSfLs" name="Account is disabled."> <unit id="NrSSfLs" name="Account is disabled.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -129,6 +143,7 @@
</unit> </unit>
<unit id="O5ZyxHr" name="Account is locked."> <unit id="O5ZyxHr" name="Account is locked.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>

View file

@ -5,9 +5,9 @@
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\Company.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\PartsContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\StructuralDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
@ -20,6 +20,22 @@
<note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Manufacturer.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\MeasurementUnit.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Part.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Storelocation.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes> </notes>
<segment> <segment>
<source>part.master_attachment.must_be_picture</source> <source>part.master_attachment.must_be_picture</source>
@ -29,9 +45,9 @@
<unit id="VJHTkxx" name="structural.entity.unique_name"> <unit id="VJHTkxx" name="structural.entity.unique_name">
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\Company.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\PartsContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\StructuralDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
@ -41,6 +57,19 @@
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Manufacturer.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\MeasurementUnit.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Storelocation.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">src\Entity\AttachmentType.php:0</note> <note priority="1">src\Entity\AttachmentType.php:0</note>
<note priority="1">src\Entity\Category.php:0</note> <note priority="1">src\Entity\Category.php:0</note>
<note priority="1">src\Entity\Company.php:0</note> <note priority="1">src\Entity\Company.php:0</note>
@ -61,14 +90,26 @@
<unit id="isXL.ie" name="validator.user.username_already_used"> <unit id="isXL.ie" name="validator.user.username_already_used">
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes> </notes>
<segment> <segment>
<source>validator.user.username_already_used</source> <source>validator.user.username_already_used</source>
<target></target> <target></target>
</segment> </segment>
</unit> </unit>
<unit id="NcM463r" name="user.invalid_username">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes>
<segment>
<source>user.invalid_username</source>
<target>Der Benutzername darf nur Buchstaben, Zahlen, Unterstriche, Punkte, Plus- oder Minuszeichen enthalten.</target>
</segment>
</unit>
<unit id="zh5oKD9" name="This value should be false."> <unit id="zh5oKD9" name="This value should be false.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -78,6 +119,7 @@
</unit> </unit>
<unit id="NN2_iru" name="This value should be true."> <unit id="NN2_iru" name="This value should be true.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -87,6 +129,7 @@
</unit> </unit>
<unit id="OjM_kpf" name="This value should be of type {{ type }}."> <unit id="OjM_kpf" name="This value should be of type {{ type }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -96,6 +139,7 @@
</unit> </unit>
<unit id="f0P5pBD" name="This value should be blank."> <unit id="f0P5pBD" name="This value should be blank.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -105,6 +149,7 @@
</unit> </unit>
<unit id="ih.4TRN" name="The value you selected is not a valid choice."> <unit id="ih.4TRN" name="The value you selected is not a valid choice.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -114,6 +159,7 @@
</unit> </unit>
<unit id="u81CkP8" name="0d999f2"> <unit id="u81CkP8" name="0d999f2">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -123,6 +169,7 @@
</unit> </unit>
<unit id="nIvOQ_o" name="0824486"> <unit id="nIvOQ_o" name="0824486">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -132,6 +179,7 @@
</unit> </unit>
<unit id="87zjiHi" name="One or more of the given values is invalid."> <unit id="87zjiHi" name="One or more of the given values is invalid.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -141,6 +189,7 @@
</unit> </unit>
<unit id="3NeQftv" name="This field was not expected."> <unit id="3NeQftv" name="This field was not expected.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -150,6 +199,7 @@
</unit> </unit>
<unit id="SwMV4zp" name="This field is missing."> <unit id="SwMV4zp" name="This field is missing.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -159,6 +209,7 @@
</unit> </unit>
<unit id="LO2vFKN" name="This value is not a valid date."> <unit id="LO2vFKN" name="This value is not a valid date.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -168,6 +219,7 @@
</unit> </unit>
<unit id="86dU_nv" name="This value is not a valid datetime."> <unit id="86dU_nv" name="This value is not a valid datetime.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -177,6 +229,7 @@
</unit> </unit>
<unit id="PSvNXdi" name="This value is not a valid email address."> <unit id="PSvNXdi" name="This value is not a valid email address.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -186,6 +239,7 @@
</unit> </unit>
<unit id="3KeHbZy" name="The file could not be found."> <unit id="3KeHbZy" name="The file could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -195,6 +249,7 @@
</unit> </unit>
<unit id="KtJhQZo" name="The file is not readable."> <unit id="KtJhQZo" name="The file is not readable.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -204,6 +259,7 @@
</unit> </unit>
<unit id="JocOVM2" name="1ad411a"> <unit id="JocOVM2" name="1ad411a">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -213,6 +269,7 @@
</unit> </unit>
<unit id="YW21SPH" name="30a318d"> <unit id="YW21SPH" name="30a318d">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -222,6 +279,7 @@
</unit> </unit>
<unit id="NubOmrs" name="This value should be {{ limit }} or less."> <unit id="NubOmrs" name="This value should be {{ limit }} or less.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -231,6 +289,7 @@
</unit> </unit>
<unit id="HX7TOFm" name="0e0c1e1"> <unit id="HX7TOFm" name="0e0c1e1">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -240,6 +299,7 @@
</unit> </unit>
<unit id="qgR8M_U" name="This value should be {{ limit }} or more."> <unit id="qgR8M_U" name="This value should be {{ limit }} or more.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -249,6 +309,7 @@
</unit> </unit>
<unit id="ekfrU.c" name="5188ff9"> <unit id="ekfrU.c" name="5188ff9">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -258,6 +319,7 @@
</unit> </unit>
<unit id="1KV4L.t" name="This value should not be blank."> <unit id="1KV4L.t" name="This value should not be blank.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -267,6 +329,7 @@
</unit> </unit>
<unit id="2G4Vepm" name="This value should not be null."> <unit id="2G4Vepm" name="This value should not be null.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -276,6 +339,7 @@
</unit> </unit>
<unit id="yDc3m6E" name="This value should be null."> <unit id="yDc3m6E" name="This value should be null.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -285,6 +349,7 @@
</unit> </unit>
<unit id="zKzWejA" name="This value is not valid."> <unit id="zKzWejA" name="This value is not valid.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -294,6 +359,7 @@
</unit> </unit>
<unit id="HSuBZpQ" name="This value is not a valid time."> <unit id="HSuBZpQ" name="This value is not a valid time.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -303,6 +369,7 @@
</unit> </unit>
<unit id="snWc_QT" name="This value is not a valid URL."> <unit id="snWc_QT" name="This value is not a valid URL.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -312,6 +379,7 @@
</unit> </unit>
<unit id="jpaLsb2" name="The two values should be equal."> <unit id="jpaLsb2" name="The two values should be equal.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -321,6 +389,7 @@
</unit> </unit>
<unit id="fIlB1B_" name="The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}."> <unit id="fIlB1B_" name="The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -330,6 +399,7 @@
</unit> </unit>
<unit id="tW7o0t9" name="The file is too large."> <unit id="tW7o0t9" name="The file is too large.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -339,6 +409,7 @@
</unit> </unit>
<unit id=".exF5Ww" name="The file could not be uploaded."> <unit id=".exF5Ww" name="The file could not be uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -348,6 +419,7 @@
</unit> </unit>
<unit id="d7sS5yw" name="This value should be a valid number."> <unit id="d7sS5yw" name="This value should be a valid number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -357,6 +429,7 @@
</unit> </unit>
<unit id="BS2Ez6i" name="This file is not a valid image."> <unit id="BS2Ez6i" name="This file is not a valid image.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -366,6 +439,7 @@
</unit> </unit>
<unit id="ydcT9kU" name="This is not a valid IP address."> <unit id="ydcT9kU" name="This is not a valid IP address.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -375,6 +449,7 @@
</unit> </unit>
<unit id="lDOGNFX" name="This value is not a valid language."> <unit id="lDOGNFX" name="This value is not a valid language.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -384,6 +459,7 @@
</unit> </unit>
<unit id="y9IdYkA" name="This value is not a valid locale."> <unit id="y9IdYkA" name="This value is not a valid locale.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -393,6 +469,7 @@
</unit> </unit>
<unit id="1YC0pOd" name="This value is not a valid country."> <unit id="1YC0pOd" name="This value is not a valid country.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -402,6 +479,7 @@
</unit> </unit>
<unit id="B5ebaMp" name="This value is already used."> <unit id="B5ebaMp" name="This value is already used.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -411,6 +489,7 @@
</unit> </unit>
<unit id="L6097a6" name="The size of the image could not be detected."> <unit id="L6097a6" name="The size of the image could not be detected.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -420,6 +499,7 @@
</unit> </unit>
<unit id="zVtJJEa" name="266051e"> <unit id="zVtJJEa" name="266051e">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -429,6 +509,7 @@
</unit> </unit>
<unit id="s8LFQGC" name="c1c23f9"> <unit id="s8LFQGC" name="c1c23f9">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -438,6 +519,7 @@
</unit> </unit>
<unit id="Z.NgqFj" name="9a128f7"> <unit id="Z.NgqFj" name="9a128f7">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -447,6 +529,7 @@
</unit> </unit>
<unit id="AW1lWVM" name="8a4cd70"> <unit id="AW1lWVM" name="8a4cd70">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -456,6 +539,7 @@
</unit> </unit>
<unit id="PSdMNab" name="This value should be the user's current password."> <unit id="PSdMNab" name="This value should be the user's current password.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -465,6 +549,7 @@
</unit> </unit>
<unit id="gYImVyV" name="fd389d6"> <unit id="gYImVyV" name="fd389d6">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -474,6 +559,7 @@
</unit> </unit>
<unit id="xJ2Bcr_" name="The file was only partially uploaded."> <unit id="xJ2Bcr_" name="The file was only partially uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -483,6 +569,7 @@
</unit> </unit>
<unit id="HzkJDtF" name="No file was uploaded."> <unit id="HzkJDtF" name="No file was uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -492,6 +579,7 @@
</unit> </unit>
<unit id="mHfEaB3" name="No temporary folder was configured in php.ini."> <unit id="mHfEaB3" name="No temporary folder was configured in php.ini.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -501,6 +589,7 @@
</unit> </unit>
<unit id="y9K3BGb" name="Cannot write temporary file to disk."> <unit id="y9K3BGb" name="Cannot write temporary file to disk.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -510,6 +599,7 @@
</unit> </unit>
<unit id="kx3yHIM" name="A PHP extension caused the upload to fail."> <unit id="kx3yHIM" name="A PHP extension caused the upload to fail.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -519,6 +609,7 @@
</unit> </unit>
<unit id="gTJYRl6" name="b54c218"> <unit id="gTJYRl6" name="b54c218">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -528,6 +619,7 @@
</unit> </unit>
<unit id="FFn3lVn" name="949632c"> <unit id="FFn3lVn" name="949632c">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -537,6 +629,7 @@
</unit> </unit>
<unit id="bSdilZv" name="e0582dc"> <unit id="bSdilZv" name="e0582dc">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -546,6 +639,7 @@
</unit> </unit>
<unit id="MAzmID7" name="Invalid card number."> <unit id="MAzmID7" name="Invalid card number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -555,6 +649,7 @@
</unit> </unit>
<unit id="c3REGK3" name="Unsupported card type or invalid card number."> <unit id="c3REGK3" name="Unsupported card type or invalid card number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -564,6 +659,7 @@
</unit> </unit>
<unit id="XSVzcbV" name="This is not a valid International Bank Account Number (IBAN)."> <unit id="XSVzcbV" name="This is not a valid International Bank Account Number (IBAN).">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -573,6 +669,7 @@
</unit> </unit>
<unit id="yHirwNr" name="This value is not a valid ISBN-10."> <unit id="yHirwNr" name="This value is not a valid ISBN-10.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -582,6 +679,7 @@
</unit> </unit>
<unit id="c_q0_ua" name="This value is not a valid ISBN-13."> <unit id="c_q0_ua" name="This value is not a valid ISBN-13.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -591,6 +689,7 @@
</unit> </unit>
<unit id="M4FlD6n" name="This value is neither a valid ISBN-10 nor a valid ISBN-13."> <unit id="M4FlD6n" name="This value is neither a valid ISBN-10 nor a valid ISBN-13.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -600,6 +699,7 @@
</unit> </unit>
<unit id="cuct0Ow" name="This value is not a valid ISSN."> <unit id="cuct0Ow" name="This value is not a valid ISSN.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -609,6 +709,7 @@
</unit> </unit>
<unit id="JBLs1a1" name="This value is not a valid currency."> <unit id="JBLs1a1" name="This value is not a valid currency.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -618,6 +719,7 @@
</unit> </unit>
<unit id="c.WxzFW" name="This value should be equal to {{ compared_value }}."> <unit id="c.WxzFW" name="This value should be equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -627,6 +729,7 @@
</unit> </unit>
<unit id="_jdjkwq" name="This value should be greater than {{ compared_value }}."> <unit id="_jdjkwq" name="This value should be greater than {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -636,6 +739,7 @@
</unit> </unit>
<unit id="o8A8a0H" name="This value should be greater than or equal to {{ compared_value }}."> <unit id="o8A8a0H" name="This value should be greater than or equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -645,6 +749,7 @@
</unit> </unit>
<unit id="bOF1fpm" name="9670078"> <unit id="bOF1fpm" name="9670078">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -654,6 +759,7 @@
</unit> </unit>
<unit id="jG0QFKw" name="This value should be less than {{ compared_value }}."> <unit id="jG0QFKw" name="This value should be less than {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -663,6 +769,7 @@
</unit> </unit>
<unit id="9lWrKmm" name="This value should be less than or equal to {{ compared_value }}."> <unit id="9lWrKmm" name="This value should be less than or equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -672,6 +779,7 @@
</unit> </unit>
<unit id="ftTwGs." name="This value should not be equal to {{ compared_value }}."> <unit id="ftTwGs." name="This value should not be equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -681,6 +789,7 @@
</unit> </unit>
<unit id="Bi22JLt" name="0eedf91"> <unit id="Bi22JLt" name="0eedf91">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -690,6 +799,7 @@
</unit> </unit>
<unit id="VczCWzQ" name="9c3ad0f"> <unit id="VczCWzQ" name="9c3ad0f">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -699,6 +809,7 @@
</unit> </unit>
<unit id="v57PXhq" name="4376d45"> <unit id="v57PXhq" name="4376d45">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -708,6 +819,7 @@
</unit> </unit>
<unit id="rpajj.a" name="The image is square ({{ width }}x{{ height }}px). Square images are not allowed."> <unit id="rpajj.a" name="The image is square ({{ width }}x{{ height }}px). Square images are not allowed.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -717,6 +829,7 @@
</unit> </unit>
<unit id="G_lu2qW" name="1dc128a"> <unit id="G_lu2qW" name="1dc128a">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -726,6 +839,7 @@
</unit> </unit>
<unit id="sFyGx4B" name="9e27714"> <unit id="sFyGx4B" name="9e27714">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -735,6 +849,7 @@
</unit> </unit>
<unit id="jZgqcpL" name="An empty file is not allowed."> <unit id="jZgqcpL" name="An empty file is not allowed.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -744,6 +859,7 @@
</unit> </unit>
<unit id="bcfVezI" name="The host could not be resolved."> <unit id="bcfVezI" name="The host could not be resolved.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -753,6 +869,7 @@
</unit> </unit>
<unit id="NtzKvgt" name="This value does not match the expected {{ charset }} charset."> <unit id="NtzKvgt" name="This value does not match the expected {{ charset }} charset.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -762,6 +879,7 @@
</unit> </unit>
<unit id="Wi2y9.N" name="This is not a valid Business Identifier Code (BIC)."> <unit id="Wi2y9.N" name="This is not a valid Business Identifier Code (BIC).">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -771,6 +889,7 @@
</unit> </unit>
<unit id="VKDowX6" name="Error"> <unit id="VKDowX6" name="Error">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -780,6 +899,7 @@
</unit> </unit>
<unit id="8zqt0Ik" name="This is not a valid UUID."> <unit id="8zqt0Ik" name="This is not a valid UUID.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -789,6 +909,7 @@
</unit> </unit>
<unit id="ru.4wkH" name="This value should be a multiple of {{ compared_value }}."> <unit id="ru.4wkH" name="This value should be a multiple of {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -798,6 +919,7 @@
</unit> </unit>
<unit id="M3vyK6s" name="This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}."> <unit id="M3vyK6s" name="This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -807,6 +929,7 @@
</unit> </unit>
<unit id="2v2xpAh" name="This value should be valid JSON."> <unit id="2v2xpAh" name="This value should be valid JSON.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -816,6 +939,7 @@
</unit> </unit>
<unit id="9CWVEGq" name="This collection should contain only unique elements."> <unit id="9CWVEGq" name="This collection should contain only unique elements.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -825,6 +949,7 @@
</unit> </unit>
<unit id="WdvZfq." name="This value should be positive."> <unit id="WdvZfq." name="This value should be positive.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -834,6 +959,7 @@
</unit> </unit>
<unit id="ubHMK2q" name="This value should be either positive or zero."> <unit id="ubHMK2q" name="This value should be either positive or zero.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -843,6 +969,7 @@
</unit> </unit>
<unit id="IwNTzo_" name="This value should be negative."> <unit id="IwNTzo_" name="This value should be negative.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -852,6 +979,7 @@
</unit> </unit>
<unit id="0GfwMfP" name="This value should be either negative or zero."> <unit id="0GfwMfP" name="This value should be either negative or zero.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -861,6 +989,7 @@
</unit> </unit>
<unit id="fs3qQZR" name="This value is not a valid timezone."> <unit id="fs3qQZR" name="This value is not a valid timezone.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -870,6 +999,7 @@
</unit> </unit>
<unit id="40dnsod" name="7e27e92"> <unit id="40dnsod" name="7e27e92">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -879,6 +1009,7 @@
</unit> </unit>
<unit id="VvxxWas" name="This value should be between {{ min }} and {{ max }}."> <unit id="VvxxWas" name="This value should be between {{ min }} and {{ max }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -886,8 +1017,27 @@
<target>Dieser Wert sollte zwischen {{ min }} und {{ max }} sein.</target> <target>Dieser Wert sollte zwischen {{ min }} und {{ max }} sein.</target>
</segment> </segment>
</unit> </unit>
<unit id="7g313cV" name="This value is not a valid hostname.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>This value is not a valid hostname.</source>
<target>Dieser Wert ist kein gültiger Hostname.</target>
</segment>
</unit>
<unit id="xwtBimR" name="d165c02">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
<target>Die Anzahl an Elementen in dieser Sammlung sollte ein Vielfaches von {{ compared_value }} sein.</target>
</segment>
</unit>
<unit id=".SEaaBa" name="This form should not contain extra fields."> <unit id=".SEaaBa" name="This form should not contain extra fields.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -897,6 +1047,7 @@
</unit> </unit>
<unit id="WPnLAh9" name="The uploaded file was too large. Please try to upload a smaller file."> <unit id="WPnLAh9" name="The uploaded file was too large. Please try to upload a smaller file.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -906,6 +1057,7 @@
</unit> </unit>
<unit id="fvxWW3V" name="The CSRF token is invalid. Please try to resubmit the form."> <unit id="fvxWW3V" name="The CSRF token is invalid. Please try to resubmit the form.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -915,6 +1067,7 @@
</unit> </unit>
<unit id="lZvhKYu" name="validator.noneofitschild.self"> <unit id="lZvhKYu" name="validator.noneofitschild.self">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -924,6 +1077,7 @@
</unit> </unit>
<unit id="pr07aV4" name="validator.noneofitschild.children"> <unit id="pr07aV4" name="validator.noneofitschild.children">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -933,6 +1087,7 @@
</unit> </unit>
<unit id="0IF0VIF" name="validator.isSelectable"> <unit id="0IF0VIF" name="validator.isSelectable">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -942,6 +1097,7 @@
</unit> </unit>
<unit id="nd207H6" name="validator.part_lot.location_full.no_increasment"> <unit id="nd207H6" name="validator.part_lot.location_full.no_increasment">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -951,6 +1107,7 @@
</unit> </unit>
<unit id="R6Ov4Yt" name="validator.part_lot.location_full"> <unit id="R6Ov4Yt" name="validator.part_lot.location_full">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -960,6 +1117,7 @@
</unit> </unit>
<unit id="6vIlN5q" name="validator.part_lot.only_existing"> <unit id="6vIlN5q" name="validator.part_lot.only_existing">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -969,6 +1127,7 @@
</unit> </unit>
<unit id="BNQk2e7" name="validator.part_lot.single_part"> <unit id="BNQk2e7" name="validator.part_lot.single_part">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -976,11 +1135,5 @@
<target>Der Lagerort wurde als "Nur ein Bauteil" markiert, daher kann kein neues Bauteil hinzugefügt werden.</target> <target>Der Lagerort wurde als "Nur ein Bauteil" markiert, daher kann kein neues Bauteil hinzugefügt werden.</target>
</segment> </segment>
</unit> </unit>
<unit id="NcM463r" name="user.invalid_username">
<segment>
<source>user.invalid_username</source>
<target>Der Benutzername darf nur Buchstaben, Zahlen, Unterstriche, Punkte, Plus- oder Minuszeichen enthalten.</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>

View file

@ -5,9 +5,9 @@
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\Company.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\PartsContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\StructuralDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
@ -20,6 +20,22 @@
<note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Manufacturer.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\MeasurementUnit.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Part.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Storelocation.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes> </notes>
<segment> <segment>
<source>part.master_attachment.must_be_picture</source> <source>part.master_attachment.must_be_picture</source>
@ -29,9 +45,9 @@
<unit id="VJHTkxx" name="structural.entity.unique_name"> <unit id="VJHTkxx" name="structural.entity.unique_name">
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\Company.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\PartsContainingDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Base\StructuralDBElement.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
@ -41,6 +57,19 @@
<note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">Part-DB1\src\Entity\Attachments\AttachmentType.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractCompany.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractPartsContainingDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Base\AbstractStructuralDBElement.php:0</note>
<note priority="1">Part-DB1\src\Entity\Devices\Device.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Category.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Footprint.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Manufacturer.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\MeasurementUnit.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Storelocation.php:0</note>
<note priority="1">Part-DB1\src\Entity\Parts\Supplier.php:0</note>
<note priority="1">Part-DB1\src\Entity\PriceInformations\Currency.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\Group.php:0</note>
<note priority="1">src\Entity\AttachmentType.php:0</note> <note priority="1">src\Entity\AttachmentType.php:0</note>
<note priority="1">src\Entity\Category.php:0</note> <note priority="1">src\Entity\Category.php:0</note>
<note priority="1">src\Entity\Company.php:0</note> <note priority="1">src\Entity\Company.php:0</note>
@ -61,14 +90,26 @@
<unit id="isXL.ie" name="validator.user.username_already_used"> <unit id="isXL.ie" name="validator.user.username_already_used">
<notes> <notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note> <note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes> </notes>
<segment> <segment>
<source>validator.user.username_already_used</source> <source>validator.user.username_already_used</source>
<target></target> <target></target>
</segment> </segment>
</unit> </unit>
<unit id="NcM463r" name="user.invalid_username">
<notes>
<note category="file-source" priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
<note priority="1">Part-DB1\src\Entity\UserSystem\User.php:0</note>
</notes>
<segment>
<source>user.invalid_username</source>
<target>The username must contain only letters, numbers, underscores, dots, pluses or minuses.</target>
</segment>
</unit>
<unit id="zh5oKD9" name="This value should be false."> <unit id="zh5oKD9" name="This value should be false.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -78,6 +119,7 @@
</unit> </unit>
<unit id="NN2_iru" name="This value should be true."> <unit id="NN2_iru" name="This value should be true.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -87,6 +129,7 @@
</unit> </unit>
<unit id="OjM_kpf" name="This value should be of type {{ type }}."> <unit id="OjM_kpf" name="This value should be of type {{ type }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -96,6 +139,7 @@
</unit> </unit>
<unit id="f0P5pBD" name="This value should be blank."> <unit id="f0P5pBD" name="This value should be blank.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -105,6 +149,7 @@
</unit> </unit>
<unit id="ih.4TRN" name="The value you selected is not a valid choice."> <unit id="ih.4TRN" name="The value you selected is not a valid choice.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -114,6 +159,7 @@
</unit> </unit>
<unit id="u81CkP8" name="0d999f2"> <unit id="u81CkP8" name="0d999f2">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -123,6 +169,7 @@
</unit> </unit>
<unit id="nIvOQ_o" name="0824486"> <unit id="nIvOQ_o" name="0824486">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -132,6 +179,7 @@
</unit> </unit>
<unit id="87zjiHi" name="One or more of the given values is invalid."> <unit id="87zjiHi" name="One or more of the given values is invalid.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -141,6 +189,7 @@
</unit> </unit>
<unit id="3NeQftv" name="This field was not expected."> <unit id="3NeQftv" name="This field was not expected.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -150,6 +199,7 @@
</unit> </unit>
<unit id="SwMV4zp" name="This field is missing."> <unit id="SwMV4zp" name="This field is missing.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -159,6 +209,7 @@
</unit> </unit>
<unit id="LO2vFKN" name="This value is not a valid date."> <unit id="LO2vFKN" name="This value is not a valid date.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -168,6 +219,7 @@
</unit> </unit>
<unit id="86dU_nv" name="This value is not a valid datetime."> <unit id="86dU_nv" name="This value is not a valid datetime.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -177,6 +229,7 @@
</unit> </unit>
<unit id="PSvNXdi" name="This value is not a valid email address."> <unit id="PSvNXdi" name="This value is not a valid email address.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -186,6 +239,7 @@
</unit> </unit>
<unit id="3KeHbZy" name="The file could not be found."> <unit id="3KeHbZy" name="The file could not be found.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -195,6 +249,7 @@
</unit> </unit>
<unit id="KtJhQZo" name="The file is not readable."> <unit id="KtJhQZo" name="The file is not readable.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -204,6 +259,7 @@
</unit> </unit>
<unit id="JocOVM2" name="1ad411a"> <unit id="JocOVM2" name="1ad411a">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -213,6 +269,7 @@
</unit> </unit>
<unit id="YW21SPH" name="30a318d"> <unit id="YW21SPH" name="30a318d">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -222,6 +279,7 @@
</unit> </unit>
<unit id="NubOmrs" name="This value should be {{ limit }} or less."> <unit id="NubOmrs" name="This value should be {{ limit }} or less.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -231,6 +289,7 @@
</unit> </unit>
<unit id="HX7TOFm" name="0e0c1e1"> <unit id="HX7TOFm" name="0e0c1e1">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -240,6 +299,7 @@
</unit> </unit>
<unit id="qgR8M_U" name="This value should be {{ limit }} or more."> <unit id="qgR8M_U" name="This value should be {{ limit }} or more.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -249,6 +309,7 @@
</unit> </unit>
<unit id="ekfrU.c" name="5188ff9"> <unit id="ekfrU.c" name="5188ff9">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -258,6 +319,7 @@
</unit> </unit>
<unit id="1KV4L.t" name="This value should not be blank."> <unit id="1KV4L.t" name="This value should not be blank.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -267,6 +329,7 @@
</unit> </unit>
<unit id="2G4Vepm" name="This value should not be null."> <unit id="2G4Vepm" name="This value should not be null.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -276,6 +339,7 @@
</unit> </unit>
<unit id="yDc3m6E" name="This value should be null."> <unit id="yDc3m6E" name="This value should be null.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -285,6 +349,7 @@
</unit> </unit>
<unit id="zKzWejA" name="This value is not valid."> <unit id="zKzWejA" name="This value is not valid.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -294,6 +359,7 @@
</unit> </unit>
<unit id="HSuBZpQ" name="This value is not a valid time."> <unit id="HSuBZpQ" name="This value is not a valid time.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -303,6 +369,7 @@
</unit> </unit>
<unit id="snWc_QT" name="This value is not a valid URL."> <unit id="snWc_QT" name="This value is not a valid URL.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -312,6 +379,7 @@
</unit> </unit>
<unit id="jpaLsb2" name="The two values should be equal."> <unit id="jpaLsb2" name="The two values should be equal.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -321,6 +389,7 @@
</unit> </unit>
<unit id="fIlB1B_" name="The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}."> <unit id="fIlB1B_" name="The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -330,6 +399,7 @@
</unit> </unit>
<unit id="tW7o0t9" name="The file is too large."> <unit id="tW7o0t9" name="The file is too large.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -339,6 +409,7 @@
</unit> </unit>
<unit id=".exF5Ww" name="The file could not be uploaded."> <unit id=".exF5Ww" name="The file could not be uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -348,6 +419,7 @@
</unit> </unit>
<unit id="d7sS5yw" name="This value should be a valid number."> <unit id="d7sS5yw" name="This value should be a valid number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -357,6 +429,7 @@
</unit> </unit>
<unit id="BS2Ez6i" name="This file is not a valid image."> <unit id="BS2Ez6i" name="This file is not a valid image.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -366,6 +439,7 @@
</unit> </unit>
<unit id="ydcT9kU" name="This is not a valid IP address."> <unit id="ydcT9kU" name="This is not a valid IP address.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -375,6 +449,7 @@
</unit> </unit>
<unit id="lDOGNFX" name="This value is not a valid language."> <unit id="lDOGNFX" name="This value is not a valid language.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -384,6 +459,7 @@
</unit> </unit>
<unit id="y9IdYkA" name="This value is not a valid locale."> <unit id="y9IdYkA" name="This value is not a valid locale.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -393,6 +469,7 @@
</unit> </unit>
<unit id="1YC0pOd" name="This value is not a valid country."> <unit id="1YC0pOd" name="This value is not a valid country.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -402,6 +479,7 @@
</unit> </unit>
<unit id="B5ebaMp" name="This value is already used."> <unit id="B5ebaMp" name="This value is already used.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -411,6 +489,7 @@
</unit> </unit>
<unit id="L6097a6" name="The size of the image could not be detected."> <unit id="L6097a6" name="The size of the image could not be detected.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -420,6 +499,7 @@
</unit> </unit>
<unit id="zVtJJEa" name="266051e"> <unit id="zVtJJEa" name="266051e">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -429,6 +509,7 @@
</unit> </unit>
<unit id="s8LFQGC" name="c1c23f9"> <unit id="s8LFQGC" name="c1c23f9">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -438,6 +519,7 @@
</unit> </unit>
<unit id="Z.NgqFj" name="9a128f7"> <unit id="Z.NgqFj" name="9a128f7">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -447,6 +529,7 @@
</unit> </unit>
<unit id="AW1lWVM" name="8a4cd70"> <unit id="AW1lWVM" name="8a4cd70">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -456,6 +539,7 @@
</unit> </unit>
<unit id="PSdMNab" name="This value should be the user's current password."> <unit id="PSdMNab" name="This value should be the user's current password.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -465,6 +549,7 @@
</unit> </unit>
<unit id="gYImVyV" name="fd389d6"> <unit id="gYImVyV" name="fd389d6">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -474,6 +559,7 @@
</unit> </unit>
<unit id="xJ2Bcr_" name="The file was only partially uploaded."> <unit id="xJ2Bcr_" name="The file was only partially uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -483,6 +569,7 @@
</unit> </unit>
<unit id="HzkJDtF" name="No file was uploaded."> <unit id="HzkJDtF" name="No file was uploaded.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -492,6 +579,7 @@
</unit> </unit>
<unit id="mHfEaB3" name="No temporary folder was configured in php.ini."> <unit id="mHfEaB3" name="No temporary folder was configured in php.ini.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -501,6 +589,7 @@
</unit> </unit>
<unit id="y9K3BGb" name="Cannot write temporary file to disk."> <unit id="y9K3BGb" name="Cannot write temporary file to disk.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -510,6 +599,7 @@
</unit> </unit>
<unit id="kx3yHIM" name="A PHP extension caused the upload to fail."> <unit id="kx3yHIM" name="A PHP extension caused the upload to fail.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -519,6 +609,7 @@
</unit> </unit>
<unit id="gTJYRl6" name="b54c218"> <unit id="gTJYRl6" name="b54c218">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -528,6 +619,7 @@
</unit> </unit>
<unit id="FFn3lVn" name="949632c"> <unit id="FFn3lVn" name="949632c">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -537,6 +629,7 @@
</unit> </unit>
<unit id="bSdilZv" name="e0582dc"> <unit id="bSdilZv" name="e0582dc">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -546,6 +639,7 @@
</unit> </unit>
<unit id="MAzmID7" name="Invalid card number."> <unit id="MAzmID7" name="Invalid card number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -555,6 +649,7 @@
</unit> </unit>
<unit id="c3REGK3" name="Unsupported card type or invalid card number."> <unit id="c3REGK3" name="Unsupported card type or invalid card number.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -564,6 +659,7 @@
</unit> </unit>
<unit id="XSVzcbV" name="This is not a valid International Bank Account Number (IBAN)."> <unit id="XSVzcbV" name="This is not a valid International Bank Account Number (IBAN).">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -573,6 +669,7 @@
</unit> </unit>
<unit id="yHirwNr" name="This value is not a valid ISBN-10."> <unit id="yHirwNr" name="This value is not a valid ISBN-10.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -582,6 +679,7 @@
</unit> </unit>
<unit id="c_q0_ua" name="This value is not a valid ISBN-13."> <unit id="c_q0_ua" name="This value is not a valid ISBN-13.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -591,6 +689,7 @@
</unit> </unit>
<unit id="M4FlD6n" name="This value is neither a valid ISBN-10 nor a valid ISBN-13."> <unit id="M4FlD6n" name="This value is neither a valid ISBN-10 nor a valid ISBN-13.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -600,6 +699,7 @@
</unit> </unit>
<unit id="cuct0Ow" name="This value is not a valid ISSN."> <unit id="cuct0Ow" name="This value is not a valid ISSN.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -609,6 +709,7 @@
</unit> </unit>
<unit id="JBLs1a1" name="This value is not a valid currency."> <unit id="JBLs1a1" name="This value is not a valid currency.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -618,6 +719,7 @@
</unit> </unit>
<unit id="c.WxzFW" name="This value should be equal to {{ compared_value }}."> <unit id="c.WxzFW" name="This value should be equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -627,6 +729,7 @@
</unit> </unit>
<unit id="_jdjkwq" name="This value should be greater than {{ compared_value }}."> <unit id="_jdjkwq" name="This value should be greater than {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -636,6 +739,7 @@
</unit> </unit>
<unit id="o8A8a0H" name="This value should be greater than or equal to {{ compared_value }}."> <unit id="o8A8a0H" name="This value should be greater than or equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -645,6 +749,7 @@
</unit> </unit>
<unit id="bOF1fpm" name="9670078"> <unit id="bOF1fpm" name="9670078">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -654,6 +759,7 @@
</unit> </unit>
<unit id="jG0QFKw" name="This value should be less than {{ compared_value }}."> <unit id="jG0QFKw" name="This value should be less than {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -663,6 +769,7 @@
</unit> </unit>
<unit id="9lWrKmm" name="This value should be less than or equal to {{ compared_value }}."> <unit id="9lWrKmm" name="This value should be less than or equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -672,6 +779,7 @@
</unit> </unit>
<unit id="ftTwGs." name="This value should not be equal to {{ compared_value }}."> <unit id="ftTwGs." name="This value should not be equal to {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -681,6 +789,7 @@
</unit> </unit>
<unit id="Bi22JLt" name="0eedf91"> <unit id="Bi22JLt" name="0eedf91">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -690,6 +799,7 @@
</unit> </unit>
<unit id="VczCWzQ" name="9c3ad0f"> <unit id="VczCWzQ" name="9c3ad0f">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -699,6 +809,7 @@
</unit> </unit>
<unit id="v57PXhq" name="4376d45"> <unit id="v57PXhq" name="4376d45">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -708,6 +819,7 @@
</unit> </unit>
<unit id="rpajj.a" name="The image is square ({{ width }}x{{ height }}px). Square images are not allowed."> <unit id="rpajj.a" name="The image is square ({{ width }}x{{ height }}px). Square images are not allowed.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -717,6 +829,7 @@
</unit> </unit>
<unit id="G_lu2qW" name="1dc128a"> <unit id="G_lu2qW" name="1dc128a">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -726,6 +839,7 @@
</unit> </unit>
<unit id="sFyGx4B" name="9e27714"> <unit id="sFyGx4B" name="9e27714">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -735,6 +849,7 @@
</unit> </unit>
<unit id="jZgqcpL" name="An empty file is not allowed."> <unit id="jZgqcpL" name="An empty file is not allowed.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -744,6 +859,7 @@
</unit> </unit>
<unit id="bcfVezI" name="The host could not be resolved."> <unit id="bcfVezI" name="The host could not be resolved.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -753,6 +869,7 @@
</unit> </unit>
<unit id="NtzKvgt" name="This value does not match the expected {{ charset }} charset."> <unit id="NtzKvgt" name="This value does not match the expected {{ charset }} charset.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -762,6 +879,7 @@
</unit> </unit>
<unit id="Wi2y9.N" name="This is not a valid Business Identifier Code (BIC)."> <unit id="Wi2y9.N" name="This is not a valid Business Identifier Code (BIC).">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -771,6 +889,7 @@
</unit> </unit>
<unit id="VKDowX6" name="Error"> <unit id="VKDowX6" name="Error">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -780,6 +899,7 @@
</unit> </unit>
<unit id="8zqt0Ik" name="This is not a valid UUID."> <unit id="8zqt0Ik" name="This is not a valid UUID.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -789,6 +909,7 @@
</unit> </unit>
<unit id="ru.4wkH" name="This value should be a multiple of {{ compared_value }}."> <unit id="ru.4wkH" name="This value should be a multiple of {{ compared_value }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -798,6 +919,7 @@
</unit> </unit>
<unit id="M3vyK6s" name="This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}."> <unit id="M3vyK6s" name="This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -807,6 +929,7 @@
</unit> </unit>
<unit id="2v2xpAh" name="This value should be valid JSON."> <unit id="2v2xpAh" name="This value should be valid JSON.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -816,6 +939,7 @@
</unit> </unit>
<unit id="9CWVEGq" name="This collection should contain only unique elements."> <unit id="9CWVEGq" name="This collection should contain only unique elements.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -825,6 +949,7 @@
</unit> </unit>
<unit id="WdvZfq." name="This value should be positive."> <unit id="WdvZfq." name="This value should be positive.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -834,6 +959,7 @@
</unit> </unit>
<unit id="ubHMK2q" name="This value should be either positive or zero."> <unit id="ubHMK2q" name="This value should be either positive or zero.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -843,6 +969,7 @@
</unit> </unit>
<unit id="IwNTzo_" name="This value should be negative."> <unit id="IwNTzo_" name="This value should be negative.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -852,6 +979,7 @@
</unit> </unit>
<unit id="0GfwMfP" name="This value should be either negative or zero."> <unit id="0GfwMfP" name="This value should be either negative or zero.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -861,6 +989,7 @@
</unit> </unit>
<unit id="fs3qQZR" name="This value is not a valid timezone."> <unit id="fs3qQZR" name="This value is not a valid timezone.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -870,6 +999,7 @@
</unit> </unit>
<unit id="40dnsod" name="7e27e92"> <unit id="40dnsod" name="7e27e92">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -879,6 +1009,7 @@
</unit> </unit>
<unit id="VvxxWas" name="This value should be between {{ min }} and {{ max }}."> <unit id="VvxxWas" name="This value should be between {{ min }} and {{ max }}.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -886,8 +1017,27 @@
<target>This value should be between {{ min }} and {{ max }}.</target> <target>This value should be between {{ min }} and {{ max }}.</target>
</segment> </segment>
</unit> </unit>
<unit id="7g313cV" name="This value is not a valid hostname.">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>This value is not a valid hostname.</source>
<target>This value is not a valid hostname.</target>
</segment>
</unit>
<unit id="xwtBimR" name="d165c02">
<notes>
<note category="state" priority="1">obsolete</note>
</notes>
<segment>
<source>The number of elements in this collection should be a multiple of {{ compared_value }}.</source>
<target>The number of elements in this collection should be a multiple of {{ compared_value }}.</target>
</segment>
</unit>
<unit id=".SEaaBa" name="This form should not contain extra fields."> <unit id=".SEaaBa" name="This form should not contain extra fields.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -897,6 +1047,7 @@
</unit> </unit>
<unit id="WPnLAh9" name="The uploaded file was too large. Please try to upload a smaller file."> <unit id="WPnLAh9" name="The uploaded file was too large. Please try to upload a smaller file.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -906,6 +1057,7 @@
</unit> </unit>
<unit id="fvxWW3V" name="The CSRF token is invalid. Please try to resubmit the form."> <unit id="fvxWW3V" name="The CSRF token is invalid. Please try to resubmit the form.">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -915,6 +1067,7 @@
</unit> </unit>
<unit id="lZvhKYu" name="validator.noneofitschild.self"> <unit id="lZvhKYu" name="validator.noneofitschild.self">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -924,6 +1077,7 @@
</unit> </unit>
<unit id="pr07aV4" name="validator.noneofitschild.children"> <unit id="pr07aV4" name="validator.noneofitschild.children">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -933,6 +1087,7 @@
</unit> </unit>
<unit id="0IF0VIF" name="validator.isSelectable"> <unit id="0IF0VIF" name="validator.isSelectable">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -942,6 +1097,7 @@
</unit> </unit>
<unit id="nd207H6" name="validator.part_lot.location_full.no_increasment"> <unit id="nd207H6" name="validator.part_lot.location_full.no_increasment">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -951,6 +1107,7 @@
</unit> </unit>
<unit id="R6Ov4Yt" name="validator.part_lot.location_full"> <unit id="R6Ov4Yt" name="validator.part_lot.location_full">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -960,6 +1117,7 @@
</unit> </unit>
<unit id="6vIlN5q" name="validator.part_lot.only_existing"> <unit id="6vIlN5q" name="validator.part_lot.only_existing">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -969,6 +1127,7 @@
</unit> </unit>
<unit id="BNQk2e7" name="validator.part_lot.single_part"> <unit id="BNQk2e7" name="validator.part_lot.single_part">
<notes> <notes>
<note priority="1">obsolete</note>
<note category="state" priority="1">obsolete</note> <note category="state" priority="1">obsolete</note>
</notes> </notes>
<segment> <segment>
@ -976,11 +1135,5 @@
<target>The storage location was marked as "single part", so you can not add a new part to it.</target> <target>The storage location was marked as "single part", so you can not add a new part to it.</target>
</segment> </segment>
</unit> </unit>
<unit id="NcM463r" name="user.invalid_username">
<segment>
<source>user.invalid_username</source>
<target>The username must contain only letters, numbers, underscores, dots, pluses or minuses.</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>