1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.MTrackTimeline = new Roo.XComponent({
6 part : ["MTrack","Timeline"],
7 order : '300-Pman.Tab.MTrackTimeline',
9 parent : 'Pman.Tab.DocumentsTab',
10 name : "unnamed module",
18 xtype: 'NestedLayoutPanel',
21 activate : function (_self)
24 // a) record the fact we go here.. (for history)
26 // when page loads, we have to go to this page..
28 // at other times, we just check
29 // a) project was the same as before... - do not change.
31 _this.project = _this.project || 0;
34 if (typeof(MTrackWeb) != 'undefined' && !MTrackWeb.Layout) {
43 _this.iscroll = new Roo.ux.Iscroll(_this.tpanel.el.dom);
53 var chg_project = (_this.project != Pman.Tab.DocumentsTab.panel.getProjectId());
55 _this.project = Pman.Tab.DocumentsTab.panel.getProjectId();
60 if (typeof(MTrackWeb) == 'undefined') {
64 window.history.pushState( { url: '/Timeline' }, 'Timeline' , baseURL + '/Timeline' );
67 MTrack.currentURL = '/Timeline';
70 _this.grid.ds.load({});
71 //_this.tpanel.view.store.load({});
82 title : "Project Timeline",
84 xtype: 'BorderLayout',
88 xtype: 'ContentPanel',
91 activate : function (_self)
102 mload : function(url) {
104 // can you actually link to this page..
105 // perhaps a specific day..
108 this._project = MTrack.projectCombo.getValue();
109 // MTrack.ajaxLoad(url, this);
110 _this.grid.ds.load({});
122 beforeload : function (_self, o)
125 if (!_this.datePicker) {return false; }
127 o.params = o.params || {};
129 o.params.ajax_body = 1;
130 o.params.from_date = _this.datePicker.getValue().format('Y-m-d');
132 load : function (_self, records, options)
134 Roo.log('store - load');
142 totalProperty : 'total',
155 'dateFormat': 'Y-m-d'
168 url : baseURL + '/Timeline'
180 text : "Select a date to refresh.."
186 xtype: 'NestedLayoutPanel',
190 xtype: 'BorderLayout',
197 activate : function() {
198 _this.gridpanel = this;
207 tableName : 'Events',
216 //_this.dialog = Pman.Dialog.FILL_IN
217 this.dataSource.load({});
221 autoExpandColumn : 'person_id_name',
224 xtype: 'RowSelectionModel',
227 afterselectionchange : function (_self)
231 var r= _this.grid.sm.getSelected();
234 _this.datePicker.setValue(r.data.changeday);
235 _this.tpanel.view.store.load({});
244 beforeload : function (_self, o)
247 o.params = o.params || {};
249 if (!_this.datePicker || !_this.datePicker.getValue) {
252 o.params.from_date = _this.datePicker.activeDate.format("Y-m-01");
253 o.params.viewtype = 'summary';
254 o.params.timeline = 1;
256 o.params.project = Pman.Tab.DocumentsTab.panel.getProjectId();
260 sortInfo : { field : 'person_name', direction: 'ASC' },
265 url : baseURL + '/Roo/Mtrack_change.php'
272 totalProperty : 'total',
285 'dateFormat': 'Y-m-d'
300 xtype: 'ColumnModel',
302 dataIndex : 'changeday',
305 renderer : function(v,x,r) {
307 return String.format('{0}', v ? v.format('d') : '' );
311 xtype: 'ColumnModel',
313 dataIndex : 'project_code',
316 renderer : function(v,x,r) {
319 return String.format( '{0}' ,v );
323 xtype: 'ColumnModel',
325 dataIndex : 'person_name',
328 renderer : function(v,x,r) {
330 return String.format( '{0}' , v);
334 xtype: 'ColumnModel',
337 dataIndex : 'nchanges',
340 renderer : function(v,x,r) {
348 xtype: 'ContentPanel',
356 render : function (_self)
358 _this.datePicker = _self;
360 select : function (_self, date)
362 if (_this.tpanel.view.store) {
365 _this.tpanel.view.store.load({});
367 monthchange : function (_self, date)
370 _this.grid.ds.load({ });
379 xtype: 'LayoutRegion',
383 xtype: 'LayoutRegion',
391 xtype: 'LayoutRegion',
396 xtype: 'LayoutRegion',