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 part : ["Admin","Watches"],
12 modKey : '860-Pman.Tab.AdminWatches',
13 module : Pman.Tab.AdminWatches,
15 parent : Pman.Tab.AdminWatchNotify,
16 name : "Pman.Tab.AdminWatches",
22 Pman.Tab.AdminWatches = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
38 activate : function() {
41 _this.grid.footer.onClick('first');
50 tableName : 'core_watch',
59 _this.dialog = Pman.Dialog.AdminWatch;
60 if (_this.panel.active) {
61 this.footer.onClick('first');
64 rowdblclick : function (_self, rowIndex, e)
66 if (!_this.dialog) return;
67 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
68 _this.grid.footer.onClick('first');
72 autoExpandColumn : 'person_id_name',
78 beforeload : function (_self, options)
80 var val = _this.affectSel.getValue();
82 options.params.ontable = val;
88 sortInfo : { field : 'ontable', direction: 'ASC' },
93 url : baseURL + '/Roo/core_watch.php'
98 totalProperty : 'total',
131 'name': 'person_id_id',
135 'name': 'person_id_office_id',
139 'name': 'person_id_name',
143 'name': 'person_id_phone',
147 'name': 'person_id_fax',
151 'name': 'person_id_email',
155 'name': 'person_id_company_id',
159 'name': 'person_id_role',
163 'name': 'person_id_active',
167 'name': 'person_id_remarks',
171 'name': 'person_id_passwd',
175 'name': 'person_id_owner_id',
179 'name': 'person_id_lang',
183 'name': 'person_id_no_reset_sent',
187 'name': 'person_id_action_type',
191 'name': 'person_id_project_id',
195 'name': 'person_id_deleted_by',
199 'name': 'person_id_deleted_dt',
206 xtype: 'PagingToolbar',
210 displayMsg : "Displaying core_watch{0} - {1} of {2}",
211 emptyMsg : "No core_watch found"
226 select : function (combo, record, index)
228 _this.grid.footer.onClick('first');
230 render : function (_self)
232 _this.affectSel = _self;
236 displayField : 'on_table',
238 emptyText : "Select Table",
239 forceSelection : true,
241 loadingText : "Searching...",
245 qtip : "Select Action",
246 queryParam : 'query[ontable]',
247 selectOnFocus : true,
248 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
249 triggerAction : 'all',
251 valueField : 'on_table',
257 beforeload : function (_self, o)
259 o.params = o.params || {};
260 // staff can see all logs, other companies can only see their own.
261 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
262 o.params.company_id = Pman.Login.authUser.company_id;
264 o.params._distinct = 'on_table';
265 o.params._columns ='on_table';
269 sortInfo : { field : 'on_table' , direction : 'ASC' },
274 url : baseURL + '/Roo/Events.php'
281 totalProperty : 'total',
304 cls : 'x-btn-text-icon',
305 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
309 if (!_this.dialog) return;
310 _this.dialog.show( { id : 0 } , function() {
311 _this.grid.footer.onClick('first');
320 cls : 'x-btn-text-icon',
321 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
325 var s = _this.grid.getSelectionModel().getSelections();
326 if (!s.length || (s.length > 1)) {
327 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
330 if (!_this.dialog) return;
331 _this.dialog.show(s[0].data, function() {
332 _this.grid.footer.onClick('first');
342 cls : 'x-btn-text-icon',
343 icon : rootURL + '/Pman/templates/images/trash.gif',
347 Pman.genericDelete(_this, 'core_watch');
355 xtype: 'ColumnModel',
358 header : 'Watch Event',
360 renderer : function(v) { return String.format('{0}', v); }
363 xtype: 'ColumnModel',
365 dataIndex : 'ontable',
366 header : 'Watch Table',
368 renderer : function(v) { return String.format('{0}', v); }
371 xtype: 'ColumnModel',
376 renderer : function(v) { return String.format('{0}', v); }
379 xtype: 'ColumnModel',
381 dataIndex : 'person_id_name',
382 header : 'Who get\'s notified',
384 renderer : function(v) { return String.format('{0}', v); }
387 xtype: 'ColumnModel',
389 dataIndex : 'medium',
390 header : 'What happens',
392 renderer : function(v) { return String.format('{0}', v); }
395 xtype: 'ColumnModel',
399 dataIndex : 'active',
400 renderer : function(v) { return String.format('{0}', v); }
405 this.layout = this.panel.layout;