Pman.Tab.AdminWatches.bjs
[Pman.Admin] / Pman.Tab.AdminWatches.bjs
1 {
2     "id": "roo-file-237",
3     "name": "Pman.Tab.AdminWatches",
4     "parent": "Pman.Tab.AdminWatchNotify",
5     "title": "Pman.Tab.AdminWatches",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminWatches.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "autoScroll": false,
13             "background": true,
14             "fitContainer": true,
15             "fitToframe": true,
16             "region": "center",
17             "tableName": "core_watch",
18             "xtype": "GridPanel",
19             "|title": "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "listeners": {
24                         "|render": "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.AdminWatch;\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
25                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
26                     },
27                     "*prop": "grid",
28                     "autoExpandColumn": "person_id_name",
29                     "loadMask": true,
30                     "xtype": "Grid",
31                     "|xns": "Roo.grid",
32                     "items": [
33                         {
34                             "listeners": {
35                                 "beforeload": "function (_self, options)\n{\n        var val = _this.affectSel.getValue();\n        if (val.length) {\n            options.params.ontable = val;\n        }\n        if (_this.requestArgs) { \n            Roo.apply(options.params, _this.requestArgs);\n        }\n        \n}"
36                             },
37                             "*prop": "dataSource",
38                             "remoteSort": true,
39                             "xtype": "Store",
40                             "|sortInfo": "{ field : 'ontable', direction: 'ASC' }",
41                             "|xns": "Roo.data",
42                             "items": [
43                                 {
44                                     "*prop": "proxy",
45                                     "xtype": "HttpProxy",
46                                     "method": "GET",
47                                     "|url": "baseURL + '/Roo/core_watch.php'",
48                                     "|xns": "Roo.data"
49                                 },
50                                 {
51                                     "|xns": "Roo.data",
52                                     "xtype": "JsonReader",
53                                     "totalProperty": "total",
54                                     "root": "data",
55                                     "*prop": "reader",
56                                     "id": "id",
57                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event',\n        'type': 'string'\n    },\n    {\n        'name': 'medium',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
58                                 }
59                             ]
60                         },
61                         {
62                             "*prop": "footer",
63                             "xtype": "PagingToolbar",
64                             "pageSize": 25,
65                             "displayInfo": true,
66                             "displayMsg": "Displaying core_watch{0} - {1} of {2}",
67                             "emptyMsg": "No core_watch found",
68                             "|xns": "Roo"
69                         },
70                         {
71                             "*prop": "toolbar",
72                             "xtype": "Toolbar",
73                             "|xns": "Roo",
74                             "items": [
75                                 {
76                                     "text": "Show",
77                                     "xtype": "TextItem",
78                                     "|xns": "Roo.Toolbar"
79                                 },
80                                 {
81                                     "listeners": {
82                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
83                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
84                                     },
85                                     "allowBlank": true,
86                                     "displayField": "on_table",
87                                     "editable": false,
88                                     "emptyText": "Select Table",
89                                     "forceSelection": true,
90                                     "listWidth": 300,
91                                     "loadingText": "Searching...",
92                                     "minChars": 2,
93                                     "name": "ontable",
94                                     "pageSize": 20,
95                                     "qtip": "Select Action",
96                                     "queryParam": "query[ontable]",
97                                     "selectOnFocus": true,
98                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
99                                     "triggerAction": "all",
100                                     "typeAhead": true,
101                                     "valueField": "on_table",
102                                     "width": 150,
103                                     "xtype": "ComboBox",
104                                     "|xns": "Roo.form",
105                                     "items": [
106                                         {
107                                             "listeners": {
108                                                 "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n        o.params.company_id = Pman.Login.authUser.company_id;\n    }\n    o.params._distinct = 'on_table';\n    o.params._columns ='on_table';\n}"
109                                             },
110                                             "*prop": "store",
111                                             "remoteSort": true,
112                                             "xtype": "Store",
113                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
114                                             "|xns": "Roo.data",
115                                             "items": [
116                                                 {
117                                                     "*prop": "proxy",
118                                                     "method": "GET",
119                                                     "xtype": "HttpProxy",
120                                                     "|url": "baseURL + '/Roo/Events.php'",
121                                                     "|xns": "Roo.data"
122                                                 },
123                                                 {
124                                                     "*prop": "reader",
125                                                     "id": "id",
126                                                     "root": "data",
127                                                     "totalProperty": "total",
128                                                     "xtype": "JsonReader",
129                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    }\n     \n]",
130                                                     "|xns": "Roo.data"
131                                                 }
132                                             ]
133                                         }
134                                     ]
135                                 },
136                                 {
137                                     "|xns": "Roo.Toolbar",
138                                     "xtype": "Fill"
139                                 },
140                                 {
141                                     "text": "Add",
142                                     "xtype": "Button",
143                                     "cls": "x-btn-text-icon",
144                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
145                                     "listeners": {
146                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
147                                     },
148                                     "|xns": "Roo.Toolbar"
149                                 },
150                                 {
151                                     "text": "Delete",
152                                     "cls": "x-btn-text-icon",
153                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
154                                     "xtype": "Button",
155                                     "listeners": {
156                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
157                                     },
158                                     "|xns": "Roo.Toolbar"
159                                 }
160                             ]
161                         },
162                         {
163                             "*prop": "colModel[]",
164                             "dataIndex": "event",
165                             "header": "Watch Event",
166                             "width": 150,
167                             "xtype": "ColumnModel",
168                             "|renderer": "function(v,x,r) { \n    if (typeof(r.data.event_right_display_name) != 'undefined') {\n        return String.format('{0}: {1}', r.data.event_left, r.data.event_right_display_name);     \n    }\n    return String.format('{0}', v); \n    \n}",
169                             "|xns": "Roo.grid"
170                         },
171                         {
172                             "*prop": "colModel[]",
173                             "dataIndex": "ontable",
174                             "header": "Watch Table",
175                             "width": 150,
176                             "xtype": "ColumnModel",
177                             "|renderer": "function(v) { return String.format('{0}', v); }",
178                             "|xns": "Roo.grid"
179                         },
180                         {
181                             "*prop": "colModel[]",
182                             "dataIndex": "onid",
183                             "header": "Watch ID",
184                             "width": 75,
185                             "xtype": "ColumnModel",
186                             "|renderer": "function(v) { return String.format('{0}', v); }",
187                             "|xns": "Roo.grid"
188                         },
189                         {
190                             "*prop": "colModel[]",
191                             "dataIndex": "person_id_name",
192                             "header": "Who get's notified",
193                             "width": 150,
194                             "xtype": "ColumnModel",
195                             "|renderer": "function(v) { return String.format('{0}', v); }",
196                             "|xns": "Roo.grid"
197                         },
198                         {
199                             "*prop": "colModel[]",
200                             "dataIndex": "medium",
201                             "header": "What happens",
202                             "width": 300,
203                             "xtype": "ColumnModel",
204                             "|renderer": "function(v) {\n    var ar = v.split(':');\n    if (ar.length > 1) {\n        var act = ar[1].replace(/^notify/,'');\n\n        return String.format('<span qtip=\"{0}\">{1}<span>', v, act);\n    }\n\n    return String.format('{0}', v);\n }",
205                             "|xns": "Roo.grid"
206                         },
207                         {
208                             "xtype": "ColumnModel",
209                             "header": "Active",
210                             "width": 75,
211                             "dataIndex": "active",
212                             "|renderer": "function(v) { return String.format('{0}', v); }",
213                             "|xns": "Roo.grid",
214                             "*prop": "colModel[]"
215                         }
216                     ]
217                 }
218             ]
219         }
220     ],
221     "permname": "",
222     "modOrder": "860"
223 }