$scope.update = function(registration, state, info_message) {
- registration.state = state;
+ if ( $scope.ValidStates.indexOf( state ) > $scope.ValidStates.indexOf( registration.state ) ) {
+ registration.state = state;
+ $log.info( 'registration.state updated to ',state);
+ } else {
+ $log.info('registration.state NOT changed');
+ }
if ( ! $scope.has_work && registration.work ) {
delete( registration.work );
registration.$save( function(registration) {
$log.info('id =', registration.id, 'state = ', registration.state);
if ( registration.id && registration.state ) {
- $log.error( $location.path(), registration.state, $routeParams );
+ $log.info( 'have id && state', $location.path(), registration.state, $routeParams );
if ( $location.path().split(/\//)[1] != registration.state ) {
$location.path( '/' + registration.state + '/' + registration.id );
} else {
$scope.user.registration_type == 'symposium' ||
$scope.user.registration_type == 'round'
) {
+ if ( angular.isUndefined( $scope.registration.work ) ) {
+ $log.info('create empty work');
+ $scope.registration.work = { persons: [ $scope.user ] };
+ if ( angular.isUndefined( $scope.work ) )
+ $scope.work = $scope.registration.work;
+ }
+
+
$scope.work.type = $scope.user.registration_type;
$scope.has_work = true;
$log.info( $scope.user.registration_type, " type updated");
$scope.show_submission_type = function() {
// FIXME check if all submission are allowed by date and allow them!
+ if ( angular.isUndefined( $scope.user ) || angular.isUndefined( $scope.registration ) ) return false;
return (
angular.isUndefined( $scope.user.registration_type ) // new registration
|| angular.isUndefined( $scope.registration.state ) // not saved yet