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