Fixed issue with table view while being logged in as a provider (#928).

This commit is contained in:
Alex Tselegidis 2020-11-16 10:15:52 +02:00
parent 976cabb2c4
commit b3fbf60e29

View file

@ -413,7 +413,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}); });
// Create providers and service filters. // Create providers and service filters.
if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
$('<label/>', { $('<label/>', {
'text': EALang.provider 'text': EALang.provider
}) })
@ -432,12 +431,19 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}) })
.appendTo($calendarHeader); .appendTo($calendarHeader);
if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
providers.forEach(function (provider) { providers.forEach(function (provider) {
$filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id)); $filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
}); });
} else {
providers.forEach(function (provider) {
if (Number(provider.id) === Number(GlobalVariables.user.id)) {
$filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
}
});
}
$filterProvider.select2(); $filterProvider.select2();
}
var services = GlobalVariables.availableServices.filter(function (service) { var services = GlobalVariables.availableServices.filter(function (service) {
var provider = providers.find(function (provider) { var provider = providers.find(function (provider) {