location URL for newly created tickets

This commit is contained in:
Davide Alberani 2016-06-19 22:27:18 +02:00
parent de6e93c1b8
commit d7eecd25f7
3 changed files with 15 additions and 20 deletions

View file

@ -52,7 +52,7 @@
<tr ng-repeat="person in event.persons | splittedFilter:query | orderBy:personsOrder">
<td class="text-right">{{$index+1}}</td>
<td>
<span><strong><a ui-sref="person.info({id: person.person_id})"><span class="fa fa-lg fa-user"></span></a>&nbsp;<a ui-sref="event.ticket.edit({id: event._id, ticket_id: person.ticket_id})" ng-if="person.ticket_id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span><span ng-if="!person.ticket_id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span></span><span ng-if="person.email">&nbsp;&lt;{{person.email}}&gt;</span>
<span><strong><a ui-sref="person.info({id: person.person_id})"><span class="fa fa-lg fa-user"></span></a>&nbsp;<a ui-sref="event.ticket.edit({id: event._id, ticket_id: person._id})" ng-if="person._id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span><span ng-if="!person._id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span></span><span ng-if="person.email">&nbsp;&lt;{{person.email}}&gt;</span>
<p ng-if="person.company || person.job_title"><i ng-if="person.job_title">{{person.job_title}}</i><span ng-if="person.company && person.job_title">&nbsp;@&nbsp;</span><i ng-if="person.company">{{person.company}}</i></p>
</td>
<td class="text-center">

View file

@ -11,6 +11,10 @@ eventManControllers.controller('NavigationCtrl', ['$scope', '$rootScope', '$loca
function ($scope, $rootScope, $location, Setting, Info) {
$scope.logo = {};
$scope.getLocation = function() {
return $location.absUrl();
};
$scope.go = function(url) {
$location.url(url);
};
@ -105,14 +109,8 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
$scope.event.formSchema = {};
$scope.customFields = Setting.query({setting: 'person_custom_field', in_event_details: true});
$scope.newTicket = $state.is('event.ticket.new');
if ($stateParams.id) {
$scope.event = Event.get($stateParams, function() {
if ($scope.newTicket) {
return;
}
$scope.$watchCollection(function() {
return $scope.event.persons;
}, function(prev, old) {
@ -229,9 +227,7 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
person.person_id = person._id;
person._id = $stateParams.id; // that's the id of the event, not the person.
Event.addPerson(person, function() {
if (!$scope.newTicket) {
$scope._localAddAttendee(person);
}
$scope._localAddAttendee(person);
});
$scope.query = '';
return person;
@ -255,16 +251,12 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
var personObj = new Person(person);
personObj.$save(function(p) {
person = $scope._addAttendee(angular.copy(p));
if (!$scope.newTicket) {
$scope._setAttended(person);
}
$scope._setAttended(person);
$scope.newPerson = {};
});
} else {
person = $scope._addAttendee(angular.copy(person));
if (!$scope.newTicket) {
$scope._setAttended(person);
}
$scope._setAttended(person);
}
};
@ -366,8 +358,8 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
);
eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', 'EventTicket', 'Person', 'EventUpdates', '$stateParams', 'Setting', '$log', '$translate', '$rootScope',
function ($scope, $state, Event, EventTicket, Person, EventUpdates, $stateParams, Setting, $log, $translate, $rootScope) {
eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', 'EventTicket', 'Person', '$location', 'Setting', '$log', '$translate', '$rootScope',
function ($scope, $state, Event, EventTicket, Person, $location, Setting, $log, $translate, $rootScope) {
$scope.message = {};
$scope.event = {};
$scope.ticket = {};
@ -377,8 +369,6 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
$scope.formFieldsMap = {};
$scope.formFieldsMapRev = {};
$scope.newTicket = $state.is('event.ticket.new');
if ($state.params.id) {
$scope.event = Event.get({id: $state.params.id}, function(data) {
if (!(data && data.formSchema)) {

View file

@ -22,6 +22,11 @@
eda-easy-form-viewer-submit-form-event="submitForm(dataModelSubmitted)"
eda-easy-form-viewer-cancel-form-event="cancelForm()">
</eda-easy-form-viewer>
<div ng-if="ticket._id">
<div ng-controller="NavigationCtrl">
<span><strong>{{'Save this URL if you want to modify your order later:'}} <a href="getLocation()">{{getLocation()}}</a></strong></span>
</div>
</div>
</div>
</div>
</div>