This commit is contained in:
gerard 2018-07-16 13:31:03 +02:00
parent 144cb3ee63
commit 26e95bfa56
2 changed files with 8 additions and 41 deletions

View File

@ -1,31 +0,0 @@
import ngModule from '../module';
class Controller {
constructor($scope, $element) {
this.$ = $scope;
this.ticket = {};
}
show() {
this.$.dialog.show();
}
hide() {
this.$.dialog.hide();
}
onResponse(response) {
this.$.ticketCreate.createTicket().then(res => {
this.callback({res});
});
}
}
Controller.$inject = ['$scope'];
ngModule.component('vnTicketCreateDialog', {
template: require('./create-dialog.html'),
controller: Controller,
bindings: {
ticket: '<?',
callback: '&'
}
});

View File

@ -111,16 +111,14 @@ class Controller {
showDeleteTicketDialog() {
this.$.deleteConfirmation.show();
}
returnDeleteTicketDialog(response) {
if (response === 'ACCEPT')
this.deleteTicket();
}
deleteTicket() {
let params = {id: this.$state.params.id};
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
this.$state.go('ticket.index');
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
});
deleteTicket(response) {
if (response === 'ACCEPT') {
let params = {id: this.$state.params.id};
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
this.$state.go('ticket.index');
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
});
}
}
// Remove Lines
onRemoveLinesClick(response) {