diff --git a/src/Entity/Timesheet.php b/src/Entity/Timesheet.php index c2c461e4..19282a8c 100644 --- a/src/Entity/Timesheet.php +++ b/src/Entity/Timesheet.php @@ -255,7 +255,7 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface * @Serializer\Expose() * @Serializer\Groups({"Default"}) * - * @ORM\Column(name="exported", type="boolean", nullable=false) + * @ORM\Column(name="exported", type="boolean", nullable=false, options={"default": false}) * @Assert\NotNull() */ private $exported = false; diff --git a/src/EventSubscriber/LastLoginSubscriber.php b/src/EventSubscriber/LastLoginSubscriber.php index 6811cba1..fd346172 100644 --- a/src/EventSubscriber/LastLoginSubscriber.php +++ b/src/EventSubscriber/LastLoginSubscriber.php @@ -13,6 +13,7 @@ use App\Entity\User; use App\Event\UserInteractiveLoginEvent; use App\Repository\UserRepository; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use Symfony\Component\Security\Http\SecurityEvents; @@ -46,6 +47,12 @@ class LastLoginSubscriber implements EventSubscriberInterface public function onSecurityInteractiveLogin(InteractiveLoginEvent $event) { + // do not count API calls as logins + // this point could be used to add API rate limitation in the future + if ($event->getAuthenticationToken() instanceof PostAuthenticationGuardToken) { + return; + } + $user = $event->getAuthenticationToken()->getUser(); if ($user instanceof User) { diff --git a/src/Form/ActivityRateForm.php b/src/Form/ActivityRateForm.php index c1264518..52a86471 100644 --- a/src/Form/ActivityRateForm.php +++ b/src/Form/ActivityRateForm.php @@ -43,7 +43,6 @@ class ActivityRateForm extends AbstractRateForm 'data_class' => ActivityRate::class, 'csrf_protection' => true, 'csrf_field_name' => '_token', - 'expand_users' => true, 'csrf_token_id' => 'admin_customer_rate_edit', 'attr' => [ 'data-form-event' => 'kimai.activityUpdate' diff --git a/src/Form/CustomerRateForm.php b/src/Form/CustomerRateForm.php index d59c7438..fafd7e2e 100644 --- a/src/Form/CustomerRateForm.php +++ b/src/Form/CustomerRateForm.php @@ -43,7 +43,6 @@ class CustomerRateForm extends AbstractRateForm 'data_class' => CustomerRate::class, 'csrf_protection' => true, 'csrf_field_name' => '_token', - 'expand_users' => true, 'csrf_token_id' => 'admin_customer_rate_edit', 'attr' => [ 'data-form-event' => 'kimai.customerUpdate' diff --git a/src/Form/ProjectRateForm.php b/src/Form/ProjectRateForm.php index ace0da39..56558c92 100644 --- a/src/Form/ProjectRateForm.php +++ b/src/Form/ProjectRateForm.php @@ -43,7 +43,6 @@ class ProjectRateForm extends AbstractRateForm 'data_class' => ProjectRate::class, 'csrf_protection' => true, 'csrf_field_name' => '_token', - 'expand_users' => true, 'csrf_token_id' => 'admin_project_rate_edit', 'attr' => [ 'data-form-event' => 'kimai.projectUpdate' diff --git a/src/Invoice/ServiceInvoice.php b/src/Invoice/ServiceInvoice.php index d46d40f6..4b8f38db 100644 --- a/src/Invoice/ServiceInvoice.php +++ b/src/Invoice/ServiceInvoice.php @@ -263,6 +263,7 @@ final class ServiceInvoice /** * @param InvoiceQuery $query * @return InvoiceItemInterface[] + * @deprecated since 1.14 and will be removed with 2.0 */ public function findInvoiceItems(InvoiceQuery $query): array { diff --git a/src/Model/Statistic/BudgetStatistic.php b/src/Model/Statistic/BudgetStatistic.php index 7c6b7fca..d9da520b 100644 --- a/src/Model/Statistic/BudgetStatistic.php +++ b/src/Model/Statistic/BudgetStatistic.php @@ -12,7 +12,7 @@ namespace App\Model\Statistic; use App\Model\TimesheetCountedStatistic; /** - * @final + * @internal */ class BudgetStatistic extends TimesheetCountedStatistic { diff --git a/tests/Configuration/SystemConfigurationTest.php b/tests/Configuration/SystemConfigurationTest.php index f60a889c..b81bf010 100644 --- a/tests/Configuration/SystemConfigurationTest.php +++ b/tests/Configuration/SystemConfigurationTest.php @@ -240,7 +240,6 @@ class SystemConfigurationTest extends TestCase { $sut = $this->getSut($this->getDefaultSettings(), []); $this->assertEquals(99, $sut->getTimesheetActiveEntriesHardLimit()); - $this->assertEquals(99, $sut->getTimesheetActiveEntriesSoftLimit()); $this->assertFalse($sut->isTimesheetAllowFutureTimes()); $this->assertFalse($sut->isTimesheetMarkdownEnabled()); $this->assertEquals('duration_only', $sut->getTimesheetTrackingMode()); @@ -260,11 +259,19 @@ class SystemConfigurationTest extends TestCase $this->assertEquals(5, $sut->getTimesheetIncrementEnd()); } + /** + * @group legacy + */ + public function testDeprecatedSettingsWithoutLoader() + { + $sut = $this->getSut($this->getDefaultSettings(), []); + $this->assertEquals(99, $sut->getTimesheetActiveEntriesSoftLimit()); + } + public function testTimesheetWithLoader() { $sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings()); $this->assertEquals(7, $sut->getTimesheetActiveEntriesHardLimit()); - $this->assertEquals(7, $sut->getTimesheetActiveEntriesSoftLimit()); $this->assertTrue($sut->isTimesheetAllowFutureTimes()); $this->assertTrue($sut->isTimesheetMarkdownEnabled()); $this->assertEquals('default', $sut->getTimesheetTrackingMode()); diff --git a/tests/Invoice/ServiceInvoiceTest.php b/tests/Invoice/ServiceInvoiceTest.php index 009e153b..46163403 100644 --- a/tests/Invoice/ServiceInvoiceTest.php +++ b/tests/Invoice/ServiceInvoiceTest.php @@ -156,6 +156,9 @@ class ServiceInvoiceTest extends TestCase self::assertEquals([], $items); } + /** + * @group legacy + */ public function testFindInvoiceItemsWithCustomer() { $sut = $this->getSut([]);