Skip to content

Commit

Permalink
alfio-event#549 - Retrieve waiting queue fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Nassim Bounouas committed Nov 28, 2018
1 parent 077dc33 commit 3eb15e2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
};

ctrl.waitingQueueDownloadFieldsSelectionModal = function() {
EventService.waitingQueueDownloadFieldsSelection(ctrl.event);
EventService.exportWaitingQueue(ctrl.event);
};

ctrl.downloadSponsorsScan = function() {
Expand Down
44 changes: 44 additions & 0 deletions src/main/webapp/resources/js/admin/service/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,50 @@
return modal.result;
},

exportWaitingQueue: function(event) {
var modal = $uibModal.open({
size:'lg',
templateUrl:'/resources/angular-templates/admin/partials/event/fragment/waiting-queue-select-field-modal.html',
backdrop: 'static',
controller: function($scope) {
$scope.selected = {};
$scope.format = 'excel';
service.getWaitingQueueFields(event.shortName).then(function(fields) {
$scope.fields = fields.data;
angular.forEach(fields.data, function(v) {
$scope.selected[v.key] = false;
})
});

$scope.selectAll = function() {
angular.forEach($scope.selected, function(v,k) {
$scope.selected[k] = true;
});
};

$scope.deselectAll = function() {
angular.forEach($scope.selected, function(v,k) {
$scope.selected[k] = false;
});
};

$scope.download = function() {
var queryString = "format="+$scope.format+"&";
angular.forEach($scope.selected, function(v,k) {
if(v) {
queryString+="fields="+k+"&";
}
});
var pathName = $window.location.pathname;
if(!pathName.endsWith("/")) {
pathName = pathName + "/";
}
$window.open(pathName+"api/events/"+event.shortName+"/export.csv?"+queryString);
};
}
});
},

exportAttendees: function(event) {
var modal = $uibModal.open({
size:'lg',
Expand Down

0 comments on commit 3eb15e2

Please sign in to comment.