View Issue Details

IDProjectCategoryView StatusLast Update
0004644SOGoWeb Calendarpublic2019-01-16 11:35
Reporterschmirl Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version4.0.5 
Summary0004644: SOGoDefaultCalendar = "selected" is not implemented
Description

Of the three possible values for SOGoDefaultCalendar (selected, personal, first), "selected" is not implemented and falls back to "personal".

Steps To Reproduce

Set SOGoDefaultCalendar to "selected" (the default). Currently there's no way to select a calendar.

Additional Information

I've attached a patch with the actual implementation of "selected". What's missing is an indicator for the currently selected calendar, i.e. you can click a calendar in the left panel and new calendar entries will indeed use this calendar. However there's no optical feedback, which calender will receive new entries.

Changing the background colour of the selected calender similar to selecting an addressbook is IMO not the right way, as only writeable calenders can be selected. So clicking a read-only calendar would actually highlight the personal calendar which is probably irritating. Also, when selecting a calendar, I would expect something to happen in the main view. When clicking an addressbook, only the entries of this addressbook will be shown. In the calendar view this is not desired.

I'd suggest some marker displayed in the line of the selected calendar (e.g. a small calendar icon with an asterisk or + sign). A tooltip would be helpfull ("default calendar for new entries"). If SoGoDefaultCalendar is set to either personal or first, the marker is also helpful.

TagsNo tags attached.

Activities

schmirl

schmirl

2019-01-16 11:35

reporter  

sogo-4.0.4-defaultCalendar_selected.diff (1,996 bytes)   
diff -ur SOGo-4.0.4.orig/UI/WebServerResources/js/Scheduler/Calendar.service.js SOGo-4.0.4/UI/WebServerResources/js/Scheduler/Calendar.service.js
--- SOGo-4.0.4.orig/UI/WebServerResources/js/Scheduler/Calendar.service.js	2018-10-23 21:22:36.000000000 +0200
+++ SOGo-4.0.4/UI/WebServerResources/js/Scheduler/Calendar.service.js	2019-01-16 09:23:35.165297026 +0100
@@ -33,6 +33,7 @@
       $Component: Component,
       $$Acl: Acl,
       activeUser: Settings.activeUser(),
+      $selectedCalendar: 'personal',
       $view: null
     });
 
@@ -72,6 +73,13 @@
       });
       if (calendar)
         return calendar.id;
+    }
+    else if (defaultCalendar == 'selected') {
+      calendar = _.find(Calendar.$findAll(null, true), function(calendar) {
+        return calendar.id == Calendar.$selectedCalendar;
+      });
+      if (calendar)
+        return calendar.id;
     }
 
     return 'personal';
diff -ur SOGo-4.0.4.orig/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js SOGo-4.0.4/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js
--- SOGo-4.0.4.orig/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js	2018-10-23 21:22:36.000000000 +0200
+++ SOGo-4.0.4/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js	2019-01-16 09:23:23.953296546 +0100
@@ -20,6 +20,7 @@
         '           ng-false-value="0"',
         '           aria-label="' + l('Enable') + '"></md-switch>',
         '<p class="sg-item-name"',
+        '   ng-click="$ctrl.selectCalendar()"',
         '   ng-dblclick="$ctrl.editFolder($event)">',
         '  <span ng-bind="$ctrl.calendar.name"></span>',
         '  <md-icon ng-if="$ctrl.calendar.$error" class="md-warn">error</md-icon>',
@@ -136,6 +137,9 @@
       this.inputElement.value = this.calendar.name;
     };
 
+    this.selectCalendar = function() {
+      Calendar.$selectedCalendar = this.calendar.id;
+    };
 
     this.confirmDelete = function() {
       if (this.calendar.isSubscription) {

Issue History

Date Modified Username Field Change
2019-01-16 11:35 schmirl New Issue
2019-01-16 11:35 schmirl File Added: sogo-4.0.4-defaultCalendar_selected.diff