Pman.Tab.AdminCompanies.bjs
[Pman.Admin] / Pman.Tab.AdminCompanies.bjs
1 {
2     "id": "roo-file-1",
3     "name": "Pman.Tab.AdminCompanies",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs",
7     "items": [
8         {
9             "title": "Companies",
10             "xtype": "NestedLayoutPanel",
11             "|xns": "Roo",
12             "items": [
13                 {
14                     "|xns": "Roo",
15                     "xtype": "BorderLayout",
16                     "*prop": "layout",
17                     "items": [
18                         {
19                             "|xns": "Roo",
20                             "xtype": "LayoutRegion",
21                             "*prop": "center"
22                         },
23                         {
24                             "*prop": "south",
25                             "xtype": "LayoutRegion",
26                             "|xns": "Roo"
27                         },
28                         {
29                             "|xns": "Roo",
30                             "xtype": "GridPanel",
31                             "title": "Companies",
32                             "fitToframe": true,
33                             "fitContainer": true,
34                             "tableName": "Companies",
35                             "background": true,
36                             "region": "center",
37                             "listeners": {
38                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
39                             },
40                             "items": [
41                                 {
42                                     "listeners": {
43                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
44                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
45                                         "rowclick": "function (_self, rowIndex, e)\n{\n  try { Pman.Tab.Office.paging.onClick('refresh'); } catch(e) {}\n}"
46                                     },
47                                     "*prop": "grid",
48                                     "autoExpandColumn": "name",
49                                     "loadMask": true,
50                                     "xtype": "Grid",
51                                     "|xns": "Roo.grid",
52                                     "items": [
53                                         {
54                                             "listeners": {
55                                                 "load": "function (_self, records, options)\n{\n   try {\n        Pman.Tab.Office.grid.footer.onClick('refresh');\n    } catch (e) {}\n}"
56                                             },
57                                             "*prop": "dataSource",
58                                             "remoteSort": true,
59                                             "xtype": "Store",
60                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
61                                             "|xns": "Roo.data",
62                                             "items": [
63                                                 {
64                                                     "listeners": {
65                                                         "load": "function (This, o, arg)\n{\n \n}"
66                                                     },
67                                                     "*prop": "proxy",
68                                                     "method": "GET",
69                                                     "xtype": "HttpProxy",
70                                                     "|url": "baseURL + '/Roo/Companies.php'",
71                                                     "|xns": "Roo.data"
72                                                 },
73                                                 {
74                                                     "|xns": "Roo.data",
75                                                     "xtype": "JsonReader",
76                                                     "totalProperty": "total",
77                                                     "root": "data",
78                                                     "*prop": "reader",
79                                                     "id": "id",
80                                                     "|fields": "[\n    {\n        'name': 'code',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'address',\n        'type': 'string'\n    },\n    {\n        'name': 'tel',\n        'type': 'string'\n    },\n    {\n        'name': 'fax',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'url',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'created_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_dt',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'dispatch_port',\n        'type': 'string'\n    },\n    {\n        'name': 'province',\n        'type': 'string'\n    },\n    {\n        'name': 'country',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'logo_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'logo_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'logo_id_title',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_deleted_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'main_office_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'main_office_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'main_office_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'main_office_id_role',\n        'type': 'string'\n    }\n]"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "*prop": "footer",
86                                             "xtype": "PagingToolbar",
87                                             "pageSize": 25,
88                                             "displayInfo": true,
89                                             "displayMsg": "Displaying Companies{0} - {1} of {2}",
90                                             "emptyMsg": "No Companies found",
91                                             "|xns": "Roo"
92                                         },
93                                         {
94                                             "*prop": "toolbar",
95                                             "xtype": "Toolbar",
96                                             "|xns": "Roo",
97                                             "items": [
98                                                 {
99                                                     "listeners": {
100                                                         "show": "function (_self)\n{\n_this.searchBox = _self;\n}"
101                                                     },
102                                                     "xtype": "TextField",
103                                                     "|xns": "Roo.form"
104                                                 },
105                                                 {
106                                                     "listeners": {
107                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
108                                                     },
109                                                     "cls": "x-btn-icon",
110                                                     "xtype": "Button",
111                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
112                                                     "|xns": "Roo.Toolbar"
113                                                 },
114                                                 {
115                                                     "listeners": {
116                                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\n}"
117                                                     },
118                                                     "cls": "x-btn-icon",
119                                                     "xtype": "Button",
120                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
121                                                     "|xns": "Roo.Toolbar"
122                                                 },
123                                                 {
124                                                     "|xns": "Roo.Toolbar",
125                                                     "xtype": "Fill"
126                                                 },
127                                                 {
128                                                     "text": "Add",
129                                                     "xtype": "Button",
130                                                     "cls": "x-btn-text-icon",
131                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
132                                                     "listeners": {
133                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
134                                                     },
135                                                     "|xns": "Roo.Toolbar"
136                                                 },
137                                                 {
138                                                     "listeners": {
139                                                         "|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    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
140                                                     },
141                                                     "cls": "x-btn-text-icon",
142                                                     "text": "Edit",
143                                                     "xtype": "Button",
144                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
145                                                     "|xns": "Roo.Toolbar"
146                                                 },
147                                                 {
148                                                     "text": "Delete",
149                                                     "cls": "x-btn-text-icon",
150                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
151                                                     "xtype": "Button",
152                                                     "listeners": {
153                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Companies'); \n}\n        "
154                                                     },
155                                                     "|xns": "Roo.Toolbar"
156                                                 }
157                                             ]
158                                         },
159                                         {
160                                             "*prop": "colModel[]",
161                                             "dataIndex": "comptype",
162                                             "header": "Type",
163                                             "sortable": true,
164                                             "width": 90,
165                                             "xtype": "ColumnModel",
166                                             "|renderer": "function (v,x ,r) {\n    return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n}",
167                                             "|xns": "Roo.grid"
168                                         },
169                                         {
170                                             "*prop": "colModel[]",
171                                             "dataIndex": "code",
172                                             "header": "Ref#",
173                                             "width": 50,
174                                             "xtype": "ColumnModel",
175                                             "|renderer": "function(v) { return String.format('{0}', v); }",
176                                             "|xns": "Roo.grid"
177                                         },
178                                         {
179                                             "*prop": "colModel[]",
180                                             "dataIndex": "name",
181                                             "header": "Name",
182                                             "width": 200,
183                                             "xtype": "ColumnModel",
184                                             "|renderer": "function(v,x,r) {\n    return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);    \n}",
185                                             "|xns": "Roo.grid"
186                                         },
187                                         {
188                                             "*prop": "colModel[]",
189                                             "dataIndex": "tel",
190                                             "header": "Tel",
191                                             "width": 100,
192                                             "xtype": "ColumnModel",
193                                             "|renderer": "function(v) { return String.format('{0}', v); }",
194                                             "|xns": "Roo.grid"
195                                         },
196                                         {
197                                             "*prop": "colModel[]",
198                                             "dataIndex": "fax",
199                                             "header": "Fax",
200                                             "width": 100,
201                                             "xtype": "ColumnModel",
202                                             "|renderer": "function(v) { return String.format('{0}', v); }",
203                                             "|xns": "Roo.grid"
204                                         },
205                                         {
206                                             "*prop": "colModel[]",
207                                             "dataIndex": "email",
208                                             "header": "Email",
209                                             "width": 100,
210                                             "xtype": "ColumnModel",
211                                             "|renderer": " function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
212                                             "|xns": "Roo.grid"
213                                         },
214                                         {
215                                             "xtype": "ColumnModel",
216                                             "header": "Address",
217                                             "width": 200,
218                                             "dataIndex": "address",
219                                             "|renderer": "function(v) { return String.format('{0}', v); }",
220                                             "|xns": "Roo.grid",
221                                             "*prop": "colModel[]"
222                                         },
223                                         {
224                                             "xtype": "ColumnModel",
225                                             "header": "Remarks",
226                                             "width": 200,
227                                             "dataIndex": "remarks",
228                                             "|renderer": "function(v) { return String.format('{0}', v); }",
229                                             "|xns": "Roo.grid",
230                                             "*prop": "colModel[]"
231                                         }
232                                     ]
233                                 }
234                             ]
235                         }
236                     ]
237                 }
238             ]
239         }
240     ],
241     "permname": "",
242     "modOrder": "001"
243 }