diff --git a/src/main/webapp/resources/js/admin/directive/admin-directive.js b/src/main/webapp/resources/js/admin/directive/admin-directive.js index 4a9a137a07..8a2f52641c 100644 --- a/src/main/webapp/resources/js/admin/directive/admin-directive.js +++ b/src/main/webapp/resources/js/admin/directive/admin-directive.js @@ -448,6 +448,12 @@ }); }; + $scope.$watch('obj.location', function(newValue, oldValue) { + if ($scope.obj && $scope.obj.location && !$scope.loadingMap && newValue != oldValue) { + $scope.updateLocation($scope.obj.location); + } + }); + $scope.updateURL = function(eventName) { if(!angular.isDefined(eventName) || eventName === '') { return; diff --git a/src/main/webapp/resources/js/admin/ng-app/admin-application.js b/src/main/webapp/resources/js/admin/ng-app/admin-application.js index 8a06a891bb..259982db93 100644 --- a/src/main/webapp/resources/js/admin/ng-app/admin-application.js +++ b/src/main/webapp/resources/js/admin/ng-app/admin-application.js @@ -878,7 +878,14 @@ $scope.event.vatPercentage = eventToCopy.vatPercentage; $scope.event.vatIncluded = eventToCopy.vatIncluded; $scope.event.allowedPaymentProxies = angular.copy(eventToCopy.allowedPaymentProxies); - $scope.event.ticketCategories = eventToCopy.ticketCategories.map(function(tc) { + + // + eventToCopy.ticketCategories.filter(function(tc) {return tc.ordinal !== 0}) + + //legacy event, has all the ticket categories with ordinal 0 + var isAllOrdinal0 = eventToCopy.ticketCategories.reduce(function(accumulator, tc) {return accumulator && (tc.ordinal === 0);}, true); + + $scope.event.ticketCategories = eventToCopy.ticketCategories.map(function(tc, idx) { @@ -888,7 +895,7 @@ var cat = { name: tc.name, bounded: tc.bounded, - ordinal: tc.ordinal, + ordinal: isAllOrdinal0 ? idx : tc.ordinal, dateString: categoryAdjustedStart + ' / ' + categoryAdjustedEnd, inception: createDateTimeObject(categoryAdjustedStart), expiration: createDateTimeObject(categoryAdjustedEnd),