X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=blobdiff_plain;f=Pman.Tab.AdminOffice.js;h=532fce26afef3f78325ab868f5df5f620a0ed64a;hp=ab343d79a0ebcd739506dfe62a272cb653fa75bd;hb=HEAD;hpb=1668a9d03dd0b388af68c088ac21d1f05a3e27e2 diff --git a/Pman.Tab.AdminOffice.js b/Pman.Tab.AdminOffice.js index ab343d7..532fce2 100644 --- a/Pman.Tab.AdminOffice.js +++ b/Pman.Tab.AdminOffice.js @@ -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' },