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

@@ -23,6 +23,8 @@ use Faker\Generator;
*
* Execute this command to load the data:
* bin/console doctrine:fixtures:load
*
* @codeCoverageIgnore
*/
class CustomerFixtures extends Fixture
{
@@ -32,7 +34,7 @@ class CustomerFixtures extends Fixture
public const MAX_BUDGET = 100000;
public const MIN_GLOBAL_ACTIVITIES = 5;
public const MAX_GLOBAL_ACTIVITIES = 50;
public const MIN_PROJECTS_PER_CUSTOMER = 1;
public const MIN_PROJECTS_PER_CUSTOMER = 2;
public const MAX_PROJECTS_PER_CUSTOMER = 25;
public const MIN_ACTIVITIES_PER_PROJECT = 0;
public const MAX_ACTIVITIES_PER_PROJECT = 25;
@@ -48,6 +50,7 @@ class CustomerFixtures extends Fixture
for ($c = 1; $c <= $amountCustomers; $c++) {
$visibleCustomer = 0 != $c % 5;
$customer = $this->createCustomer($faker, $visibleCustomer);
$manager->persist($customer);
$projectForCustomer = rand(self::MIN_PROJECTS_PER_CUSTOMER, self::MAX_PROJECTS_PER_CUSTOMER);
for ($p = 1; $p <= $projectForCustomer; $p++) {
@@ -63,8 +66,6 @@ class CustomerFixtures extends Fixture
}
}
$manager->persist($customer);
$manager->flush();
$manager->clear();
}

View File

@@ -21,6 +21,8 @@ use Faker\Generator;
*
* Execute this command to load the data:
* $ php bin/console doctrine:fixtures:load
*
* @codeCoverageIgnore
*/
class InvoiceFixtures extends Fixture
{

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\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
@@ -25,6 +26,8 @@ use Faker\Factory;
*
* Execute this command to load the data:
* bin/console doctrine:fixtures:load
*
* @codeCoverageIgnore
*/
class TimesheetFixtures extends Fixture implements DependentFixtureInterface
{
@@ -181,11 +184,12 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
$end = $end->modify('+ ' . (rand(self::MIN_MINUTES_PER_ENTRY, self::MAX_MINUTES_PER_ENTRY)) . ' minutes');
$duration = $end->getTimestamp() - $start->getTimestamp();
$rate = $user->getPreferenceValue(UserPreference::HOURLY_RATE);
$hourlyRate = (float) $user->getPreferenceValue(UserPreference::HOURLY_RATE);
$rate = Util::calculateRate($hourlyRate, $duration);
$entry
->setEnd($end)
->setRate(round(($duration / 3600) * $rate))
->setRate($rate)
->setDuration($duration);
}

View File

@@ -22,6 +22,8 @@ use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
*
* Execute this command to load the data:
* $ php bin/console doctrine:fixtures:load
*
* @codeCoverageIgnore
*/
class UserFixtures extends Fixture
{