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   try {\n       o.params['query[name]'] = _this.searchBox.getValue();\n   } catch(e) { return false; }\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\n}",
103                                                         "specialkey": "function (_self, e)\n{\n if (e.getKey() == 13) {\n     _this.grid.footer.onClick( 'first' );\n  }\n}",
104                                                         "render": "function (_self)\n{\n_this.searchBox = _self;\n}"
105                                                     },
106                                                     "xtype": "TextField",
107                                                     "|xns": "Roo.form"
108                                                 },
109                                                 {
110                                                     "listeners": {
111                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
112                                                     },
113                                                     "cls": "x-btn-icon",
114                                                     "xtype": "Button",
115                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
116                                                     "|xns": "Roo.Toolbar"
117                                                 },
118                                                 {
119                                                     "listeners": {
120                                                         "|click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\n}"
121                                                     },
122                                                     "cls": "x-btn-icon",
123                                                     "xtype": "Button",
124                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
125                                                     "|xns": "Roo.Toolbar"
126                                                 },
127                                                 {
128                                                     "|xns": "Roo.Toolbar",
129                                                     "xtype": "Fill"
130                                                 },
131                                                 {
132                                                     "text": "Add",
133                                                     "xtype": "Button",
134                                                     "cls": "x-btn-text-icon",
135                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
136                                                     "listeners": {
137                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
138                                                     },
139                                                     "|xns": "Roo.Toolbar"
140                                                 },
141                                                 {
142                                                     "listeners": {
143                                                         "|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"
144                                                     },
145                                                     "cls": "x-btn-text-icon",
146                                                     "text": "Edit",
147                                                     "xtype": "Button",
148                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
149                                                     "|xns": "Roo.Toolbar"
150                                                 },
151                                                 {
152                                                     "text": "Delete",
153                                                     "cls": "x-btn-text-icon",
154                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
155                                                     "xtype": "Button",
156                                                     "listeners": {
157                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Companies'); \n}\n        "
158                                                     },
159                                                     "|xns": "Roo.Toolbar"
160                                                 }
161                                             ]
162                                         },
163                                         {
164                                             "*prop": "colModel[]",
165                                             "dataIndex": "comptype",
166                                             "header": "Type",
167                                             "sortable": true,
168                                             "width": 90,
169                                             "xtype": "ColumnModel",
170                                             "|renderer": "function (v,x ,r) {\n    return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n}",
171                                             "|xns": "Roo.grid"
172                                         },
173                                         {
174                                             "*prop": "colModel[]",
175                                             "dataIndex": "code",
176                                             "header": "Ref#",
177                                             "sortable": true,
178                                             "width": 50,
179                                             "xtype": "ColumnModel",
180                                             "|renderer": "function(v) { return String.format('{0}', v); }",
181                                             "|xns": "Roo.grid"
182                                         },
183                                         {
184                                             "*prop": "colModel[]",
185                                             "dataIndex": "name",
186                                             "header": "Name",
187                                             "sortable": true,
188                                             "width": 200,
189                                             "xtype": "ColumnModel",
190                                             "|renderer": "function(v,x,r) {\n    return String.format(r.data.isOwner ? '<B>{0}</B>' : '{0}',v);    \n}",
191                                             "|xns": "Roo.grid"
192                                         },
193                                         {
194                                             "*prop": "colModel[]",
195                                             "dataIndex": "tel",
196                                             "header": "Tel",
197                                             "width": 100,
198                                             "xtype": "ColumnModel",
199                                             "|renderer": "function(v) { return String.format('{0}', v); }",
200                                             "|xns": "Roo.grid"
201                                         },
202                                         {
203                                             "*prop": "colModel[]",
204                                             "dataIndex": "fax",
205                                             "header": "Fax",
206                                             "width": 100,
207                                             "xtype": "ColumnModel",
208                                             "|renderer": "function(v) { return String.format('{0}', v); }",
209                                             "|xns": "Roo.grid"
210                                         },
211                                         {
212                                             "*prop": "colModel[]",
213                                             "dataIndex": "email",
214                                             "header": "Email",
215                                             "sortable": true,
216                                             "width": 100,
217                                             "xtype": "ColumnModel",
218                                             "|renderer": " function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
219                                             "|xns": "Roo.grid"
220                                         },
221                                         {
222                                             "*prop": "colModel[]",
223                                             "dataIndex": "address",
224                                             "header": "Address",
225                                             "sortable": true,
226                                             "width": 200,
227                                             "xtype": "ColumnModel",
228                                             "|renderer": "function(v) { return String.format('{0}', v); }",
229                                             "|xns": "Roo.grid"
230                                         },
231                                         {
232                                             "xtype": "ColumnModel",
233                                             "header": "Remarks",
234                                             "width": 200,
235                                             "dataIndex": "remarks",
236                                             "|renderer": "function(v) { return String.format('{0}', v); }",
237                                             "|xns": "Roo.grid",
238                                             "*prop": "colModel[]"
239                                         }
240                                     ]
241                                 }
242                             ]
243                         }
244                     ]
245                 }
246             ]
247         }
248     ],
249     "permname": "",
250     "modOrder": "030"
251 }