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"
209 cls : 'x-btn-text-icon',
210 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
214 if (!_this.dialog) return;
215 _this.dialog.show( { id : 0 } , function() {
216 _this.grid.footer.onClick('first');
225 cls : 'x-btn-text-icon',
226 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
230 var s = _this.grid.getSelectionModel().getSelections();
231 if (!s.length || (s.length > 1)) {
232 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
235 if (!_this.dialog) return;
236 _this.dialog.show(s[0].data, function() {
237 _this.grid.footer.onClick('first');
247 cls : 'x-btn-text-icon',
248 icon : rootURL + '/Pman/templates/images/trash.gif',
252 Pman.genericDelete(_this, 'core_watch');
265 select : function (combo, record, index)
267 _this.grid.footer.onClick('first');
269 render : function (_self)
271 _this.affectSel = _self;
275 displayField : 'on_table',
277 emptyText : "Select Affects",
278 forceSelection : true,
280 loadingText : "Searching...",
284 qtip : "Select Action",
285 queryParam : 'query[on_table]',
286 selectOnFocus : true,
287 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
288 triggerAction : 'all',
290 valueField : 'action',
296 beforeload : function (_self, o)
298 o.params = o.params || {};
299 // staff can see all logs, other companies can only see their own.
300 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
301 o.params.company_id = Pman.Login.authUser.company_id;
303 o.params._distinct = 'on_table';
304 o.params._columns ='on_table';
308 sortInfo : { field : 'on_table' , direction : 'ASC' },
313 url : baseURL + '/Roo/Core_watch.php'
318 totalProperty : 'total',
327 'name': 'person_name',
331 'name': 'event_when',
333 'dateFormat': 'Y-m-d'
360 'name': 'person_id_id',
364 'name': 'person_id_office_id',
368 'name': 'person_id_name',
372 'name': 'person_id_phone',
376 'name': 'person_id_fax',
380 'name': 'person_id_email',
384 'name': 'person_id_company_id',
388 'name': 'person_id_role',
392 'name': 'person_id_active',
396 'name': 'person_id_remarks',
400 'name': 'person_id_passwd',
404 'name': 'person_id_owner_id',
408 'name': 'person_id_lang',
412 'name': 'person_id_no_reset_sent',
416 'name': 'person_id_action_type',
420 'name': 'person_id_project_id',
424 'name': 'person_id_deleted_by',
428 'name': 'person_id_deleted_dt',
443 cls : 'x-btn-text-icon',
444 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
448 if (!_this.dialog) return;
449 _this.dialog.show( { id : 0 } , function() {
450 _this.grid.footer.onClick('first');
459 xtype: 'ColumnModel',
462 header : 'Watch Event',
464 renderer : function(v) { return String.format('{0}', v); }
467 xtype: 'ColumnModel',
469 dataIndex : 'ontable',
470 header : 'Watch Table',
472 renderer : function(v) { return String.format('{0}', v); }
475 xtype: 'ColumnModel',
480 renderer : function(v) { return String.format('{0}', v); }
483 xtype: 'ColumnModel',
485 dataIndex : 'person_id_name',
486 header : 'Who get\'s notified',
488 renderer : function(v) { return String.format('{0}', v); }
491 xtype: 'ColumnModel',
493 dataIndex : 'medium',
494 header : 'What happens',
496 renderer : function(v) { return String.format('{0}', v); }
499 xtype: 'ColumnModel',
503 dataIndex : 'active',
504 renderer : function(v) { return String.format('{0}', v); }
509 this.layout = this.panel.layout;