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