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 sortInfo : { field : 'ontable', direction: 'ASC' },
81 url : baseURL + '/Roo/core_watch.php'
86 totalProperty : 'total',
119 'name': 'person_id_id',
123 'name': 'person_id_office_id',
127 'name': 'person_id_name',
131 'name': 'person_id_phone',
135 'name': 'person_id_fax',
139 'name': 'person_id_email',
143 'name': 'person_id_company_id',
147 'name': 'person_id_role',
151 'name': 'person_id_active',
155 'name': 'person_id_remarks',
159 'name': 'person_id_passwd',
163 'name': 'person_id_owner_id',
167 'name': 'person_id_lang',
171 'name': 'person_id_no_reset_sent',
175 'name': 'person_id_action_type',
179 'name': 'person_id_project_id',
183 'name': 'person_id_deleted_by',
187 'name': 'person_id_deleted_dt',
194 xtype: 'PagingToolbar',
198 displayMsg : "Displaying core_watch{0} - {1} of {2}",
199 emptyMsg : "No core_watch found"
214 select : function (combo, record, index)
216 _this.grid.footer.onClick('first');
218 render : function (_self)
220 _this.affectSel = _self;
224 displayField : 'on_table',
226 emptyText : "Select Affects",
227 forceSelection : true,
229 loadingText : "Searching...",
233 qtip : "Select Action",
234 queryParam : 'query[on_table]',
235 selectOnFocus : true,
236 tpl : '<div class="x-grid-cell-text x-btn button"><b>{ontable}</b> </div>',
237 triggerAction : 'all',
239 valueField : 'action',
245 beforeload : function (_self, o)
247 o.params = o.params || {};
248 // staff can see all logs, other companies can only see their own.
249 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
250 o.params.company_id = Pman.Login.authUser.company_id;
252 o.params._distinct = 'on_table';
253 o.params._columns ='on_table';
257 sortInfo : { field : 'on_table' , direction : 'ASC' },
262 url : baseURL + '/Roo/Core_watch.php'
267 totalProperty : 'total',
276 'name': 'person_name',
280 'name': 'event_when',
282 'dateFormat': 'Y-m-d'
309 'name': 'person_id_id',
313 'name': 'person_id_office_id',
317 'name': 'person_id_name',
321 'name': 'person_id_phone',
325 'name': 'person_id_fax',
329 'name': 'person_id_email',
333 'name': 'person_id_company_id',
337 'name': 'person_id_role',
341 'name': 'person_id_active',
345 'name': 'person_id_remarks',
349 'name': 'person_id_passwd',
353 'name': 'person_id_owner_id',
357 'name': 'person_id_lang',
361 'name': 'person_id_no_reset_sent',
365 'name': 'person_id_action_type',
369 'name': 'person_id_project_id',
373 'name': 'person_id_deleted_by',
377 'name': 'person_id_deleted_dt',
392 cls : 'x-btn-text-icon',
393 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
397 if (!_this.dialog) return;
398 _this.dialog.show( { id : 0 } , function() {
399 _this.grid.footer.onClick('first');
408 cls : 'x-btn-text-icon',
409 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
413 var s = _this.grid.getSelectionModel().getSelections();
414 if (!s.length || (s.length > 1)) {
415 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
418 if (!_this.dialog) return;
419 _this.dialog.show(s[0].data, function() {
420 _this.grid.footer.onClick('first');
430 cls : 'x-btn-text-icon',
431 icon : rootURL + '/Pman/templates/images/trash.gif',
435 Pman.genericDelete(_this, 'core_watch');
443 xtype: 'ColumnModel',
446 header : 'Watch Event',
448 renderer : function(v) { return String.format('{0}', v); }
451 xtype: 'ColumnModel',
453 dataIndex : 'ontable',
454 header : 'Watch Table',
456 renderer : function(v) { return String.format('{0}', v); }
459 xtype: 'ColumnModel',
464 renderer : function(v) { return String.format('{0}', v); }
467 xtype: 'ColumnModel',
469 dataIndex : 'person_id_name',
470 header : 'Who get\'s notified',
472 renderer : function(v) { return String.format('{0}', v); }
475 xtype: 'ColumnModel',
477 dataIndex : 'medium',
478 header : 'What happens',
480 renderer : function(v) { return String.format('{0}', v); }
483 xtype: 'ColumnModel',
487 dataIndex : 'active',
488 renderer : function(v) { return String.format('{0}', v); }
493 this.layout = this.panel.layout;