Release 2.0.25 (#4066)

* added support for hourly rate column in detail table
* allow to register icon in extension
* allow to show QR code secret
* new translations
* bump theme and packages
* fix validation for invoice-document-filenames with uppercase character
* max upload size 1MB
* fix last month in daterange-picker in certain situations, more years in quick-select
* remove unused package-versions-deprecated
* link preferences from contract warning message
* added page_setup page layout
* prevent DROP TABLE in addSQL() and replace drop table with schema call
* added azuyalabs/yasumi
This commit is contained in:
Kevin Papst
2023-06-06 23:05:20 +02:00
committed by GitHub
parent 2ba9cff281
commit 0663995d06
34 changed files with 629 additions and 467 deletions

View File

@@ -65,6 +65,7 @@ final class InvoiceDocumentUploadForm extends AbstractType
new File([
'mimeTypes' => $mimetypes,
'mimeTypesMessage' => 'This file type is not allowed',
'maxSize' => '1024k',
]),
new Callback([$this, 'validateDocument'])
],
@@ -117,7 +118,7 @@ final class InvoiceDocumentUploadForm extends AbstractType
$safeFilename = transliterator_transliterate(self::FILENAME_RULE, $nameWithoutExtension);
if ($safeFilename !== $nameWithoutExtension) {
if ($safeFilename === false || strtolower($safeFilename) !== strtolower($nameWithoutExtension)) {
$context->buildViolation('This invoice document cannot be used, filename may only contain the following ascii character: %character%')
->setParameters(['%character%' => 'A-Z a-z 0-9 _ -'])
->setTranslationDomain('validators')

View File

@@ -17,8 +17,9 @@ final class Configuration
{
private ?string $label = null;
private string $translationDomain = 'messages';
private string|int|null|bool|array $value = null;
private string|int|null|bool|float $value = null;
private ?string $type = null;
/** @var array<string, mixed> */
private array $options = [];
private bool $enabled = true;
private bool $required = true;
@@ -36,12 +37,12 @@ final class Configuration
return $this->name;
}
public function getValue(): string|int|null|bool|object
public function getValue(): string|int|null|bool|float
{
return $this->value;
}
public function setValue(string|int|null|bool|object $value): Configuration
public function setValue(string|int|null|bool|float $value): Configuration
{
if ($this->type === CheckboxType::class || $this->type === YesNoType::class) {
$value = (bool) $value;
@@ -131,11 +132,17 @@ final class Configuration
return $this;
}
/**
* @return array<string, mixed>
*/
public function getOptions(): array
{
return $this->options;
}
/**
* @param array<string, mixed> $options
*/
public function setOptions(array $options): Configuration
{
$this->options = $options;

View File

@@ -61,18 +61,24 @@ final class DateRangeType extends AbstractType
$user = $options['user'];
$factory = DateTimeFactory::createByUser($user);
$view->vars['ranges'] = [
'today' => [$factory->createDateTime('00:00:00'), $factory->createDateTime('23:59:59')],
'yesterday' => [$factory->createDateTime('-1 day 00:00:00'), $factory->createDateTime('-1 day 23:59:59')],
'thisWeek' => [$factory->getStartOfWeek(), $factory->getEndOfWeek()],
'lastWeek' => [$factory->getStartOfWeek('-1 week'), $factory->getEndOfWeek('-1 week')],
'thisMonth' => [$factory->getStartOfMonth(), $factory->getEndOfMonth()],
'lastMonth' => [$factory->getStartOfMonth('-1 month'), $factory->getEndOfMonth('-1 month')],
'thisYear' => [$factory->createStartOfYear(), $factory->createEndOfYear()],
'thisYearUntilNow' => [$factory->createStartOfYear(), $factory->createDateTime('23:59:59')],
'lastYear' => [$factory->createStartOfYear('-1 year'), $factory->createEndOfYear('-1 year')],
'allTime' => [null, null],
$ranges = [
'daterangepicker.allTime' => [null, null],
'daterangepicker.today' => [$factory->createDateTime('00:00:00'), $factory->createDateTime('23:59:59')],
'daterangepicker.yesterday' => [$factory->createDateTime('-1 day 00:00:00'), $factory->createDateTime('-1 day 23:59:59')],
'daterangepicker.thisWeek' => [$factory->getStartOfWeek(), $factory->getEndOfWeek()],
'daterangepicker.lastWeek' => [$factory->getStartOfWeek('-1 week'), $factory->getEndOfWeek('-1 week')],
'daterangepicker.thisMonth' => [$factory->getStartOfMonth(), $factory->getEndOfMonth()],
'daterangepicker.lastMonth' => [$factory->getStartOfLastMonth(), $factory->getEndOfLastMonth()],
'daterangepicker.thisYearUntilNow' => [$factory->createStartOfYear(), $factory->createDateTime('23:59:59')],
];
$thisYear = (int) $factory->createStartOfYear()->format('Y');
for ($i = 0; $i < 3; $i++) {
$year = $thisYear - $i;
$ranges[$year] = [$year . '-01-01', $year . '-12-31'];
}
$view->vars['ranges'] = $ranges;
$view->vars['rangeFormat'] = $options['format'];
$view->vars['attr'] = array_merge($view->vars['attr'], [