Release 2.6.0 (#4472)
- Added: calendar entry title combination for customer, project and activity - Added: show not_invoiced and not_exported data in detail screens - Added: force logout if user is disabled - Added: reduced amount of database queries on several screens - Fixed: open-close status on work-contract screen for users without configuration - Fixed: failsafe order/orderBy in query if manually manipulated to be null - Fixed: unify statistic calculation (not_invoiced and not_exported) across screens - Tech: bump packages - Tech: Symfony 6.4
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
namespace App\Form;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Entity\Customer;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Form\Type\CustomerType;
|
||||
use App\Form\Type\DatePickerType;
|
||||
use App\Form\Type\DescriptionType;
|
||||
use App\Form\Type\DurationType;
|
||||
@@ -23,6 +25,7 @@ use App\Form\Type\TimesheetBillableType;
|
||||
use App\Form\Type\UserType;
|
||||
use App\Form\Type\YesNoType;
|
||||
use App\Repository\CustomerRepository;
|
||||
use App\Repository\Query\CustomerFormTypeQuery;
|
||||
use App\Timesheet\Calculator\BillableCalculator;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
@@ -49,7 +52,6 @@ class TimesheetEditForm extends AbstractType
|
||||
$project = null;
|
||||
$customer = null;
|
||||
$currency = false;
|
||||
$customerCount = $this->customers->countCustomer(true);
|
||||
$timezone = $options['timezone'];
|
||||
$isNew = true;
|
||||
|
||||
@@ -100,15 +102,33 @@ class TimesheetEditForm extends AbstractType
|
||||
$this->addDuration($builder, $options, (!$options['allow_begin_datetime'] || !$options['allow_end_datetime']), $isNew);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
$query = new CustomerFormTypeQuery($customer);
|
||||
$query->setUser($options['user']); // @phpstan-ignore-line
|
||||
$qb = $this->customers->getQueryBuilderForFormType($query);
|
||||
/** @var array<Customer> $customers */
|
||||
$customers = $qb->getQuery()->getResult();
|
||||
$customerCount = \count($customers);
|
||||
|
||||
if ($this->showCustomer($options, $isNew, $customerCount)) {
|
||||
$this->addCustomer($builder, $customer);
|
||||
$builder->add('customer', CustomerType::class, [
|
||||
'choices' => $customers,
|
||||
'data' => $customer,
|
||||
'required' => false,
|
||||
'placeholder' => '',
|
||||
'mapped' => false,
|
||||
'project_enabled' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$allowCreate = (bool) $this->systemConfiguration->find('activity.allow_inline_create');
|
||||
|
||||
// TODO pre-select if only one exists
|
||||
$this->addProject($builder, $isNew, $project, $customer);
|
||||
|
||||
// TODO make creation possible
|
||||
//$allowCreate = (bool) $this->systemConfiguration->find('activity.allow_inline_create');
|
||||
$this->addActivity($builder, $activity, $project, [
|
||||
'allow_create' => $allowCreate && $options['create_activity'],
|
||||
'allow_create' => false,
|
||||
// 'allow_create' => $allowCreate && $options['create_activity'],
|
||||
]);
|
||||
|
||||
$descriptionOptions = ['required' => false];
|
||||
@@ -394,7 +414,7 @@ class TimesheetEditForm extends AbstractType
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$maxMinutes = $this->systemConfiguration->getTimesheetLongRunningDuration();
|
||||
$maxHours = 8;
|
||||
$maxHours = 10;
|
||||
if ($maxMinutes > 0) {
|
||||
$maxHours = (int) ($maxMinutes / 60);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user