Pman.Tab.MTrackTimeline.bjs
[Pman.MTrack] / Pman.Tab.MTrackTimeline.bjs
1 {
2     "id": "roo-file-245",
3     "name": "Pman.Tab.MTrackTimeline",
4     "parent": "Pman.Tab.DocumentsTab",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.MTrack/Pman.Tab.MTrackTimeline.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n    // navigation..\n    // a) record the fact we go here.. (for history)\n    \n    // when page loads, we have to go to this page..\n    \n    // at other times, we just check \n    //  a) project was the same as before... - do not change.\n    //  b) \n    _this.project = _this.project || 0;\n    \n    \n    if (typeof(MTrackWeb) != 'undefined' && !MTrackWeb.Layout) {\n        return;\n    }\n    \n    if (typeof(Pman.Tab.DocumentsTab) == 'undefined') {\n        return;\n    }\n    /*\n    if (!_this.iscroll) {  \n    \n        (function() {\n \n            try {\n                _this.iscroll = new Roo.ux.Iscroll(_this.tpanel.el.dom);\n            } catch(e) { \n                Roo.log(e);\n            }\n        }).defer(100);    \n\n    }\n    _this.iscroll = true;    \n    \n    */\n    var  chg_project =  (_this.project != Pman.Tab.DocumentsTab.panel.getProjectId());\n    \n   _this.project = Pman.Tab.DocumentsTab.panel.getProjectId();\n    \n   if (typeof(MTrackWeb) == 'undefined') {\n        return;\n    }\n    try { \n         window.history.pushState( { url: '/Timeline' }, 'Timeline' , baseURL +  '/Timeline' );\n    } catch (e) {}\n    \n    MTrack.currentURL = '/Timeline';\n    if (chg_project) {\n        (function() {\n            _this.grid.ds.load({});\n           //_this.tpanel.view.store.load({});\n        }).defer(100);\n    }\n   \n \n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToFrame": true,
15             "region": "center",
16             "title": "Project Timeline",
17             "xtype": "NestedLayoutPanel",
18             "|xns": "Roo",
19             "items": [
20                 {
21                     "|xns": "Roo",
22                     "xtype": "BorderLayout",
23                     "*prop": "layout",
24                     "items": [
25                         {
26                             "*prop": "center",
27                             "tabPosition": "top",
28                             "xtype": "LayoutRegion",
29                             "|xns": "Roo"
30                         },
31                         {
32                             "*prop": "west",
33                             "width": 250,
34                             "xtype": "LayoutRegion",
35                             "|xns": "Roo"
36                         },
37                         {
38                             "listeners": {
39                                 "activate": "function (_self)\n{\n    \n}",
40                                 "render": "function (_self)\n{\n    _this.commitpanel = _self;\n}"
41                             },
42                             "region": "center",
43                             "title": "Code Changes",
44                             "xtype": "ContentPanel",
45                             "|xns": "Roo",
46                             "items": [
47                                 {
48                                     "listeners": {
49                                         "preparedata": "function (_self, data, i, rec)\n{\n    Roo.apply(data, rec.json);\n}"
50                                     },
51                                     "*prop": "view",
52                                     "xtype": "View",
53                                     "|tpl": "new Roo.DomTemplate({url : rootURL +'/Pman/MTrack/domtemplates/dailychanges.html'})",
54                                     "|xns": "Roo",
55                                     "items": [
56                                         {
57                                             "listeners": {
58                                                 "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params._daychanges = _this.datePicker.activeDate.format(\"Y-m-d\");\n    var re = _this.repogrid.selModel.getSelected();\n    if (!re) {\n        return;\n    }\n    o.params.id = re.data.id;\n}"
59                                             },
60                                             "*prop": "store",
61                                             "xtype": "Store",
62                                             "|xns": "Roo.data",
63                                             "items": [
64                                                 {
65                                                     "*prop": "proxy",
66                                                     "method": "GET",
67                                                     "xtype": "HttpProxy",
68                                                     "|url": "baseURL + '/Roo/Mtrack_repos'",
69                                                     "|xns": "Roo.data"
70                                                 },
71                                                 {
72                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    'name'\n]",
73                                                     "*prop": "reader",
74                                                     "id": "id",
75                                                     "root": "data",
76                                                     "xtype": "JsonReader",
77                                                     "|xns": "Roo.data"
78                                                 }
79                                             ]
80                                         }
81                                     ]
82                                 }
83                             ]
84                         },
85                         {
86                             "listeners": {
87                                 "activate": "function (_self)\n{\n    _this.tpanel = _self;\n}"
88                             },
89                             "autoScroll": true,
90                             "background": true,
91                             "fitContainer": true,
92                             "fitToFrame": true,
93                             "region": "center",
94                             "title": "Timeline",
95                             "xtype": "ContentPanel",
96                             "|mload": "function(url) {\n\n  // can you actually link to this page..\n  // perhaps a specific day..\n\n    this._url = url;\n   // this._project = MTrack.projectCombo.getValue();\n   // MTrack.ajaxLoad(url, this);\n   _this.grid.ds.load({});\n    \n}\n",
97                             "|xns": "Roo",
98                             "items": [
99                                 {
100                                     "|xns": "Roo",
101                                     "xtype": "Toolbar",
102                                     "*prop": "toolbar",
103                                     "items": [
104                                         {
105                                             "text": "Select a date to refresh..",
106                                             "xtype": "Button",
107                                             "|xns": "Roo.Toolbar"
108                                         }
109                                     ]
110                                 },
111                                 {
112                                     "listeners": {
113                                         "beforeselect": "function (_self, node, selections)\n{\n   //Roo.log(node)\n   //Roo.log(this.indexOf(node));\n   var rec =  this.store.getAt(this.indexOf(node));\n   //Roo.log(data);\n   \n   new Pman.Request({\n         url : baseURL + '/Roo/mtrack_change',\n         method :'GET',\n         params : {\n            _id : rec.data.id,\n            _withdiff : 1\n        },\n        success : function (res) {\n        \n           //.. this.tpl.\n           //Roo.log( _this.tpanel.view.chgtmp.apply(res));\n            \n        \n        }\n    });\n   \n   \n   \n   \n}",
114                                         "beforeclick": "function (_self, index, node, e)\n{\n    Roo.log(node);\n    Roo.log(e);\n}"
115                                     },
116                                     "multiSelect": true,
117                                     "selectedClass": "change-log-item-expanded",
118                                     "singleSelect": false,
119                                     "toggleSelect": true,
120                                     "xtype": "View",
121                                     "|xns": "Roo",
122                                     "items": [
123                                         {
124                                             "*prop": "tpl",
125                                             "xtype": "XTemplate",
126                                             "|url": "rootURL + '/Pman/MTrack/templates/timeline.html'",
127                                             "|xns": "Roo"
128                                         },
129                                         {
130                                             "listeners": {
131                                                 "beforeload": "function (_self, o)\n{\n    o = o || {};\n    o.params = o.params || {};\n    \n    var sel = _this.grid.selModel.getSelected();\n    if (!sel) {\n        return false;\n    }\n    \n    \n    o.params.from_date =_this.datePicker.activeDate.format(\"Y-m-d\");\n    o.params.person_id = sel.data.person_id;\n   // o.params.viewtype = 'summary';    \n    o.params.timeline = 1;\n    // project?\n    o.params.project_id =  sel.data.project_id;\n    o.params.limit = 9999;\n}"
132                                             },
133                                             "*prop": "store",
134                                             "remoteSort": true,
135                                             "xtype": "Store",
136                                             "|sortInfo": "{ field : 'person_name', direction: 'ASC' }",
137                                             "|xns": "Roo.data",
138                                             "items": [
139                                                 {
140                                                     "*prop": "proxy",
141                                                     "method": "GET",
142                                                     "xtype": "HttpProxy",
143                                                     "|url": "baseURL + '/Roo/mtrack_change.php'",
144                                                     "|xns": "Roo.data"
145                                                 },
146                                                 {
147                                                     "*prop": "reader",
148                                                     "id": "id",
149                                                     "root": "data",
150                                                     "totalProperty": "total",
151                                                     "xtype": "JsonReader",
152                                                     "|fields": "[\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'changeday',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'nchanges',\n        'type': 'int'\n    },\n    'project_code',\n    'project_id',\n    \n\n]",
153                                                     "|xns": "Roo.data"
154                                                 }
155                                             ]
156                                         },
157                                         {
158                                             "*prop": "chgtpl",
159                                             "xtype": "XTemplate",
160                                             "|url": "rootURL + '/Pman/MTrack/templates/timeline-changelog.html'",
161                                             "|xns": "Roo"
162                                         }
163                                     ]
164                                 }
165                             ]
166                         },
167                         {
168                             "region": "west",
169                             "xtype": "NestedLayoutPanel",
170                             "|xns": "Roo",
171                             "items": [
172                                 {
173                                     "|xns": "Roo",
174                                     "xtype": "BorderLayout",
175                                     "*prop": "layout",
176                                     "items": [
177                                         {
178                                             "*prop": "center",
179                                             "xtype": "LayoutRegion",
180                                             "|xns": "Roo"
181                                         },
182                                         {
183                                             "*prop": "north",
184                                             "height": 220,
185                                             "xtype": "LayoutRegion",
186                                             "|xns": "Roo"
187                                         },
188                                         {
189                                             "listeners": {
190                                                 "|activate": "function() {\n    _this.gridpanel = this;\n\n}"
191                                             },
192                                             "autoScroll": true,
193                                             "background": false,
194                                             "fitContainer": true,
195                                             "fitToframe": true,
196                                             "region": "center",
197                                             "tableName": "Events",
198                                             "title": "Events",
199                                             "xtype": "GridPanel",
200                                             "|xns": "Roo",
201                                             "items": [
202                                                 {
203                                                     "listeners": {
204                                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n       this.dataSource.load({});\n\n}"
205                                                     },
206                                                     "*prop": "grid",
207                                                     "autoExpandColumn": "person_id_name",
208                                                     "loadMask": true,
209                                                     "xtype": "Grid",
210                                                     "|xns": "Roo.grid",
211                                                     "items": [
212                                                         {
213                                                             "listeners": {
214                                                                 "afterselectionchange": "function (_self)\n{\n  // select the data..\n  \n  var r= _this.grid.sm.getSelected();\n  \n  \n  //_this.datePicker.setValue(r.data.changeday);\n  //\n   _this.cpanel.view.store.load({});\n  // _this.tpanel.view.store.load({});\n   \n}                                                                   "
215                                                             },
216                                                             "*prop": "sm",
217                                                             "singleSelect": true,
218                                                             "xtype": "RowSelectionModel",
219                                                             "|xns": "Roo.grid"
220                                                         },
221                                                         {
222                                                             "listeners": {
223                                                                 "beforeload": "function (_self, o)\n{\n    o = o || {};\n    o.params = o.params || {};\n    \n    if (!_this.datePicker || !_this.datePicker.getValue) {\n        return false;\n    }\n    o.params.on_date = _this.datePicker.activeDate.format(\"Y-m-d\");\n    o.params.viewtype = 'summary';    \n    o.params.timeline = 1;\n    // project?\n    o.params.project_id =  Pman.Tab.DocumentsTab ? \n                Pman.Tab.DocumentsTab.panel.getProjectId() : 0;\n}"
224                                                             },
225                                                             "*prop": "dataSource",
226                                                             "remoteSort": true,
227                                                             "xtype": "Store",
228                                                             "|sortInfo": "{ field : 'person_name', direction: 'ASC' }",
229                                                             "|xns": "Roo.data",
230                                                             "items": [
231                                                                 {
232                                                                     "*prop": "proxy",
233                                                                     "method": "GET",
234                                                                     "xtype": "HttpProxy",
235                                                                     "|url": "baseURL + '/Roo/mtrack_change.php'",
236                                                                     "|xns": "Roo.data"
237                                                                 },
238                                                                 {
239                                                                     "*prop": "reader",
240                                                                     "id": "id",
241                                                                     "root": "data",
242                                                                     "totalProperty": "total",
243                                                                     "xtype": "JsonReader",
244                                                                     "|fields": "[\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'changeday',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'nchanges',\n        'type': 'int'\n    },\n    'project_code',\n    'project_id',\n    \n\n]",
245                                                                     "|xns": "Roo.data"
246                                                                 }
247                                                             ]
248                                                         },
249                                                         {
250                                                             "*prop": "colModel[]",
251                                                             "dataIndex": "repo_name",
252                                                             "header": "Repos",
253                                                             "width": 30,
254                                                             "xtype": "ColumnModel",
255                                                             "|renderer": "function(v,x,r) { \n\n    return String.format('{0}',  v  ? v : '' );\n }",
256                                                             "|xns": "Roo.grid"
257                                                         },
258                                                         {
259                                                             "*prop": "colModel[]",
260                                                             "dataIndex": "project_code",
261                                                             "header": "Project",
262                                                             "width": 50,
263                                                             "xtype": "ColumnModel",
264                                                             "|renderer": "function(v,x,r) { \n    \n    Roo.log(r);\n    return String.format( '{0}' ,v );\n }\n ",
265                                                             "|xns": "Roo.grid"
266                                                         },
267                                                         {
268                                                             "*prop": "colModel[]",
269                                                             "dataIndex": "person_name",
270                                                             "header": "Who",
271                                                             "width": 100,
272                                                             "xtype": "ColumnModel",
273                                                             "|renderer": "function(v,x,r) { \n    \n    return String.format( '{0}' , v);\n }\n ",
274                                                             "|xns": "Roo.grid"
275                                                         },
276                                                         {
277                                                             "*prop": "colModel[]",
278                                                             "align": "right",
279                                                             "dataIndex": "nchanges",
280                                                             "header": "Changes",
281                                                             "width": 30,
282                                                             "xtype": "ColumnModel",
283                                                             "|renderer": "function(v,x,r) { \n    return v * 1;\n }\n ",
284                                                             "|xns": "Roo.grid"
285                                                         }
286                                                     ]
287                                                 }
288                                             ]
289                                         },
290                                         {
291                                             "region": "north",
292                                             "xtype": "ContentPanel",
293                                             "|xns": "Roo",
294                                             "items": [
295                                                 {
296                                                     "listeners": {
297                                                         "render": "function (_self)\n{\n  _this.datePicker = _self;\n}",
298                                                         "select": "function (_self, date)\n{\n    if (! _this.grid) {\n        return;\n    }\n    _this.grid.ds.load({});\n}",
299                                                         "monthchange": "function (_self, date)\n{\n   \n}"
300                                                     },
301                                                     "xtype": "DatePicker",
302                                                     "|xns": "Roo"
303                                                 }
304                                             ]
305                                         }
306                                     ]
307                                 }
308                             ]
309                         }
310                     ]
311                 }
312             ]
313         }
314     ],
315     "permname": "",
316     "modOrder": "300"
317 }