Release 2.0.5 (#3888)
- Fixed: mandatory fields / form validation for invoice template - Added: Duration as calendar title replacer (open: running records) - Fixed: HTML injection in Calendar - Fixed: Doctrine Proxies are not initialized (leads to empty customer/project) - Fixed: tag creation - Fixed: validation errors do not need to be logged in prod - Removed: Customer VCard download, as used library is outdated and not maintained - Added: supporting translations domains in many new places (menu, help_text, page_setup, report, exporter, calendar)
This commit is contained in:
@@ -35,26 +35,6 @@ class ActivityRepository extends EntityRepository
|
||||
{
|
||||
use RepositorySearchTrait;
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param null $lockMode
|
||||
* @param null $lockVersion
|
||||
* @return Activity|null
|
||||
*/
|
||||
public function find($id, $lockMode = null, $lockVersion = null): ?Activity
|
||||
{
|
||||
/** @var Activity|null $activity */
|
||||
$activity = parent::find($id, $lockMode, $lockVersion);
|
||||
if (null === $activity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$loader = new ActivityLoader($this->getEntityManager(), true);
|
||||
$loader->loadResults([$activity]);
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Project $project
|
||||
* @return Activity[]
|
||||
|
||||
@@ -35,26 +35,6 @@ class CustomerRepository extends EntityRepository
|
||||
{
|
||||
use RepositorySearchTrait;
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param null $lockMode
|
||||
* @param null $lockVersion
|
||||
* @return Customer|null
|
||||
*/
|
||||
public function find($id, $lockMode = null, $lockVersion = null): ?Customer
|
||||
{
|
||||
/** @var Customer|null $customer */
|
||||
$customer = parent::find($id, $lockMode, $lockVersion);
|
||||
if (null === $customer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$loader = new CustomerLoader($this->getEntityManager(), true);
|
||||
$loader->loadResults([$customer]);
|
||||
|
||||
return $customer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $customerIDs
|
||||
* @return Customer[]
|
||||
|
||||
@@ -32,6 +32,9 @@ final class ActivityLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($activity) {
|
||||
if ($activity instanceof Activity) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$activity->getName();
|
||||
|
||||
return $activity->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ final class CustomerLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($customer) {
|
||||
if ($customer instanceof Customer) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$customer->getName();
|
||||
|
||||
return $customer->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ final class InvoiceLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($invoice) {
|
||||
if ($invoice instanceof Invoice) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$invoice->getInvoiceNumber();
|
||||
|
||||
return $invoice->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ final class ProjectLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($project) {
|
||||
if ($project instanceof Project) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$project->getName();
|
||||
|
||||
return $project->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ final class TeamLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($team) {
|
||||
if ($team instanceof Team) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$team->getName();
|
||||
|
||||
return $team->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ final class TimesheetLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($timesheet) {
|
||||
if ($timesheet instanceof Timesheet) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$timesheet->getType();
|
||||
|
||||
return $timesheet->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ final class UserLoader implements LoaderInterface
|
||||
|
||||
$ids = array_map(function ($user) {
|
||||
if ($user instanceof User) {
|
||||
// make sure that this potential doctrine proxy is initialized and filled with all data
|
||||
$user->getDisplayName();
|
||||
|
||||
return $user->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,26 +38,6 @@ class ProjectRepository extends EntityRepository
|
||||
{
|
||||
use RepositorySearchTrait;
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param null $lockMode
|
||||
* @param null $lockVersion
|
||||
* @return Project|null
|
||||
*/
|
||||
public function find($id, $lockMode = null, $lockVersion = null): ?Project
|
||||
{
|
||||
/** @var Project|null $project */
|
||||
$project = parent::find($id, $lockMode, $lockVersion);
|
||||
if (null === $project) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$loader = new ProjectLoader($this->getEntityManager(), true);
|
||||
$loader->loadResults([$project]);
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $projectIds
|
||||
* @return Project[]
|
||||
|
||||
@@ -64,7 +64,7 @@ trait RepositorySearchTrait
|
||||
$c = 0;
|
||||
foreach ($searchTerm->getSearchFields() as $metaName => $metaValue) {
|
||||
$and = $qb->expr()->andX();
|
||||
/** @var literal-string $alias */
|
||||
/** @var non-falsy-string&literal-string $alias */
|
||||
$alias = 'meta' . $a++;
|
||||
$paramName = 'metaName' . $i++;
|
||||
$paramValue = 'metaValue' . $c++;
|
||||
|
||||
@@ -40,20 +40,6 @@ class TeamRepository extends EntityRepository
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function find($id, $lockMode = null, $lockVersion = null): ?Team
|
||||
{
|
||||
/** @var Team|null $team */
|
||||
$team = parent::find($id, $lockMode, $lockVersion);
|
||||
if (null === $team) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$loader = new TeamLoader($this->getEntityManager());
|
||||
$loader->loadResults([$team]);
|
||||
|
||||
return $team;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $teamIds
|
||||
* @return Team[]
|
||||
|
||||
@@ -78,26 +78,6 @@ class TimesheetRepository extends EntityRepository
|
||||
return $qb->getQuery()->getOneOrNullResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param null $lockMode
|
||||
* @param null $lockVersion
|
||||
* @return Timesheet|null
|
||||
*/
|
||||
public function find($id, $lockMode = null, $lockVersion = null): ?Timesheet
|
||||
{
|
||||
/** @var Timesheet|null $timesheet */
|
||||
$timesheet = parent::find($id, $lockMode, $lockVersion);
|
||||
if (null === $timesheet) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$loader = new TimesheetLoader($this->getEntityManager());
|
||||
$loader->loadResults([$timesheet]);
|
||||
|
||||
return $timesheet;
|
||||
}
|
||||
|
||||
public function delete(Timesheet $timesheet): void
|
||||
{
|
||||
$entityManager = $this->getEntityManager();
|
||||
|
||||
Reference in New Issue
Block a user