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