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) {
38 if (typeof(Pman.Tab.DocumentsTab) == 'undefined') {
47 _this.iscroll = new Roo.ux.Iscroll(_this.tpanel.el.dom);
57 var chg_project = (_this.project != Pman.Tab.DocumentsTab.panel.getProjectId());
59 _this.project = Pman.Tab.DocumentsTab.panel.getProjectId();
61 if (typeof(MTrackWeb) == 'undefined') {
65 window.history.pushState( { url: '/Timeline' }, 'Timeline' , baseURL + '/Timeline' );
68 MTrack.currentURL = '/Timeline';
71 _this.grid.ds.load({});
72 //_this.tpanel.view.store.load({});
83 title : "Project Timeline",
85 xtype: 'BorderLayout',
89 xtype: 'ContentPanel',
92 activate : function (_self)
98 title : "Code Changes",
103 preparedata : function (_self, data, i, rec)
105 Roo.apply(data, rec.json);
108 tpl : new Roo.DomTemplate({url : rootURL +'/Pman/MTrack/domtemplates/dailychanges.html'}),
113 beforeload : function (_self, o)
115 o.params = o.params || {};
116 o.params._daychanges = _this.dateField.getValue().format('Y-m-d') ;
117 var re = _this.repogrid.selModel.getSelected();
121 o.params.id = re.data.id;
128 url : baseURL + '/Roo/Mtrack_repos'
147 xtype: 'ContentPanel',
150 activate : function (_self)
152 _this.tpanel = _self;
161 mload : function(url) {
163 // can you actually link to this page..
164 // perhaps a specific day..
167 // this._project = MTrack.projectCombo.getValue();
168 // MTrack.ajaxLoad(url, this);
169 _this.grid.ds.load({});
177 beforeselect : function (_self, node, selections)
180 //Roo.log(this.indexOf(node));
181 var rec = this.store.getAt(this.indexOf(node));
185 url : baseURL + '/Roo/mtrack_change',
191 success : function (res) {
194 //Roo.log( _this.tpanel.view.chgtmp.apply(res));
204 beforeclick : function (_self, index, node, e)
211 selectedClass : 'change-log-item-expanded',
212 singleSelect : false,
217 url : rootURL + '/Pman/MTrack/templates/timeline.html'
223 beforeload : function (_self, o)
226 o.params = o.params || {};
228 var sel = _this.grid.selModel.getSelected();
234 o.params.from_date =_this.datePicker.activeDate.format("Y-m-d");
235 o.params.person_id = sel.data.person_id;
236 // o.params.viewtype = 'summary';
237 o.params.timeline = 1;
239 o.params.project_id = sel.data.project_id;
240 o.params.limit = 9999;
244 sortInfo : { field : 'person_name', direction: 'ASC' },
249 url : baseURL + '/Roo/mtrack_change.php'
256 totalProperty : 'total',
263 'name': 'person_name',
269 'dateFormat': 'Y-m-d'
285 url : rootURL + '/Pman/MTrack/templates/timeline-changelog.html'
296 text : "Select a date to refresh.."
302 xtype: 'NestedLayoutPanel',
306 xtype: 'BorderLayout',
313 activate : function() {
314 _this.gridpanel = this;
323 tableName : 'Events',
332 //_this.dialog = Pman.Dialog.FILL_IN
333 this.dataSource.load({});
337 autoExpandColumn : 'person_id_name',
340 xtype: 'RowSelectionModel',
343 afterselectionchange : function (_self)
347 var r= _this.grid.sm.getSelected();
350 _this.datePicker.setValue(r.data.changeday);
351 _this.tpanel.view.store.load({});
361 beforeload : function (_self, o)
364 o.params = o.params || {};
366 if (!_this.datePicker || !_this.datePicker.getValue) {
369 o.params.on_date = _this.datePicker.activeDate.format("Y-m-d");
370 o.params.viewtype = 'summary';
371 o.params.timeline = 1;
373 o.params.project_id = Pman.Tab.DocumentsTab ?
374 Pman.Tab.DocumentsTab.panel.getProjectId() : 0;
378 sortInfo : { field : 'person_name', direction: 'ASC' },
383 url : baseURL + '/Roo/mtrack_change.php'
390 totalProperty : 'total',
397 'name': 'person_name',
403 'dateFormat': 'Y-m-d'
418 xtype: 'ColumnModel',
420 dataIndex : 'changeday',
423 renderer : function(v,x,r) {
425 return String.format('{0}', v ? v.format('d') : '' );
429 xtype: 'ColumnModel',
431 dataIndex : 'project_code',
434 renderer : function(v,x,r) {
437 return String.format( '{0}' ,v );
441 xtype: 'ColumnModel',
443 dataIndex : 'person_name',
446 renderer : function(v,x,r) {
448 return String.format( '{0}' , v);
452 xtype: 'ColumnModel',
455 dataIndex : 'nchanges',
458 renderer : function(v,x,r) {
466 xtype: 'ContentPanel',
474 render : function (_self)
476 _this.datePicker = _self;
478 select : function (_self, date)
483 _this.grid.ds.load({});
485 monthchange : function (_self, date)
495 xtype: 'LayoutRegion',
499 xtype: 'LayoutRegion',
507 xtype: 'LayoutRegion',
512 xtype: 'LayoutRegion',