diff --git a/htdocs/includes/jsgantt/jsgantt.css b/htdocs/includes/jsgantt/jsgantt.css index 7acf9318347..78a7e83e971 100644 --- a/htdocs/includes/jsgantt/jsgantt.css +++ b/htdocs/includes/jsgantt/jsgantt.css @@ -1,53 +1,242 @@ +/* Sample CSS for jsGanttImproved v1.7.3 */ +div.gantt { font-family:tahoma, arial, verdana, Sans-serif; font-size:10px; color: #2F2F2F; } -// 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. +.gantt table { border-collapse: collapse; } +.gantt td { padding: 0px; } -// 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 +/* cell defaults */ +.gmajorheading, +.gminorheading, +.gminorheadingwkend, +.gtaskcell, +.gtaskcellwkend { height: 19px; font-size: 12px; border: #efefef 1px solid; text-align: center; cursor: default } +.gtasklist { height: 19px; min-width: 5px; max-width: 5px; width: 5px; border: #efefef 1px solid; border-right: none; } /* all three width values set just to make sure - helps resizing code */ -// make alot of the code look simpleer/cleaner without all the embedded styles +/* Additional values for some cell elements */ +.gtaskheading, +.gmajorheading, +.gminorheading { background-color: #ffffff; font-weight: bold; font-size: 9px; white-space: nowrap; } +.gtaskcellwkend, +.gminorheadingwkend { background-color: #f7f7f7; font-weight: bold; font-size: 9px; white-space: nowrap; } +td.gtaskcell { text-align: left } +td.gspanning { border-left: none; border-right: none; } +.gtaskcelldiv { position: relative; } + +/* Task list defaults */ +.gtaskheading, +.gname, +.gtaskname, +.gresource, +.gduration, +.gpccomplete, +.gstartdate, +.genddate { height: 18px; white-space: nowrap; border: #efefef 1px solid; } + +/* Additional values for some task list elements */ +.gresource, +.gduration, +.gpccomplete, +.gstartdate div, /* needed for IE8 */ +.gstartdate { text-align: center; min-width: 70px; max-width: 70px; width: 70px; font-size: 10px; } +.genddate div, /* needed for IE8 */ +.genddate { text-align: center; min-width: 70px; max-width: 70px; width: 70px; font-size: 10px; } +.gtaskheading { text-align: center; } +.gtaskname div, /* needed for IE8 */ +.gtaskname { min-width: 170px; max-width: 170px; width: 170px;/* font-size: 9px;*/ border-left: none; } + +.gselector { text-align: left; white-space: nowrap; min-width: 170px; max-width: 170px; width: 170px; } + +.gformlabel { position:relative; top:0px; cursor:pointer; border: #ffffff 1px solid; margin-left: 2px; padding-left: 2px; padding-right: 2px; } +span.gformlabel:hover, +span.gselected { background-color: #dbecff; border: #cccccc 1px solid;} + +span.gfoldercollapse { color:#000000; cursor:pointer; font-weight:bold; font-size: 12px; font-family: Courier, "Courier New", monospace; } + +.gtasktableh, +.gtasktable { border-right: #efefef 1px solid; } +.gcharttable { border: #efefef 1px solid; } /* for some reason firefox needs this */ + +/* Differentiate Group, Milestone and Ordinary task items (applied to row) */ +.ggroupitem { background-color: #fbfbfb; font-weight: bold; } +.gmileitem, +.glineitem { background-color: #ffffff; } + +/* highlight row (applied to row) */ +.gitemhighlight td { background-image: none; background-color: #fffaaa;} + +/* task bar caption text styles */ +.gmilecaption, +.ggroupcaption, +.gcaption { font-weight: normal; font-size: 9px; text-align: left; white-space: nowrap; top:1px; position: absolute; top:2px; } + +.ggroupcaption, +.gcaption { right: -126px; } + +/* Task complete %age bar shared attributes */ +.gtaskcomplete { float:left; overflow: hidden; } + +/* Task complete %age bar */ +.gtaskcomplete { height:5px; background-color:#000000; margin-top:4px; opacity:0.4; filter: alpha(opacity=40); } + +/* Milestones */ +.gmilestone { font-size: 14px; position: absolute; top: -2px; } +.gmdtop { top: 2px; overflow: hidden; width:0px; height:0px; border-bottom: 5px solid black; border-left: 5px solid transparent; border-top: 5px solid transparent; border-right: 5px solid transparent;} +.gmdbottom { top: 2px; overflow: hidden; width:0px; height:0px; border-top: 5px solid black; border-left: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid transparent;} + +/* Task bar shared attributes */ +.ggroupblack, +.gtaskblue, +.gtaskred, +.gtaskgreen, +.gtaskyellow, +.gtaskpurple, +.gtaskpink { height: 13px; filter: alpha(opacity=90); opacity:0.9; margin-top: 1px; } + +/* Task bars - ggroupblack is set as the default class on the task if it is undefined */ +.ggroupblack { height: 7px; background: #000000; margin-top: 2px; } +.ggroupblackendpointleft { overflow: hidden; width:0px; height:0px; top: 2px; border-top: 4px solid black; border-left: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 4px solid transparent; float: left; } +.ggroupblackendpointright { overflow: hidden; width:0px; height:0px; top: 2px; border-top: 4px solid black; border-left: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 4px solid transparent; float: right; } +.ggroupblackcomplete { float:left; overflow: hidden; height:3px; filter: alpha(opacity=80); opacity:0.8; background-color:#777777; margin-top:2px; margin-bottom: 2px; } +.gtaskblue { + background: rgb(58,132,195); /* Old browsers */ + background: linear-gradient(to bottom, rgba(58,132,195,1) 0%,rgba(65,154,214,1) 20%,rgba(75,184,240,1) 40%,rgba(58,139,194,1) 70%,rgba(38,85,139,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4bb8f0', endColorstr='#3a84c3',GradientType=0 ); /* IE6-9 */ +} +.gtaskred { + background: rgb(196,58,58); /* Old browsers */ + background: linear-gradient(to bottom, rgba(196,58,58,1) 0%,rgba(211,65,65,1) 20%,rgba(239,76,76,1) 40%,rgba(196,58,58,1) 70%,rgba(135,37,37,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ef4c4c', endColorstr='#c43a3a',GradientType=0 ); /* IE6-9 */ +} +.gtaskgreen { + background: rgb(80,193,58); /* Old browsers */ + background: linear-gradient(to bottom, rgba(80,193,58,1) 0%,rgba(88,209,64,1) 20%,rgba(102,237,75,1) 40%,rgba(80,193,58,1) 70%,rgba(53,132,37,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#66ED4B', endColorstr='#50c13a',GradientType=0 ); /* IE6-9 */ +} +.gtaskyellow { + background: rgb(247,228,56); /* Old browsers */ + background: linear-gradient(to bottom, rgba(247,228,56,1) 0%,rgba(239,239,55,1) 20%,rgba(255,255,58,1) 40%,rgba(242,236,55,1) 70%,rgba(241,218,54,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff3a', endColorstr='#f7e438',GradientType=0 ); /* IE6-9 */ +} +.gtaskpurple { + background: rgb(193,58,193); /* Old browsers */ + background: linear-gradient(to bottom, rgba(193,58,193,1) 0%,rgba(211,65,211,1) 20%,rgba(239,76,239,1) 40%,rgba(193,58,193,1) 70%,rgba(137,38,137,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ef4cef', endColorstr='#892689',GradientType=0 ); /* IE6-9 */ +} +.gtaskpink { + background: rgb(249,177,245); /* Old browsers */ + background: linear-gradient(to bottom, rgba(249,177,245,1) 0%,rgba(247,192,243,1) 20%,rgba(247,202,244,1) 40%,rgba(249,192,246,1) 70%,rgba(252,174,247,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7caf4', endColorstr='#fcaef7',GradientType=0 ); /* IE6-9 */ +} +.gtaskbluecomplete, +.gtaskredcomplete, +.gtaskgreencomplete, +.gtaskyellowcomplete, +.gtaskpurplecomplete, +.gtaskpinkcomplete { float:left; overflow: hidden; height:5px; filter: alpha(opacity=40); opacity:0.4; background-color: #000000; margin-top:4px; } + +/* Printer friendly styles - we could use these all the time but they are not as pretty! */ +/* note that "@media print" is not supported in IE6 or 7. Fully patched IE8 should be OK */ +@media print { + .ggroupblack { height:0px; border-top: 7px solid; border-color: #000000; } + .gtaskblue { height:0px; border-top: 13px solid; border-color: rgb(58,132,195); } + .gtaskred { height:0px; border-top: 13px solid; border-color: rgb(196,58,58); } + .gtaskgreen { height:0px; border-top: 13px solid; border-color: rgb(80,193,58); } + .gtaskyellow { height:0px; border-top: 13px solid; border-color: rgb(247,228,56); } + .gtaskpurple { height:0px; border-top: 13px solid; border-color: rgb(193,58,193); } + .gtaskpink { height:0px; border-top: 13px solid; border-color: rgb(249,177,245); } + + .gtaskbluecomplete, + .gtaskredcomplete, + .gtaskgreencomplete, + .gtaskyellowcomplete, + .gtaskpurplecomplete, + .gtaskpinkcomplete { height:0px; filter: alpha(opacity=40); opacity:0.4; margin-top: -9px; border-top: 5px solid; border-color: #000000; } + .ggroupblackcomplete { height: 0px; filter: alpha(opacity=80); opacity:0.8; margin-top:-5px; border-top:3px solid; border-color:#777777; } +} + +/* END Task bar styles */ +.glinev { border-left: 1px solid; width: 0px; } +.glineh { border-top: 1px solid; height: 0px; } + +.gDepFS, +.gDepSS, +.gDepSF, +.gDepFF { border-color: #26558b; } +.gDepFSArw, +.gDepSSArw { overflow: hidden; width:0px; height:0px; border-bottom: 4px solid transparent; border-left: 4px solid #26558b; border-top: 4px solid transparent; border-right: 4px solid transparent;} +.gDepFFArw, +.gDepSFArw { overflow: hidden; width:0px; height:0px; border-bottom: 4px solid transparent; border-left: 4px solid transparent; border-top: 4px solid transparent; border-right: 4px solid #26558b;} +.gCurDate { border-color: #0000ff; } +div.gtaskbarcontainer { z-index: 1; position: absolute; top: 0px } -..gantt { font-family:tahoma, arial, verdana; font-size:10px;} +.JSGanttToolTip {position: absolute; display: block; z-index: 2;} +.JSGanttToolTipcont {font-family: tahoma, arial, verdana; font-size: 10px; display: block; background: #ffffff; color: #656565} +.gTaskInfo {background: #dbecff; width: 400px; border: #656565 1px solid; border-radius: 10px; padding: 4px 6px 4px 6px; float: left;} +.gTtTitle {display: block; font-size: 12px; font-weight: bold; color: #404040; margin-left: 4px; margin-bottom: 1em;} +.gTaskLabel {font-size: 11px; font-weight: bold; color: #656565; margin-left: 4px;} +.gTaskText {position:absolute; left: 90px; padding-top: 1px; font-size: 10px; font-weight: normal; color: #656565;} +.gTaskNotes {font-size: 11px; font-weight: normal; color: #323232; padding: 0 15px; display: block;} +.gTIn {padding-top: 10px;} -..gdatehead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; HEIGHT: 18px } +.gantt { min-width: 1064px; /* 2x LC width */ } +.gchartcontainer { padding-left: 532px; /* LC width */ } +.gcontainercol { position: relative; float: left; } /* Add a max-height value here if wanted */ +.glistgrid { width: 532px; /* LC width */ margin-left: -100%; right: 532px; /* LC width */ padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; background-color: #ffffff; overflow: hidden; } +.glistlbl { width: 532px; /* LC width */ margin-left: -100%; right: 532px; /* LC width */ padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; background-color: #ffffff; overflow: hidden; } +.glabelfooter { clear: both; } +.ggridfooter { clear: both; } -..ghead { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px } +/*.rhscrpad { width: 150px; position: absolute; top: 0px; height: 1px; }*/ -..gname { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; WIDTH: 18px; HEIGHT: 18px } +.gchartgrid { width: 100%; padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; background-color: #ffffff; position: relative; overflow: auto; min-height: 0%; } +.gchartlbl { width: 100%; padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; background-color: #ffffff; position: relative; overflow: hidden; } -..ghead A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none } +/* Old Internet Explorer version hacks */ +.gantt { _height: 100% } /* otherwise the chart disappears! */ +div .gantt { _width: 1064px; } /* ie6 fixed width */ +div.gchartlbl, +div.gchartgrid { _width: 532px; } /* ie6 fixed width */ +div.glistlbl, +div.glistgrid { + *right: 0px; /* ie7 pulls the content too far left with the negative margin */ + _right: 532px; /* but ie6 fixed width needs this */ + _margin-left: -532px; /* ie6 fixed width */ +} +div.gchartgrid { *padding-bottom: 20px; *overflow-y: hidden; } /* variable height design, no need for vertical scroll */ +td.gmajorheading div { *overflow: hidden; } /* stops resizing fixed width columns if the text is too wide */ +td.gspanning div { *overflow: hidden; } /* stops resizing fixed width columns if the text is too wide */ -..gheadwkend A { FONT-SIZE: 10px; COLOR: #000000; TEXT-DECORATION: none } +/* border transparency tricks */ +.ggroupblackendpointleft { _border-top: 4px solid black; _border-left: 4px solid pink; _border-bottom: 4px solid pink; _border-right: 4px solid pink; _filter: chroma(color=pink); } +.ggroupblackendpointright { _border-top: 4px solid black; _border-left: 4px solid pink; _border-bottom: 4px solid pink; _border-right: 4px solid pink;_filter: chroma(color=pink); } -..gheadwkend { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #efefef 1px solid; WIDTH: 24px; HEIGHT: 20px; background-color: #cfcfcf } +.gmdtop { _border-left: 5px solid pink; _border-top: 5px solid pink; _border-right: 5px solid pink; _filter: chroma(color=pink);} +.gmdbottom { _border-left: 5px solid pink; _border-bottom: 5px solid pink; _border-right: 5px solid pink; _filter: chroma(color=pink);} -..gfiller { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px } +.gDepFSArw, +.gDepSSArw { _border-bottom: 4px solid pink; _border-top: 4px solid pink; _border-right: 4px solid pink; _filter: chroma(color=pink);} +.gDepFFArw, +.gDepSFArw { _border-bottom: 4px solid pink; _border-left: 4px solid pink; _border-top: 4px solid pink; _filter: chroma(color=pink);} -..gfillerwkend { BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px; BACKGROUND-COLOR: #cfcfcf } - -..gitem { BORDER-TOP: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px } - -..gitemwkend { BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px } - -..gmilestone { BORDER-TOP: #efefef 1px solid; FONT-SIZE: 14px; OVERFLOW: hidden; BORDER-LEFT: #efefef 1px solid; WIDTH: 18px; HEIGHT: 18px} - -..gmilestonewkend { BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #cccccc 1px solid; WIDTH: 18px; HEIGHT: 18px} - -..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 } - -..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 } - -..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 } - -..gweekend { font-family:tahoma, arial, verdana; font-size:11px; background-color:#EEEEEE; text-align:center; } - -..gtask { font-family:tahoma, arial, verdana; font-size:11px; background-color:#00FF00; text-align:center; } - -..gday { font-family:tahoma, arial, verdana; font-size:11px; text-align:center; } - -..gcomplete { background-color:black; height:5px; overflow: auto; margin-top:4px; } - -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 } - -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 } +/* Workaround for odd bug in old versions of Opera - no other browser needs this */ +.glinediv {position: absolute; top: 0px; left: 0px;} +/* if using setUseSingleCell(1) the following is a suggested set of CSS3 styles to recreate the table grid - won't work on old browsers +.ggrouphour td, +.gmilehour td, +.gitemhour td { background-size: 19px 1px; background-image: linear-gradient(to left, #efefef, transparent 1px, transparent 18px); width: 100%; height: 19px; } +.ggroupday td, +.gmileday td, +.gitemday td { background-size: 19px 1px, 133px 1px; background-image: linear-gradient(to left, #efefef, transparent 1px, transparent 18px), linear-gradient(to left, #f7f7f7 39px, transparent 1px, transparent 92px); width: 100%; height: 19px; } +.ggroupweek td, +.gmileweek td, +.gitemweek td { background-size: 37px 1px; background-image: linear-gradient(to left, #efefef, transparent 1px, transparent 36px); width: 100%; height: 19px; } +.ggroupmonth td, +.gmilemonth td, +.gitemmonth td { background-size: 37px 1px; background-image: linear-gradient(to left, #efefef, transparent 1px, transparent 36px); width: 100%; height: 19px; } +.ggroupquarter td, +.gmilequarter td, +.gitemquarter td { background-size: 19px 1px; background-image: linear-gradient(to left, #efefef, transparent 1px, transparent 18px); width: 100%; height: 19px; } +*/ diff --git a/htdocs/includes/jsgantt/jsgantt.js b/htdocs/includes/jsgantt/jsgantt.js index 2447a068bf7..3360d832ec6 100644 --- a/htdocs/includes/jsgantt/jsgantt.js +++ b/htdocs/includes/jsgantt/jsgantt.js @@ -1,2315 +1,2575 @@ /* -Copyright (c) 2009, Shlomy Gantz BlueBrick Inc. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* -* LDR Modified to replace hard coded values by i18[key] -*/ + _ ___ _____ _ _____ ____ ____ + (_) / _ \ \_ \ / ||___ | ___| |___ \ + | |/ /_\/ / /\/ | | / /|___ \ __) | + | / /_\\/\/ /_ | |_ / /_ ___) | / __/ + _/ \____/\____/ |_(_)_/(_)____(_)_____| + |__/ + jsGanttImproved 1.7.5.2 + Copyright (c) 2013-2016, Paul Geldart All rights reserved. -/** -* JSGantt component is a UI control that displays gantt charts based by using CSS and HTML -* @module jsgantt -* @title JSGantt -*/ + The current version of this code can be found at https://code.google.com/p/jsgantt-improved/ -var JSGantt; if (!JSGantt) JSGantt = {}; + * Copyright (c) 2013-2016, Paul Geldart. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Paul Geldart nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY PAUL GELDART. ''AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL PAUL GELDART BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -var vTimeout = 0; -var vBenchTime = new Date().getTime(); + This project is based on jsGantt 1.2, (which can be obtained from + https://code.google.com/p/jsgantt/) and remains under the original BSD license. + The original project license follows: -/** -* Creates a task (one row) in gantt object -* @class TaskItem -* @namespace JSGantt -* @constructor -* @for JSGantt + Copyright (c) 2009, Shlomy Gantz BlueBrick Inc. All rights reserved. -* @param pID {Number} Task unique numeric ID -* @param pName {String} Task Name -* @param pStart {Date} Task start date/time (not required for pGroup=1 ) -* @param pEnd {Date} Task end date/time, you can set the end time to 12:00 to indicate half-day (not required for pGroup=1 ) -* @param pColor {String} Task bar RGB value -* @param pLink {String} Task URL, clicking on the task will redirect to this url. Leave empty if you do not with the Task also serve as a link -* @param pMile {Boolean} Determines whether task is a milestone (1=Yes,0=No) -* @param pRes {String} Resource to perform the task -* @param pComp {Number} Percent complete (Number between 0 and 100) -* @param pGroup {Boolean} -* @param pParent {Number} ID of the parent task -* @param pOpen {Boolean} -* @param pDepend {String} Comma seperated list of IDs this task depends on -* @param pCaption {String} Caption to be used instead of default caption (Resource). -* note : you should use setCaption("Caption") in order to display the caption -* @return void -*/ -JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Shlomy Gantz or BlueBrick Inc. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY SHLOMY GANTZ/BLUEBRICK INC. ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL SHLOMY GANTZ/BLUEBRICK INC. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var JSGantt; if (!JSGantt) JSGantt={}; + +var vBenchTime=new Date().getTime(); + +JSGantt.isIE=function () { - -/** -* The name of the attribute. -* @property vID -* @type String -* @default pID -* @private -*/ -var vID = pID; - -/** -* @property vName -* @type String -* @default pName -* @private -*/ -var vName = pName; - -/** -* @property vStart -* @type Datetime -* @default new Date() -* @private -*/ -var vStart = new Date(); - -/** -* @property vEnd -* @type Datetime -* @default new Date() -* @private -*/ -var vEnd = new Date(); - -/** -* @property vColor -* @type String -* @default pColor -* @private -*/ -var vColor = pColor; - -/** -* @property vLink -* @type String -* @default pLink -* @private -*/ -var vLink = pLink; - -/** -* @property vMile -* @type Boolean -* @default pMile -* @private -*/ -var vMile = pMile; - -/** -* @property vRes -* @type String -* @default pRes -* @private -*/ -var vRes = pRes; - -/** -* @property vComp -* @type Number -* @default pComp -* @private -*/ -var vComp = pComp; - -/** -* @property vGroup -* @type Boolean -* @default pGroup -* @private -*/ -var vGroup = pGroup; - -/** -* @property vParent -* @type Number -* @default pParent -* @private -*/ -var vParent = pParent; - -/** -* @property vOpen -* @type Boolean -* @default pOpen -* @private -*/ -var vOpen = pOpen; - -/** -* @property vDepend -* @type String -* @default pDepend -* @private -*/ -var vDepend = pDepend; - -/** -* @property vCaption -* @type String -* @default pCaption -* @private -*/ -var vCaption = pCaption; - -/** -* @property vDuration -* @type Number -* @default '' -* @private -*/ -var vDuration = ''; - -/** -* @property vLevel -* @type Number -* @default 0 -* @private -*/ -var vLevel = 0; - -/** -* @property vNumKid -* @type Number -* @default 0 -* @private -*/ -var vNumKid = 0; - -/** -* @property vVisible -* @type Boolean -* @default 0 -* @private -*/ -var vVisible = 1; - var x1, y1, x2, y2; - - - if (vGroup != 1) - { - vStart = JSGantt.parseDateStr(pStart,g.getDateInputFormat()); - vEnd = JSGantt.parseDateStr(pEnd,g.getDateInputFormat()); - } -/** -* Returns task ID -* @method getID -* @return {Number} -*/ - this.getID = function(){ return vID }; -/** -* Returns task name -* @method getName -* @return {String} -*/ - this.getName = function(){ return vName }; -/** -* Returns task start date -* @method getStart -* @return {Datetime} -*/ - this.getStart = function(){ return vStart}; -/** -* Returns task end date -* @method getEnd -* @return {Datetime} -*/ this.getEnd = function(){ return vEnd }; - -/** -* Returns task bar color (i.e. 00FF00) -* @method getColor -* @return {String} -*/ this.getColor = function(){ return vColor}; - -/** -* Returns task URL (i.e. http://www.jsgantt.com) -* @method getLink -* @return {String} -*/ this.getLink = function(){ return vLink }; - -/** -* Returns whether task is a milestone (1=Yes,0=No) -* @method getMile -* @return {Boolean} -*/ this.getMile = function(){ return vMile }; - -/** -* Returns task dependencies as list of values (i.e. 123,122) -* @method getDepend -* @return {String} -*/ this.getDepend = function(){ if(vDepend) return vDepend; else return null }; - -/** -* Returns task caption (if it exists) -* @method getCaption -* @return {String} -*/ this.getCaption = function(){ if(vCaption) return vCaption; else return ''; }; - -/** -* Returns task resource name as string -* @method getResource -* @return {String} -*/ this.getResource = function(){ if(vRes) return vRes; else return ' '; }; - -/** -* Returns task completion percent as numeric value -* @method getCompVal -* @return {Boolean} -*/ this.getCompVal = function(){ if(vComp) return vComp; else return 0; }; - -/** -* Returns task completion percent as formatted string (##%) -* @method getCompStr -* @return {String} -*/ this.getCompStr = function(){ if(vComp) return vComp+'%'; else return ''; }; - -/** -* Returns task duration as a fortmatted string based on the current selected format -* @method getDuration -* @param vFormat {String} selected format (minute,hour,day,week,month) -* @return {String} -*/ this.getDuration = function(vFormat){ - if (vMile) - vDuration = '-'; - else if (vFormat=='hour') - { - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 60 * 1000) ); - if(tmpPer == 1) - vDuration = '1 '+i18n["sHour"]; - else - vDuration = tmpPer + ' '+i18n["sHours"]; - } - - else if (vFormat=='minute') - { - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / ( 60 * 1000) ); - if(tmpPer == 1) - vDuration = '1 '+i18n["sMinute"]; - else - vDuration = tmpPer + ' '+i18n["sMinutes"]; - } - - else { //if(vFormat == 'day') { - tmpPer = Math.ceil((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1); - if(tmpPer == 1) vDuration = '1 '+i18n["sDay"]; - else vDuration = tmpPer + ' '+i18n["sDays"]; - } - - //else if(vFormat == 'week') { - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/7; - // if(tmpPer == 1) vDuration = '1 Week'; - // else vDuration = tmpPer + ' Weeks'; - //} - - //else if(vFormat == 'month') { - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/30; - // if(tmpPer == 1) vDuration = '1 Month'; - // else vDuration = tmpPer + ' Months'; - //} - - //else if(vFormat == 'quater') { - // tmpPer = ((this.getEnd() - this.getStart()) / (24 * 60 * 60 * 1000) + 1)/120; - // if(tmpPer == 1) vDuration = '1 Qtr'; - // else vDuration = tmpPer + ' Qtrs'; - //} - return( vDuration ) - }; - -/** -* Returns task parent ID -* @method getParent -* @return {Number} -*/ this.getParent = function(){ return vParent }; - -/** -* Returns whether task is a group (1=Yes,0=No) -* @method getGroup -* @return {Number} -*/ this.getGroup = function(){ return vGroup }; - -/** -* Returns whether task is open (1=Yes,0=No) -* @method getOpen -* @return {Boolean} -*/ this.getOpen = function(){ return vOpen }; - -/** -* Returns task tree level (0,1,2,3...) -* @method getLevel -* @return {Boolean} -*/ this.getLevel = function(){ return vLevel }; - -/** -* Returns the number of child tasks -* @method getNumKids -* @return {Number} -*/ this.getNumKids = function(){ return vNumKid }; - /** -* Returns the X position of the left side of the task bar on the graph (right side) -* @method getStartX -* @return {Number} -*/ this.getStartX = function(){ return x1 }; - -/** -* Returns the Y position of the top of the task bar on the graph (right side) -* @method getStartY -* @return {Number} -*/ this.getStartY = function(){ return y1 }; - -/** -* Returns the X position of the right of the task bar on the graph (right side) -* @method getEndX -* @return {Int} -*/ this.getEndX = function(){ return x2 }; - -/** -* Returns the Y position of the bottom of the task bar on the graph (right side) -* @method getEndY -* @return {Number} -*/ this.getEndY = function(){ return y2 }; - -/** -* Returns whether task is visible (1=Yes,0=No) -* @method getVisible -* @return {Boolean} -*/ this.getVisible = function(){ return vVisible }; - -/** -* Set task dependencies -* @method setDepend -* @param pDepend {String} A comma delimited list of task IDs the current task depends on. -* @return {void} -*/ this.setDepend = function(pDepend){ vDepend = pDepend;}; - -/** -* Set task start date/time -* @method setStart -* @param pStart {Datetime} -* @return {void} -*/ this.setStart = function(pStart){ vStart = pStart;}; - -/** -* Set task end date/time -* @method setEnd -* @param pEnd {Datetime} -* @return {void} -*/ this.setEnd = function(pEnd) { vEnd = pEnd; }; - -/** -* Set task tree level (0,1,2,3...) -* @method setLevel -* @param pLevel {Number} -* @return {void} -*/ this.setLevel = function(pLevel){ vLevel = pLevel;}; - -/** -* Set Number of children for the task -* @method setNumKid -* @param pNumKid {Number} -* @return {void} -*/ this.setNumKid = function(pNumKid){ vNumKid = pNumKid;}; - -/** -* Set task completion percentage -* @method setCompVal -* @param pCompVal {Number} -* @return {void} -*/ this.setCompVal = function(pCompVal){ vComp = pCompVal;}; - -/** -* Set a task bar starting position (left) -* @method setStartX -* @param pX {Number} -* @return {void} -*/ this.setStartX = function(pX) {x1 = pX; }; - -/** -* Set a task bar starting position (top) -* @method setStartY -* @param pY {Number} -* @return {String} -*/ this.setStartY = function(pY) {y1 = pY; }; - -/** -* Set a task bar starting position (right) -* @method setEndX -* @param pX {Number} -* @return {String} -*/ this.setEndX = function(pX) {x2 = pX; }; - -/** -* Set a task bar starting position (bottom) -* @method setEndY -* @param pY {Number} -* @return {String} -*/ this.setEndY = function(pY) {y2 = pY; }; - -/** -* Set task open/closed -* @method setOpen -* @param pOpen {Boolean} -* @return {void} -*/ this.setOpen = function(pOpen) {vOpen = pOpen; }; - -/** -* Set task visibility -* @method setVisible -* @param pVisible {Boolean} -* @return {void} -*/ this.setVisible = function(pVisible) {vVisible = pVisible; }; - + if(typeof document.all!='undefined') + { + if ('pageXOffset' in window) return false; // give IE9 and above the benefit of the doubt! + else return true; + } + else return false; }; - - -/** -* Creates the gant chart. for example: -
var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');
- -var g = new JSGantt.GanttChart( - assign the gantt chart to a javascript variable called 'g' -'g' - the name of the variable that was just assigned (will be used later so that gantt object can reference itself) -document.getElementById('GanttChartDIV') - reference to the DIV that will hold the gantt chart -'day' - default format will be by day - -* -* @class GanttChart -* @param pGanttVar {String} the name of the gantt chart variable -* @param pDiv {String} reference to the DIV that will hold the gantt chart -* @param pFormat {String} default format (minute,hour,day,week,month,quarter) -* @return void -*/ - -JSGantt.GanttChart = function(pGanttVar, pDiv, pFormat) +JSGantt.TaskItem=function(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt) { -/** -* The name of the gantt chart variable -* @property vGanttVar -* @type String -* @default pGanttVar -* @private -*/ var vGanttVar = pGanttVar; -/** -* The name of the gantt chart DIV -* @property vDiv -* @type String -* @default pDiv -* @private -*/ var vDiv = pDiv; -/** -* Selected format (minute,hour,day,week,month) -* @property vFormat -* @type String -* @default pFormat -* @private -*/ var vFormat = pFormat; -/** -* Show resource column -* @property vShowRes -* @type Number -* @default 1 -* @private -*/ var vShowRes = 1; -/** -* Show duration column -* @property vShowDur -* @type Number -* @default 1 -* @private -*/ var vShowDur = 1; -/** -* Show percent complete column -* @property vShowComp -* @type Number -* @default 1 -* @private -*/ var vShowComp = 1; -/** -* Show start date column -* @property vShowStartDate -* @type Number -* @default 1 -* @private -*/ var vShowStartDate = 1; -/** -* Show end date column -* @property vShowEndDate -* @type Number -* @default 1 -* @private -*/ var vShowEndDate = 1; -/** -* Date input format -* @property vDateInputFormat -* @type String -* @default "mm/dd/yyyy" -* @private -*/var vDateInputFormat = "mm/dd/yyyy"; -/** -* Date display format -* @property vDateDisplayFormat -* @type String -* @default "mm/dd/yy" -* @private -*/var vDateDisplayFormat = "mm/dd/yy"; - var vNumUnits = 0; - var vCaptionType; - var vDepId = 1; - var vTaskList = new Array(); - var vFormatArr = new Array("day","week","month","quarter"); - var vQuarterArr = new Array(1,1,1,2,2,2,3,3,3,4,4,4); - var vMonthDaysArr = new Array(31,28,31,30,31,30,31,31,30,31,30,31); - var vMonthArr = new Array(i18n["January"],i18n["February"],i18n["March"],i18n["April"],i18n["May"],i18n["June"],i18n["July"],i18n["August"],i18n["September"],i18n["October"],i18n["November"],i18n["December"]); + var vID=parseInt(document.createTextNode(pID).data); + var vName=document.createTextNode(pName).data; + var vStart=new Date(0); + var vEnd=new Date(0); + var vGroupMinStart=null; + var vGroupMinEnd=null; + var vClass=document.createTextNode(pClass).data; + var vLink=document.createTextNode(pLink).data; + var vMile=parseInt(document.createTextNode(pMile).data); + var vRes=document.createTextNode(pRes).data; + var vComp=parseFloat(document.createTextNode(pComp).data); + var vGroup=parseInt(document.createTextNode(pGroup).data); + var vParent=document.createTextNode(pParent).data; + var vOpen=(vGroup==2)?1:parseInt(document.createTextNode(pOpen).data); + var vDepend=new Array(); + var vDependType=new Array(); + var vCaption=document.createTextNode(pCaption).data; + var vDuration=''; + var vLevel=0; + var vNumKid=0; + var vVisible=1; + var vSortIdx=0; + var vToDelete=false; + var x1, y1, x2, y2; + var vNotes; + var vParItem=null; + var vCellDiv=null; + var vGantt=(pGantt instanceof JSGantt.GanttChart)? pGantt : g; //hack for backwards compatibility + var vBarDiv=null; + var vTaskDiv=null; + var vListChildRow=null; + var vChildRow=null; + var vGroupSpan=null; - -/** -* Set current display format (minute/hour/day/week/month/quarter) -* Only the first 4 arguments are used, for example: -*
-* g.setFormatArr("day","week","month");
-*
-* will show 3 formatting options (day/week/month) at the bottom right of the gantt chart
-* @method setFormatArr
-* @return {void}
-*/ this.setFormatArr = function() {
- vFormatArr = new Array();
- for(var i = 0; i < arguments.length; i++) {vFormatArr[i] = arguments[i];}
- if(vFormatArr.length>4){vFormatArr.length=4;}
- };
-/**
-* Show/Hide resource column
-* @param pShow {Number} 1=Show,0=Hide
-* @method setShowRes
-* @return {void}
-*/ this.setShowRes = function(pShow) { vShowRes = pShow; };
-/**
-* Show/Hide duration column
-* @param pShow {Number} 1=Show,0=Hide
-* @method setShowDur
-* @return {void}
-*/ this.setShowDur = function(pShow) { vShowDur = pShow; };
-/**
-* Show/Hide completed column
-* @param pShow {Number} 1=Show,0=Hide
-* @method setShowComp
-* @return {void}
-*/ this.setShowComp = function(pShow) { vShowComp = pShow; };
-/**
-* Show/Hide start date column
-* @param pShow {Number} 1=Show,0=Hide
-* @method setShowStartDate
-* @return {void}
-*/ this.setShowStartDate = function(pShow) { vShowStartDate = pShow; };
-/**
-* Show/Hide end date column
-* @param pShow {Number} 1=Show,0=Hide
-* @method setShowEndDate
-* @return {void}
-*/ this.setShowEndDate = function(pShow) { vShowEndDate = pShow; };
-/**
-* Overall date input format
-* @param pShow {String} (mm/dd/yyyy,dd/mm/yyyy,yyyy-mm-dd)
-* @method setDateInputFormat
-* @return {void}
-*/ this.setDateInputFormat = function(pShow) { vDateInputFormat = pShow; };
-/**
-* Overall date display format
-* @param pShow {String} (mm/dd/yyyy,dd/mm/yyyy,yyyy-mm-dd)
-* @method setDateDisplayFormat
-* @return {void}
-*/ this.setDateDisplayFormat = function(pShow) { vDateDisplayFormat = pShow; };
-/**
-* Set gantt caption
-* @param pType {String}
-Caption-Displays a custom caption set in TaskItem
-Resource-Displays task resource
-Duration-Displays task duration
-Complete-Displays task percent complete
';
-
- if(vShowRes !=1) vNameWidth+=vStatusWidth;
- if(vShowDur !=1) vNameWidth+=vStatusWidth;
- if(vShowComp!=1) vNameWidth+=vStatusWidth;
- if(vShowStartDate!=1) vNameWidth+=vStatusWidth;
- if(vShowEndDate!=1) vNameWidth+=vStatusWidth;
-
- // DRAW the Left-side of the chart (names, resources, comp%)
- vLeftTable =
- '
| ';
+ this.getParent=function(){return vParent;};
+ this.getGroup=function(){return vGroup;};
+ this.getOpen=function(){return vOpen;};
+ this.getLevel=function(){return vLevel;};
+ this.getNumKids=function(){return vNumKid;};
+ this.getStartX=function(){return x1;};
+ this.getStartY=function(){return y1;};
+ this.getEndX=function(){return x2;};
+ this.getEndY=function(){return y2;};
+ this.getVisible=function(){return vVisible;};
+ this.getParItem=function(){return vParItem;};
+ this.getCellDiv=function(){return vCellDiv;};
+ this.getBarDiv=function(){return vBarDiv;};
+ this.getTaskDiv=function(){return vTaskDiv;};
+ this.getChildRow=function(){return vChildRow;};
+ this.getListChildRow=function(){return vListChildRow;};
+ this.getGroupSpan=function(){return vGroupSpan;};
+ this.setStart=function(pStart){if(pStart instanceof Date)vStart=pStart;};
+ this.setEnd=function(pEnd){if(pEnd instanceof Date)vEnd=pEnd;};
+ this.setGroupMinStart=function(pStart){if(pStart instanceof Date)vGroupMinStart=pStart;};
+ this.setGroupMinEnd=function(pEnd){if(pEnd instanceof Date)vGroupMinEnd=pEnd;};
+ this.setLevel=function(pLevel){vLevel=parseInt(document.createTextNode(pLevel).data);};
+ this.setNumKid=function(pNumKid){vNumKid=parseInt(document.createTextNode(pNumKid).data);};
+ this.setCompVal=function(pCompVal){vComp=parseFloat(document.createTextNode(pCompVal).data);};
+ this.setStartX=function(pX){x1=parseInt(document.createTextNode(pX).data);};
+ this.setStartY=function(pY){y1=parseInt(document.createTextNode(pY).data);};
+ this.setEndX=function(pX){x2=parseInt(document.createTextNode(pX).data);};
+ this.setEndY=function(pY){y2=parseInt(document.createTextNode(pY).data);};
+ this.setOpen=function(pOpen){vOpen=parseInt(document.createTextNode(pOpen).data);};
+ this.setVisible=function(pVisible){vVisible=parseInt(document.createTextNode(pVisible).data);};
+ this.setSortIdx=function(pSortIdx){vSortIdx=parseInt(document.createTextNode(pSortIdx).data);};
+ this.setToDelete=function(pToDelete){if (pToDelete) vToDelete=true; else vToDelete=false;};
+ this.setParItem=function(pParItem){if(pParItem instanceof JSGantt.TaskItem) vParItem=pParItem;};
+ this.setCellDiv=function(pCellDiv){if(typeof HTMLDivElement !== 'function' || pCellDiv instanceof HTMLDivElement) vCellDiv=pCellDiv;}; //"typeof HTMLDivElement !== 'function'" to play nice with ie6 and 7
+ this.setGroup=function(pGroup){vGroup=parseInt(document.createTextNode(pGroup).data);};
+ this.setBarDiv=function(pDiv){if(typeof HTMLDivElement !== 'function' || pDiv instanceof HTMLDivElement)vBarDiv=pDiv;};
+ this.setTaskDiv=function(pDiv){if(typeof HTMLDivElement !== 'function' || pDiv instanceof HTMLDivElement)vTaskDiv=pDiv;};
+ this.setChildRow=function(pRow){if(typeof HTMLTableRowElement !== 'function' || pRow instanceof HTMLTableRowElement)vChildRow=pRow;};
+ this.setListChildRow=function(pRow){if(typeof HTMLTableRowElement !== 'function' || pRow instanceof HTMLTableRowElement)vListChildRow=pRow;};
+ this.setGroupSpan=function(pSpan){if(typeof HTMLSpanElement !== 'function' || pSpan instanceof HTMLSpanElement)vGroupSpan=pSpan;};
+};
- vMainTable += vLeftTable;
+// function that loads the main gantt chart properties and functions
+// pDiv: (required) this is a div object created in HTML
+// pFormat: (required) - used to indicate whether chart should be drawn in "hour", "day", "week", "month", or "quarter" format
+JSGantt.GanttChart=function(pDiv, pFormat)
+{
+ var vDiv=pDiv;
+ var vFormat=pFormat;
+ var vDivId=null;
+ var vUseFade=1;
+ var vUseMove=1;
+ var vUseRowHlt=1;
+ var vUseToolTip=1;
+ var vUseSort=1;
+ var vUseSingleCell=25000;
+ var vShowRes=1;
+ var vShowDur=1;
+ var vShowComp=1;
+ var vShowStartDate=1;
+ var vShowEndDate=1;
+ var vShowEndWeekDate=1;
+ var vShowTaskInfoRes=1;
+ var vShowTaskInfoDur=1;
+ var vShowTaskInfoComp=1;
+ var vShowTaskInfoStartDate=1;
+ var vShowTaskInfoEndDate=1;
+ var vShowTaskInfoNotes=1;
+ var vShowTaskInfoLink=1;
+ var vShowDeps=1;
+ var vShowSelector=new Array('top');
+ var vDateInputFormat='yyyy-mm-dd';
+ var vDateTaskTableDisplayFormat=JSGantt.parseDateFormatStr('dd/mm/yyyy');
+ var vDateTaskDisplayFormat=JSGantt.parseDateFormatStr('dd month yyyy');
+ var vHourMajorDateDisplayFormat=JSGantt.parseDateFormatStr('day dd month yyyy');
+ var vHourMinorDateDisplayFormat=JSGantt.parseDateFormatStr('HH');
+ var vDayMajorDateDisplayFormat=JSGantt.parseDateFormatStr('dd/mm/yyyy');
+ var vDayMinorDateDisplayFormat=JSGantt.parseDateFormatStr('dd');
+ var vWeekMajorDateDisplayFormat=JSGantt.parseDateFormatStr('yyyy');
+ var vWeekMinorDateDisplayFormat=JSGantt.parseDateFormatStr('dd/mm');
+ var vMonthMajorDateDisplayFormat=JSGantt.parseDateFormatStr('yyyy');
+ var vMonthMinorDateDisplayFormat=JSGantt.parseDateFormatStr('mon');
+ var vQuarterMajorDateDisplayFormat=JSGantt.parseDateFormatStr('yyyy');
+ var vQuarterMinorDateDisplayFormat=JSGantt.parseDateFormatStr('qq');
+ var vUseFullYear=JSGantt.parseDateFormatStr('dd/mm/yyyy');
+ var vCaptionType;
+ var vDepId=1;
+ var vTaskList=new Array();
+ var vFormatArr=new Array('hour','day','week','month','quarter');
+ var vMonthDaysArr=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
+ var vProcessNeeded=true;
+ var vMinGpLen=8;
+ var vScrollTo='';
+ var vHourColWidth=18;
+ var vDayColWidth=18;
+ var vWeekColWidth=36;
+ var vMonthColWidth=36;
+ var vQuarterColWidth=18;
+ var vRowHeight=20;
+ var vTodayPx=-1;
+ /*var vLangs={'en':
+ {'format':'Format','hour':'Hour','day':'Day','week':'Week','month':'Month','quarter':'Quarter','hours':'Hours','days':'Days',
+ 'weeks':'Weeks','months':'Months','quarters':'Quarters','hr':'Hr','dy':'Day','wk':'Wk','mth':'Mth','qtr':'Qtr','hrs':'Hrs',
+ 'dys':'Days','wks':'Wks','mths':'Mths','qtrs':'Qtrs','resource':'Resource','duration':'Duration','comp':'% Comp.',
+ 'completion':'Completion','startdate':'Start Date','enddate':'End Date','moreinfo':'More Information','notes':'Notes',
+ 'january':'January','february':'February','march':'March','april':'April','maylong':'May','june':'June','july':'July',
+ 'august':'August','september':'September','october':'October','november':'November','december':'December','jan':'Jan',
+ 'feb':'Feb','mar':'Mar','apr':'Apr','may':'May','jun':'Jun','jul':'Jul','aug':'Aug','sep':'Sep','oct':'Oct','nov':'Nov',
+ 'dec':'Dec','sunday':'Sunday','monday':'Monday','tuesday':'Tuesday','wednesday':'Wednesday','thursday':'Thursday',
+ 'friday':'Friday','saturday':'Saturday','sun':'Sun','mon':'Mon','tue':'Tue','wed':'Wed','thu':'Thu','fri':'Fri','sat':'Sat'}
+ };
+ var vLang='en';*/
+ var vChartBody=null;
+ var vChartHead=null;
+ var vListBody=null;
+ var vChartTable=null;
+ var vLines=null;
+ var vTimer=20;
+
+ this.setUseFade=function(pVal){vUseFade=pVal;};
+ this.setUseMove=function(pVal){vUseMove=pVal;};
+ this.setUseRowHlt=function(pVal){vUseRowHlt=pVal;};
+ this.setUseToolTip=function(pVal){vUseToolTip=pVal;};
+ this.setUseSort=function(pVal){vUseSort=pVal;};
+ this.setUseSingleCell=function(pVal){vUseSingleCell=pVal*1;};
+ this.setFormatArr=function()
+ {
+ var vValidFormats='hour day week month quarter';
+ vFormatArr=new Array();
+ for(var i=0, j=0; i|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' ; - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' ' + vTmpDate.getHours() + ':00 -' + vTmpDate.getHours() + ':59 | '; - vTmpDate.setHours(vTmpDate.getHours()+1); - } - - if(vFormat == 'hour') - { - vRightTable += '' ; - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' | '; - vTmpDate.setDate(vTmpDate.getDate()+1); - } - - if(vFormat == 'day') - { - vRightTable += '' + - JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5)) + ' - '; - vTmpDate.setDate(vTmpDate.getDate()+6); - vRightTable += JSGantt.formatDateStr(vTmpDate, vDateDisplayFormat) + ' | '; - vTmpDate.setDate(vTmpDate.getDate()+1); - } - else if(vFormat == 'week') - { - vRightTable += '`'+ vStr + ' | '; - vTmpDate.setDate(vTmpDate.getDate()+7); - } - else if(vFormat == 'month') - { - vRightTable += '`'+ vStr + ' | '; - vTmpDate.setDate(vTmpDate.getDate() + 1); - while(vTmpDate.getDate() > 1) - { - vTmpDate.setDate(vTmpDate.getDate() + 1); - } - } - else if(vFormat == 'quarter') - { - vRightTable += '`'+ vStr + ' | '; - vTmpDate.setDate(vTmpDate.getDate() + 81); - while(vTmpDate.getDate() > 1) - { - vTmpDate.setDate(vTmpDate.getDate() + 1); - } - } + var vHeaderCellClass='gmajorheading'; + vCellContents=''; - } - - vRightTable += '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
' + vTmpDate.getMinutes() + ' | ';
- vItemRowStr += '   | ';
- vTmpDate.setMinutes(vTmpDate.getMinutes() + 1);
- }
-
- else if (vFormat == 'hour')
- {
-
- if( vTmpDate.getHours() ==0 )
- vWeekdayColor = "ccccff";
- else
- vWeekdayColor = "ffffff";
-
-
- vDateRowStr += '' + vTmpDate.getHours() + ' | ';
- vItemRowStr += '   | ';
- vTmpDate.setHours(vTmpDate.getHours() + 1);
- }
-
- else if(vFormat == 'day' )
- {
- if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) {
- vWeekdayColor = "ccccff";
- vWeekendColor = "9999ff";
- vWeekdayGColor = "bbbbff";
- vWeekendGColor = "8888ff";
- } else {
- vWeekdayColor = "ffffff";
- vWeekendColor = "cfcfcf";
- vWeekdayGColor = "f3f3f3";
- vWeekendGColor = "c3c3c3";
- }
-
- if(vTmpDate.getDay() % 6 == 0) {
- vDateRowStr += '' + vTmpDate.getDate() + ' | ';
- vItemRowStr += '  | ';
- }
- else {
- vDateRowStr += '' + vTmpDate.getDate() + ' | ';
- if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
- }
-
- vTmpDate.setDate(vTmpDate.getDate() + 1);
-
- }
-
- else if(vFormat == 'week')
- {
-
- vNxtDate.setDate(vNxtDate.getDate() + 7);
-
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vWeekdayColor = "ccccff";
- else
- vWeekdayColor = "ffffff";
-
- if(vNxtDate <= vMaxDate) {
- vDateRowStr += '' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
-
- } else {
- vDateRowStr += '' + (vTmpDate.getMonth()+1) + '/' + vTmpDate.getDate() + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
-
- }
-
- vTmpDate.setDate(vTmpDate.getDate() + 7);
-
- }
-
- else if(vFormat == 'month')
- {
-
- vNxtDate.setFullYear(vTmpDate.getFullYear(), vTmpDate.getMonth(), vMonthDaysArr[vTmpDate.getMonth()]);
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vWeekdayColor = "ccccff";
- else
- vWeekdayColor = "ffffff";
-
- if(vNxtDate <= vMaxDate) {
- vDateRowStr += '' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
- } else {
- vDateRowStr += '' + vMonthArr[vTmpDate.getMonth()].substr(0,3) + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
- }
-
- vTmpDate.setDate(vTmpDate.getDate() + 1);
-
- while(vTmpDate.getDate() > 1)
- {
- vTmpDate.setDate(vTmpDate.getDate() + 1);
- }
-
- }
-
- else if(vFormat == 'quarter')
- {
-
- vNxtDate.setDate(vNxtDate.getDate() + 122);
- if( vTmpDate.getMonth()==0 || vTmpDate.getMonth()==1 || vTmpDate.getMonth()==2 )
- vNxtDate.setFullYear(vTmpDate.getFullYear(), 2, 31);
- else if( vTmpDate.getMonth()==3 || vTmpDate.getMonth()==4 || vTmpDate.getMonth()==5 )
- vNxtDate.setFullYear(vTmpDate.getFullYear(), 5, 30);
- else if( vTmpDate.getMonth()==6 || vTmpDate.getMonth()==7 || vTmpDate.getMonth()==8 )
- vNxtDate.setFullYear(vTmpDate.getFullYear(), 8, 30);
- else if( vTmpDate.getMonth()==9 || vTmpDate.getMonth()==10 || vTmpDate.getMonth()==11 )
- vNxtDate.setFullYear(vTmpDate.getFullYear(), 11, 31);
-
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vWeekdayColor = "ccccff";
- else
- vWeekdayColor = "ffffff";
-
- if(vNxtDate <= vMaxDate) {
- vDateRowStr += 'Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
- } else {
- vDateRowStr += 'Qtr. ' + vQuarterArr[vTmpDate.getMonth()] + ' | ';
- if( vCurrDate >= vTmpDate && vCurrDate < vNxtDate )
- vItemRowStr += '   | ';
- else
- vItemRowStr += '   | ';
- }
-
- vTmpDate.setDate(vTmpDate.getDate() + 81);
-
- while(vTmpDate.getDate() > 1)
- {
- vTmpDate.setDate(vTmpDate.getDate() + 1);
- }
-
- }
- }
-
- vRightTable += vDateRowStr + '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||