DataObjects/Core_person.php
[Pman.Core] / Pman.Dialog.CoreCompanies.js
index 6fd02cb..9ceef5e 100644 (file)
@@ -114,18 +114,27 @@ Pman.Dialog.CoreCompanies = {
                   _check_name : 1
                 }, 
                 success : function(res) {
-                    Roo.log(res);
+                    _this.dialog.el.mask("Saving");
+                    _this.form.doAction("submit");
                 },
                 failure : function(res) {
-                    Roo.log(res);
+                    Roo.MessageBox.confirm(
+                        "Confirm", 
+                        "The company name has been used. Save it anyway?", 
+                        function(res) {
+                            if(res != 'yes') {
+                                return;
+                            }
+                            
+                            _this.dialog.el.mask("Saving");
+                            _this.form.doAction("submit");
+                        }
+                    );
                 }
             });
             
             return;
             
-            _this.dialog.el.mask("Saving");
-            _this.form.doAction("submit");
-        
         }
       },
       xns : Roo,