fixed calendar for empty timesheet descriptions (#265)
This commit is contained in:
@@ -155,7 +155,7 @@ class TimesheetEntity
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getDescription(): string
|
public function getDescription(): ?string
|
||||||
{
|
{
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,10 +66,18 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
if ($i > self::MAX_TIMESHEETS_TOTAL) {
|
if ($i > self::MAX_TIMESHEETS_TOTAL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$description = null;
|
||||||
|
if ($i % 3 == 0) {
|
||||||
|
$description = $faker->text;
|
||||||
|
} elseif ($i % 7 == 0) {
|
||||||
|
$description = '';
|
||||||
|
}
|
||||||
|
|
||||||
$entry = $this->createTimesheetEntry(
|
$entry = $this->createTimesheetEntry(
|
||||||
$user,
|
$user,
|
||||||
$activities[array_rand($activities)],
|
$activities[array_rand($activities)],
|
||||||
($i % 3 == 0 ? $faker->text : ''),
|
$description,
|
||||||
round($i / 2),
|
round($i / 2),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@@ -89,7 +97,7 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
$entry = $this->createTimesheetEntry(
|
$entry = $this->createTimesheetEntry(
|
||||||
$user,
|
$user,
|
||||||
$activities[array_rand($activities)],
|
$activities[array_rand($activities)],
|
||||||
$faker->text
|
null
|
||||||
);
|
);
|
||||||
$manager->persist($entry);
|
$manager->persist($entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,10 +97,16 @@ class TimesheetFixtures extends Fixture
|
|||||||
$user = $this->user;
|
$user = $this->user;
|
||||||
|
|
||||||
for ($i = 0; $i < $this->amount; $i++) {
|
for ($i = 0; $i < $this->amount; $i++) {
|
||||||
|
$description = null;
|
||||||
|
if ($i % 3 == 0) {
|
||||||
|
$description = $faker->text;
|
||||||
|
} elseif ($i % 2 == 0) {
|
||||||
|
$description = '';
|
||||||
|
}
|
||||||
$entry = $this->createTimesheetEntry(
|
$entry = $this->createTimesheetEntry(
|
||||||
$user,
|
$user,
|
||||||
$activities[array_rand($activities)],
|
$activities[array_rand($activities)],
|
||||||
($i % 3 == 0 ? $faker->text : ''),
|
$description,
|
||||||
$this->getDateTime($i)
|
$this->getDateTime($i)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user