/* Controllers */
-function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $route, Organizations, RegistrationState) {
+function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $route, Organizations, ValidStates) {
$scope.$routeParams = $routeParams;
$scope.$location = $location;
$scope.organizations = data;
$log.info('organizations promise ', $scope.organizations);
});
- $scope.RegistrationState = RegistrationState();
+ $scope.ValidStates = ValidStates();
$scope.info = { message: '', css_class: '' } ; // alert box
$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
$scope.reset();
}
-RegistrationCtrl.$inject = [ '$scope', '$log', 'Registration', '$routeParams', '$location', '$route', 'Organizations', 'RegistrationState' ];
+RegistrationCtrl.$inject = [ '$scope', '$log', 'Registration', '$routeParams', '$location', '$route', 'Organizations', 'ValidStates' ];
-function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, RegistrationState ) {
+function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, ValidStates ) {
$scope.list = [];
$scope.list_results = 0;
states: true,
pager_numeric: false
};
- $scope.RegistrationState = RegistrationState();
+ $scope.ValidStates = ValidStates();
$scope.create_counts = function( array ) {
$log.info('create_counts', array.length );
}
}
-ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter', 'RegistrationState' ];
+ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter', 'ValidStates' ];