use dialog to duplicate timesheet (#2567)
* fix: display time budget in customer listing if set * updated api methods with annotations * do not require checkboxes for system configurations * open dialog for duplicated timesheets
This commit is contained in:
@@ -12,9 +12,12 @@ namespace App\EventSubscriber\Actions;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Event\PageActionsEvent;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
abstract class AbstractTimesheetSubscriber extends AbstractActionsSubscriber
|
||||
{
|
||||
protected function timesheetActions(PageActionsEvent $event, string $routeListing, string $routeEdit): void
|
||||
protected function timesheetActions(PageActionsEvent $event, string $routeEdit, string $routeDuplicate): void
|
||||
{
|
||||
$payload = $event->getPayload();
|
||||
|
||||
@@ -35,7 +38,8 @@ abstract class AbstractTimesheetSubscriber extends AbstractActionsSubscriber
|
||||
}
|
||||
|
||||
if ($this->isGranted('duplicate', $timesheet)) {
|
||||
$event->addAction('copy', ['url' => $this->path('duplicate_timesheet', ['id' => $timesheet->getId()]), 'class' => 'api-link', 'attr' => ['data-payload' => '{"copy": "all"}', 'data-event' => 'kimai.timesheetStart kimai.timesheetUpdate', 'data-method' => 'PATCH', 'data-msg-error' => 'action.update.error', 'data-msg-success' => 'action.update.success']]);
|
||||
$class = $event->isView('edit') ? '' : 'modal-ajax-form';
|
||||
$event->addAction('copy', ['url' => $this->path($routeDuplicate, ['id' => $timesheet->getId()]), 'class' => $class]);
|
||||
}
|
||||
|
||||
if ($event->countActions() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user