@@ -54,30 +54,30 @@
-
+
{{$index+1}} |
- {{person.name}} {{person.surname}}
+ {{ticket.name}} {{ticket.surname}}
- <{{person.email}}>
- {{person.job_title}} @ {{person.company}}
+ <{{ticket.email}}>
+ {{ticket.job_title}} @ {{ticket.company}}
|
-
+
|
-
+
- {{person[col.key]}}
+ {{ticket[col.key]}}
|
-
+
|
diff --git a/angular_app/events-list.html b/angular_app/events-list.html
index 8029053..cbc2ad0 100644
--- a/angular_app/events-list.html
+++ b/angular_app/events-list.html
@@ -46,12 +46,12 @@
{{'Begins:' | translate}} {{event['begin-date'] | date:'fullDate'}} {{event['begin-time'] | date:'HH:mm'}}
{{'Ends:' | translate}} {{event['end-date'] | date:'fullDate' }} {{event['end-time'] | date:'HH:mm'}}
-
- {{attendeesNr}} / {{((event.persons || []) | registeredFilter).length}} ({{((attendeesNr / ((event.persons || []) | registeredFilter).length * 100) || 0).toFixed()}}%)
+ |
+ {{attendeesNr}} / {{((event.tickets || []) | registeredFilter).length}} ({{((attendeesNr / ((event.tickets || []) | registeredFilter).length * 100) || 0).toFixed()}}%)
|
-
+
|
diff --git a/angular_app/index.html b/angular_app/index.html
index 4046451..f091851 100644
--- a/angular_app/index.html
+++ b/angular_app/index.html
@@ -80,8 +80,8 @@
- -
- {{info.user.username}}
+
-
+ {{info.user.username}}
{{'logout' | translate}}
diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js
index b5050fc..9764b4a 100644
--- a/angular_app/js/controllers.js
+++ b/angular_app/js/controllers.js
@@ -72,7 +72,7 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$uibModal'
$scope.events = Event.all(function(events) {
if (events && $state.is('tickets')) {
angular.forEach(events, function(evt, idx) {
- var evt_tickets = (evt.persons || []).slice(0);
+ var evt_tickets = (evt.tickets || []).slice(0);
angular.forEach(evt_tickets, function(obj, obj_idx) {
obj.event_title = evt.title;
obj.event_id = evt._id;
@@ -133,7 +133,7 @@ eventManControllers.controller('EventsListCtrl', ['$scope', 'Event', '$uibModal'
eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event', '$log', '$translate', '$rootScope',
function ($scope, $state, Event, $log, $translate, $rootScope) {
$scope.event = {};
- $scope.event.persons = [];
+ $scope.event.tickets = [];
$scope.event.formSchema = {};
$scope.eventFormDisabled = false;
@@ -146,10 +146,10 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
// store a new Event or update an existing one
$scope.save = function() {
- // avoid override of event.persons list.
+ // avoid override of event.tickets list.
var this_event = angular.copy($scope.event);
- if (this_event.persons) {
- delete this_event.persons;
+ if (this_event.tickets) {
+ delete this_event.tickets;
}
if (this_event._id === undefined) {
$scope.event = Event.save(this_event);
@@ -169,7 +169,7 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', 'EventTicket', 'Setting', '$log', '$translate', '$rootScope', 'EventUpdates', '$uibModal',
function ($scope, $state, Event, EventTicket, Setting, $log, $translate, $rootScope, EventUpdates, $uibModal) {
- $scope.personsOrder = ["name", "surname"];
+ $scope.ticketsOrder = ["name", "surname"];
$scope.countAttendees = 0;
$scope.message = {};
$scope.event = {};
@@ -178,7 +178,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
$scope.formSchema = {};
$scope.formData = {};
$scope.guiOptions = {dangerousActionsEnabled: false};
- $scope.customFields = Setting.query({setting: 'person_custom_field', in_event_details: true});
+ $scope.customFields = Setting.query({setting: 'ticket_custom_field', in_event_details: true});
$scope.formFieldsMap = {};
$scope.formFieldsMapRev = {};
@@ -186,7 +186,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
if ($state.params.id) {
$scope.event = Event.get({id: $state.params.id}, function(data) {
$scope.$watchCollection(function() {
- return $scope.event.persons;
+ return $scope.event.tickets;
}, function(prev, old) {
$scope.calcAttendees();
}
@@ -215,7 +215,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
if ($state.is('event.tickets')) {
$scope.allPersons = Event.group_persons({id: $state.params.id});
- // Handle WebSocket connection used to update the list of persons.
+ // Handle WebSocket connection used to update the list of tickets.
$scope.EventUpdates = EventUpdates;
$scope.EventUpdates.open();
$scope.$watchCollection(function() {
@@ -230,23 +230,23 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
$log.debug('do not process our own message');
return false;
}
- if (!$scope.event.persons) {
- $scope.event.persons = [];
+ if (!$scope.event.tickets) {
+ $scope.event.tickets = [];
}
- var person_idx = $scope.event.persons.findIndex(function(el, idx, array) {
+ var ticket_idx = $scope.event.tickets.findIndex(function(el, idx, array) {
return data._id == el._id;
});
- if (person_idx != -1) {
+ if (ticket_idx != -1) {
$log.debug('_id ' + data._id + ' found');
} else {
$log.debug('_id ' + data._id + ' not found');
}
- if (data.action == 'update' && person_idx != -1 && $scope.event.persons[person_idx] != data.person) {
- $scope.event.persons[person_idx] = data.person;
- } else if (data.action == 'add' && person_idx == -1) {
- $scope._localAddTicket(data.person);
- } else if (data.action == 'delete' && person_idx != -1) {
+ if (data.action == 'update' && ticket_idx != -1 && $scope.event.tickets[ticket_idx] != data.ticket) {
+ $scope.event.tickets[ticket_idx] = data.ticket;
+ } else if (data.action == 'add' && ticket_idx == -1) {
+ $scope._localAddTicket(data.ticket);
+ } else if (data.action == 'delete' && ticket_idx != -1) {
$scope._localRemoveTicket({_id: data._id});
}
}
@@ -257,12 +257,12 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
}
$scope.calcAttendees = function() {
- if (!($scope.event && $scope.event.persons)) {
+ if (!($scope.event && $scope.event.tickets)) {
$scope.countAttendees = 0;
return;
}
var attendees = 0;
- angular.forEach($scope.event.persons, function(value, key) {
+ angular.forEach($scope.event.tickets, function(value, key) {
if (value.attended && !value.cancelled) {
attendees += 1;
}
@@ -272,30 +272,30 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
/* Stuff to do when a ticket is added, modified or removed locally. */
- $scope._localAddTicket = function(ticket, original_person) {
+ $scope._localAddTicket = function(ticket, original_ticket) {
if (!$state.is('event.tickets')) {
return true;
}
var ret = true;
- if (!$scope.event.persons) {
- $scope.event.persons = [];
+ if (!$scope.event.tickets) {
+ $scope.event.tickets = [];
}
- var ticket_idx = $scope.event.persons.findIndex(function(el, idx, array) {
+ var ticket_idx = $scope.event.tickets.findIndex(function(el, idx, array) {
return ticket._id == el._id;
});
if (ticket_idx != -1) {
$log.warn('ticket already present: not added');
ret = false;
} else {
- $scope.event.persons.push(ticket);
+ $scope.event.tickets.push(ticket);
}
// Try to remove this person from the allPersons list using ID or email.
var field = null;
var field_value = null;
- if (original_person && original_person._id) {
+ if (original_ticket && original_ticket._id) {
field = '_id';
- field_value = original_person._id;
+ field_value = original_ticket._id;
} else if (ticket.email) {
field = 'email';
field_value = ticket.email;
@@ -312,34 +312,36 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
};
$scope._localUpdateTicket = function(ticket) {
- if (!$scope.event.persons) {
- $scope.event.persons = [];
+ if (!$scope.event.tickets) {
+ $scope.event.tickets = [];
}
- var ticket_idx = $scope.event.persons.findIndex(function(el, idx, array) {
+ var ticket_idx = $scope.event.tickets.findIndex(function(el, idx, array) {
return ticket._id == el._id;
});
if (ticket_idx == -1) {
$log.warn('ticket not present: not updated');
return false;
}
- $scope.event.persons[ticket_idx] = ticket;
+ $scope.event.tickets[ticket_idx] = ticket;
};
- $scope._localRemoveTicket = function(person) {
- if (!(person && person._id && $scope.event.persons)) {
+ $scope._localRemoveTicket = function(ticket) {
+ if (!(ticket && ticket._id && $scope.event.tickets)) {
return;
}
- var person_idx = $scope.event.persons.findIndex(function(el, idx, array) {
- return person._id == el._id;
+ var ticket_idx = $scope.event.tickets.findIndex(function(el, idx, array) {
+ return ticket._id == el._id;
});
- if (person_idx == -1) {
- $log.warn('unable to find and delete ticket _id ' + person._id);
+ if (ticket_idx == -1) {
+ $log.warn('unable to find and delete ticket _id ' + ticket._id);
return;
}
- var removed_person = $scope.event.persons.splice(person_idx, 1);
+ var removed_person = $scope.event.tickets.splice(ticket_idx, 1);
// to be used to populate allPersons, if needed.
if (removed_person.length) {
person = removed_person[0];
+ } else {
+ return;
}
if (!$scope.allPersons) {
$scope.allPersons = [];
@@ -352,23 +354,23 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
}
};
- $scope.setTicketAttribute = function(person, key, value, callback, hideMessage) {
- $log.debug('setTicketAttribute for _id ' + person._id + ' key: ' + key + ' value: ' + value);
- var newData = {event_id: $state.params.id, _id: person._id};
+ $scope.setTicketAttribute = function(ticket, key, value, callback, hideMessage) {
+ $log.debug('setTicketAttribute for _id ' + ticket._id + ' key: ' + key + ' value: ' + value);
+ var newData = {event_id: $state.params.id, _id: ticket._id};
newData[key] = value;
EventTicket.update(newData, function(data) {
- if (!(data && data._id && data.person)) {
+ if (!(data && data._id && data.ticket)) {
return;
}
- var person_idx = $scope.event.persons.findIndex(function(el, idx, array) {
+ var ticket_idx = $scope.event.tickets.findIndex(function(el, idx, array) {
return data._id == el._id;
});
- if (person_idx == -1) {
+ if (ticket_idx == -1) {
$log.warn('unable to find ticket _id ' + _id);
return;
}
- if ($scope.event.persons[person_idx] != data.person) {
- $scope.event.persons[person_idx] = data.person;
+ if ($scope.event.tickets[ticket_idx] != data.ticket) {
+ $scope.event.tickets[ticket_idx] = data.ticket;
}
if (callback) {
callback(data);
@@ -376,9 +378,9 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
if (key === 'attended' && !hideMessage) {
var msg = {};
if (value) {
- msg.message = '' + person.name + ' ' + person.surname + ' successfully added to event ' + $scope.event.title;
+ msg.message = '' + ticket.name + ' ' + ticket.surname + ' successfully added to event ' + $scope.event.title;
} else {
- msg.message = '' + person.name + ' ' + person.surname + ' successfully removed from event ' + $scope.event.title;
+ msg.message = '' + ticket.name + ' ' + ticket.surname + ' successfully removed from event ' + $scope.event.title;
msg.isError = true;
}
$scope.showMessage(msg);
@@ -386,30 +388,30 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
});
};
- $scope.setTicketAttributeAndRefocus = function(person, key, value) {
- $scope.setTicketAttribute(person, key, value);
+ $scope.setTicketAttributeAndRefocus = function(ticket, key, value) {
+ $scope.setTicketAttribute(ticket, key, value);
$scope.query = '';
};
- $scope._setAttended = function(person) {
- $scope.setTicketAttribute(person, 'attended', true, null, true);
+ $scope._setAttended = function(ticket) {
+ $scope.setTicketAttribute(ticket, 'attended', true, null, true);
};
- $scope.deleteTicket = function(person) {
+ $scope.deleteTicket = function(ticket) {
EventTicket.delete({
event_id: $state.params.id,
- ticket_id: person._id
+ ticket_id: ticket._id
}, function() {
- $scope._localRemoveTicket(person);
+ $scope._localRemoveTicket(ticket);
});
};
- $scope.addTicket = function(person) {
- person.event_id = $state.params.id;
- EventTicket.add(person, function(ticket) {
+ $scope.addTicket = function(ticket) {
+ ticket.event_id = $state.params.id;
+ EventTicket.add(ticket, function(ticket) {
$log.debug('addTicket');
$log.debug(ticket);
- $scope._localAddTicket(ticket, person);
+ $scope._localAddTicket(ticket, ticket);
if (!$state.is('event.tickets')) {
$state.go('event.ticket.edit', {id: $scope.event._id, ticket_id: ticket._id});
} else {
@@ -425,7 +427,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
$scope.updateTicket = function(ticket, cb) {
ticket.event_id = $state.params.id;
EventTicket.update(ticket, function(t) {
- $scope._localUpdateTicket(t.person);
+ $scope._localUpdateTicket(t.ticket);
if (cb) {
cb(t);
}
@@ -499,14 +501,14 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
} else {
inv_key = '-' + key;
}
- angular.forEach($scope.personsOrder,
+ angular.forEach($scope.ticketsOrder,
function(value, idx) {
if (value !== key && value !== inv_key) {
new_order.push(value);
}
}
);
- $scope.personsOrder = new_order;
+ $scope.ticketsOrder = new_order;
};
$scope.showMessage = function(cfg) {
diff --git a/angular_app/js/filters.js b/angular_app/js/filters.js
index 2c79f76..d415bf7 100644
--- a/angular_app/js/filters.js
+++ b/angular_app/js/filters.js
@@ -2,27 +2,6 @@
/* Filters for EventMan(ager) lists of objects. */
-/* Filter for events that have (or not) information about a registered person. */
-eventManApp.filter('eventWithPersonData', ['$filter',
- function($filter) {
- return function(inputArray, mustBePresent) {
- if (mustBePresent === undefined) {
- mustBePresent = true;
- }
- inputArray = inputArray || [];
- var returnArray = [];
- for (var x=0; x < inputArray.length; x++) {
- var found = inputArray[x].person_data && inputArray[x].person_data.person_id;
- if ((found && mustBePresent) || (!found && !mustBePresent)) {
- returnArray.push(inputArray[x]);
- }
- }
- return returnArray;
- };
- }]
-);
-
-
/* Filter for persons (not) registered for a given event. */
eventManApp.filter('personRegistered', ['$filter',
function($filter) {
@@ -33,14 +12,14 @@ eventManApp.filter('personRegistered', ['$filter',
inputArray = inputArray || [];
var returnArray = [];
var registeredIDs = [];
- if (!(data.event && data.event.persons && data.event.persons.length)) {
+ if (!(data.event && data.event.tickets && data.event.tickets.length)) {
return inputArray;
}
- for (var x=0; x < data.event.persons.length; x++) {
- if (!data.includeCancelled && data.event.persons[x].cancelled) {
+ for (var x=0; x < data.event.tickets.length; x++) {
+ if (!data.includeCancelled && data.event.tickets[x].cancelled) {
continue;
}
- registeredIDs.push(data.event.persons[x].person_id);
+ registeredIDs.push(data.event.tickets[x]._id);
}
for (var x=0; x < inputArray.length; x++) {
var found = registeredIDs.indexOf(inputArray[x]._id) != -1;
@@ -68,7 +47,7 @@ eventManApp.filter('splittedFilter', ['$filter',
);
-/* Filter that returns only the (not) registered persons at an event. */
+/* Filter that returns only the (not) registered tickets at an event. */
eventManApp.filter('registeredFilter', ['$filter',
function($filter) {
return function(inputArray, data) {
diff --git a/angular_app/js/services.js b/angular_app/js/services.js
index 232d956..0239786 100644
--- a/angular_app/js/services.js
+++ b/angular_app/js/services.js
@@ -44,10 +44,10 @@ eventManServices.factory('Event', ['$resource', '$rootScope',
data = angular.fromJson(data);
convert_dates(data);
// strip empty keys.
- angular.forEach(data.persons || [], function(person, person_idx) {
- angular.forEach(person, function(value, key) {
+ angular.forEach(data.tickets || [], function(ticket, ticket_idx) {
+ angular.forEach(ticket, function(value, key) {
if (value === "") {
- delete person[key];
+ delete ticket[key];
}
});
});
@@ -84,7 +84,7 @@ eventManServices.factory('EventTicket', ['$resource', '$rootScope',
interceptor : {responseError: $rootScope.errorHandler},
transformResponse: function(data, headers) {
data = angular.fromJson(data);
- return data.person;
+ return data.ticket;
}
},
@@ -98,7 +98,7 @@ eventManServices.factory('EventTicket', ['$resource', '$rootScope',
if (data.error) {
return data;
}
- return data.persons;
+ return data.tickets;
}
},
@@ -110,7 +110,7 @@ eventManServices.factory('EventTicket', ['$resource', '$rootScope',
params: {uuid: $rootScope.app_uuid},
transformResponse: function(data, headers) {
data = angular.fromJson(data);
- return data.person;
+ return data.ticket;
}
},
@@ -236,7 +236,7 @@ eventManServices.factory('User', ['$resource', '$rootScope',
);
-/* WebSocket collection used to update the list of persons of an Event. */
+/* WebSocket collection used to update the list of tickets of an Event. */
eventManApp.factory('EventUpdates', ['$websocket', '$location', '$log',
function($websocket, $location, $log) {
diff --git a/angular_app/person-edit.html b/angular_app/person-edit.html
deleted file mode 100644
index d28328c..0000000
--- a/angular_app/person-edit.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
- {{'New person' | translate}}{{person.name}} {{person.surname}}
-
-
-