1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '860-Pman.Tab.AdminWatches',
12 module : Pman.Tab.AdminWatches,
14 parent : Pman.Tab.Admin,
15 name : "Pman.Tab.AdminWatches",
21 Pman.Tab.AdminWatches = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
37 activate : function() {
40 _this.grid.footer.onClick('first');
49 tableName : 'core_watch',
58 _this.dialog = Pman.Dialog.AdminWatch;
59 if (_this.panel.active) {
60 this.footer.onClick('first');
63 rowdblclick : function (_self, rowIndex, e)
65 if (!_this.dialog) return;
66 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
67 _this.grid.footer.onClick('first');
71 autoExpandColumn : 'person_id_name',
77 beforeload : function (_self, options)
79 var val = _this.affectSel.getValue();
81 options.params.ontable = val;
87 sortInfo : { field : 'ontable', direction: 'ASC' },
92 url : baseURL + '/Roo/core_watch.php'
97 totalProperty : 'total',
130 'name': 'person_id_id',
134 'name': 'person_id_office_id',
138 'name': 'person_id_name',
142 'name': 'person_id_phone',
146 'name': 'person_id_fax',
150 'name': 'person_id_email',
154 'name': 'person_id_company_id',
158 'name': 'person_id_role',
162 'name': 'person_id_active',
166 'name': 'person_id_remarks',
170 'name': 'person_id_passwd',
174 'name': 'person_id_owner_id',
178 'name': 'person_id_lang',
182 'name': 'person_id_no_reset_sent',
186 'name': 'person_id_action_type',
190 'name': 'person_id_project_id',
194 'name': 'person_id_deleted_by',
198 'name': 'person_id_deleted_dt',
205 xtype: 'PagingToolbar',
209 displayMsg : "Displaying core_watch{0} - {1} of {2}",
210 emptyMsg : "No core_watch found"
225 select : function (combo, record, index)
227 _this.grid.footer.onClick('first');
229 render : function (_self)
231 _this.affectSel = _self;
235 displayField : 'ontable',
237 emptyText : "Select Table",
238 forceSelection : true,
240 loadingText : "Searching...",
244 qtip : "Select Action",
245 queryParam : 'query[ontable]',
246 selectOnFocus : true,
247 tpl : '<div class="x-grid-cell-text x-btn button"><b>{ontable}</b> </div>',
248 triggerAction : 'all',
250 valueField : 'ontable',
256 beforeload : function (_self, o)
258 o.params = o.params || {};
259 // staff can see all logs, other companies can only see their own.
260 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
261 o.params.company_id = Pman.Login.authUser.company_id;
263 o.params._distinct = 'ontable';
264 o.params._columns ='ontable';
268 sortInfo : { field : 'ontable' , direction : 'ASC' },
273 url : baseURL + '/Roo/Events.php'
280 totalProperty : 'total',
303 cls : 'x-btn-text-icon',
304 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
308 if (!_this.dialog) return;
309 _this.dialog.show( { id : 0 } , function() {
310 _this.grid.footer.onClick('first');
319 cls : 'x-btn-text-icon',
320 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
324 var s = _this.grid.getSelectionModel().getSelections();
325 if (!s.length || (s.length > 1)) {
326 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
329 if (!_this.dialog) return;
330 _this.dialog.show(s[0].data, function() {
331 _this.grid.footer.onClick('first');
341 cls : 'x-btn-text-icon',
342 icon : rootURL + '/Pman/templates/images/trash.gif',
346 Pman.genericDelete(_this, 'core_watch');
354 xtype: 'ColumnModel',
357 header : 'Watch Event',
359 renderer : function(v) { return String.format('{0}', v); }
362 xtype: 'ColumnModel',
364 dataIndex : 'ontable',
365 header : 'Watch Table',
367 renderer : function(v) { return String.format('{0}', v); }
370 xtype: 'ColumnModel',
375 renderer : function(v) { return String.format('{0}', v); }
378 xtype: 'ColumnModel',
380 dataIndex : 'person_id_name',
381 header : 'Who get\'s notified',
383 renderer : function(v) { return String.format('{0}', v); }
386 xtype: 'ColumnModel',
388 dataIndex : 'medium',
389 header : 'What happens',
391 renderer : function(v) { return String.format('{0}', v); }
394 xtype: 'ColumnModel',
398 dataIndex : 'active',
399 renderer : function(v) { return String.format('{0}', v); }
404 this.layout = this.panel.layout;