sync
[Pman.Admin] / Pman.Tab.AdminOffice.js
index ab343d7..532fce2 100644 (file)
@@ -27,7 +27,7 @@ Pman.Tab.AdminOffice = new Roo.XComponent({
   name     : "Pman.Tab.AdminOffice",
   disabled : false, 
   permname : '', 
-  _tree : function()
+  _tree : function(_data)
   {
    var _this = this;
    var MODULE = this;
@@ -99,8 +99,13 @@ Pman.Tab.AdminOffice = new Roo.XComponent({
              if (!_this.dialog) {
               return;
              }
-             var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;
-             _dialog.show( { 
+             var sd = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected();
+             if (!sd) {
+                 Roo.MessageBox.alert("Error", "Select an company to add an office to");
+                 return;
+             }
+             var cdata = sd.data;
+             _this. dialog.show( { 
                  id : 0 ,
                  company_name : cdata.name,
                  company_id : cdata.id,
@@ -186,7 +191,7 @@ Pman.Tab.AdminOffice = new Roo.XComponent({
      proxy : {
       xtype : 'HttpProxy',
       method : 'GET',
-      url : baseURL + '/Roo/Office.php',
+      url : baseURL + '/Roo/core_office.php',
       xns : Roo.data,
       '|xns' : 'Roo.data'
      },