From 54d097a4646d5d00126f34bb554d537802c2f3b4 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sat, 22 May 2010 16:23:30 +0000
Subject: [PATCH] New: Add JSGrant library
---
COPYRIGHT | 1 +
htdocs/includes/jsgantt/index.htm | 564 ++++
htdocs/includes/jsgantt/jsgantt.compressed.js | 1 +
htdocs/includes/jsgantt/jsgantt.css | 53 +
htdocs/includes/jsgantt/jsgantt.js | 2307 +++++++++++++++++
htdocs/includes/jsgantt/jsgantt_Minutes.html | 548 ++++
.../jsgantt/jsgantt_exExternalXML.html | 533 ++++
htdocs/includes/jsgantt/project.xml | 65 +
8 files changed, 4072 insertions(+)
create mode 100644 htdocs/includes/jsgantt/index.htm
create mode 100644 htdocs/includes/jsgantt/jsgantt.compressed.js
create mode 100644 htdocs/includes/jsgantt/jsgantt.css
create mode 100644 htdocs/includes/jsgantt/jsgantt.js
create mode 100644 htdocs/includes/jsgantt/jsgantt_Minutes.html
create mode 100644 htdocs/includes/jsgantt/jsgantt_exExternalXML.html
create mode 100644 htdocs/includes/jsgantt/project.xml
diff --git a/COPYRIGHT b/COPYRIGHT
index 59b0b0c033c..4546c93a8f1 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -21,6 +21,7 @@ FPDI_Protection 1.0.3 Apache Software License 2.0 No GPL3 only PDF encr
GeoIP x.x Yes GeoIP Maxmind conversion
iWebkit 5.0.4 LGPL 3.0 Yes Iphone templates framework
JCrop 0.9.8 MIT Licence Yes JS library to crop images
+JSGrant 1.2 BSD Licence
MagPieRss 0.72 GPL 2.0 Yes Load RSS
NuSoap 0.7.3 LGPL 2.1 Yes Interfaces with third tools
OdtPHP 1.0.1 GPL 2.0 Yes Mibrary to build/edit ODT files
diff --git a/htdocs/includes/jsgantt/index.htm b/htdocs/includes/jsgantt/index.htm
new file mode 100644
index 00000000000..32b73059d56
--- /dev/null
+++ b/htdocs/includes/jsgantt/index.htm
@@ -0,0 +1,564 @@
+
+
+
+
+
+
+FREE javascript gantt - JSGantt HTML and CSS only
+
+
+
+
+
+
+
+
+
+ 100% Free Javascript / CSS/ HTML Gantt chart control. Completely buzzword compliant including AJAX !
+
+
+
+
+
+
+Basic Features
+
+Tasks & Collapsible Task Groups
+Multiple Dependencies
+Task Completion
+Task Color
+Milestones
+Resources
+No images needed
+
+
+Advanced Features
+
+Dynamic Loading of Tasks
+Dynamic change of format
+
+ Day
+ Week
+ Month
+ Quarter
+ Hour
+ Minute
+
+
+Load Gantt from XML file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Current Issues:
+
+Currently only one gantt chart is allowed per page.
+
+
+New in 1.2:
+
+Support for half-days
+Hour/Minute format
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Click here to download the jsgantt
+You can download the latest bleeding edge version, request features and report issues at http://code.google.com/p/jsgantt/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+JSGantt is released under BSD license. If you require another license please contact shlomygantz@hotmail.com
+If you plan to use it in a commercial product please consider donating the first sale to charity.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1. Include JSGantt CSS and Javascript
+
+<link rel="stylesheet" type="text/css" href="jsgantt.css" />
+<script language="javascript" src="jsgantt.js"></script>
+
+
+2. Create a div element to hold the gantt chart
+<div style="position:relative" class="gantt" id="GanttChartDIV"></div>
+3. Start a <script> block
+<script language="javascript">
+4. Instantiate JSGantt using GanttChart()
+var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');
+
+
+
+GanttChart(pGanttVar, pDiv, pFormat )
+ pGanttVar : (required) name of the variable assigned
+ pDiv : (required) this is a DIV object created in HTML
+ pFormat : (required) - used to indicate whether chart should be drawn in "day", "week", "month", or "quarter" format
+Customize the look and feel using the following setters
+
g.setShowRes(1); // Show/Hide Responsible (0/1)
+g.setShowDur(1); // Show/Hide Duration (0/1)
+g.setShowComp(1); // Show/Hide % Complete(0/1)
+g.setCaptionType('Resource'); // Set to Show Caption (None,Caption,Resource,Duration,Complete)
+g.setShowStartDate(1); // Show/Hide Start Date(0/1)
+g.setShowEndDate(1); // Show/Hide End Date(0/1)
+g.setDateInputFormat('mm/dd/yyyy') // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
+g.setDateDisplayFormat('mm/dd/yyyy') // Set format to display dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
+g.setFormatArr("day","week","month","quarter") // Set format options (up to 4 : "minute","hour","day","week","month","quarter")
+
+
+
+5. Add Tasks using AddTaskItem()
+
+g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API', '', '', 'ff0000', 'http://help.com', 0, 'Brian', 0, 1, 0, 1));
+g.AddTaskItem(new JSGantt.TaskItem(11, 'Chart Object', '2/10/2008', '2/10/2008', 'ff00ff', 'http://www.yahoo.com', 1, 'Shlomy', 100, 0, 1, 1, "121,122", "My Caption"));
+
+
+TaskItem(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend )
+pID : (required) is a unique ID used to identify each row for parent functions and for setting dom id for hiding/showing
+pName : (required) is the task Label
+pStart : (required) the task start date, can enter empty date ('') for groups. You can also enter specific time (2/10/2008 12:00) for additional percision or half days.
+pEnd : (required) the task end date, can enter empty date ('') for groups
+pColor : (required) the html color for this task; e.g. '00ff00'
+pLink : (optional) any http link navigated to when task bar is clicked.
+pMile :(optional) represent a milestone
+pRes : (optional) resource name
+pComp : (required) completion percent
+pGroup : (optional) indicates whether this is a group(parent) - 0=NOT Parent; 1=IS Parent
+pParent : (required) identifies a parent pID, this causes this task to be a child of identified task
+pOpen : can be initially set to close folder when chart is first drawn
+pDepend : optional list of id's this task is dependent on ... line drawn from dependent to this item
+pCaption : optional caption that will be added after task bar if CaptionType set to "Caption"
+
+*You should be able to add items to the chart in realtime via javascript and issuing "g.Draw()" command.
+
+5a. Another way to add tasks is to use an external XML file with parseXML()
+
+JSGantt.parseXML("project.xml",g);
+
+The structure of the XML file:
+
+
+6. Call Draw() and DrawDependencies()
+
+
+g.Draw();
+g.DrawDependencies();
+
+
+
+
+7. Close the <script> block
+</script>
+
+
+Final code should look like
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Enter your email address to receive JSGantt announcements
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Developed by Shlomy Gantz and Brian Twidt
+Contributed: Paul Labuschagne, Kevin Badgett, Ilan Admon
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/includes/jsgantt/jsgantt.compressed.js b/htdocs/includes/jsgantt/jsgantt.compressed.js
new file mode 100644
index 00000000000..2d0a23d4a0d
--- /dev/null
+++ b/htdocs/includes/jsgantt/jsgantt.compressed.js
@@ -0,0 +1 @@
+var JSGantt;if(!JSGantt)JSGantt={};var vTimeout=0;var vBenchTime=new Date().getTime();JSGantt.TaskItem=function(pID,pName,pStart,pEnd,pColor,pLink,pMile,pRes,pComp,pGroup,pParent,pOpen,pDepend,pCaption){var vID=pID;var vName=pName;var vStart=new Date();var vEnd=new Date();var vColor=pColor;var vLink=pLink;var vMile=pMile;var vRes=pRes;var vComp=pComp;var vGroup=pGroup;var vParent=pParent;var vOpen=pOpen;var vDepend=pDepend;var vCaption=pCaption;var vDuration='';var vLevel=0;var vNumKid=0;var vVisible=1;var x1,y1,x2,y2;if(vGroup!=1){vStart=JSGantt.parseDateStr(pStart,g.getDateInputFormat());vEnd=JSGantt.parseDateStr(pEnd,g.getDateInputFormat())}this.getID=function(){return vID};this.getName=function(){return vName};this.getStart=function(){return vStart};this.getEnd=function(){return vEnd};this.getColor=function(){return vColor};this.getLink=function(){return vLink};this.getMile=function(){return vMile};this.getDepend=function(){if(vDepend)return vDepend;else return null};this.getCaption=function(){if(vCaption)return vCaption;else return''};this.getResource=function(){if(vRes)return vRes;else return' '};this.getCompVal=function(){if(vComp)return vComp;else return 0};this.getCompStr=function(){if(vComp)return vComp+'%';else return''};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 Hour';else vDuration=tmpPer+' Hours'}else if(vFormat=='minute'){tmpPer=Math.ceil((this.getEnd()-this.getStart())/(60*1000));if(tmpPer==1)vDuration='1 Minute';else vDuration=tmpPer+' Minutes'}else{tmpPer=Math.ceil((this.getEnd()-this.getStart())/(24*60*60*1000)+1);if(tmpPer==1)vDuration='1 Day';else vDuration=tmpPer+' Days'}return(vDuration)};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.setDepend=function(pDepend){vDepend=pDepend};this.setStart=function(pStart){vStart=pStart};this.setEnd=function(pEnd){vEnd=pEnd};this.setLevel=function(pLevel){vLevel=pLevel};this.setNumKid=function(pNumKid){vNumKid=pNumKid};this.setCompVal=function(pCompVal){vComp=pCompVal};this.setStartX=function(pX){x1=pX};this.setStartY=function(pY){y1=pY};this.setEndX=function(pX){x2=pX};this.setEndY=function(pY){y2=pY};this.setOpen=function(pOpen){vOpen=pOpen};this.setVisible=function(pVisible){vVisible=pVisible}};JSGantt.GanttChart=function(pGanttVar,pDiv,pFormat){var vGanttVar=pGanttVar;var vDiv=pDiv;var vFormat=pFormat;var vShowRes=1;var vShowDur=1;var vShowComp=1;var vShowStartDate=1;var vShowEndDate=1;var vDateInputFormat="mm/dd/yyyy";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("January","February","March","April","May","June","July","August","September","October","November","December");this.setFormatArr=function(){vFormatArr=new Array();for(var i=0;i4){vFormatArr.length=4}};this.setShowRes=function(pShow){vShowRes=pShow};this.setShowDur=function(pShow){vShowDur=pShow};this.setShowComp=function(pShow){vShowComp=pShow};this.setShowStartDate=function(pShow){vShowStartDate=pShow};this.setShowEndDate=function(pShow){vShowEndDate=pShow};this.setDateInputFormat=function(pShow){vDateInputFormat=pShow};this.setDateDisplayFormat=function(pShow){vDateDisplayFormat=pShow};this.setCaptionType=function(pType){vCaptionType=pType};this.setFormat=function(pFormat){vFormat=pFormat;this.Draw()};this.getShowRes=function(){return vShowRes};this.getShowDur=function(){return vShowDur};this.getShowComp=function(){return vShowComp};this.getShowStartDate=function(){return vShowStartDate};this.getShowEndDate=function(){return vShowEndDate};this.getDateInputFormat=function(){return vDateInputFormat};this.getDateDisplayFormat=function(){return vDateDisplayFormat};this.getCaptionType=function(){return vCaptionType};this.CalcTaskXY=function(){var vList=this.getList();var vTaskDiv;var vParDiv;var vLeft,vTop,vHeight,vWidth;for(i=0;i0){JSGantt.processRows(vTaskList,0,-1,1,1);vMinDate=JSGantt.getMinDate(vTaskList,vFormat);vMaxDate=JSGantt.getMaxDate(vTaskList,vFormat);if(vFormat=='day'){vColWidth=18;vColUnit=1}else if(vFormat=='week'){vColWidth=37;vColUnit=7}else if(vFormat=='month'){vColWidth=37;vColUnit=30}else if(vFormat=='quarter'){vColWidth=60;vColUnit=90}else if(vFormat=='hour'){vColWidth=18;vColUnit=1}else if(vFormat=='minute'){vColWidth=18;vColUnit=1}vNumDays=(Date.parse(vMaxDate)-Date.parse(vMinDate))/(24*60*60*1000);vNumUnits=vNumDays/vColUnit;vChartWidth=vNumUnits*vColWidth+1;vDayWidth=(vColWidth/vColUnit)+(1/vColUnit);vMainTable=''+'';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;vLeftTable=' ';vMainTable+=vLeftTable;vRightTable=''+''}vMainTable+=vRightTable+'