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