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');
48 tableName : 'core_watch',
57 //_this.dialog = Pman.Dialog.FILL_IN
58 if (_this.panel.active) {
59 this.footer.onClick('first');
62 rowdblclick : function (_self, rowIndex, e)
64 if (!_this.dialog) return;
65 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
66 _this.grid.footer.onClick('first');
70 autoExpandColumn : 'person_id_name',
76 beforeload : function (_self, options)
78 var val = _this.affectSel.getValue();
80 options.params.ontable = val;
86 sortInfo : { field : 'ontable', direction: 'ASC' },
91 url : baseURL + '/Roo/core_watch.php'
96 totalProperty : 'total',
129 'name': 'person_id_id',
133 'name': 'person_id_office_id',
137 'name': 'person_id_name',
141 'name': 'person_id_phone',
145 'name': 'person_id_fax',
149 'name': 'person_id_email',
153 'name': 'person_id_company_id',
157 'name': 'person_id_role',
161 'name': 'person_id_active',
165 'name': 'person_id_remarks',
169 'name': 'person_id_passwd',
173 'name': 'person_id_owner_id',
177 'name': 'person_id_lang',
181 'name': 'person_id_no_reset_sent',
185 'name': 'person_id_action_type',
189 'name': 'person_id_project_id',
193 'name': 'person_id_deleted_by',
197 'name': 'person_id_deleted_dt',
204 xtype: 'PagingToolbar',
208 displayMsg : "Displaying core_watch{0} - {1} of {2}",
209 emptyMsg : "No core_watch found"
224 select : function (combo, record, index)
226 _this.grid.footer.onClick('first');
228 render : function (_self)
230 _this.affectSel = _self;
234 displayField : 'on_table',
236 emptyText : "Select Affects",
237 forceSelection : true,
239 loadingText : "Searching...",
243 qtip : "Select Action",
244 queryParam : 'query[on_table]',
245 selectOnFocus : true,
246 tpl : '<div class="x-grid-cell-text x-btn button"><b>{ontable}</b> </div>',
247 triggerAction : 'all',
249 valueField : 'action',
255 beforeload : function (_self, o)
257 o.params = o.params || {};
258 // staff can see all logs, other companies can only see their own.
259 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
260 o.params.company_id = Pman.Login.authUser.company_id;
262 o.params._distinct = 'ontable';
263 o.params._columns ='ontable';
267 sortInfo : { field : 'on_table' , direction : 'ASC' },
272 url : baseURL + '/Roo/Core_watch.php'
277 totalProperty : 'total',
286 'name': 'person_name',
290 'name': 'event_when',
292 'dateFormat': 'Y-m-d'
319 'name': 'person_id_id',
323 'name': 'person_id_office_id',
327 'name': 'person_id_name',
331 'name': 'person_id_phone',
335 'name': 'person_id_fax',
339 'name': 'person_id_email',
343 'name': 'person_id_company_id',
347 'name': 'person_id_role',
351 'name': 'person_id_active',
355 'name': 'person_id_remarks',
359 'name': 'person_id_passwd',
363 'name': 'person_id_owner_id',
367 'name': 'person_id_lang',
371 'name': 'person_id_no_reset_sent',
375 'name': 'person_id_action_type',
379 'name': 'person_id_project_id',
383 'name': 'person_id_deleted_by',
387 'name': 'person_id_deleted_dt',
402 cls : 'x-btn-text-icon',
403 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
407 if (!_this.dialog) return;
408 _this.dialog.show( { id : 0 } , function() {
409 _this.grid.footer.onClick('first');
418 cls : 'x-btn-text-icon',
419 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
423 var s = _this.grid.getSelectionModel().getSelections();
424 if (!s.length || (s.length > 1)) {
425 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
428 if (!_this.dialog) return;
429 _this.dialog.show(s[0].data, function() {
430 _this.grid.footer.onClick('first');
440 cls : 'x-btn-text-icon',
441 icon : rootURL + '/Pman/templates/images/trash.gif',
445 Pman.genericDelete(_this, 'core_watch');
453 xtype: 'ColumnModel',
456 header : 'Watch Event',
458 renderer : function(v) { return String.format('{0}', v); }
461 xtype: 'ColumnModel',
463 dataIndex : 'ontable',
464 header : 'Watch Table',
466 renderer : function(v) { return String.format('{0}', v); }
469 xtype: 'ColumnModel',
474 renderer : function(v) { return String.format('{0}', v); }
477 xtype: 'ColumnModel',
479 dataIndex : 'person_id_name',
480 header : 'Who get\'s notified',
482 renderer : function(v) { return String.format('{0}', v); }
485 xtype: 'ColumnModel',
487 dataIndex : 'medium',
488 header : 'What happens',
490 renderer : function(v) { return String.format('{0}', v); }
493 xtype: 'ColumnModel',
497 dataIndex : 'active',
498 renderer : function(v) { return String.format('{0}', v); }
503 this.layout = this.panel.layout;