Pman.Dialog.BAdminStaffTwoFactorQRCode.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCompany.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Tab');
6
7 Pman.Tab.BAdminCompany = new Roo.XComponent({
8
9  _strings : {
10   'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
11   '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
12   'edefbda3a2bdd979e42d8944b7325b79' :"Companies",
13   'b80bb7740288fda1f201890375a60c8f' :"id",
14   'fc6f97505d89fe9277965c126744647a' :"No Companies found",
15   '694e249c3a9503141fa5ce3fb71d5477' :"<i class=\"fa fa-edit\"></i> Edit",
16   '155ca6a755e25c15ad7ce45e2f638f10' :"Displaying Companies{0} - {1} of {2}",
17   'fd5293a712d172f5c556a83c62d44bd6' :"<i class=\"fa fa-plus\"></i> Add",
18   'ed807858fcb68abdd180481f1fcba5c5' :"<i class=\"fa fa-trash\"></i> Delete",
19   'f78e208016407d8756c29673558ac14d' :"Company List",
20   'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
21   '9c9745a343efeacc9efe9b7222b27afb' :"Ref#",
22   '49ee3087348e8d44e1feda1917443987' :"Name",
23   '2e006b735fbd916d8ab26978ae6714d4' :"Tel",
24   'dd7bf230fde8d4836917806aff6a6b27' :"Address",
25   '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
26  },
27  _named_strings : {
28   'footer_displayMsg' : '155ca6a755e25c15ad7ce45e2f638f10' /* Displaying Companies{0} - {1} of {2} */ ,
29   'footer_emptyMsg' : 'fc6f97505d89fe9277965c126744647a' /* No Companies found */ 
30  },
31
32   part     :  ["BAdmin", "Company" ],
33   order    : '002-Pman.Tab.BAdminCompany',
34   region   : 'center',
35   parent   : 'Pman.Tab.BAdmin',
36   name     : "unnamed module",
37   disabled : false, 
38   permname : '', 
39   _tree : function(_data)
40   {
41    var _this = this;
42    var MODULE = this;
43    return {
44    xtype : 'Nest',
45    background : false,
46    region : 'center',
47    title : _this._strings['edefbda3a2bdd979e42d8944b7325b79'] /* Companies */,
48    xns : Roo.bootstrap.panel,
49    '|xns' : 'Roo.bootstrap.panel',
50    layout : {
51     xtype : 'Border',
52     xns : Roo.bootstrap.layout,
53     '|xns' : 'Roo.bootstrap.layout',
54     center : {
55      xtype : 'Region',
56      tabPosition : 'top',
57      xns : Roo.bootstrap.layout,
58      '|xns' : 'Roo.bootstrap.layout'
59     },
60     items  : [
61      {
62       xtype : 'Grid',
63       closable : false,
64       fitToFrame : true,
65       region : 'center',
66       title : _this._strings['f78e208016407d8756c29673558ac14d'] /* Company List */,
67       listeners : {
68        activate : function (_self)
69         {
70             _this.edit_btn.hide();
71             _this.delete_btn.hide();
72             
73             if (_this.table) {
74                 _this.table.footer.onClick('first');
75             }
76         },
77        render : function (_self)
78         {
79             _this.grid = _self;
80         }
81       },
82       xns : Roo.bootstrap.panel,
83       '|xns' : 'Roo.bootstrap.panel',
84       toolbar : {
85        xtype : 'NavSimplebar',
86        xns : Roo.bootstrap,
87        '|xns' : 'Roo.bootstrap',
88        items  : [
89         {
90          xtype : 'NavGroup',
91          xns : Roo.bootstrap,
92          '|xns' : 'Roo.bootstrap',
93          items  : [
94           {
95            xtype : 'NavItem',
96            xns : Roo.bootstrap,
97            '|xns' : 'Roo.bootstrap',
98            items  : [
99             {
100              xtype : 'Element',
101              xns : Roo.bootstrap,
102              '|xns' : 'Roo.bootstrap',
103              items  : [
104               {
105                xtype : 'Row',
106                cls : 'roo-toolbar',
107                xns : Roo.bootstrap,
108                '|xns' : 'Roo.bootstrap',
109                items  : [
110                 {
111                  xtype : 'Column',
112                  md : 12,
113                  xns : Roo.bootstrap,
114                  '|xns' : 'Roo.bootstrap',
115                  items  : [
116                   {
117                    xtype : 'Button',
118                    cls : 'roo-toolbar-button',
119                    html : _this._strings['fd5293a712d172f5c556a83c62d44bd6'] /* <i class="fa fa-plus"></i> Add */,
120                    weight : 'default',
121                    listeners : {
122                     click : function (_self, e)
123                      {
124                          Pman.Dialog.BAdminCompany.show({}, function() {
125                              if (_this.table) {
126                                  _this.table.footer.onClick('first');
127                              }
128                          }); 
129                      }
130                    },
131                    xns : Roo.bootstrap,
132                    '|xns' : 'Roo.bootstrap'
133                   },
134                   {
135                    xtype : 'Button',
136                    cls : 'roo-toolbar-button',
137                    html : _this._strings['694e249c3a9503141fa5ce3fb71d5477'] /* <i class="fa fa-edit"></i> Edit */,
138                    weight : 'default',
139                    listeners : {
140                     click : function (_self, e)
141                      {
142                          var s = _this.table.getSelectionModel().getSelected();
143                              
144                          if (!s || s.data.id * 1 < 1)  {
145                              Roo.bootstrap.MessageBox.alert("Error", 'Please select a company');
146                              return;
147                          }
148                          
149                          Pman.Dialog.BAdminCompany.show({
150                              id : s.data.id
151                          }, function() {
152                              if (_this.table) {
153                                  _this.table.footer.onClick('refresh');
154                              }
155                          });
156                          
157                          
158                      },
159                     render : function (_self)
160                      {
161                          _this.edit_btn = this;
162                          
163                          this.hide();
164                      }
165                    },
166                    xns : Roo.bootstrap,
167                    '|xns' : 'Roo.bootstrap'
168                   },
169                   {
170                    xtype : 'Button',
171                    cls : 'roo-toolbar-button',
172                    html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
173                    weight : 'primary',
174                    listeners : {
175                     click : function (_self, e)
176                      {
177                          Pman.genericDelete(_this.grid, 'core_company'); 
178                      },
179                     render : function (_self)
180                      {
181                          _this.delete_btn = this;
182                          
183                          this.hide();
184                      }
185                    },
186                    xns : Roo.bootstrap,
187                    '|xns' : 'Roo.bootstrap'
188                   }
189                  ]
190                 }
191                ]
192               }
193              ]
194             }
195            ]
196           }
197          ]
198         }
199        ]
200       },
201       grid : {
202        xtype : 'Table',
203        cls : 'table-fixed',
204        hover : true,
205        loadMask : true,
206        responsive : true,
207        rowSelection : true,
208        striped : false,
209        listeners : {
210         render : function (_self)
211          {
212              _this.table = this;
213          },
214         rowclick : function (_self, el, rowIndex, e)
215          {
216              (function(){
217                  
218                  _this.edit_btn.hide();
219                  _this.delete_btn.hide();
220                  
221                  var s = _this.table.getSelectionModel().getSelected();
222                  
223                  if (!s || s.data.id * 1 < 1)  {
224                      return;
225                  }
226                  
227                  _this.edit_btn.show();
228                  _this.delete_btn.show();
229                  
230              }).defer(100);
231              
232          },
233         rowdblclick : function (_self, el, rowIndex, e)
234          {
235              var s = _this.table.store.getAt(rowIndex);
236              
237              if(!s || s.data.id * 1 < 1){
238                  return;
239              }
240              
241              Pman.Dialog.BAdminCompany.show({
242                  id : s.data.id
243              }, function() {
244                  if (_this.table) {
245                      _this.table.footer.onClick('refresh');
246                  }
247              });
248          }
249        },
250        xns : Roo.bootstrap,
251        '|xns' : 'Roo.bootstrap',
252        footer : {
253         xtype : 'PagingToolbar',
254         displayInfo : false,
255         displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
256         emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
257         name : 'footer',
258         pageSize : 25,
259         listeners : {
260          render : function (_self)
261           {
262               _this.footer = _self;
263           }
264         },
265         xns : Roo.bootstrap,
266         '|xns' : 'Roo.bootstrap'
267        },
268        store : {
269         xtype : 'Store',
270         hover : true,
271         loadMask : true,
272         rowSelection : true,
273         striped : true,
274         listeners : {
275          beforeload : function (_self, options)
276           {
277                if (!Pman.buildCompleted) {
278                   return false;
279               }
280               
281               options.params = options.params || {};
282           },
283          load : function (_self, records, options)
284           {
285               _this.delete_btn.hide();
286               _this.edit_btn.hide();
287           }
288         },
289         xns : Roo.data,
290         '|xns' : 'Roo.data',
291         proxy : {
292          xtype : 'HttpProxy',
293          method : 'GET',
294          url : baseURL + '/Roo/core_company',
295          listeners : {
296           load : function (This, o, arg)
297            {
298                _this.table.footer.onClick('first');
299            }
300          },
301          xns : Roo.data,
302          '|xns' : 'Roo.data'
303         },
304         reader : {
305          xtype : 'JsonReader',
306          id : 'id',
307          root : 'data',
308          totalProperty : 'total',
309          xns : Roo.data,
310          '|xns' : 'Roo.data'
311         }
312        },
313        sm : {
314         xtype : 'RowSelectionModel',
315         singleSelect : true,
316         xns : Roo.bootstrap.Table,
317         '|xns' : 'Roo.bootstrap.Table'
318        },
319        cm : [
320         {
321          xtype : 'ColumnModel',
322          cursor : 'pointer',
323          dataIndex : 'comptype',
324          header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
325          md : 1,
326          renderer : function (v,x ,r) {
327              //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);
328              return v;
329          },
330          sm : 1,
331          sortable : true,
332          xs : 1,
333          xns : Roo.grid,
334          '|xns' : 'Roo.grid'
335         },
336         {
337          xtype : 'ColumnModel',
338          cursor : 'pointer',
339          dataIndex : 'code',
340          header : _this._strings['9c9745a343efeacc9efe9b7222b27afb'] /* Ref# */,
341          hidden : true,
342          renderer : function(v) { return String.format('{0}', v); },
343          sortable : true,
344          xns : Roo.grid,
345          '|xns' : 'Roo.grid'
346         },
347         {
348          xtype : 'ColumnModel',
349          cursor : 'pointer',
350          dataIndex : 'name',
351          header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
352          md : 2,
353          renderer : function(v,x,r) {
354              return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);    
355          },
356          sm : 2,
357          sortable : true,
358          xs : 2,
359          xns : Roo.grid,
360          '|xns' : 'Roo.grid'
361         },
362         {
363          xtype : 'ColumnModel',
364          cursor : 'pointer',
365          dataIndex : 'tel',
366          header : _this._strings['2e006b735fbd916d8ab26978ae6714d4'] /* Tel */,
367          md : 1,
368          renderer : function(v) { return String.format('{0}', v); },
369          sm : 1,
370          xs : 1,
371          xns : Roo.grid,
372          '|xns' : 'Roo.grid'
373         },
374         {
375          xtype : 'ColumnModel',
376          cursor : 'pointer',
377          dataIndex : 'fax',
378          header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
379          md : 1,
380          renderer : function(v) { return String.format('{0}', v); },
381          sm : 1,
382          xs : 1,
383          xns : Roo.grid,
384          '|xns' : 'Roo.grid'
385         },
386         {
387          xtype : 'ColumnModel',
388          cursor : 'pointer',
389          dataIndex : 'email',
390          header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
391          md : 2,
392          renderer : function (v) {
393                  return (v.length && v.indexOf('@') > 0 ) ? 
394                      String.format('<a href="mailto:{0}">{0}</a>',v) : v;
395                      
396              },
397          sm : 2,
398          sortable : true,
399          xs : 2,
400          xns : Roo.grid,
401          '|xns' : 'Roo.grid'
402         },
403         {
404          xtype : 'ColumnModel',
405          cursor : 'pointer',
406          dataIndex : 'address',
407          header : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
408          md : 5,
409          renderer : function(v) { return String.format('{0}', v); },
410          sm : 5,
411          sortable : true,
412          xs : 5,
413          xns : Roo.grid,
414          '|xns' : 'Roo.grid'
415         },
416         {
417          xtype : 'ColumnModel',
418          cursor : 'pointer',
419          dataIndex : 'remarks',
420          header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
421          hidden : true,
422          renderer : function(v) { return String.format('{0}', v); },
423          width : 200,
424          xns : Roo.grid,
425          '|xns' : 'Roo.grid'
426         },
427         {
428          xtype : 'ColumnModel',
429          cursor : 'pointer',
430          dataIndex : 'id',
431          header : _this._strings['b80bb7740288fda1f201890375a60c8f'] /* id */,
432          hidden : true,
433          renderer : function(v) { return String.format('{0}', v); },
434          sortable : true,
435          width : 50,
436          xns : Roo.grid,
437          '|xns' : 'Roo.grid'
438         }
439        ]
440       }
441      }
442     ]
443    }
444   };  }
445 });