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