enhanced plugin support (#634)

- refactored admin controller and templates
- plugin support for entity actions
- changed column mail to email in customer table
- refactored theme events
This commit is contained in:
Kevin Papst
2019-03-11 14:46:30 +01:00
committed by GitHub
parent 519be2d5a2
commit 3ac72a5c89
104 changed files with 1878 additions and 976 deletions

View File

@@ -14,6 +14,7 @@ use App\Entity\Project;
use App\Entity\Timesheet;
use App\Entity\User;
use App\Entity\UserPreference;
use App\Timesheet\Util;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Faker\Factory;
@@ -271,7 +272,8 @@ class TimesheetFixtures extends Fixture
$end = $end->modify('+ ' . (rand(1, 172800)) . ' seconds');
$duration = $end->getTimestamp() - $start->getTimestamp();
$rate = $user->getPreferenceValue(UserPreference::HOURLY_RATE);
$hourlyRate = (float) $user->getPreferenceValue(UserPreference::HOURLY_RATE);
$rate = Util::calculateRate($hourlyRate, $duration);
$entry = new Timesheet();
$entry
@@ -279,7 +281,7 @@ class TimesheetFixtures extends Fixture
->setProject($project)
->setDescription($description)
->setUser($user)
->setRate(round(($duration / 3600) * $rate))
->setRate($rate)
->setBegin($start);
if ($this->fixedRate) {
@@ -287,13 +289,14 @@ class TimesheetFixtures extends Fixture
}
if ($this->hourlyRate) {
$entry->setHourlyRate($rate);
$entry->setHourlyRate($hourlyRate);
}
if ($setEndDate) {
$entry
->setEnd($end)
->setDuration($duration);
->setDuration($duration)
;
}
return $entry;