parent
93bb95d256
commit
e4f6be243e
1
NEWS
1
NEWS
|
@ -6,6 +6,7 @@ Enhancements
|
|||
- [web] new button to mark a task as completed (#4531)
|
||||
- [web] new button to reset Calendar categories to defaults
|
||||
- [web] moved the unseen messages count to the beginning of the window's title (#4553)
|
||||
- [web] allow export of calendars subscriptions (#4560)
|
||||
|
||||
Bug fixes
|
||||
- [web] include mail account name in form validation (#4532)
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
SOGoAppointmentFolderICS = {
|
||||
methods = {
|
||||
export = {
|
||||
protectedBy = "View";
|
||||
protectedBy = "Access Contents Information";
|
||||
actionClass = "UIxCalFolderActions";
|
||||
actionName = "export";
|
||||
};
|
||||
|
|
|
@ -487,7 +487,7 @@
|
|||
ng-show="list.component.$isLoading()">
|
||||
<md-progress-circular class="md-accent"
|
||||
md-mode="indeterminate"
|
||||
md-diameter="32"><!-- mailbox loading progress --></md-progress-circular>
|
||||
md-diameter="32"><!-- components loading progress --></md-progress-circular>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -572,7 +572,7 @@
|
|||
<var:string label:value="Import"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item ng-hide="::($menuCtrl.calendar.isSubscription || $menuCtrl.calendar.isWebCalendar)">
|
||||
<md-menu-item ng-hide="::$menuCtrl.calendar.isWebCalendar">
|
||||
<md-button ng-click="$menuCtrl.calendar.export()">
|
||||
<var:string label:value="Export"/>
|
||||
</md-button>
|
||||
|
|
|
@ -554,14 +554,26 @@
|
|||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
Calendar.prototype.export = function() {
|
||||
var options;
|
||||
var options, resource, ownerPaths, realOwnerId, path, index;
|
||||
|
||||
options = {
|
||||
type: 'application/octet-stream',
|
||||
filename: this.name + '.ics'
|
||||
};
|
||||
|
||||
return Calendar.$$resource.open(this.id + '.ics', 'export', null, options);
|
||||
if (this.isSubscription) {
|
||||
index = this.urls.webDavICSURL.indexOf('/dav/');
|
||||
ownerPaths = this.urls.webDavICSURL.substring(index + 5).split(/\//);
|
||||
realOwnerId = ownerPaths[0];
|
||||
resource = Calendar.$$resource.userResource(realOwnerId);
|
||||
path = ownerPaths.splice(ownerPaths.length - 2).join('/');
|
||||
}
|
||||
else {
|
||||
resource = Calendar.$$resource;
|
||||
path = this.id + '.ics';
|
||||
}
|
||||
|
||||
return resource.open(path, 'export', null, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue