r77293 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77292‎ | r77293 | r77294 >
Date:17:00, 25 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
svn:eol-style native
Modified paths:
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter7.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter7.css (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/demo.html (modified) (history)
  • /trunk/extensions/SVGEdit/svg-edit/svg-editor.html (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/INSTALL (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/README (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/SemanticProjectManagement.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_Alias.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_GanttChart.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_Messages.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_ProjectManagementClass.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_SpecialPage.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_WBS.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/calendar.css (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_db.js (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_eu.js (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_us.js (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/license.txt (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/calendar/readme.txt (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/ganttchart/copyright.txt (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.css (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.js (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/ganttchart/test.html (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/libs/jscolor/jscolor.js (modified) (history)

Diff [purge]

Property changes on: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback-beta/ext.articleFeedback-beta.html
___________________________________________________________________
Added: svn:eol-style
11 + native
Property changes on: trunk/extensions/SemanticProjectManagement/INSTALL
___________________________________________________________________
Added: svn:eol-style
22 + native
Property changes on: trunk/extensions/SemanticProjectManagement/RELEASE-NOTES
___________________________________________________________________
Added: svn:eol-style
33 + native
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_WBS.php
___________________________________________________________________
Added: svn:eol-style
44 + native
Index: trunk/extensions/SemanticProjectManagement/includes/SPM_SpecialPage.php
@@ -1,440 +1,440 @@
2 -<?php
3 -/*******************************************************************************
4 - *
5 - * Copyright (c) 2010 Jonas Bissinger
6 - *
7 - * Semantic Project Management is free software: you can redistribute it and/or modify
8 - * it under the terms of the GNU General Public License as published by
9 - * the Free Software Foundation, either version 3 of the License, or
10 - * (at your option) any later version.
11 - *
12 - * Semantic Project Management is distributed in the hope that it will be useful,
13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 - * GNU General Public License for more details.
16 - *
17 - * You should have received a copy of the GNU General Public License
18 - * along with Semantic Project Management. If not, see <http://www.gnu.org/licenses/>.
19 - *******************************************************************************/
20 -
21 -/**
22 - *
23 - * @author Jonas Bissinger
24 - *
25 - * @ingroup SemanticProjectManagement
26 - *
27 - */
28 -
29 -class SemanticProjectManagement extends SpecialPage
30 -{
31 -
32 -
33 - /**
34 - * Constructor
35 - */
36 - function __construct() {
37 - parent::__construct( 'SemanticProjectManagement' );
38 - wfLoadExtensionMessages( 'SemanticProjectManagement' );
39 - }
40 - //main class
41 - function execute( $par ){
42 -
43 - global $wgRequest,$wgOut,$wgUser;
44 -
45 - $page = 0;
46 - $this->setHeaders();
47 -
48 - //check if user is allowed to access special page
49 - if ( ! $wgUser->isAllowed('SPMsetup') ) {
50 - $wgOut->permissionRequired('SPMsetup');
51 - return;
52 - }
53 -
54 - if ($wgRequest->getCheck('page2')) {
55 - $page = 2;
56 -
57 - $levels = $wgRequest->getVal('level');
58 - if ($levels == "") $levels = 1;
59 - $text = self::getPage1Text($levels);
60 - }
61 -
62 - if ($wgRequest->getCheck('page3')) {
63 - $page = 3;
64 - $levels = $wgRequest->getVal('level');
65 - if ($wgRequest->getVal('allSame')=="on") $allSame = 1;
66 - else $allSame = 0;
67 - $text = self::getPage2Text($levels,$allSame);
68 -
69 - }
70 -
71 - if ($wgRequest->getCheck('calendar')) {
72 - $page = 4;
73 - $date = $wgRequest->getVal('startmonth');
74 - $text = self::getCalendarText($date);
75 -
76 - }
77 -
78 -
79 - if (($page == 0)||($wgRequest->getCheck('page1')||($wgRequest->getCheck('page1refresh')) ||($wgRequest->getCheck('calendarRefresh')))) {
80 - $page = 1;
81 - $text = self::getPage0Text();
82 - }
83 -
84 - $wgOut->addHTML($text);
85 -
86 - }
87 -
88 -
89 - function writeSetupData($level,$m0,$allSame,$cat,$props,$colors){
90 -
91 - //structure: levels{**}M0{**}$allSame{**}cat[0]{**}color[0]{**}property[0]{**}cat[1]...
92 -
93 - $newtext = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--";
94 - $newtext .= $level."{**}".$m0."{**}".$allSame."{**}";
95 -
96 - for ($i = 0; $i<$level; $i++){
97 - $newtext .= $cat[$i]."{**}".$colors[$i]."{**}".$props[$i]."{**}";
98 - }
99 -
100 - $newtext .= "-->";
101 -
102 - $title = Title::newFromText("SPM_Setup");
103 - $article = new Article($title);
104 - $article->doEdit($newtext, "settings change", EDIT_UPDATE);
105 -
106 - }
107 -
108 - function getSetupData(){
109 -
110 - //get values from SPM_setup
111 - $title = Title::newFromText("SPM_Setup");
112 - $article = new Article($title);
113 - $wikitext = $article->getContent();
114 -
115 - $pos1 = strpos($wikitext,"<!--");
116 - $pos2 = strpos($wikitext,"-->");
117 - $data = substr($wikitext,$pos1+4,$pos2-$pos1-4);
118 -
119 - $textarr = explode("{**}",$data);
120 - $levels = (int) $textarr[0];
121 -
122 -
123 - //check if data on SPM_setup is valid
124 - //todo: better check!
125 - //echo "SIZE: ".(sizeof($textarr))."<br/>";
126 - if ((3*$levels) != (sizeof($textarr)-4)) return false;
127 - return $textarr;
128 -
129 - }
130 -
131 - //checks if all values in an array are different
132 - function checkAllDifferent($arr){
133 -
134 - $check = array();
135 - for ($i = 0;$i<sizeof($arr);$i++){
136 - if (isset($check[$arr[$i]])) return false;
137 - else $check[$arr[$i]] = 1;
138 - }
139 - return true;
140 - }
141 -
142 - //checks if all values in an array are identical
143 - function checkAllSame($arr){
144 - for ($i = 1;$i<sizeof($arr);$i++){
145 - if ($arr[0] != $arr[$i]) return false;
146 - }
147 - return true;
148 - }
149 -
150 -
151 - function getPage0Text(){
152 -
153 - global $wgRequest;
154 -
155 - $startmonth = "";
156 - $setting = "";
157 -
158 - if ($wgRequest->getCheck('calendarRefresh')){
159 - $startmonth = $wgRequest->getVal('testinput');
160 - }
161 -
162 - //page is reached after changes have been made
163 - if ($wgRequest->getCheck('page1refresh')){
164 -
165 - $arr = self::getSetupData();
166 - $m0 = $arr[1];
167 - $allSame = $arr[2];
168 -
169 - //echo "loaded m0: ".$m0;
170 -
171 - $l = $wgRequest->getVal('level');
172 -
173 - $cat = array();
174 - $col = array();
175 - $prop = array();
176 -
177 - for ($i = 1; $i<=$l; $i++){
178 -
179 - $cat[$i-1] = $wgRequest->getVal('category'.$i);
180 - $col[$i-1] = $wgRequest->getVal('color'.$i);
181 - $prop[$i-1] = $wgRequest->getVal('property'.$i);
182 - }
183 -
184 - $allSame = $wgRequest->getVal('allSame');
185 -
186 - $valid = true;
187 - $error = "";
188 -
189 - if ($allSame == 1) {
190 - $valid = (self::checkAllSame($cat))&&(self::checkAllSame(array_slice($prop,1)));
191 - $error = "<br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> All categories/properties have to be identical <br/> <br/>";
192 - }
193 - if ($allSame == 0){
194 - $valid = self::checkAllDifferent($cat);
195 - $error = "<br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> All categories have to be different! <br/> <br/>";
196 - }
197 -
198 - if ($valid) self::writeSetupData($l,$m0,$allSame,$cat,$prop,$col);
199 - else $setting .= $error;
200 -
201 - }
202 -
203 - //page is reached after m0 has been changed
204 - if ($wgRequest->getCheck('calendarRefresh')){
205 - $startmonth = $wgRequest->getVal('testinput');
206 -
207 - $arr = self::getSetupData();
208 -
209 - $arr[1] = $startmonth;
210 - $result = implode("{**}",$arr);
211 -
212 - $newtext = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--";
213 - $newtext .= $result;
214 - $newtext .= "-->";
215 -
216 -
217 - //save SPM_Setup with new m0
218 - $title = Title::newFromText("SPM_Setup");
219 - $article = new Article($title);
220 -
221 - $article->doEdit($newtext , "startmonth change");
222 - }
223 -
224 -
225 - //check if data is valid
226 - if (self::getSetupData() == false) {
227 -
228 - //fill SPM_Setup with default values
229 - $title = Title::newFromText("SPM_Setup");
230 - $article = new Article($title);
231 - $defaultText = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--3{**}06/01/2009{**}false{**}Work Package{**}FF0000{**}{**}Task{**}FFEE05{**}Part of{**}Deliverable{**}09FF00{**}Part of{**}-->";
232 - $article->doEdit($defaultText , "default restored");
233 -
234 - //create error message
235 - $setting .= " <br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> <br/> Default setting restored! <br/><br/>";
236 - }
237 -
238 -
239 - //data is valid
240 - $textarr = self::getSetupData();
241 - $levels = $textarr[0];
242 - $m0 = $textarr[1];
243 - $allSame = $textarr[2];
244 - $setting .= " <b> Current Setting: </b> <br/> <br/> <table border = \"0\" cellpadding=\"3\" cellspacing=\"5\"><tr bgcolor = \"#A3D5E4\"><th>Level</th><th>Category</th><th>Color</th><th>Property</th><tr>";
245 - for ($i = 0; $i < $levels; $i++){
246 - $triple = array_splice($textarr,3,3);
247 -
248 - if ($triple[2] == "") $triple[2] = "-";
249 - $setting .= "<tr> <td align=\"center\">".($i+1)."</td> <td>".$triple[0]."</td> <td width=\"100\" bgcolor=\"#".$triple[1]."\" height=\"21\"></td> <td td align=\"center\">".$triple[2]." </td></tr>";
250 -
251 - }
252 -
253 - $setting .= "</table>";
254 -
255 -
256 - $text =<<<END
257 -<html>
258 -<head>
259 -
260 -</head>
261 -<body>
262 -
263 - $setting
264 - <br/>
265 - <br/>
266 - <b> Project Start Month (M0): $m0 </b>
267 - <br/>
268 - <br/>
269 - <form enctype="multipart/form-data" action="" method="post" name="page0">
270 -<input type="hidden" name="level" value="$levels">
271 -<input type="hidden" name="startmonth" value="$m0">
272 - <p><input type="Submit" name="page2" value="Change Setting"><input type="Submit" name="calendar" value="Change Startmonth"></p>
273 -
274 - </form>
275 -</body>
276 -END;
277 -
278 - return $text;
279 - }
280 -
281 -
282 - function getCalendarText($date){
283 -
284 - global $spmgScriptPath;
285 -
286 - $text =<<<END
287 -
288 -<html>
289 -<head>
290 - <link rel="stylesheet" type="text/css" href="$spmgScriptPath/libs/calendar/calendar.css" />
291 - <script language="javascript" src="$spmgScriptPath/libs/calendar/calendar_us.js"></script>
292 -
293 -</head>
294 -<body>
295 -
296 -Please enter Project Startmonth (M0):
297 -
298 -<form name="testform" enctype="multipart/form-data" action="" method="post">
299 -
300 - <input type="text" name="testinput" value="$date" />
301 - <script language="javascript">
302 - var A_CALTPL = {
303 - 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
304 - 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
305 - 'yearscroll': true, // show year scroller
306 - 'weekstart': 0, // first day of week: 0-Su or 1-Mo
307 - 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
308 - 'imgpath' : '$spmgScriptPath/libs/calendar/img/'
309 - }
310 - new tcal ({
311 - 'formname': 'testform',
312 - 'controlname': 'testinput'},
313 -
314 - A_CALTPL);
315 - </script>
316 -
317 -
318 -<p><input type="Submit" name="calendarRefresh" value="Save"><input type="Submit" name="page0" value="Cancel"></p>
319 -</form>
320 -
321 -
322 -</body>
323 -</html>
324 -END;
325 -
326 - return $text;
327 -
328 - }
329 -
330 -
331 - function getPage1Text($levels){
332 -
333 - $checkbox = "";
334 -
335 - //$checkbox = "<p><input type=\"checkbox\" name=\"allSame\"> All Levels have same Category/Property </p>";
336 - //uncomment last line to enable allSame checkbox
337 -
338 - $s = array("","","","","","","","","","");
339 - $s[$levels] = "selected";
340 -
341 - $text =<<<END
342 -
343 -<form enctype="multipart/form-data" action="" method="post">
344 -<p>Please select number of levels:
345 -<select name="level">
346 - <option value="1" $s[1]>1</option>
347 - <option value="2" $s[2]>2</option>
348 - <option value="3" $s[3]>3</option>
349 - <option value="4" $s[4]>4</option>
350 - <option value="5" $s[5]>5</option>
351 - <option value="6" $s[6]>6</option>
352 - <option value="7" $s[7]>7</option>
353 - <option value="8" $s[8]>8</option>
354 - <option value="9" $s[9]>9</option>
355 - </select>
356 -$checkbox
357 -<p><input type="Submit" name="page3" value="Continue"><input type="Submit" name="page0" value="Cancel"></p>
358 -</form>
359 -
360 -END;
361 -
362 - return $text;
363 - }
364 -
365 - function getPage2Text($levels,$allSame){
366 -
367 - global $spmgScriptPath;
368 -
369 - //echo " allSame:".$allSame."<br/>";
370 -
371 - if (self::getSetupData() != false) $textarr = self::getSetupData();
372 - else return "<br/> Internal error: Please reload Special:SemanticProjectManagement <br/>";
373 -
374 -
375 - $l = $textarr[0];
376 - $text =<<<END
377 -
378 -<html>
379 -<head>
380 -<script type="text/javascript" src="$spmgScriptPath/libs/jscolor/jscolor.js"></script>
381 -</head>
382 -<body>
383 -<form enctype="multipart/form-data" action="" method="post" name="page2">
384 -<table>
385 -<tr>
386 -END;
387 -
388 -
389 - for ( $i = 0; $i < $levels; $i += 1) {
390 -
391 - $triple = array_splice($textarr,3,3);
392 -
393 - if ($i < $l) $text .= self::generateLevelBox($i+1, $triple[0], $triple[2], $triple[1]);
394 - else $text .= self::generateLevelBox($i+1, "", "", "", "ffffff", 0);
395 -
396 - if (($i+1)%4 == 0) {
397 - $text.= "</tr> <tr>";
398 - }
399 - }
400 -
401 - $text .=<<<END
402 -</tr>
403 -</table>
404 -<input type="hidden" name="allSame" value="$allSame">
405 -<input type="hidden" name="level" value="$levels">
406 -<p><input type="Submit" name="page1refresh" value="Save"><input type="Submit" name="page0" value="Cancel"></p>
407 -</form>
408 -</body>
409 -</html>
410 -END;
411 -
412 - return $text;
413 - }
414 -
415 - function generateLevelBox($index, $category, $property, $color){
416 -
417 - $low = $index-1;
418 - $propbox = "";
419 - if ($low != 0) $propbox ="<p> Connecting Property to Level $low: <input style=\"width: 100%;\" type=\"text\" name=\"property$index\" value=\"$property\"/></p>";
420 -
421 - $text =<<<END
422 -<td>
423 -<fieldset style="width: 220px;">
424 -<legend>
425 -Level $index
426 -</legend>
427 -<p> Category: <input style="width: 100%;" type="text" name="category$index" value="$category"/> </p>
428 -
429 -<p> Color: <input style="width: 100%;" class="color" name="color$index" value="$color"/></p>
430 -
431 -$propbox
432 -</fieldset>
433 -<td>
434 -
435 -END;
436 -
437 - return $text;
438 -
439 - }
440 -
 2+<?php
 3+/*******************************************************************************
 4+ *
 5+ * Copyright (c) 2010 Jonas Bissinger
 6+ *
 7+ * Semantic Project Management is free software: you can redistribute it and/or modify
 8+ * it under the terms of the GNU General Public License as published by
 9+ * the Free Software Foundation, either version 3 of the License, or
 10+ * (at your option) any later version.
 11+ *
 12+ * Semantic Project Management is distributed in the hope that it will be useful,
 13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15+ * GNU General Public License for more details.
 16+ *
 17+ * You should have received a copy of the GNU General Public License
 18+ * along with Semantic Project Management. If not, see <http://www.gnu.org/licenses/>.
 19+ *******************************************************************************/
 20+
 21+/**
 22+ *
 23+ * @author Jonas Bissinger
 24+ *
 25+ * @ingroup SemanticProjectManagement
 26+ *
 27+ */
 28+
 29+class SemanticProjectManagement extends SpecialPage
 30+{
 31+
 32+
 33+ /**
 34+ * Constructor
 35+ */
 36+ function __construct() {
 37+ parent::__construct( 'SemanticProjectManagement' );
 38+ wfLoadExtensionMessages( 'SemanticProjectManagement' );
 39+ }
 40+ //main class
 41+ function execute( $par ){
 42+
 43+ global $wgRequest,$wgOut,$wgUser;
 44+
 45+ $page = 0;
 46+ $this->setHeaders();
 47+
 48+ //check if user is allowed to access special page
 49+ if ( ! $wgUser->isAllowed('SPMsetup') ) {
 50+ $wgOut->permissionRequired('SPMsetup');
 51+ return;
 52+ }
 53+
 54+ if ($wgRequest->getCheck('page2')) {
 55+ $page = 2;
 56+
 57+ $levels = $wgRequest->getVal('level');
 58+ if ($levels == "") $levels = 1;
 59+ $text = self::getPage1Text($levels);
 60+ }
 61+
 62+ if ($wgRequest->getCheck('page3')) {
 63+ $page = 3;
 64+ $levels = $wgRequest->getVal('level');
 65+ if ($wgRequest->getVal('allSame')=="on") $allSame = 1;
 66+ else $allSame = 0;
 67+ $text = self::getPage2Text($levels,$allSame);
 68+
 69+ }
 70+
 71+ if ($wgRequest->getCheck('calendar')) {
 72+ $page = 4;
 73+ $date = $wgRequest->getVal('startmonth');
 74+ $text = self::getCalendarText($date);
 75+
 76+ }
 77+
 78+
 79+ if (($page == 0)||($wgRequest->getCheck('page1')||($wgRequest->getCheck('page1refresh')) ||($wgRequest->getCheck('calendarRefresh')))) {
 80+ $page = 1;
 81+ $text = self::getPage0Text();
 82+ }
 83+
 84+ $wgOut->addHTML($text);
 85+
 86+ }
 87+
 88+
 89+ function writeSetupData($level,$m0,$allSame,$cat,$props,$colors){
 90+
 91+ //structure: levels{**}M0{**}$allSame{**}cat[0]{**}color[0]{**}property[0]{**}cat[1]...
 92+
 93+ $newtext = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--";
 94+ $newtext .= $level."{**}".$m0."{**}".$allSame."{**}";
 95+
 96+ for ($i = 0; $i<$level; $i++){
 97+ $newtext .= $cat[$i]."{**}".$colors[$i]."{**}".$props[$i]."{**}";
 98+ }
 99+
 100+ $newtext .= "-->";
 101+
 102+ $title = Title::newFromText("SPM_Setup");
 103+ $article = new Article($title);
 104+ $article->doEdit($newtext, "settings change", EDIT_UPDATE);
 105+
 106+ }
 107+
 108+ function getSetupData(){
 109+
 110+ //get values from SPM_setup
 111+ $title = Title::newFromText("SPM_Setup");
 112+ $article = new Article($title);
 113+ $wikitext = $article->getContent();
 114+
 115+ $pos1 = strpos($wikitext,"<!--");
 116+ $pos2 = strpos($wikitext,"-->");
 117+ $data = substr($wikitext,$pos1+4,$pos2-$pos1-4);
 118+
 119+ $textarr = explode("{**}",$data);
 120+ $levels = (int) $textarr[0];
 121+
 122+
 123+ //check if data on SPM_setup is valid
 124+ //todo: better check!
 125+ //echo "SIZE: ".(sizeof($textarr))."<br/>";
 126+ if ((3*$levels) != (sizeof($textarr)-4)) return false;
 127+ return $textarr;
 128+
 129+ }
 130+
 131+ //checks if all values in an array are different
 132+ function checkAllDifferent($arr){
 133+
 134+ $check = array();
 135+ for ($i = 0;$i<sizeof($arr);$i++){
 136+ if (isset($check[$arr[$i]])) return false;
 137+ else $check[$arr[$i]] = 1;
 138+ }
 139+ return true;
 140+ }
 141+
 142+ //checks if all values in an array are identical
 143+ function checkAllSame($arr){
 144+ for ($i = 1;$i<sizeof($arr);$i++){
 145+ if ($arr[0] != $arr[$i]) return false;
 146+ }
 147+ return true;
 148+ }
 149+
 150+
 151+ function getPage0Text(){
 152+
 153+ global $wgRequest;
 154+
 155+ $startmonth = "";
 156+ $setting = "";
 157+
 158+ if ($wgRequest->getCheck('calendarRefresh')){
 159+ $startmonth = $wgRequest->getVal('testinput');
 160+ }
 161+
 162+ //page is reached after changes have been made
 163+ if ($wgRequest->getCheck('page1refresh')){
 164+
 165+ $arr = self::getSetupData();
 166+ $m0 = $arr[1];
 167+ $allSame = $arr[2];
 168+
 169+ //echo "loaded m0: ".$m0;
 170+
 171+ $l = $wgRequest->getVal('level');
 172+
 173+ $cat = array();
 174+ $col = array();
 175+ $prop = array();
 176+
 177+ for ($i = 1; $i<=$l; $i++){
 178+
 179+ $cat[$i-1] = $wgRequest->getVal('category'.$i);
 180+ $col[$i-1] = $wgRequest->getVal('color'.$i);
 181+ $prop[$i-1] = $wgRequest->getVal('property'.$i);
 182+ }
 183+
 184+ $allSame = $wgRequest->getVal('allSame');
 185+
 186+ $valid = true;
 187+ $error = "";
 188+
 189+ if ($allSame == 1) {
 190+ $valid = (self::checkAllSame($cat))&&(self::checkAllSame(array_slice($prop,1)));
 191+ $error = "<br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> All categories/properties have to be identical <br/> <br/>";
 192+ }
 193+ if ($allSame == 0){
 194+ $valid = self::checkAllDifferent($cat);
 195+ $error = "<br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> All categories have to be different! <br/> <br/>";
 196+ }
 197+
 198+ if ($valid) self::writeSetupData($l,$m0,$allSame,$cat,$prop,$col);
 199+ else $setting .= $error;
 200+
 201+ }
 202+
 203+ //page is reached after m0 has been changed
 204+ if ($wgRequest->getCheck('calendarRefresh')){
 205+ $startmonth = $wgRequest->getVal('testinput');
 206+
 207+ $arr = self::getSetupData();
 208+
 209+ $arr[1] = $startmonth;
 210+ $result = implode("{**}",$arr);
 211+
 212+ $newtext = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--";
 213+ $newtext .= $result;
 214+ $newtext .= "-->";
 215+
 216+
 217+ //save SPM_Setup with new m0
 218+ $title = Title::newFromText("SPM_Setup");
 219+ $article = new Article($title);
 220+
 221+ $article->doEdit($newtext , "startmonth change");
 222+ }
 223+
 224+
 225+ //check if data is valid
 226+ if (self::getSetupData() == false) {
 227+
 228+ //fill SPM_Setup with default values
 229+ $title = Title::newFromText("SPM_Setup");
 230+ $article = new Article($title);
 231+ $defaultText = "This page is used to store the settings of the Semantic Project Management Extension.<br/><br/>Do not delete or edit this page. To change the settings, please go to: [[Special:SemanticProjectManagement]].<!--3{**}06/01/2009{**}false{**}Work Package{**}FF0000{**}{**}Task{**}FFEE05{**}Part of{**}Deliverable{**}09FF00{**}Part of{**}-->";
 232+ $article->doEdit($defaultText , "default restored");
 233+
 234+ //create error message
 235+ $setting .= " <br/> <b> <font color=\"#FF0000\"> Invalid setting! </font> </b> <br/> Default setting restored! <br/><br/>";
 236+ }
 237+
 238+
 239+ //data is valid
 240+ $textarr = self::getSetupData();
 241+ $levels = $textarr[0];
 242+ $m0 = $textarr[1];
 243+ $allSame = $textarr[2];
 244+ $setting .= " <b> Current Setting: </b> <br/> <br/> <table border = \"0\" cellpadding=\"3\" cellspacing=\"5\"><tr bgcolor = \"#A3D5E4\"><th>Level</th><th>Category</th><th>Color</th><th>Property</th><tr>";
 245+ for ($i = 0; $i < $levels; $i++){
 246+ $triple = array_splice($textarr,3,3);
 247+
 248+ if ($triple[2] == "") $triple[2] = "-";
 249+ $setting .= "<tr> <td align=\"center\">".($i+1)."</td> <td>".$triple[0]."</td> <td width=\"100\" bgcolor=\"#".$triple[1]."\" height=\"21\"></td> <td td align=\"center\">".$triple[2]." </td></tr>";
 250+
 251+ }
 252+
 253+ $setting .= "</table>";
 254+
 255+
 256+ $text =<<<END
 257+<html>
 258+<head>
 259+
 260+</head>
 261+<body>
 262+
 263+ $setting
 264+ <br/>
 265+ <br/>
 266+ <b> Project Start Month (M0): $m0 </b>
 267+ <br/>
 268+ <br/>
 269+ <form enctype="multipart/form-data" action="" method="post" name="page0">
 270+<input type="hidden" name="level" value="$levels">
 271+<input type="hidden" name="startmonth" value="$m0">
 272+ <p><input type="Submit" name="page2" value="Change Setting"><input type="Submit" name="calendar" value="Change Startmonth"></p>
 273+
 274+ </form>
 275+</body>
 276+END;
 277+
 278+ return $text;
 279+ }
 280+
 281+
 282+ function getCalendarText($date){
 283+
 284+ global $spmgScriptPath;
 285+
 286+ $text =<<<END
 287+
 288+<html>
 289+<head>
 290+ <link rel="stylesheet" type="text/css" href="$spmgScriptPath/libs/calendar/calendar.css" />
 291+ <script language="javascript" src="$spmgScriptPath/libs/calendar/calendar_us.js"></script>
 292+
 293+</head>
 294+<body>
 295+
 296+Please enter Project Startmonth (M0):
 297+
 298+<form name="testform" enctype="multipart/form-data" action="" method="post">
 299+
 300+ <input type="text" name="testinput" value="$date" />
 301+ <script language="javascript">
 302+ var A_CALTPL = {
 303+ 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
 304+ 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
 305+ 'yearscroll': true, // show year scroller
 306+ 'weekstart': 0, // first day of week: 0-Su or 1-Mo
 307+ 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
 308+ 'imgpath' : '$spmgScriptPath/libs/calendar/img/'
 309+ }
 310+ new tcal ({
 311+ 'formname': 'testform',
 312+ 'controlname': 'testinput'},
 313+
 314+ A_CALTPL);
 315+ </script>
 316+
 317+
 318+<p><input type="Submit" name="calendarRefresh" value="Save"><input type="Submit" name="page0" value="Cancel"></p>
 319+</form>
 320+
 321+
 322+</body>
 323+</html>
 324+END;
 325+
 326+ return $text;
 327+
 328+ }
 329+
 330+
 331+ function getPage1Text($levels){
 332+
 333+ $checkbox = "";
 334+
 335+ //$checkbox = "<p><input type=\"checkbox\" name=\"allSame\"> All Levels have same Category/Property </p>";
 336+ //uncomment last line to enable allSame checkbox
 337+
 338+ $s = array("","","","","","","","","","");
 339+ $s[$levels] = "selected";
 340+
 341+ $text =<<<END
 342+
 343+<form enctype="multipart/form-data" action="" method="post">
 344+<p>Please select number of levels:
 345+<select name="level">
 346+ <option value="1" $s[1]>1</option>
 347+ <option value="2" $s[2]>2</option>
 348+ <option value="3" $s[3]>3</option>
 349+ <option value="4" $s[4]>4</option>
 350+ <option value="5" $s[5]>5</option>
 351+ <option value="6" $s[6]>6</option>
 352+ <option value="7" $s[7]>7</option>
 353+ <option value="8" $s[8]>8</option>
 354+ <option value="9" $s[9]>9</option>
 355+ </select>
 356+$checkbox
 357+<p><input type="Submit" name="page3" value="Continue"><input type="Submit" name="page0" value="Cancel"></p>
 358+</form>
 359+
 360+END;
 361+
 362+ return $text;
 363+ }
 364+
 365+ function getPage2Text($levels,$allSame){
 366+
 367+ global $spmgScriptPath;
 368+
 369+ //echo " allSame:".$allSame."<br/>";
 370+
 371+ if (self::getSetupData() != false) $textarr = self::getSetupData();
 372+ else return "<br/> Internal error: Please reload Special:SemanticProjectManagement <br/>";
 373+
 374+
 375+ $l = $textarr[0];
 376+ $text =<<<END
 377+
 378+<html>
 379+<head>
 380+<script type="text/javascript" src="$spmgScriptPath/libs/jscolor/jscolor.js"></script>
 381+</head>
 382+<body>
 383+<form enctype="multipart/form-data" action="" method="post" name="page2">
 384+<table>
 385+<tr>
 386+END;
 387+
 388+
 389+ for ( $i = 0; $i < $levels; $i += 1) {
 390+
 391+ $triple = array_splice($textarr,3,3);
 392+
 393+ if ($i < $l) $text .= self::generateLevelBox($i+1, $triple[0], $triple[2], $triple[1]);
 394+ else $text .= self::generateLevelBox($i+1, "", "", "", "ffffff", 0);
 395+
 396+ if (($i+1)%4 == 0) {
 397+ $text.= "</tr> <tr>";
 398+ }
 399+ }
 400+
 401+ $text .=<<<END
 402+</tr>
 403+</table>
 404+<input type="hidden" name="allSame" value="$allSame">
 405+<input type="hidden" name="level" value="$levels">
 406+<p><input type="Submit" name="page1refresh" value="Save"><input type="Submit" name="page0" value="Cancel"></p>
 407+</form>
 408+</body>
 409+</html>
 410+END;
 411+
 412+ return $text;
 413+ }
 414+
 415+ function generateLevelBox($index, $category, $property, $color){
 416+
 417+ $low = $index-1;
 418+ $propbox = "";
 419+ if ($low != 0) $propbox ="<p> Connecting Property to Level $low: <input style=\"width: 100%;\" type=\"text\" name=\"property$index\" value=\"$property\"/></p>";
 420+
 421+ $text =<<<END
 422+<td>
 423+<fieldset style="width: 220px;">
 424+<legend>
 425+Level $index
 426+</legend>
 427+<p> Category: <input style="width: 100%;" type="text" name="category$index" value="$category"/> </p>
 428+
 429+<p> Color: <input style="width: 100%;" class="color" name="color$index" value="$color"/></p>
 430+
 431+$propbox
 432+</fieldset>
 433+<td>
 434+
 435+END;
 436+
 437+ return $text;
 438+
 439+ }
 440+
441441 }
\ No newline at end of file
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_SpecialPage.php
___________________________________________________________________
Added: svn:eol-style
442442 + native
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_GanttChart.php
___________________________________________________________________
Added: svn:eol-style
443443 + native
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_Messages.php
___________________________________________________________________
Added: svn:eol-style
444444 + native
Index: trunk/extensions/SemanticProjectManagement/includes/SPM_Alias.php
@@ -1,12 +1,12 @@
2 -<?php
3 -/**
4 - * Alias file for the Semantic Project Management extension
5 - *
6 - * @addtogroup Extensions
7 -*/
8 -$aliases = array();
9 -
10 -/** English */
11 -$aliases['en'] = array(
12 - 'SemanticProjectManagement' => array( 'SemanticProjectManagement' ),
13 -);
 2+<?php
 3+/**
 4+ * Alias file for the Semantic Project Management extension
 5+ *
 6+ * @addtogroup Extensions
 7+*/
 8+$aliases = array();
 9+
 10+/** English */
 11+$aliases['en'] = array(
 12+ 'SemanticProjectManagement' => array( 'SemanticProjectManagement' ),
 13+);
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_Alias.php
___________________________________________________________________
Added: svn:eol-style
1414 + native
Property changes on: trunk/extensions/SemanticProjectManagement/includes/SPM_ProjectManagementClass.php
___________________________________________________________________
Added: svn:eol-style
1515 + native
Index: trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.css
@@ -1,53 +1,53 @@
2 -
3 -// 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.
4 -
5 -// 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
6 -
7 -// make alot of the code look simpleer/cleaner without all the embedded styles
8 -
9 -
10 -
11 -..gantt { font-family:tahoma, arial, verdana; font-size:10px;}
12 -
13 -..gdatehead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; HEIGHT: 18px }
14 -
15 -..ghead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px }
16 -
17 -..gname { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; WIDTH: 18px; HEIGHT: 18px }
18 -
19 -..ghead A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
20 -
21 -..gheadwkend A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
22 -
23 -..gheadwkend { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px; background-color: #cfcfcf }
24 -
25 -..gfiller { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px }
26 -
27 -..gfillerwkend { BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px; BACKGROUND-COLOR: #cfcfcf }
28 -
29 -..gitem { BORDER-TOP: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
30 -
31 -..gitemwkend { BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
32 -
33 -..gmilestone { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 14px; OVERFLOW: hidden; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px}
34 -
35 -..gmilestonewkend { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px}
36 -
37 -..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 }
38 -
39 -..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 }
40 -
41 -..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 }
42 -
43 -..gweekend { font-family:tahoma, arial, verdana; font-size:11px; background-color:#EEEEEE; text-align:center; }
44 -
45 -..gtask { font-family:tahoma, arial, verdana; font-size:11px; background-color:#00FF00; text-align:center; }
46 -
47 -..gday { font-family:tahoma, arial, verdana; font-size:11px; text-align:center; }
48 -
49 -..gcomplete { background-color:black; height:5px; overflow: auto; margin-top:4px; }
50 -
51 -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 }
52 -
53 -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 }
54 -
 2+
 3+// 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.
 4+
 5+// 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
 6+
 7+// make alot of the code look simpleer/cleaner without all the embedded styles
 8+
 9+
 10+
 11+..gantt { font-family:tahoma, arial, verdana; font-size:10px;}
 12+
 13+..gdatehead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; HEIGHT: 18px }
 14+
 15+..ghead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px }
 16+
 17+..gname { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; WIDTH: 18px; HEIGHT: 18px }
 18+
 19+..ghead A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
 20+
 21+..gheadwkend A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none }
 22+
 23+..gheadwkend { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px; background-color: #cfcfcf }
 24+
 25+..gfiller { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px }
 26+
 27+..gfillerwkend { BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px; BACKGROUND-COLOR: #cfcfcf }
 28+
 29+..gitem { BORDER-TOP: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
 30+
 31+..gitemwkend { BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px }
 32+
 33+..gmilestone { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 14px; OVERFLOW: hidden; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px}
 34+
 35+..gmilestonewkend { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px}
 36+
 37+..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 }
 38+
 39+..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 }
 40+
 41+..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 }
 42+
 43+..gweekend { font-family:tahoma, arial, verdana; font-size:11px; background-color:#EEEEEE; text-align:center; }
 44+
 45+..gtask { font-family:tahoma, arial, verdana; font-size:11px; background-color:#00FF00; text-align:center; }
 46+
 47+..gday { font-family:tahoma, arial, verdana; font-size:11px; text-align:center; }
 48+
 49+..gcomplete { background-color:black; height:5px; overflow: auto; margin-top:4px; }
 50+
 51+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 }
 52+
 53+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 }
 54+
Property changes on: trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.css
___________________________________________________________________
Added: svn:eol-style
5555 + native
Property changes on: trunk/extensions/SemanticProjectManagement/libs/ganttchart/test.html
___________________________________________________________________
Added: svn:eol-style
5656 + native
Index: trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.js
@@ -1,1693 +1,1693 @@
2 -/*
3 - _ ___ _ _ _ ____
4 - (_)___ / _ \__ _ _ __ | |_| |_ / | |___ \
5 - | / __| / /_\/ _` | '_ \| __| __| | | __) |
6 - | \__ \/ /_\\ (_| | | | | |_| |_ | |_ / __/
7 - _/ |___/\____/\__,_|_| |_|\__|\__| |_(_)_____|
8 -|__/
9 -
10 -Copyright (c) 2009, Shlomy Gantz BlueBrick Inc. All rights reserved.
11 -
12 -*
13 -* Redistribution and use in source and binary forms, with or without
14 -* modification, are permitted provided that the following conditions are met:
15 -* * Redistributions of source code must retain the above copyright
16 -* notice, this list of conditions and the following disclaimer.
17 -* * Redistributions in binary form must reproduce the above copyright
18 -* notice, this list of conditions and the following disclaimer in the
19 -* documentation and/or other materials provided with the distribution.
20 -* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the
21 -* names of its contributors may be used to endorse or promote products
22 -* derived from this software without specific prior written permission.
23 -*
24 -* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY
25 -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 -* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY
28 -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 -*/
35 -
36 -var JSGantt; if (!JSGantt) JSGantt = {};
37 -
38 -var vTimeout = 0;
39 -var vBenchTime = new Date().getTime();
40 -
41 -JSGantt.isIE = function () {
42 -
43 - if(typeof document.all != 'undefined')
44 - return true;
45 - else
46 - return false;
47 -}
48 -
49 -
50 -JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pPicture, pPictureLink)
51 -{
52 -
53 - var vID = pID;
54 - var vName = pName;
55 - var vStart = new Date();
56 - var vEnd = new Date();
57 - var vColor = pColor;
58 - var vLink = pLink;
59 - var vMile = pMile;
60 - var vRes = pRes;
61 - var vComp = pComp;
62 - var vGroup = pGroup;
63 - var vParent = pParent;
64 - var vOpen = pOpen;
65 - var vDepend = pDepend;
66 - var vCaption = pCaption;
67 - var vPicture = pPicture;
68 - var vPictureLink = pPictureLink;
69 - var vDuration = '';
70 - var vLevel = 0;
71 - var vNumKid = 0;
72 - var vVisible = 1;
73 - var x1, y1, x2, y2;
74 -
75 - if (vGroup != 1)
76 - {
77 - vStart = JSGantt.parseDateStr(pStart,g.getDateInputFormat());
78 - vEnd = JSGantt.parseDateStr(pEnd,g.getDateInputFormat());
79 - }
80 -
81 - this.getID = function(){ return vID };
82 - this.getName = function(){ return vName };
83 - this.getStart = function(){ return vStart};
84 - this.getEnd = function(){ return vEnd };
85 - this.getColor = function(){ return vColor};
86 - this.getLink = function(){ return vLink };
87 - this.getMile = function(){ return vMile };
88 - this.getPictureLink = function(){ return vPictureLink };
89 - this.getPicture = function(){ return vPicture };
90 - this.getDepend = function(){ if(vDepend) return vDepend; else return null };
91 - this.getCaption = function(){ if(vCaption) return vCaption; else return ''; };
92 - this.getResource = function(){ if(vRes) return vRes; else return '&nbsp'; };
93 - this.getCompVal = function(){ if(vComp) return vComp; else return 0; };
94 - this.getCompStr = function(){ if(vComp) return vComp+'%'; else return ''; };
95 -
96 - this.getDuration = function(vFormat){
97 - if (vMile)
98 - vDuration = '-';
99 - else if (vFormat=='hour')
100 - {
101 - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 60 * 1000) );
102 - if(tmpPer == 1)
103 - vDuration = '1 Hour';
104 - else
105 - vDuration = tmpPer + ' Hours';
106 - }
107 -
108 - else if (vFormat=='minute')
109 - {
110 - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 1000) );
111 - if(tmpPer == 1)
112 - vDuration = '1 Minute';
113 - else
114 - vDuration = tmpPer + ' Minutes';
115 - }
116 -
117 - else { //if(vFormat == 'day') {
118 - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1);
119 - if(tmpPer == 1) vDuration = '1 Day';
120 - else vDuration = tmpPer + ' Days';
121 - }
122 -
123 - //else if(vFormat == 'week') {
124 - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/7;
125 - // if(tmpPer == 1) vDuration = '1 Week';
126 - // else vDuration = tmpPer + ' Weeks';
127 - //}
128 -
129 - //else if(vFormat == 'month') {
130 - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/30;
131 - // if(tmpPer == 1) vDuration = '1 Month';
132 - // else vDuration = tmpPer + ' Months';
133 - //}
134 -
135 - //else if(vFormat == 'quater') {
136 - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/120;
137 - // if(tmpPer == 1) vDuration = '1 Qtr';
138 - // else vDuration = tmpPer + ' Qtrs';
139 - //}
140 - return( vDuration )
141 - };
142 -
143 - this.getParent = function(){ return vParent };
144 - this.getGroup = function(){ return vGroup };
145 - this.getOpen = function(){ return vOpen };
146 - this.getLevel = function(){ return vLevel };
147 - this.getNumKids = function(){ return vNumKid };
148 - this.getStartX = function(){ return x1 };
149 - this.getStartY = function(){ return y1 };
150 - this.getEndX = function(){ return x2 };
151 - this.getEndY = function(){ return y2 };
152 - this.getVisible = function(){ return vVisible };
153 - this.setDepend = function(pDepend){ vDepend = pDepend;};
154 - this.setStart = function(pStart){ vStart = pStart;};
155 - this.setEnd = function(pEnd) { vEnd = pEnd; };
156 - this.setLevel = function(pLevel){ vLevel = pLevel;};
157 - this.setNumKid = function(pNumKid){ vNumKid = pNumKid;};
158 - this.setCompVal = function(pCompVal){ vComp = pCompVal;};
159 - this.setStartX = function(pX) {x1 = pX; };
160 - this.setStartY = function(pY) {y1 = pY; };
161 - this.setEndX = function(pX) {x2 = pX; };
162 - this.setEndY = function(pY) {y2 = pY; };
163 - this.setOpen = function(pOpen) {vOpen = pOpen; };
164 - this.setVisible = function(pVisible) {vVisible = pVisible; };
165 -
166 - }
167 -
168 -
169 - // function that loads the main gantt chart properties and functions
170 - // pDiv: (required) this is a DIV object created in HTML
171 - // pStart: UNUSED - future use to force minimum chart date
172 - // pEnd: UNUSED - future use to force maximum chart date
173 - // pWidth: UNUSED - future use to force chart width and cause objects to scale to fit within that width
174 - // pShowRes: UNUSED - future use to turn on/off display of resource names
175 - // pShowDur: UNUSED - future use to turn on/off display of task durations
176 - // pFormat: (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format
177 - // pCationType - what type of Caption to show: Caption, Resource, Duration, Complete
178 -JSGantt.GanttChart = function(pGanttVar, pDiv, pFormat)
179 -{
180 -
181 - var vGanttVar = pGanttVar;
182 - var vDiv = pDiv;
183 - var vFormat = pFormat;
184 - var vShowRes = 1;
185 - var vShowDur = 1;
186 - var vShowComp = 1;
187 - var vShowStartDate = 1;
188 - var vShowEndDate = 1;
189 - var vShowPicture = 1;
190 - var vDateInputFormat = "mm/dd/yyyy";
191 - var vDateDisplayFormat = "mm/dd/yy";
192 - var vNumUnits = 0;
193 - var vCaptionType;
194 - var vDepId = 1;
195 - var vTaskList = new Array();
196 - var vFormatArr = new Array("day","week","month","quarter");
197 - var vQuarterArr = new Array(1,1,1,2,2,2,3,3,3,4,4,4);
198 - var vMonthDaysArr = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
199 - var vMonthArr = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
200 - this.setFormatArr = function() {
201 - vFormatArr = new Array();
202 - for(var i = 0; i < arguments.length; i++) {vFormatArr[i] = arguments[i];}
203 - if(vFormatArr.length>4){vFormatArr.length=4;}
204 - };
205 - this.setShowRes = function(pShow) { vShowRes = pShow; };
206 - this.setShowDur = function(pShow) { vShowDur = pShow; };
207 - this.setShowComp = function(pShow) { vShowComp = pShow; };
208 - this.setShowStartDate = function(pShow) { vShowStartDate = pShow; };
209 - this.setShowEndDate = function(pShow) { vShowEndDate = pShow; };
210 - this.setShowPicture = function(pShow) { vShowPicture = pShow; };
211 - this.setDateInputFormat = function(pShow) { vDateInputFormat = pShow; };
212 - this.setDateDisplayFormat = function(pShow) { vDateDisplayFormat = pShow; };
213 - this.setCaptionType = function(pType) { vCaptionType = pType };
214 - this.setFormat = function(pFormat){
215 - vFormat = pFormat;
216 - this.Draw();
217 - };
218 -
219 - this.getShowRes = function(){ return vShowRes };
220 - this.getShowDur = function(){ return vShowDur };
221 - this.getShowComp = function(){ return vShowComp };
222 - this.getShowStartDate = function(){ return vShowStartDate };
223 - this.getShowEndDate = function(){ return vShowEndDate };
224 - this.getShowPicture = function(){ return vShowPicture };
225 - this.getDateInputFormat = function() { return vDateInputFormat };
226 - this.getDateDisplayFormat = function() { return vDateDisplayFormat };
227 - this.getCaptionType = function() { return vCaptionType };
228 - this.CalcTaskXY = function ()
229 - {
230 - var vList = this.getList();
231 - var vTaskDiv;
232 - var vParDiv;
233 - var vLeft, vTop, vHeight, vWidth;
234 -
235 - for(i = 0; i < vList.length; i++)
236 - {
237 - vID = vList[i].getID();
238 - vTaskDiv = document.getElementById("taskbar_"+vID);
239 - vBarDiv = document.getElementById("bardiv_"+vID);
240 - vParDiv = document.getElementById("childgrid_"+vID);
241 -
242 - if(vBarDiv) {
243 - vList[i].setStartX( vBarDiv.offsetLeft );
244 - vList[i].setStartY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
245 - vList[i].setEndX( vBarDiv.offsetLeft + vBarDiv.offsetWidth );
246 - vList[i].setEndY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
247 - }
248 - }
249 - }
250 -
251 - this.AddTaskItem = function(value)
252 - {
253 - vTaskList.push(value);
254 - }
255 -
256 - this.getList = function() { return vTaskList };
257 -
258 - this.clearDependencies = function()
259 - {
260 - var parent = document.getElementById('rightside');
261 - var depLine;
262 - var vMaxId = vDepId;
263 - for ( i=1; i<vMaxId; i++ ) {
264 - depLine = document.getElementById("line"+i);
265 - if (depLine) { parent.removeChild(depLine); }
266 - }
267 - vDepId = 1;
268 - }
269 -
270 -
271 - // sLine: Draw a straight line (colored one-pixel wide DIV), need to parameterize doc item
272 - this.sLine = function(x1,y1,x2,y2) {
273 -
274 - vLeft = Math.min(x1,x2);
275 - vTop = Math.min(y1,y2);
276 - vWid = Math.abs(x2-x1) + 1;
277 - vHgt = Math.abs(y2-y1) + 1;
278 -
279 - vDoc = document.getElementById('rightside');
280 -
281 - // retrieve DIV
282 - var oDiv = document.createElement('div');
283 -
284 - oDiv.id = "line"+vDepId++;
285 - oDiv.style.position = "absolute";
286 - oDiv.style.margin = "0px";
287 - oDiv.style.padding = "0px";
288 - oDiv.style.overflow = "hidden";
289 - oDiv.style.border = "0px";
290 -
291 - // set attributes
292 - oDiv.style.zIndex = 0;
293 - oDiv.style.backgroundColor = "red";
294 -
295 - oDiv.style.left = vLeft + "px";
296 - oDiv.style.top = vTop + "px";
297 - oDiv.style.width = vWid + "px";
298 - oDiv.style.height = vHgt + "px";
299 -
300 - oDiv.style.visibility = "visible";
301 -
302 - vDoc.appendChild(oDiv);
303 -
304 - }
305 -
306 -
307 - // dLine: Draw a diaganol line (calc line x,y paisrs and draw multiple one-by-one sLines)
308 - this.dLine = function(x1,y1,x2,y2) {
309 -
310 - var dx = x2 - x1;
311 - var dy = y2 - y1;
312 - var x = x1;
313 - var y = y1;
314 -
315 - var n = Math.max(Math.abs(dx),Math.abs(dy));
316 - dx = dx / n;
317 - dy = dy / n;
318 - for ( i = 0; i <= n; i++ )
319 - {
320 - vx = Math.round(x);
321 - vy = Math.round(y);
322 - this.sLine(vx,vy,vx,vy);
323 - x += dx;
324 - y += dy;
325 - }
326 -
327 - }
328 -
329 - this.drawDependency =function(x1,y1,x2,y2)
330 - {
331 - if(x1 + 10 < x2)
332 - {
333 - this.sLine(x1,y1,x1+4,y1);
334 - this.sLine(x1+4,y1,x1+4,y2);
335 - this.sLine(x1+4,y2,x2,y2);
336 - this.dLine(x2,y2,x2-3,y2-3);
337 - this.dLine(x2,y2,x2-3,y2+3);
338 - this.dLine(x2-1,y2,x2-3,y2-2);
339 - this.dLine(x2-1,y2,x2-3,y2+2);
340 - }
341 - else
342 - {
343 - this.sLine(x1,y1,x1+4,y1);
344 - this.sLine(x1+4,y1,x1+4,y2-10);
345 - this.sLine(x1+4,y2-10,x2-8,y2-10);
346 - this.sLine(x2-8,y2-10,x2-8,y2);
347 - this.sLine(x2-8,y2,x2,y2);
348 - this.dLine(x2,y2,x2-3,y2-3);
349 - this.dLine(x2,y2,x2-3,y2+3);
350 - this.dLine(x2-1,y2,x2-3,y2-2);
351 - this.dLine(x2-1,y2,x2-3,y2+2);
352 - }
353 - }
354 -
355 - this.DrawDependencies = function () {
356 -
357 - //First recalculate the x,y
358 - this.CalcTaskXY();
359 -
360 - this.clearDependencies();
361 -
362 - var vList = this.getList();
363 - for(var i = 0; i < vList.length; i++)
364 - {
365 -
366 - vDepend = vList[i].getDepend();
367 - if(vDepend) {
368 -
369 - var vDependStr = vDepend + '';
370 - var vDepList = vDependStr.split(',');
371 - var n = vDepList.length;
372 -
373 - for(var k=0;k<n;k++) {
374 - var vTask = this.getArrayLocationByID(vDepList[k]);
375 -
376 - if(vList[vTask].getVisible()==1)
377 - this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY())
378 - }
379 - }
380 - }
381 - }
382 -
383 -
384 - this.getArrayLocationByID = function(pId) {
385 -
386 - var vList = this.getList();
387 - for(var i = 0; i < vList.length; i++)
388 - {
389 - if(vList[i].getID()==pId)
390 - return i;
391 - }
392 - }
393 -
394 -
395 - this.Draw = function()
396 - {
397 - var vMaxDate = new Date();
398 - var vMinDate = new Date();
399 - var vTmpDate = new Date();
400 - var vNxtDate = new Date();
401 - var vCurrDate = new Date();
402 - var vTaskLeft = 0;
403 - var vTaskRight = 0;
404 - var vNumCols = 0;
405 - var vID = 0;
406 - var vMainTable = "";
407 - var vLeftTable = "";
408 - var vRightTable = "";
409 - var vDateRowStr = "";
410 - var vItemRowStr = "";
411 - var vColWidth = 0;
412 - var vColUnit = 0;
413 - var vChartWidth = 0;
414 - var vNumDays = 0;
415 - var vDayWidth = 0;
416 - var vStr = "";
417 - var vNameWidth = 220;
418 - var vStatusWidth = 70;
419 - var vPictureWidth = 20;
420 - var vLeftWidth = 15 + 220 + 70 + 70 + 70 + 70 + 70+ 20;
421 -
422 - if(vTaskList.length > 0)
423 - {
424 -
425 - // Process all tasks preset parent date and completion %
426 - JSGantt.processRows(vTaskList, 0, -1, 1, 1);
427 -
428 - // get overall min/max dates plus padding
429 - vMinDate = JSGantt.getMinDate(vTaskList, vFormat);
430 - vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat);
431 -
432 - // Calculate chart width variables. vColWidth can be altered manually to change each column width
433 - // May be smart to make this a parameter of GanttChart or set it based on existing pWidth parameter
434 - if(vFormat == 'day') {
435 - vColWidth = 18;
436 - vColUnit = 1;
437 - }
438 - else if(vFormat == 'week') {
439 - vColWidth = 37;
440 - vColUnit = 7;
441 - }
442 - else if(vFormat == 'month') {
443 - vColWidth = 37;
444 - vColUnit = 30;
445 - }
446 - else if(vFormat == 'quarter') {
447 - vColWidth = 60;
448 - vColUnit = 90;
449 - }
450 -
451 - else if(vFormat=='hour')
452 - {
453 - vColWidth = 18;
454 - vColUnit = 1;
455 - }
456 -
457 - else if(vFormat=='minute')
458 - {
459 - vColWidth = 18;
460 - vColUnit = 1;
461 - }
462 -
463 - vNumDays = (Date.parse(vMaxDate) - Date.parse(vMinDate)) / ( 24 * 60 * 60 * 1000);
464 - vNumUnits = vNumDays / vColUnit;
465 -
466 -
467 - vChartWidth = vNumUnits * vColWidth + 1;
468 - vDayWidth = (vColWidth / vColUnit) + (1/vColUnit);
469 -
470 - vMainTable =
471 - '<TABLE id=theTable cellSpacing=0 cellPadding=0 border=0><TBODY><TR>' +
472 - '<TD vAlign=top bgColor=#ffffff>';
473 -
474 - if(vShowRes !=1) vNameWidth+=vStatusWidth;
475 - if(vShowDur !=1) vNameWidth+=vStatusWidth;
476 - if(vShowComp!=1) vNameWidth+=vStatusWidth;
477 - if(vShowStartDate!=1) vNameWidth+=vStatusWidth;
478 - if(vShowEndDate!=1) vNameWidth+=vStatusWidth;
479 - if(vShowPicture!=1) vNameWidth+=vPictureWidth;
480 - // DRAW the Left-side of the chart (names, resources, comp%)
481 - vLeftTable =
482 - '<DIV class=scroll id=leftside style="width:' + vLeftWidth + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +
483 - '<TR style="HEIGHT: 17px">' +
484 - ' <TD style="WIDTH: 15px; HEIGHT: 17px"></TD>' +
485 - ' <TD style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 17px"><NOBR></NOBR></TD>';
486 -
487 - if(vShowRes ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
488 - if(vShowDur ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
489 - if(vShowComp==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
490 - if(vShowStartDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
491 - if(vShowEndDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
492 - if(vShowPicture==1) vLeftTable += ' <TD style="WIDTH: ' + vPictureWidth + 'px; HEIGHT: 17px"></TD>' ;
493 - vLeftTable +=
494 - '<TR style="HEIGHT: 20px">' +
495 - ' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: 15px; HEIGHT: 20px"></TD>' +
496 - ' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px"><NOBR></NOBR></TD>' ;
497 -
498 - 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>' ;
499 - 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>' ;
500 - 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>' ;
501 - 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>' ;
502 - 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>' ;
503 - if(vShowPicture==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 20px; HEIGHT: 20px" align=center nowrap></TD>' ;
504 - vLeftTable += '</TR>';
505 -
506 - for(i = 0; i < vTaskList.length; i++)
507 - {
508 - if( vTaskList[i].getGroup()) {
509 - vBGColor = "f3f3f3";
510 - vRowType = "group";
511 - } else {
512 - vBGColor = "ffffff";
513 - vRowType = "row";
514 - }
515 -
516 - vID = vTaskList[i].getID();
517 -
518 - if(vTaskList[i].getVisible() == 0)
519 - vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' style="display:none" onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
520 - else
521 - vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
522 -
523 - vLeftTable +=
524 - ' <TD class=gdatehead style="WIDTH: 15px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;">&nbsp;</TD>' +
525 - ' <TD class=gname style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;" nowrap><NOBR><span style="color: #aaaaaa">';
526 -
527 - for(j=1; j<vTaskList[i].getLevel(); j++) {
528 - vLeftTable += '&nbsp&nbsp&nbsp&nbsp';
529 - }
530 -
531 - vLeftTable += '</span>';
532 -
533 - if( vTaskList[i].getGroup()) {
534 - if( vTaskList[i].getOpen() == 1)
535 - vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">&ndash;</span><span style="color:#000000">&nbsp</SPAN>' ;
536 - else
537 - 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">&nbsp</SPAN>' ;
538 -
539 - } else {
540 -
541 - vLeftTable += '<span style="color: #000000; font-weight:bold; FONT-SIZE: 12px;">&nbsp&nbsp&nbsp</span>';
542 - }
543 -
544 - vLeftTable +=
545 - '<span onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); style="cursor:pointer"> ' + vTaskList[i].getName() + '</span></NOBR></TD>' ;
546 -
547 - 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>' ;
548 - 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>' ;
549 - 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>' ;
550 - 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>' ;
551 - 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>' ;
552 - if(vShowPicture==1) vLeftTable += ' <TD class=gname ' ;
553 - if(vShowPicture==1 && vTaskList[i].getPictureLink()!="" ) vLeftTable += 'onclick=JSGantt.taskLink("' + vTaskList[i].getPictureLink() + '",300,200); ' ;
554 - if(vShowPicture==1) vLeftTable += 'style="WIDTH: 20px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; background-image: url('+vTaskList[i].getPicture()+');' ;
555 - if(vShowPicture==1 && vTaskList[i].getPictureLink()!="" ) vLeftTable += 'cursor:pointer;';
556 - if(vShowPicture==1) vLeftTable += '" align=center><NOBR></NOBR></TD>';
557 - vLeftTable += '</TR>';
558 -
559 - }
560 -
561 - // DRAW the date format selector at bottom left. Another potential GanttChart parameter to hide/show this selector
562 - vLeftTable += '</TD></TR>' +
563 - '<TR><TD border=1 colspan=5 align=left style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #efefef 1px solid; height=18px">&nbsp;&nbsp;Powered by <a href=http://www.jsgantt.com>jsGantt</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format:';
564 -
565 - if (vFormatArr.join().indexOf("minute")!=-1) {
566 - if (vFormat=='minute') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="minute" checked>Minute';
567 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("minute",'+vGanttVar+'); VALUE="minute">Minute';
568 - }
569 -
570 - if (vFormatArr.join().indexOf("hour")!=-1) {
571 - if (vFormat=='hour') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="hour" checked>Hour';
572 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("hour",'+vGanttVar+'); VALUE="hour">Hour';
573 - }
574 -
575 - if (vFormatArr.join().indexOf("day")!=-1) {
576 - if (vFormat=='day') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="day" checked>Day';
577 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("day",'+vGanttVar+'); VALUE="day">Day';
578 - }
579 -
580 - if (vFormatArr.join().indexOf("week")!=-1) {
581 - if (vFormat=='week') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="week" checked>Week';
582 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("week",'+vGanttVar+') VALUE="week">Week';
583 - }
584 -
585 - if (vFormatArr.join().indexOf("month")!=-1) {
586 - if (vFormat=='month') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="month" checked>Month';
587 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("month",'+vGanttVar+') VALUE="month">Month';
588 - }
589 -
590 - if (vFormatArr.join().indexOf("quarter")!=-1) {
591 - if (vFormat=='quarter') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="quarter" checked>Quarter';
592 - else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("quarter",'+vGanttVar+') VALUE="quarter">Quarter';
593 - }
594 -
595 -// vLeftTable += '<INPUT TYPE=RADIO NAME="other" VALUE="other" style="display:none"> .';
596 -
597 - vLeftTable += '</TD></TR></TBODY></TABLE></TD>';
598 -
599 - vMainTable += vLeftTable;
600 -
601 - // Draw the Chart Rows
602 - vRightTable =
603 - '<TD style="width: ' + vChartWidth + 'px;" vAlign=top bgColor=#ffffff>' +
604 - '<DIV class=scroll2 id=rightside>' +
605 - '<TABLE style="width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
606 - '<TBODY><TR style="HEIGHT: 18px">';
607 -
608 - vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
609 - vTmpDate.setHours(0);
610 - vTmpDate.setMinutes(0);
611 -
612 - // Major Date Header
613 - while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
614 - {
615 - vStr = vTmpDate.getFullYear() + '';
616 - vStr = vStr.substring(2,4);
617 -
618 -
619 - if(vFormat == 'minute')
620 - {
621 - vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=60>' ;
622 - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' ' + vTmpDate.getHours() + ':00 -' + vTmpDate.getHours() + ':59 </td>';
623 - vTmpDate.setHours(vTmpDate.getHours()+1);
624 - }
625 -
626 - if(vFormat == 'hour')
627 - {
628 - vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=24>' ;
629 - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
630 - vTmpDate.setDate(vTmpDate.getDate()+1);
631 - }
632 -
633 - if(vFormat == 'day')
634 - {
635 - vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=7>' +
636 - JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5)) + ' - ';
637 - vTmpDate.setDate(vTmpDate.getDate()+6);
638 - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
639 - vTmpDate.setDate(vTmpDate.getDate()+1);
640 - }
641 - else if(vFormat == 'week')
642 - {
643 - vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
644 - vTmpDate.setDate(vTmpDate.getDate()+7);
645 - }
646 - else if(vFormat == 'month')
647 - {
648 - vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
649 - vTmpDate.setDate(vTmpDate.getDate() + 1);
650 - while(vTmpDate.getDate() > 1)
651 - {
652 - vTmpDate.setDate(vTmpDate.getDate() + 1);
653 - }
654 - }
655 - else if(vFormat == 'quarter')
656 - {
657 - vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
658 - vTmpDate.setDate(vTmpDate.getDate() + 81);
659 - while(vTmpDate.getDate() > 1)
660 - {
661 - vTmpDate.setDate(vTmpDate.getDate() + 1);
662 - }
663 - }
664 -
665 - }
666 -
667 - vRightTable += '</TR><TR>';
668 -
669 - // Minor Date header and Cell Rows
670 - vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
671 - vNxtDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
672 - vNumCols = 0;
673 -
674 - while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
675 - {
676 - if (vFormat == 'minute')
677 - {
678 -
679 - if( vTmpDate.getMinutes() ==0 )
680 - vWeekdayColor = "ccccff";
681 - else
682 - vWeekdayColor = "ffffff";
683 -
684 -
685 - 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>';
686 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
687 - vTmpDate.setMinutes(vTmpDate.getMinutes() + 1);
688 - }
689 -
690 - else if (vFormat == 'hour')
691 - {
692 -
693 - if( vTmpDate.getHours() ==0 )
694 - vWeekdayColor = "ccccff";
695 - else
696 - vWeekdayColor = "ffffff";
697 -
698 -
699 - 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>';
700 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
701 - vTmpDate.setHours(vTmpDate.getHours() + 1);
702 - }
703 -
704 - else if(vFormat == 'day' )
705 - {
706 - if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) {
707 - vWeekdayColor = "ccccff";
708 - vWeekendColor = "9999ff";
709 - vWeekdayGColor = "bbbbff";
710 - vWeekendGColor = "8888ff";
711 - } else {
712 - vWeekdayColor = "ffffff";
713 - vWeekendColor = "cfcfcf";
714 - vWeekdayGColor = "f3f3f3";
715 - vWeekendGColor = "c3c3c3";
716 - }
717 -
718 - if(vTmpDate.getDay() % 6 == 0) {
719 - 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>';
720 - vItemRowStr += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp</div></td>';
721 - }
722 - else {
723 - 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>';
724 - if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))
725 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
726 - else
727 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
728 - }
729 -
730 - vTmpDate.setDate(vTmpDate.getDate() + 1);
731 -
732 - }
733 -
734 - else if(vFormat == 'week')
735 - {
736 -
737 - vNxtDate.setDate(vNxtDate.getDate() + 7);
738 -
739 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
740 - vWeekdayColor = "ccccff";
741 - else
742 - vWeekdayColor = "ffffff";
743 -
744 - if(vNxtDate <= vMaxDate) {
745 - 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>';
746 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
747 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
748 - else
749 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
750 -
751 - } else {
752 - 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>';
753 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
754 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
755 - else
756 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
757 -
758 - }
759 -
760 - vTmpDate.setDate(vTmpDate.getDate() + 7);
761 -
762 - }
763 -
764 - else if(vFormat == 'month')
765 - {
766 -
767 - vNxtDate.setFullYear(vTmpDate.getFullYear(), vTmpDate.getMonth(), vMonthDaysArr[vTmpDate.getMonth()]);
768 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
769 - vWeekdayColor = "ccccff";
770 - else
771 - vWeekdayColor = "ffffff";
772 -
773 - if(vNxtDate <= vMaxDate) {
774 - 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>';
775 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
776 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
777 - else
778 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
779 - } else {
780 - 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>';
781 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
782 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
783 - else
784 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
785 - }
786 -
787 - vTmpDate.setDate(vTmpDate.getDate() + 1);
788 -
789 - while(vTmpDate.getDate() > 1)
790 - {
791 - vTmpDate.setDate(vTmpDate.getDate() + 1);
792 - }
793 -
794 - }
795 -
796 - else if(vFormat == 'quarter')
797 - {
798 -
799 - vNxtDate.setDate(vNxtDate.getDate() + 122);
800 - if( vTmpDate.getMonth()==0 || vTmpDate.getMonth()==1 || vTmpDate.getMonth()==2 )
801 - vNxtDate.setFullYear(vTmpDate.getFullYear(), 2, 31);
802 - else if( vTmpDate.getMonth()==3 || vTmpDate.getMonth()==4 || vTmpDate.getMonth()==5 )
803 - vNxtDate.setFullYear(vTmpDate.getFullYear(), 5, 30);
804 - else if( vTmpDate.getMonth()==6 || vTmpDate.getMonth()==7 || vTmpDate.getMonth()==8 )
805 - vNxtDate.setFullYear(vTmpDate.getFullYear(), 8, 30);
806 - else if( vTmpDate.getMonth()==9 || vTmpDate.getMonth()==10 || vTmpDate.getMonth()==11 )
807 - vNxtDate.setFullYear(vTmpDate.getFullYear(), 11, 31);
808 -
809 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
810 - vWeekdayColor = "ccccff";
811 - else
812 - vWeekdayColor = "ffffff";
813 -
814 - if(vNxtDate <= vMaxDate) {
815 - 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>';
816 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
817 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
818 - else
819 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
820 - } else {
821 - 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>';
822 - if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
823 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
824 - else
825 - vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
826 - }
827 -
828 - vTmpDate.setDate(vTmpDate.getDate() + 81);
829 -
830 - while(vTmpDate.getDate() > 1)
831 - {
832 - vTmpDate.setDate(vTmpDate.getDate() + 1);
833 - }
834 -
835 - }
836 - }
837 -
838 - vRightTable += vDateRowStr + '</TR>';
839 - vRightTable += '</TBODY></TABLE>';
840 -
841 - // Draw each row
842 -
843 - for(i = 0; i < vTaskList.length; i++)
844 -
845 - {
846 -
847 - vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
848 - vTaskStart = vTaskList[i].getStart();
849 - vTaskEnd = vTaskList[i].getEnd();
850 -
851 - vNumCols = 0;
852 - vID = vTaskList[i].getID();
853 -
854 - // vNumUnits = Math.ceil((vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000)) + 1;
855 - vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000) + 1;
856 - if (vFormat=='hour')
857 - {
858 - vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
859 - }
860 - else if (vFormat=='minute')
861 - {
862 - vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
863 - }
864 -
865 - if(vTaskList[i].getVisible() == 0)
866 - vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative; display:none;">';
867 - else
868 - vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative">';
869 -
870 - if( vTaskList[i].getMile()) {
871 -
872 - vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
873 - '<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>';
874 -
875 - // Build date string for Title
876 - vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat);
877 -
878 - vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);
879 - vTaskRight = 1
880 -
881 - vRightTable +=
882 - '<div id=bardiv_' + vID + ' style="position:absolute; top:0px; left:' + Math.ceil((vTaskLeft * (vDayWidth) + 1)) + 'px; height: 18px; width:160px; overflow:hidden;">' +
883 - ' <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);>';
884 -
885 - if(vTaskList[i].getCompVal() < 100)
886 - vRightTable += '&loz;</div>' ;
887 - else
888 - vRightTable += '&diams;</div>' ;
889 -
890 - if( g.getCaptionType() ) {
891 - vCaptionStr = '';
892 - switch( g.getCaptionType() ) {
893 - case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
894 - case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
895 - case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
896 - case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
897 - }
898 - //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
899 - vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:2px; width:120px; left:12px">' + vCaptionStr + '</div>';
900 - }
901 -
902 - vRightTable += '</div>';
903 -
904 -
905 - } else {
906 -
907 - // Build date string for Title
908 - vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat)
909 -
910 - if (vFormat=='minute')
911 - {
912 - vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 1000) + 1/vColUnit;
913 - vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 1000));
914 - }
915 - else if (vFormat=='hour')
916 - {
917 - vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 60 * 1000) + 1/vColUnit;
918 - vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 60 * 1000);
919 - }
920 - else
921 - {
922 - vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / (24 * 60 * 60 * 1000) + 1/vColUnit;
923 - vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000));
924 - if (vFormat='day')
925 - {
926 - var tTime=new Date();
927 - tTime.setTime(Date.parse(vTaskList[i].getStart()));
928 - if (tTime.getMinutes() > 29)
929 - vTaskLeft+=.5
930 - }
931 - }
932 -
933 - // Draw Group Bar which has outer div with inner group div and several small divs to left and right to create angled-end indicators
934 - if( vTaskList[i].getGroup()) {
935 - vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
936 - '<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>';
937 - vRightTable +=
938 - '<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">' +
939 - '<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;">' +
940 - '<div style="Z-INDEX: -4; float:left; background-color:#666666; height:3px; overflow: hidden; margin-top:1px; ' +
941 - 'margin-left:1px; margin-right:1px; filter: alpha(opacity=80); opacity:0.8; width:' + vTaskList[i].getCompStr() + '; ' +
942 - 'cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>' +
943 - '</div>' +
944 - '</div>' +
945 - '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
946 - '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
947 - '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
948 - '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
949 - '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
950 - '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
951 - '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' +
952 - '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' ;
953 -
954 - if( g.getCaptionType() ) {
955 - vCaptionStr = '';
956 - switch( g.getCaptionType() ) {
957 - case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
958 - case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
959 - case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
960 - case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
961 - }
962 - //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
963 - vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
964 - }
965 -
966 - vRightTable += '</div>' ;
967 -
968 - } else {
969 -
970 - vDivStr = '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
971 - '<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>';
972 - vRightTable += vDivStr;
973 -
974 - // Draw Task Bar which has outer DIV with enclosed colored bar div, and opaque completion div
975 - vRightTable +=
976 - '<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">' +
977 - '<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;" ' +
978 - 'onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); >' +
979 - '<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">' +
980 - '</div>' +
981 - '</div>';
982 -
983 - if( g.getCaptionType() ) {
984 - vCaptionStr = '';
985 - switch( g.getCaptionType() ) {
986 - case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
987 - case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
988 - case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
989 - case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
990 - }
991 - //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:-3px;">' + vCaptionStr + '</div>';
992 - vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
993 - }
994 - vRightTable += '</div>' ;
995 -
996 -
997 -
998 - }
999 - }
1000 -
1001 - vRightTable += '</DIV>';
1002 -
1003 - }
1004 -
1005 - vMainTable += vRightTable + '</DIV></TD></TR></TBODY></TABLE></BODY></HTML>';
1006 -
1007 - vDiv.innerHTML = vMainTable;
1008 -
1009 - }
1010 -
1011 - } //this.draw
1012 -
1013 - this.mouseOver = function( pObj, pID, pPos, pType ) {
1014 - if( pPos == 'right' ) vID = 'child_' + pID;
1015 - else vID = 'childrow_' + pID;
1016 -
1017 - pObj.bgColor = "#ffffaa";
1018 - vRowObj = JSGantt.findObj(vID);
1019 - if (vRowObj) vRowObj.bgColor = "#ffffaa";
1020 - }
1021 -
1022 - this.mouseOut = function( pObj, pID, pPos, pType ) {
1023 - if( pPos == 'right' ) vID = 'child_' + pID;
1024 - else vID = 'childrow_' + pID;
1025 -
1026 - pObj.bgColor = "#ffffff";
1027 - vRowObj = JSGantt.findObj(vID);
1028 - if (vRowObj) {
1029 - if( pType == "group") {
1030 - pObj.bgColor = "#f3f3f3";
1031 - vRowObj.bgColor = "#f3f3f3";
1032 - } else {
1033 - pObj.bgColor = "#ffffff";
1034 - vRowObj.bgColor = "#ffffff";
1035 - }
1036 - }
1037 - }
1038 -
1039 -} //GanttChart
1040 -
1041 -// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
1042 -JSGantt.processRows = function(pList, pID, pRow, pLevel, pOpen)
1043 -{
1044 -
1045 - var vMinDate = new Date();
1046 - var vMaxDate = new Date();
1047 - var vMinSet = 0;
1048 - var vMaxSet = 0;
1049 - var vList = pList;
1050 - var vLevel = pLevel;
1051 - var i = 0;
1052 - var vNumKid = 0;
1053 - var vCompSum = 0;
1054 - var vVisible = pOpen;
1055 -
1056 - for(i = 0; i < pList.length; i++)
1057 - {
1058 - if(pList[i].getParent() == pID) {
1059 - vVisible = pOpen;
1060 - pList[i].setVisible(vVisible);
1061 - if(vVisible==1 && pList[i].getOpen() == 0)
1062 - vVisible = 0;
1063 -
1064 - pList[i].setLevel(vLevel);
1065 - vNumKid++;
1066 -
1067 - if(pList[i].getGroup() == 1) {
1068 - JSGantt.processRows(vList, pList[i].getID(), i, vLevel+1, vVisible);
1069 - }
1070 -
1071 - if( vMinSet==0 || pList[i].getStart() < vMinDate) {
1072 - vMinDate = pList[i].getStart();
1073 - vMinSet = 1;
1074 - }
1075 -
1076 - if( vMaxSet==0 || pList[i].getEnd() > vMaxDate) {
1077 - vMaxDate = pList[i].getEnd();
1078 - vMaxSet = 1;
1079 - }
1080 -
1081 - vCompSum += pList[i].getCompVal();
1082 -
1083 - }
1084 - }
1085 -
1086 - if(pRow >= 0) {
1087 - pList[pRow].setStart(vMinDate);
1088 - pList[pRow].setEnd(vMaxDate);
1089 - pList[pRow].setNumKid(vNumKid);
1090 - pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid));
1091 - }
1092 -
1093 -}
1094 -
1095 -
1096 -// Used to determine the minimum date of all tasks and set lower bound based on format
1097 -JSGantt.getMinDate = function getMinDate(pList, pFormat)
1098 - {
1099 -
1100 - var vDate = new Date();
1101 -
1102 - vDate.setFullYear(pList[0].getStart().getFullYear(), pList[0].getStart().getMonth(), pList[0].getStart().getDate());
1103 -
1104 - // Parse all Task End dates to find min
1105 - for(i = 0; i < pList.length; i++)
1106 - {
1107 - if(Date.parse(pList[i].getStart()) < Date.parse(vDate))
1108 - vDate.setFullYear(pList[i].getStart().getFullYear(), pList[i].getStart().getMonth(), pList[i].getStart().getDate());
1109 - }
1110 -
1111 - if ( pFormat== 'minute')
1112 - {
1113 - vDate.setHours(0);
1114 - vDate.setMinutes(0);
1115 - }
1116 - else if (pFormat == 'hour' )
1117 - {
1118 - vDate.setHours(0);
1119 - vDate.setMinutes(0);
1120 - }
1121 - // Adjust min date to specific format boundaries (first of week or first of month)
1122 - else if (pFormat=='day')
1123 - {
1124 - vDate.setDate(vDate.getDate() - 1);
1125 - while(vDate.getDay() % 7 > 0)
1126 - {
1127 - vDate.setDate(vDate.getDate() - 1);
1128 - }
1129 -
1130 - }
1131 -
1132 - else if (pFormat=='week')
1133 - {
1134 - vDate.setDate(vDate.getDate() - 7);
1135 - while(vDate.getDay() % 7 > 0)
1136 - {
1137 - vDate.setDate(vDate.getDate() - 1);
1138 - }
1139 -
1140 - }
1141 -
1142 - else if (pFormat=='month')
1143 - {
1144 - while(vDate.getDate() > 1)
1145 - {
1146 - vDate.setDate(vDate.getDate() - 1);
1147 - }
1148 - }
1149 -
1150 - else if (pFormat=='quarter')
1151 - {
1152 - if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
1153 - vDate.setFullYear(vDate.getFullYear(), 0, 1);
1154 - else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
1155 - vDate.setFullYear(vDate.getFullYear(), 3, 1);
1156 - else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
1157 - vDate.setFullYear(vDate.getFullYear(), 6, 1);
1158 - else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
1159 - vDate.setFullYear(vDate.getFullYear(), 9, 1);
1160 -
1161 - }
1162 -
1163 - return(vDate);
1164 -
1165 - }
1166 -
1167 -
1168 -
1169 -
1170 -
1171 -
1172 -
1173 - // Used to determine the minimum date of all tasks and set lower bound based on format
1174 -
1175 -JSGantt.getMaxDate = function (pList, pFormat)
1176 -{
1177 - var vDate = new Date();
1178 -
1179 - vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
1180 -
1181 -
1182 - // Parse all Task End dates to find max
1183 - for(i = 0; i < pList.length; i++)
1184 - {
1185 - if(Date.parse(pList[i].getEnd()) > Date.parse(vDate))
1186 - {
1187 - //vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
1188 - vDate.setTime(Date.parse(pList[i].getEnd()));
1189 - }
1190 - }
1191 -
1192 - if (pFormat == 'minute')
1193 - {
1194 - vDate.setHours(vDate.getHours() + 1);
1195 - vDate.setMinutes(59);
1196 - }
1197 -
1198 - if (pFormat == 'hour')
1199 - {
1200 - vDate.setHours(vDate.getHours() + 2);
1201 - }
1202 -
1203 - // Adjust max date to specific format boundaries (end of week or end of month)
1204 - if (pFormat=='day')
1205 - {
1206 - vDate.setDate(vDate.getDate() + 1);
1207 -
1208 - while(vDate.getDay() % 6 > 0)
1209 - {
1210 - vDate.setDate(vDate.getDate() + 1);
1211 - }
1212 -
1213 - }
1214 -
1215 - if (pFormat=='week')
1216 - {
1217 - //For weeks, what is the last logical boundary?
1218 - vDate.setDate(vDate.getDate() + 11);
1219 -
1220 - while(vDate.getDay() % 6 > 0)
1221 - {
1222 - vDate.setDate(vDate.getDate() + 1);
1223 - }
1224 -
1225 - }
1226 -
1227 - // Set to last day of current Month
1228 - if (pFormat=='month')
1229 - {
1230 - while(vDate.getDay() > 1)
1231 - {
1232 - vDate.setDate(vDate.getDate() + 1);
1233 - }
1234 -
1235 - vDate.setDate(vDate.getDate() - 1);
1236 - }
1237 -
1238 - // Set to last day of current Quarter
1239 - if (pFormat=='quarter')
1240 - {
1241 - if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
1242 - vDate.setFullYear(vDate.getFullYear(), 2, 31);
1243 - else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
1244 - vDate.setFullYear(vDate.getFullYear(), 5, 30);
1245 - else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
1246 - vDate.setFullYear(vDate.getFullYear(), 8, 30);
1247 - else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
1248 - vDate.setFullYear(vDate.getFullYear(), 11, 31);
1249 -
1250 - }
1251 -
1252 - return(vDate);
1253 -
1254 - }
1255 -
1256 -
1257 -
1258 -
1259 -
1260 -
1261 -
1262 - // This function finds the document id of the specified object
1263 -
1264 -JSGantt.findObj = function (theObj, theDoc)
1265 -
1266 - {
1267 -
1268 - var p, i, foundObj;
1269 -
1270 - if(!theDoc) theDoc = document;
1271 -
1272 - if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
1273 -
1274 - theDoc = parent.frames[theObj.substring(p+1)].document;
1275 -
1276 - theObj = theObj.substring(0,p);
1277 -
1278 - }
1279 -
1280 - if(!(foundObj = theDoc[theObj]) && theDoc.all)
1281 -
1282 - foundObj = theDoc.all[theObj];
1283 -
1284 -
1285 -
1286 - for (i=0; !foundObj && i < theDoc.forms.length; i++)
1287 -
1288 - foundObj = theDoc.forms[i][theObj];
1289 -
1290 -
1291 -
1292 - for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
1293 -
1294 - foundObj = JSGantt.findObj(theObj,theDoc.layers[i].document);
1295 -
1296 -
1297 -
1298 - if(!foundObj && document.getElementById)
1299 -
1300 - foundObj = document.getElementById(theObj);
1301 -
1302 -
1303 -
1304 - return foundObj;
1305 -
1306 - }
1307 -
1308 -
1309 -
1310 -
1311 -
1312 -JSGantt.changeFormat = function(pFormat,ganttObj) {
1313 -
1314 -
1315 -
1316 - if(ganttObj)
1317 -
1318 - {
1319 -
1320 - ganttObj.setFormat(pFormat);
1321 -
1322 - ganttObj.DrawDependencies();
1323 -
1324 - }
1325 -
1326 - else
1327 -
1328 - alert('Chart undefined');
1329 -
1330 -
1331 -
1332 - }
1333 -
1334 -
1335 -
1336 -
1337 -
1338 - // Function to open/close and hide/show children of specified task
1339 -
1340 -JSGantt.folder= function (pID,ganttObj) {
1341 -
1342 - var vList = ganttObj.getList();
1343 -
1344 - for(i = 0; i < vList.length; i++)
1345 - {
1346 - if(vList[i].getID() == pID) {
1347 -
1348 - if( vList[i].getOpen() == 1 ) {
1349 - vList[i].setOpen(0);
1350 - JSGantt.hide(pID,ganttObj);
1351 -
1352 - if (JSGantt.isIE())
1353 - JSGantt.findObj('group_'+pID).innerText = '+';
1354 - else
1355 - JSGantt.findObj('group_'+pID).textContent = '+';
1356 -
1357 - } else {
1358 -
1359 - vList[i].setOpen(1);
1360 -
1361 - JSGantt.show(pID, 1, ganttObj);
1362 -
1363 - if (JSGantt.isIE())
1364 - JSGantt.findObj('group_'+pID).innerText = '�';
1365 - else
1366 - JSGantt.findObj('group_'+pID).textContent = '�';
1367 -
1368 - }
1369 -
1370 - }
1371 - }
1372 -}
1373 -
1374 -JSGantt.hide= function (pID,ganttObj) {
1375 - var vList = ganttObj.getList();
1376 - var vID = 0;
1377 -
1378 - for(var i = 0; i < vList.length; i++)
1379 - {
1380 - if(vList[i].getParent() == pID) {
1381 - vID = vList[i].getID();
1382 - JSGantt.findObj('child_' + vID).style.display = "none";
1383 - JSGantt.findObj('childgrid_' + vID).style.display = "none";
1384 - vList[i].setVisible(0);
1385 - if(vList[i].getGroup() == 1)
1386 - JSGantt.hide(vID,ganttObj);
1387 - }
1388 -
1389 - }
1390 -}
1391 -
1392 -// Function to show children of specified task
1393 -JSGantt.show = function (pID, pTop, ganttObj) {
1394 - var vList = ganttObj.getList();
1395 - var vID = 0;
1396 -
1397 - for(var i = 0; i < vList.length; i++)
1398 - {
1399 - if(vList[i].getParent() == pID) {
1400 - vID = vList[i].getID();
1401 - if(pTop == 1) {
1402 - if (JSGantt.isIE()) { // IE;
1403 -
1404 - if( JSGantt.findObj('group_'+pID).innerText == '+') {
1405 - JSGantt.findObj('child_'+vID).style.display = "";
1406 - JSGantt.findObj('childgrid_'+vID).style.display = "";
1407 - vList[i].setVisible(1);
1408 - }
1409 -
1410 - } else {
1411 -
1412 - if( JSGantt.findObj('group_'+pID).textContent == '+') {
1413 - JSGantt.findObj('child_'+vID).style.display = "";
1414 - JSGantt.findObj('childgrid_'+vID).style.display = "";
1415 - vList[i].setVisible(1);
1416 - }
1417 -
1418 - }
1419 -
1420 - } else {
1421 -
1422 - if (JSGantt.isIE()) { // IE;
1423 - if( JSGantt.findObj('group_'+pID).innerText == '�') {
1424 - JSGantt.findObj('child_'+vID).style.display = "";
1425 - JSGantt.findObj('childgrid_'+vID).style.display = "";
1426 - vList[i].setVisible(1);
1427 - }
1428 -
1429 - } else {
1430 -
1431 - if( JSGantt.findObj('group_'+pID).textContent == '�') {
1432 - JSGantt.findObj('child_'+vID).style.display = "";
1433 - JSGantt.findObj('childgrid_'+vID).style.display = "";
1434 - vList[i].setVisible(1);
1435 - }
1436 - }
1437 - }
1438 -
1439 - if(vList[i].getGroup() == 1)
1440 - JSGantt.show(vID, 0,ganttObj);
1441 -
1442 - }
1443 - }
1444 -}
1445 -
1446 -
1447 -
1448 -
1449 -
1450 - // function to open window to display task link
1451 -
1452 -JSGantt.taskLink = function(pRef,pWidth,pHeight)
1453 -
1454 - {
1455 -
1456 - if(pWidth) vWidth =pWidth; else vWidth =400;
1457 - if(pHeight) vHeight=pHeight; else vHeight=400;
1458 -
1459 - var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
1460 -
1461 - }
1462 -
1463 -JSGantt.parseDateStr = function(pDateStr,pFormatStr) {
1464 - var vDate =new Date();
1465 - vDate.setTime( Date.parse(pDateStr));
1466 -
1467 - switch(pFormatStr)
1468 - {
1469 - case 'mm/dd/yyyy':
1470 - var vDateParts = pDateStr.split('/');
1471 - vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));
1472 - break;
1473 - case 'dd/mm/yyyy':
1474 - var vDateParts = pDateStr.split('/');
1475 - vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));
1476 - break;
1477 - case 'yyyy-mm-dd':
1478 - var vDateParts = pDateStr.split('-');
1479 - vDate.setFullYear(parseInt(vDateParts[0], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[1], 10));
1480 - break;
1481 - }
1482 -
1483 - return(vDate);
1484 -
1485 -}
1486 -
1487 -JSGantt.formatDateStr = function(pDate,pFormatStr) {
1488 - vYear4Str = pDate.getFullYear() + '';
1489 - vYear2Str = vYear4Str.substring(2,4);
1490 - vMonthStr = (pDate.getMonth()+1) + '';
1491 - vDayStr = pDate.getDate() + '';
1492 -
1493 - var vDateStr = "";
1494 -
1495 - switch(pFormatStr) {
1496 - case 'mm/dd/yyyy':
1497 - return( vMonthStr + '/' + vDayStr + '/' + vYear4Str );
1498 - case 'dd/mm/yyyy':
1499 - return( vDayStr + '/' + vMonthStr + '/' + vYear4Str );
1500 - case 'yyyy-mm-dd':
1501 - return( vYear4Str + '-' + vMonthStr + '-' + vDayStr );
1502 - case 'mm/dd/yy':
1503 - return( vMonthStr + '/' + vDayStr + '/' + vYear2Str );
1504 - case 'dd/mm/yy':
1505 - return( vDayStr + '/' + vMonthStr + '/' + vYear2Str );
1506 - case 'yy-mm-dd':
1507 - return( vYear2Str + '-' + vMonthStr + '-' + vDayStr );
1508 - case 'mm/dd':
1509 - return( vMonthStr + '/' + vDayStr );
1510 - case 'dd/mm':
1511 - return( vDayStr + '/' + vMonthStr );
1512 - }
1513 -
1514 -}
1515 -
1516 -JSGantt.parseXML = function(ThisFile,pGanttVar){
1517 - var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; // Is this Chrome
1518 -
1519 - try { //Internet Explorer
1520 - xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
1521 - }
1522 - catch(e) {
1523 - try { //Firefox, Mozilla, Opera, Chrome etc.
1524 - if (is_chrome==false) { xmlDoc=document.implementation.createDocument("","",null); }
1525 - }
1526 - catch(e) {
1527 - alert(e.message);
1528 - return;
1529 - }
1530 - }
1531 -
1532 - if (is_chrome==false) { // can't use xmlDoc.load in chrome at the moment
1533 - xmlDoc.async=false;
1534 - xmlDoc.load(ThisFile); // we can use loadxml
1535 - JSGantt.AddXMLTask(pGanttVar)
1536 - xmlDoc=null; // a little tidying
1537 - Task = null;
1538 - }
1539 - else {
1540 - JSGantt.ChromeLoadXML(ThisFile,pGanttVar);
1541 - ta=null; // a little tidying
1542 - }
1543 -}
1544 -
1545 -JSGantt.AddXMLTask = function(pGanttVar){
1546 -
1547 - Task=xmlDoc.getElementsByTagName("task");
1548 -
1549 - var n = xmlDoc.documentElement.childNodes.length; // the number of tasks. IE gets this right, but mozilla add extra ones (Whitespace)
1550 -
1551 - for(var i=0;i<n;i++) {
1552 -
1553 - // optional parameters may not have an entry (Whitespace from mozilla also returns an error )
1554 - // Task ID must NOT be zero other wise it will be skipped
1555 - try { pID = Task[i].getElementsByTagName("pID")[0].childNodes[0].nodeValue;
1556 - } catch (error) {pID =0;}
1557 - pID *= 1; // make sure that these are numbers rather than strings in order to make jsgantt.js behave as expected.
1558 -
1559 - if(pID!=0){
1560 - try { pName = Task[i].getElementsByTagName("pName")[0].childNodes[0].nodeValue;
1561 - } catch (error) {pName ="No Task Name";} // If there is no corresponding entry in the XML file the set a default.
1562 -
1563 - try { pColor = Task[i].getElementsByTagName("pColor")[0].childNodes[0].nodeValue;
1564 - } catch (error) {pColor ="0000ff";}
1565 -
1566 - try { pParent = Task[i].getElementsByTagName("pParent")[0].childNodes[0].nodeValue;
1567 - } catch (error) {pParent =0;}
1568 - pParent *= 1;
1569 -
1570 - try { pStart = Task[i].getElementsByTagName("pStart")[0].childNodes[0].nodeValue;
1571 - } catch (error) {pStart ="";}
1572 -
1573 - try { pEnd = Task[i].getElementsByTagName("pEnd")[0].childNodes[0].nodeValue;
1574 - } catch (error) { pEnd ="";}
1575 -
1576 - try { pLink = Task[i].getElementsByTagName("pLink")[0].childNodes[0].nodeValue;
1577 - } catch (error) { pLink ="";}
1578 -
1579 - try { pMile = Task[i].getElementsByTagName("pMile")[0].childNodes[0].nodeValue;
1580 - } catch (error) { pMile=0;}
1581 - pMile *= 1;
1582 -
1583 - try { pRes = Task[i].getElementsByTagName("pRes")[0].childNodes[0].nodeValue;
1584 - } catch (error) { pRes ="";}
1585 -
1586 - try { pComp = Task[i].getElementsByTagName("pComp")[0].childNodes[0].nodeValue;
1587 - } catch (error) {pComp =0;}
1588 - pComp *= 1;
1589 -
1590 - try { pGroup = Task[i].getElementsByTagName("pGroup")[0].childNodes[0].nodeValue;
1591 - } catch (error) {pGroup =0;}
1592 - pGroup *= 1;
1593 -
1594 - try { pOpen = Task[i].getElementsByTagName("pOpen")[0].childNodes[0].nodeValue;
1595 - } catch (error) { pOpen =1;}
1596 - pOpen *= 1;
1597 -
1598 - try { pDepend = Task[i].getElementsByTagName("pDepend")[0].childNodes[0].nodeValue;
1599 - } catch (error) { pDepend =0;}
1600 - //pDepend *= 1;
1601 - if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
1602 -
1603 - try { pCaption = Task[i].getElementsByTagName("pCaption")[0].childNodes[0].nodeValue;
1604 - } catch (error) { pCaption ="";}
1605 -
1606 -
1607 - // Finally add the task
1608 - pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption));
1609 - }
1610 - }
1611 -}
1612 -
1613 -JSGantt.ChromeLoadXML = function(ThisFile,pGanttVar){
1614 -// Thanks to vodobas at mindlence,com for the initial pointers here.
1615 - XMLLoader = new XMLHttpRequest();
1616 - XMLLoader.onreadystatechange= function(){
1617 - JSGantt.ChromeXMLParse(pGanttVar);
1618 - };
1619 - XMLLoader.open("GET", ThisFile, false);
1620 - XMLLoader.send(null);
1621 -}
1622 -
1623 -JSGantt.ChromeXMLParse = function (pGanttVar){
1624 -// Manually parse the file as it is loads quicker
1625 - if (XMLLoader.readyState == 4) {
1626 - var ta=XMLLoader.responseText.split(/<task>/gi);
1627 -
1628 - var n = ta.length; // the number of tasks.
1629 - for(var i=1;i<n;i++) {
1630 - Task = ta[i].replace(/<[/]p/g, '<p');
1631 - var te = Task.split(/<pid>/i)
1632 -
1633 - if(te.length> 2){var pID=te[1];} else {var pID = 0;}
1634 - pID *= 1;
1635 -
1636 - var te = Task.split(/<pName>/i)
1637 - if(te.length> 2){var pName=te[1];} else {var pName = "No Task Name";}
1638 -
1639 - var te = Task.split(/<pstart>/i)
1640 - if(te.length> 2){var pStart=te[1];} else {var pStart = "";}
1641 -
1642 - var te = Task.split(/<pEnd>/i)
1643 - if(te.length> 2){var pEnd=te[1];} else {var pEnd = "";}
1644 -
1645 - var te = Task.split(/<pColor>/i)
1646 - if(te.length> 2){var pColor=te[1];} else {var pColor = '0000ff';}
1647 -
1648 - var te = Task.split(/<pLink>/i)
1649 - if(te.length> 2){var pLink=te[1];} else {var pLink = "";}
1650 -
1651 - var te = Task.split(/<pMile>/i)
1652 - if(te.length> 2){var pMile=te[1];} else {var pMile = 0;}
1653 - pMile *= 1;
1654 -
1655 - var te = Task.split(/<pRes>/i)
1656 - if(te.length> 2){var pRes=te[1];} else {var pRes = "";}
1657 -
1658 - var te = Task.split(/<pComp>/i)
1659 - if(te.length> 2){var pComp=te[1];} else {var pComp = 0;}
1660 - pComp *= 1;
1661 -
1662 - var te = Task.split(/<pGroup>/i)
1663 - if(te.length> 2){var pGroup=te[1];} else {var pGroup = 0;}
1664 - pGroup *= 1;
1665 -
1666 - var te = Task.split(/<pParent>/i)
1667 - if(te.length> 2){var pParent=te[1];} else {var pParent = 0;}
1668 - pParent *= 1;
1669 -
1670 - var te = Task.split(/<pOpen>/i)
1671 - if(te.length> 2){var pOpen=te[1];} else {var pOpen = 1;}
1672 - pOpen *= 1;
1673 -
1674 - var te = Task.split(/<pDepend>/i)
1675 - if(te.length> 2){var pDepend=te[1];} else {var pDepend = "";}
1676 - //pDepend *= 1;
1677 - if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
1678 -
1679 - var te = Task.split(/<pCaption>/i)
1680 - if(te.length> 2){var pCaption=te[1];} else {var pCaption = "";}
1681 -
1682 - // Finally add the task
1683 - pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption ));
1684 - }
1685 - }
1686 -}
1687 -
1688 -JSGantt.benchMark = function(pItem){
1689 - var vEndTime=new Date().getTime();
1690 - alert(pItem + ': Elapsed time: '+((vEndTime-vBenchTime)/1000)+' seconds.');
1691 - vBenchTime=new Date().getTime();
1692 -}
1693 -
1694 -
 2+/*
 3+ _ ___ _ _ _ ____
 4+ (_)___ / _ \__ _ _ __ | |_| |_ / | |___ \
 5+ | / __| / /_\/ _` | '_ \| __| __| | | __) |
 6+ | \__ \/ /_\\ (_| | | | | |_| |_ | |_ / __/
 7+ _/ |___/\____/\__,_|_| |_|\__|\__| |_(_)_____|
 8+|__/
 9+
 10+Copyright (c) 2009, Shlomy Gantz BlueBrick Inc. All rights reserved.
 11+
 12+*
 13+* Redistribution and use in source and binary forms, with or without
 14+* modification, are permitted provided that the following conditions are met:
 15+* * Redistributions of source code must retain the above copyright
 16+* notice, this list of conditions and the following disclaimer.
 17+* * Redistributions in binary form must reproduce the above copyright
 18+* notice, this list of conditions and the following disclaimer in the
 19+* documentation and/or other materials provided with the distribution.
 20+* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the
 21+* names of its contributors may be used to endorse or promote products
 22+* derived from this software without specific prior written permission.
 23+*
 24+* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY
 25+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 26+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 27+* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY
 28+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 29+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 30+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 31+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 32+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 33+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 34+*/
 35+
 36+var JSGantt; if (!JSGantt) JSGantt = {};
 37+
 38+var vTimeout = 0;
 39+var vBenchTime = new Date().getTime();
 40+
 41+JSGantt.isIE = function () {
 42+
 43+ if(typeof document.all != 'undefined')
 44+ return true;
 45+ else
 46+ return false;
 47+}
 48+
 49+
 50+JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pPicture, pPictureLink)
 51+{
 52+
 53+ var vID = pID;
 54+ var vName = pName;
 55+ var vStart = new Date();
 56+ var vEnd = new Date();
 57+ var vColor = pColor;
 58+ var vLink = pLink;
 59+ var vMile = pMile;
 60+ var vRes = pRes;
 61+ var vComp = pComp;
 62+ var vGroup = pGroup;
 63+ var vParent = pParent;
 64+ var vOpen = pOpen;
 65+ var vDepend = pDepend;
 66+ var vCaption = pCaption;
 67+ var vPicture = pPicture;
 68+ var vPictureLink = pPictureLink;
 69+ var vDuration = '';
 70+ var vLevel = 0;
 71+ var vNumKid = 0;
 72+ var vVisible = 1;
 73+ var x1, y1, x2, y2;
 74+
 75+ if (vGroup != 1)
 76+ {
 77+ vStart = JSGantt.parseDateStr(pStart,g.getDateInputFormat());
 78+ vEnd = JSGantt.parseDateStr(pEnd,g.getDateInputFormat());
 79+ }
 80+
 81+ this.getID = function(){ return vID };
 82+ this.getName = function(){ return vName };
 83+ this.getStart = function(){ return vStart};
 84+ this.getEnd = function(){ return vEnd };
 85+ this.getColor = function(){ return vColor};
 86+ this.getLink = function(){ return vLink };
 87+ this.getMile = function(){ return vMile };
 88+ this.getPictureLink = function(){ return vPictureLink };
 89+ this.getPicture = function(){ return vPicture };
 90+ this.getDepend = function(){ if(vDepend) return vDepend; else return null };
 91+ this.getCaption = function(){ if(vCaption) return vCaption; else return ''; };
 92+ this.getResource = function(){ if(vRes) return vRes; else return '&nbsp'; };
 93+ this.getCompVal = function(){ if(vComp) return vComp; else return 0; };
 94+ this.getCompStr = function(){ if(vComp) return vComp+'%'; else return ''; };
 95+
 96+ this.getDuration = function(vFormat){
 97+ if (vMile)
 98+ vDuration = '-';
 99+ else if (vFormat=='hour')
 100+ {
 101+ tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 60 * 1000) );
 102+ if(tmpPer == 1)
 103+ vDuration = '1 Hour';
 104+ else
 105+ vDuration = tmpPer + ' Hours';
 106+ }
 107+
 108+ else if (vFormat=='minute')
 109+ {
 110+ tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 1000) );
 111+ if(tmpPer == 1)
 112+ vDuration = '1 Minute';
 113+ else
 114+ vDuration = tmpPer + ' Minutes';
 115+ }
 116+
 117+ else { //if(vFormat == 'day') {
 118+ tmpPer = Math.ceil((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1);
 119+ if(tmpPer == 1) vDuration = '1 Day';
 120+ else vDuration = tmpPer + ' Days';
 121+ }
 122+
 123+ //else if(vFormat == 'week') {
 124+ // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/7;
 125+ // if(tmpPer == 1) vDuration = '1 Week';
 126+ // else vDuration = tmpPer + ' Weeks';
 127+ //}
 128+
 129+ //else if(vFormat == 'month') {
 130+ // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/30;
 131+ // if(tmpPer == 1) vDuration = '1 Month';
 132+ // else vDuration = tmpPer + ' Months';
 133+ //}
 134+
 135+ //else if(vFormat == 'quater') {
 136+ // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/120;
 137+ // if(tmpPer == 1) vDuration = '1 Qtr';
 138+ // else vDuration = tmpPer + ' Qtrs';
 139+ //}
 140+ return( vDuration )
 141+ };
 142+
 143+ this.getParent = function(){ return vParent };
 144+ this.getGroup = function(){ return vGroup };
 145+ this.getOpen = function(){ return vOpen };
 146+ this.getLevel = function(){ return vLevel };
 147+ this.getNumKids = function(){ return vNumKid };
 148+ this.getStartX = function(){ return x1 };
 149+ this.getStartY = function(){ return y1 };
 150+ this.getEndX = function(){ return x2 };
 151+ this.getEndY = function(){ return y2 };
 152+ this.getVisible = function(){ return vVisible };
 153+ this.setDepend = function(pDepend){ vDepend = pDepend;};
 154+ this.setStart = function(pStart){ vStart = pStart;};
 155+ this.setEnd = function(pEnd) { vEnd = pEnd; };
 156+ this.setLevel = function(pLevel){ vLevel = pLevel;};
 157+ this.setNumKid = function(pNumKid){ vNumKid = pNumKid;};
 158+ this.setCompVal = function(pCompVal){ vComp = pCompVal;};
 159+ this.setStartX = function(pX) {x1 = pX; };
 160+ this.setStartY = function(pY) {y1 = pY; };
 161+ this.setEndX = function(pX) {x2 = pX; };
 162+ this.setEndY = function(pY) {y2 = pY; };
 163+ this.setOpen = function(pOpen) {vOpen = pOpen; };
 164+ this.setVisible = function(pVisible) {vVisible = pVisible; };
 165+
 166+ }
 167+
 168+
 169+ // function that loads the main gantt chart properties and functions
 170+ // pDiv: (required) this is a DIV object created in HTML
 171+ // pStart: UNUSED - future use to force minimum chart date
 172+ // pEnd: UNUSED - future use to force maximum chart date
 173+ // pWidth: UNUSED - future use to force chart width and cause objects to scale to fit within that width
 174+ // pShowRes: UNUSED - future use to turn on/off display of resource names
 175+ // pShowDur: UNUSED - future use to turn on/off display of task durations
 176+ // pFormat: (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format
 177+ // pCationType - what type of Caption to show: Caption, Resource, Duration, Complete
 178+JSGantt.GanttChart = function(pGanttVar, pDiv, pFormat)
 179+{
 180+
 181+ var vGanttVar = pGanttVar;
 182+ var vDiv = pDiv;
 183+ var vFormat = pFormat;
 184+ var vShowRes = 1;
 185+ var vShowDur = 1;
 186+ var vShowComp = 1;
 187+ var vShowStartDate = 1;
 188+ var vShowEndDate = 1;
 189+ var vShowPicture = 1;
 190+ var vDateInputFormat = "mm/dd/yyyy";
 191+ var vDateDisplayFormat = "mm/dd/yy";
 192+ var vNumUnits = 0;
 193+ var vCaptionType;
 194+ var vDepId = 1;
 195+ var vTaskList = new Array();
 196+ var vFormatArr = new Array("day","week","month","quarter");
 197+ var vQuarterArr = new Array(1,1,1,2,2,2,3,3,3,4,4,4);
 198+ var vMonthDaysArr = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
 199+ var vMonthArr = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
 200+ this.setFormatArr = function() {
 201+ vFormatArr = new Array();
 202+ for(var i = 0; i < arguments.length; i++) {vFormatArr[i] = arguments[i];}
 203+ if(vFormatArr.length>4){vFormatArr.length=4;}
 204+ };
 205+ this.setShowRes = function(pShow) { vShowRes = pShow; };
 206+ this.setShowDur = function(pShow) { vShowDur = pShow; };
 207+ this.setShowComp = function(pShow) { vShowComp = pShow; };
 208+ this.setShowStartDate = function(pShow) { vShowStartDate = pShow; };
 209+ this.setShowEndDate = function(pShow) { vShowEndDate = pShow; };
 210+ this.setShowPicture = function(pShow) { vShowPicture = pShow; };
 211+ this.setDateInputFormat = function(pShow) { vDateInputFormat = pShow; };
 212+ this.setDateDisplayFormat = function(pShow) { vDateDisplayFormat = pShow; };
 213+ this.setCaptionType = function(pType) { vCaptionType = pType };
 214+ this.setFormat = function(pFormat){
 215+ vFormat = pFormat;
 216+ this.Draw();
 217+ };
 218+
 219+ this.getShowRes = function(){ return vShowRes };
 220+ this.getShowDur = function(){ return vShowDur };
 221+ this.getShowComp = function(){ return vShowComp };
 222+ this.getShowStartDate = function(){ return vShowStartDate };
 223+ this.getShowEndDate = function(){ return vShowEndDate };
 224+ this.getShowPicture = function(){ return vShowPicture };
 225+ this.getDateInputFormat = function() { return vDateInputFormat };
 226+ this.getDateDisplayFormat = function() { return vDateDisplayFormat };
 227+ this.getCaptionType = function() { return vCaptionType };
 228+ this.CalcTaskXY = function ()
 229+ {
 230+ var vList = this.getList();
 231+ var vTaskDiv;
 232+ var vParDiv;
 233+ var vLeft, vTop, vHeight, vWidth;
 234+
 235+ for(i = 0; i < vList.length; i++)
 236+ {
 237+ vID = vList[i].getID();
 238+ vTaskDiv = document.getElementById("taskbar_"+vID);
 239+ vBarDiv = document.getElementById("bardiv_"+vID);
 240+ vParDiv = document.getElementById("childgrid_"+vID);
 241+
 242+ if(vBarDiv) {
 243+ vList[i].setStartX( vBarDiv.offsetLeft );
 244+ vList[i].setStartY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
 245+ vList[i].setEndX( vBarDiv.offsetLeft + vBarDiv.offsetWidth );
 246+ vList[i].setEndY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
 247+ }
 248+ }
 249+ }
 250+
 251+ this.AddTaskItem = function(value)
 252+ {
 253+ vTaskList.push(value);
 254+ }
 255+
 256+ this.getList = function() { return vTaskList };
 257+
 258+ this.clearDependencies = function()
 259+ {
 260+ var parent = document.getElementById('rightside');
 261+ var depLine;
 262+ var vMaxId = vDepId;
 263+ for ( i=1; i<vMaxId; i++ ) {
 264+ depLine = document.getElementById("line"+i);
 265+ if (depLine) { parent.removeChild(depLine); }
 266+ }
 267+ vDepId = 1;
 268+ }
 269+
 270+
 271+ // sLine: Draw a straight line (colored one-pixel wide DIV), need to parameterize doc item
 272+ this.sLine = function(x1,y1,x2,y2) {
 273+
 274+ vLeft = Math.min(x1,x2);
 275+ vTop = Math.min(y1,y2);
 276+ vWid = Math.abs(x2-x1) + 1;
 277+ vHgt = Math.abs(y2-y1) + 1;
 278+
 279+ vDoc = document.getElementById('rightside');
 280+
 281+ // retrieve DIV
 282+ var oDiv = document.createElement('div');
 283+
 284+ oDiv.id = "line"+vDepId++;
 285+ oDiv.style.position = "absolute";
 286+ oDiv.style.margin = "0px";
 287+ oDiv.style.padding = "0px";
 288+ oDiv.style.overflow = "hidden";
 289+ oDiv.style.border = "0px";
 290+
 291+ // set attributes
 292+ oDiv.style.zIndex = 0;
 293+ oDiv.style.backgroundColor = "red";
 294+
 295+ oDiv.style.left = vLeft + "px";
 296+ oDiv.style.top = vTop + "px";
 297+ oDiv.style.width = vWid + "px";
 298+ oDiv.style.height = vHgt + "px";
 299+
 300+ oDiv.style.visibility = "visible";
 301+
 302+ vDoc.appendChild(oDiv);
 303+
 304+ }
 305+
 306+
 307+ // dLine: Draw a diaganol line (calc line x,y paisrs and draw multiple one-by-one sLines)
 308+ this.dLine = function(x1,y1,x2,y2) {
 309+
 310+ var dx = x2 - x1;
 311+ var dy = y2 - y1;
 312+ var x = x1;
 313+ var y = y1;
 314+
 315+ var n = Math.max(Math.abs(dx),Math.abs(dy));
 316+ dx = dx / n;
 317+ dy = dy / n;
 318+ for ( i = 0; i <= n; i++ )
 319+ {
 320+ vx = Math.round(x);
 321+ vy = Math.round(y);
 322+ this.sLine(vx,vy,vx,vy);
 323+ x += dx;
 324+ y += dy;
 325+ }
 326+
 327+ }
 328+
 329+ this.drawDependency =function(x1,y1,x2,y2)
 330+ {
 331+ if(x1 + 10 < x2)
 332+ {
 333+ this.sLine(x1,y1,x1+4,y1);
 334+ this.sLine(x1+4,y1,x1+4,y2);
 335+ this.sLine(x1+4,y2,x2,y2);
 336+ this.dLine(x2,y2,x2-3,y2-3);
 337+ this.dLine(x2,y2,x2-3,y2+3);
 338+ this.dLine(x2-1,y2,x2-3,y2-2);
 339+ this.dLine(x2-1,y2,x2-3,y2+2);
 340+ }
 341+ else
 342+ {
 343+ this.sLine(x1,y1,x1+4,y1);
 344+ this.sLine(x1+4,y1,x1+4,y2-10);
 345+ this.sLine(x1+4,y2-10,x2-8,y2-10);
 346+ this.sLine(x2-8,y2-10,x2-8,y2);
 347+ this.sLine(x2-8,y2,x2,y2);
 348+ this.dLine(x2,y2,x2-3,y2-3);
 349+ this.dLine(x2,y2,x2-3,y2+3);
 350+ this.dLine(x2-1,y2,x2-3,y2-2);
 351+ this.dLine(x2-1,y2,x2-3,y2+2);
 352+ }
 353+ }
 354+
 355+ this.DrawDependencies = function () {
 356+
 357+ //First recalculate the x,y
 358+ this.CalcTaskXY();
 359+
 360+ this.clearDependencies();
 361+
 362+ var vList = this.getList();
 363+ for(var i = 0; i < vList.length; i++)
 364+ {
 365+
 366+ vDepend = vList[i].getDepend();
 367+ if(vDepend) {
 368+
 369+ var vDependStr = vDepend + '';
 370+ var vDepList = vDependStr.split(',');
 371+ var n = vDepList.length;
 372+
 373+ for(var k=0;k<n;k++) {
 374+ var vTask = this.getArrayLocationByID(vDepList[k]);
 375+
 376+ if(vList[vTask].getVisible()==1)
 377+ this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY())
 378+ }
 379+ }
 380+ }
 381+ }
 382+
 383+
 384+ this.getArrayLocationByID = function(pId) {
 385+
 386+ var vList = this.getList();
 387+ for(var i = 0; i < vList.length; i++)
 388+ {
 389+ if(vList[i].getID()==pId)
 390+ return i;
 391+ }
 392+ }
 393+
 394+
 395+ this.Draw = function()
 396+ {
 397+ var vMaxDate = new Date();
 398+ var vMinDate = new Date();
 399+ var vTmpDate = new Date();
 400+ var vNxtDate = new Date();
 401+ var vCurrDate = new Date();
 402+ var vTaskLeft = 0;
 403+ var vTaskRight = 0;
 404+ var vNumCols = 0;
 405+ var vID = 0;
 406+ var vMainTable = "";
 407+ var vLeftTable = "";
 408+ var vRightTable = "";
 409+ var vDateRowStr = "";
 410+ var vItemRowStr = "";
 411+ var vColWidth = 0;
 412+ var vColUnit = 0;
 413+ var vChartWidth = 0;
 414+ var vNumDays = 0;
 415+ var vDayWidth = 0;
 416+ var vStr = "";
 417+ var vNameWidth = 220;
 418+ var vStatusWidth = 70;
 419+ var vPictureWidth = 20;
 420+ var vLeftWidth = 15 + 220 + 70 + 70 + 70 + 70 + 70+ 20;
 421+
 422+ if(vTaskList.length > 0)
 423+ {
 424+
 425+ // Process all tasks preset parent date and completion %
 426+ JSGantt.processRows(vTaskList, 0, -1, 1, 1);
 427+
 428+ // get overall min/max dates plus padding
 429+ vMinDate = JSGantt.getMinDate(vTaskList, vFormat);
 430+ vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat);
 431+
 432+ // Calculate chart width variables. vColWidth can be altered manually to change each column width
 433+ // May be smart to make this a parameter of GanttChart or set it based on existing pWidth parameter
 434+ if(vFormat == 'day') {
 435+ vColWidth = 18;
 436+ vColUnit = 1;
 437+ }
 438+ else if(vFormat == 'week') {
 439+ vColWidth = 37;
 440+ vColUnit = 7;
 441+ }
 442+ else if(vFormat == 'month') {
 443+ vColWidth = 37;
 444+ vColUnit = 30;
 445+ }
 446+ else if(vFormat == 'quarter') {
 447+ vColWidth = 60;
 448+ vColUnit = 90;
 449+ }
 450+
 451+ else if(vFormat=='hour')
 452+ {
 453+ vColWidth = 18;
 454+ vColUnit = 1;
 455+ }
 456+
 457+ else if(vFormat=='minute')
 458+ {
 459+ vColWidth = 18;
 460+ vColUnit = 1;
 461+ }
 462+
 463+ vNumDays = (Date.parse(vMaxDate) - Date.parse(vMinDate)) / ( 24 * 60 * 60 * 1000);
 464+ vNumUnits = vNumDays / vColUnit;
 465+
 466+
 467+ vChartWidth = vNumUnits * vColWidth + 1;
 468+ vDayWidth = (vColWidth / vColUnit) + (1/vColUnit);
 469+
 470+ vMainTable =
 471+ '<TABLE id=theTable cellSpacing=0 cellPadding=0 border=0><TBODY><TR>' +
 472+ '<TD vAlign=top bgColor=#ffffff>';
 473+
 474+ if(vShowRes !=1) vNameWidth+=vStatusWidth;
 475+ if(vShowDur !=1) vNameWidth+=vStatusWidth;
 476+ if(vShowComp!=1) vNameWidth+=vStatusWidth;
 477+ if(vShowStartDate!=1) vNameWidth+=vStatusWidth;
 478+ if(vShowEndDate!=1) vNameWidth+=vStatusWidth;
 479+ if(vShowPicture!=1) vNameWidth+=vPictureWidth;
 480+ // DRAW the Left-side of the chart (names, resources, comp%)
 481+ vLeftTable =
 482+ '<DIV class=scroll id=leftside style="width:' + vLeftWidth + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +
 483+ '<TR style="HEIGHT: 17px">' +
 484+ ' <TD style="WIDTH: 15px; HEIGHT: 17px"></TD>' +
 485+ ' <TD style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 17px"><NOBR></NOBR></TD>';
 486+
 487+ if(vShowRes ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
 488+ if(vShowDur ==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
 489+ if(vShowComp==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
 490+ if(vShowStartDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
 491+ if(vShowEndDate==1) vLeftTable += ' <TD style="WIDTH: ' + vStatusWidth + 'px; HEIGHT: 17px"></TD>' ;
 492+ if(vShowPicture==1) vLeftTable += ' <TD style="WIDTH: ' + vPictureWidth + 'px; HEIGHT: 17px"></TD>' ;
 493+ vLeftTable +=
 494+ '<TR style="HEIGHT: 20px">' +
 495+ ' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: 15px; HEIGHT: 20px"></TD>' +
 496+ ' <TD style="BORDER-TOP: #efefef 1px solid; WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px"><NOBR></NOBR></TD>' ;
 497+
 498+ 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>' ;
 499+ 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>' ;
 500+ 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>' ;
 501+ 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>' ;
 502+ 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>' ;
 503+ if(vShowPicture==1) vLeftTable += ' <TD style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 20px; HEIGHT: 20px" align=center nowrap></TD>' ;
 504+ vLeftTable += '</TR>';
 505+
 506+ for(i = 0; i < vTaskList.length; i++)
 507+ {
 508+ if( vTaskList[i].getGroup()) {
 509+ vBGColor = "f3f3f3";
 510+ vRowType = "group";
 511+ } else {
 512+ vBGColor = "ffffff";
 513+ vRowType = "row";
 514+ }
 515+
 516+ vID = vTaskList[i].getID();
 517+
 518+ if(vTaskList[i].getVisible() == 0)
 519+ vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' style="display:none" onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
 520+ else
 521+ vLeftTable += '<TR id=child_' + vID + ' bgcolor=#' + vBGColor + ' onMouseover=g.mouseOver(this,' + vID + ',"left","' + vRowType + '") onMouseout=g.mouseOut(this,' + vID + ',"left","' + vRowType + '")>' ;
 522+
 523+ vLeftTable +=
 524+ ' <TD class=gdatehead style="WIDTH: 15px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;">&nbsp;</TD>' +
 525+ ' <TD class=gname style="WIDTH: ' + vNameWidth + 'px; HEIGHT: 20px; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px;" nowrap><NOBR><span style="color: #aaaaaa">';
 526+
 527+ for(j=1; j<vTaskList[i].getLevel(); j++) {
 528+ vLeftTable += '&nbsp&nbsp&nbsp&nbsp';
 529+ }
 530+
 531+ vLeftTable += '</span>';
 532+
 533+ if( vTaskList[i].getGroup()) {
 534+ if( vTaskList[i].getOpen() == 1)
 535+ vLeftTable += '<SPAN id="group_' + vID + '" style="color:#000000; cursor:pointer; font-weight:bold; FONT-SIZE: 12px;" onclick="JSGantt.folder(' + vID + ','+vGanttVar+');'+vGanttVar+'.DrawDependencies();">&ndash;</span><span style="color:#000000">&nbsp</SPAN>' ;
 536+ else
 537+ 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">&nbsp</SPAN>' ;
 538+
 539+ } else {
 540+
 541+ vLeftTable += '<span style="color: #000000; font-weight:bold; FONT-SIZE: 12px;">&nbsp&nbsp&nbsp</span>';
 542+ }
 543+
 544+ vLeftTable +=
 545+ '<span onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); style="cursor:pointer"> ' + vTaskList[i].getName() + '</span></NOBR></TD>' ;
 546+
 547+ 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>' ;
 548+ 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>' ;
 549+ 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>' ;
 550+ 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>' ;
 551+ 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>' ;
 552+ if(vShowPicture==1) vLeftTable += ' <TD class=gname ' ;
 553+ if(vShowPicture==1 && vTaskList[i].getPictureLink()!="" ) vLeftTable += 'onclick=JSGantt.taskLink("' + vTaskList[i].getPictureLink() + '",300,200); ' ;
 554+ if(vShowPicture==1) vLeftTable += 'style="WIDTH: 20px; HEIGHT: 20px; TEXT-ALIGN: center; BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; background-image: url('+vTaskList[i].getPicture()+');' ;
 555+ if(vShowPicture==1 && vTaskList[i].getPictureLink()!="" ) vLeftTable += 'cursor:pointer;';
 556+ if(vShowPicture==1) vLeftTable += '" align=center><NOBR></NOBR></TD>';
 557+ vLeftTable += '</TR>';
 558+
 559+ }
 560+
 561+ // DRAW the date format selector at bottom left. Another potential GanttChart parameter to hide/show this selector
 562+ vLeftTable += '</TD></TR>' +
 563+ '<TR><TD border=1 colspan=5 align=left style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #efefef 1px solid; height=18px">&nbsp;&nbsp;Powered by <a href=http://www.jsgantt.com>jsGantt</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format:';
 564+
 565+ if (vFormatArr.join().indexOf("minute")!=-1) {
 566+ if (vFormat=='minute') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="minute" checked>Minute';
 567+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("minute",'+vGanttVar+'); VALUE="minute">Minute';
 568+ }
 569+
 570+ if (vFormatArr.join().indexOf("hour")!=-1) {
 571+ if (vFormat=='hour') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="hour" checked>Hour';
 572+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("hour",'+vGanttVar+'); VALUE="hour">Hour';
 573+ }
 574+
 575+ if (vFormatArr.join().indexOf("day")!=-1) {
 576+ if (vFormat=='day') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="day" checked>Day';
 577+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("day",'+vGanttVar+'); VALUE="day">Day';
 578+ }
 579+
 580+ if (vFormatArr.join().indexOf("week")!=-1) {
 581+ if (vFormat=='week') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="week" checked>Week';
 582+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("week",'+vGanttVar+') VALUE="week">Week';
 583+ }
 584+
 585+ if (vFormatArr.join().indexOf("month")!=-1) {
 586+ if (vFormat=='month') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="month" checked>Month';
 587+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("month",'+vGanttVar+') VALUE="month">Month';
 588+ }
 589+
 590+ if (vFormatArr.join().indexOf("quarter")!=-1) {
 591+ if (vFormat=='quarter') vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" VALUE="quarter" checked>Quarter';
 592+ else vLeftTable += '<INPUT TYPE=RADIO NAME="radFormat" onclick=JSGantt.changeFormat("quarter",'+vGanttVar+') VALUE="quarter">Quarter';
 593+ }
 594+
 595+// vLeftTable += '<INPUT TYPE=RADIO NAME="other" VALUE="other" style="display:none"> .';
 596+
 597+ vLeftTable += '</TD></TR></TBODY></TABLE></TD>';
 598+
 599+ vMainTable += vLeftTable;
 600+
 601+ // Draw the Chart Rows
 602+ vRightTable =
 603+ '<TD style="width: ' + vChartWidth + 'px;" vAlign=top bgColor=#ffffff>' +
 604+ '<DIV class=scroll2 id=rightside>' +
 605+ '<TABLE style="width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
 606+ '<TBODY><TR style="HEIGHT: 18px">';
 607+
 608+ vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
 609+ vTmpDate.setHours(0);
 610+ vTmpDate.setMinutes(0);
 611+
 612+ // Major Date Header
 613+ while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
 614+ {
 615+ vStr = vTmpDate.getFullYear() + '';
 616+ vStr = vStr.substring(2,4);
 617+
 618+
 619+ if(vFormat == 'minute')
 620+ {
 621+ vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=60>' ;
 622+ vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' ' + vTmpDate.getHours() + ':00 -' + vTmpDate.getHours() + ':59 </td>';
 623+ vTmpDate.setHours(vTmpDate.getHours()+1);
 624+ }
 625+
 626+ if(vFormat == 'hour')
 627+ {
 628+ vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=24>' ;
 629+ vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
 630+ vTmpDate.setDate(vTmpDate.getDate()+1);
 631+ }
 632+
 633+ if(vFormat == 'day')
 634+ {
 635+ vRightTable += '<td class=gdatehead style="FONT-SIZE: 12px; HEIGHT: 19px;" align=center colspan=7>' +
 636+ JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5)) + ' - ';
 637+ vTmpDate.setDate(vTmpDate.getDate()+6);
 638+ vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + '</td>';
 639+ vTmpDate.setDate(vTmpDate.getDate()+1);
 640+ }
 641+ else if(vFormat == 'week')
 642+ {
 643+ vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
 644+ vTmpDate.setDate(vTmpDate.getDate()+7);
 645+ }
 646+ else if(vFormat == 'month')
 647+ {
 648+ vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
 649+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 650+ while(vTmpDate.getDate() > 1)
 651+ {
 652+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 653+ }
 654+ }
 655+ else if(vFormat == 'quarter')
 656+ {
 657+ vRightTable += '<td class=gdatehead align=center style="FONT-SIZE: 12px; HEIGHT: 19px;" width='+vColWidth+'px>`'+ vStr + '</td>';
 658+ vTmpDate.setDate(vTmpDate.getDate() + 81);
 659+ while(vTmpDate.getDate() > 1)
 660+ {
 661+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 662+ }
 663+ }
 664+
 665+ }
 666+
 667+ vRightTable += '</TR><TR>';
 668+
 669+ // Minor Date header and Cell Rows
 670+ vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
 671+ vNxtDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
 672+ vNumCols = 0;
 673+
 674+ while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
 675+ {
 676+ if (vFormat == 'minute')
 677+ {
 678+
 679+ if( vTmpDate.getMinutes() ==0 )
 680+ vWeekdayColor = "ccccff";
 681+ else
 682+ vWeekdayColor = "ffffff";
 683+
 684+
 685+ 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>';
 686+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 687+ vTmpDate.setMinutes(vTmpDate.getMinutes() + 1);
 688+ }
 689+
 690+ else if (vFormat == 'hour')
 691+ {
 692+
 693+ if( vTmpDate.getHours() ==0 )
 694+ vWeekdayColor = "ccccff";
 695+ else
 696+ vWeekdayColor = "ffffff";
 697+
 698+
 699+ 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>';
 700+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 701+ vTmpDate.setHours(vTmpDate.getHours() + 1);
 702+ }
 703+
 704+ else if(vFormat == 'day' )
 705+ {
 706+ if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) {
 707+ vWeekdayColor = "ccccff";
 708+ vWeekendColor = "9999ff";
 709+ vWeekdayGColor = "bbbbff";
 710+ vWeekendGColor = "8888ff";
 711+ } else {
 712+ vWeekdayColor = "ffffff";
 713+ vWeekendColor = "cfcfcf";
 714+ vWeekdayGColor = "f3f3f3";
 715+ vWeekendGColor = "c3c3c3";
 716+ }
 717+
 718+ if(vTmpDate.getDay() % 6 == 0) {
 719+ 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>';
 720+ vItemRowStr += '<td class="gheadwkend" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp</div></td>';
 721+ }
 722+ else {
 723+ 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>';
 724+ if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))
 725+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 726+ else
 727+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; cursor: default;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 728+ }
 729+
 730+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 731+
 732+ }
 733+
 734+ else if(vFormat == 'week')
 735+ {
 736+
 737+ vNxtDate.setDate(vNxtDate.getDate() + 7);
 738+
 739+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 740+ vWeekdayColor = "ccccff";
 741+ else
 742+ vWeekdayColor = "ffffff";
 743+
 744+ if(vNxtDate <= vMaxDate) {
 745+ 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>';
 746+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 747+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 748+ else
 749+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 750+
 751+ } else {
 752+ 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>';
 753+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 754+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 755+ else
 756+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 757+
 758+ }
 759+
 760+ vTmpDate.setDate(vTmpDate.getDate() + 7);
 761+
 762+ }
 763+
 764+ else if(vFormat == 'month')
 765+ {
 766+
 767+ vNxtDate.setFullYear(vTmpDate.getFullYear(), vTmpDate.getMonth(), vMonthDaysArr[vTmpDate.getMonth()]);
 768+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 769+ vWeekdayColor = "ccccff";
 770+ else
 771+ vWeekdayColor = "ffffff";
 772+
 773+ if(vNxtDate <= vMaxDate) {
 774+ 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>';
 775+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 776+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 777+ else
 778+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 779+ } else {
 780+ 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>';
 781+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 782+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 783+ else
 784+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 785+ }
 786+
 787+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 788+
 789+ while(vTmpDate.getDate() > 1)
 790+ {
 791+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 792+ }
 793+
 794+ }
 795+
 796+ else if(vFormat == 'quarter')
 797+ {
 798+
 799+ vNxtDate.setDate(vNxtDate.getDate() + 122);
 800+ if( vTmpDate.getMonth()==0 || vTmpDate.getMonth()==1 || vTmpDate.getMonth()==2 )
 801+ vNxtDate.setFullYear(vTmpDate.getFullYear(), 2, 31);
 802+ else if( vTmpDate.getMonth()==3 || vTmpDate.getMonth()==4 || vTmpDate.getMonth()==5 )
 803+ vNxtDate.setFullYear(vTmpDate.getFullYear(), 5, 30);
 804+ else if( vTmpDate.getMonth()==6 || vTmpDate.getMonth()==7 || vTmpDate.getMonth()==8 )
 805+ vNxtDate.setFullYear(vTmpDate.getFullYear(), 8, 30);
 806+ else if( vTmpDate.getMonth()==9 || vTmpDate.getMonth()==10 || vTmpDate.getMonth()==11 )
 807+ vNxtDate.setFullYear(vTmpDate.getFullYear(), 11, 31);
 808+
 809+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 810+ vWeekdayColor = "ccccff";
 811+ else
 812+ vWeekdayColor = "ffffff";
 813+
 814+ if(vNxtDate <= vMaxDate) {
 815+ 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>';
 816+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 817+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 818+ else
 819+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 820+ } else {
 821+ 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>';
 822+ if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
 823+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 824+ else
 825+ vItemRowStr += '<td class="ghead" style="BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; BORDER-RIGHT: #efefef 1px solid;" align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
 826+ }
 827+
 828+ vTmpDate.setDate(vTmpDate.getDate() + 81);
 829+
 830+ while(vTmpDate.getDate() > 1)
 831+ {
 832+ vTmpDate.setDate(vTmpDate.getDate() + 1);
 833+ }
 834+
 835+ }
 836+ }
 837+
 838+ vRightTable += vDateRowStr + '</TR>';
 839+ vRightTable += '</TBODY></TABLE>';
 840+
 841+ // Draw each row
 842+
 843+ for(i = 0; i < vTaskList.length; i++)
 844+
 845+ {
 846+
 847+ vTmpDate.setFullYear(vMinDate.getFullYear(), vMinDate.getMonth(), vMinDate.getDate());
 848+ vTaskStart = vTaskList[i].getStart();
 849+ vTaskEnd = vTaskList[i].getEnd();
 850+
 851+ vNumCols = 0;
 852+ vID = vTaskList[i].getID();
 853+
 854+ // vNumUnits = Math.ceil((vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000)) + 1;
 855+ vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / (24 * 60 * 60 * 1000) + 1;
 856+ if (vFormat=='hour')
 857+ {
 858+ vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
 859+ }
 860+ else if (vFormat=='minute')
 861+ {
 862+ vNumUnits = (vTaskList[i].getEnd() - vTaskList[i].getStart()) / ( 60 * 1000) + 1;
 863+ }
 864+
 865+ if(vTaskList[i].getVisible() == 0)
 866+ vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative; display:none;">';
 867+ else
 868+ vRightTable += '<DIV id=childgrid_' + vID + ' style="position:relative">';
 869+
 870+ if( vTaskList[i].getMile()) {
 871+
 872+ vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
 873+ '<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>';
 874+
 875+ // Build date string for Title
 876+ vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat);
 877+
 878+ vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);
 879+ vTaskRight = 1
 880+
 881+ vRightTable +=
 882+ '<div id=bardiv_' + vID + ' style="position:absolute; top:0px; left:' + Math.ceil((vTaskLeft * (vDayWidth) + 1)) + 'px; height: 18px; width:160px; overflow:hidden;">' +
 883+ ' <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);>';
 884+
 885+ if(vTaskList[i].getCompVal() < 100)
 886+ vRightTable += '&loz;</div>' ;
 887+ else
 888+ vRightTable += '&diams;</div>' ;
 889+
 890+ if( g.getCaptionType() ) {
 891+ vCaptionStr = '';
 892+ switch( g.getCaptionType() ) {
 893+ case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
 894+ case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
 895+ case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
 896+ case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
 897+ }
 898+ //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
 899+ vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:2px; width:120px; left:12px">' + vCaptionStr + '</div>';
 900+ }
 901+
 902+ vRightTable += '</div>';
 903+
 904+
 905+ } else {
 906+
 907+ // Build date string for Title
 908+ vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat)
 909+
 910+ if (vFormat=='minute')
 911+ {
 912+ vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 1000) + 1/vColUnit;
 913+ vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 1000));
 914+ }
 915+ else if (vFormat=='hour')
 916+ {
 917+ vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / ( 60 * 60 * 1000) + 1/vColUnit;
 918+ vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / ( 60 * 60 * 1000);
 919+ }
 920+ else
 921+ {
 922+ vTaskRight = (Date.parse(vTaskList[i].getEnd()) - Date.parse(vTaskList[i].getStart())) / (24 * 60 * 60 * 1000) + 1/vColUnit;
 923+ vTaskLeft = Math.ceil((Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000));
 924+ if (vFormat='day')
 925+ {
 926+ var tTime=new Date();
 927+ tTime.setTime(Date.parse(vTaskList[i].getStart()));
 928+ if (tTime.getMinutes() > 29)
 929+ vTaskLeft+=.5
 930+ }
 931+ }
 932+
 933+ // Draw Group Bar which has outer div with inner group div and several small divs to left and right to create angled-end indicators
 934+ if( vTaskList[i].getGroup()) {
 935+ vRightTable += '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
 936+ '<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>';
 937+ vRightTable +=
 938+ '<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">' +
 939+ '<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;">' +
 940+ '<div style="Z-INDEX: -4; float:left; background-color:#666666; height:3px; overflow: hidden; margin-top:1px; ' +
 941+ 'margin-left:1px; margin-right:1px; filter: alpha(opacity=80); opacity:0.8; width:' + vTaskList[i].getCompStr() + '; ' +
 942+ 'cursor: pointer;" onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200);>' +
 943+ '</div>' +
 944+ '</div>' +
 945+ '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
 946+ '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:4px; overflow: hidden; width:1px;"></div>' +
 947+ '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
 948+ '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:3px; overflow: hidden; width:1px;"></div>' +
 949+ '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
 950+ '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:2px; overflow: hidden; width:1px;"></div>' +
 951+ '<div style="Z-INDEX: -4; float:left; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' +
 952+ '<div style="Z-INDEX: -4; float:right; background-color:#000000; height:1px; overflow: hidden; width:1px;"></div>' ;
 953+
 954+ if( g.getCaptionType() ) {
 955+ vCaptionStr = '';
 956+ switch( g.getCaptionType() ) {
 957+ case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
 958+ case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
 959+ case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
 960+ case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
 961+ }
 962+ //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:1px;">' + vCaptionStr + '</div>';
 963+ vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
 964+ }
 965+
 966+ vRightTable += '</div>' ;
 967+
 968+ } else {
 969+
 970+ vDivStr = '<DIV><TABLE style="position:relative; top:0px; width: ' + vChartWidth + 'px;" cellSpacing=0 cellPadding=0 border=0>' +
 971+ '<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>';
 972+ vRightTable += vDivStr;
 973+
 974+ // Draw Task Bar which has outer DIV with enclosed colored bar div, and opaque completion div
 975+ vRightTable +=
 976+ '<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">' +
 977+ '<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;" ' +
 978+ 'onclick=JSGantt.taskLink("' + vTaskList[i].getLink() + '",300,200); >' +
 979+ '<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">' +
 980+ '</div>' +
 981+ '</div>';
 982+
 983+ if( g.getCaptionType() ) {
 984+ vCaptionStr = '';
 985+ switch( g.getCaptionType() ) {
 986+ case 'Caption': vCaptionStr = vTaskList[i].getCaption(); break;
 987+ case 'Resource': vCaptionStr = vTaskList[i].getResource(); break;
 988+ case 'Duration': vCaptionStr = vTaskList[i].getDuration(vFormat); break;
 989+ case 'Complete': vCaptionStr = vTaskList[i].getCompStr(); break;
 990+ }
 991+ //vRightTable += '<div style="FONT-SIZE:12px; position:absolute; left: 6px; top:-3px;">' + vCaptionStr + '</div>';
 992+ vRightTable += '<div style="FONT-SIZE:12px; position:absolute; top:-3px; width:120px; left:' + (Math.ceil((vTaskRight) * (vDayWidth) - 1) + 6) + 'px">' + vCaptionStr + '</div>';
 993+ }
 994+ vRightTable += '</div>' ;
 995+
 996+
 997+
 998+ }
 999+ }
 1000+
 1001+ vRightTable += '</DIV>';
 1002+
 1003+ }
 1004+
 1005+ vMainTable += vRightTable + '</DIV></TD></TR></TBODY></TABLE></BODY></HTML>';
 1006+
 1007+ vDiv.innerHTML = vMainTable;
 1008+
 1009+ }
 1010+
 1011+ } //this.draw
 1012+
 1013+ this.mouseOver = function( pObj, pID, pPos, pType ) {
 1014+ if( pPos == 'right' ) vID = 'child_' + pID;
 1015+ else vID = 'childrow_' + pID;
 1016+
 1017+ pObj.bgColor = "#ffffaa";
 1018+ vRowObj = JSGantt.findObj(vID);
 1019+ if (vRowObj) vRowObj.bgColor = "#ffffaa";
 1020+ }
 1021+
 1022+ this.mouseOut = function( pObj, pID, pPos, pType ) {
 1023+ if( pPos == 'right' ) vID = 'child_' + pID;
 1024+ else vID = 'childrow_' + pID;
 1025+
 1026+ pObj.bgColor = "#ffffff";
 1027+ vRowObj = JSGantt.findObj(vID);
 1028+ if (vRowObj) {
 1029+ if( pType == "group") {
 1030+ pObj.bgColor = "#f3f3f3";
 1031+ vRowObj.bgColor = "#f3f3f3";
 1032+ } else {
 1033+ pObj.bgColor = "#ffffff";
 1034+ vRowObj.bgColor = "#ffffff";
 1035+ }
 1036+ }
 1037+ }
 1038+
 1039+} //GanttChart
 1040+
 1041+// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
 1042+JSGantt.processRows = function(pList, pID, pRow, pLevel, pOpen)
 1043+{
 1044+
 1045+ var vMinDate = new Date();
 1046+ var vMaxDate = new Date();
 1047+ var vMinSet = 0;
 1048+ var vMaxSet = 0;
 1049+ var vList = pList;
 1050+ var vLevel = pLevel;
 1051+ var i = 0;
 1052+ var vNumKid = 0;
 1053+ var vCompSum = 0;
 1054+ var vVisible = pOpen;
 1055+
 1056+ for(i = 0; i < pList.length; i++)
 1057+ {
 1058+ if(pList[i].getParent() == pID) {
 1059+ vVisible = pOpen;
 1060+ pList[i].setVisible(vVisible);
 1061+ if(vVisible==1 && pList[i].getOpen() == 0)
 1062+ vVisible = 0;
 1063+
 1064+ pList[i].setLevel(vLevel);
 1065+ vNumKid++;
 1066+
 1067+ if(pList[i].getGroup() == 1) {
 1068+ JSGantt.processRows(vList, pList[i].getID(), i, vLevel+1, vVisible);
 1069+ }
 1070+
 1071+ if( vMinSet==0 || pList[i].getStart() < vMinDate) {
 1072+ vMinDate = pList[i].getStart();
 1073+ vMinSet = 1;
 1074+ }
 1075+
 1076+ if( vMaxSet==0 || pList[i].getEnd() > vMaxDate) {
 1077+ vMaxDate = pList[i].getEnd();
 1078+ vMaxSet = 1;
 1079+ }
 1080+
 1081+ vCompSum += pList[i].getCompVal();
 1082+
 1083+ }
 1084+ }
 1085+
 1086+ if(pRow >= 0) {
 1087+ pList[pRow].setStart(vMinDate);
 1088+ pList[pRow].setEnd(vMaxDate);
 1089+ pList[pRow].setNumKid(vNumKid);
 1090+ pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid));
 1091+ }
 1092+
 1093+}
 1094+
 1095+
 1096+// Used to determine the minimum date of all tasks and set lower bound based on format
 1097+JSGantt.getMinDate = function getMinDate(pList, pFormat)
 1098+ {
 1099+
 1100+ var vDate = new Date();
 1101+
 1102+ vDate.setFullYear(pList[0].getStart().getFullYear(), pList[0].getStart().getMonth(), pList[0].getStart().getDate());
 1103+
 1104+ // Parse all Task End dates to find min
 1105+ for(i = 0; i < pList.length; i++)
 1106+ {
 1107+ if(Date.parse(pList[i].getStart()) < Date.parse(vDate))
 1108+ vDate.setFullYear(pList[i].getStart().getFullYear(), pList[i].getStart().getMonth(), pList[i].getStart().getDate());
 1109+ }
 1110+
 1111+ if ( pFormat== 'minute')
 1112+ {
 1113+ vDate.setHours(0);
 1114+ vDate.setMinutes(0);
 1115+ }
 1116+ else if (pFormat == 'hour' )
 1117+ {
 1118+ vDate.setHours(0);
 1119+ vDate.setMinutes(0);
 1120+ }
 1121+ // Adjust min date to specific format boundaries (first of week or first of month)
 1122+ else if (pFormat=='day')
 1123+ {
 1124+ vDate.setDate(vDate.getDate() - 1);
 1125+ while(vDate.getDay() % 7 > 0)
 1126+ {
 1127+ vDate.setDate(vDate.getDate() - 1);
 1128+ }
 1129+
 1130+ }
 1131+
 1132+ else if (pFormat=='week')
 1133+ {
 1134+ vDate.setDate(vDate.getDate() - 7);
 1135+ while(vDate.getDay() % 7 > 0)
 1136+ {
 1137+ vDate.setDate(vDate.getDate() - 1);
 1138+ }
 1139+
 1140+ }
 1141+
 1142+ else if (pFormat=='month')
 1143+ {
 1144+ while(vDate.getDate() > 1)
 1145+ {
 1146+ vDate.setDate(vDate.getDate() - 1);
 1147+ }
 1148+ }
 1149+
 1150+ else if (pFormat=='quarter')
 1151+ {
 1152+ if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
 1153+ vDate.setFullYear(vDate.getFullYear(), 0, 1);
 1154+ else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
 1155+ vDate.setFullYear(vDate.getFullYear(), 3, 1);
 1156+ else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
 1157+ vDate.setFullYear(vDate.getFullYear(), 6, 1);
 1158+ else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
 1159+ vDate.setFullYear(vDate.getFullYear(), 9, 1);
 1160+
 1161+ }
 1162+
 1163+ return(vDate);
 1164+
 1165+ }
 1166+
 1167+
 1168+
 1169+
 1170+
 1171+
 1172+
 1173+ // Used to determine the minimum date of all tasks and set lower bound based on format
 1174+
 1175+JSGantt.getMaxDate = function (pList, pFormat)
 1176+{
 1177+ var vDate = new Date();
 1178+
 1179+ vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
 1180+
 1181+
 1182+ // Parse all Task End dates to find max
 1183+ for(i = 0; i < pList.length; i++)
 1184+ {
 1185+ if(Date.parse(pList[i].getEnd()) > Date.parse(vDate))
 1186+ {
 1187+ //vDate.setFullYear(pList[0].getEnd().getFullYear(), pList[0].getEnd().getMonth(), pList[0].getEnd().getDate());
 1188+ vDate.setTime(Date.parse(pList[i].getEnd()));
 1189+ }
 1190+ }
 1191+
 1192+ if (pFormat == 'minute')
 1193+ {
 1194+ vDate.setHours(vDate.getHours() + 1);
 1195+ vDate.setMinutes(59);
 1196+ }
 1197+
 1198+ if (pFormat == 'hour')
 1199+ {
 1200+ vDate.setHours(vDate.getHours() + 2);
 1201+ }
 1202+
 1203+ // Adjust max date to specific format boundaries (end of week or end of month)
 1204+ if (pFormat=='day')
 1205+ {
 1206+ vDate.setDate(vDate.getDate() + 1);
 1207+
 1208+ while(vDate.getDay() % 6 > 0)
 1209+ {
 1210+ vDate.setDate(vDate.getDate() + 1);
 1211+ }
 1212+
 1213+ }
 1214+
 1215+ if (pFormat=='week')
 1216+ {
 1217+ //For weeks, what is the last logical boundary?
 1218+ vDate.setDate(vDate.getDate() + 11);
 1219+
 1220+ while(vDate.getDay() % 6 > 0)
 1221+ {
 1222+ vDate.setDate(vDate.getDate() + 1);
 1223+ }
 1224+
 1225+ }
 1226+
 1227+ // Set to last day of current Month
 1228+ if (pFormat=='month')
 1229+ {
 1230+ while(vDate.getDay() > 1)
 1231+ {
 1232+ vDate.setDate(vDate.getDate() + 1);
 1233+ }
 1234+
 1235+ vDate.setDate(vDate.getDate() - 1);
 1236+ }
 1237+
 1238+ // Set to last day of current Quarter
 1239+ if (pFormat=='quarter')
 1240+ {
 1241+ if( vDate.getMonth()==0 || vDate.getMonth()==1 || vDate.getMonth()==2 )
 1242+ vDate.setFullYear(vDate.getFullYear(), 2, 31);
 1243+ else if( vDate.getMonth()==3 || vDate.getMonth()==4 || vDate.getMonth()==5 )
 1244+ vDate.setFullYear(vDate.getFullYear(), 5, 30);
 1245+ else if( vDate.getMonth()==6 || vDate.getMonth()==7 || vDate.getMonth()==8 )
 1246+ vDate.setFullYear(vDate.getFullYear(), 8, 30);
 1247+ else if( vDate.getMonth()==9 || vDate.getMonth()==10 || vDate.getMonth()==11 )
 1248+ vDate.setFullYear(vDate.getFullYear(), 11, 31);
 1249+
 1250+ }
 1251+
 1252+ return(vDate);
 1253+
 1254+ }
 1255+
 1256+
 1257+
 1258+
 1259+
 1260+
 1261+
 1262+ // This function finds the document id of the specified object
 1263+
 1264+JSGantt.findObj = function (theObj, theDoc)
 1265+
 1266+ {
 1267+
 1268+ var p, i, foundObj;
 1269+
 1270+ if(!theDoc) theDoc = document;
 1271+
 1272+ if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
 1273+
 1274+ theDoc = parent.frames[theObj.substring(p+1)].document;
 1275+
 1276+ theObj = theObj.substring(0,p);
 1277+
 1278+ }
 1279+
 1280+ if(!(foundObj = theDoc[theObj]) && theDoc.all)
 1281+
 1282+ foundObj = theDoc.all[theObj];
 1283+
 1284+
 1285+
 1286+ for (i=0; !foundObj && i < theDoc.forms.length; i++)
 1287+
 1288+ foundObj = theDoc.forms[i][theObj];
 1289+
 1290+
 1291+
 1292+ for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
 1293+
 1294+ foundObj = JSGantt.findObj(theObj,theDoc.layers[i].document);
 1295+
 1296+
 1297+
 1298+ if(!foundObj && document.getElementById)
 1299+
 1300+ foundObj = document.getElementById(theObj);
 1301+
 1302+
 1303+
 1304+ return foundObj;
 1305+
 1306+ }
 1307+
 1308+
 1309+
 1310+
 1311+
 1312+JSGantt.changeFormat = function(pFormat,ganttObj) {
 1313+
 1314+
 1315+
 1316+ if(ganttObj)
 1317+
 1318+ {
 1319+
 1320+ ganttObj.setFormat(pFormat);
 1321+
 1322+ ganttObj.DrawDependencies();
 1323+
 1324+ }
 1325+
 1326+ else
 1327+
 1328+ alert('Chart undefined');
 1329+
 1330+
 1331+
 1332+ }
 1333+
 1334+
 1335+
 1336+
 1337+
 1338+ // Function to open/close and hide/show children of specified task
 1339+
 1340+JSGantt.folder= function (pID,ganttObj) {
 1341+
 1342+ var vList = ganttObj.getList();
 1343+
 1344+ for(i = 0; i < vList.length; i++)
 1345+ {
 1346+ if(vList[i].getID() == pID) {
 1347+
 1348+ if( vList[i].getOpen() == 1 ) {
 1349+ vList[i].setOpen(0);
 1350+ JSGantt.hide(pID,ganttObj);
 1351+
 1352+ if (JSGantt.isIE())
 1353+ JSGantt.findObj('group_'+pID).innerText = '+';
 1354+ else
 1355+ JSGantt.findObj('group_'+pID).textContent = '+';
 1356+
 1357+ } else {
 1358+
 1359+ vList[i].setOpen(1);
 1360+
 1361+ JSGantt.show(pID, 1, ganttObj);
 1362+
 1363+ if (JSGantt.isIE())
 1364+ JSGantt.findObj('group_'+pID).innerText = '�';
 1365+ else
 1366+ JSGantt.findObj('group_'+pID).textContent = '�';
 1367+
 1368+ }
 1369+
 1370+ }
 1371+ }
 1372+}
 1373+
 1374+JSGantt.hide= function (pID,ganttObj) {
 1375+ var vList = ganttObj.getList();
 1376+ var vID = 0;
 1377+
 1378+ for(var i = 0; i < vList.length; i++)
 1379+ {
 1380+ if(vList[i].getParent() == pID) {
 1381+ vID = vList[i].getID();
 1382+ JSGantt.findObj('child_' + vID).style.display = "none";
 1383+ JSGantt.findObj('childgrid_' + vID).style.display = "none";
 1384+ vList[i].setVisible(0);
 1385+ if(vList[i].getGroup() == 1)
 1386+ JSGantt.hide(vID,ganttObj);
 1387+ }
 1388+
 1389+ }
 1390+}
 1391+
 1392+// Function to show children of specified task
 1393+JSGantt.show = function (pID, pTop, ganttObj) {
 1394+ var vList = ganttObj.getList();
 1395+ var vID = 0;
 1396+
 1397+ for(var i = 0; i < vList.length; i++)
 1398+ {
 1399+ if(vList[i].getParent() == pID) {
 1400+ vID = vList[i].getID();
 1401+ if(pTop == 1) {
 1402+ if (JSGantt.isIE()) { // IE;
 1403+
 1404+ if( JSGantt.findObj('group_'+pID).innerText == '+') {
 1405+ JSGantt.findObj('child_'+vID).style.display = "";
 1406+ JSGantt.findObj('childgrid_'+vID).style.display = "";
 1407+ vList[i].setVisible(1);
 1408+ }
 1409+
 1410+ } else {
 1411+
 1412+ if( JSGantt.findObj('group_'+pID).textContent == '+') {
 1413+ JSGantt.findObj('child_'+vID).style.display = "";
 1414+ JSGantt.findObj('childgrid_'+vID).style.display = "";
 1415+ vList[i].setVisible(1);
 1416+ }
 1417+
 1418+ }
 1419+
 1420+ } else {
 1421+
 1422+ if (JSGantt.isIE()) { // IE;
 1423+ if( JSGantt.findObj('group_'+pID).innerText == '�') {
 1424+ JSGantt.findObj('child_'+vID).style.display = "";
 1425+ JSGantt.findObj('childgrid_'+vID).style.display = "";
 1426+ vList[i].setVisible(1);
 1427+ }
 1428+
 1429+ } else {
 1430+
 1431+ if( JSGantt.findObj('group_'+pID).textContent == '�') {
 1432+ JSGantt.findObj('child_'+vID).style.display = "";
 1433+ JSGantt.findObj('childgrid_'+vID).style.display = "";
 1434+ vList[i].setVisible(1);
 1435+ }
 1436+ }
 1437+ }
 1438+
 1439+ if(vList[i].getGroup() == 1)
 1440+ JSGantt.show(vID, 0,ganttObj);
 1441+
 1442+ }
 1443+ }
 1444+}
 1445+
 1446+
 1447+
 1448+
 1449+
 1450+ // function to open window to display task link
 1451+
 1452+JSGantt.taskLink = function(pRef,pWidth,pHeight)
 1453+
 1454+ {
 1455+
 1456+ if(pWidth) vWidth =pWidth; else vWidth =400;
 1457+ if(pHeight) vHeight=pHeight; else vHeight=400;
 1458+
 1459+ var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
 1460+
 1461+ }
 1462+
 1463+JSGantt.parseDateStr = function(pDateStr,pFormatStr) {
 1464+ var vDate =new Date();
 1465+ vDate.setTime( Date.parse(pDateStr));
 1466+
 1467+ switch(pFormatStr)
 1468+ {
 1469+ case 'mm/dd/yyyy':
 1470+ var vDateParts = pDateStr.split('/');
 1471+ vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[0], 10) - 1, parseInt(vDateParts[1], 10));
 1472+ break;
 1473+ case 'dd/mm/yyyy':
 1474+ var vDateParts = pDateStr.split('/');
 1475+ vDate.setFullYear(parseInt(vDateParts[2], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[0], 10));
 1476+ break;
 1477+ case 'yyyy-mm-dd':
 1478+ var vDateParts = pDateStr.split('-');
 1479+ vDate.setFullYear(parseInt(vDateParts[0], 10), parseInt(vDateParts[1], 10) - 1, parseInt(vDateParts[1], 10));
 1480+ break;
 1481+ }
 1482+
 1483+ return(vDate);
 1484+
 1485+}
 1486+
 1487+JSGantt.formatDateStr = function(pDate,pFormatStr) {
 1488+ vYear4Str = pDate.getFullYear() + '';
 1489+ vYear2Str = vYear4Str.substring(2,4);
 1490+ vMonthStr = (pDate.getMonth()+1) + '';
 1491+ vDayStr = pDate.getDate() + '';
 1492+
 1493+ var vDateStr = "";
 1494+
 1495+ switch(pFormatStr) {
 1496+ case 'mm/dd/yyyy':
 1497+ return( vMonthStr + '/' + vDayStr + '/' + vYear4Str );
 1498+ case 'dd/mm/yyyy':
 1499+ return( vDayStr + '/' + vMonthStr + '/' + vYear4Str );
 1500+ case 'yyyy-mm-dd':
 1501+ return( vYear4Str + '-' + vMonthStr + '-' + vDayStr );
 1502+ case 'mm/dd/yy':
 1503+ return( vMonthStr + '/' + vDayStr + '/' + vYear2Str );
 1504+ case 'dd/mm/yy':
 1505+ return( vDayStr + '/' + vMonthStr + '/' + vYear2Str );
 1506+ case 'yy-mm-dd':
 1507+ return( vYear2Str + '-' + vMonthStr + '-' + vDayStr );
 1508+ case 'mm/dd':
 1509+ return( vMonthStr + '/' + vDayStr );
 1510+ case 'dd/mm':
 1511+ return( vDayStr + '/' + vMonthStr );
 1512+ }
 1513+
 1514+}
 1515+
 1516+JSGantt.parseXML = function(ThisFile,pGanttVar){
 1517+ var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; // Is this Chrome
 1518+
 1519+ try { //Internet Explorer
 1520+ xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
 1521+ }
 1522+ catch(e) {
 1523+ try { //Firefox, Mozilla, Opera, Chrome etc.
 1524+ if (is_chrome==false) { xmlDoc=document.implementation.createDocument("","",null); }
 1525+ }
 1526+ catch(e) {
 1527+ alert(e.message);
 1528+ return;
 1529+ }
 1530+ }
 1531+
 1532+ if (is_chrome==false) { // can't use xmlDoc.load in chrome at the moment
 1533+ xmlDoc.async=false;
 1534+ xmlDoc.load(ThisFile); // we can use loadxml
 1535+ JSGantt.AddXMLTask(pGanttVar)
 1536+ xmlDoc=null; // a little tidying
 1537+ Task = null;
 1538+ }
 1539+ else {
 1540+ JSGantt.ChromeLoadXML(ThisFile,pGanttVar);
 1541+ ta=null; // a little tidying
 1542+ }
 1543+}
 1544+
 1545+JSGantt.AddXMLTask = function(pGanttVar){
 1546+
 1547+ Task=xmlDoc.getElementsByTagName("task");
 1548+
 1549+ var n = xmlDoc.documentElement.childNodes.length; // the number of tasks. IE gets this right, but mozilla add extra ones (Whitespace)
 1550+
 1551+ for(var i=0;i<n;i++) {
 1552+
 1553+ // optional parameters may not have an entry (Whitespace from mozilla also returns an error )
 1554+ // Task ID must NOT be zero other wise it will be skipped
 1555+ try { pID = Task[i].getElementsByTagName("pID")[0].childNodes[0].nodeValue;
 1556+ } catch (error) {pID =0;}
 1557+ pID *= 1; // make sure that these are numbers rather than strings in order to make jsgantt.js behave as expected.
 1558+
 1559+ if(pID!=0){
 1560+ try { pName = Task[i].getElementsByTagName("pName")[0].childNodes[0].nodeValue;
 1561+ } catch (error) {pName ="No Task Name";} // If there is no corresponding entry in the XML file the set a default.
 1562+
 1563+ try { pColor = Task[i].getElementsByTagName("pColor")[0].childNodes[0].nodeValue;
 1564+ } catch (error) {pColor ="0000ff";}
 1565+
 1566+ try { pParent = Task[i].getElementsByTagName("pParent")[0].childNodes[0].nodeValue;
 1567+ } catch (error) {pParent =0;}
 1568+ pParent *= 1;
 1569+
 1570+ try { pStart = Task[i].getElementsByTagName("pStart")[0].childNodes[0].nodeValue;
 1571+ } catch (error) {pStart ="";}
 1572+
 1573+ try { pEnd = Task[i].getElementsByTagName("pEnd")[0].childNodes[0].nodeValue;
 1574+ } catch (error) { pEnd ="";}
 1575+
 1576+ try { pLink = Task[i].getElementsByTagName("pLink")[0].childNodes[0].nodeValue;
 1577+ } catch (error) { pLink ="";}
 1578+
 1579+ try { pMile = Task[i].getElementsByTagName("pMile")[0].childNodes[0].nodeValue;
 1580+ } catch (error) { pMile=0;}
 1581+ pMile *= 1;
 1582+
 1583+ try { pRes = Task[i].getElementsByTagName("pRes")[0].childNodes[0].nodeValue;
 1584+ } catch (error) { pRes ="";}
 1585+
 1586+ try { pComp = Task[i].getElementsByTagName("pComp")[0].childNodes[0].nodeValue;
 1587+ } catch (error) {pComp =0;}
 1588+ pComp *= 1;
 1589+
 1590+ try { pGroup = Task[i].getElementsByTagName("pGroup")[0].childNodes[0].nodeValue;
 1591+ } catch (error) {pGroup =0;}
 1592+ pGroup *= 1;
 1593+
 1594+ try { pOpen = Task[i].getElementsByTagName("pOpen")[0].childNodes[0].nodeValue;
 1595+ } catch (error) { pOpen =1;}
 1596+ pOpen *= 1;
 1597+
 1598+ try { pDepend = Task[i].getElementsByTagName("pDepend")[0].childNodes[0].nodeValue;
 1599+ } catch (error) { pDepend =0;}
 1600+ //pDepend *= 1;
 1601+ if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
 1602+
 1603+ try { pCaption = Task[i].getElementsByTagName("pCaption")[0].childNodes[0].nodeValue;
 1604+ } catch (error) { pCaption ="";}
 1605+
 1606+
 1607+ // Finally add the task
 1608+ pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption));
 1609+ }
 1610+ }
 1611+}
 1612+
 1613+JSGantt.ChromeLoadXML = function(ThisFile,pGanttVar){
 1614+// Thanks to vodobas at mindlence,com for the initial pointers here.
 1615+ XMLLoader = new XMLHttpRequest();
 1616+ XMLLoader.onreadystatechange= function(){
 1617+ JSGantt.ChromeXMLParse(pGanttVar);
 1618+ };
 1619+ XMLLoader.open("GET", ThisFile, false);
 1620+ XMLLoader.send(null);
 1621+}
 1622+
 1623+JSGantt.ChromeXMLParse = function (pGanttVar){
 1624+// Manually parse the file as it is loads quicker
 1625+ if (XMLLoader.readyState == 4) {
 1626+ var ta=XMLLoader.responseText.split(/<task>/gi);
 1627+
 1628+ var n = ta.length; // the number of tasks.
 1629+ for(var i=1;i<n;i++) {
 1630+ Task = ta[i].replace(/<[/]p/g, '<p');
 1631+ var te = Task.split(/<pid>/i)
 1632+
 1633+ if(te.length> 2){var pID=te[1];} else {var pID = 0;}
 1634+ pID *= 1;
 1635+
 1636+ var te = Task.split(/<pName>/i)
 1637+ if(te.length> 2){var pName=te[1];} else {var pName = "No Task Name";}
 1638+
 1639+ var te = Task.split(/<pstart>/i)
 1640+ if(te.length> 2){var pStart=te[1];} else {var pStart = "";}
 1641+
 1642+ var te = Task.split(/<pEnd>/i)
 1643+ if(te.length> 2){var pEnd=te[1];} else {var pEnd = "";}
 1644+
 1645+ var te = Task.split(/<pColor>/i)
 1646+ if(te.length> 2){var pColor=te[1];} else {var pColor = '0000ff';}
 1647+
 1648+ var te = Task.split(/<pLink>/i)
 1649+ if(te.length> 2){var pLink=te[1];} else {var pLink = "";}
 1650+
 1651+ var te = Task.split(/<pMile>/i)
 1652+ if(te.length> 2){var pMile=te[1];} else {var pMile = 0;}
 1653+ pMile *= 1;
 1654+
 1655+ var te = Task.split(/<pRes>/i)
 1656+ if(te.length> 2){var pRes=te[1];} else {var pRes = "";}
 1657+
 1658+ var te = Task.split(/<pComp>/i)
 1659+ if(te.length> 2){var pComp=te[1];} else {var pComp = 0;}
 1660+ pComp *= 1;
 1661+
 1662+ var te = Task.split(/<pGroup>/i)
 1663+ if(te.length> 2){var pGroup=te[1];} else {var pGroup = 0;}
 1664+ pGroup *= 1;
 1665+
 1666+ var te = Task.split(/<pParent>/i)
 1667+ if(te.length> 2){var pParent=te[1];} else {var pParent = 0;}
 1668+ pParent *= 1;
 1669+
 1670+ var te = Task.split(/<pOpen>/i)
 1671+ if(te.length> 2){var pOpen=te[1];} else {var pOpen = 1;}
 1672+ pOpen *= 1;
 1673+
 1674+ var te = Task.split(/<pDepend>/i)
 1675+ if(te.length> 2){var pDepend=te[1];} else {var pDepend = "";}
 1676+ //pDepend *= 1;
 1677+ if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
 1678+
 1679+ var te = Task.split(/<pCaption>/i)
 1680+ if(te.length> 2){var pCaption=te[1];} else {var pCaption = "";}
 1681+
 1682+ // Finally add the task
 1683+ pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend,pCaption ));
 1684+ }
 1685+ }
 1686+}
 1687+
 1688+JSGantt.benchMark = function(pItem){
 1689+ var vEndTime=new Date().getTime();
 1690+ alert(pItem + ': Elapsed time: '+((vEndTime-vBenchTime)/1000)+' seconds.');
 1691+ vBenchTime=new Date().getTime();
 1692+}
 1693+
 1694+
Property changes on: trunk/extensions/SemanticProjectManagement/libs/ganttchart/jsgantt.js
___________________________________________________________________
Added: svn:eol-style
16951695 + native
Index: trunk/extensions/SemanticProjectManagement/libs/ganttchart/copyright.txt
@@ -1,24 +1,24 @@
2 -* Copyright (c) 2008, Shlomy Gantz/BlueBrick Inc.
3 -* All rights reserved.
4 -*
5 -* Redistribution and use in source and binary forms, with or without
6 -* modification, are permitted provided that the following conditions are met:
7 -* * Redistributions of source code must retain the above copyright
8 -* notice, this list of conditions and the following disclaimer.
9 -* * Redistributions in binary form must reproduce the above copyright
10 -* notice, this list of conditions and the following disclaimer in the
11 -* documentation and/or other materials provided with the distribution.
12 -* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the
13 -* names of its contributors may be used to endorse or promote products
14 -* derived from this software without specific prior written permission.
15 -*
16 -* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY
17 -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 -* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY
20 -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 2+* Copyright (c) 2008, Shlomy Gantz/BlueBrick Inc.
 3+* All rights reserved.
 4+*
 5+* Redistribution and use in source and binary forms, with or without
 6+* modification, are permitted provided that the following conditions are met:
 7+* * Redistributions of source code must retain the above copyright
 8+* notice, this list of conditions and the following disclaimer.
 9+* * Redistributions in binary form must reproduce the above copyright
 10+* notice, this list of conditions and the following disclaimer in the
 11+* documentation and/or other materials provided with the distribution.
 12+* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the
 13+* names of its contributors may be used to endorse or promote products
 14+* derived from this software without specific prior written permission.
 15+*
 16+* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY
 17+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 18+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 19+* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY
 20+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 21+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 22+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 23+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 24+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 25+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Property changes on: trunk/extensions/SemanticProjectManagement/libs/ganttchart/copyright.txt
___________________________________________________________________
Added: svn:eol-style
2626 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar.css
@@ -1,95 +1,95 @@
2 -/* calendar icon */
3 -img.tcalIcon {
4 - cursor: pointer;
5 - margin-left: 1px;
6 - vertical-align: middle;
7 -}
8 -/* calendar container element */
9 -div#tcal {
10 - position: absolute;
11 - visibility: hidden;
12 - z-index: 100;
13 - width: 158px;
14 - padding: 2px 0 0 0;
15 -}
16 -/* all tables in calendar */
17 -div#tcal table {
18 - width: 100%;
19 - border: 1px solid silver;
20 - border-collapse: collapse;
21 - background-color: white;
22 -}
23 -/* navigation table */
24 -div#tcal table.ctrl {
25 - border-bottom: 0;
26 -}
27 -/* navigation buttons */
28 -div#tcal table.ctrl td {
29 - width: 15px;
30 - height: 20px;
31 -}
32 -/* month year header */
33 -div#tcal table.ctrl th {
34 - background-color: white;
35 - color: black;
36 - border: 0;
37 -}
38 -/* week days header */
39 -div#tcal th {
40 - border: 1px solid silver;
41 - border-collapse: collapse;
42 - text-align: center;
43 - padding: 3px 0;
44 - font-family: tahoma, verdana, arial;
45 - font-size: 10px;
46 - background-color: gray;
47 - color: white;
48 -}
49 -/* date cells */
50 -div#tcal td {
51 - border: 0;
52 - border-collapse: collapse;
53 - text-align: center;
54 - padding: 2px 0;
55 - font-family: tahoma, verdana, arial;
56 - font-size: 11px;
57 - width: 22px;
58 - cursor: pointer;
59 -}
60 -/* date highlight
61 - in case of conflicting settings order here determines the priority from least to most important */
62 -div#tcal td.othermonth {
63 - color: silver;
64 -}
65 -div#tcal td.weekend {
66 - background-color: #ACD6F5;
67 -}
68 -div#tcal td.today {
69 - border: 1px solid red;
70 -}
71 -div#tcal td.selected {
72 - background-color: #FFB3BE;
73 -}
74 -/* iframe element used to suppress windowed controls in IE5/6 */
75 -iframe#tcalIF {
76 - position: absolute;
77 - visibility: hidden;
78 - z-index: 98;
79 - border: 0;
80 -}
81 -/* transparent shadow */
82 -div#tcalShade {
83 - position: absolute;
84 - visibility: hidden;
85 - z-index: 99;
86 -}
87 -div#tcalShade table {
88 - border: 0;
89 - border-collapse: collapse;
90 - width: 100%;
91 -}
92 -div#tcalShade table td {
93 - border: 0;
94 - border-collapse: collapse;
95 - padding: 0;
96 -}
 2+/* calendar icon */
 3+img.tcalIcon {
 4+ cursor: pointer;
 5+ margin-left: 1px;
 6+ vertical-align: middle;
 7+}
 8+/* calendar container element */
 9+div#tcal {
 10+ position: absolute;
 11+ visibility: hidden;
 12+ z-index: 100;
 13+ width: 158px;
 14+ padding: 2px 0 0 0;
 15+}
 16+/* all tables in calendar */
 17+div#tcal table {
 18+ width: 100%;
 19+ border: 1px solid silver;
 20+ border-collapse: collapse;
 21+ background-color: white;
 22+}
 23+/* navigation table */
 24+div#tcal table.ctrl {
 25+ border-bottom: 0;
 26+}
 27+/* navigation buttons */
 28+div#tcal table.ctrl td {
 29+ width: 15px;
 30+ height: 20px;
 31+}
 32+/* month year header */
 33+div#tcal table.ctrl th {
 34+ background-color: white;
 35+ color: black;
 36+ border: 0;
 37+}
 38+/* week days header */
 39+div#tcal th {
 40+ border: 1px solid silver;
 41+ border-collapse: collapse;
 42+ text-align: center;
 43+ padding: 3px 0;
 44+ font-family: tahoma, verdana, arial;
 45+ font-size: 10px;
 46+ background-color: gray;
 47+ color: white;
 48+}
 49+/* date cells */
 50+div#tcal td {
 51+ border: 0;
 52+ border-collapse: collapse;
 53+ text-align: center;
 54+ padding: 2px 0;
 55+ font-family: tahoma, verdana, arial;
 56+ font-size: 11px;
 57+ width: 22px;
 58+ cursor: pointer;
 59+}
 60+/* date highlight
 61+ in case of conflicting settings order here determines the priority from least to most important */
 62+div#tcal td.othermonth {
 63+ color: silver;
 64+}
 65+div#tcal td.weekend {
 66+ background-color: #ACD6F5;
 67+}
 68+div#tcal td.today {
 69+ border: 1px solid red;
 70+}
 71+div#tcal td.selected {
 72+ background-color: #FFB3BE;
 73+}
 74+/* iframe element used to suppress windowed controls in IE5/6 */
 75+iframe#tcalIF {
 76+ position: absolute;
 77+ visibility: hidden;
 78+ z-index: 98;
 79+ border: 0;
 80+}
 81+/* transparent shadow */
 82+div#tcalShade {
 83+ position: absolute;
 84+ visibility: hidden;
 85+ z-index: 99;
 86+}
 87+div#tcalShade table {
 88+ border: 0;
 89+ border-collapse: collapse;
 90+ width: 100%;
 91+}
 92+div#tcalShade table td {
 93+ border: 0;
 94+ border-collapse: collapse;
 95+ padding: 0;
 96+}
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar.css
___________________________________________________________________
Added: svn:eol-style
9797 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/license.txt
@@ -1,16 +1,16 @@
2 -Tigra Calendar v4.0 LICENSE:
3 -
4 -Permission is hereby granted, free of charge, to any person obtaining a copy
5 -of this software and associated documentation files (the "Software"), to deal
6 -in the Software without restriction, including without limitation the rights
7 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 -copies of the Software, and to permit persons to whom the Software is
9 -furnished to do so
10 -
11 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 2+Tigra Calendar v4.0 LICENSE:
 3+
 4+Permission is hereby granted, free of charge, to any person obtaining a copy
 5+of this software and associated documentation files (the "Software"), to deal
 6+in the Software without restriction, including without limitation the rights
 7+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 8+copies of the Software, and to permit persons to whom the Software is
 9+furnished to do so
 10+
 11+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 12+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 13+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 14+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 15+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 16+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1717 THE SOFTWARE.
\ No newline at end of file
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/license.txt
___________________________________________________________________
Added: svn:eol-style
1818 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_db.js
@@ -1,335 +1,335 @@
2 -// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd)
3 -// http://www.softcomplex.com/products/tigra_calendar/
4 -// Public Domain Software... You're welcome.
5 -
6 -// default settins
7 -var A_TCALDEF = {
8 - 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
9 - 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10 - 'yearscroll': true, // show year scroller
11 - 'weekstart': 0, // first day of week: 0-Su or 1-Mo
12 - 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
13 - 'imgpath' : 'img/' // directory with calendar images
14 -}
15 -// date parsing function
16 -function f_tcalParseDate (s_date) {
17 -
18 - var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/;
19 - if (!re_date.exec(s_date))
20 - return alert ("Invalid date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.")
21 - var n_day = Number(RegExp.$3),
22 - n_month = Number(RegExp.$2),
23 - n_year = Number(RegExp.$1);
24 -
25 - if (n_year < 100)
26 - n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
27 - if (n_month < 1 || n_month > 12)
28 - return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
29 - var d_numdays = new Date(n_year, n_month, 0);
30 - if (n_day > d_numdays.getDate())
31 - return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
32 -
33 - return new Date (n_year, n_month - 1, n_day);
34 -}
35 -// date generating function
36 -function f_tcalGenerDate (d_date) {
37 - return (
38 - d_date.getFullYear() + "-"
39 - + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
40 - + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate()
41 - );
42 -}
43 -
44 -// implementation
45 -function tcal (a_cfg, a_tpl) {
46 -
47 - // apply default template if not specified
48 - if (!a_tpl)
49 - a_tpl = A_TCALDEF;
50 -
51 - // register in global collections
52 - if (!window.A_TCALS)
53 - window.A_TCALS = [];
54 - if (!window.A_TCALSIDX)
55 - window.A_TCALSIDX = [];
56 -
57 - this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
58 - window.A_TCALS[this.s_id] = this;
59 - window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
60 -
61 - // assign methods
62 - this.f_show = f_tcalShow;
63 - this.f_hide = f_tcalHide;
64 - this.f_toggle = f_tcalToggle;
65 - this.f_update = f_tcalUpdate;
66 - this.f_relDate = f_tcalRelDate;
67 - this.f_parseDate = f_tcalParseDate;
68 - this.f_generDate = f_tcalGenerDate;
69 -
70 - // create calendar icon
71 - this.s_iconId = 'tcalico_' + this.s_id;
72 - this.e_icon = f_getElement(this.s_iconId);
73 - if (!this.e_icon) {
74 - document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
75 - this.e_icon = f_getElement(this.s_iconId);
76 - }
77 - // save received parameters
78 - this.a_cfg = a_cfg;
79 - this.a_tpl = a_tpl;
80 -}
81 -
82 -function f_tcalShow (d_date) {
83 -
84 - // find input field
85 - if (!this.a_cfg.controlname)
86 - throw("TC: control name is not specified");
87 - if (this.a_cfg.formname) {
88 - var e_form = document.forms[this.a_cfg.formname];
89 - if (!e_form)
90 - throw("TC: form '" + this.a_cfg.formname + "' can not be found");
91 - this.e_input = e_form.elements[this.a_cfg.controlname];
92 - }
93 - else
94 - this.e_input = f_getElement(this.a_cfg.controlname);
95 -
96 - if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
97 - throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
98 - + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
99 -
100 - // dynamically create HTML elements if needed
101 - this.e_div = f_getElement('tcal');
102 - if (!this.e_div) {
103 - this.e_div = document.createElement("DIV");
104 - this.e_div.id = 'tcal';
105 - document.body.appendChild(this.e_div);
106 - }
107 - this.e_shade = f_getElement('tcalShade');
108 - if (!this.e_shade) {
109 - this.e_shade = document.createElement("DIV");
110 - this.e_shade.id = 'tcalShade';
111 - document.body.appendChild(this.e_shade);
112 - }
113 - this.e_iframe = f_getElement('tcalIF')
114 - if (b_ieFix && !this.e_iframe) {
115 - this.e_iframe = document.createElement("IFRAME");
116 - this.e_iframe.style.filter = 'alpha(opacity=0)';
117 - this.e_iframe.id = 'tcalIF';
118 - this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
119 - document.body.appendChild(this.e_iframe);
120 - }
121 -
122 - // hide all calendars
123 - f_tcalHideAll();
124 -
125 - // generate HTML and show calendar
126 - this.e_icon = f_getElement(this.s_iconId);
127 - if (!this.f_update())
128 - return;
129 -
130 - this.e_div.style.visibility = 'visible';
131 - this.e_shade.style.visibility = 'visible';
132 - if (this.e_iframe)
133 - this.e_iframe.style.visibility = 'visible';
134 -
135 - // change icon and status
136 - this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
137 - this.e_icon.title = 'Close Calendar';
138 - this.b_visible = true;
139 -}
140 -
141 -function f_tcalHide (n_date) {
142 - if (n_date)
143 - this.e_input.value = this.f_generDate(new Date(n_date));
144 -
145 - // no action if not visible
146 - if (!this.b_visible)
147 - return;
148 -
149 - // hide elements
150 - if (this.e_iframe)
151 - this.e_iframe.style.visibility = 'hidden';
152 - if (this.e_shade)
153 - this.e_shade.style.visibility = 'hidden';
154 - this.e_div.style.visibility = 'hidden';
155 -
156 - // change icon and status
157 - this.e_icon = f_getElement(this.s_iconId);
158 - this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
159 - this.e_icon.title = 'Open Calendar';
160 - this.b_visible = false;
161 -}
162 -
163 -function f_tcalToggle () {
164 - return this.b_visible ? this.f_hide() : this.f_show();
165 -}
166 -
167 -function f_tcalUpdate (d_date) {
168 -
169 - var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
170 - var d_selected = this.e_input.value == ''
171 - ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
172 - : this.f_parseDate(this.e_input.value);
173 -
174 - // figure out date to display
175 - if (!d_date)
176 - // selected by default
177 - d_date = d_selected;
178 - else if (typeof(d_date) == 'number')
179 - // get from number
180 - d_date = f_tcalResetTime(new Date(d_date));
181 - else if (typeof(d_date) == 'string')
182 - // parse from string
183 - this.f_parseDate(d_date);
184 -
185 - if (!d_date) return false;
186 -
187 - // first date to display
188 - var d_firstday = new Date(d_date);
189 - d_firstday.setDate(1);
190 - d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
191 -
192 - var a_class, s_html = '<table class="ctrl"><tbody><tr>'
193 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
194 - + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
195 - + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
196 - + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
197 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
198 - + '</tr></tbody></table><table><tbody><tr class="wd">';
199 -
200 - // print weekdays titles
201 - for (var i = 0; i < 7; i++)
202 - s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
203 - s_html += '</tr>' ;
204 -
205 - // print calendar table
206 - var n_date, n_month, d_current = new Date(d_firstday);
207 - while (d_current.getMonth() == d_date.getMonth() ||
208 - d_current.getMonth() == d_firstday.getMonth()) {
209 -
210 - // print row heder
211 - s_html +='<tr>';
212 - for (var n_wday = 0; n_wday < 7; n_wday++) {
213 -
214 - a_class = [];
215 - n_date = d_current.getDate();
216 - n_month = d_current.getMonth();
217 -
218 - // other month
219 - if (d_current.getMonth() != d_date.getMonth())
220 - a_class[a_class.length] = 'othermonth';
221 - // weekend
222 - if (d_current.getDay() == 0 || d_current.getDay() == 6)
223 - a_class[a_class.length] = 'weekend';
224 - // today
225 - if (d_current.valueOf() == d_today.valueOf())
226 - a_class[a_class.length] = 'today';
227 - // selected
228 - if (d_current.valueOf() == d_selected.valueOf())
229 - a_class[a_class.length] = 'selected';
230 -
231 - s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
232 -
233 - d_current.setDate(++n_date);
234 - while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
235 - d_current.setHours(d_current.getHours + 1);
236 - d_current = f_tcalResetTime(d_current);
237 - }
238 - }
239 - // print row footer
240 - s_html +='</tr>';
241 - }
242 - s_html +='</tbody></table>';
243 -
244 - // update HTML, positions and sizes
245 - this.e_div.innerHTML = s_html;
246 -
247 - var n_width = this.e_div.offsetWidth;
248 - var n_height = this.e_div.offsetHeight;
249 - var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
250 - var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
251 - if (n_left < 0) n_left = 0;
252 -
253 - this.e_div.style.left = n_left + 'px';
254 - this.e_div.style.top = n_top + 'px';
255 -
256 - this.e_shade.style.width = (n_width + 8) + 'px';
257 - this.e_shade.style.left = (n_left - 1) + 'px';
258 - this.e_shade.style.top = (n_top - 1) + 'px';
259 - this.e_shade.innerHTML = b_ieFix
260 - ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
261 - : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
262 -
263 - if (this.e_iframe) {
264 - this.e_iframe.style.left = n_left + 'px';
265 - this.e_iframe.style.top = n_top + 'px';
266 - this.e_iframe.style.width = (n_width + 6) + 'px';
267 - this.e_iframe.style.height = (n_height + 6) +'px';
268 - }
269 - return true;
270 -}
271 -
272 -function f_getPosition (e_elemRef, s_coord) {
273 - var n_pos = 0, n_offset,
274 - e_elem = e_elemRef;
275 -
276 - while (e_elem) {
277 - n_offset = e_elem["offset" + s_coord];
278 - n_pos += n_offset;
279 - e_elem = e_elem.offsetParent;
280 - }
281 - // margin correction in some browsers
282 - if (b_ieMac)
283 - n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
284 - else if (b_safari)
285 - n_pos -= n_offset;
286 -
287 - e_elem = e_elemRef;
288 - while (e_elem != document.body) {
289 - n_offset = e_elem["scroll" + s_coord];
290 - if (n_offset && e_elem.style.overflow == 'scroll')
291 - n_pos -= n_offset;
292 - e_elem = e_elem.parentNode;
293 - }
294 - return n_pos;
295 -}
296 -
297 -function f_tcalRelDate (d_date, d_diff, s_units) {
298 - var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
299 - var d_result = new Date(d_date);
300 - d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
301 - if (d_result.getDate() != d_date.getDate())
302 - d_result.setDate(0);
303 - return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
304 -}
305 -
306 -function f_tcalHideAll () {
307 - for (var i = 0; i < window.A_TCALSIDX.length; i++)
308 - window.A_TCALSIDX[i].f_hide();
309 -}
310 -
311 -function f_tcalResetTime (d_date) {
312 - d_date.setHours(0);
313 - d_date.setMinutes(0);
314 - d_date.setSeconds(0);
315 - d_date.setMilliseconds(0);
316 - return d_date;
317 -}
318 -
319 -f_getElement = document.all ?
320 - function (s_id) { return document.all[s_id] } :
321 - function (s_id) { return document.getElementById(s_id) };
322 -
323 -if (document.addEventListener)
324 - window.addEventListener('scroll', f_tcalHideAll, false);
325 -if (window.attachEvent)
326 - window.attachEvent('onscroll', f_tcalHideAll);
327 -
328 -// global variables
329 -var s_userAgent = navigator.userAgent.toLowerCase(),
330 - re_webkit = /WebKit\/(\d+)/i;
331 -var b_mac = s_userAgent.indexOf('mac') != -1,
332 - b_ie5 = s_userAgent.indexOf('msie 5') != -1,
333 - b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
334 -var b_ieFix = b_ie5 || b_ie6,
335 - b_ieMac = b_mac && b_ie5,
336 - b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
 2+// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd)
 3+// http://www.softcomplex.com/products/tigra_calendar/
 4+// Public Domain Software... You're welcome.
 5+
 6+// default settins
 7+var A_TCALDEF = {
 8+ 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
 9+ 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
 10+ 'yearscroll': true, // show year scroller
 11+ 'weekstart': 0, // first day of week: 0-Su or 1-Mo
 12+ 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
 13+ 'imgpath' : 'img/' // directory with calendar images
 14+}
 15+// date parsing function
 16+function f_tcalParseDate (s_date) {
 17+
 18+ var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/;
 19+ if (!re_date.exec(s_date))
 20+ return alert ("Invalid date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.")
 21+ var n_day = Number(RegExp.$3),
 22+ n_month = Number(RegExp.$2),
 23+ n_year = Number(RegExp.$1);
 24+
 25+ if (n_year < 100)
 26+ n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
 27+ if (n_month < 1 || n_month > 12)
 28+ return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
 29+ var d_numdays = new Date(n_year, n_month, 0);
 30+ if (n_day > d_numdays.getDate())
 31+ return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
 32+
 33+ return new Date (n_year, n_month - 1, n_day);
 34+}
 35+// date generating function
 36+function f_tcalGenerDate (d_date) {
 37+ return (
 38+ d_date.getFullYear() + "-"
 39+ + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
 40+ + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate()
 41+ );
 42+}
 43+
 44+// implementation
 45+function tcal (a_cfg, a_tpl) {
 46+
 47+ // apply default template if not specified
 48+ if (!a_tpl)
 49+ a_tpl = A_TCALDEF;
 50+
 51+ // register in global collections
 52+ if (!window.A_TCALS)
 53+ window.A_TCALS = [];
 54+ if (!window.A_TCALSIDX)
 55+ window.A_TCALSIDX = [];
 56+
 57+ this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
 58+ window.A_TCALS[this.s_id] = this;
 59+ window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
 60+
 61+ // assign methods
 62+ this.f_show = f_tcalShow;
 63+ this.f_hide = f_tcalHide;
 64+ this.f_toggle = f_tcalToggle;
 65+ this.f_update = f_tcalUpdate;
 66+ this.f_relDate = f_tcalRelDate;
 67+ this.f_parseDate = f_tcalParseDate;
 68+ this.f_generDate = f_tcalGenerDate;
 69+
 70+ // create calendar icon
 71+ this.s_iconId = 'tcalico_' + this.s_id;
 72+ this.e_icon = f_getElement(this.s_iconId);
 73+ if (!this.e_icon) {
 74+ document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
 75+ this.e_icon = f_getElement(this.s_iconId);
 76+ }
 77+ // save received parameters
 78+ this.a_cfg = a_cfg;
 79+ this.a_tpl = a_tpl;
 80+}
 81+
 82+function f_tcalShow (d_date) {
 83+
 84+ // find input field
 85+ if (!this.a_cfg.controlname)
 86+ throw("TC: control name is not specified");
 87+ if (this.a_cfg.formname) {
 88+ var e_form = document.forms[this.a_cfg.formname];
 89+ if (!e_form)
 90+ throw("TC: form '" + this.a_cfg.formname + "' can not be found");
 91+ this.e_input = e_form.elements[this.a_cfg.controlname];
 92+ }
 93+ else
 94+ this.e_input = f_getElement(this.a_cfg.controlname);
 95+
 96+ if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
 97+ throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
 98+ + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
 99+
 100+ // dynamically create HTML elements if needed
 101+ this.e_div = f_getElement('tcal');
 102+ if (!this.e_div) {
 103+ this.e_div = document.createElement("DIV");
 104+ this.e_div.id = 'tcal';
 105+ document.body.appendChild(this.e_div);
 106+ }
 107+ this.e_shade = f_getElement('tcalShade');
 108+ if (!this.e_shade) {
 109+ this.e_shade = document.createElement("DIV");
 110+ this.e_shade.id = 'tcalShade';
 111+ document.body.appendChild(this.e_shade);
 112+ }
 113+ this.e_iframe = f_getElement('tcalIF')
 114+ if (b_ieFix && !this.e_iframe) {
 115+ this.e_iframe = document.createElement("IFRAME");
 116+ this.e_iframe.style.filter = 'alpha(opacity=0)';
 117+ this.e_iframe.id = 'tcalIF';
 118+ this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
 119+ document.body.appendChild(this.e_iframe);
 120+ }
 121+
 122+ // hide all calendars
 123+ f_tcalHideAll();
 124+
 125+ // generate HTML and show calendar
 126+ this.e_icon = f_getElement(this.s_iconId);
 127+ if (!this.f_update())
 128+ return;
 129+
 130+ this.e_div.style.visibility = 'visible';
 131+ this.e_shade.style.visibility = 'visible';
 132+ if (this.e_iframe)
 133+ this.e_iframe.style.visibility = 'visible';
 134+
 135+ // change icon and status
 136+ this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
 137+ this.e_icon.title = 'Close Calendar';
 138+ this.b_visible = true;
 139+}
 140+
 141+function f_tcalHide (n_date) {
 142+ if (n_date)
 143+ this.e_input.value = this.f_generDate(new Date(n_date));
 144+
 145+ // no action if not visible
 146+ if (!this.b_visible)
 147+ return;
 148+
 149+ // hide elements
 150+ if (this.e_iframe)
 151+ this.e_iframe.style.visibility = 'hidden';
 152+ if (this.e_shade)
 153+ this.e_shade.style.visibility = 'hidden';
 154+ this.e_div.style.visibility = 'hidden';
 155+
 156+ // change icon and status
 157+ this.e_icon = f_getElement(this.s_iconId);
 158+ this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
 159+ this.e_icon.title = 'Open Calendar';
 160+ this.b_visible = false;
 161+}
 162+
 163+function f_tcalToggle () {
 164+ return this.b_visible ? this.f_hide() : this.f_show();
 165+}
 166+
 167+function f_tcalUpdate (d_date) {
 168+
 169+ var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
 170+ var d_selected = this.e_input.value == ''
 171+ ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
 172+ : this.f_parseDate(this.e_input.value);
 173+
 174+ // figure out date to display
 175+ if (!d_date)
 176+ // selected by default
 177+ d_date = d_selected;
 178+ else if (typeof(d_date) == 'number')
 179+ // get from number
 180+ d_date = f_tcalResetTime(new Date(d_date));
 181+ else if (typeof(d_date) == 'string')
 182+ // parse from string
 183+ this.f_parseDate(d_date);
 184+
 185+ if (!d_date) return false;
 186+
 187+ // first date to display
 188+ var d_firstday = new Date(d_date);
 189+ d_firstday.setDate(1);
 190+ d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
 191+
 192+ var a_class, s_html = '<table class="ctrl"><tbody><tr>'
 193+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
 194+ + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
 195+ + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
 196+ + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
 197+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
 198+ + '</tr></tbody></table><table><tbody><tr class="wd">';
 199+
 200+ // print weekdays titles
 201+ for (var i = 0; i < 7; i++)
 202+ s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
 203+ s_html += '</tr>' ;
 204+
 205+ // print calendar table
 206+ var n_date, n_month, d_current = new Date(d_firstday);
 207+ while (d_current.getMonth() == d_date.getMonth() ||
 208+ d_current.getMonth() == d_firstday.getMonth()) {
 209+
 210+ // print row heder
 211+ s_html +='<tr>';
 212+ for (var n_wday = 0; n_wday < 7; n_wday++) {
 213+
 214+ a_class = [];
 215+ n_date = d_current.getDate();
 216+ n_month = d_current.getMonth();
 217+
 218+ // other month
 219+ if (d_current.getMonth() != d_date.getMonth())
 220+ a_class[a_class.length] = 'othermonth';
 221+ // weekend
 222+ if (d_current.getDay() == 0 || d_current.getDay() == 6)
 223+ a_class[a_class.length] = 'weekend';
 224+ // today
 225+ if (d_current.valueOf() == d_today.valueOf())
 226+ a_class[a_class.length] = 'today';
 227+ // selected
 228+ if (d_current.valueOf() == d_selected.valueOf())
 229+ a_class[a_class.length] = 'selected';
 230+
 231+ s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
 232+
 233+ d_current.setDate(++n_date);
 234+ while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
 235+ d_current.setHours(d_current.getHours + 1);
 236+ d_current = f_tcalResetTime(d_current);
 237+ }
 238+ }
 239+ // print row footer
 240+ s_html +='</tr>';
 241+ }
 242+ s_html +='</tbody></table>';
 243+
 244+ // update HTML, positions and sizes
 245+ this.e_div.innerHTML = s_html;
 246+
 247+ var n_width = this.e_div.offsetWidth;
 248+ var n_height = this.e_div.offsetHeight;
 249+ var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
 250+ var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
 251+ if (n_left < 0) n_left = 0;
 252+
 253+ this.e_div.style.left = n_left + 'px';
 254+ this.e_div.style.top = n_top + 'px';
 255+
 256+ this.e_shade.style.width = (n_width + 8) + 'px';
 257+ this.e_shade.style.left = (n_left - 1) + 'px';
 258+ this.e_shade.style.top = (n_top - 1) + 'px';
 259+ this.e_shade.innerHTML = b_ieFix
 260+ ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
 261+ : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
 262+
 263+ if (this.e_iframe) {
 264+ this.e_iframe.style.left = n_left + 'px';
 265+ this.e_iframe.style.top = n_top + 'px';
 266+ this.e_iframe.style.width = (n_width + 6) + 'px';
 267+ this.e_iframe.style.height = (n_height + 6) +'px';
 268+ }
 269+ return true;
 270+}
 271+
 272+function f_getPosition (e_elemRef, s_coord) {
 273+ var n_pos = 0, n_offset,
 274+ e_elem = e_elemRef;
 275+
 276+ while (e_elem) {
 277+ n_offset = e_elem["offset" + s_coord];
 278+ n_pos += n_offset;
 279+ e_elem = e_elem.offsetParent;
 280+ }
 281+ // margin correction in some browsers
 282+ if (b_ieMac)
 283+ n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
 284+ else if (b_safari)
 285+ n_pos -= n_offset;
 286+
 287+ e_elem = e_elemRef;
 288+ while (e_elem != document.body) {
 289+ n_offset = e_elem["scroll" + s_coord];
 290+ if (n_offset && e_elem.style.overflow == 'scroll')
 291+ n_pos -= n_offset;
 292+ e_elem = e_elem.parentNode;
 293+ }
 294+ return n_pos;
 295+}
 296+
 297+function f_tcalRelDate (d_date, d_diff, s_units) {
 298+ var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
 299+ var d_result = new Date(d_date);
 300+ d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
 301+ if (d_result.getDate() != d_date.getDate())
 302+ d_result.setDate(0);
 303+ return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
 304+}
 305+
 306+function f_tcalHideAll () {
 307+ for (var i = 0; i < window.A_TCALSIDX.length; i++)
 308+ window.A_TCALSIDX[i].f_hide();
 309+}
 310+
 311+function f_tcalResetTime (d_date) {
 312+ d_date.setHours(0);
 313+ d_date.setMinutes(0);
 314+ d_date.setSeconds(0);
 315+ d_date.setMilliseconds(0);
 316+ return d_date;
 317+}
 318+
 319+f_getElement = document.all ?
 320+ function (s_id) { return document.all[s_id] } :
 321+ function (s_id) { return document.getElementById(s_id) };
 322+
 323+if (document.addEventListener)
 324+ window.addEventListener('scroll', f_tcalHideAll, false);
 325+if (window.attachEvent)
 326+ window.attachEvent('onscroll', f_tcalHideAll);
 327+
 328+// global variables
 329+var s_userAgent = navigator.userAgent.toLowerCase(),
 330+ re_webkit = /WebKit\/(\d+)/i;
 331+var b_mac = s_userAgent.indexOf('mac') != -1,
 332+ b_ie5 = s_userAgent.indexOf('msie 5') != -1,
 333+ b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
 334+var b_ieFix = b_ie5 || b_ie6,
 335+ b_ieMac = b_mac && b_ie5,
 336+ b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_db.js
___________________________________________________________________
Added: svn:eol-style
337337 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_us.js
@@ -1,335 +1,335 @@
2 -// Tigra Calendar v4.0.3 (01/12/2009) American (mm/dd/yyyy)
3 -// http://www.softcomplex.com/products/tigra_calendar/
4 -// Public Domain Software... You're welcome.
5 -
6 -// default settins
7 -var A_TCALDEF = {
8 - 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
9 - 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10 - 'yearscroll': true, // show year scroller
11 - 'weekstart': 0, // first day of week: 0-Su or 1-Mo
12 - 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
13 - 'imgpath' : 'img/' // directory with calendar images
14 -}
15 -// date parsing function
16 -function f_tcalParseDate (s_date) {
17 -
18 - var re_date = /^\s*(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s*$/;
19 - if (!re_date.exec(s_date))
20 - return alert ("Invalid date: '" + s_date + "'.\nAccepted format is mm/dd/yyyy.")
21 - var n_day = Number(RegExp.$2),
22 - n_month = Number(RegExp.$1),
23 - n_year = Number(RegExp.$3);
24 -
25 - if (n_year < 100)
26 - n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
27 - if (n_month < 1 || n_month > 12)
28 - return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
29 - var d_numdays = new Date(n_year, n_month, 0);
30 - if (n_day > d_numdays.getDate())
31 - return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
32 -
33 - return new Date (n_year, n_month - 1, n_day);
34 -}
35 -// date generating function
36 -function f_tcalGenerDate (d_date) {
37 - return (
38 - (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "/"
39 - + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "/"
40 - + d_date.getFullYear()
41 - );
42 -}
43 -
44 -// implementation
45 -function tcal (a_cfg, a_tpl) {
46 -
47 - // apply default template if not specified
48 - if (!a_tpl)
49 - a_tpl = A_TCALDEF;
50 -
51 - // register in global collections
52 - if (!window.A_TCALS)
53 - window.A_TCALS = [];
54 - if (!window.A_TCALSIDX)
55 - window.A_TCALSIDX = [];
56 -
57 - this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
58 - window.A_TCALS[this.s_id] = this;
59 - window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
60 -
61 - // assign methods
62 - this.f_show = f_tcalShow;
63 - this.f_hide = f_tcalHide;
64 - this.f_toggle = f_tcalToggle;
65 - this.f_update = f_tcalUpdate;
66 - this.f_relDate = f_tcalRelDate;
67 - this.f_parseDate = f_tcalParseDate;
68 - this.f_generDate = f_tcalGenerDate;
69 -
70 - // create calendar icon
71 - this.s_iconId = 'tcalico_' + this.s_id;
72 - this.e_icon = f_getElement(this.s_iconId);
73 - if (!this.e_icon) {
74 - document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
75 - this.e_icon = f_getElement(this.s_iconId);
76 - }
77 - // save received parameters
78 - this.a_cfg = a_cfg;
79 - this.a_tpl = a_tpl;
80 -}
81 -
82 -function f_tcalShow (d_date) {
83 -
84 - // find input field
85 - if (!this.a_cfg.controlname)
86 - throw("TC: control name is not specified");
87 - if (this.a_cfg.formname) {
88 - var e_form = document.forms[this.a_cfg.formname];
89 - if (!e_form)
90 - throw("TC: form '" + this.a_cfg.formname + "' can not be found");
91 - this.e_input = e_form.elements[this.a_cfg.controlname];
92 - }
93 - else
94 - this.e_input = f_getElement(this.a_cfg.controlname);
95 -
96 - if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
97 - throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
98 - + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
99 -
100 - // dynamically create HTML elements if needed
101 - this.e_div = f_getElement('tcal');
102 - if (!this.e_div) {
103 - this.e_div = document.createElement("DIV");
104 - this.e_div.id = 'tcal';
105 - document.body.appendChild(this.e_div);
106 - }
107 - this.e_shade = f_getElement('tcalShade');
108 - if (!this.e_shade) {
109 - this.e_shade = document.createElement("DIV");
110 - this.e_shade.id = 'tcalShade';
111 - document.body.appendChild(this.e_shade);
112 - }
113 - this.e_iframe = f_getElement('tcalIF')
114 - if (b_ieFix && !this.e_iframe) {
115 - this.e_iframe = document.createElement("IFRAME");
116 - this.e_iframe.style.filter = 'alpha(opacity=0)';
117 - this.e_iframe.id = 'tcalIF';
118 - this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
119 - document.body.appendChild(this.e_iframe);
120 - }
121 -
122 - // hide all calendars
123 - f_tcalHideAll();
124 -
125 - // generate HTML and show calendar
126 - this.e_icon = f_getElement(this.s_iconId);
127 - if (!this.f_update())
128 - return;
129 -
130 - this.e_div.style.visibility = 'visible';
131 - this.e_shade.style.visibility = 'visible';
132 - if (this.e_iframe)
133 - this.e_iframe.style.visibility = 'visible';
134 -
135 - // change icon and status
136 - this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
137 - this.e_icon.title = 'Close Calendar';
138 - this.b_visible = true;
139 -}
140 -
141 -function f_tcalHide (n_date) {
142 - if (n_date)
143 - this.e_input.value = this.f_generDate(new Date(n_date));
144 -
145 - // no action if not visible
146 - if (!this.b_visible)
147 - return;
148 -
149 - // hide elements
150 - if (this.e_iframe)
151 - this.e_iframe.style.visibility = 'hidden';
152 - if (this.e_shade)
153 - this.e_shade.style.visibility = 'hidden';
154 - this.e_div.style.visibility = 'hidden';
155 -
156 - // change icon and status
157 - this.e_icon = f_getElement(this.s_iconId);
158 - this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
159 - this.e_icon.title = 'Open Calendar';
160 - this.b_visible = false;
161 -}
162 -
163 -function f_tcalToggle () {
164 - return this.b_visible ? this.f_hide() : this.f_show();
165 -}
166 -
167 -function f_tcalUpdate (d_date) {
168 -
169 - var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
170 - var d_selected = this.e_input.value == ''
171 - ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
172 - : this.f_parseDate(this.e_input.value);
173 -
174 - // figure out date to display
175 - if (!d_date)
176 - // selected by default
177 - d_date = d_selected;
178 - else if (typeof(d_date) == 'number')
179 - // get from number
180 - d_date = f_tcalResetTime(new Date(d_date));
181 - else if (typeof(d_date) == 'string')
182 - // parse from string
183 - this.f_parseDate(d_date);
184 -
185 - if (!d_date) return false;
186 -
187 - // first date to display
188 - var d_firstday = new Date(d_date);
189 - d_firstday.setDate(1);
190 - d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
191 -
192 - var a_class, s_html = '<table class="ctrl"><tbody><tr>'
193 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
194 - + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
195 - + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
196 - + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
197 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
198 - + '</tr></tbody></table><table><tbody><tr class="wd">';
199 -
200 - // print weekdays titles
201 - for (var i = 0; i < 7; i++)
202 - s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
203 - s_html += '</tr>' ;
204 -
205 - // print calendar table
206 - var n_date, n_month, d_current = new Date(d_firstday);
207 - while (d_current.getMonth() == d_date.getMonth() ||
208 - d_current.getMonth() == d_firstday.getMonth()) {
209 -
210 - // print row heder
211 - s_html +='<tr>';
212 - for (var n_wday = 0; n_wday < 7; n_wday++) {
213 -
214 - a_class = [];
215 - n_date = d_current.getDate();
216 - n_month = d_current.getMonth();
217 -
218 - // other month
219 - if (d_current.getMonth() != d_date.getMonth())
220 - a_class[a_class.length] = 'othermonth';
221 - // weekend
222 - if (d_current.getDay() == 0 || d_current.getDay() == 6)
223 - a_class[a_class.length] = 'weekend';
224 - // today
225 - if (d_current.valueOf() == d_today.valueOf())
226 - a_class[a_class.length] = 'today';
227 - // selected
228 - if (d_current.valueOf() == d_selected.valueOf())
229 - a_class[a_class.length] = 'selected';
230 -
231 - s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
232 -
233 - d_current.setDate(++n_date);
234 - while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
235 - d_current.setHours(d_current.getHours + 1);
236 - d_current = f_tcalResetTime(d_current);
237 - }
238 - }
239 - // print row footer
240 - s_html +='</tr>';
241 - }
242 - s_html +='</tbody></table>';
243 -
244 - // update HTML, positions and sizes
245 - this.e_div.innerHTML = s_html;
246 -
247 - var n_width = this.e_div.offsetWidth;
248 - var n_height = this.e_div.offsetHeight;
249 - var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
250 - var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
251 - if (n_left < 0) n_left = 0;
252 -
253 - this.e_div.style.left = n_left + 'px';
254 - this.e_div.style.top = n_top + 'px';
255 -
256 - this.e_shade.style.width = (n_width + 8) + 'px';
257 - this.e_shade.style.left = (n_left - 1) + 'px';
258 - this.e_shade.style.top = (n_top - 1) + 'px';
259 - this.e_shade.innerHTML = b_ieFix
260 - ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
261 - : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
262 -
263 - if (this.e_iframe) {
264 - this.e_iframe.style.left = n_left + 'px';
265 - this.e_iframe.style.top = n_top + 'px';
266 - this.e_iframe.style.width = (n_width + 6) + 'px';
267 - this.e_iframe.style.height = (n_height + 6) +'px';
268 - }
269 - return true;
270 -}
271 -
272 -function f_getPosition (e_elemRef, s_coord) {
273 - var n_pos = 0, n_offset,
274 - e_elem = e_elemRef;
275 -
276 - while (e_elem) {
277 - n_offset = e_elem["offset" + s_coord];
278 - n_pos += n_offset;
279 - e_elem = e_elem.offsetParent;
280 - }
281 - // margin correction in some browsers
282 - if (b_ieMac)
283 - n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
284 - else if (b_safari)
285 - n_pos -= n_offset;
286 -
287 - e_elem = e_elemRef;
288 - while (e_elem != document.body) {
289 - n_offset = e_elem["scroll" + s_coord];
290 - if (n_offset && e_elem.style.overflow == 'scroll')
291 - n_pos -= n_offset;
292 - e_elem = e_elem.parentNode;
293 - }
294 - return n_pos;
295 -}
296 -
297 -function f_tcalRelDate (d_date, d_diff, s_units) {
298 - var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
299 - var d_result = new Date(d_date);
300 - d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
301 - if (d_result.getDate() != d_date.getDate())
302 - d_result.setDate(0);
303 - return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
304 -}
305 -
306 -function f_tcalHideAll () {
307 - for (var i = 0; i < window.A_TCALSIDX.length; i++)
308 - window.A_TCALSIDX[i].f_hide();
309 -}
310 -
311 -function f_tcalResetTime (d_date) {
312 - d_date.setHours(0);
313 - d_date.setMinutes(0);
314 - d_date.setSeconds(0);
315 - d_date.setMilliseconds(0);
316 - return d_date;
317 -}
318 -
319 -f_getElement = document.all ?
320 - function (s_id) { return document.all[s_id] } :
321 - function (s_id) { return document.getElementById(s_id) };
322 -
323 -if (document.addEventListener)
324 - window.addEventListener('scroll', f_tcalHideAll, false);
325 -if (window.attachEvent)
326 - window.attachEvent('onscroll', f_tcalHideAll);
327 -
328 -// global variables
329 -var s_userAgent = navigator.userAgent.toLowerCase(),
330 - re_webkit = /WebKit\/(\d+)/i;
331 -var b_mac = s_userAgent.indexOf('mac') != -1,
332 - b_ie5 = s_userAgent.indexOf('msie 5') != -1,
333 - b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
334 -var b_ieFix = b_ie5 || b_ie6,
335 - b_ieMac = b_mac && b_ie5,
336 - b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
 2+// Tigra Calendar v4.0.3 (01/12/2009) American (mm/dd/yyyy)
 3+// http://www.softcomplex.com/products/tigra_calendar/
 4+// Public Domain Software... You're welcome.
 5+
 6+// default settins
 7+var A_TCALDEF = {
 8+ 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
 9+ 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
 10+ 'yearscroll': true, // show year scroller
 11+ 'weekstart': 0, // first day of week: 0-Su or 1-Mo
 12+ 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
 13+ 'imgpath' : 'img/' // directory with calendar images
 14+}
 15+// date parsing function
 16+function f_tcalParseDate (s_date) {
 17+
 18+ var re_date = /^\s*(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s*$/;
 19+ if (!re_date.exec(s_date))
 20+ return alert ("Invalid date: '" + s_date + "'.\nAccepted format is mm/dd/yyyy.")
 21+ var n_day = Number(RegExp.$2),
 22+ n_month = Number(RegExp.$1),
 23+ n_year = Number(RegExp.$3);
 24+
 25+ if (n_year < 100)
 26+ n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
 27+ if (n_month < 1 || n_month > 12)
 28+ return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
 29+ var d_numdays = new Date(n_year, n_month, 0);
 30+ if (n_day > d_numdays.getDate())
 31+ return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
 32+
 33+ return new Date (n_year, n_month - 1, n_day);
 34+}
 35+// date generating function
 36+function f_tcalGenerDate (d_date) {
 37+ return (
 38+ (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "/"
 39+ + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "/"
 40+ + d_date.getFullYear()
 41+ );
 42+}
 43+
 44+// implementation
 45+function tcal (a_cfg, a_tpl) {
 46+
 47+ // apply default template if not specified
 48+ if (!a_tpl)
 49+ a_tpl = A_TCALDEF;
 50+
 51+ // register in global collections
 52+ if (!window.A_TCALS)
 53+ window.A_TCALS = [];
 54+ if (!window.A_TCALSIDX)
 55+ window.A_TCALSIDX = [];
 56+
 57+ this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
 58+ window.A_TCALS[this.s_id] = this;
 59+ window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
 60+
 61+ // assign methods
 62+ this.f_show = f_tcalShow;
 63+ this.f_hide = f_tcalHide;
 64+ this.f_toggle = f_tcalToggle;
 65+ this.f_update = f_tcalUpdate;
 66+ this.f_relDate = f_tcalRelDate;
 67+ this.f_parseDate = f_tcalParseDate;
 68+ this.f_generDate = f_tcalGenerDate;
 69+
 70+ // create calendar icon
 71+ this.s_iconId = 'tcalico_' + this.s_id;
 72+ this.e_icon = f_getElement(this.s_iconId);
 73+ if (!this.e_icon) {
 74+ document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
 75+ this.e_icon = f_getElement(this.s_iconId);
 76+ }
 77+ // save received parameters
 78+ this.a_cfg = a_cfg;
 79+ this.a_tpl = a_tpl;
 80+}
 81+
 82+function f_tcalShow (d_date) {
 83+
 84+ // find input field
 85+ if (!this.a_cfg.controlname)
 86+ throw("TC: control name is not specified");
 87+ if (this.a_cfg.formname) {
 88+ var e_form = document.forms[this.a_cfg.formname];
 89+ if (!e_form)
 90+ throw("TC: form '" + this.a_cfg.formname + "' can not be found");
 91+ this.e_input = e_form.elements[this.a_cfg.controlname];
 92+ }
 93+ else
 94+ this.e_input = f_getElement(this.a_cfg.controlname);
 95+
 96+ if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
 97+ throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
 98+ + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
 99+
 100+ // dynamically create HTML elements if needed
 101+ this.e_div = f_getElement('tcal');
 102+ if (!this.e_div) {
 103+ this.e_div = document.createElement("DIV");
 104+ this.e_div.id = 'tcal';
 105+ document.body.appendChild(this.e_div);
 106+ }
 107+ this.e_shade = f_getElement('tcalShade');
 108+ if (!this.e_shade) {
 109+ this.e_shade = document.createElement("DIV");
 110+ this.e_shade.id = 'tcalShade';
 111+ document.body.appendChild(this.e_shade);
 112+ }
 113+ this.e_iframe = f_getElement('tcalIF')
 114+ if (b_ieFix && !this.e_iframe) {
 115+ this.e_iframe = document.createElement("IFRAME");
 116+ this.e_iframe.style.filter = 'alpha(opacity=0)';
 117+ this.e_iframe.id = 'tcalIF';
 118+ this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
 119+ document.body.appendChild(this.e_iframe);
 120+ }
 121+
 122+ // hide all calendars
 123+ f_tcalHideAll();
 124+
 125+ // generate HTML and show calendar
 126+ this.e_icon = f_getElement(this.s_iconId);
 127+ if (!this.f_update())
 128+ return;
 129+
 130+ this.e_div.style.visibility = 'visible';
 131+ this.e_shade.style.visibility = 'visible';
 132+ if (this.e_iframe)
 133+ this.e_iframe.style.visibility = 'visible';
 134+
 135+ // change icon and status
 136+ this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
 137+ this.e_icon.title = 'Close Calendar';
 138+ this.b_visible = true;
 139+}
 140+
 141+function f_tcalHide (n_date) {
 142+ if (n_date)
 143+ this.e_input.value = this.f_generDate(new Date(n_date));
 144+
 145+ // no action if not visible
 146+ if (!this.b_visible)
 147+ return;
 148+
 149+ // hide elements
 150+ if (this.e_iframe)
 151+ this.e_iframe.style.visibility = 'hidden';
 152+ if (this.e_shade)
 153+ this.e_shade.style.visibility = 'hidden';
 154+ this.e_div.style.visibility = 'hidden';
 155+
 156+ // change icon and status
 157+ this.e_icon = f_getElement(this.s_iconId);
 158+ this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
 159+ this.e_icon.title = 'Open Calendar';
 160+ this.b_visible = false;
 161+}
 162+
 163+function f_tcalToggle () {
 164+ return this.b_visible ? this.f_hide() : this.f_show();
 165+}
 166+
 167+function f_tcalUpdate (d_date) {
 168+
 169+ var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
 170+ var d_selected = this.e_input.value == ''
 171+ ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
 172+ : this.f_parseDate(this.e_input.value);
 173+
 174+ // figure out date to display
 175+ if (!d_date)
 176+ // selected by default
 177+ d_date = d_selected;
 178+ else if (typeof(d_date) == 'number')
 179+ // get from number
 180+ d_date = f_tcalResetTime(new Date(d_date));
 181+ else if (typeof(d_date) == 'string')
 182+ // parse from string
 183+ this.f_parseDate(d_date);
 184+
 185+ if (!d_date) return false;
 186+
 187+ // first date to display
 188+ var d_firstday = new Date(d_date);
 189+ d_firstday.setDate(1);
 190+ d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
 191+
 192+ var a_class, s_html = '<table class="ctrl"><tbody><tr>'
 193+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
 194+ + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
 195+ + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
 196+ + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
 197+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
 198+ + '</tr></tbody></table><table><tbody><tr class="wd">';
 199+
 200+ // print weekdays titles
 201+ for (var i = 0; i < 7; i++)
 202+ s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
 203+ s_html += '</tr>' ;
 204+
 205+ // print calendar table
 206+ var n_date, n_month, d_current = new Date(d_firstday);
 207+ while (d_current.getMonth() == d_date.getMonth() ||
 208+ d_current.getMonth() == d_firstday.getMonth()) {
 209+
 210+ // print row heder
 211+ s_html +='<tr>';
 212+ for (var n_wday = 0; n_wday < 7; n_wday++) {
 213+
 214+ a_class = [];
 215+ n_date = d_current.getDate();
 216+ n_month = d_current.getMonth();
 217+
 218+ // other month
 219+ if (d_current.getMonth() != d_date.getMonth())
 220+ a_class[a_class.length] = 'othermonth';
 221+ // weekend
 222+ if (d_current.getDay() == 0 || d_current.getDay() == 6)
 223+ a_class[a_class.length] = 'weekend';
 224+ // today
 225+ if (d_current.valueOf() == d_today.valueOf())
 226+ a_class[a_class.length] = 'today';
 227+ // selected
 228+ if (d_current.valueOf() == d_selected.valueOf())
 229+ a_class[a_class.length] = 'selected';
 230+
 231+ s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
 232+
 233+ d_current.setDate(++n_date);
 234+ while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
 235+ d_current.setHours(d_current.getHours + 1);
 236+ d_current = f_tcalResetTime(d_current);
 237+ }
 238+ }
 239+ // print row footer
 240+ s_html +='</tr>';
 241+ }
 242+ s_html +='</tbody></table>';
 243+
 244+ // update HTML, positions and sizes
 245+ this.e_div.innerHTML = s_html;
 246+
 247+ var n_width = this.e_div.offsetWidth;
 248+ var n_height = this.e_div.offsetHeight;
 249+ var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
 250+ var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
 251+ if (n_left < 0) n_left = 0;
 252+
 253+ this.e_div.style.left = n_left + 'px';
 254+ this.e_div.style.top = n_top + 'px';
 255+
 256+ this.e_shade.style.width = (n_width + 8) + 'px';
 257+ this.e_shade.style.left = (n_left - 1) + 'px';
 258+ this.e_shade.style.top = (n_top - 1) + 'px';
 259+ this.e_shade.innerHTML = b_ieFix
 260+ ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
 261+ : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
 262+
 263+ if (this.e_iframe) {
 264+ this.e_iframe.style.left = n_left + 'px';
 265+ this.e_iframe.style.top = n_top + 'px';
 266+ this.e_iframe.style.width = (n_width + 6) + 'px';
 267+ this.e_iframe.style.height = (n_height + 6) +'px';
 268+ }
 269+ return true;
 270+}
 271+
 272+function f_getPosition (e_elemRef, s_coord) {
 273+ var n_pos = 0, n_offset,
 274+ e_elem = e_elemRef;
 275+
 276+ while (e_elem) {
 277+ n_offset = e_elem["offset" + s_coord];
 278+ n_pos += n_offset;
 279+ e_elem = e_elem.offsetParent;
 280+ }
 281+ // margin correction in some browsers
 282+ if (b_ieMac)
 283+ n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
 284+ else if (b_safari)
 285+ n_pos -= n_offset;
 286+
 287+ e_elem = e_elemRef;
 288+ while (e_elem != document.body) {
 289+ n_offset = e_elem["scroll" + s_coord];
 290+ if (n_offset && e_elem.style.overflow == 'scroll')
 291+ n_pos -= n_offset;
 292+ e_elem = e_elem.parentNode;
 293+ }
 294+ return n_pos;
 295+}
 296+
 297+function f_tcalRelDate (d_date, d_diff, s_units) {
 298+ var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
 299+ var d_result = new Date(d_date);
 300+ d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
 301+ if (d_result.getDate() != d_date.getDate())
 302+ d_result.setDate(0);
 303+ return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
 304+}
 305+
 306+function f_tcalHideAll () {
 307+ for (var i = 0; i < window.A_TCALSIDX.length; i++)
 308+ window.A_TCALSIDX[i].f_hide();
 309+}
 310+
 311+function f_tcalResetTime (d_date) {
 312+ d_date.setHours(0);
 313+ d_date.setMinutes(0);
 314+ d_date.setSeconds(0);
 315+ d_date.setMilliseconds(0);
 316+ return d_date;
 317+}
 318+
 319+f_getElement = document.all ?
 320+ function (s_id) { return document.all[s_id] } :
 321+ function (s_id) { return document.getElementById(s_id) };
 322+
 323+if (document.addEventListener)
 324+ window.addEventListener('scroll', f_tcalHideAll, false);
 325+if (window.attachEvent)
 326+ window.attachEvent('onscroll', f_tcalHideAll);
 327+
 328+// global variables
 329+var s_userAgent = navigator.userAgent.toLowerCase(),
 330+ re_webkit = /WebKit\/(\d+)/i;
 331+var b_mac = s_userAgent.indexOf('mac') != -1,
 332+ b_ie5 = s_userAgent.indexOf('msie 5') != -1,
 333+ b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
 334+var b_ieFix = b_ie5 || b_ie6,
 335+ b_ieMac = b_mac && b_ie5,
 336+ b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_us.js
___________________________________________________________________
Added: svn:eol-style
337337 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/readme.txt
@@ -1,45 +1,45 @@
2 -
3 -Tigra Calendar readme
4 -
5 -Thank you for downloading Tigra Calendar! We appreciate your interest
6 -and we hope that you'll enjoy working with the component.
7 -
8 -
9 -GETTING STARTED
10 -
11 -Tigra Calendar is a JavaScript software component, it is not intended
12 -for stand-alone use. We included several working samples demonstrating
13 -component's features and possible use scenarios, but eventually the
14 -calendar must be configured inside your own web pages. Follow the
15 -steps below to implement the calendar in your application:
16 -
17 -1. Test the samples, make sure calendar works in all the required browsers
18 -2. Make a copy of one of the samples and customize the calendar's
19 - configuration for your needs. Check the page after every modification.
20 -3. Copy calendar related code from the test page into the destination
21 - page. Adjust paths if needed.
22 -
23 -DOCUMENTATION
24 -
25 -The documentation for the latest version of the component is available at:
26 -http://www.softcomplex.com/products/tigra_calendar/docs/
27 -
28 -TECHNICAL SUPPORT
29 -
30 -For general questions please use our forum at:
31 -http://www.softcomplex.com/forum/forumdisplay_42/
32 -
33 -For full list of the available support options visit:
34 -http://www.softcomplex.com/support.html
35 -
36 -Subscribe to our RSS feed to be notified about new releases of the component:
37 -http://www.softcomplex.com/news.xml
38 -
39 -Thank you and good luck!
40 -Softcomplex Team
41 -
 2+
 3+Tigra Calendar readme
 4+----------------------------------------------
 5+
 6+Thank you for downloading Tigra Calendar! We appreciate your interest
 7+and we hope that you'll enjoy working with the component.
 8+
 9+
 10+GETTING STARTED
 11+----------------------------------------------
 12+
 13+Tigra Calendar is a JavaScript software component, it is not intended
 14+for stand-alone use. We included several working samples demonstrating
 15+component's features and possible use scenarios, but eventually the
 16+calendar must be configured inside your own web pages. Follow the
 17+steps below to implement the calendar in your application:
 18+
 19+1. Test the samples, make sure calendar works in all the required browsers
 20+2. Make a copy of one of the samples and customize the calendar's
 21+ configuration for your needs. Check the page after every modification.
 22+3. Copy calendar related code from the test page into the destination
 23+ page. Adjust paths if needed.
 24+
 25+DOCUMENTATION
 26+----------------------------------------------
 27+
 28+The documentation for the latest version of the component is available at:
 29+http://www.softcomplex.com/products/tigra_calendar/docs/
 30+
 31+TECHNICAL SUPPORT
 32+----------------------------------------------
 33+
 34+For general questions please use our forum at:
 35+http://www.softcomplex.com/forum/forumdisplay_42/
 36+
 37+For full list of the available support options visit:
 38+http://www.softcomplex.com/support.html
 39+
 40+Subscribe to our RSS feed to be notified about new releases of the component:
 41+http://www.softcomplex.com/news.xml
 42+
 43+--
 44+Thank you and good luck!
 45+Softcomplex Team
 46+
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/readme.txt
___________________________________________________________________
Added: svn:eol-style
4247 + native
Index: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_eu.js
@@ -1,335 +1,335 @@
2 -// Tigra Calendar v4.0.2 (12-01-2009) European (dd-mm-yyyy)
3 -// http://www.softcomplex.com/products/tigra_calendar/
4 -// Public Domain Software... You're welcome.
5 -
6 -// default settins
7 -var A_TCALDEF = {
8 - 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
9 - 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10 - 'yearscroll': true, // show year scroller
11 - 'weekstart': 1, // first day of week: 0-Su or 1-Mo
12 - 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
13 - 'imgpath' : 'img/' // directory with calendar images
14 -}
15 -// date parsing function
16 -function f_tcalParseDate (s_date) {
17 -
18 - var re_date = /^\s*(\d{1,2})\-(\d{1,2})\-(\d{2,4})\s*$/;
19 - if (!re_date.exec(s_date))
20 - return alert ("Invalid date: '" + s_date + "'.\nAccepted format is dd-mm-yyyy.")
21 - var n_day = Number(RegExp.$1),
22 - n_month = Number(RegExp.$2),
23 - n_year = Number(RegExp.$3);
24 -
25 - if (n_year < 100)
26 - n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
27 - if (n_month < 1 || n_month > 12)
28 - return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
29 - var d_numdays = new Date(n_year, n_month, 0);
30 - if (n_day > d_numdays.getDate())
31 - return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
32 -
33 - return new Date (n_year, n_month - 1, n_day);
34 -}
35 -// date generating function
36 -function f_tcalGenerDate (d_date) {
37 - return (
38 - (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "-"
39 - + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
40 - + d_date.getFullYear()
41 - );
42 -}
43 -
44 -// implementation
45 -function tcal (a_cfg, a_tpl) {
46 -
47 - // apply default template if not specified
48 - if (!a_tpl)
49 - a_tpl = A_TCALDEF;
50 -
51 - // register in global collections
52 - if (!window.A_TCALS)
53 - window.A_TCALS = [];
54 - if (!window.A_TCALSIDX)
55 - window.A_TCALSIDX = [];
56 -
57 - this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
58 - window.A_TCALS[this.s_id] = this;
59 - window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
60 -
61 - // assign methods
62 - this.f_show = f_tcalShow;
63 - this.f_hide = f_tcalHide;
64 - this.f_toggle = f_tcalToggle;
65 - this.f_update = f_tcalUpdate;
66 - this.f_relDate = f_tcalRelDate;
67 - this.f_parseDate = f_tcalParseDate;
68 - this.f_generDate = f_tcalGenerDate;
69 -
70 - // create calendar icon
71 - this.s_iconId = 'tcalico_' + this.s_id;
72 - this.e_icon = f_getElement(this.s_iconId);
73 - if (!this.e_icon) {
74 - document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
75 - this.e_icon = f_getElement(this.s_iconId);
76 - }
77 - // save received parameters
78 - this.a_cfg = a_cfg;
79 - this.a_tpl = a_tpl;
80 -}
81 -
82 -function f_tcalShow (d_date) {
83 -
84 - // find input field
85 - if (!this.a_cfg.controlname)
86 - throw("TC: control name is not specified");
87 - if (this.a_cfg.formname) {
88 - var e_form = document.forms[this.a_cfg.formname];
89 - if (!e_form)
90 - throw("TC: form '" + this.a_cfg.formname + "' can not be found");
91 - this.e_input = e_form.elements[this.a_cfg.controlname];
92 - }
93 - else
94 - this.e_input = f_getElement(this.a_cfg.controlname);
95 -
96 - if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
97 - throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
98 - + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
99 -
100 - // dynamically create HTML elements if needed
101 - this.e_div = f_getElement('tcal');
102 - if (!this.e_div) {
103 - this.e_div = document.createElement("DIV");
104 - this.e_div.id = 'tcal';
105 - document.body.appendChild(this.e_div);
106 - }
107 - this.e_shade = f_getElement('tcalShade');
108 - if (!this.e_shade) {
109 - this.e_shade = document.createElement("DIV");
110 - this.e_shade.id = 'tcalShade';
111 - document.body.appendChild(this.e_shade);
112 - }
113 - this.e_iframe = f_getElement('tcalIF')
114 - if (b_ieFix && !this.e_iframe) {
115 - this.e_iframe = document.createElement("IFRAME");
116 - this.e_iframe.style.filter = 'alpha(opacity=0)';
117 - this.e_iframe.id = 'tcalIF';
118 - this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
119 - document.body.appendChild(this.e_iframe);
120 - }
121 -
122 - // hide all calendars
123 - f_tcalHideAll();
124 -
125 - // generate HTML and show calendar
126 - this.e_icon = f_getElement(this.s_iconId);
127 - if (!this.f_update())
128 - return;
129 -
130 - this.e_div.style.visibility = 'visible';
131 - this.e_shade.style.visibility = 'visible';
132 - if (this.e_iframe)
133 - this.e_iframe.style.visibility = 'visible';
134 -
135 - // change icon and status
136 - this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
137 - this.e_icon.title = 'Close Calendar';
138 - this.b_visible = true;
139 -}
140 -
141 -function f_tcalHide (n_date) {
142 - if (n_date)
143 - this.e_input.value = this.f_generDate(new Date(n_date));
144 -
145 - // no action if not visible
146 - if (!this.b_visible)
147 - return;
148 -
149 - // hide elements
150 - if (this.e_iframe)
151 - this.e_iframe.style.visibility = 'hidden';
152 - if (this.e_shade)
153 - this.e_shade.style.visibility = 'hidden';
154 - this.e_div.style.visibility = 'hidden';
155 -
156 - // change icon and status
157 - this.e_icon = f_getElement(this.s_iconId);
158 - this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
159 - this.e_icon.title = 'Open Calendar';
160 - this.b_visible = false;
161 -}
162 -
163 -function f_tcalToggle () {
164 - return this.b_visible ? this.f_hide() : this.f_show();
165 -}
166 -
167 -function f_tcalUpdate (d_date) {
168 -
169 - var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
170 - var d_selected = this.e_input.value == ''
171 - ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
172 - : this.f_parseDate(this.e_input.value);
173 -
174 - // figure out date to display
175 - if (!d_date)
176 - // selected by default
177 - d_date = d_selected;
178 - else if (typeof(d_date) == 'number')
179 - // get from number
180 - d_date = f_tcalResetTime(new Date(d_date));
181 - else if (typeof(d_date) == 'string')
182 - // parse from string
183 - this.f_parseDate(d_date);
184 -
185 - if (!d_date) return false;
186 -
187 - // first date to display
188 - var d_firstday = new Date(d_date);
189 - d_firstday.setDate(1);
190 - d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
191 -
192 - var a_class, s_html = '<table class="ctrl"><tbody><tr>'
193 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
194 - + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
195 - + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
196 - + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
197 - + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
198 - + '</tr></tbody></table><table><tbody><tr class="wd">';
199 -
200 - // print weekdays titles
201 - for (var i = 0; i < 7; i++)
202 - s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
203 - s_html += '</tr>' ;
204 -
205 - // print calendar table
206 - var n_date, n_month, d_current = new Date(d_firstday);
207 - while (d_current.getMonth() == d_date.getMonth() ||
208 - d_current.getMonth() == d_firstday.getMonth()) {
209 -
210 - // print row heder
211 - s_html +='<tr>';
212 - for (var n_wday = 0; n_wday < 7; n_wday++) {
213 -
214 - a_class = [];
215 - n_date = d_current.getDate();
216 - n_month = d_current.getMonth();
217 -
218 - // other month
219 - if (d_current.getMonth() != d_date.getMonth())
220 - a_class[a_class.length] = 'othermonth';
221 - // weekend
222 - if (d_current.getDay() == 0 || d_current.getDay() == 6)
223 - a_class[a_class.length] = 'weekend';
224 - // today
225 - if (d_current.valueOf() == d_today.valueOf())
226 - a_class[a_class.length] = 'today';
227 - // selected
228 - if (d_current.valueOf() == d_selected.valueOf())
229 - a_class[a_class.length] = 'selected';
230 -
231 - s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
232 -
233 - d_current.setDate(++n_date);
234 - while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
235 - d_current.setHours(d_current.getHours + 1);
236 - d_current = f_tcalResetTime(d_current);
237 - }
238 - }
239 - // print row footer
240 - s_html +='</tr>';
241 - }
242 - s_html +='</tbody></table>';
243 -
244 - // update HTML, positions and sizes
245 - this.e_div.innerHTML = s_html;
246 -
247 - var n_width = this.e_div.offsetWidth;
248 - var n_height = this.e_div.offsetHeight;
249 - var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
250 - var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
251 - if (n_left < 0) n_left = 0;
252 -
253 - this.e_div.style.left = n_left + 'px';
254 - this.e_div.style.top = n_top + 'px';
255 -
256 - this.e_shade.style.width = (n_width + 8) + 'px';
257 - this.e_shade.style.left = (n_left - 1) + 'px';
258 - this.e_shade.style.top = (n_top - 1) + 'px';
259 - this.e_shade.innerHTML = b_ieFix
260 - ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
261 - : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
262 -
263 - if (this.e_iframe) {
264 - this.e_iframe.style.left = n_left + 'px';
265 - this.e_iframe.style.top = n_top + 'px';
266 - this.e_iframe.style.width = (n_width + 6) + 'px';
267 - this.e_iframe.style.height = (n_height + 6) +'px';
268 - }
269 - return true;
270 -}
271 -
272 -function f_getPosition (e_elemRef, s_coord) {
273 - var n_pos = 0, n_offset,
274 - e_elem = e_elemRef;
275 -
276 - while (e_elem) {
277 - n_offset = e_elem["offset" + s_coord];
278 - n_pos += n_offset;
279 - e_elem = e_elem.offsetParent;
280 - }
281 - // margin correction in some browsers
282 - if (b_ieMac)
283 - n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
284 - else if (b_safari)
285 - n_pos -= n_offset;
286 -
287 - e_elem = e_elemRef;
288 - while (e_elem != document.body) {
289 - n_offset = e_elem["scroll" + s_coord];
290 - if (n_offset && e_elem.style.overflow == 'scroll')
291 - n_pos -= n_offset;
292 - e_elem = e_elem.parentNode;
293 - }
294 - return n_pos;
295 -}
296 -
297 -function f_tcalRelDate (d_date, d_diff, s_units) {
298 - var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
299 - var d_result = new Date(d_date);
300 - d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
301 - if (d_result.getDate() != d_date.getDate())
302 - d_result.setDate(0);
303 - return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
304 -}
305 -
306 -function f_tcalHideAll () {
307 - for (var i = 0; i < window.A_TCALSIDX.length; i++)
308 - window.A_TCALSIDX[i].f_hide();
309 -}
310 -
311 -function f_tcalResetTime (d_date) {
312 - d_date.setHours(0);
313 - d_date.setMinutes(0);
314 - d_date.setSeconds(0);
315 - d_date.setMilliseconds(0);
316 - return d_date;
317 -}
318 -
319 -f_getElement = document.all ?
320 - function (s_id) { return document.all[s_id] } :
321 - function (s_id) { return document.getElementById(s_id) };
322 -
323 -if (document.addEventListener)
324 - window.addEventListener('scroll', f_tcalHideAll, false);
325 -if (window.attachEvent)
326 - window.attachEvent('onscroll', f_tcalHideAll);
327 -
328 -// global variables
329 -var s_userAgent = navigator.userAgent.toLowerCase(),
330 - re_webkit = /WebKit\/(\d+)/i;
331 -var b_mac = s_userAgent.indexOf('mac') != -1,
332 - b_ie5 = s_userAgent.indexOf('msie 5') != -1,
333 - b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
334 -var b_ieFix = b_ie5 || b_ie6,
335 - b_ieMac = b_mac && b_ie5,
336 - b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
 2+// Tigra Calendar v4.0.2 (12-01-2009) European (dd-mm-yyyy)
 3+// http://www.softcomplex.com/products/tigra_calendar/
 4+// Public Domain Software... You're welcome.
 5+
 6+// default settins
 7+var A_TCALDEF = {
 8+ 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
 9+ 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
 10+ 'yearscroll': true, // show year scroller
 11+ 'weekstart': 1, // first day of week: 0-Su or 1-Mo
 12+ 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
 13+ 'imgpath' : 'img/' // directory with calendar images
 14+}
 15+// date parsing function
 16+function f_tcalParseDate (s_date) {
 17+
 18+ var re_date = /^\s*(\d{1,2})\-(\d{1,2})\-(\d{2,4})\s*$/;
 19+ if (!re_date.exec(s_date))
 20+ return alert ("Invalid date: '" + s_date + "'.\nAccepted format is dd-mm-yyyy.")
 21+ var n_day = Number(RegExp.$1),
 22+ n_month = Number(RegExp.$2),
 23+ n_year = Number(RegExp.$3);
 24+
 25+ if (n_year < 100)
 26+ n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
 27+ if (n_month < 1 || n_month > 12)
 28+ return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
 29+ var d_numdays = new Date(n_year, n_month, 0);
 30+ if (n_day > d_numdays.getDate())
 31+ return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
 32+
 33+ return new Date (n_year, n_month - 1, n_day);
 34+}
 35+// date generating function
 36+function f_tcalGenerDate (d_date) {
 37+ return (
 38+ (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "-"
 39+ + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-"
 40+ + d_date.getFullYear()
 41+ );
 42+}
 43+
 44+// implementation
 45+function tcal (a_cfg, a_tpl) {
 46+
 47+ // apply default template if not specified
 48+ if (!a_tpl)
 49+ a_tpl = A_TCALDEF;
 50+
 51+ // register in global collections
 52+ if (!window.A_TCALS)
 53+ window.A_TCALS = [];
 54+ if (!window.A_TCALSIDX)
 55+ window.A_TCALSIDX = [];
 56+
 57+ this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
 58+ window.A_TCALS[this.s_id] = this;
 59+ window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
 60+
 61+ // assign methods
 62+ this.f_show = f_tcalShow;
 63+ this.f_hide = f_tcalHide;
 64+ this.f_toggle = f_tcalToggle;
 65+ this.f_update = f_tcalUpdate;
 66+ this.f_relDate = f_tcalRelDate;
 67+ this.f_parseDate = f_tcalParseDate;
 68+ this.f_generDate = f_tcalGenerDate;
 69+
 70+ // create calendar icon
 71+ this.s_iconId = 'tcalico_' + this.s_id;
 72+ this.e_icon = f_getElement(this.s_iconId);
 73+ if (!this.e_icon) {
 74+ document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
 75+ this.e_icon = f_getElement(this.s_iconId);
 76+ }
 77+ // save received parameters
 78+ this.a_cfg = a_cfg;
 79+ this.a_tpl = a_tpl;
 80+}
 81+
 82+function f_tcalShow (d_date) {
 83+
 84+ // find input field
 85+ if (!this.a_cfg.controlname)
 86+ throw("TC: control name is not specified");
 87+ if (this.a_cfg.formname) {
 88+ var e_form = document.forms[this.a_cfg.formname];
 89+ if (!e_form)
 90+ throw("TC: form '" + this.a_cfg.formname + "' can not be found");
 91+ this.e_input = e_form.elements[this.a_cfg.controlname];
 92+ }
 93+ else
 94+ this.e_input = f_getElement(this.a_cfg.controlname);
 95+
 96+ if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
 97+ throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
 98+ + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
 99+
 100+ // dynamically create HTML elements if needed
 101+ this.e_div = f_getElement('tcal');
 102+ if (!this.e_div) {
 103+ this.e_div = document.createElement("DIV");
 104+ this.e_div.id = 'tcal';
 105+ document.body.appendChild(this.e_div);
 106+ }
 107+ this.e_shade = f_getElement('tcalShade');
 108+ if (!this.e_shade) {
 109+ this.e_shade = document.createElement("DIV");
 110+ this.e_shade.id = 'tcalShade';
 111+ document.body.appendChild(this.e_shade);
 112+ }
 113+ this.e_iframe = f_getElement('tcalIF')
 114+ if (b_ieFix && !this.e_iframe) {
 115+ this.e_iframe = document.createElement("IFRAME");
 116+ this.e_iframe.style.filter = 'alpha(opacity=0)';
 117+ this.e_iframe.id = 'tcalIF';
 118+ this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
 119+ document.body.appendChild(this.e_iframe);
 120+ }
 121+
 122+ // hide all calendars
 123+ f_tcalHideAll();
 124+
 125+ // generate HTML and show calendar
 126+ this.e_icon = f_getElement(this.s_iconId);
 127+ if (!this.f_update())
 128+ return;
 129+
 130+ this.e_div.style.visibility = 'visible';
 131+ this.e_shade.style.visibility = 'visible';
 132+ if (this.e_iframe)
 133+ this.e_iframe.style.visibility = 'visible';
 134+
 135+ // change icon and status
 136+ this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
 137+ this.e_icon.title = 'Close Calendar';
 138+ this.b_visible = true;
 139+}
 140+
 141+function f_tcalHide (n_date) {
 142+ if (n_date)
 143+ this.e_input.value = this.f_generDate(new Date(n_date));
 144+
 145+ // no action if not visible
 146+ if (!this.b_visible)
 147+ return;
 148+
 149+ // hide elements
 150+ if (this.e_iframe)
 151+ this.e_iframe.style.visibility = 'hidden';
 152+ if (this.e_shade)
 153+ this.e_shade.style.visibility = 'hidden';
 154+ this.e_div.style.visibility = 'hidden';
 155+
 156+ // change icon and status
 157+ this.e_icon = f_getElement(this.s_iconId);
 158+ this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
 159+ this.e_icon.title = 'Open Calendar';
 160+ this.b_visible = false;
 161+}
 162+
 163+function f_tcalToggle () {
 164+ return this.b_visible ? this.f_hide() : this.f_show();
 165+}
 166+
 167+function f_tcalUpdate (d_date) {
 168+
 169+ var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
 170+ var d_selected = this.e_input.value == ''
 171+ ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
 172+ : this.f_parseDate(this.e_input.value);
 173+
 174+ // figure out date to display
 175+ if (!d_date)
 176+ // selected by default
 177+ d_date = d_selected;
 178+ else if (typeof(d_date) == 'number')
 179+ // get from number
 180+ d_date = f_tcalResetTime(new Date(d_date));
 181+ else if (typeof(d_date) == 'string')
 182+ // parse from string
 183+ this.f_parseDate(d_date);
 184+
 185+ if (!d_date) return false;
 186+
 187+ // first date to display
 188+ var d_firstday = new Date(d_date);
 189+ d_firstday.setDate(1);
 190+ d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
 191+
 192+ var a_class, s_html = '<table class="ctrl"><tbody><tr>'
 193+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
 194+ + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
 195+ + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
 196+ + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
 197+ + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
 198+ + '</tr></tbody></table><table><tbody><tr class="wd">';
 199+
 200+ // print weekdays titles
 201+ for (var i = 0; i < 7; i++)
 202+ s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
 203+ s_html += '</tr>' ;
 204+
 205+ // print calendar table
 206+ var n_date, n_month, d_current = new Date(d_firstday);
 207+ while (d_current.getMonth() == d_date.getMonth() ||
 208+ d_current.getMonth() == d_firstday.getMonth()) {
 209+
 210+ // print row heder
 211+ s_html +='<tr>';
 212+ for (var n_wday = 0; n_wday < 7; n_wday++) {
 213+
 214+ a_class = [];
 215+ n_date = d_current.getDate();
 216+ n_month = d_current.getMonth();
 217+
 218+ // other month
 219+ if (d_current.getMonth() != d_date.getMonth())
 220+ a_class[a_class.length] = 'othermonth';
 221+ // weekend
 222+ if (d_current.getDay() == 0 || d_current.getDay() == 6)
 223+ a_class[a_class.length] = 'weekend';
 224+ // today
 225+ if (d_current.valueOf() == d_today.valueOf())
 226+ a_class[a_class.length] = 'today';
 227+ // selected
 228+ if (d_current.valueOf() == d_selected.valueOf())
 229+ a_class[a_class.length] = 'selected';
 230+
 231+ s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
 232+
 233+ d_current.setDate(++n_date);
 234+ while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
 235+ d_current.setHours(d_current.getHours + 1);
 236+ d_current = f_tcalResetTime(d_current);
 237+ }
 238+ }
 239+ // print row footer
 240+ s_html +='</tr>';
 241+ }
 242+ s_html +='</tbody></table>';
 243+
 244+ // update HTML, positions and sizes
 245+ this.e_div.innerHTML = s_html;
 246+
 247+ var n_width = this.e_div.offsetWidth;
 248+ var n_height = this.e_div.offsetHeight;
 249+ var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
 250+ var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
 251+ if (n_left < 0) n_left = 0;
 252+
 253+ this.e_div.style.left = n_left + 'px';
 254+ this.e_div.style.top = n_top + 'px';
 255+
 256+ this.e_shade.style.width = (n_width + 8) + 'px';
 257+ this.e_shade.style.left = (n_left - 1) + 'px';
 258+ this.e_shade.style.top = (n_top - 1) + 'px';
 259+ this.e_shade.innerHTML = b_ieFix
 260+ ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
 261+ : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
 262+
 263+ if (this.e_iframe) {
 264+ this.e_iframe.style.left = n_left + 'px';
 265+ this.e_iframe.style.top = n_top + 'px';
 266+ this.e_iframe.style.width = (n_width + 6) + 'px';
 267+ this.e_iframe.style.height = (n_height + 6) +'px';
 268+ }
 269+ return true;
 270+}
 271+
 272+function f_getPosition (e_elemRef, s_coord) {
 273+ var n_pos = 0, n_offset,
 274+ e_elem = e_elemRef;
 275+
 276+ while (e_elem) {
 277+ n_offset = e_elem["offset" + s_coord];
 278+ n_pos += n_offset;
 279+ e_elem = e_elem.offsetParent;
 280+ }
 281+ // margin correction in some browsers
 282+ if (b_ieMac)
 283+ n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
 284+ else if (b_safari)
 285+ n_pos -= n_offset;
 286+
 287+ e_elem = e_elemRef;
 288+ while (e_elem != document.body) {
 289+ n_offset = e_elem["scroll" + s_coord];
 290+ if (n_offset && e_elem.style.overflow == 'scroll')
 291+ n_pos -= n_offset;
 292+ e_elem = e_elem.parentNode;
 293+ }
 294+ return n_pos;
 295+}
 296+
 297+function f_tcalRelDate (d_date, d_diff, s_units) {
 298+ var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
 299+ var d_result = new Date(d_date);
 300+ d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
 301+ if (d_result.getDate() != d_date.getDate())
 302+ d_result.setDate(0);
 303+ return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
 304+}
 305+
 306+function f_tcalHideAll () {
 307+ for (var i = 0; i < window.A_TCALSIDX.length; i++)
 308+ window.A_TCALSIDX[i].f_hide();
 309+}
 310+
 311+function f_tcalResetTime (d_date) {
 312+ d_date.setHours(0);
 313+ d_date.setMinutes(0);
 314+ d_date.setSeconds(0);
 315+ d_date.setMilliseconds(0);
 316+ return d_date;
 317+}
 318+
 319+f_getElement = document.all ?
 320+ function (s_id) { return document.all[s_id] } :
 321+ function (s_id) { return document.getElementById(s_id) };
 322+
 323+if (document.addEventListener)
 324+ window.addEventListener('scroll', f_tcalHideAll, false);
 325+if (window.attachEvent)
 326+ window.attachEvent('onscroll', f_tcalHideAll);
 327+
 328+// global variables
 329+var s_userAgent = navigator.userAgent.toLowerCase(),
 330+ re_webkit = /WebKit\/(\d+)/i;
 331+var b_mac = s_userAgent.indexOf('mac') != -1,
 332+ b_ie5 = s_userAgent.indexOf('msie 5') != -1,
 333+ b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
 334+var b_ieFix = b_ie5 || b_ie6,
 335+ b_ieMac = b_mac && b_ie5,
 336+ b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;
Property changes on: trunk/extensions/SemanticProjectManagement/libs/calendar/calendar_eu.js
___________________________________________________________________
Added: svn:eol-style
337337 + native
Property changes on: trunk/extensions/SemanticProjectManagement/libs/jscolor/jscolor.js
___________________________________________________________________
Added: svn:eol-style
338338 + native
Property changes on: trunk/extensions/SemanticProjectManagement/README
___________________________________________________________________
Added: svn:eol-style
339339 + native
Property changes on: trunk/extensions/SemanticProjectManagement/SemanticProjectManagement.php
___________________________________________________________________
Added: svn:eol-style
340340 + native
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter7.php
___________________________________________________________________
Added: svn:eol-style
341341 + native
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter7.css
___________________________________________________________________
Added: svn:eol-style
342342 + native
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/demo.html
___________________________________________________________________
Added: svn:eol-style
343343 + native
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
___________________________________________________________________
Added: svn:eol-style
344344 + native
Property changes on: trunk/extensions/SVGEdit/svg-edit/svg-editor.html
___________________________________________________________________
Deleted: svn:mime-type
345345 - text/html
Added: svn:eol-style
346346 + native

Status & tagging log