diff --git a/assets/js/backend_calendar_table_view.js b/assets/js/backend_calendar_table_view.js
index a4562e4b..fd2742db 100755
--- a/assets/js/backend_calendar_table_view.js
+++ b/assets/js/backend_calendar_table_view.js
@@ -413,32 +413,38 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
});
// Create providers and service filters.
- if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
- $('', {
- 'text': EALang.provider
- })
- .appendTo($calendarHeader);
+ $('', {
+ 'text': EALang.provider
+ })
+ .appendTo($calendarHeader);
- $filterProvider = $('', {
- 'id': 'filter-provider',
- 'multiple': 'multiple',
- 'on': {
- 'change': function () {
- var startDate = new Date($('.calendar-view .date-column:first').data('date'));
- var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-date').val()) - 1});
- createView(startDate, endDate);
- }
+ $filterProvider = $('', {
+ 'id': 'filter-provider',
+ 'multiple': 'multiple',
+ 'on': {
+ 'change': function () {
+ var startDate = new Date($('.calendar-view .date-column:first').data('date'));
+ var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-date').val()) - 1});
+ createView(startDate, endDate);
}
- })
- .appendTo($calendarHeader);
+ }
+ })
+ .appendTo($calendarHeader);
+ if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
providers.forEach(function (provider) {
$filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
});
-
- $filterProvider.select2();
+ } 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();
+
var services = GlobalVariables.availableServices.filter(function (service) {
var provider = providers.find(function (provider) {
return provider.services.indexOf(service.id) !== -1;