3 "name": "Pman.Tab.AdminCountries",
4 "parent": "Pman.Tab.AdminContactsManager",
5 "title": "Pman.Tab.AdminCountries",
6 "path": "/home/chris/gitlive/Pman.Admin/Pman.Tab.AdminCountries.bjs",
10 "activate": "function (_self)\n{\n _this.panel = this;\n if (_this.grid){\n _this.grid.ds.load({});\n }\n}"
16 "tableName": "Person",
23 "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.Groups;\n if (_this.panel.active) {\n _this.grid.ds.load({});\n }\n}",
24 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n var s = this.getDataSource().getAt(rowIndex);\n if (s.data.id < 1 ) {\n return;\n }\n _this.dialog.show( s.data, function() {\n _this.ds.load({});\n }); \n}\n"
27 "autoExpandColumn": "country",
36 "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n o.params._distinct = 'country';\n o.params._columns = 'country,country_tr';\n o.params.limit = 9999;\n o.params._hideEmptyCountry = 1;\n}",
37 "load": "function (_self, records, options)\n{\n var sm = _this.grid.getSelectionModel();\n if (!sm.getSelections().length) {\n sm.selectFirstRow();\n }\n Pman.Tab.AdminContacts.grid.footer.onClick('first');\n}"
39 "*prop": "dataSource",
42 "|sortInfo": "{ field : 'country_tr', direction: 'ASC' }",
49 "|url": "baseURL + '/Roo/Clipping.php'",
54 "xtype": "JsonReader",
55 "totalProperty": "total",
59 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n }\n]"
64 "*prop": "colModel[]",
65 "dataIndex": "country",
68 "xtype": "ColumnModel",
69 "|renderer": "function(v,x,r)\n{\n if(v*1 == -1){\n return String.format('<b>{0}</b>', r.data.country_tr);\n }\n \n return String.format('{0}', r.data.country_tr);\n}",
74 "afterselectionchange": "function (_self)\n{\n// Pman.Tab.AdminContacts.grid.footer.onClick('first');\n var c = Pman.Tab.AdminContactsManager.layout.getRegion('center');\n c.getActivePanel().grid.footer.onClick('first');\n \n}"
78 "xtype": "RowSelectionModel",
83 "drop": "function (source, e, data)\n{\n //Roo.log(\"DROP\");\n \n var t = Roo.lib.Event.getTarget(e); \n var ri = _this.grid.view.findRowIndex(t);\n var rid = false;\n if (ri !== false) {\n rid = _this.grid.getDataSource().getAt(ri).data;\n }\n //var s = _this.grid.getSelectionModel().getSelections();\n \n //console.log(data);\n var isFromGroup = _this.grid.getSelectionModel().isSelected(ri);;\n\n //var isToGroup = rid && rid.id > 0;\n this.success = false;\n \n if (isFromGroup){\n return;\n }\n var targetCountry = rid.country;\n var action = 'add';\n \n if (targetCountry*1 == -1) {\n action = 'sub';\n //return 'x-dd-drop-ok-sub'; \n }\n // build a list of selections.\n var sels = [];\n \n for (var i=0; i < data.selections.length; i++){\n var c = data.selections[i].data.countries.split(',');\n if(c.indexOf(targetCountry) > -1){\n //Roo.log(\"skipped : \"+data.selections[i].data.id);\n continue;\n }\n //Roo.log(data.selections[i].data);\n sels.push(data.selections[i].data.id);\n }\n \n if(sels.length < 1){\n Roo.MessageBox.alert('Error', 'No person add to group');\n return;\n }\n \n new Pman.Request({\n url: baseURL + '/Core/GroupCountries.php',\n params: {\n action : action,\n country: (targetCountry != -1) ? targetCountry : _this.grid.getSelectionModel().getSelected().data.country,\n user_ids : sels.join(',')\n },\n method: 'POST', \n success : function(res) {\n Pman.Tab.AdminContacts.grid.footer.onClick('refresh');\n //var data = res.data\n //refreshPager();\n // \n // do we need to do anything??\n //if (isFromGroup) {\n // Pman.Tab.AdminContacts.grid.footer.onClick('refresh');\n //}\n }, \n \n failure: function() {\n //Ext.get(document.body).unmask();\n //if (cb) {\n // cb.call(false);\n //}\n \n }\n });\n\n this.success = true;\n return;\n\n}",
84 "over": "function (source, e, data)\n{\n //Roo.log(\"dragover\");\n \n var t = Roo.lib.Event.getTarget(e);\n var ri = _this.grid.view.findRowIndex(t);\n var rid = false;\n if (ri !== false) {\n rid = _this.grid.getDataSource().getAt(ri).data;\n }\n \n var isFromGroup = _this.grid.getSelectionModel().isSelected(ri);\n \n //Roo.log(\", isFromGroup:\" + isFromGroup);\n \n if (isFromGroup) {\n this.valid = false;\n return;\n }\n \n if(rid.country*1 == -1) {\n this.valid = 'ok-sub'; \n return;\n } \n \n this.valid = 'ok-add';\n}"
86 "*prop": "dropTarget",
88 "xtype": "DropTarget",