- Added: calendar entry title combination for customer, project and activity - Added: show not_invoiced and not_exported data in detail screens - Added: force logout if user is disabled - Added: reduced amount of database queries on several screens - Fixed: open-close status on work-contract screen for users without configuration - Fixed: failsafe order/orderBy in query if manually manipulated to be null - Fixed: unify statistic calculation (not_invoiced and not_exported) across screens - Tech: bump packages - Tech: Symfony 6.4
79 lines
1.5 KiB
PHP
79 lines
1.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Kimai time-tracking app.
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace App\Reporting\ProjectView;
|
|
|
|
use App\Entity\Customer;
|
|
use App\Entity\User;
|
|
use DateTime;
|
|
|
|
final class ProjectViewQuery
|
|
{
|
|
private ?Customer $customer = null;
|
|
private bool $includeNoWork = false;
|
|
private ?bool $budgetType = true;
|
|
|
|
public function __construct(private DateTime $today, private User $user)
|
|
{
|
|
}
|
|
|
|
public function getUser(): User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function getBudgetType(): ?bool
|
|
{
|
|
return $this->budgetType;
|
|
}
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
public function setBudgetType(?bool $budgetType): void
|
|
{
|
|
$this->budgetType = $budgetType;
|
|
}
|
|
|
|
public function isIncludeWithoutBudget(): bool
|
|
{
|
|
return $this->budgetType === false;
|
|
}
|
|
|
|
public function isIncludeWithBudget(): bool
|
|
{
|
|
return $this->budgetType === true;
|
|
}
|
|
|
|
public function isIncludeNoWork(): bool
|
|
{
|
|
return $this->includeNoWork;
|
|
}
|
|
|
|
public function setIncludeNoWork(bool $includeNoWork): void
|
|
{
|
|
$this->includeNoWork = $includeNoWork;
|
|
}
|
|
|
|
public function getCustomer(): ?Customer
|
|
{
|
|
return $this->customer;
|
|
}
|
|
|
|
public function setCustomer(Customer $customer): void
|
|
{
|
|
$this->customer = $customer;
|
|
}
|
|
|
|
public function getToday(): DateTime
|
|
{
|
|
return $this->today;
|
|
}
|
|
}
|