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