(fix) XSRF supprot for all calendar operations

pull/207/head
Ludovic Marcotte 2016-05-04 14:52:06 -04:00
parent 5f2a862bc8
commit f3f1f6dcb4
3 changed files with 12 additions and 7 deletions

View File

@ -8,7 +8,7 @@
xmlns:label="OGo:label"
className="UIxPageFrame"
title="title"
const:jsFiles="Common.js, vendor/ng-sortable.min.js, Preferences.services.js, Contacts.services.js, Mailer.services.js, vendor/angular-file-upload.min.js, Scheduler.js, Scheduler.services.js">
const:jsFiles="Common.js, vendor/ng-sortable.min.js, Preferences.services.js, Contacts.services.js, Mailer.services.js, vendor/angular-file-upload.min.js, Scheduler.js, Scheduler.services.js, vendor/FileSaver.min.js">
<script type="text/javascript">
var firstDayOfWeek = <var:string value="firstDayOfWeek"/>;
var dayStartHour = <var:string value="dayStartHour"/>;
@ -121,7 +121,7 @@
</md-button>
</md-menu-item>
<md-menu-item>
<md-button ng-click="app.exportCalendar(calendar)">
<md-button ng-click="calendar.export()">
<var:string label:value="Export"/>
</md-button>
</md-menu-item>

View File

@ -438,6 +438,16 @@
});
};
/**
* @function export
* @memberof Calendar.prototype
* @desc Export the calendar
* @returns a promise of the HTTP operation
*/
Calendar.prototype.export = function() {
return Calendar.$$resource.download(this.id + '.ics', 'export', null, {type: 'application/octet-stream'});
};
/**
* @function $setActivation
* @memberof Calendar.prototype

View File

@ -20,7 +20,6 @@
vm.renameFolder = renameFolder;
vm.share = share;
vm.importCalendar = importCalendar;
vm.exportCalendar = exportCalendar;
vm.showOnly = showOnly;
vm.showAll = showAll;
vm.showLinks = showLinks;
@ -241,10 +240,6 @@
}
}
function exportCalendar(calendar) {
window.location.href = ApplicationBaseURL + '/' + calendar.id + '.ics' + '/export';
}
function showOnly(calendar) {
_.forEach(Calendar.$findAll(), function(o) {
if (calendar.id == o.id)