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