src/p4l/static/p4l/js/p4l.js
changeset 112 ba6056f58516
parent 111 e2ecb345b58f
child 117 0a4e7d6ebe80
--- a/src/p4l/static/p4l/js/p4l.js	Fri Sep 20 12:54:55 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js	Fri Sep 20 15:44:11 2013 +0200
@@ -284,7 +284,7 @@
     };
 });
 
-app.controller("RecordCtrl", function($scope, RecordModel, context){
+app.controller("RecordCtrl", function($translate, $scope, RecordModel, context){
     
     $scope.record = RecordModel.record;
     $scope.uriLabels = RecordModel.uriLabels;
@@ -293,7 +293,15 @@
         
     $scope.submitRecord = function() {
         $scope.saving = true;
-        $scope.record.$save({recordId: context.record_id})
+        $scope.record.$save(
+        	{ recordId: context.record_id },
+        	function(){
+        		//console.log("SUCCESS");
+        	},
+        	function(){
+        		alert($translate("An error occured. Somes datas may be incorrect or incomplete."));
+        		$scope.saving=false;
+        	})
             .then(function(response) {
                 $scope.saving=false;
             });