Added additional filters to attachment datatable

This commit is contained in:
Jan Böhmer 2025-02-22 17:48:26 +01:00
parent 48be9a8098
commit f146d88aa5
3 changed files with 17 additions and 0 deletions

View file

@ -45,6 +45,9 @@ class AttachmentFilter implements FilterInterface
public readonly DateTimeConstraint $lastModified;
public readonly DateTimeConstraint $addedDate;
public readonly TextConstraint $originalFileName;
public readonly TextConstraint $externalLink;
public function __construct(NodesListBuilder $nodesListBuilder)
{
@ -55,6 +58,9 @@ class AttachmentFilter implements FilterInterface
$this->lastModified = new DateTimeConstraint('attachment.lastModified');
$this->addedDate = new DateTimeConstraint('attachment.addedDate');
$this->showInTable = new BooleanConstraint('attachment.show_in_table');
$this->originalFileName = new TextConstraint('attachment.original_filename');
$this->externalLink = new TextConstraint('attachment.external_path');
}
public function apply(QueryBuilder $queryBuilder): void

View file

@ -100,6 +100,15 @@ class AttachmentFilterType extends AbstractType
'label' => 'attachment.edit.show_in_table'
]);
$builder->add('originalFileName', TextConstraintType::class, [
'label' => 'attachment.file_name'
]);
$builder->add('externalLink', TextConstraintType::class, [
'label' => 'attachment.table.external_link'
]);
$builder->add('lastModified', DateTimeConstraintType::class, [
'label' => 'lastModified'
]);

View file

@ -34,6 +34,8 @@
{{ form_row(filterForm.attachmentType) }}
{{ form_row(filterForm.targetType) }}
{{ form_row(filterForm.showInTable) }}
{{ form_row(filterForm.originalFileName) }}
{{ form_row(filterForm.externalLink) }}
{{ form_row(filterForm.lastModified) }}
{{ form_row(filterForm.addedDate) }}
{{ form_row(filterForm.dbId) }}