From 04ea2a6fd5ce8eb5d90f172ca0aa639aa36fe7d2 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 18 Mar 2014 21:33:05 +0800 Subject: [PATCH] Pman.Tab.AdminContacts.bjs Pman.Tab.AdminContacts.js --- Pman.Tab.AdminContacts.bjs | 2 +- Pman.Tab.AdminContacts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pman.Tab.AdminContacts.bjs b/Pman.Tab.AdminContacts.bjs index 0605f70..e5ff56e 100644 --- a/Pman.Tab.AdminContacts.bjs +++ b/Pman.Tab.AdminContacts.bjs @@ -35,7 +35,7 @@ "items": [ { "listeners": { - "beforeload": "function (_self, o)\n{\n if(!_this.active_company_button.pressed){\n o.params['!company_id_comptype'] = 'OWNER';\n }\n \n o.params['query[search]'] = _this.searchBox.getValue();\n \n if (!_this.activeButton) {return; false;}\n \n if (_this.companyCombo && _this.companyCombo.getValue()) {\n o.params.company_id = _this.companyCombo.getValue();\n }\n \n \n o.params.active = _this.activeButton.pressed ? 0 : 1;\n \n if(_this.active_company_button.pressed){\n o.params.company_id = 0;\n }\n \n var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel();\n \n if (!c) { \n return false;\n }\n \n var tms = c.grid.getSelectionModel().getSelected();\n \n if (!tms) {\n return false;\n }\n \n if(c.tableName == 'Groups'){\n o.params['query[in_group]'] = tms.data.id;\n o.params['query[type]'] = 2; // group type..\n }else{\n o.params['query[in_country]'] = (tms.data.country == 'subGroup') ? '' : tms.data.country;\n o.params['query[in_group]'] = 0;\n o.params['query[type]'] = 2;\n }\n /*\n if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {\n \n \n \n }\n \n if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){\n var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected();\n \n if (!tms) {\n return false;\n }\n \n }\n */\n //o.params['query[name]'] = _this.searchBox.getValue();\n \n}", + "beforeload": "function (_self, o)\n{\n if(!_this.active_company_button.pressed){\n o.params['!company_id_comptype'] = 'OWNER';\n }\n \n o.params['query[search]'] = _this.searchBox.getValue();\n \n if (!_this.activeButton) {return; false;}\n \n if (_this.companyCombo && _this.companyCombo.getValue()) {\n o.params.company_id = _this.companyCombo.getValue();\n }\n \n \n o.params.active = _this.activeButton.pressed ? 0 : 1;\n \n if(_this.active_company_button.pressed){\n o.params.company_id = 0;\n }\n \n var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel();\n \n if (!c) { \n return false;\n }\n \n var tms = c.grid.getSelectionModel().getSelected();\n \n if (!tms) {\n return false;\n }\n \n if(c.tableName == 'Groups'){\n o.params['query[in_group]'] = tms.data.id;\n o.params['query[type]'] = 2; // group type..\n }else{\n o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country;\n o.params['query[in_group]'] = 0;\n o.params['query[type]'] = 2;\n }\n /*\n if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {\n \n \n \n }\n \n if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){\n var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected();\n \n if (!tms) {\n return false;\n }\n \n }\n */\n //o.params['query[name]'] = _this.searchBox.getValue();\n \n}", "update": "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.Request({\n url : baseURL + '/Roo/Person.php',\n method :'POST',\n params : {\n id : record.data.id,\n active: record.data.active\n \n },\n success : function() {\n // do nothing\n \n _this.grid.ds.remove(record);\n \n },\n failure : function() \n {\n Roo.MessageBox.alert(\"Error\", \"saving failed\", function() {\n _this.grid.footer.onClick('first');\n });\n }\n });\n}" }, "*prop": "dataSource", diff --git a/Pman.Tab.AdminContacts.js b/Pman.Tab.AdminContacts.js index c1af9a9..a74d002 100644 --- a/Pman.Tab.AdminContacts.js +++ b/Pman.Tab.AdminContacts.js @@ -116,7 +116,7 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ o.params['query[in_group]'] = tms.data.id; o.params['query[type]'] = 2; // group type.. }else{ - o.params['query[in_country]'] = (tms.data.country == 'subGroup') ? '' : tms.data.country; + o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country; o.params['query[in_group]'] = 0; o.params['query[type]'] = 2; } -- 2.39.2