fix calendar drag and drop for regular user (#3358)

This commit is contained in:
Kevin Papst
2022-06-14 13:07:57 +02:00
committed by GitHub
parent a60df65062
commit cdf5a545eb
2 changed files with 7 additions and 3 deletions

View File

@@ -17,11 +17,11 @@ class Constants
/**
* The current release version
*/
public const VERSION = '1.20.3';
public const VERSION = '1.20.4';
/**
* The current release: major * 10000 + minor * 100 + patch
*/
public const VERSION_ID = 12003;
public const VERSION_ID = 12004;
/**
* The current release status, either "stable" or "dev"
*/

View File

@@ -73,7 +73,9 @@
{% set canDelete = is_granted('delete_own_timesheet') %}
{% set canCreate = is_granted('create_own_timesheet') %}
{% set canEdit = is_granted('edit_own_timesheet') %}
{% set isForeignEdit = false %}
{% if user != app.user %}
{% set isForeignEdit = true %}
{% set createParams = '&user=' ~ user.id %}
{% set createRoute = 'admin_timesheet_create' %}
{% set editRoute = 'admin_timesheet_edit' %}
@@ -305,7 +307,9 @@
let source = entry.parentElement;
let plainData = entry.dataset.entry;
let data = JSON.parse(plainData);
data.user = {{ user.id }};
{% if isForeignEdit and canCreate %}
data.user = {{ user.id }};
{% endif %}
let urlReplacer = JSON.parse(source.dataset.routeReplacer);
let apiUrl = source.dataset.route;