random improvements (#5506)
* fix order of destroying form elements * API documentation - fixes #1949 * make command path independent * use PhpSubprocess to execute migrations * allow to configure optional SAML attributes * fix deprecation * unify wording of exported state - fixes #5392
This commit is contained in:
@@ -27,7 +27,11 @@ final class TimesheetApiEditForm extends TimesheetEditForm
|
||||
return;
|
||||
}
|
||||
|
||||
$builder->add('billable', BillableType::class);
|
||||
$builder->add('billable', BillableType::class, [
|
||||
'documentation' => [
|
||||
'description' => 'If true, this timesheet will be flagged as billable'
|
||||
]
|
||||
]);
|
||||
|
||||
$builder->addEventListener(
|
||||
FormEvents::PRE_SUBMIT,
|
||||
@@ -56,6 +60,7 @@ final class TimesheetApiEditForm extends TimesheetEditForm
|
||||
$builder->remove('metaFields');
|
||||
}
|
||||
|
||||
// TODO this is only a quick fix, see bugs reports
|
||||
if ($builder->has('duration')) {
|
||||
$builder->remove('duration');
|
||||
}
|
||||
@@ -64,11 +69,6 @@ final class TimesheetApiEditForm extends TimesheetEditForm
|
||||
$builder->get('user')->setRequired(false);
|
||||
}
|
||||
|
||||
// TODO this is only a quick fix, see bugs reports
|
||||
if ($builder->has('duration')) {
|
||||
$builder->remove('duration');
|
||||
}
|
||||
|
||||
if ($builder->has('tags')) {
|
||||
$builder->remove('tags');
|
||||
// @deprecated for BC reasons here, arrays will be supported in 2.0
|
||||
@@ -82,6 +82,10 @@ final class TimesheetApiEditForm extends TimesheetEditForm
|
||||
{
|
||||
$builder->add('begin', DateTimeApiType::class, array_merge($dateTimeOptions, [
|
||||
'label' => 'begin',
|
||||
'required' => false,
|
||||
'documentation' => [
|
||||
'description' => 'If no begin date-time is set, the users current timestamp will be used'
|
||||
]
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -90,6 +94,9 @@ final class TimesheetApiEditForm extends TimesheetEditForm
|
||||
$builder->add('end', DateTimeApiType::class, array_merge($dateTimeOptions, [
|
||||
'label' => 'end',
|
||||
'required' => false,
|
||||
'documentation' => [
|
||||
'description' => 'If no end date-time is set, the timesheet will be running'
|
||||
]
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
@@ -183,8 +183,8 @@ final class TimesheetMultiUpdate extends AbstractType
|
||||
'label' => 'mark_as_exported',
|
||||
'required' => false,
|
||||
'choices' => [
|
||||
'entryState.exported' => true,
|
||||
'entryState.not_exported' => false
|
||||
'yes' => true,
|
||||
'no' => false
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@ class TimesheetEditForm extends AbstractType
|
||||
{
|
||||
use FormTrait;
|
||||
|
||||
public function __construct(private CustomerRepository $customers, private SystemConfiguration $systemConfiguration)
|
||||
public function __construct(
|
||||
private readonly CustomerRepository $customers,
|
||||
private readonly SystemConfiguration $systemConfiguration
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -400,14 +403,17 @@ class TimesheetEditForm extends AbstractType
|
||||
}
|
||||
|
||||
$builder->add('exported', YesNoType::class, [
|
||||
'label' => 'exported'
|
||||
'label' => 'exported',
|
||||
'documentation' => [
|
||||
'description' => 'If true, this timesheet will be flagged as being exported'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
protected function addBillable(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
if ($options['include_billable']) {
|
||||
$builder->add('billableMode', TimesheetBillableType::class, []);
|
||||
$builder->add('billableMode', TimesheetBillableType::class);
|
||||
}
|
||||
|
||||
$builder->addModelTransformer(new CallbackTransformer(
|
||||
|
||||
Reference in New Issue
Block a user