Pman.Tab.AdminWatches.bjs
[Pman.Admin] / Pman.Tab.AdminWatches.bjs
1 {
2     "id": "roo-file-169",
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             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "core_watch",
17             "title": "Watches",
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": "ontable",
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>{ontable}</b> </div>",
98                                     "triggerAction": "all",
99                                     "typeAhead": true,
100                                     "valueField": "ontable",
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 = 'ontable';\n    o.params._columns ='ontable';\n}"
108                                             },
109                                             "*prop": "store",
110                                             "remoteSort": true,
111                                             "xtype": "Store",
112                                             "|sortInfo": "{ field : 'ontable' , direction : 'ASC' }",
113                                             "|xns": "Roo.data",
114                                             "items": [
115                                                 {
116                                                     "*prop": "proxy",
117                                                     "method": "GET",
118                                                     "xtype": "HttpProxy",
119                                                     "|url": "baseURL + '/Roo/Core_watch.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": "Edit",
151                                     "xtype": "Button",
152                                     "cls": "x-btn-text-icon",
153                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
154                                     "listeners": {
155                                         "|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"
156                                     },
157                                     "|xns": "Roo.Toolbar"
158                                 },
159                                 {
160                                     "text": "Delete",
161                                     "cls": "x-btn-text-icon",
162                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
163                                     "xtype": "Button",
164                                     "listeners": {
165                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
166                                     },
167                                     "|xns": "Roo.Toolbar"
168                                 }
169                             ]
170                         },
171                         {
172                             "*prop": "colModel[]",
173                             "dataIndex": "event",
174                             "header": "Watch Event",
175                             "width": 100,
176                             "xtype": "ColumnModel",
177                             "|renderer": "function(v) { return String.format('{0}', v); }",
178                             "|xns": "Roo.grid"
179                         },
180                         {
181                             "*prop": "colModel[]",
182                             "dataIndex": "ontable",
183                             "header": "Watch Table",
184                             "width": 150,
185                             "xtype": "ColumnModel",
186                             "|renderer": "function(v) { return String.format('{0}', v); }",
187                             "|xns": "Roo.grid"
188                         },
189                         {
190                             "*prop": "colModel[]",
191                             "dataIndex": "onid",
192                             "header": "Watch ID",
193                             "width": 75,
194                             "xtype": "ColumnModel",
195                             "|renderer": "function(v) { return String.format('{0}', v); }",
196                             "|xns": "Roo.grid"
197                         },
198                         {
199                             "*prop": "colModel[]",
200                             "dataIndex": "person_id_name",
201                             "header": "Who get's notified",
202                             "width": 150,
203                             "xtype": "ColumnModel",
204                             "|renderer": "function(v) { return String.format('{0}', v); }",
205                             "|xns": "Roo.grid"
206                         },
207                         {
208                             "*prop": "colModel[]",
209                             "dataIndex": "medium",
210                             "header": "What happens",
211                             "width": 200,
212                             "xtype": "ColumnModel",
213                             "|renderer": "function(v) { return String.format('{0}', v); }",
214                             "|xns": "Roo.grid"
215                         },
216                         {
217                             "xtype": "ColumnModel",
218                             "header": "Active",
219                             "width": 75,
220                             "dataIndex": "active",
221                             "|renderer": "function(v) { return String.format('{0}', v); }",
222                             "|xns": "Roo.grid",
223                             "*prop": "colModel[]"
224                         }
225                     ]
226                 }
227             ]
228         }
229     ],
230     "permname": "",
231     "modOrder": "860"
232 }