DataObjects/core.sql
[Pman.Core] / Pman.js
diff --git a/Pman.js b/Pman.js
index 6468f75..c1b6c7a 100644 (file)
--- a/Pman.js
+++ b/Pman.js
@@ -372,7 +372,9 @@ Pman = new Roo.Document(
                 return;
             }
             if (!data || !data.id) {
-                Pman.Dialog.Companies.show( { id : 0, isOwner : 1, comptype: 'OWNER' }, function(data) {
+                Pman.Dialog.CoreCompanies.show( { id : 0, comptype: 'OWNER' }, function(data) {
+                    Roo.log("company dialog returned");
+                    Roo.log(data);
                     forceCompany(data);
                 });
                 return;
@@ -380,6 +382,7 @@ Pman = new Roo.Document(
             Pman.Login.authUser.company_id_id  = data.id;
             Pman.Login.authUser.company_id  = data.id;
             Pman.Login.authUser.company_id_name  = data.name;
+            Roo.log("forcing admin");
             forceAdmin();
         }
         
@@ -584,8 +587,15 @@ Pman = new Roo.Document(
                         
                     },
                     failure: function(act) {
+                        Roo.log(act);
+                        var msg = '';
+                        try {
+                            msg = act.errorMsg;
+                        } catch(e) {
+                            msg = "Error deleting";
+                        }
                         tab.grid.getView().mainWrap.unmask();
-                        Roo.MessageBox.alert("Error", "Error Deleting");
+                        Roo.MessageBox.alert("Error",  msg);
                     }
                     
                 });
@@ -804,8 +814,8 @@ Pman = new Roo.Document(
         }
         
         if (typeof(obj.parent) == 'undefined') {
-            console.log("Parent is undefined");
-            console.log(obj);
+            Roo.log("Parent is undefined");
+            Roo.log(obj);
             obj.disabled = true;
             return;
         }
@@ -813,8 +823,8 @@ Pman = new Roo.Document(
             
         if (obj.parent === false) {
             obj.disabled = true;
-            console.log('ignoring top level object (as parent===false found)');
-            console.log(obj);
+            Roo.log('ignoring top level object (as parent===false found)');
+            Roo.log(obj);
             return;
         }
         // this is an error condition - the parent does not exist..