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