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