Pman.Tab.AdminNotify.bjs
[Pman.Admin] / Pman.Tab.AdminNotify.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.AdminNotify = new Roo.XComponent({
8
9  _strings : {
10   '136fac3c5c5881e0a7d0039e57decd68' :"Select notify type",
11   'bf1cb7e2a337a5e2ebf614009cbce9cc' :"Current Notifications",
12   '8535bcc0f05358a583bb432bbadf7e0d' :"Select type",
13   'e12167aa0a7698e6ebc92b4ce3909b53' :"To",
14   '478192f02d448c49bc6b7d76818d8483' :"Ontable",
15   'dca4dd744d00b6fe1362ef7825ffdee5' :"No core_notify found",
16   'dc873ea4b71ca217b0d8d1fdd45854ac' :"id#",
17   '0f6d01b16d57911731aa44b94dbfefcc' :"Act when",
18   '7f8c0283f16925caed8e632086b81b9c' :"Sent",
19   'c956c97343a45cca5d492e70c56daa8e' :"Select person",
20   '12832b4def6eb0b6105b3d11e16066ea' :"Msgid",
21   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
22   '24463f10155b8af973300f86302c4fde' :"Who to notify",
23   'b22e7ea679daf5146f08f477419dd8bd' :"Triggered by",
24   '5da618e8e4b89c66fe86e32cdafde142' :"From",
25   'e4b478c05a833569833f9cc63b6c4354' :"Displaying core_notify{0} - {1} of {2}",
26   '4c3880bb027f159e801041b1021e88e8' :"Method",
27   'a4ecfc70574394990cf17bd83df499f7' :"Event",
28   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
29   'f821027bade4aa6b7a4191cd1676cf41' :"Show Completed"
30  },
31
32   part     :  ["Admin", "Notify" ],
33   order    : '001-Pman.Tab.AdminNotify',
34   region   : 'center',
35   parent   : 'Pman.Tab.AdminWatchNotify',
36   name     : "Pman.Tab.AdminNotify",
37   disabled : false, 
38   permname : '', 
39   _tree : function()
40   {
41    var _this = this;
42    var MODULE = this;
43    return {
44    grid : {
45     dataSource : {
46      proxy : {
47       '|xns' : 'Roo.data',
48       method : 'GET',
49       url : baseURL + '/Roo/core_notify.php',
50       xns : Roo.data,
51       xtype : 'HttpProxy'
52      },
53      reader : {
54       '|xns' : 'Roo.data',
55       fields : [
56           {
57               'name': 'id',
58               'type': 'int'
59           },
60           {
61               'name': 'act_when',
62               'type': 'date',
63               'dateFormat': 'Y-m-d'
64           },
65           {
66               'name': 'onid',
67               'type': 'int'
68           },
69           {
70               'name': 'ontable',
71               'type': 'string'
72           },
73           {
74               'name': 'person_id',
75               'type': 'int'
76           },
77           {
78               'name': 'msgid',
79               'type': 'string'
80           },
81           {
82               'name': 'sent',
83               'type': 'date',
84               'dateFormat': 'Y-m-d'
85           },
86           {
87               'name': 'event_id',
88               'type': 'int'
89           },
90           {
91               'name': 'person_id_id',
92               'type': 'int'
93           },
94           {
95               'name': 'person_id_office_id',
96               'type': 'int'
97           },
98           {
99               'name': 'person_id_name',
100               'type': 'string'
101           },
102           {
103               'name': 'person_id_phone',
104               'type': 'string'
105           },
106           {
107               'name': 'person_id_fax',
108               'type': 'string'
109           },
110           {
111               'name': 'person_id_email',
112               'type': 'string'
113           },
114           {
115               'name': 'person_id_company_id',
116               'type': 'int'
117           },
118           {
119               'name': 'person_id_role',
120               'type': 'string'
121           },
122           {
123               'name': 'person_id_active',
124               'type': 'int'
125           },
126           {
127               'name': 'person_id_remarks',
128               'type': 'string'
129           },
130           {
131               'name': 'person_id_passwd',
132               'type': 'string'
133           },
134           {
135               'name': 'person_id_owner_id',
136               'type': 'int'
137           },
138           {
139               'name': 'person_id_lang',
140               'type': 'string'
141           },
142           {
143               'name': 'person_id_no_reset_sent',
144               'type': 'int'
145           },
146           {
147               'name': 'person_id_action_type',
148               'type': 'string'
149           },
150           {
151               'name': 'person_id_project_id',
152               'type': 'int'
153           },
154           {
155               'name': 'person_id_deleted_by',
156               'type': 'int'
157           },
158           {
159               'name': 'person_id_deleted_dt',
160               'type': 'date'
161           },
162           {
163               'name': 'event_id_id',
164               'type': 'int'
165           },
166           {
167               'name': 'event_id_person_name',
168               'type': 'string'
169           },
170           {
171               'name': 'event_id_event_when',
172               'type': 'date'
173           },
174           {
175               'name': 'event_id_action',
176               'type': 'string'
177           },
178           {
179               'name': 'event_id_ipaddr',
180               'type': 'string'
181           },
182           {
183               'name': 'event_id_on_id',
184               'type': 'int'
185           },
186           {
187               'name': 'event_id_on_table',
188               'type': 'string'
189           },
190           {
191               'name': 'event_id_person_id',
192               'type': 'int'
193           },
194           {
195               'name': 'event_id_remarks',
196               'type': 'string'
197           }
198       ],
199       id : 'id',
200       root : 'data',
201       totalProperty : 'total',
202       xns : Roo.data,
203       xtype : 'JsonReader'
204      },
205      '|xns' : 'Roo.data',
206      remoteSort : true,
207      sortInfo : { field : 'act_when', direction: 'DESC' },
208      xns : Roo.data,
209      xtype : 'Store',
210      listeners : {
211       beforeload : function (_self, options)
212        {
213            options.params = options.params || {};
214            
215            options.params._evtype_align = 1;
216            
217            if (!_this.toggleBtn.pressed) {
218                options.params['event_id'] = 0;
219            }
220            if (!_this.personCombo) {
221                return false;
222            }
223            var p = _this.personCombo.getValue();
224            if (p*1) { 
225                options.params.person_id = p;
226            }
227            
228            var from = _this.fromDateSel.getValue();
229            
230            if(from){
231                options.params.from = from.format('Y-m-d');
232            }
233            
234            var to = _this.toDateSel.getValue();
235            
236            if(to){
237                options.params.to = to.format('Y-m-d');
238            }
239            
240            var type = _this.typeCombo.getValue();
241            
242            if(type.length){
243                options.params.evtype = type;
244            }
245        }
246      },
247      items : [
248
249      ]
250
251     },
252     footer : {
253      '|xns' : 'Roo',
254      displayInfo : true,
255      displayMsg : _this._strings['e4b478c05a833569833f9cc63b6c4354'],
256      emptyMsg : _this._strings['dca4dd744d00b6fe1362ef7825ffdee5'],
257      pageSize : 25,
258      xns : Roo,
259      xtype : 'PagingToolbar'
260     },
261     toolbar : {
262      '|xns' : 'Roo',
263      xns : Roo,
264      xtype : 'Toolbar',
265      items : [
266       {
267        store : {
268         proxy : {
269          '|xns' : 'Roo.data',
270          method : 'GET',
271          url : baseURL + '/Roo/core_notify.php',
272          xns : Roo.data,
273          xtype : 'HttpProxy'
274         },
275         reader : {
276          '|xns' : 'Roo.data',
277          fields : [{"name":"id","type":"int"},{"name":"ontable","type":"string"}],
278          id : 'id',
279          root : 'data',
280          totalProperty : 'total',
281          xns : Roo.data,
282          xtype : 'JsonReader'
283         },
284         '|xns' : 'Roo.data',
285         remoteSort : true,
286         sortInfo : { direction : 'ASC', field: 'person_id_name' },
287         xns : Roo.data,
288         xtype : 'Store',
289         listeners : {
290          beforeload : function (_self, o){
291               o.params = o.params || {};
292               o.params._distinct='person_id';
293               o.params._columns='person_id,person_id_name,person_id_email';
294               o.params['!person_id_name'] = '';
295               
296               // set more here
297           }
298         },
299         items : [
300
301         ]
302
303        },
304        '|xns' : 'Roo.form',
305        allowBlank : true,
306        displayField : 'person_id_name',
307        editable : true,
308        emptyText : _this._strings['c956c97343a45cca5d492e70c56daa8e'],
309        forceSelection : true,
310        listWidth : 400,
311        loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
312        minChars : 2,
313        pageSize : 20,
314        qtip : _this._strings['c956c97343a45cca5d492e70c56daa8e'],
315        queryParam : 'query[person_id_name]',
316        selectOnFocus : true,
317        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{person_id_name}</b> {person_id_email}</div>',
318        triggerAction : 'all',
319        valueField : 'person_id',
320        width : 200,
321        xns : Roo.form,
322        xtype : 'ComboBox',
323        listeners : {
324         render : function (_self)
325          {
326             _this.personCombo = _self;
327          },
328         select : function (combo, record, index)
329          {
330             _this.grid.footer.onClick('first');
331          }
332        },
333        items : [
334
335        ]
336
337       },
338       {
339        '|xns' : 'Roo.Toolbar',
340        xns : Roo.Toolbar,
341        xtype : 'Separator'
342       },
343       {
344        store : {
345         proxy : {
346          '|xns' : 'Roo.data',
347          method : 'GET',
348          url : baseURL + '/Roo/core_enum.php',
349          xns : Roo.data,
350          xtype : 'HttpProxy'
351         },
352         reader : {
353          '|xns' : 'Roo.data',
354          fields : [{"name":"name","type":"string"},{"name":"display_name","type":"string"}],
355          id : 'id',
356          root : 'data',
357          totalProperty : 'total',
358          xns : Roo.data,
359          xtype : 'JsonReader'
360         },
361         '|xns' : 'Roo.data',
362         remoteSort : true,
363         sortInfo : { direction : 'ASC', field: 'id' },
364         xns : Roo.data,
365         xtype : 'Store',
366         listeners : {
367          beforeload : function (_self, o){
368               o.params = o.params || {};
369               o.params.etype = 'Core.NotifyType';
370               o.params.active = 1;
371           }
372         },
373         items : [
374
375         ]
376
377        },
378        '|xns' : 'Roo.form',
379        allowBlank : true,
380        displayField : 'display_name',
381        editable : true,
382        emptyText : _this._strings['136fac3c5c5881e0a7d0039e57decd68'],
383        forceSelection : true,
384        listWidth : 400,
385        loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
386        minChars : 2,
387        pageSize : 20,
388        qtip : _this._strings['8535bcc0f05358a583bb432bbadf7e0d'],
389        queryParam : 'query[name]',
390        selectOnFocus : true,
391        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b></div>',
392        triggerAction : 'all',
393        valueField : 'name',
394        width : 200,
395        xns : Roo.form,
396        xtype : 'ComboBox',
397        listeners : {
398         render : function (_self)
399          {
400             _this.typeCombo = _self;
401          },
402         select : function (combo, record, index)
403          {
404             _this.grid.footer.onClick('first');
405          }
406        },
407        items : [
408
409        ]
410
411       },
412       {
413        '|xns' : 'Roo.Toolbar',
414        xns : Roo.Toolbar,
415        xtype : 'Separator'
416       },
417       {
418        '|xns' : 'Roo.Toolbar',
419        text : _this._strings['5da618e8e4b89c66fe86e32cdafde142'],
420        xns : Roo.Toolbar,
421        xtype : 'TextItem'
422       },
423       {
424        '|xns' : 'Roo.form',
425        format : 'd/M/Y',
426        width : 100,
427        xns : Roo.form,
428        xtype : 'DateField',
429        listeners : {
430         render : function (_self)\r
431          {\r
432              _this.fromDateSel = _self;\r
433             //_self.setValue(  new Date() );\r
434          },
435         select : function (combo, date)
436          {
437              _this.grid.footer.onClick('first');
438          }
439        }
440       },
441       {
442        '|xns' : 'Roo.Toolbar',
443        xns : Roo.Toolbar,
444        xtype : 'Separator'
445       },
446       {
447        '|xns' : 'Roo.Toolbar',
448        text : _this._strings['e12167aa0a7698e6ebc92b4ce3909b53'],
449        xns : Roo.Toolbar,
450        xtype : 'TextItem'
451       },
452       {
453        '|xns' : 'Roo.form',
454        format : 'd/M/Y',
455        width : 100,
456        xns : Roo.form,
457        xtype : 'DateField',
458        listeners : {
459         render : function (_self)\r
460          {\r
461              _this.toDateSel = _self;\r
462             //_self.setValue(  new Date() );\r
463          },
464         select : function (combo, date)
465          {
466              _this.grid.footer.onClick('first');
467          }
468        }
469       },
470       {
471        '|xns' : 'Roo.Toolbar',
472        xns : Roo.Toolbar,
473        xtype : 'Fill'
474       },
475       {
476        '|xns' : 'Roo.Toolbar',
477        cls : 'x-btn-text-icon',
478        icon : rootURL + '/Pman/templates/images/trash.gif',
479        text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
480        xns : Roo.Toolbar,
481        xtype : 'Button',
482        listeners : {
483         click : function()
484          {
485              Pman.genericDelete(_this, 'core_notify'); 
486          }
487        }
488       },
489       {
490        '|xns' : 'Roo.Toolbar',
491        enableToggle : true,
492        text : _this._strings['f821027bade4aa6b7a4191cd1676cf41'],
493        xns : Roo.Toolbar,
494        xtype : 'Button',
495        listeners : {
496         render : function (_self)
497          {
498              _this.toggleBtn = _self;
499          },
500         toggle : function (_self, pressed)
501          {
502              this.setText(pressed ? "Hide Completed" : "Show Completed");
503              _this.grid.footer.onClick('first');
504          }
505        }
506       }
507      ]
508
509     },
510     '|xns' : 'Roo.grid',
511     autoExpandColumn : 'person_id_name',
512     loadMask : true,
513     xns : Roo.grid,
514     xtype : 'Grid',
515     colModel : [
516       {
517        '|xns' : 'Roo.grid',
518        dataIndex : 'id',
519        header : _this._strings['dc873ea4b71ca217b0d8d1fdd45854ac'],
520        renderer : function(v) { return String.format('{0}', v ); },
521        sortable : true,
522        width : 50,
523        xns : Roo.grid,
524        xtype : 'ColumnModel'
525       },
526 {
527        '|xns' : 'Roo.grid',
528        dataIndex : 'evtype',
529        header : _this._strings['4c3880bb027f159e801041b1021e88e8'],
530        renderer : function(v,x,r) 
531        { 
532            var vv = (typeof(r.data.evtype_align) != 'undefined' && r.data.evtype_align) ? r.data.evtype_align : v;
533            return String.format('<span qtip="{0}">{1}</span>', v, vv ); 
534        },
535        sortable : true,
536        width : 200,
537        xns : Roo.grid,
538        xtype : 'ColumnModel'
539       },
540 {
541        '|xns' : 'Roo.grid',
542        dataIndex : 'act_when',
543        header : _this._strings['0f6d01b16d57911731aa44b94dbfefcc'],
544        renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
545        sortable : true,
546        width : 150,
547        xns : Roo.grid,
548        xtype : 'ColumnModel'
549       },
550 {
551        '|xns' : 'Roo.grid',
552        dataIndex : 'sent',
553        header : _this._strings['7f8c0283f16925caed8e632086b81b9c'],
554        renderer : function(v,x,r) {
555            if (r.data.event_id *1 == 0) {
556                return '';
557            }
558             return String.format('{0}', v ? v.format('d/M/Y H:i:s') : '');
559          },
560        sortable : true,
561        width : 150,
562        xns : Roo.grid,
563        xtype : 'ColumnModel'
564       },
565 {
566        '|xns' : 'Roo.grid',
567        dataIndex : 'ontable',
568        header : _this._strings['478192f02d448c49bc6b7d76818d8483'],
569        renderer : function(v,x,r) { return String.format('{0}:{1}', v,r.data.onid); },
570        width : 150,
571        xns : Roo.grid,
572        xtype : 'ColumnModel'
573       },
574 {
575        '|xns' : 'Roo.grid',
576        dataIndex : 'person_id_name',
577        header : _this._strings['24463f10155b8af973300f86302c4fde'],
578        renderer : function(v,x,r) {
579             return String.format('{0} <u>&lt;{1}&gt;</u>', v, r.data.person_id_email); 
580         },
581        width : 100,
582        xns : Roo.grid,
583        xtype : 'ColumnModel'
584       },
585 {
586        '|xns' : 'Roo.grid',
587        dataIndex : 'trigger_event_id',
588        header : _this._strings['b22e7ea679daf5146f08f477419dd8bd'],
589        renderer : function(v,x,r) {
590             return String.format(
591                    '{0} : {1} {2}', 
592                    r.data.trigger_event_id_on_table, 
593                    r.data.trigger_event_id_on_id, 
594                    r.data.trigger_event_id_remarks
595                ); 
596         },
597        width : 100,
598        xns : Roo.grid,
599        xtype : 'ColumnModel'
600       },
601 {
602        '|xns' : 'Roo.grid',
603        dataIndex : 'msgid',
604        header : _this._strings['12832b4def6eb0b6105b3d11e16066ea'],
605        renderer : function(v) { return String.format('{0}', v); },
606        width : 200,
607        xns : Roo.grid,
608        xtype : 'ColumnModel'
609       },
610 {
611        '|xns' : 'Roo.grid',
612        dataIndex : 'event_id_remarks',
613        header : _this._strings['a4ecfc70574394990cf17bd83df499f7'],
614        renderer : function(v) { return String.format('<span qtip="{0}">{0}</span>', v); },
615        width : 300,
616        xns : Roo.grid,
617        xtype : 'ColumnModel'
618       }
619     ],
620     listeners : {
621      render : function() 
622       {
623           _this.grid = this; 
624           //_this.dialog = Pman.Dialog.FILL_IN
625           if (_this.panel.active) {
626              this.footer.onClick('first');
627           }
628       }
629     },
630     items : [
631
632     ]
633
634    },
635    '|xns' : 'Roo',
636    background : false,
637    fitContainer : true,
638    fitToframe : true,
639    region : 'center',
640    tableName : 'core_notify',
641    title : _this._strings['bf1cb7e2a337a5e2ebf614009cbce9cc'],
642    xns : Roo,
643    xtype : 'GridPanel',
644    listeners : {
645     activate : function() {
646          _this.panel = this;
647          if (_this.grid) {
648              _this.grid.footer.onClick('first');
649          }
650          
651      }
652    },
653    items : [
654
655    ]
656
657   };  }
658 });