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