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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user