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             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|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}",
24                         "|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"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "person_id_name",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, options)\n{\n        var val = _this.affectSel.getValue();\n        if (val.length) {\n            options.params.ontable = val;\n        }\n        \n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'ontable', direction: 'ASC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/core_watch.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|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]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying core_watch{0} - {1} of {2}",
66                             "emptyMsg": "No core_watch found",
67                             "|xns": "Roo"
68                         },
69                         {
70                             "*prop": "toolbar",
71                             "xtype": "Toolbar",
72                             "|xns": "Roo",
73                             "items": [
74                                 {
75                                     "text": "Show",
76                                     "xtype": "TextItem",
77                                     "|xns": "Roo.Toolbar"
78                                 },
79                                 {
80                                     "listeners": {
81                                         "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
82                                         "|render": "function (_self)\n{\n  _this.affectSel = _self;\n}"
83                                     },
84                                     "allowBlank": true,
85                                     "displayField": "on_table",
86                                     "editable": false,
87                                     "emptyText": "Select Table",
88                                     "forceSelection": true,
89                                     "listWidth": 300,
90                                     "loadingText": "Searching...",
91                                     "minChars": 2,
92                                     "name": "ontable",
93                                     "pageSize": 20,
94                                     "qtip": "Select Action",
95                                     "queryParam": "query[ontable]",
96                                     "selectOnFocus": true,
97                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
98                                     "triggerAction": "all",
99                                     "typeAhead": true,
100                                     "valueField": "on_table",
101                                     "width": 150,
102                                     "xtype": "ComboBox",
103                                     "|xns": "Roo.form",
104                                     "items": [
105                                         {
106                                             "listeners": {
107                                                 "|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}"
108                                             },
109                                             "*prop": "store",
110                                             "remoteSort": true,
111                                             "xtype": "Store",
112                                             "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }",
113                                             "|xns": "Roo.data",
114                                             "items": [
115                                                 {
116                                                     "*prop": "proxy",
117                                                     "method": "GET",
118                                                     "xtype": "HttpProxy",
119                                                     "|url": "baseURL + '/Roo/Events.php'",
120                                                     "|xns": "Roo.data"
121                                                 },
122                                                 {
123                                                     "*prop": "reader",
124                                                     "id": "id",
125                                                     "root": "data",
126                                                     "totalProperty": "total",
127                                                     "xtype": "JsonReader",
128                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    }\n     \n]",
129                                                     "|xns": "Roo.data"
130                                                 }
131                                             ]
132                                         }
133                                     ]
134                                 },
135                                 {
136                                     "|xns": "Roo.Toolbar",
137                                     "xtype": "Fill"
138                                 },
139                                 {
140                                     "text": "Add",
141                                     "xtype": "Button",
142                                     "cls": "x-btn-text-icon",
143                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
144                                     "listeners": {
145                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
146                                     },
147                                     "|xns": "Roo.Toolbar"
148                                 },
149                                 {
150                                     "text": "Delete",
151                                     "cls": "x-btn-text-icon",
152                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
153                                     "xtype": "Button",
154                                     "listeners": {
155                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
156                                     },
157                                     "|xns": "Roo.Toolbar"
158                                 }
159                             ]
160                         },
161                         {
162                             "*prop": "colModel[]",
163                             "dataIndex": "event",
164                             "header": "Watch Event",
165                             "width": 100,
166                             "xtype": "ColumnModel",
167                             "|renderer": "function(v) { return String.format('{0}', v); }",
168                             "|xns": "Roo.grid"
169                         },
170                         {
171                             "*prop": "colModel[]",
172                             "dataIndex": "ontable",
173                             "header": "Watch Table",
174                             "width": 150,
175                             "xtype": "ColumnModel",
176                             "|renderer": "function(v) { return String.format('{0}', v); }",
177                             "|xns": "Roo.grid"
178                         },
179                         {
180                             "*prop": "colModel[]",
181                             "dataIndex": "onid",
182                             "header": "Watch ID",
183                             "width": 75,
184                             "xtype": "ColumnModel",
185                             "|renderer": "function(v) { return String.format('{0}', v); }",
186                             "|xns": "Roo.grid"
187                         },
188                         {
189                             "*prop": "colModel[]",
190                             "dataIndex": "person_id_name",
191                             "header": "Who get's notified",
192                             "width": 150,
193                             "xtype": "ColumnModel",
194                             "|renderer": "function(v) { return String.format('{0}', v); }",
195                             "|xns": "Roo.grid"
196                         },
197                         {
198                             "*prop": "colModel[]",
199                             "dataIndex": "medium",
200                             "header": "What happens",
201                             "width": 200,
202                             "xtype": "ColumnModel",
203                             "|renderer": "function(v) { return String.format('{0}', v); }",
204                             "|xns": "Roo.grid"
205                         },
206                         {
207                             "xtype": "ColumnModel",
208                             "header": "Active",
209                             "width": 75,
210                             "dataIndex": "active",
211                             "|renderer": "function(v) { return String.format('{0}', v); }",
212                             "|xns": "Roo.grid",
213                             "*prop": "colModel[]"
214                         }
215                     ]
216                 }
217             ]
218         }
219     ],
220     "permname": "",
221     "modOrder": "860"
222 }