cbt 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +221 -0
- data/ROADMAP +33 -0
- data/Rakefile +3 -0
- data/bin/cbt +130 -0
- data/cbt.gemspec +19 -0
- data/config/components.yml +20 -0
- data/config/members.yml +16 -0
- data/docs/css/jsgantt.css +53 -0
- data/docs/gantt.html +330 -0
- data/docs/js/jsgantt.js +1681 -0
- data/examples/config/components.yml +19 -0
- data/lib/cbt.rb +13 -0
- data/lib/cbt/app.rb +93 -0
- data/lib/cbt/checkout.rb +155 -0
- data/lib/cbt/cleanup.rb +7 -0
- data/lib/cbt/component.rb +91 -0
- data/lib/cbt/creator.rb +75 -0
- data/lib/cbt/diagram.rb +50 -0
- data/lib/cbt/digester.rb +59 -0
- data/lib/cbt/girc.rb +169 -0
- data/lib/cbt/version.rb +3 -0
- data/lib/luobo/cbt.rb +25 -0
- data/lib/luobo/lua.rb +3 -0
- data/lib/luobo/settings.rb +4 -0
- data/lib/luobo/spec.rb +4 -0
- data/spec/app_spec.rb +49 -0
- data/spec/creator_spec.rb +39 -0
- data/spec/digester_spec.rb +55 -0
- data/spec/spec_helper.rb +8 -0
- data/templates/Class.lua.erb +18 -0
- data/templates/Class.mock.lua.erb +20 -0
- data/templates/Class_with_super.lua.erb +22 -0
- data/templates/Class_with_super.mock.lua.erb +23 -0
- data/templates/main.lua.erb +2 -0
- data/templates/part.lua.erb +9 -0
- data/templates/part.mock.lua.erb +11 -0
- data/templates/part_with_super.lua.erb +13 -0
- data/templates/part_with_super.mock.lua.erb +13 -0
- data/templates/spec.lua.erb +3 -0
- metadata +143 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
|
2
|
+
// These are the class/styles used by various objects in GanttChart. However, Firefox has problems deciphering class style when DIVs are embedded in other DIVs.
|
3
|
+
|
4
|
+
// GanttChart makes heavy use of embedded DIVS, thus the style are often embedded directly in the objects html. If this could be resolved with Firefox, it would
|
5
|
+
|
6
|
+
// make alot of the code look simpleer/cleaner without all the embedded styles
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
..gantt { font-family:tahoma, arial, verdana; font-size:10px;}
|
11
|
+
|
12
|
+
..gdatehead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; HEIGHT: 18px }
|
13
|
+
|
14
|
+
..ghead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px }
|
15
|
+
|
16
|
+
..gname { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; WIDTH: 18px; HEIGHT: 18px }
|
17
|
+
|
18
|
+
..ghead A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
|
19
|
+
|
20
|
+
..gheadwkend A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
|
21
|
+
|
22
|
+
..gheadwkend { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px; background-color: #cfcfcf }
|
23
|
+
|
24
|
+
..gfiller { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px }
|
25
|
+
|
26
|
+
..gfillerwkend { BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px; BACKGROUND-COLOR: #cfcfcf }
|
27
|
+
|
28
|
+
..gitem { BORDER-TOP: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
|
29
|
+
|
30
|
+
..gitemwkend { BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
|
31
|
+
|
32
|
+
..gmilestone { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 14px; OVERFLOW: hidden; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px}
|
33
|
+
|
34
|
+
..gmilestonewkend { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px}
|
35
|
+
|
36
|
+
..btn { BORDER-RIGHT: #ffffff; BORDER-TOP: #ffffff; FONT-WEIGHT: bold; FONT-SIZE: 10px; BORDER-LEFT: #ffffff; WIDTH: 12px; COLOR: #cccccc; BORDER-BOTTOM: #ffffff; BACKGROUND-COLOR: #ffffff }
|
37
|
+
|
38
|
+
..hrcomplete { BORDER-RIGHT: #000000 2px solid; PADDING-RIGHT: 0px; BORDER-TOP: #000000 2px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: #000000 2px solid; WIDTH: 20px; COLOR: #000000; PADDING-TOP: 0px; BORDER-BOTTOM: #000000 2px solid; HEIGHT: 4px }
|
39
|
+
|
40
|
+
..hrhalfcomplete { BORDER-RIGHT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-LEFT: #000000 2px solid; WIDTH: 9px; COLOR: #000000; BORDER-BOTTOM: #000000 2px solid; HEIGHT: 4px }
|
41
|
+
|
42
|
+
..gweekend { font-family:tahoma, arial, verdana; font-size:11px; background-color:#EEEEEE; text-align:center; }
|
43
|
+
|
44
|
+
..gtask { font-family:tahoma, arial, verdana; font-size:11px; background-color:#00FF00; text-align:center; }
|
45
|
+
|
46
|
+
..gday { font-family:tahoma, arial, verdana; font-size:11px; text-align:center; }
|
47
|
+
|
48
|
+
..gcomplete { background-color:black; height:5px; overflow: auto; margin-top:4px; }
|
49
|
+
|
50
|
+
DIV.scroll { BORDER-RIGHT: #efefef 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #efefef 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; BORDER-LEFT: #efefef 1px solid; WIDTH: 420px; PADDING-TOP: 0px; BORDER-BOTTOM: #efefef 1px solid; BACKGROUND-COLOR: #ffffff }
|
51
|
+
|
52
|
+
DIV.scroll2 { position:relative; PADDING-RIGHT: 0px; overflow:auto ;overflow-x:scroll;overflow-y:hidden; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 482px; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff }
|
53
|
+
|
data/docs/gantt.html
ADDED
@@ -0,0 +1,330 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
5
|
+
<link rel="stylesheet" type="text/css" href="./css/jsgantt.css" />
|
6
|
+
<script language="javascript" src="./js/jsgantt.js"></script>
|
7
|
+
<title>Gantt Chart | CBT - Corona Build Tools</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<h2>CBT - Corona Build Tools
|
11
|
+
|
12
|
+
</h2>
|
13
|
+
|
14
|
+
<div style="position:relative" class="gantt" id="GanttChartDIV"></div>
|
15
|
+
<script>
|
16
|
+
var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');
|
17
|
+
g.setShowRes(1); // Show/Hide Responsible (0/1)
|
18
|
+
g.setShowDur(1); // Show/Hide Duration (0/1)
|
19
|
+
g.setShowComp(0); //
|
20
|
+
g.setCaptionType('Caption'); // Set to Show Caption
|
21
|
+
g.setShowStartDate(0); // Show/Hide Start Date(0/1)
|
22
|
+
g.setShowEndDate(0); // Show/Hide End Date(0/1)
|
23
|
+
//g.setDateDisplayFormat('yyyy-mm-dd') // Set format to display dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
|
24
|
+
g.setFormatArr("day","week","month") // Set format options (up to 4 : "minute","hour","day","week","month","quarter")
|
25
|
+
|
26
|
+
if( g ) {
|
27
|
+
g.AddTaskItem(new JSGantt.TaskItem(10,'define the interface of command line program','04/06/2013','04/06/2013','008000','',0,'黄巍',100,1,0,1,'',''));
|
28
|
+
|
29
|
+
g.AddTaskItem(new JSGantt.TaskItem(11,'rewrite readme document','04/06/2013','04/06/2013','008000','',0,'黄巍',100,0,10,1,'','黄巍2013-04-06'));
|
30
|
+
|
31
|
+
g.AddTaskItem(new JSGantt.TaskItem(12,'design test strategy ','04/06/2013','04/06/2013','008000','',0,'黄巍',100,0,10,1,'','黄巍2013-04-06'));
|
32
|
+
|
33
|
+
g.AddTaskItem(new JSGantt.TaskItem(14,'implement all features','04/06/2013','04/15/2013','008000','',0,'黄巍',100,1,0,1,'',''));
|
34
|
+
|
35
|
+
g.AddTaskItem(new JSGantt.TaskItem(15,'create new directory structure','04/06/2013','04/07/2013','008000','',0,'黄巍',100,0,14,1,'','黄巍2013-04-07'));
|
36
|
+
|
37
|
+
g.AddTaskItem(new JSGantt.TaskItem(16,'copy library files to build directory','04/08/2013','04/09/2013','008000','',0,'黄巍',100,0,14,1,'','黄巍2013-04-08'));
|
38
|
+
|
39
|
+
g.AddTaskItem(new JSGantt.TaskItem(18,'implement all features under new design','04/06/2013','04/20/2013','008000','',0,'黄巍',100,1,0,1,'',''));
|
40
|
+
|
41
|
+
g.AddTaskItem(new JSGantt.TaskItem(19,'review readme again','04/08/2013','04/08/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-08'));
|
42
|
+
|
43
|
+
g.AddTaskItem(new JSGantt.TaskItem(20,'revise command line options again','04/12/2013','04/12/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-12'));
|
44
|
+
|
45
|
+
g.AddTaskItem(new JSGantt.TaskItem(21,'create skeleton files','04/12/2013','04/12/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-12'));
|
46
|
+
|
47
|
+
g.AddTaskItem(new JSGantt.TaskItem(22,'a mechanism for file contestency','04/12/2013','04/13/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-12'));
|
48
|
+
|
49
|
+
g.AddTaskItem(new JSGantt.TaskItem(23,'revise command structure again','04/15/2013','04/15/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-15'));
|
50
|
+
|
51
|
+
g.AddTaskItem(new JSGantt.TaskItem(24,'checkout lua and asset files','04/13/2013','04/15/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-17'));
|
52
|
+
|
53
|
+
g.AddTaskItem(new JSGantt.TaskItem(25,'spec test mechanism with TTS function','04/16/2013','04/22/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-04-19'));
|
54
|
+
|
55
|
+
g.AddTaskItem(new JSGantt.TaskItem(26,'create component-relationship diagram','04/22/2013','04/23/2013','008000','',0,'黄巍',100,0,18,1,'','黄巍2013-05-23'));
|
56
|
+
|
57
|
+
g.AddTaskItem(new JSGantt.TaskItem(28,'create gem for the first time','06/03/2013','06/03/2013','FF0000','',1,'黄巍',0,0,0,1,'','黄巍'));
|
58
|
+
|
59
|
+
g.AddTaskItem(new JSGantt.TaskItem(30,'fix functionalities','04/23/2013','04/27/2013','FF0000','',0,'黄巍',0,1,0,1,'',''));
|
60
|
+
|
61
|
+
g.AddTaskItem(new JSGantt.TaskItem(31,'review and rewrite all functions','04/23/2013','04/25/2013','FF0000','',0,'黄巍',10,0,30,1,'','黄巍:10\%'));
|
62
|
+
|
63
|
+
g.AddTaskItem(new JSGantt.TaskItem(33,'first public release','04/27/2013','04/27/2013','FF0000','',1,'黄巍',0,0,0,1,'','黄巍'));
|
64
|
+
|
65
|
+
g.Draw();
|
66
|
+
g.DrawDependencies();
|
67
|
+
}
|
68
|
+
else
|
69
|
+
{
|
70
|
+
alert("not defined");
|
71
|
+
}
|
72
|
+
</script>
|
73
|
+
|
74
|
+
|
75
|
+
<h3>Recent Git Log</h3>
|
76
|
+
<pre><code>
|
77
|
+
* <em style='color:grey'>b7a5d96b38cc3de2d09acd39c4ceeebc30d5c9c2</em>
|
78
|
+
| <strong>2013-06-04 13:48</strong> By Huang Wei <huang@humentsoft.com>
|
79
|
+
| | <strong style='color:green'>update roadmap</strong>
|
80
|
+
|
|
81
|
+
|
|
82
|
+
* <em style='color:grey'>880a1e486781462e230dd936c516240ffab1527c</em>
|
83
|
+
| <strong>2013-05-23 15:39</strong> By Huang Wei <huangw@pe-po.com>
|
84
|
+
| | <strong style='color:green'>update progress of task rewrite_beta to 10</strong>
|
85
|
+
|
|
86
|
+
|
|
87
|
+
* <em style='color:grey'>6b69bd26f3d6019eab84e5c653ea551ea011e278</em>
|
88
|
+
| <strong>2013-05-23 15:19</strong> By Huang Wei <huangw@pe-po.com>
|
89
|
+
| | <strong style='color:green'>update progress of task alpha2 to 100</strong>
|
90
|
+
|
|
91
|
+
|
|
92
|
+
* <em style='color:grey'>6b5626cb7e39725d8561e7b8229a0fb768c44cae</em>
|
93
|
+
| <strong>2013-05-23 15:16</strong> By Huang Wei <huangw@pe-po.com>
|
94
|
+
| | <strong style='color:green'>update progress of task alpha2 to 10</strong>
|
95
|
+
|
|
96
|
+
|
|
97
|
+
* <em style='color:grey'>96b9bfaa5482414d179b7fbdcb44aab28b49314b</em>
|
98
|
+
| <strong>2013-05-23 15:04</strong> By Huang Wei <huangw@pe-po.com>
|
99
|
+
| | <strong style='color:green'>update progress of task erd to 100</strong>
|
100
|
+
|
|
101
|
+
|
|
102
|
+
* <em style='color:grey'>84d75b5b5377d8c6f9c67b0e82dbe6e86244245a</em>
|
103
|
+
|\ <strong>2013-05-23 15:04</strong> By Huang Wei <huangw@pe-po.com>
|
104
|
+
| | | | <strong style='color:green'>Merge branch 'erd' into develop</strong>
|
105
|
+
| |
|
106
|
+
| |
|
107
|
+
| * <em style='color:grey'>3a6210289345ec02fc9d5ee6a00989f4bd30363d</em>
|
108
|
+
|/ <strong>2013-05-23 15:04</strong> By Huang Wei <huangw@pe-po.com>
|
109
|
+
| | <strong style='color:green'>[close] close the branch by set progress to 100.</strong>
|
110
|
+
|
|
111
|
+
|
|
112
|
+
* <em style='color:grey'>d68054eddc2e388602284438ca7ac76403abddda</em>
|
113
|
+
| <strong>2013-05-23 14:42</strong> By Huang Wei <huangw@pe-po.com>
|
114
|
+
| | <strong style='color:green'>update progress of task erd to 99</strong>
|
115
|
+
|
|
116
|
+
|
|
117
|
+
* <em style='color:grey'>35ee28fe8ef9d85017c6bdd9451f69f14a637748</em>
|
118
|
+
| <strong>2013-05-10 14:24</strong> By Huang Wei <huangw@pe-po.com>
|
119
|
+
| | <strong style='color:green'>update progress of task erd to 100</strong>
|
120
|
+
|
|
121
|
+
|
|
122
|
+
* <em style='color:grey'>5a82e509579f57ce67e1b3fe301a472292ee4e55</em>
|
123
|
+
|\ <strong>2013-05-10 14:24</strong> By Huang Wei <huangw@pe-po.com>
|
124
|
+
| | | | <strong style='color:green'>Merge branch 'erd' into develop</strong>
|
125
|
+
| |
|
126
|
+
| |
|
127
|
+
| * <em style='color:grey'>17b1fb798a37cd4a5454b9a183a3b6a72aa9d4bb</em>
|
128
|
+
| |\ <strong>2013-05-10 14:22</strong> By Huang Wei <huangw@pe-po.com>
|
129
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into erd</strong>
|
130
|
+
| |
|
131
|
+
| |
|
132
|
+
* | <em style='color:grey'>cd89055c4e03953a82dad0578dd666b77ffe047a</em>
|
133
|
+
| | <strong>2013-05-10 14:21</strong> By Huang Wei <huangw@pe-po.com>
|
134
|
+
| | | | <strong style='color:green'>update progress of task erd to 99</strong>
|
135
|
+
| |
|
136
|
+
| |
|
137
|
+
| * <em style='color:grey'>dd0ab937753235ef4e2bf8118a9b2984c76fd6f8</em>
|
138
|
+
| | <strong>2013-05-10 14:20</strong> By Huang Wei <huangw@pe-po.com>
|
139
|
+
| | | | <strong style='color:green'>[complete] complete the branch by set progress to 99.</strong>
|
140
|
+
| |
|
141
|
+
| |
|
142
|
+
| * <em style='color:grey'>2939f02eccbe27c05cafe6a643b09057c6e1a64e</em>
|
143
|
+
| |\ <strong>2013-05-09 18:05</strong> By Huang Wei <huangw@pe-po.com>
|
144
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into erd</strong>
|
145
|
+
| |
|
146
|
+
| |
|
147
|
+
* | <em style='color:grey'>29a8a792193d9ef01170f8cf534c4d5d9517bdb3</em>
|
148
|
+
| | <strong>2013-05-09 18:05</strong> By Huang Wei <huangw@pe-po.com>
|
149
|
+
| | | | <strong style='color:green'>update progress of task erd to 55</strong>
|
150
|
+
| |
|
151
|
+
| |
|
152
|
+
| * <em style='color:grey'>dc4c803743b11a59e6b0c8d3a9ad8fadf877baaa</em>
|
153
|
+
| | <strong>2013-05-09 18:04</strong> By Huang Wei <huangw@pe-po.com>
|
154
|
+
| | | | <strong style='color:green'>[progress] update progress to 55</strong>
|
155
|
+
| |
|
156
|
+
| |
|
157
|
+
| * <em style='color:grey'>d541b2254814d4d4ab787524a61cfd20597a5642</em>
|
158
|
+
| |\ <strong>2013-05-08 18:11</strong> By Huang Wei <huangw@pe-po.com>
|
159
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into erd</strong>
|
160
|
+
| |
|
161
|
+
| |
|
162
|
+
* | <em style='color:grey'>489602d4ff17ae10d62f92b02f7f96d00401c07b</em>
|
163
|
+
| | <strong>2013-05-08 18:10</strong> By Huang Wei <huangw@pe-po.com>
|
164
|
+
| | | | <strong style='color:green'>update progress of task erd to 45</strong>
|
165
|
+
| |
|
166
|
+
| |
|
167
|
+
| * <em style='color:grey'>3496784189f536c06e6b5f834476e59e8c74f22b</em>
|
168
|
+
| | <strong>2013-05-08 18:10</strong> By Huang Wei <huangw@pe-po.com>
|
169
|
+
| | | | <strong style='color:green'>[progress] update progress to 45</strong>
|
170
|
+
| |
|
171
|
+
| |
|
172
|
+
| * <em style='color:grey'>b7882803eab266a56094051277bf28093c9a00e2</em>
|
173
|
+
| |\ <strong>2013-05-08 16:56</strong> By Huang Wei <huangw@pe-po.com>
|
174
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into erd</strong>
|
175
|
+
| |
|
176
|
+
| |
|
177
|
+
* | <em style='color:grey'>e86167ba7395e135eaba8c0b793355cbf310b3c0</em>
|
178
|
+
| | <strong>2013-05-08 16:56</strong> By Huang Wei <huangw@pe-po.com>
|
179
|
+
| | | | <strong style='color:green'>update progress of task erd to 40</strong>
|
180
|
+
| |
|
181
|
+
| |
|
182
|
+
| * <em style='color:grey'>55075c4926098c2480b70efdd37e4400628f8749</em>
|
183
|
+
|/ <strong>2013-05-08 16:56</strong> By Huang Wei <huangw@pe-po.com>
|
184
|
+
| | <strong style='color:green'>[progress] update progress to 40</strong>
|
185
|
+
|
|
186
|
+
|
|
187
|
+
* <em style='color:grey'>e7675da4bfb387b163d42b818f10433c9ae8e1ba</em>
|
188
|
+
| <strong>2013-04-21 16:03</strong> By Huang Wei <huangw@pe-po.com>
|
189
|
+
| | <strong style='color:green'>update progress of task erd to 10</strong>
|
190
|
+
|
|
191
|
+
|
|
192
|
+
* <em style='color:grey'>591a2ef30388461925a4d9b306b58c71d3dfb2d0</em>
|
193
|
+
| <strong>2013-04-19 18:25</strong> By Huang Wei <huangw@pe-po.com>
|
194
|
+
| | <strong style='color:green'>update progress of task spec to 100</strong>
|
195
|
+
|
|
196
|
+
|
|
197
|
+
* <em style='color:grey'>393364b9fd1988cbe787cc0293a365848cac9c02</em>
|
198
|
+
|\ <strong>2013-04-19 18:25</strong> By Huang Wei <huangw@pe-po.com>
|
199
|
+
| | | | <strong style='color:green'>Merge branch 'spec' into develop</strong>
|
200
|
+
| |
|
201
|
+
| |
|
202
|
+
| * <em style='color:grey'>4ae6887b8c2376122e1f8ace24fc3a43cd09b50d</em>
|
203
|
+
| |\ <strong>2013-04-19 18:25</strong> By Huang Wei <huangw@pe-po.com>
|
204
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into spec</strong>
|
205
|
+
| |
|
206
|
+
| |
|
207
|
+
* | <em style='color:grey'>427adffa8b87ac34b84403dc3b685702481151ab</em>
|
208
|
+
| | <strong>2013-04-19 18:24</strong> By Huang Wei <huangw@pe-po.com>
|
209
|
+
| | | | <strong style='color:green'>update progress of task spec to 99</strong>
|
210
|
+
| |
|
211
|
+
| |
|
212
|
+
| * <em style='color:grey'>c59874da3cca66b3de045d7fe6f6f660beb526f5</em>
|
213
|
+
| | <strong>2013-04-19 18:23</strong> By Huang Wei <huangw@pe-po.com>
|
214
|
+
| | | | <strong style='color:green'>[complete] complete the branch by set progress to 99.</strong>
|
215
|
+
| |
|
216
|
+
| |
|
217
|
+
| * <em style='color:grey'>aea8dba3f46cecef7f65bf06a19a6a2447f2bd8f</em>
|
218
|
+
| |\ <strong>2013-04-18 18:27</strong> By Huang Wei <huangw@pe-po.com>
|
219
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into spec</strong>
|
220
|
+
| |
|
221
|
+
| |
|
222
|
+
* | <em style='color:grey'>0bbba1e15366b747bace37c2a7f124984d7fd057</em>
|
223
|
+
| | <strong>2013-04-18 18:27</strong> By Huang Wei <huangw@pe-po.com>
|
224
|
+
| | | | <strong style='color:green'>update progress of task spec to 50</strong>
|
225
|
+
| |
|
226
|
+
| |
|
227
|
+
| * <em style='color:grey'>3cf81b139d58ac2f65bddcc26f34e053d75bfe73</em>
|
228
|
+
| | <strong>2013-04-18 18:27</strong> By Huang Wei <huangw@pe-po.com>
|
229
|
+
| | | | <strong style='color:green'>[progress] add luobo sources.</strong>
|
230
|
+
| |
|
231
|
+
| |
|
232
|
+
| * <em style='color:grey'>9cb233aa5be84b3b6fe3e0940834d5a22fcb00f7</em>
|
233
|
+
| |\ <strong>2013-04-18 10:02</strong> By Huang Wei <huangw@pe-po.com>
|
234
|
+
| |/ |/| <strong style='color:green'>Merge branch 'develop' into spec</strong>
|
235
|
+
| |
|
236
|
+
| |
|
237
|
+
* | <em style='color:grey'>132f5f913c9e8b561fd7f5232d2f55732da9831f</em>
|
238
|
+
| | <strong>2013-04-18 10:02</strong> By Huang Wei <huangw@pe-po.com>
|
239
|
+
| | | | <strong style='color:green'>update progress of task spec to 20</strong>
|
240
|
+
| |
|
241
|
+
| |
|
242
|
+
| * <em style='color:grey'>dd75a256db34803915cefb4636b3de73bd5fb8cc</em>
|
243
|
+
|/ <strong>2013-04-18 10:02</strong> By Huang Wei <huangw@pe-po.com>
|
244
|
+
| | <strong style='color:green'>[progress] on digest debug.</strong>
|
245
|
+
|
|
246
|
+
|
|
247
|
+
* <em style='color:grey'>05010df0531812774c78feea5851d115cac2f03d</em>
|
248
|
+
| <strong>2013-04-17 16:46</strong> By Huang Wei <huangw@pe-po.com>
|
249
|
+
| | <strong style='color:green'>update progress of task spec to 10</strong>
|
250
|
+
|
|
251
|
+
|
|
252
|
+
* <em style='color:grey'>d578ddc9e239782d1cb7bd8b6b7b062cd780ff99</em>
|
253
|
+
| <strong>2013-04-17 16:46</strong> By Huang Wei <huangw@pe-po.com>
|
254
|
+
| | <strong style='color:green'>update roadmap</strong>
|
255
|
+
|
|
256
|
+
|
|
257
|
+
* <em style='color:grey'>3b219b0cbc225c755b166b63cd4a3e894b24df66</em>
|
258
|
+
| <strong>2013-04-17 16:44</strong> By Huang Wei <huangw@pe-po.com>
|
259
|
+
| | <strong style='color:green'>update progress of task cout to 100</strong>
|
260
|
+
|
|
261
|
+
|
|
262
|
+
* <em style='color:grey'>7bdc2b9c06deb42a39c9d01af61927321b17284d</em>
|
263
|
+
|\ <strong>2013-04-17 16:44</strong> By Huang Wei <huangw@pe-po.com>
|
264
|
+
| | | | <strong style='color:green'>Merge branch 'cout' into develop</strong>
|
265
|
+
| |
|
266
|
+
| |
|
267
|
+
| * <em style='color:grey'>94bdbb8f82f21459911c57e636884cfdbca60856</em>
|
268
|
+
| |\ <strong>2013-04-17 16:43</strong> By Huang Wei <huangw@pe-po.com>
|
269
|
+
| |/ |/| <strong style='color:green'>update gitignore for conflict.</strong>
|
270
|
+
| |
|
271
|
+
| |
|
272
|
+
* | <em style='color:grey'>a6b87803f547eb4704a0f0f27a102b8abab711b8</em>
|
273
|
+
| | <strong>2013-04-17 16:41</strong> By Huang Wei <huangw@pe-po.com>
|
274
|
+
| | | | <strong style='color:green'>add assets and workspace to ignore list.</strong>
|
275
|
+
| |
|
276
|
+
| |
|
277
|
+
* | <em style='color:grey'>56e7573f6d4262a1969393993e7ebd0220fe1aa4</em>
|
278
|
+
| | <strong>2013-04-17 16:40</strong> By Huang Wei <huangw@pe-po.com>
|
279
|
+
| | | | <strong style='color:green'>update progress of task cout to 99</strong>
|
280
|
+
| |
|
281
|
+
| |
|
282
|
+
| * <em style='color:grey'>238a751443884bee9e0aa71580971f45b4558915</em>
|
283
|
+
| | <strong>2013-04-17 16:40</strong> By Huang Wei <huangw@pe-po.com>
|
284
|
+
| | | | <strong style='color:green'>[complete] complete the branch by set progress to 99.</strong>
|
285
|
+
| |
|
286
|
+
| |
|
287
|
+
| * <em style='color:grey'>4d0346b982a9a1f77ca23e363daa90c307ad25cd</em>
|
288
|
+
| |\ <strong>2013-04-17 15:17</strong> By Huang Wei <huangw@pe-po.com>
|
289
|
+
| | | | | | <strong style='color:green'>Merge branch 'cout' of gg:cbt-gem into cout</strong>
|
290
|
+
| | |
|
291
|
+
| | |
|
292
|
+
| | * <em style='color:grey'>daba69630b41872042c95fd673e0cf636ff328dd</em>
|
293
|
+
| |_|/ Date: Wed, 17 Apr 2013 18:38:13 +0800
|
294
|
+
|/| | <strong style='color:green'>Merge branch 'develop' into cout</strong>
|
295
|
+
| | |
|
296
|
+
| | |
|
297
|
+
| | * <em style='color:grey'>d9ecdde0dfa96ce1bc80337deb6f82b1438da2cc</em>
|
298
|
+
| | | <strong>2013-04-17 18:37</strong> By Huang Wei <huangw@pe-po.com>
|
299
|
+
| | | | | | <strong style='color:green'>[progress] update progress to 50</strong>
|
300
|
+
| | |
|
301
|
+
| | |
|
302
|
+
| | * <em style='color:grey'>cc8d79cb4cef785b32e7133a033a2ddd551edfbc</em>
|
303
|
+
| | |\ <strong>2013-04-17 17:51</strong> By Huang Wei <huangw@pe-po.com>
|
304
|
+
| | | | | | | | <strong style='color:green'>Merge branch 'develop' into cout</strong>
|
305
|
+
| | | |
|
306
|
+
| | | |
|
307
|
+
| | * | <em style='color:grey'>57c11ff4f1a7e03111250fdacf865d01d35888f7</em>
|
308
|
+
| | | | <strong>2013-04-17 17:51</strong> By Huang Wei <huangw@pe-po.com>
|
309
|
+
| | | | | | | | <strong style='color:green'>[progress] update progress to 40</strong>
|
310
|
+
| | | |
|
311
|
+
| | | |
|
312
|
+
| | * | <em style='color:grey'>3bd7df02d06b5f83ddf1381c583b9039ebde47a7</em>
|
313
|
+
| | |\ \ <strong>2013-04-17 09:04</strong> By Huang Wei <huangw@pe-po.com>
|
314
|
+
| | | | | | | | | | <strong style='color:green'>Merge branch 'cout' of gg:cbt-gem into cout</strong>
|
315
|
+
| | | | |
|
316
|
+
| | | | |
|
317
|
+
| | * | | <em style='color:grey'>52ec616a9c6724cc3338000b91cbcc8e1d88afc0</em>
|
318
|
+
| | |\ \ \ <strong>2013-04-17 09:04</strong> By Huang Wei <huangw@pe-po.com>
|
319
|
+
| | | | | | | | | | | | <strong style='color:green'>Merge branch 'develop' into cout</strong>
|
320
|
+
| | | | | |
|
321
|
+
| | | | | |
|
322
|
+
| | * | | | <em style='color:grey'>92042bf2bbf0501de2a1472bffac70f7ef735b88</em>
|
323
|
+
| | |\ \ \ \ <strong>2013-04-16 17:17</strong> By Huang Wei <huangw@pe-po.com>
|
324
|
+
| | | | | | | | | | | | | | <strong style='color:green'>Merge branch 'develop' into cout</strong>
|
325
|
+
| | | | | | |
|
326
|
+
|
327
|
+
</code></pre>
|
328
|
+
|
329
|
+
</body>
|
330
|
+
</html>
|
data/docs/js/jsgantt.js
ADDED
@@ -0,0 +1,1681 @@
|
|
1
|
+
/*
|
2
|
+
_ ___ _ _ _ ____
|
3
|
+
(_)___ / _ \__ _ _ __ | |_| |_ / | |___ \
|
4
|
+
| / __| / /_\/ _` | '_ \| __| __| | | __) |
|
5
|
+
| \__ \/ /_\\ (_| | | | | |_| |_ | |_ / __/
|
6
|
+
_/ |___/\____/\__,_|_| |_|\__|\__| |_(_)_____|
|
7
|
+
|__/
|
8
|
+
|
9
|
+
Copyright (c) 2009, Shlomy Gantz BlueBrick Inc. All rights reserved.
|
10
|
+
|
11
|
+
*
|
12
|
+
* Redistribution and use in source and binary forms, with or without
|
13
|
+
* modification, are permitted provided that the following conditions are met:
|
14
|
+
* * Redistributions of source code must retain the above copyright
|
15
|
+
* notice, this list of conditions and the following disclaimer.
|
16
|
+
* * Redistributions in binary form must reproduce the above copyright
|
17
|
+
* notice, this list of conditions and the following disclaimer in the
|
18
|
+
* documentation and/or other materials provided with the distribution.
|
19
|
+
* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the
|
20
|
+
* names of its contributors may be used to endorse or promote products
|
21
|
+
* derived from this software without specific prior written permission.
|
22
|
+
*
|
23
|
+
* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY
|
24
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
25
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
+
* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY
|
27
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
28
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
29
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
30
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
31
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
32
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
*/
|
34
|
+
|
35
|
+
var JSGantt; if (!JSGantt) JSGantt = {};
|
36
|
+
|
37
|
+
var vTimeout = 0;
|
38
|
+
var vBenchTime = new Date().getTime();
|
39
|
+
|
40
|
+
JSGantt.isIE = function () {
|
41
|
+
|
42
|
+
if(typeof document.all != 'undefined')
|
43
|
+
return true;
|
44
|
+
else
|
45
|
+
return false;
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption)
|
50
|
+
{
|
51
|
+
|
52
|
+
var vID = pID;
|
53
|
+
var vName = pName;
|
54
|
+
var vStart = new Date();
|
55
|
+
var vEnd = new Date();
|
56
|
+
var vColor = pColor;
|
57
|
+
var vLink = pLink;
|
58
|
+
var vMile = pMile;
|
59
|
+
var vRes = pRes;
|
60
|
+
var vComp = pComp;
|
61
|
+
var vGroup = pGroup;
|
62
|
+
var vParent = pParent;
|
63
|
+
var vOpen = pOpen;
|
64
|
+
var vDepend = pDepend;
|
65
|
+
var vCaption = pCaption;
|
66
|
+
var vDuration = '';
|
67
|
+
var vLevel = 0;
|
68
|
+
var vNumKid = 0;
|
69
|
+
var vVisible = 1;
|
70
|
+
var x1, y1, x2, y2;
|
71
|
+
|
72
|
+
if (vGroup != 1)
|
73
|
+
{
|
74
|
+
vStart = JSGantt.parseDateStr(pStart,g.getDateInputFormat());
|
75
|
+
vEnd = JSGantt.parseDateStr(pEnd,g.getDateInputFormat());
|
76
|
+
}
|
77
|
+
|
78
|
+
this.getID = function(){ return vID };
|
79
|
+
this.getName = function(){ return vName };
|
80
|
+
this.getStart = function(){ return vStart};
|
81
|
+
this.getEnd = function(){ return vEnd };
|
82
|
+
this.getColor = function(){ return vColor};
|
83
|
+
this.getLink = function(){ return vLink };
|
84
|
+
this.getMile = function(){ return vMile };
|
85
|
+
this.getDepend = function(){ if(vDepend) return vDepend; else return null };
|
86
|
+
this.getCaption = function(){ if(vCaption) return vCaption; else return ''; };
|
87
|
+
this.getResource = function(){ if(vRes) return vRes; else return ' '; };
|
88
|
+
this.getCompVal = function(){ if(vComp) return vComp; else return 0; };
|
89
|
+
this.getCompStr = function(){ if(vComp) return vComp+'%'; else return ''; };
|
90
|
+
|
91
|
+
this.getDuration = function(vFormat){
|
92
|
+
if (vMile)
|
93
|
+
vDuration = '-';
|
94
|
+
else if (vFormat=='hour')
|
95
|
+
{
|
96
|
+
tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 60 * 1000) );
|
97
|
+
if(tmpPer == 1)
|
98
|
+
vDuration = '1 Hour';
|
99
|
+
else
|
100
|
+
vDuration = tmpPer + ' Hours';
|
101
|
+
}
|
102
|
+
|
103
|
+
else if (vFormat=='minute')
|
104
|
+
{
|
105
|
+
tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 1000) );
|
106
|
+
if(tmpPer == 1)
|
107
|
+
vDuration = '1 Minute';
|
108
|
+
else
|
109
|
+
vDuration = tmpPer + ' Minutes';
|
110
|
+
}
|
111
|
+
|
112
|
+
else { //if(vFormat == 'day') {
|
113
|
+
tmpPer = Math.ceil((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1);
|
114
|
+
if(tmpPer == 1) vDuration = '1 Day';
|
115
|
+
else vDuration = tmpPer + ' Days';
|
116
|
+
}
|
117
|
+
|
118
|
+
//else if(vFormat == 'week') {
|
119
|
+
// tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/7;
|
120
|
+
// if(tmpPer == 1) vDuration = '1 Week';
|
121
|
+
// else vDuration = tmpPer + ' Weeks';
|
122
|
+
//}
|
123
|
+
|
124
|
+
//else if(vFormat == 'month') {
|
125
|
+
// tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/30;
|
126
|
+
// if(tmpPer == 1) vDuration = '1 Month';
|
127
|
+
// else vDuration = tmpPer + ' Months';
|
128
|
+
//}
|
129
|
+
|
130
|
+
//else if(vFormat == 'quater') {
|
131
|
+
// tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/120;
|
132
|
+
// if(tmpPer == 1) vDuration = '1 Qtr';
|
133
|
+
// else vDuration = tmpPer + ' Qtrs';
|
134
|
+
//}
|
135
|
+
return( vDuration )
|
136
|
+
};
|
137
|
+
|
138
|
+
this.getParent = function(){ return vParent };
|
139
|
+
this.getGroup = function(){ return vGroup };
|
140
|
+
this.getOpen = function(){ return vOpen };
|
141
|
+
this.getLevel = function(){ return vLevel };
|
142
|
+
this.getNumKids = function(){ return vNumKid };
|
143
|
+
this.getStartX = function(){ return x1 };
|
144
|
+
this.getStartY = function(){ return y1 };
|
145
|
+
this.getEndX = function(){ return x2 };
|
146
|
+
this.getEndY = function(){ return y2 };
|
147
|
+
this.getVisible = function(){ return vVisible };
|
148
|
+
this.setDepend = function(pDepend){ vDepend = pDepend;};
|
149
|
+
this.setStart = function(pStart){ vStart = pStart;};
|
150
|
+
this.setEnd = function(pEnd) { vEnd = pEnd; };
|
151
|
+
this.setLevel = function(pLevel){ vLevel = pLevel;};
|
152
|
+
this.setNumKid = function(pNumKid){ vNumKid = pNumKid;};
|
153
|
+
this.setCompVal = function(pCompVal){ vComp = pCompVal;};
|
154
|
+
this.setStartX = function(pX) {x1 = pX; };
|
155
|
+
this.setStartY = function(pY) {y1 = pY; };
|
156
|
+
this.setEndX = function(pX) {x2 = pX; };
|
157
|
+
this.setEndY = function(pY) {y2 = pY; };
|
158
|
+
this.setOpen = function(pOpen) {vOpen = pOpen; };
|
159
|
+
this.setVisible = function(pVisible) {vVisible = pVisible; };
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
// function that loads the main gantt chart properties and functions
|
165
|
+
// pDiv: (required) this is a DIV object created in HTML
|
166
|
+
// pStart: UNUSED - future use to force minimum chart date
|
167
|
+
// pEnd: UNUSED - future use to force maximum chart date
|
168
|
+
// pWidth: UNUSED - future use to force chart width and cause objects to scale to fit within that width
|
169
|
+
// pShowRes: UNUSED - future use to turn on/off display of resource names
|
170
|
+
// pShowDur: UNUSED - future use to turn on/off display of task durations
|
171
|
+
// pFormat: (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format
|
172
|
+
// pCationType - what type of Caption to show: Caption, Resource, Duration, Complete
|
173
|
+
JSGantt.GanttChart = function(pGanttVar, pDiv, pFormat)
|
174
|
+
{
|
175
|
+
|
176
|
+
var vGanttVar = pGanttVar;
|
177
|
+
var vDiv = pDiv;
|
178
|
+
var vFormat = pFormat;
|
179
|
+
var vShowRes = 1;
|
180
|
+
var vShowDur = 1;
|
181
|
+
var vShowComp = 1;
|
182
|
+
var vShowStartDate = 1;
|
183
|
+
var vShowEndDate = 1;
|
184
|
+
var vDateInputFormat = "mm/dd/yyyy";
|
185
|
+
var vDateDisplayFormat = "mm/dd/yy";
|
186
|
+
var vNumUnits = 0;
|
187
|
+
var vCaptionType;
|
188
|
+
var vDepId = 1;
|
189
|
+
var vTaskList = new Array();
|
190
|
+
var vFormatArr = new Array("day","week","month","quarter");
|
191
|
+
var vQuarterArr = new Array(1,1,1,2,2,2,3,3,3,4,4,4);
|
192
|
+
var vMonthDaysArr = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
|
193
|
+
var vMonthArr = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
|
194
|
+
this.setFormatArr = function() {
|
195
|
+
vFormatArr = new Array();
|
196
|
+
for(var i = 0; i < arguments.length; i++) {vFormatArr[i] = arguments[i];}
|
197
|
+
if(vFormatArr.length>4){vFormatArr.length=4;}
|
198
|
+
};
|
199
|
+
this.setShowRes = function(pShow) { vShowRes = pShow; };
|
200
|
+
this.setShowDur = function(pShow) { vShowDur = pShow; };
|
201
|
+
this.setShowComp = function(pShow) { vShowComp = pShow; };
|
202
|
+
this.setShowStartDate = function(pShow) { vShowStartDate = pShow; };
|
203
|
+
this.setShowEndDate = function(pShow) { vShowEndDate = pShow; };
|
204
|
+
this.setDateInputFormat = function(pShow) { vDateInputFormat = pShow; };
|
205
|
+
this.setDateDisplayFormat = function(pShow) { vDateDisplayFormat = pShow; };
|
206
|
+
this.setCaptionType = function(pType) { vCaptionType = pType };
|
207
|
+
this.setFormat = function(pFormat){
|
208
|
+
vFormat = pFormat;
|
209
|
+
this.Draw();
|
210
|
+
};
|
211
|
+
|
212
|
+
this.getShowRes = function(){ return vShowRes };
|
213
|
+
this.getShowDur = function(){ return vShowDur };
|
214
|
+
this.getShowComp = function(){ return vShowComp };
|
215
|
+
this.getShowStartDate = function(){ return vShowStartDate };
|
216
|
+
this.getShowEndDate = function(){ return vShowEndDate };
|
217
|
+
this.getDateInputFormat = function() { return vDateInputFormat };
|
218
|
+
this.getDateDisplayFormat = function() { return vDateDisplayFormat };
|
219
|
+
this.getCaptionType = function() { return vCaptionType };
|
220
|
+
this.CalcTaskXY = function ()
|
221
|
+
{
|
222
|
+
var vList = this.getList();
|
223
|
+
var vTaskDiv;
|
224
|
+
var vParDiv;
|
225
|
+
var vLeft, vTop, vHeight, vWidth;
|
226
|
+
|
227
|
+
for(i = 0; i < vList.length; i++)
|
228
|
+
{
|
229
|
+
vID = vList[i].getID();
|
230
|
+
vTaskDiv = document.getElementById("taskbar_"+vID);
|
231
|
+
vBarDiv = document.getElementById("bardiv_"+vID);
|
232
|
+
vParDiv = document.getElementById("childgrid_"+vID);
|
233
|
+
|
234
|
+
if(vBarDiv) {
|
235
|
+
vList[i].setStartX( vBarDiv.offsetLeft );
|
236
|
+
vList[i].setStartY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
|
237
|
+
vList[i].setEndX( vBarDiv.offsetLeft + vBarDiv.offsetWidth );
|
238
|
+
vList[i].setEndY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
this.AddTaskItem = function(value)
|
244
|
+
{
|
245
|
+
vTaskList.push(value);
|
246
|
+
}
|
247
|
+
|
248
|
+
this.getList = function() { return vTaskList };
|
249
|
+
|
250
|
+
this.clearDependencies = function()
|
251
|
+
{
|
252
|
+
var parent = document.getElementById('rightside');
|
253
|
+
var depLine;
|
254
|
+
var vMaxId = vDepId;
|
255
|
+
for ( i=1; i<vMaxId; i++ ) {
|
256
|
+
depLine = document.getElementById("line"+i);
|
257
|
+
if (depLine) { parent.removeChild(depLine); }
|
258
|
+
}
|
259
|
+
vDepId = 1;
|
260
|
+
}
|
261
|
+
|
262
|
+
|
263
|
+
// sLine: Draw a straight line (colored one-pixel wide DIV), need to parameterize doc item
|
264
|
+
this.sLine = function(x1,y1,x2,y2) {
|
265
|
+
|
266
|
+
vLeft = Math.min(x1,x2);
|
267
|
+
vTop = Math.min(y1,y2);
|
268
|
+
vWid = Math.abs(x2-x1) + 1;
|
269
|
+
vHgt = Math.abs(y2-y1) + 1;
|
270
|
+
|
271
|
+
vDoc = document.getElementById('rightside');
|
272
|
+
|
273
|
+
// retrieve DIV
|
274
|
+
var oDiv = document.createElement('div');
|
275
|
+
|
276
|
+
oDiv.id = "line"+vDepId++;
|
277
|
+
oDiv.style.position = "absolute";
|
278
|
+
oDiv.style.margin = "0px";
|
279
|
+
oDiv.style.padding = "0px";
|
280
|
+
oDiv.style.overflow = "hidden";
|
281
|
+
oDiv.style.border = "0px";
|
282
|
+
|
283
|
+
// set attributes
|
284
|
+
oDiv.style.zIndex = 0;
|
285
|
+
oDiv.style.backgroundColor = "red";
|
286
|
+
|
287
|
+
oDiv.style.left = vLeft + "px";
|
288
|
+
oDiv.style.top = vTop + "px";
|
289
|
+
oDiv.style.width = vWid + "px";
|
290
|
+
oDiv.style.height = vHgt + "px";
|
291
|
+
|
292
|
+
oDiv.style.visibility = "visible";
|
293
|
+
|
294
|
+
vDoc.appendChild(oDiv);
|
295
|
+
|
296
|
+
}
|
297
|
+
|
298
|
+
|
299
|
+
// dLine: Draw a diaganol line (calc line x,y paisrs and draw multiple one-by-one sLines)
|
300
|
+
this.dLine = function(x1,y1,x2,y2) {
|
301
|
+
|
302
|
+
var dx = x2 - x1;
|
303
|
+
var dy = y2 - y1;
|
304
|
+
var x = x1;
|
305
|
+
var y = y1;
|
306
|
+
|
307
|
+
var n = Math.max(Math.abs(dx),Math.abs(dy));
|
308
|
+
dx = dx / n;
|
309
|
+
dy = dy / n;
|
310
|
+
for ( i = 0; i <= n; i++ )
|
311
|
+
{
|
312
|
+
vx = Math.round(x);
|
313
|
+
vy = Math.round(y);
|
314
|
+
this.sLine(vx,vy,vx,vy);
|
315
|
+
x += dx;
|
316
|
+
y += dy;
|
317
|
+
}
|
318
|
+
|
319
|
+
}
|
320
|
+
|
321
|
+
this.drawDependency =function(x1,y1,x2,y2)
|
322
|
+
{
|
323
|
+
if(x1 + 10 < x2)
|
324
|
+
{
|
325
|
+
this.sLine(x1,y1,x1+4,y1);
|
326
|
+
this.sLine(x1+4,y1,x1+4,y2);
|
327
|
+
this.sLine(x1+4,y2,x2,y2);
|
328
|
+
this.dLine(x2,y2,x2-3,y2-3);
|
329
|
+
this.dLine(x2,y2,x2-3,y2+3);
|
330
|
+
this.dLine(x2-1,y2,x2-3,y2-2);
|
331
|
+
this.dLine(x2-1,y2,x2-3,y2+2);
|
332
|
+
}
|
333
|
+
else
|
334
|
+
{
|
335
|
+
this.sLine(x1,y1,x1+4,y1);
|
336
|
+
this.sLine(x1+4,y1,x1+4,y2-10);
|
337
|
+
this.sLine(x1+4,y2-10,x2-8,y2-10);
|
338
|
+
this.sLine(x2-8,y2-10,x2-8,y2);
|
339
|
+
this.sLine(x2-8,y2,x2,y2);
|
340
|
+
this.dLine(x2,y2,x2-3,y2-3);
|
341
|
+
this.dLine(x2,y2,x2-3,y2+3);
|
342
|
+
this.dLine(x2-1,y2,x2-3,y2-2);
|
343
|
+
this.dLine(x2-1,y2,x2-3,y2+2);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
this.DrawDependencies = function () {
|
348
|
+
|
349
|
+
//First recalculate the x,y
|
350
|
+
this.CalcTaskXY();
|
351
|
+
|
352
|
+
this.clearDependencies();
|
353
|
+
|
354
|
+
var vList = this.getList();
|
355
|
+
for(var i = 0; i < vList.length; i++)
|
356
|
+
{
|
357
|
+
|
358
|
+
vDepend = vList[i].getDepend();
|
359
|
+
if(vDepend) {
|
360
|
+
|
361
|
+
var vDependStr = vDepend + '';
|
362
|
+
var vDepList = vDependStr.split(',');
|
363
|
+
var n = vDepList.length;
|
364
|
+
|
365
|
+
for(var k=0;k<n;k++) {
|
366
|
+
var vTask = this.getArrayLocationByID(vDepList[k]);
|
367
|
+
|
368
|
+
if(vList[vTask].getVisible()==1)
|
369
|
+
this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY())
|
370
|
+
}
|
371
|
+
}
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
|
376
|
+
this.getArrayLocationByID = function(pId) {
|
377
|
+
|
378
|
+
var vList = this.getList();
|
379
|
+
for(var i = 0; i < vList.length; i++)
|
380
|
+
{
|
381
|
+
if(vList[i].getID()==pId)
|
382
|
+
return i;
|
383
|
+
}
|
384
|
+
}
|
385
|
+
|
386
|
+
|
387
|
+
this.Draw = function()
|
388
|
+
{
|
389
|
+
var vMaxDate = new Date();
|
390
|
+
var vMinDate = new Date();
|
391
|
+
var vTmpDate = new Date();
|
392
|
+
var vNxtDate = new Date();
|
393
|
+
var vCurrDate = new Date();
|
394
|
+
var vTaskLeft = 0;
|
395
|
+
var vTaskRight = 0;
|
396
|
+
var vNumCols = 0;
|
397
|
+
var vID = 0;
|
398
|
+
var vMainTable = "";
|
399
|
+
var vLeftTable = "";
|
400
|
+
var vRightTable = "";
|
401
|
+
var vDateRowStr = "";
|
402
|
+
var vItemRowStr = "";
|
403
|
+
var vColWidth = 0;
|
404
|
+
var vColUnit = 0;
|
405
|
+
var vChartWidth = 0;
|
406
|
+
var vNumDays = 0;
|
407
|
+
var vDayWidth = 0;
|
408
|
+
var vStr = "";
|
409
|
+
var vNameWidth = 220;
|
410
|
+
var vStatusWidth = 70;
|
411
|
+
var vLeftWidth = 15 + 220 + 70 + 70 + 70 + 70 + 70;
|
412
|
+
|
413
|
+
if(vTaskList.length > 0)
|
414
|
+
{
|
415
|
+
|
416
|
+
// Process all tasks preset parent date and completion %
|
417
|
+
JSGantt.processRows(vTaskList, 0, -1, 1, 1);
|
418
|
+
|
419
|
+
// get overall min/max dates plus padding
|
420
|
+
vMinDate = JSGantt.getMinDate(vTaskList, vFormat);
|
421
|
+
vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat);
|
422
|
+
|
423
|
+
// Calculate chart width variables. vColWidth can be altered manually to change each column width
|
424
|
+
// May be smart to make this a parameter of GanttChart or set it based on existing pWidth parameter
|
425
|
+
if(vFormat == 'day') {
|
426
|
+
vColWidth = 18;
|
427
|
+
vColUnit = 1;
|
428
|
+
}
|
429
|
+
else if(vFormat == 'week') {
|
430
|
+
vColWidth = 37;
|
431
|
+
vColUnit = 7;
|
432
|
+
}
|
433
|
+
else if(vFormat == 'month') {
|
434
|
+
vColWidth = 37;
|
435
|
+
vColUnit = 30;
|
436
|
+
}
|
437
|
+
else if(vFormat == 'quarter') {
|
438
|
+
vColWidth = 60;
|
439
|
+
vColUnit = 90;
|
440
|
+
}
|
441
|
+
|
442
|
+
else if(vFormat=='hour')
|
443
|
+
{
|
444
|
+
vColWidth = 18;
|
445
|
+
vColUnit = 1;
|
446
|
+
}
|
447
|
+
|
448
|
+
else if(vFormat=='minute')
|
449
|
+
{
|
450
|
+
vColWidth = 18;
|
451
|
+
vColUnit = 1;
|
452
|
+
}
|
453
|
+
|
454
|
+
vNumDays = (Date.parse(vMaxDate) - Date.parse(vMinDate)) / ( 24 * 60 * 60 * 1000);
|
455
|
+
vNumUnits = vNumDays / vColUnit;
|
456
|
+
|
457
|
+
|
458
|
+
vChartWidth = vNumUnits * vColWidth + 1;
|
459
|
+
vDayWidth = (vColWidth / vColUnit) + (1/vColUnit);
|
460
|
+
|
461
|
+
vMainTable =
|
462
|
+
'<TABLE id=theTable cellSpacing=0 cellPadding=0 border=0><TBODY><TR>' +
|
463
|
+
'<TD vAlign=top bgColor=#ffffff>';
|
464
|
+
|
465
|
+
if(vShowRes !=1) vNameWidth+=vStatusWidth;
|
466
|
+
if(vShowDur !=1) vNameWidth+=vStatusWidth;
|
467
|
+
if(vShowComp!=1) vNameWidth+=vStatusWidth;
|
468
|
+
if(vShowStartDate!=1) vNameWidth+=vStatusWidth;
|
469
|
+
if(vShowEndDate!=1) vNameWidth+=vStatusWidth;
|
470
|
+
|
471
|
+
// DRAW the Left-side of the chart (names, resources, comp%)
|
472
|
+
vLeftTable =
|
473
|
+
'<DIV class=scroll id=leftside style="width:' + vLeftWidth + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +
|
474
|
+
'<TR style="HEIGHT: 17px">' +
|
475
|
+
' <TD style="WIDTH: 15px; HEIGHT: 17px"></TD>' +
|
476
|
+
' <TD style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 17px"><NOBR></NOBR></TD>';
|
477
|
+
|
478
|
+
if(vShowRes ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
|
479
|
+
if(vShowDur ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
|
480
|
+
if(vShowComp==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
|
481
|
+
if(vShowStartDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
|
482
|
+
if(vShowEndDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
|
483
|
+
|
484
|
+
vLeftTable +=
|
485
|
+
'<TR style="HEIGHT: 20px">' +
|
486
|
+
' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: 15px; HEIGHT: 20px"></TD>' +
|
487
|
+
' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px"><NOBR></NOBR></TD>' ;
|
488
|
+
|
489
|
+
if(vShowRes ==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Resource</TD>' ;
|
490
|
+
if(vShowDur ==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Duration</TD>' ;
|
491
|
+
if(vShowComp==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>% Comp.</TD>' ;
|
492
|
+
if(vShowStartDate==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>Start Date</TD>' ;
|
493
|
+
if(vShowEndDate==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 60px; HEIGHT: 20px" align=center nowrap>End Date</TD>' ;
|
494
|
+
|
495
|
+
vLeftTable += '</TR>';
|
496
|
+
|
497
|
+
for(i = 0; i < vTaskList.length; i++)
|
498
|
+
{
|
499
|
+
if( vTaskList[i].getGroup()) {
|
500
|
+
vBGColor = "f3f3f3";
|
501
|
+
vRowType = "group";
|
502
|
+
} else {
|
503
|
+
vBGColor = "ffffff";
|
504
|
+
vRowType = "row";
|
505
|
+
}
|
506
|
+
|
507
|
+
vID = vTaskList[i].getID();
|
508
|
+
|
509
|
+
if(vTaskList[i].getVisible() == 0)
|
510
|
+
vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' style="display:none" onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
|
511
|
+
else
|
512
|
+
vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
|
513
|
+
|
514
|
+
vLeftTable +=
|
515
|
+
' <TD class=gdatehead style="WIDTH: 15px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;"> </TD>' +
|
516
|
+
' <TD class=gname style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;" nowrap><NOBR><span style="color: #aaaaaa">';
|
517
|
+
|
518
|
+
for(j=1; j<vTaskList[i].getLevel(); j++) {
|
519
|
+
vLeftTable += '    ';
|
520
|
+
}
|
521
|
+
|
522
|
+
vLeftTable += '</span>';
|
523
|
+
|
524
|
+
if( vTaskList[i].getGroup()) {
|
525
|
+
if( vTaskList[i].getOpen() == 1)
|
526
|
+
vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">–</span><span style="color:#000000"> </SPAN>' ;
|
527
|
+
else
|
528
|
+
vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">+</span><span style="color:#000000"> </SPAN>' ;
|
529
|
+
|
530
|
+
} else {
|
531
|
+
|
532
|
+
vLeftTable += '<span style="color: #000000; font-weight:bold; FONT-SIZE: 12px;">   </span>';
|
533
|
+
}
|
534
|
+
|
535
|
+
vLeftTable +=
|
536
|
+
'<span onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); style="cursor:pointer"> ' + vTaskList[i].getName() + '</span></NOBR></TD>' ;
|
537
|
+
|
538
|
+
if(vShowRes ==1) vLeftTable += ' <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getResource() + '</NOBR></TD>' ;
|
539
|
+
if(vShowDur ==1) vLeftTable += ' <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getDuration(vFormat) + '</NOBR></TD>' ;
|
540
|
+
if(vShowComp==1) vLeftTable += ' <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + vTaskList[i].getCompStr() + '</NOBR></TD>' ;
|
541
|
+
if(vShowStartDate==1) vLeftTable += ' <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + JSGantt.formatDateStr( vTaskList[i].getStart(), vDateDisplayFormat) + '</NOBR></TD>' ;
|
542
|
+
if(vShowEndDate==1) vLeftTable += ' <TD class=gname style="WIDTH: 60px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><NOBR>' + JSGantt.formatDateStr( vTaskList[i].getEnd(), vDateDisplayFormat) + '</NOBR></TD>' ;
|
543
|
+
|
544
|
+
vLeftTable += '</TR>';
|
545
|
+
|
546
|
+
}
|
547
|
+
|
548
|
+
// DRAW the date format selector at bottom left. Another potential GanttChart parameter to hide/show this selector
|
549
|
+
vLeftTable += '</TD></TR>' +
|
550
|
+
'<TR><TD border=1 colspan=5 align=left style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #efefef 1px solid; height=18px"> Powered by <a href=http://www.jsgantt.com>jsGantt</a> Format:';
|
551
|
+
|
552
|
+
if (vFormatArr.join().indexOf("minute")!=-1) {
|
553
|
+
if (vFormat=='minute') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="minute" checked>Minute';
|
554
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("minute",'+vGanttVar+'); VALUE="minute">Minute';
|
555
|
+
}
|
556
|
+
|
557
|
+
if (vFormatArr.join().indexOf("hour")!=-1) {
|
558
|
+
if (vFormat=='hour') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="hour" checked>Hour';
|
559
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("hour",'+vGanttVar+'); VALUE="hour">Hour';
|
560
|
+
}
|
561
|
+
|
562
|
+
if (vFormatArr.join().indexOf("day")!=-1) {
|
563
|
+
if (vFormat=='day') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="day" checked>Day';
|
564
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("day",'+vGanttVar+'); VALUE="day">Day';
|
565
|
+
}
|
566
|
+
|
567
|
+
if (vFormatArr.join().indexOf("week")!=-1) {
|
568
|
+
if (vFormat=='week') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="week" checked>Week';
|
569
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("week",'+vGanttVar+') VALUE="week">Week';
|
570
|
+
}
|
571
|
+
|
572
|
+
if (vFormatArr.join().indexOf("month")!=-1) {
|
573
|
+
if (vFormat=='month') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="month" checked>Month';
|
574
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("month",'+vGanttVar+') VALUE="month">Month';
|
575
|
+
}
|
576
|
+
|
577
|
+
if (vFormatArr.join().indexOf("quarter")!=-1) {
|
578
|
+
if (vFormat=='quarter') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="quarter" checked>Quarter';
|
579
|
+
else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("quarter",'+vGanttVar+') VALUE="quarter">Quarter';
|
580
|
+
}
|
581
|
+
|
582
|
+
// vLeftTable += '<INPUT TYPE=RADIO NAME="other" VALUE="other" style="display:none"> .';
|
583
|
+
|
584
|
+
vLeftTable += '</TD></TR></TBODY></TABLE></TD>';
|
585
|
+
|
586
|
+
vMainTable += vLeftTable;
|
587
|
+
|
588
|
+
// Draw the Chart Rows
|
589
|
+
vRightTable =
|
590
|
+
'<TD style="width: ' + vChartWidth + 'px;" vAlign=top bgColor=#ffffff>' +
|
591
|
+
'<DIV class=scroll2 id=rightside>' +
|
592
|
+
'<TABLE style="width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
|
593
|
+
'<TBODY><TR style="HEIGHT: 18px">';
|
594
|
+
|
595
|
+
vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
|
596
|
+
vTmpDate.setHours(0);
|
597
|
+
vTmpDate.setMinutes(0);
|
598
|
+
|
599
|
+
// Major Date Header
|
600
|
+
while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
|
601
|
+
{
|
602
|
+
vStr = vTmpDate.getFullYear() + '';
|
603
|
+
vStr = vStr.substring(2,4);
|
604
|
+
|
605
|
+
|
606
|
+
if(vFormat == 'minute')
|
607
|
+
{
|
608
|
+
vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=60>' ;
|
609
|
+
vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' ' + vTmpDate.getHours() + ':00 -' + vTmpDate.getHours() + ':59 </td>';
|
610
|
+
vTmpDate.setHours(vTmpDate.getHours()+1);
|
611
|
+
}
|
612
|
+
|
613
|
+
if(vFormat == 'hour')
|
614
|
+
{
|
615
|
+
vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=24>' ;
|
616
|
+
vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
|
617
|
+
vTmpDate.setDate(vTmpDate.getDate()+1);
|
618
|
+
}
|
619
|
+
|
620
|
+
if(vFormat == 'day')
|
621
|
+
{
|
622
|
+
vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=7>' +
|
623
|
+
JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5)) + ' - ';
|
624
|
+
vTmpDate.setDate(vTmpDate.getDate()+6);
|
625
|
+
vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
|
626
|
+
vTmpDate.setDate(vTmpDate.getDate()+1);
|
627
|
+
}
|
628
|
+
else if(vFormat == 'week')
|
629
|
+
{
|
630
|
+
vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
|
631
|
+
vTmpDate.setDate(vTmpDate.getDate()+7);
|
632
|
+
}
|
633
|
+
else if(vFormat == 'month')
|
634
|
+
{
|
635
|
+
vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
|
636
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
637
|
+
while(vTmpDate.getDate() > 1)
|
638
|
+
{
|
639
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
640
|
+
}
|
641
|
+
}
|
642
|
+
else if(vFormat == 'quarter')
|
643
|
+
{
|
644
|
+
vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
|
645
|
+
vTmpDate.setDate(vTmpDate.getDate() + 81);
|
646
|
+
while(vTmpDate.getDate() > 1)
|
647
|
+
{
|
648
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
649
|
+
}
|
650
|
+
}
|
651
|
+
|
652
|
+
}
|
653
|
+
|
654
|
+
vRightTable += '</TR><TR>';
|
655
|
+
|
656
|
+
// Minor Date header and Cell Rows
|
657
|
+
vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
|
658
|
+
vNxtDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
|
659
|
+
vNumCols = 0;
|
660
|
+
|
661
|
+
while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
|
662
|
+
{
|
663
|
+
if (vFormat == 'minute')
|
664
|
+
{
|
665
|
+
|
666
|
+
if( vTmpDate.getMinutes() ==0 )
|
667
|
+
vWeekdayColor = "ccccff";
|
668
|
+
else
|
669
|
+
vWeekdayColor = "ffffff";
|
670
|
+
|
671
|
+
|
672
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getMinutes() + '</div></td>';
|
673
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
674
|
+
vTmpDate.setMinutes(vTmpDate.getMinutes() + 1);
|
675
|
+
}
|
676
|
+
|
677
|
+
else if (vFormat == 'hour')
|
678
|
+
{
|
679
|
+
|
680
|
+
if( vTmpDate.getHours() ==0 )
|
681
|
+
vWeekdayColor = "ccccff";
|
682
|
+
else
|
683
|
+
vWeekdayColor = "ffffff";
|
684
|
+
|
685
|
+
|
686
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getHours() + '</div></td>';
|
687
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
688
|
+
vTmpDate.setHours(vTmpDate.getHours() + 1);
|
689
|
+
}
|
690
|
+
|
691
|
+
else if(vFormat == 'day' )
|
692
|
+
{
|
693
|
+
if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) {
|
694
|
+
vWeekdayColor = "ccccff";
|
695
|
+
vWeekendColor = "9999ff";
|
696
|
+
vWeekdayGColor = "bbbbff";
|
697
|
+
vWeekendGColor = "8888ff";
|
698
|
+
} else {
|
699
|
+
vWeekdayColor = "ffffff";
|
700
|
+
vWeekendColor = "cfcfcf";
|
701
|
+
vWeekdayGColor = "f3f3f3";
|
702
|
+
vWeekendGColor = "c3c3c3";
|
703
|
+
}
|
704
|
+
|
705
|
+
if(vTmpDate.getDay() % 6 == 0) {
|
706
|
+
vDateRowStr += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';
|
707
|
+
vItemRowStr += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;HEIGHT: 20px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px"> </div></td>';
|
708
|
+
}
|
709
|
+
else {
|
710
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';
|
711
|
+
if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))
|
712
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
713
|
+
else
|
714
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; cursor: default;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
715
|
+
}
|
716
|
+
|
717
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
718
|
+
|
719
|
+
}
|
720
|
+
|
721
|
+
else if(vFormat == 'week')
|
722
|
+
{
|
723
|
+
|
724
|
+
vNxtDate.setDate(vNxtDate.getDate() + 7);
|
725
|
+
|
726
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
727
|
+
vWeekdayColor = "ccccff";
|
728
|
+
else
|
729
|
+
vWeekdayColor = "ffffff";
|
730
|
+
|
731
|
+
if(vNxtDate <= vMaxDate) {
|
732
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + '</div></td>';
|
733
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
734
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
735
|
+
else
|
736
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid;" align=center><div style="width:'+ vColWidth +'px">  </div></td>';
|
737
|
+
|
738
|
+
} else {
|
739
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; bgcolor=#' + vWeekdayColor + ' BORDER-RIGHT: #efefef 1px solid;" align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + '</div></td>';
|
740
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
741
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
742
|
+
else
|
743
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
744
|
+
|
745
|
+
}
|
746
|
+
|
747
|
+
vTmpDate.setDate(vTmpDate.getDate() + 7);
|
748
|
+
|
749
|
+
}
|
750
|
+
|
751
|
+
else if(vFormat == 'month')
|
752
|
+
{
|
753
|
+
|
754
|
+
vNxtDate.setFullYear(vTmpDate.getFullYear(), vTmpDate.getMonth(), vMonthDaysArr[vTmpDate.getMonth()]);
|
755
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
756
|
+
vWeekdayColor = "ccccff";
|
757
|
+
else
|
758
|
+
vWeekdayColor = "ffffff";
|
759
|
+
|
760
|
+
if(vNxtDate <= vMaxDate) {
|
761
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + '</div></td>';
|
762
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
763
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
764
|
+
else
|
765
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
766
|
+
} else {
|
767
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + '</div></td>';
|
768
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
769
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
770
|
+
else
|
771
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
772
|
+
}
|
773
|
+
|
774
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
775
|
+
|
776
|
+
while(vTmpDate.getDate() > 1)
|
777
|
+
{
|
778
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
779
|
+
}
|
780
|
+
|
781
|
+
}
|
782
|
+
|
783
|
+
else if(vFormat == 'quarter')
|
784
|
+
{
|
785
|
+
|
786
|
+
vNxtDate.setDate(vNxtDate.getDate() + 122);
|
787
|
+
if( vTmpDate.getMonth()==0 || vTmpDate.getMonth()==1 || vTmpDate.getMonth()==2 )
|
788
|
+
vNxtDate.setFullYear(vTmpDate.getFullYear(), 2, 31);
|
789
|
+
else if( vTmpDate.getMonth()==3 || vTmpDate.getMonth()==4 || vTmpDate.getMonth()==5 )
|
790
|
+
vNxtDate.setFullYear(vTmpDate.getFullYear(), 5, 30);
|
791
|
+
else if( vTmpDate.getMonth()==6 || vTmpDate.getMonth()==7 || vTmpDate.getMonth()==8 )
|
792
|
+
vNxtDate.setFullYear(vTmpDate.getFullYear(), 8, 30);
|
793
|
+
else if( vTmpDate.getMonth()==9 || vTmpDate.getMonth()==10 || vTmpDate.getMonth()==11 )
|
794
|
+
vNxtDate.setFullYear(vTmpDate.getFullYear(), 11, 31);
|
795
|
+
|
796
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
797
|
+
vWeekdayColor = "ccccff";
|
798
|
+
else
|
799
|
+
vWeekdayColor = "ffffff";
|
800
|
+
|
801
|
+
if(vNxtDate <= vMaxDate) {
|
802
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + '</div></td>';
|
803
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
804
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
805
|
+
else
|
806
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;HEIGHT: 20px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
807
|
+
} else {
|
808
|
+
vDateRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center width:'+vColWidth+'px><div style="width: '+vColWidth+'px">Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + '</div></td>';
|
809
|
+
if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
|
810
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
811
|
+
else
|
812
|
+
vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; HEIGHT: 20px;BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">  </div></td>';
|
813
|
+
}
|
814
|
+
|
815
|
+
vTmpDate.setDate(vTmpDate.getDate() + 81);
|
816
|
+
|
817
|
+
while(vTmpDate.getDate() > 1)
|
818
|
+
{
|
819
|
+
vTmpDate.setDate(vTmpDate.getDate() + 1);
|
820
|
+
}
|
821
|
+
|
822
|
+
}
|
823
|
+
}
|
824
|
+
|
825
|
+
vRightTable += vDateRowStr + '</TR>';
|
826
|
+
vRightTable += '</TBODY></TABLE>';
|
827
|
+
|
828
|
+
// Draw each row
|
829
|
+
|
830
|
+
for(i = 0; i < vTaskList.length; i++)
|
831
|
+
|
832
|
+
{
|
833
|
+
|
834
|
+
vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
|
835
|
+
vTaskStart = vTaskList[i].getStart();
|
836
|
+
vTaskEnd = vTaskList[i].getEnd();
|
837
|
+
|
838
|
+
vNumCols = 0;
|
839
|
+
vID = vTaskList[i].getID();
|
840
|
+
|
841
|
+
// vNumUnits = Math.ceil((vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000)) + 1;
|
842
|
+
vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000) + 1;
|
843
|
+
if (vFormat=='hour')
|
844
|
+
{
|
845
|
+
vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
|
846
|
+
}
|
847
|
+
else if (vFormat=='minute')
|
848
|
+
{
|
849
|
+
vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
|
850
|
+
}
|
851
|
+
|
852
|
+
if(vTaskList[i].getVisible() == 0)
|
853
|
+
vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative; display:none;">';
|
854
|
+
else
|
855
|
+
vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative">';
|
856
|
+
|
857
|
+
if( vTaskList[i].getMile()) {
|
858
|
+
|
859
|
+
vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
|
860
|
+
'<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" onMouseover=g.mouseOver(this,' + vID + ',"right","mile") onMouseout=g.mouseOut(this,' + vID + ',"right","mile")>' + vItemRowStr + '</TR></TABLE></DIV>';
|
861
|
+
|
862
|
+
// Build date string for Title
|
863
|
+
vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat);
|
864
|
+
|
865
|
+
vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);
|
866
|
+
vTaskRight = 1
|
867
|
+
|
868
|
+
vRightTable +=
|
869
|
+
'<div id=bardiv_' + vID + ' style="position:absolute; top:0px; left:' + Math.ceil((vTaskLeft * (vDayWidth) + 1)) + 'px; height: 18px; width:160px; overflow:hidden;">' +
|
870
|
+
' <div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" style="height: 16px; width:12px; overflow:hidden; cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>';
|
871
|
+
|
872
|
+
if(vTaskList[i].getCompVal() < 100)
|
873
|
+
vRightTable += '◊</div>' ;
|
874
|
+
else
|
875
|
+
vRightTable += '♦</div>' ;
|
876
|
+
|
877
|
+
if( g.getCaptionType() ) {
|
878
|
+
vCaptionStr = '';
|
879
|
+
switch( g.getCaptionType() ) {
|
880
|
+
case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
|
881
|
+
case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
|
882
|
+
case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
|
883
|
+
case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
|
884
|
+
}
|
885
|
+
//vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
|
886
|
+
vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:2px; width:120px; left:12px">' + vCaptionStr + '</div>';
|
887
|
+
}
|
888
|
+
|
889
|
+
vRightTable += '</div>';
|
890
|
+
|
891
|
+
|
892
|
+
} else {
|
893
|
+
|
894
|
+
// Build date string for Title
|
895
|
+
vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat)
|
896
|
+
|
897
|
+
if (vFormat=='minute')
|
898
|
+
{
|
899
|
+
vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 1000) + 1/vColUnit;
|
900
|
+
vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 1000));
|
901
|
+
}
|
902
|
+
else if (vFormat=='hour')
|
903
|
+
{
|
904
|
+
vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 60 * 1000) + 1/vColUnit;
|
905
|
+
vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 60 * 1000);
|
906
|
+
}
|
907
|
+
else
|
908
|
+
{
|
909
|
+
vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / (24 * 60 * 60 * 1000) + 1/vColUnit;
|
910
|
+
vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000));
|
911
|
+
if (vFormat='day')
|
912
|
+
{
|
913
|
+
var tTime=new Date();
|
914
|
+
tTime.setTime(Date.parse(vTaskList[i].getStart()));
|
915
|
+
if (tTime.getMinutes() > 29)
|
916
|
+
vTaskLeft+=.5
|
917
|
+
}
|
918
|
+
}
|
919
|
+
|
920
|
+
// Draw Group Bar which has outer div with inner group div and several small divs to left and right to create angled-end indicators
|
921
|
+
if( vTaskList[i].getGroup()) {
|
922
|
+
vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
|
923
|
+
'<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" bgColor=#f3f3f3 onMouseover=g.mouseOver(this,' + vID + ',"right","group") onMouseout=g.mouseOut(this,' + vID + ',"right","group")>' + vItemRowStr + '</TR></TABLE></DIV>';
|
924
|
+
vRightTable +=
|
925
|
+
'<div id=bardiv_' + vID + ' style="position:absolute; top:5px; left:' + Math.ceil(vTaskLeft * (vDayWidth) + 1) + 'px; height: 7px; width:' + Math.ceil((vTaskRight) * (vDayWidth) - 1) + 'px">' +
|
926
|
+
'<div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" class=gtask style="background-color:#000000; height: 7px; width:' + Math.ceil((vTaskRight) * (vDayWidth) -1) + 'px; cursor: pointer;opacity:0.9;">' +
|
927
|
+
'<div style="Z-INDEX: -4; float:left; background-color:#666666; height:3px; overflow: hidden; margin-top:1px; ' +
|
928
|
+
'margin-left:1px; margin-right:1px; filter: alpha(opacity=80); opacity:0.8; width:' + vTaskList[i].getCompStr() + '; ' +
|
929
|
+
'cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>' +
|
930
|
+
'</div>' +
|
931
|
+
'</div>' +
|
932
|
+
'<div style="Z-INDEX: -4; float:left; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
|
933
|
+
'<div style="Z-INDEX: -4; float:right; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
|
934
|
+
'<div style="Z-INDEX: -4; float:left; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
|
935
|
+
'<div style="Z-INDEX: -4; float:right; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
|
936
|
+
'<div style="Z-INDEX: -4; float:left; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
|
937
|
+
'<div style="Z-INDEX: -4; float:right; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
|
938
|
+
'<div style="Z-INDEX: -4; float:left; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' +
|
939
|
+
'<div style="Z-INDEX: -4; float:right; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' ;
|
940
|
+
|
941
|
+
if( g.getCaptionType() ) {
|
942
|
+
vCaptionStr = '';
|
943
|
+
switch( g.getCaptionType() ) {
|
944
|
+
case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
|
945
|
+
case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
|
946
|
+
case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
|
947
|
+
case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
|
948
|
+
}
|
949
|
+
//vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
|
950
|
+
vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
|
951
|
+
}
|
952
|
+
|
953
|
+
vRightTable += '</div>' ;
|
954
|
+
|
955
|
+
} else {
|
956
|
+
|
957
|
+
vDivStr = '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
|
958
|
+
'<TR id=childrow_' + vID + ' class=yesdisplay style="HEIGHT: 20px" bgColor=#ffffff onMouseover=g.mouseOver(this,' + vID + ',"right","row") onMouseout=g.mouseOut(this,' + vID + ',"right","row")>' + vItemRowStr + '</TR></TABLE></DIV>';
|
959
|
+
vRightTable += vDivStr;
|
960
|
+
|
961
|
+
// Draw Task Bar which has outer DIV with enclosed colored bar div, and opaque completion div
|
962
|
+
vRightTable +=
|
963
|
+
'<div id=bardiv_' + vID + ' style="position:absolute; top:4px; left:' + Math.ceil(vTaskLeft * (vDayWidth) + 1) + 'px; height:18px; width:' + Math.ceil((vTaskRight) * (vDayWidth) - 1) + 'px">' +
|
964
|
+
'<div id=taskbar_' + vID + ' title="' + vTaskList[i].getName() + ': ' + vDateRowStr + '" class=gtask style="background-color:#' + vTaskList[i].getColor() +'; height: 13px; width:' + Math.ceil((vTaskRight) * (vDayWidth) - 1) + 'px; cursor: pointer;opacity:0.9;" ' +
|
965
|
+
'onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); >' +
|
966
|
+
'<div class=gcomplete style="Z-INDEX: -4; float:left; background-color:black; height:5px; overflow: auto; margin-top:4px; filter: alpha(opacity=40); opacity:0.4; width:' + vTaskList[i].getCompStr() + '; overflow:hidden">' +
|
967
|
+
'</div>' +
|
968
|
+
'</div>';
|
969
|
+
|
970
|
+
if( g.getCaptionType() ) {
|
971
|
+
vCaptionStr = '';
|
972
|
+
switch( g.getCaptionType() ) {
|
973
|
+
case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
|
974
|
+
case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
|
975
|
+
case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
|
976
|
+
case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
|
977
|
+
}
|
978
|
+
//vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:-3px;">' + vCaptionStr + '</div>';
|
979
|
+
vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
|
980
|
+
}
|
981
|
+
vRightTable += '</div>' ;
|
982
|
+
|
983
|
+
|
984
|
+
|
985
|
+
}
|
986
|
+
}
|
987
|
+
|
988
|
+
vRightTable += '</DIV>';
|
989
|
+
|
990
|
+
}
|
991
|
+
|
992
|
+
vMainTable += vRightTable + '</DIV></TD></TR></TBODY></TABLE></BODY></HTML>';
|
993
|
+
|
994
|
+
vDiv.innerHTML = vMainTable;
|
995
|
+
|
996
|
+
}
|
997
|
+
|
998
|
+
} //this.draw
|
999
|
+
|
1000
|
+
this.mouseOver = function( pObj, pID, pPos, pType ) {
|
1001
|
+
if( pPos == 'right' ) vID = 'child_' + pID;
|
1002
|
+
else vID = 'childrow_' + pID;
|
1003
|
+
|
1004
|
+
pObj.bgColor = "#ffffaa";
|
1005
|
+
vRowObj = JSGantt.findObj(vID);
|
1006
|
+
if (vRowObj) vRowObj.bgColor = "#ffffaa";
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
this.mouseOut = function( pObj, pID, pPos, pType ) {
|
1010
|
+
if( pPos == 'right' ) vID = 'child_' + pID;
|
1011
|
+
else vID = 'childrow_' + pID;
|
1012
|
+
|
1013
|
+
pObj.bgColor = "#ffffff";
|
1014
|
+
vRowObj = JSGantt.findObj(vID);
|
1015
|
+
if (vRowObj) {
|
1016
|
+
if( pType == "group") {
|
1017
|
+
pObj.bgColor = "#f3f3f3";
|
1018
|
+
vRowObj.bgColor = "#f3f3f3";
|
1019
|
+
} else {
|
1020
|
+
pObj.bgColor = "#ffffff";
|
1021
|
+
vRowObj.bgColor = "#ffffff";
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
} //GanttChart
|
1027
|
+
|
1028
|
+
// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
|
1029
|
+
JSGantt.processRows = function(pList, pID, pRow, pLevel, pOpen)
|
1030
|
+
{
|
1031
|
+
|
1032
|
+
var vMinDate = new Date();
|
1033
|
+
var vMaxDate = new Date();
|
1034
|
+
var vMinSet = 0;
|
1035
|
+
var vMaxSet = 0;
|
1036
|
+
var vList = pList;
|
1037
|
+
var vLevel = pLevel;
|
1038
|
+
var i = 0;
|
1039
|
+
var vNumKid = 0;
|
1040
|
+
var vCompSum = 0;
|
1041
|
+
var vVisible = pOpen;
|
1042
|
+
|
1043
|
+
for(i = 0; i < pList.length; i++)
|
1044
|
+
{
|
1045
|
+
if(pList[i].getParent() == pID) {
|
1046
|
+
vVisible = pOpen;
|
1047
|
+
pList[i].setVisible(vVisible);
|
1048
|
+
if(vVisible==1 && pList[i].getOpen() == 0)
|
1049
|
+
vVisible = 0;
|
1050
|
+
|
1051
|
+
pList[i].setLevel(vLevel);
|
1052
|
+
vNumKid++;
|
1053
|
+
|
1054
|
+
if(pList[i].getGroup() == 1) {
|
1055
|
+
JSGantt.processRows(vList, pList[i].getID(), i, vLevel+1, vVisible);
|
1056
|
+
}
|
1057
|
+
|
1058
|
+
if( vMinSet==0 || pList[i].getStart() < vMinDate) {
|
1059
|
+
vMinDate = pList[i].getStart();
|
1060
|
+
vMinSet = 1;
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
if( vMaxSet==0 || pList[i].getEnd() > vMaxDate) {
|
1064
|
+
vMaxDate = pList[i].getEnd();
|
1065
|
+
vMaxSet = 1;
|
1066
|
+
}
|
1067
|
+
|
1068
|
+
vCompSum += pList[i].getCompVal();
|
1069
|
+
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
if(pRow >= 0) {
|
1074
|
+
pList[pRow].setStart(vMinDate);
|
1075
|
+
pList[pRow].setEnd(vMaxDate);
|
1076
|
+
pList[pRow].setNumKid(vNumKid);
|
1077
|
+
pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid));
|
1078
|
+
}
|
1079
|
+
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
|
1083
|
+
// Used to determine the minimum date of all tasks and set lower bound based on format
|
1084
|
+
JSGantt.getMinDate = function getMinDate(pList, pFormat)
|
1085
|
+
{
|
1086
|
+
|
1087
|
+
var vDate = new Date();
|
1088
|
+
|
1089
|
+
vDate.setFullYear(pList[0].getStart().getFullYear(), pList[0].getStart().getMonth(), pList[0].getStart().getDate());
|
1090
|
+
|
1091
|
+
// Parse all Task End dates to find min
|
1092
|
+
for(i = 0; i < pList.length; i++)
|
1093
|
+
{
|
1094
|
+
if(Date.parse(pList[i].getStart()) < Date.parse(vDate))
|
1095
|
+
vDate.setFullYear(pList[i].getStart().getFullYear(), pList[i].getStart().getMonth(), pList[i].getStart().getDate());
|
1096
|
+
}
|
1097
|
+
|
1098
|
+
if ( pFormat== 'minute')
|
1099
|
+
{
|
1100
|
+
vDate.setHours(0);
|
1101
|
+
vDate.setMinutes(0);
|
1102
|
+
}
|
1103
|
+
else if (pFormat == 'hour' )
|
1104
|
+
{
|
1105
|
+
vDate.setHours(0);
|
1106
|
+
vDate.setMinutes(0);
|
1107
|
+
}
|
1108
|
+
// Adjust min date to specific format boundaries (first of week or first of month)
|
1109
|
+
else if (pFormat=='day')
|
1110
|
+
{
|
1111
|
+
vDate.setDate(vDate.getDate() - 1);
|
1112
|
+
while(vDate.getDay() % 7 > 0)
|
1113
|
+
{
|
1114
|
+
vDate.setDate(vDate.getDate() - 1);
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
else if (pFormat=='week')
|
1120
|
+
{
|
1121
|
+
vDate.setDate(vDate.getDate() - 7);
|
1122
|
+
while(vDate.getDay() % 7 > 0)
|
1123
|
+
{
|
1124
|
+
vDate.setDate(vDate.getDate() - 1);
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
else if (pFormat=='month')
|
1130
|
+
{
|
1131
|
+
while(vDate.getDate() > 1)
|
1132
|
+
{
|
1133
|
+
vDate.setDate(vDate.getDate() - 1);
|
1134
|
+
}
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
else if (pFormat=='quarter')
|
1138
|
+
{
|
1139
|
+
if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
|
1140
|
+
vDate.setFullYear(vDate.getFullYear(), 0, 1);
|
1141
|
+
else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
|
1142
|
+
vDate.setFullYear(vDate.getFullYear(), 3, 1);
|
1143
|
+
else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
|
1144
|
+
vDate.setFullYear(vDate.getFullYear(), 6, 1);
|
1145
|
+
else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
|
1146
|
+
vDate.setFullYear(vDate.getFullYear(), 9, 1);
|
1147
|
+
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
return(vDate);
|
1151
|
+
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
|
1155
|
+
|
1156
|
+
|
1157
|
+
|
1158
|
+
|
1159
|
+
|
1160
|
+
// Used to determine the minimum date of all tasks and set lower bound based on format
|
1161
|
+
|
1162
|
+
JSGantt.getMaxDate = function (pList, pFormat)
|
1163
|
+
{
|
1164
|
+
var vDate = new Date();
|
1165
|
+
|
1166
|
+
vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
|
1167
|
+
|
1168
|
+
|
1169
|
+
// Parse all Task End dates to find max
|
1170
|
+
for(i = 0; i < pList.length; i++)
|
1171
|
+
{
|
1172
|
+
if(Date.parse(pList[i].getEnd()) > Date.parse(vDate))
|
1173
|
+
{
|
1174
|
+
//vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
|
1175
|
+
vDate.setTime(Date.parse(pList[i].getEnd()));
|
1176
|
+
}
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
if (pFormat == 'minute')
|
1180
|
+
{
|
1181
|
+
vDate.setHours(vDate.getHours() + 1);
|
1182
|
+
vDate.setMinutes(59);
|
1183
|
+
}
|
1184
|
+
|
1185
|
+
if (pFormat == 'hour')
|
1186
|
+
{
|
1187
|
+
vDate.setHours(vDate.getHours() + 2);
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
// Adjust max date to specific format boundaries (end of week or end of month)
|
1191
|
+
if (pFormat=='day')
|
1192
|
+
{
|
1193
|
+
vDate.setDate(vDate.getDate() + 1);
|
1194
|
+
|
1195
|
+
while(vDate.getDay() % 6 > 0)
|
1196
|
+
{
|
1197
|
+
vDate.setDate(vDate.getDate() + 1);
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
if (pFormat=='week')
|
1203
|
+
{
|
1204
|
+
//For weeks, what is the last logical boundary?
|
1205
|
+
vDate.setDate(vDate.getDate() + 11);
|
1206
|
+
|
1207
|
+
while(vDate.getDay() % 6 > 0)
|
1208
|
+
{
|
1209
|
+
vDate.setDate(vDate.getDate() + 1);
|
1210
|
+
}
|
1211
|
+
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
// Set to last day of current Month
|
1215
|
+
if (pFormat=='month')
|
1216
|
+
{
|
1217
|
+
while(vDate.getDay() > 1)
|
1218
|
+
{
|
1219
|
+
vDate.setDate(vDate.getDate() + 1);
|
1220
|
+
}
|
1221
|
+
|
1222
|
+
vDate.setDate(vDate.getDate() - 1);
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
// Set to last day of current Quarter
|
1226
|
+
if (pFormat=='quarter')
|
1227
|
+
{
|
1228
|
+
if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
|
1229
|
+
vDate.setFullYear(vDate.getFullYear(), 2, 31);
|
1230
|
+
else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
|
1231
|
+
vDate.setFullYear(vDate.getFullYear(), 5, 30);
|
1232
|
+
else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
|
1233
|
+
vDate.setFullYear(vDate.getFullYear(), 8, 30);
|
1234
|
+
else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
|
1235
|
+
vDate.setFullYear(vDate.getFullYear(), 11, 31);
|
1236
|
+
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
return(vDate);
|
1240
|
+
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
|
1244
|
+
|
1245
|
+
|
1246
|
+
|
1247
|
+
|
1248
|
+
|
1249
|
+
// This function finds the document id of the specified object
|
1250
|
+
|
1251
|
+
JSGantt.findObj = function (theObj, theDoc)
|
1252
|
+
|
1253
|
+
{
|
1254
|
+
|
1255
|
+
var p, i, foundObj;
|
1256
|
+
|
1257
|
+
if(!theDoc) theDoc = document;
|
1258
|
+
|
1259
|
+
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
|
1260
|
+
|
1261
|
+
theDoc = parent.frames[theObj.substring(p+1)].document;
|
1262
|
+
|
1263
|
+
theObj = theObj.substring(0,p);
|
1264
|
+
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
if(!(foundObj = theDoc[theObj]) && theDoc.all)
|
1268
|
+
|
1269
|
+
foundObj = theDoc.all[theObj];
|
1270
|
+
|
1271
|
+
|
1272
|
+
|
1273
|
+
for (i=0; !foundObj && i < theDoc.forms.length; i++)
|
1274
|
+
|
1275
|
+
foundObj = theDoc.forms[i][theObj];
|
1276
|
+
|
1277
|
+
|
1278
|
+
|
1279
|
+
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
|
1280
|
+
|
1281
|
+
foundObj = JSGantt.findObj(theObj,theDoc.layers[i].document);
|
1282
|
+
|
1283
|
+
|
1284
|
+
|
1285
|
+
if(!foundObj && document.getElementById)
|
1286
|
+
|
1287
|
+
foundObj = document.getElementById(theObj);
|
1288
|
+
|
1289
|
+
|
1290
|
+
|
1291
|
+
return foundObj;
|
1292
|
+
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
|
1299
|
+
JSGantt.changeFormat = function(pFormat,ganttObj) {
|
1300
|
+
|
1301
|
+
|
1302
|
+
|
1303
|
+
if(ganttObj)
|
1304
|
+
|
1305
|
+
{
|
1306
|
+
|
1307
|
+
ganttObj.setFormat(pFormat);
|
1308
|
+
|
1309
|
+
ganttObj.DrawDependencies();
|
1310
|
+
|
1311
|
+
}
|
1312
|
+
|
1313
|
+
else
|
1314
|
+
|
1315
|
+
alert('Chart undefined');
|
1316
|
+
|
1317
|
+
|
1318
|
+
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
|
1322
|
+
|
1323
|
+
|
1324
|
+
|
1325
|
+
// Function to open/close and hide/show children of specified task
|
1326
|
+
|
1327
|
+
JSGantt.folder= function (pID,ganttObj) {
|
1328
|
+
|
1329
|
+
var vList = ganttObj.getList();
|
1330
|
+
|
1331
|
+
for(i = 0; i < vList.length; i++)
|
1332
|
+
{
|
1333
|
+
if(vList[i].getID() == pID) {
|
1334
|
+
|
1335
|
+
if( vList[i].getOpen() == 1 ) {
|
1336
|
+
vList[i].setOpen(0);
|
1337
|
+
JSGantt.hide(pID,ganttObj);
|
1338
|
+
|
1339
|
+
if (JSGantt.isIE())
|
1340
|
+
JSGantt.findObj('group_'+pID).innerText = '+';
|
1341
|
+
else
|
1342
|
+
JSGantt.findObj('group_'+pID).textContent = '+';
|
1343
|
+
|
1344
|
+
} else {
|
1345
|
+
|
1346
|
+
vList[i].setOpen(1);
|
1347
|
+
|
1348
|
+
JSGantt.show(pID, 1, ganttObj);
|
1349
|
+
|
1350
|
+
if (JSGantt.isIE())
|
1351
|
+
JSGantt.findObj('group_'+pID).innerText = '�';
|
1352
|
+
else
|
1353
|
+
JSGantt.findObj('group_'+pID).textContent = '�';
|
1354
|
+
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
}
|
1358
|
+
}
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
JSGantt.hide= function (pID,ganttObj) {
|
1362
|
+
var vList = ganttObj.getList();
|
1363
|
+
var vID = 0;
|
1364
|
+
|
1365
|
+
for(var i = 0; i < vList.length; i++)
|
1366
|
+
{
|
1367
|
+
if(vList[i].getParent() == pID) {
|
1368
|
+
vID = vList[i].getID();
|
1369
|
+
JSGantt.findObj('child_' + vID).style.display = "none";
|
1370
|
+
JSGantt.findObj('childgrid_' + vID).style.display = "none";
|
1371
|
+
vList[i].setVisible(0);
|
1372
|
+
if(vList[i].getGroup() == 1)
|
1373
|
+
JSGantt.hide(vID,ganttObj);
|
1374
|
+
}
|
1375
|
+
|
1376
|
+
}
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
// Function to show children of specified task
|
1380
|
+
JSGantt.show = function (pID, pTop, ganttObj) {
|
1381
|
+
var vList = ganttObj.getList();
|
1382
|
+
var vID = 0;
|
1383
|
+
|
1384
|
+
for(var i = 0; i < vList.length; i++)
|
1385
|
+
{
|
1386
|
+
if(vList[i].getParent() == pID) {
|
1387
|
+
vID = vList[i].getID();
|
1388
|
+
if(pTop == 1) {
|
1389
|
+
if (JSGantt.isIE()) { // IE;
|
1390
|
+
|
1391
|
+
if( JSGantt.findObj('group_'+pID).innerText == '+') {
|
1392
|
+
JSGantt.findObj('child_'+vID).style.display = "";
|
1393
|
+
JSGantt.findObj('childgrid_'+vID).style.display = "";
|
1394
|
+
vList[i].setVisible(1);
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
} else {
|
1398
|
+
|
1399
|
+
if( JSGantt.findObj('group_'+pID).textContent == '+') {
|
1400
|
+
JSGantt.findObj('child_'+vID).style.display = "";
|
1401
|
+
JSGantt.findObj('childgrid_'+vID).style.display = "";
|
1402
|
+
vList[i].setVisible(1);
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
} else {
|
1408
|
+
|
1409
|
+
if (JSGantt.isIE()) { // IE;
|
1410
|
+
if( JSGantt.findObj('group_'+pID).innerText == '�') {
|
1411
|
+
JSGantt.findObj('child_'+vID).style.display = "";
|
1412
|
+
JSGantt.findObj('childgrid_'+vID).style.display = "";
|
1413
|
+
vList[i].setVisible(1);
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
} else {
|
1417
|
+
|
1418
|
+
if( JSGantt.findObj('group_'+pID).textContent == '�') {
|
1419
|
+
JSGantt.findObj('child_'+vID).style.display = "";
|
1420
|
+
JSGantt.findObj('childgrid_'+vID).style.display = "";
|
1421
|
+
vList[i].setVisible(1);
|
1422
|
+
}
|
1423
|
+
}
|
1424
|
+
}
|
1425
|
+
|
1426
|
+
if(vList[i].getGroup() == 1)
|
1427
|
+
JSGantt.show(vID, 0,ganttObj);
|
1428
|
+
|
1429
|
+
}
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
|
1434
|
+
|
1435
|
+
|
1436
|
+
|
1437
|
+
// function to open window to display task link
|
1438
|
+
|
1439
|
+
JSGantt.taskLink = function(pRef,pWidth,pHeight)
|
1440
|
+
|
1441
|
+
{
|
1442
|
+
|
1443
|
+
if(pWidth) vWidth =pWidth; else vWidth =400;
|
1444
|
+
if(pHeight) vHeight=pHeight; else vHeight=400;
|
1445
|
+
|
1446
|
+
var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
1447
|
+
|
1448
|
+
}
|
1449
|
+
|
1450
|
+
JSGantt.parseDateStr = function(pDateStr,pFormatStr) {
|
1451
|
+
var vDate =new Date();
|
1452
|
+
vDate.setTime( Date.parse(pDateStr));
|
1453
|
+
|
1454
|
+
switch(pFormatStr)
|
1455
|
+
{
|
1456
|
+
case 'mm/dd/yyyy':
|
1457
|
+
var vDateParts = pDateStr.split('/');
|
1458
|
+
vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));
|
1459
|
+
break;
|
1460
|
+
case 'dd/mm/yyyy':
|
1461
|
+
var vDateParts = pDateStr.split('/');
|
1462
|
+
vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));
|
1463
|
+
break;
|
1464
|
+
case 'yyyy-mm-dd':
|
1465
|
+
var vDateParts = pDateStr.split('-');
|
1466
|
+
vDate.setFullYear(parseInt(vDateParts[0], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[1], 10));
|
1467
|
+
break;
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
return(vDate);
|
1471
|
+
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
JSGantt.formatDateStr = function(pDate,pFormatStr) {
|
1475
|
+
vYear4Str = pDate.getFullYear() + '';
|
1476
|
+
vYear2Str = vYear4Str.substring(2,4);
|
1477
|
+
vMonthStr = (pDate.getMonth()+1) + '';
|
1478
|
+
vDayStr = pDate.getDate() + '';
|
1479
|
+
|
1480
|
+
var vDateStr = "";
|
1481
|
+
|
1482
|
+
switch(pFormatStr) {
|
1483
|
+
case 'mm/dd/yyyy':
|
1484
|
+
return( vMonthStr + '/' + vDayStr + '/' + vYear4Str );
|
1485
|
+
case 'dd/mm/yyyy':
|
1486
|
+
return( vDayStr + '/' + vMonthStr + '/' + vYear4Str );
|
1487
|
+
case 'yyyy-mm-dd':
|
1488
|
+
return( vYear4Str + '-' + vMonthStr + '-' + vDayStr );
|
1489
|
+
case 'mm/dd/yy':
|
1490
|
+
return( vMonthStr + '/' + vDayStr + '/' + vYear2Str );
|
1491
|
+
case 'dd/mm/yy':
|
1492
|
+
return( vDayStr + '/' + vMonthStr + '/' + vYear2Str );
|
1493
|
+
case 'yy-mm-dd':
|
1494
|
+
return( vYear2Str + '-' + vMonthStr + '-' + vDayStr );
|
1495
|
+
case 'mm/dd':
|
1496
|
+
return( vMonthStr + '/' + vDayStr );
|
1497
|
+
case 'dd/mm':
|
1498
|
+
return( vDayStr + '/' + vMonthStr );
|
1499
|
+
}
|
1500
|
+
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
JSGantt.parseXML = function(ThisFile,pGanttVar){
|
1504
|
+
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; // Is this Chrome
|
1505
|
+
|
1506
|
+
try { //Internet Explorer
|
1507
|
+
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
|
1508
|
+
}
|
1509
|
+
catch(e) {
|
1510
|
+
try { //Firefox, Mozilla, Opera, Chrome etc.
|
1511
|
+
if (is_chrome==false) { xmlDoc=document.implementation.createDocument("","",null); }
|
1512
|
+
}
|
1513
|
+
catch(e) {
|
1514
|
+
alert(e.message);
|
1515
|
+
return;
|
1516
|
+
}
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
if (is_chrome==false) { // can't use xmlDoc.load in chrome at the moment
|
1520
|
+
xmlDoc.async=false;
|
1521
|
+
xmlDoc.load(ThisFile); // we can use loadxml
|
1522
|
+
JSGantt.AddXMLTask(pGanttVar)
|
1523
|
+
xmlDoc=null; // a little tidying
|
1524
|
+
Task = null;
|
1525
|
+
}
|
1526
|
+
else {
|
1527
|
+
JSGantt.ChromeLoadXML(ThisFile,pGanttVar);
|
1528
|
+
ta=null; // a little tidying
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
|
1532
|
+
JSGantt.AddXMLTask = function(pGanttVar){
|
1533
|
+
|
1534
|
+
Task=xmlDoc.getElementsByTagName("task");
|
1535
|
+
|
1536
|
+
var n = xmlDoc.documentElement.childNodes.length; // the number of tasks. IE gets this right, but mozilla add extra ones (Whitespace)
|
1537
|
+
|
1538
|
+
for(var i=0;i<n;i++) {
|
1539
|
+
|
1540
|
+
// optional parameters may not have an entry (Whitespace from mozilla also returns an error )
|
1541
|
+
// Task ID must NOT be zero other wise it will be skipped
|
1542
|
+
try { pID = Task[i].getElementsByTagName("pID")[0].childNodes[0].nodeValue;
|
1543
|
+
} catch (error) {pID =0;}
|
1544
|
+
pID *= 1; // make sure that these are numbers rather than strings in order to make jsgantt.js behave as expected.
|
1545
|
+
|
1546
|
+
if(pID!=0){
|
1547
|
+
try { pName = Task[i].getElementsByTagName("pName")[0].childNodes[0].nodeValue;
|
1548
|
+
} catch (error) {pName ="No Task Name";} // If there is no corresponding entry in the XML file the set a default.
|
1549
|
+
|
1550
|
+
try { pColor = Task[i].getElementsByTagName("pColor")[0].childNodes[0].nodeValue;
|
1551
|
+
} catch (error) {pColor ="0000ff";}
|
1552
|
+
|
1553
|
+
try { pParent = Task[i].getElementsByTagName("pParent")[0].childNodes[0].nodeValue;
|
1554
|
+
} catch (error) {pParent =0;}
|
1555
|
+
pParent *= 1;
|
1556
|
+
|
1557
|
+
try { pStart = Task[i].getElementsByTagName("pStart")[0].childNodes[0].nodeValue;
|
1558
|
+
} catch (error) {pStart ="";}
|
1559
|
+
|
1560
|
+
try { pEnd = Task[i].getElementsByTagName("pEnd")[0].childNodes[0].nodeValue;
|
1561
|
+
} catch (error) { pEnd ="";}
|
1562
|
+
|
1563
|
+
try { pLink = Task[i].getElementsByTagName("pLink")[0].childNodes[0].nodeValue;
|
1564
|
+
} catch (error) { pLink ="";}
|
1565
|
+
|
1566
|
+
try { pMile = Task[i].getElementsByTagName("pMile")[0].childNodes[0].nodeValue;
|
1567
|
+
} catch (error) { pMile=0;}
|
1568
|
+
pMile *= 1;
|
1569
|
+
|
1570
|
+
try { pRes = Task[i].getElementsByTagName("pRes")[0].childNodes[0].nodeValue;
|
1571
|
+
} catch (error) { pRes ="";}
|
1572
|
+
|
1573
|
+
try { pComp = Task[i].getElementsByTagName("pComp")[0].childNodes[0].nodeValue;
|
1574
|
+
} catch (error) {pComp =0;}
|
1575
|
+
pComp *= 1;
|
1576
|
+
|
1577
|
+
try { pGroup = Task[i].getElementsByTagName("pGroup")[0].childNodes[0].nodeValue;
|
1578
|
+
} catch (error) {pGroup =0;}
|
1579
|
+
pGroup *= 1;
|
1580
|
+
|
1581
|
+
try { pOpen = Task[i].getElementsByTagName("pOpen")[0].childNodes[0].nodeValue;
|
1582
|
+
} catch (error) { pOpen =1;}
|
1583
|
+
pOpen *= 1;
|
1584
|
+
|
1585
|
+
try { pDepend = Task[i].getElementsByTagName("pDepend")[0].childNodes[0].nodeValue;
|
1586
|
+
} catch (error) { pDepend =0;}
|
1587
|
+
//pDepend *= 1;
|
1588
|
+
if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
|
1589
|
+
|
1590
|
+
try { pCaption = Task[i].getElementsByTagName("pCaption")[0].childNodes[0].nodeValue;
|
1591
|
+
} catch (error) { pCaption ="";}
|
1592
|
+
|
1593
|
+
|
1594
|
+
// Finally add the task
|
1595
|
+
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption));
|
1596
|
+
}
|
1597
|
+
}
|
1598
|
+
}
|
1599
|
+
|
1600
|
+
JSGantt.ChromeLoadXML = function(ThisFile,pGanttVar){
|
1601
|
+
// Thanks to vodobas at mindlence,com for the initial pointers here.
|
1602
|
+
XMLLoader = new XMLHttpRequest();
|
1603
|
+
XMLLoader.onreadystatechange= function(){
|
1604
|
+
JSGantt.ChromeXMLParse(pGanttVar);
|
1605
|
+
};
|
1606
|
+
XMLLoader.open("GET", ThisFile, false);
|
1607
|
+
XMLLoader.send(null);
|
1608
|
+
}
|
1609
|
+
|
1610
|
+
JSGantt.ChromeXMLParse = function (pGanttVar){
|
1611
|
+
// Manually parse the file as it is loads quicker
|
1612
|
+
if (XMLLoader.readyState == 4) {
|
1613
|
+
var ta=XMLLoader.responseText.split(/<task>/gi);
|
1614
|
+
|
1615
|
+
var n = ta.length; // the number of tasks.
|
1616
|
+
for(var i=1;i<n;i++) {
|
1617
|
+
Task = ta[i].replace(/<[/]p/g, '<p');
|
1618
|
+
var te = Task.split(/<pid>/i)
|
1619
|
+
|
1620
|
+
if(te.length> 2){var pID=te[1];} else {var pID = 0;}
|
1621
|
+
pID *= 1;
|
1622
|
+
|
1623
|
+
var te = Task.split(/<pName>/i)
|
1624
|
+
if(te.length> 2){var pName=te[1];} else {var pName = "No Task Name";}
|
1625
|
+
|
1626
|
+
var te = Task.split(/<pstart>/i)
|
1627
|
+
if(te.length> 2){var pStart=te[1];} else {var pStart = "";}
|
1628
|
+
|
1629
|
+
var te = Task.split(/<pEnd>/i)
|
1630
|
+
if(te.length> 2){var pEnd=te[1];} else {var pEnd = "";}
|
1631
|
+
|
1632
|
+
var te = Task.split(/<pColor>/i)
|
1633
|
+
if(te.length> 2){var pColor=te[1];} else {var pColor = '0000ff';}
|
1634
|
+
|
1635
|
+
var te = Task.split(/<pLink>/i)
|
1636
|
+
if(te.length> 2){var pLink=te[1];} else {var pLink = "";}
|
1637
|
+
|
1638
|
+
var te = Task.split(/<pMile>/i)
|
1639
|
+
if(te.length> 2){var pMile=te[1];} else {var pMile = 0;}
|
1640
|
+
pMile *= 1;
|
1641
|
+
|
1642
|
+
var te = Task.split(/<pRes>/i)
|
1643
|
+
if(te.length> 2){var pRes=te[1];} else {var pRes = "";}
|
1644
|
+
|
1645
|
+
var te = Task.split(/<pComp>/i)
|
1646
|
+
if(te.length> 2){var pComp=te[1];} else {var pComp = 0;}
|
1647
|
+
pComp *= 1;
|
1648
|
+
|
1649
|
+
var te = Task.split(/<pGroup>/i)
|
1650
|
+
if(te.length> 2){var pGroup=te[1];} else {var pGroup = 0;}
|
1651
|
+
pGroup *= 1;
|
1652
|
+
|
1653
|
+
var te = Task.split(/<pParent>/i)
|
1654
|
+
if(te.length> 2){var pParent=te[1];} else {var pParent = 0;}
|
1655
|
+
pParent *= 1;
|
1656
|
+
|
1657
|
+
var te = Task.split(/<pOpen>/i)
|
1658
|
+
if(te.length> 2){var pOpen=te[1];} else {var pOpen = 1;}
|
1659
|
+
pOpen *= 1;
|
1660
|
+
|
1661
|
+
var te = Task.split(/<pDepend>/i)
|
1662
|
+
if(te.length> 2){var pDepend=te[1];} else {var pDepend = "";}
|
1663
|
+
//pDepend *= 1;
|
1664
|
+
if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
|
1665
|
+
|
1666
|
+
var te = Task.split(/<pCaption>/i)
|
1667
|
+
if(te.length> 2){var pCaption=te[1];} else {var pCaption = "";}
|
1668
|
+
|
1669
|
+
// Finally add the task
|
1670
|
+
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption ));
|
1671
|
+
}
|
1672
|
+
}
|
1673
|
+
}
|
1674
|
+
|
1675
|
+
JSGantt.benchMark = function(pItem){
|
1676
|
+
var vEndTime=new Date().getTime();
|
1677
|
+
alert(pItem + ': Elapsed time: '+((vEndTime-vBenchTime)/1000)+' seconds.');
|
1678
|
+
vBenchTime=new Date().getTime();
|
1679
|
+
}
|
1680
|
+
|
1681
|
+
|