From 8235aa19f276cf9e36aa0ebf1db7b7e5817b1c05 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 14 Feb 2013 17:02:04 +0100 Subject: [PATCH] change change only to next one when editing existing registration --- app/js/controllers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 4ddca47..e52344d 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -17,7 +17,12 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $ $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 ); -- 2.20.1