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 : 'ontable',
236 emptyText : "Select Table",
237 forceSelection : true,
239 loadingText : "Searching...",
243 qtip : "Select Action",
244 queryParam : 'query[ontable]',
245 selectOnFocus : true,
246 tpl : '<div class="x-grid-cell-text x-btn button"><b>{ontable}</b> </div>',
247 triggerAction : 'all',
249 valueField : 'ontable',
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 : 'ontable' , direction : 'ASC' },
272 url : baseURL + '/Roo/Core_watch.php'
279 totalProperty : 'total',
302 cls : 'x-btn-text-icon',
303 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
307 if (!_this.dialog) return;
308 _this.dialog.show( { id : 0 } , function() {
309 _this.grid.footer.onClick('first');
318 cls : 'x-btn-text-icon',
319 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
323 var s = _this.grid.getSelectionModel().getSelections();
324 if (!s.length || (s.length > 1)) {
325 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
328 if (!_this.dialog) return;
329 _this.dialog.show(s[0].data, function() {
330 _this.grid.footer.onClick('first');
340 cls : 'x-btn-text-icon',
341 icon : rootURL + '/Pman/templates/images/trash.gif',
345 Pman.genericDelete(_this, 'core_watch');
353 xtype: 'ColumnModel',
356 header : 'Watch Event',
358 renderer : function(v) { return String.format('{0}', v); }
361 xtype: 'ColumnModel',
363 dataIndex : 'ontable',
364 header : 'Watch Table',
366 renderer : function(v) { return String.format('{0}', v); }
369 xtype: 'ColumnModel',
374 renderer : function(v) { return String.format('{0}', v); }
377 xtype: 'ColumnModel',
379 dataIndex : 'person_id_name',
380 header : 'Who get\'s notified',
382 renderer : function(v) { return String.format('{0}', v); }
385 xtype: 'ColumnModel',
387 dataIndex : 'medium',
388 header : 'What happens',
390 renderer : function(v) { return String.format('{0}', v); }
393 xtype: 'ColumnModel',
397 dataIndex : 'active',
398 renderer : function(v) { return String.format('{0}', v); }
403 this.layout = this.panel.layout;