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