3 "name": "Pman.Tab.AdminOffice",
4 "parent": "Pman.Tab.AdminCompanies",
5 "title": "Pman.Tab.AdminOffice",
6 "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminOffice.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
16 "tableName": "Office",
17 "title": "Offices / Departments / Sub-Companies",
23 "|render": "function() \n{\n _this.grid = this; \n _this.dialog =Pman.Dialog.Office;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
24 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
27 "autoExpandColumn": "name",
34 "beforeload": "function (_self, o)\n{\n try {\n var sm = Pman.Tab.AdminCompanies.grid.getSelectionModel();\n sm = sm.getSelected();\n if (!sm || !sm.data.id) {\n // mask??\n return false;\n }\n \n o.params.company_id = sm.data.id ;\n } catch (e) {\n return false;\n }\n \n \n }"
36 "*prop": "dataSource",
39 "|sortInfo": "{ field : 'name', direction: 'ASC' }",
46 "|url": "baseURL + '/Roo/Office.php'",
51 "xtype": "JsonReader",
52 "totalProperty": "total",
56 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'company_id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'address',\n 'type': 'string'\n },\n {\n 'name': 'phone',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'role',\n 'type': 'string'\n },\n {\n 'name': 'company_id_code',\n 'type': 'string'\n },\n {\n 'name': 'company_id_name',\n 'type': 'string'\n },\n {\n 'name': 'company_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'company_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_address',\n 'type': 'string'\n },\n {\n 'name': 'company_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'company_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'company_id_email',\n 'type': 'string'\n },\n {\n 'name': 'company_id_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'company_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'company_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'company_id_url',\n 'type': 'string'\n },\n {\n 'name': 'company_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'company_id_dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'company_id_province',\n 'type': 'string'\n },\n {\n 'name': 'company_id_country',\n 'type': 'string'\n }\n]"
62 "xtype": "PagingToolbar",
65 "displayMsg": "Displaying Office{0} - {1} of {2}",
66 "emptyMsg": "No Office found",
76 "|click": "function()\n{\n if (!_this.dialog) return;\n \n var cdata = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data;\n _dialog.show( { \n id : 0 ,\n company_name : cdata.name,\n company_id : cdata.id,\n address : cdata.address,\n phone : cdata.tel,\n fax : cdata.fax,\n email : cdata.email\n } , function() {\n _this.grid.footer.onClick('first');\n });\n}\n"
78 "cls": "x-btn-text-icon",
81 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
86 "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n s[0].data.company_name = Pman.Tab.AdminCompanies.grid.getSelectionModel().getSelected().data.name;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n"
88 "cls": "x-btn-text-icon",
91 "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
96 "cls": "x-btn-text-icon",
97 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
100 "|click": "function()\n{\n Pman.genericDelete(_this, 'Office'); \n}\n "
102 "|xns": "Roo.Toolbar"
107 "*prop": "colModel[]",
109 "header": "Name / Department / Sub Comp.",
112 "xtype": "ColumnModel",
113 "|renderer": "function(v) { return String.format('{0}', v); }",
117 "*prop": "colModel[]",
118 "dataIndex": "phone",
121 "xtype": "ColumnModel",
122 "|renderer": "function(v) { return String.format('{0}', v); }",
126 "*prop": "colModel[]",
130 "xtype": "ColumnModel",
131 "|renderer": "function(v) { return String.format('{0}', v); }",
135 "*prop": "colModel[]",
136 "dataIndex": "email",
139 "xtype": "ColumnModel",
140 "|renderer": "function (v) {\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n \n}",
144 "*prop": "colModel[]",
145 "dataIndex": "address",
148 "xtype": "ColumnModel",
149 "|renderer": "function(v) { return String.format('{0}', v); }",