Pman.Tab.AdminWatches.bjs
[Pman.Admin] / Pman.Tab.AdminWatches.bjs
1 {
2     "id": "roo-file-58",
3     "name": "Pman.Tab.AdminWatches",
4     "parent": "Pman.Tab.Admin",
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             "title": "Watches",
19             "xtype": "GridPanel",
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        \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": "ontable",
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>{ontable}</b> </div>",
99                                     "triggerAction": "all",
100                                     "typeAhead": true,
101                                     "valueField": "ontable",
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": "Edit",
152                                     "xtype": "Button",
153                                     "cls": "x-btn-text-icon",
154                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
155                                     "listeners": {
156                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
157                                     },
158                                     "|xns": "Roo.Toolbar"
159                                 },
160                                 {
161                                     "text": "Delete",
162                                     "cls": "x-btn-text-icon",
163                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
164                                     "xtype": "Button",
165                                     "listeners": {
166                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
167                                     },
168                                     "|xns": "Roo.Toolbar"
169                                 }
170                             ]
171                         },
172                         {
173                             "*prop": "colModel[]",
174                             "dataIndex": "event",
175                             "header": "Watch Event",
176                             "width": 100,
177                             "xtype": "ColumnModel",
178                             "|renderer": "function(v) { return String.format('{0}', v); }",
179                             "|xns": "Roo.grid"
180                         },
181                         {
182                             "*prop": "colModel[]",
183                             "dataIndex": "ontable",
184                             "header": "Watch Table",
185                             "width": 150,
186                             "xtype": "ColumnModel",
187                             "|renderer": "function(v) { return String.format('{0}', v); }",
188                             "|xns": "Roo.grid"
189                         },
190                         {
191                             "*prop": "colModel[]",
192                             "dataIndex": "onid",
193                             "header": "Watch ID",
194                             "width": 75,
195                             "xtype": "ColumnModel",
196                             "|renderer": "function(v) { return String.format('{0}', v); }",
197                             "|xns": "Roo.grid"
198                         },
199                         {
200                             "*prop": "colModel[]",
201                             "dataIndex": "person_id_name",
202                             "header": "Who get's notified",
203                             "width": 150,
204                             "xtype": "ColumnModel",
205                             "|renderer": "function(v) { return String.format('{0}', v); }",
206                             "|xns": "Roo.grid"
207                         },
208                         {
209                             "*prop": "colModel[]",
210                             "dataIndex": "medium",
211                             "header": "What happens",
212                             "width": 200,
213                             "xtype": "ColumnModel",
214                             "|renderer": "function(v) { return String.format('{0}', v); }",
215                             "|xns": "Roo.grid"
216                         },
217                         {
218                             "xtype": "ColumnModel",
219                             "header": "Active",
220                             "width": 75,
221                             "dataIndex": "active",
222                             "|renderer": "function(v) { return String.format('{0}', v); }",
223                             "|xns": "Roo.grid",
224                             "*prop": "colModel[]"
225                         }
226                     ]
227                 }
228             ]
229         }
230     ],
231     "permname": "",
232     "modOrder": "860"
233 }