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 : rootURL + '/Pman/templates/images/trash.gif',
214 Pman.genericDelete(_this, 'core_watch');
227 select : function (combo, record, index)
229 _this.grid.footer.onClick('first');
231 render : function (_self)
233 _this.affectSel = _self;
237 displayField : 'on_table',
239 emptyText : "Select Affects",
240 forceSelection : true,
242 loadingText : "Searching...",
246 qtip : "Select Action",
247 queryParam : 'query[on_table]',
248 selectOnFocus : true,
249 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
250 triggerAction : 'all',
252 valueField : 'action',
258 beforeload : function (_self, o)
260 o.params = o.params || {};
261 // staff can see all logs, other companies can only see their own.
262 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
263 o.params.company_id = Pman.Login.authUser.company_id;
265 o.params._distinct = 'on_table';
266 o.params._columns ='on_table';
270 sortInfo : { field : 'on_table' , direction : 'ASC' },
275 url : baseURL + '/Roo/Core_watch.php'
280 totalProperty : 'total',
289 'name': 'person_name',
293 'name': 'event_when',
295 'dateFormat': 'Y-m-d'
322 'name': 'person_id_id',
326 'name': 'person_id_office_id',
330 'name': 'person_id_name',
334 'name': 'person_id_phone',
338 'name': 'person_id_fax',
342 'name': 'person_id_email',
346 'name': 'person_id_company_id',
350 'name': 'person_id_role',
354 'name': 'person_id_active',
358 'name': 'person_id_remarks',
362 'name': 'person_id_passwd',
366 'name': 'person_id_owner_id',
370 'name': 'person_id_lang',
374 'name': 'person_id_no_reset_sent',
378 'name': 'person_id_action_type',
382 'name': 'person_id_project_id',
386 'name': 'person_id_deleted_by',
390 'name': 'person_id_deleted_dt',
405 cls : 'x-btn-text-icon',
406 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
410 if (!_this.dialog) return;
411 _this.dialog.show( { id : 0 } , function() {
412 _this.grid.footer.onClick('first');
421 cls : 'x-btn-text-icon',
422 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
426 var s = _this.grid.getSelectionModel().getSelections();
427 if (!s.length || (s.length > 1)) {
428 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
431 if (!_this.dialog) return;
432 _this.dialog.show(s[0].data, function() {
433 _this.grid.footer.onClick('first');
443 cls : 'x-btn-text-icon',
444 icon : rootURL + '/Pman/templates/images/trash.gif',
448 Pman.genericDelete(_this, 'core_watch');
456 xtype: 'ColumnModel',
459 header : 'Watch Event',
461 renderer : function(v) { return String.format('{0}', v); }
464 xtype: 'ColumnModel',
466 dataIndex : 'ontable',
467 header : 'Watch Table',
469 renderer : function(v) { return String.format('{0}', v); }
472 xtype: 'ColumnModel',
477 renderer : function(v) { return String.format('{0}', v); }
480 xtype: 'ColumnModel',
482 dataIndex : 'person_id_name',
483 header : 'Who get\'s notified',
485 renderer : function(v) { return String.format('{0}', v); }
488 xtype: 'ColumnModel',
490 dataIndex : 'medium',
491 header : 'What happens',
493 renderer : function(v) { return String.format('{0}', v); }
496 xtype: 'ColumnModel',
500 dataIndex : 'active',
501 renderer : function(v) { return String.format('{0}', v); }
506 this.layout = this.panel.layout;