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