/fb/cuentas/php-jpgraph/jpgraph_gantt.php
PHP | 3803 lines | 2788 code | 460 blank | 555 comment | 395 complexity | ccdb6de3d2450e9c5f0dbebb5fa67b40 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
Large files files are truncated, but you can click here to view the full file
- <?php
- /*=======================================================================
- // File: JPGRAPH_GANTT.PHP
- // Description: JpGraph Gantt plot extension
- // Created: 2001-11-12
- // Ver: $Id: jpgraph_gantt.php 956 2007-11-17 13:19:20Z ljp $
- //
- // Copyright (c) Aditus Consulting. All rights reserved.
- //========================================================================
- */
- require_once('jpgraph_plotband.php');
- require_once('jpgraph_iconplot.php');
- require_once('jpgraph_plotmark.inc.php');
- // Maximum size for Automatic Gantt chart
- DEFINE('MAX_GANTTIMG_SIZE_W',4000);
- DEFINE('MAX_GANTTIMG_SIZE_H',5000);
- // Scale Header types
- DEFINE("GANTT_HDAY",1);
- DEFINE("GANTT_HWEEK",2);
- DEFINE("GANTT_HMONTH",4);
- DEFINE("GANTT_HYEAR",8);
- DEFINE("GANTT_HHOUR",16);
- DEFINE("GANTT_HMIN",32);
- // Bar patterns
- DEFINE("GANTT_RDIAG",BAND_RDIAG); // Right diagonal lines
- DEFINE("GANTT_LDIAG",BAND_LDIAG); // Left diagonal lines
- DEFINE("GANTT_SOLID",BAND_SOLID); // Solid one color
- DEFINE("GANTT_VLINE",BAND_VLINE); // Vertical lines
- DEFINE("GANTT_HLINE",BAND_HLINE); // Horizontal lines
- DEFINE("GANTT_3DPLANE",BAND_3DPLANE); // "3D" Plane
- DEFINE("GANTT_HVCROSS",BAND_HVCROSS); // Vertical/Hor crosses
- DEFINE("GANTT_DIAGCROSS",BAND_DIAGCROSS); // Diagonal crosses
- // Conversion constant
- DEFINE("SECPERDAY",3600*24);
- // Locales. ONLY KEPT FOR BACKWARDS COMPATIBILITY
- // You should use the proper locale strings directly
- // from now on.
- DEFINE("LOCALE_EN","en_UK");
- DEFINE("LOCALE_SV","sv_SE");
- // Layout of bars
- DEFINE("GANTT_EVEN",1);
- DEFINE("GANTT_FROMTOP",2);
- // Style for minute header
- DEFINE("MINUTESTYLE_MM",0); // 15
- DEFINE("MINUTESTYLE_CUSTOM",2); // Custom format
- // Style for hour header
- DEFINE("HOURSTYLE_HM24",0); // 13:10
- DEFINE("HOURSTYLE_HMAMPM",1); // 1:10pm
- DEFINE("HOURSTYLE_H24",2); // 13
- DEFINE("HOURSTYLE_HAMPM",3); // 1pm
- DEFINE("HOURSTYLE_CUSTOM",4); // User defined
- // Style for day header
- DEFINE("DAYSTYLE_ONELETTER",0); // "M"
- DEFINE("DAYSTYLE_LONG",1); // "Monday"
- DEFINE("DAYSTYLE_LONGDAYDATE1",2); // "Monday 23 Jun"
- DEFINE("DAYSTYLE_LONGDAYDATE2",3); // "Monday 23 Jun 2003"
- DEFINE("DAYSTYLE_SHORT",4); // "Mon"
- DEFINE("DAYSTYLE_SHORTDAYDATE1",5); // "Mon 23/6"
- DEFINE("DAYSTYLE_SHORTDAYDATE2",6); // "Mon 23 Jun"
- DEFINE("DAYSTYLE_SHORTDAYDATE3",7); // "Mon 23"
- DEFINE("DAYSTYLE_SHORTDATE1",8); // "23/6"
- DEFINE("DAYSTYLE_SHORTDATE2",9); // "23 Jun"
- DEFINE("DAYSTYLE_SHORTDATE3",10); // "Mon 23"
- DEFINE("DAYSTYLE_SHORTDATE4",11); // "23"
- DEFINE("DAYSTYLE_CUSTOM",12); // "M"
- // Styles for week header
- DEFINE("WEEKSTYLE_WNBR",0);
- DEFINE("WEEKSTYLE_FIRSTDAY",1);
- DEFINE("WEEKSTYLE_FIRSTDAY2",2);
- DEFINE("WEEKSTYLE_FIRSTDAYWNBR",3);
- DEFINE("WEEKSTYLE_FIRSTDAY2WNBR",4);
- // Styles for month header
- DEFINE("MONTHSTYLE_SHORTNAME",0);
- DEFINE("MONTHSTYLE_LONGNAME",1);
- DEFINE("MONTHSTYLE_LONGNAMEYEAR2",2);
- DEFINE("MONTHSTYLE_SHORTNAMEYEAR2",3);
- DEFINE("MONTHSTYLE_LONGNAMEYEAR4",4);
- DEFINE("MONTHSTYLE_SHORTNAMEYEAR4",5);
- DEFINE("MONTHSTYLE_FIRSTLETTER",6);
- // Types of constrain links
- DEFINE('CONSTRAIN_STARTSTART',0);
- DEFINE('CONSTRAIN_STARTEND',1);
- DEFINE('CONSTRAIN_ENDSTART',2);
- DEFINE('CONSTRAIN_ENDEND',3);
- // Arrow direction for constrain links
- DEFINE('ARROW_DOWN',0);
- DEFINE('ARROW_UP',1);
- DEFINE('ARROW_LEFT',2);
- DEFINE('ARROW_RIGHT',3);
- // Arrow type for constrain type
- DEFINE('ARROWT_SOLID',0);
- DEFINE('ARROWT_OPEN',1);
- // Arrow size for constrain lines
- DEFINE('ARROW_S1',0);
- DEFINE('ARROW_S2',1);
- DEFINE('ARROW_S3',2);
- DEFINE('ARROW_S4',3);
- DEFINE('ARROW_S5',4);
- // Activity types for use with utility method CreateSimple()
- DEFINE('ACTYPE_NORMAL',0);
- DEFINE('ACTYPE_GROUP',1);
- DEFINE('ACTYPE_MILESTONE',2);
- DEFINE('ACTINFO_3D',1);
- DEFINE('ACTINFO_2D',0);
- // Check if array_fill() exists
- if (!function_exists('array_fill')) {
- function array_fill($iStart, $iLen, $vValue) {
- $aResult = array();
- for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) {
- $aResult[$iCount] = $vValue;
- }
- return $aResult;
- }
- }
- //===================================================
- // CLASS GanttActivityInfo
- // Description:
- //===================================================
- class GanttActivityInfo {
- public $iShow=true;
- public $iLeftColMargin=4,$iRightColMargin=1,$iTopColMargin=1,$iBottomColMargin=3;
- public $vgrid = null;
- private $iColor='black';
- private $iBackgroundColor='lightgray';
- private $iFFamily=FF_FONT1,$iFStyle=FS_NORMAL,$iFSize=10,$iFontColor='black';
- private $iTitles=array();
- private $iWidth=array(),$iHeight=-1;
- private $iTopHeaderMargin = 4;
- private $iStyle=1;
- private $iHeaderAlign='center';
- function GanttActivityInfo() {
- $this->vgrid = new LineProperty();
- }
- function Hide($aF=true) {
- $this->iShow=!$aF;
- }
- function Show($aF=true) {
- $this->iShow=$aF;
- }
- // Specify font
- function SetFont($aFFamily,$aFStyle=FS_NORMAL,$aFSize=10) {
- $this->iFFamily = $aFFamily;
- $this->iFStyle = $aFStyle;
- $this->iFSize = $aFSize;
- }
- function SetStyle($aStyle) {
- $this->iStyle = $aStyle;
- }
- function SetColumnMargin($aLeft,$aRight) {
- $this->iLeftColMargin = $aLeft;
- $this->iRightColMargin = $aRight;
- }
- function SetFontColor($aFontColor) {
- $this->iFontColor = $aFontColor;
- }
- function SetColor($aColor) {
- $this->iColor = $aColor;
- }
- function SetBackgroundColor($aColor) {
- $this->iBackgroundColor = $aColor;
- }
- function SetColTitles($aTitles,$aWidth=null) {
- $this->iTitles = $aTitles;
- $this->iWidth = $aWidth;
- }
- function SetMinColWidth($aWidths) {
- $n = min(count($this->iTitles),count($aWidths));
- for($i=0; $i < $n; ++$i ) {
- if( !empty($aWidths[$i]) ) {
- if( empty($this->iWidth[$i]) ) {
- $this->iWidth[$i] = $aWidths[$i];
- }
- else {
- $this->iWidth[$i] = max($this->iWidth[$i],$aWidths[$i]);
- }
- }
- }
- }
- function GetWidth($aImg) {
- $txt = new TextProperty();
- $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize);
- $n = count($this->iTitles) ;
- $rm=$this->iRightColMargin;
- $w = 0;
- for($h=0, $i=0; $i < $n; ++$i ) {
- $w += $this->iLeftColMargin;
- $txt->Set($this->iTitles[$i]);
- if( !empty($this->iWidth[$i]) ) {
- $w1 = max($txt->GetWidth($aImg)+$rm,$this->iWidth[$i]);
- }
- else {
- $w1 = $txt->GetWidth($aImg)+$rm;
- }
- $this->iWidth[$i] = $w1;
- $w += $w1;
- $h = max($h,$txt->GetHeight($aImg));
- }
- $this->iHeight = $h+$this->iTopHeaderMargin;
- $txt='';
- return $w;
- }
-
- function GetColStart($aImg,&$aStart,$aAddLeftMargin=false) {
- $n = count($this->iTitles) ;
- $adj = $aAddLeftMargin ? $this->iLeftColMargin : 0;
- $aStart=array($aImg->left_margin+$adj);
- for( $i=1; $i < $n; ++$i ) {
- $aStart[$i] = $aStart[$i-1]+$this->iLeftColMargin+$this->iWidth[$i-1];
- }
- }
-
- // Adjust headers left, right or centered
- function SetHeaderAlign($aAlign) {
- $this->iHeaderAlign=$aAlign;
- }
- function Stroke($aImg,$aXLeft,$aYTop,$aXRight,$aYBottom,$aUseTextHeight=false) {
- if( !$this->iShow ) return;
- $txt = new TextProperty();
- $txt->SetFont($this->iFFamily,$this->iFStyle,$this->iFSize);
- $txt->SetColor($this->iFontColor);
- $txt->SetAlign($this->iHeaderAlign,'top');
- $n=count($this->iTitles);
- if( $n == 0 )
- return;
-
- $x = $aXLeft;
- $h = $this->iHeight;
- $yTop = $aUseTextHeight ? $aYBottom-$h-$this->iTopColMargin-$this->iBottomColMargin : $aYTop ;
- if( $h < 0 ) {
- JpGraphError::RaiseL(6001);
- //('Internal error. Height for ActivityTitles is < 0');
- }
- $aImg->SetLineWeight(1);
- // Set background color
- $aImg->SetColor($this->iBackgroundColor);
- $aImg->FilledRectangle($aXLeft,$yTop,$aXRight,$aYBottom-1);
- if( $this->iStyle == 1 ) {
- // Make a 3D effect
- $aImg->SetColor('white');
- $aImg->Line($aXLeft,$yTop+1,
- $aXRight,$yTop+1);
- }
-
- for($i=0; $i < $n; ++$i ) {
- if( $this->iStyle == 1 ) {
- // Make a 3D effect
- $aImg->SetColor('white');
- $aImg->Line($x+1,$yTop,$x+1,$aYBottom);
- }
- $x += $this->iLeftColMargin;
- $txt->Set($this->iTitles[$i]);
-
- // Adjust the text anchor position according to the choosen alignment
- $xp = $x;
- if( $this->iHeaderAlign == 'center' ) {
- $xp = (($x-$this->iLeftColMargin)+($x+$this->iWidth[$i]))/2;
- }
- elseif( $this->iHeaderAlign == 'right' ) {
- $xp = $x +$this->iWidth[$i]-$this->iRightColMargin;
- }
-
- $txt->Stroke($aImg,$xp,$yTop+$this->iTopHeaderMargin);
- $x += $this->iWidth[$i];
- if( $i < $n-1 ) {
- $aImg->SetColor($this->iColor);
- $aImg->Line($x,$yTop,$x,$aYBottom);
- }
- }
- $aImg->SetColor($this->iColor);
- $aImg->Line($aXLeft,$yTop, $aXRight,$yTop);
- // Stroke vertical column dividers
- $cols=array();
- $this->GetColStart($aImg,$cols);
- $n=count($cols);
- for( $i=1; $i < $n; ++$i ) {
- $this->vgrid->Stroke($aImg,$cols[$i],$aYBottom,$cols[$i],
- $aImg->height - $aImg->bottom_margin);
- }
- }
- }
- //===================================================
- // CLASS GanttGraph
- // Description: Main class to handle gantt graphs
- //===================================================
- class GanttGraph extends Graph {
- public $scale; // Public accessible
- public $hgrid=null;
- private $iObj=array(); // Gantt objects
- private $iLabelHMarginFactor=0.2; // 10% margin on each side of the labels
- private $iLabelVMarginFactor=0.4; // 40% margin on top and bottom of label
- private $iLayout=GANTT_FROMTOP; // Could also be GANTT_EVEN
- private $iSimpleFont = FF_FONT1,$iSimpleFontSize=11;
- private $iSimpleStyle=GANTT_RDIAG,$iSimpleColor='yellow',$iSimpleBkgColor='red';
- private $iSimpleProgressBkgColor='gray',$iSimpleProgressColor='darkgreen';
- private $iSimpleProgressStyle=GANTT_SOLID;
- //---------------
- // CONSTRUCTOR
- // Create a new gantt graph
- function GanttGraph($aWidth=0,$aHeight=0,$aCachedName="",$aTimeOut=0,$aInline=true) {
- // Backward compatibility
- if( $aWidth == -1 ) $aWidth=0;
- if( $aHeight == -1 ) $aHeight=0;
- if( $aWidth< 0 || $aHeight < 0 ) {
- JpgraphError::RaiseL(6002);
- //("You can't specify negative sizes for Gantt graph dimensions. Use 0 to indicate that you want the library to automatically determine a dimension.");
- }
- Graph::Graph($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline);
- $this->scale = new GanttScale($this->img);
- // Default margins
- $this->img->SetMargin(15,17,25,15);
- $this->hgrid = new HorizontalGridLine();
-
- $this->scale->ShowHeaders(GANTT_HWEEK|GANTT_HDAY);
- $this->SetBox();
- }
-
- //---------------
- // PUBLIC METHODS
- //
- function SetSimpleFont($aFont,$aSize) {
- $this->iSimpleFont = $aFont;
- $this->iSimpleFontSize = $aSize;
- }
- function SetSimpleStyle($aBand,$aColor,$aBkgColor) {
- $this->iSimpleStyle = $aBand;
- $this->iSimpleColor = $aColor;
- $this->iSimpleBkgColor = $aBkgColor;
- }
- // A utility function to help create basic Gantt charts
- function CreateSimple($data,$constrains=array(),$progress=array()) {
- $num = count($data);
- for( $i=0; $i < $num; ++$i) {
- switch( $data[$i][1] ) {
- case ACTYPE_GROUP:
- // Create a slightly smaller height bar since the
- // "wings" at the end will make it look taller
- $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',8);
- $a->title->SetFont($this->iSimpleFont,FS_BOLD,$this->iSimpleFontSize);
- $a->rightMark->Show();
- $a->rightMark->SetType(MARK_RIGHTTRIANGLE);
- $a->rightMark->SetWidth(8);
- $a->rightMark->SetColor('black');
- $a->rightMark->SetFillColor('black');
-
- $a->leftMark->Show();
- $a->leftMark->SetType(MARK_LEFTTRIANGLE);
- $a->leftMark->SetWidth(8);
- $a->leftMark->SetColor('black');
- $a->leftMark->SetFillColor('black');
-
- $a->SetPattern(BAND_SOLID,'black');
- $csimpos = 6;
- break;
-
- case ACTYPE_NORMAL:
- $a = new GanttBar($data[$i][0],$data[$i][2],$data[$i][3],$data[$i][4],'',10);
- $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize);
- $a->SetPattern($this->iSimpleStyle,$this->iSimpleColor);
- $a->SetFillColor($this->iSimpleBkgColor);
- // Check if this activity should have a constrain line
- $n = count($constrains);
- for( $j=0; $j < $n; ++$j ) {
- if( empty($constrains[$j]) || (count($constrains[$j]) != 3) ) {
- JpGraphError::RaiseL(6003,$j);
- //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)");
- }
- if( $constrains[$j][0]==$data[$i][0] ) {
- $a->SetConstrain($constrains[$j][1],$constrains[$j][2],'black',ARROW_S2,ARROWT_SOLID);
- }
- }
- // Check if this activity have a progress bar
- $n = count($progress);
- for( $j=0; $j < $n; ++$j ) {
-
- if( empty($progress[$j]) || (count($progress[$j]) != 2) ) {
- JpGraphError::RaiseL(6004,$j);
- //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)");
- }
- if( $progress[$j][0]==$data[$i][0] ) {
- $a->progress->Set($progress[$j][1]);
- $a->progress->SetPattern($this->iSimpleProgressStyle,
- $this->iSimpleProgressColor);
- $a->progress->SetFillColor($this->iSimpleProgressBkgColor);
- //$a->progress->SetPattern($progress[$j][2],$progress[$j][3]);
- break;
- }
- }
- $csimpos = 6;
- break;
- case ACTYPE_MILESTONE:
- $a = new MileStone($data[$i][0],$data[$i][2],$data[$i][3]);
- $a->title->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize);
- $a->caption->SetFont($this->iSimpleFont,FS_NORMAL,$this->iSimpleFontSize);
- $csimpos = 5;
- break;
- default:
- die('Unknown activity type');
- break;
- }
- // Setup caption
- $a->caption->Set($data[$i][$csimpos-1]);
- // Check if this activity should have a CSIM target ?
- if( !empty($data[$i][$csimpos]) ) {
- $a->SetCSIMTarget($data[$i][$csimpos]);
- $a->SetCSIMAlt($data[$i][$csimpos+1]);
- }
- if( !empty($data[$i][$csimpos+2]) ) {
- $a->title->SetCSIMTarget($data[$i][$csimpos+2]);
- $a->title->SetCSIMAlt($data[$i][$csimpos+3]);
- }
- $this->Add($a);
- }
- }
-
- // Set what headers should be shown
- function ShowHeaders($aFlg) {
- $this->scale->ShowHeaders($aFlg);
- }
-
- // Specify the fraction of the font height that should be added
- // as vertical margin
- function SetLabelVMarginFactor($aVal) {
- $this->iLabelVMarginFactor = $aVal;
- }
- // Synonym to the method above
- function SetVMarginFactor($aVal) {
- $this->iLabelVMarginFactor = $aVal;
- }
-
-
- // Add a new Gantt object
- function Add($aObject) {
- if( is_array($aObject) && count($aObject) > 0 ) {
- $cl = $aObject[0];
- if( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) {
- $this->AddIcon($aObject);
- }
- else {
- $n = count($aObject);
- for($i=0; $i < $n; ++$i)
- $this->iObj[] = $aObject[$i];
- }
- }
- else {
- if( class_exists('IconPlot',false) && ($aObject instanceof IconPlot) ) {
- $this->AddIcon($aObject);
- }
- else {
- $this->iObj[] = $aObject;
- }
- }
- }
- // Override inherit method from Graph and give a warning message
- function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) {
- JpGraphError::RaiseL(6005);
- //("SetScale() is not meaningfull with Gantt charts.");
- }
- // Specify the date range for Gantt graphs (if this is not set it will be
- // automtically determined from the input data)
- function SetDateRange($aStart,$aEnd) {
- // Adjust the start and end so that the indicate the
- // begining and end of respective start and end days
- if( strpos($aStart,':') === false )
- $aStart = date('Y-m-d 00:00',strtotime($aStart));
- if( strpos($aEnd,':') === false )
- $aEnd = date('Y-m-d 23:59',strtotime($aEnd));
- $this->scale->SetRange($aStart,$aEnd);
- }
-
- // Get the maximum width of the activity titles columns for the bars
- // The name is lightly misleading since we from now on can have
- // multiple columns in the label section. When this was first written
- // it only supported a single label, hence the name.
- function GetMaxLabelWidth() {
- $m=10;
- if( $this->iObj != null ) {
- $marg = $this->scale->actinfo->iLeftColMargin+$this->scale->actinfo->iRightColMargin;
- $n = count($this->iObj);
- for($i=0; $i < $n; ++$i) {
- if( !empty($this->iObj[$i]->title) ) {
- if( $this->iObj[$i]->title->HasTabs() ) {
- list($tot,$w) = $this->iObj[$i]->title->GetWidth($this->img,true);
- $m=max($m,$tot);
- }
- else
- $m=max($m,$this->iObj[$i]->title->GetWidth($this->img));
- }
- }
- }
- return $m;
- }
-
- // Get the maximum height of the titles for the bars
- function GetMaxLabelHeight() {
- $m=10;
- if( $this->iObj != null ) {
- $n = count($this->iObj);
- for($i=0; $i < $n; ++$i) {
- if( !empty($this->iObj[$i]->title) ) {
- $m=max($m,$this->iObj[$i]->title->GetHeight($this->img));
- }
- }
- }
- return $m;
- }
- function GetMaxBarAbsHeight() {
- $m=0;
- if( $this->iObj != null ) {
- $m = $this->iObj[0]->GetAbsHeight($this->img);
- $n = count($this->iObj);
- for($i=1; $i < $n; ++$i) {
- $m=max($m,$this->iObj[$i]->GetAbsHeight($this->img));
- }
- }
- return $m;
- }
-
- // Get the maximum used line number (vertical position) for bars
- function GetBarMaxLineNumber() {
- $m=1;
- if( $this->iObj != null ) {
- $m = $this->iObj[0]->GetLineNbr();
- $n = count($this->iObj);
- for($i=1; $i < $n; ++$i) {
- $m=max($m,$this->iObj[$i]->GetLineNbr());
- }
- }
- return $m;
- }
-
- // Get the minumum and maximum used dates for all bars
- function GetBarMinMax() {
- $start = 0 ;
- $n = count($this->iObj);
- while( $start < $n && $this->iObj[$start]->GetMaxDate() === false )
- ++$start;
- if( $start >= $n ) {
- JpgraphError::RaiseL(6006);
- //('Cannot autoscale Gantt chart. No dated activities exist. [GetBarMinMax() start >= n]');
- }
- $max=$this->scale->NormalizeDate($this->iObj[$start]->GetMaxDate());
- $min=$this->scale->NormalizeDate($this->iObj[$start]->GetMinDate());
- for($i=$start+1; $i < $n; ++$i) {
- $rmax = $this->scale->NormalizeDate($this->iObj[$i]->GetMaxDate());
- if( $rmax != false )
- $max=Max($max,$rmax);
- $rmin = $this->scale->NormalizeDate($this->iObj[$i]->GetMinDate());
- if( $rmin != false )
- $min=Min($min,$rmin);
- }
- $minDate = date("Y-m-d",$min);
- $min = strtotime($minDate);
- $maxDate = date("Y-m-d 23:59",$max);
- $max = strtotime($maxDate);
- return array($min,$max);
- }
- // Create a new auto sized canvas if the user hasn't specified a size
- // The size is determined by what scale the user has choosen and hence
- // the minimum width needed to display the headers. Some margins are
- // also added to make it better looking.
- function AutoSize() {
- if( $this->img->img == null ) {
- // The predefined left, right, top, bottom margins.
- // Note that the top margin might incease depending on
- // the title.
- $lm = $this->img->left_margin;
- $rm = $this->img->right_margin;
- $rm += 2 ;
- $tm = $this->img->top_margin;
- $bm = $this->img->bottom_margin;
- $bm += 1;
- if( BRAND_TIMING ) $bm += 10;
-
- // First find out the height
- $n=$this->GetBarMaxLineNumber()+1;
- $m=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight());
- $height=$n*((1+$this->iLabelVMarginFactor)*$m);
-
- // Add the height of the scale titles
- $h=$this->scale->GetHeaderHeight();
- $height += $h;
- // Calculate the top margin needed for title and subtitle
- if( $this->title->t != "" ) {
- $tm += $this->title->GetFontHeight($this->img);
- }
- if( $this->subtitle->t != "" ) {
- $tm += $this->subtitle->GetFontHeight($this->img);
- }
- // ...and then take the bottom and top plot margins into account
- $height += $tm + $bm + $this->scale->iTopPlotMargin + $this->scale->iBottomPlotMargin;
- // Now find the minimum width for the chart required
- // If day scale or smaller is shown then we use the day font width
- // as the base size unit.
- // If only weeks or above is displayed we use a modified unit to
- // get a smaller image.
- if( $this->scale->IsDisplayHour() || $this->scale->IsDisplayMinute() ) {
- // Add 2 pixel margin on each side
- $fw=$this->scale->day->GetFontWidth($this->img)+4;
- }
- elseif( $this->scale->IsDisplayWeek() ) {
- $fw = 8;
- }
- elseif( $this->scale->IsDisplayMonth() ) {
- $fw = 4;
- }
- else {
- $fw = 2;
- }
- $nd=$this->scale->GetNumberOfDays();
- if( $this->scale->IsDisplayDay() ) {
- // If the days are displayed we also need to figure out
- // how much space each day's title will require.
- switch( $this->scale->day->iStyle ) {
- case DAYSTYLE_LONG :
- $txt = "Monday";
- break;
- case DAYSTYLE_LONGDAYDATE1 :
- $txt = "Monday 23 Jun";
- break;
- case DAYSTYLE_LONGDAYDATE2 :
- $txt = "Monday 23 Jun 2003";
- break;
- case DAYSTYLE_SHORT :
- $txt = "Mon";
- break;
- case DAYSTYLE_SHORTDAYDATE1 :
- $txt = "Mon 23/6";
- break;
- case DAYSTYLE_SHORTDAYDATE2 :
- $txt = "Mon 23 Jun";
- break;
- case DAYSTYLE_SHORTDAYDATE3 :
- $txt = "Mon 23";
- break;
- case DAYSTYLE_SHORTDATE1 :
- $txt = "23/6";
- break;
- case DAYSTYLE_SHORTDATE2 :
- $txt = "23 Jun";
- break;
- case DAYSTYLE_SHORTDATE3 :
- $txt = "Mon 23";
- break;
- case DAYSTYLE_SHORTDATE4 :
- $txt = "88";
- break;
- case DAYSTYLE_CUSTOM :
- $txt = date($this->scale->day->iLabelFormStr,
- strtotime('2003-12-20 18:00'));
- break;
- case DAYSTYLE_ONELETTER :
- default:
- $txt = "M";
- break;
- }
- $fw = $this->scale->day->GetStrWidth($this->img,$txt)+6;
- }
- // If we have hours enabled we must make sure that each day has enough
- // space to fit the number of hours to be displayed.
- if( $this->scale->IsDisplayHour() ) {
- // Depending on what format the user has choose we need different amount
- // of space. We therefore create a typical string for the choosen format
- // and determine the length of that string.
- switch( $this->scale->hour->iStyle ) {
- case HOURSTYLE_HMAMPM:
- $txt = '12:00pm';
- break;
- case HOURSTYLE_H24:
- // 13
- $txt = '24';
- break;
- case HOURSTYLE_HAMPM:
- $txt = '12pm';
- break;
- case HOURSTYLE_CUSTOM:
- $txt = date($this->scale->hour->iLabelFormStr,strtotime('2003-12-20 18:00'));
- break;
- case HOURSTYLE_HM24:
- default:
- $txt = '24:00';
- break;
- }
- $hfw = $this->scale->hour->GetStrWidth($this->img,$txt)+6;
- $mw = $hfw;
- if( $this->scale->IsDisplayMinute() ) {
- // Depending on what format the user has choose we need different amount
- // of space. We therefore create a typical string for the choosen format
- // and determine the length of that string.
- switch( $this->scale->minute->iStyle ) {
- case HOURSTYLE_CUSTOM:
- $txt2 = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55'));
- break;
- case MINUTESTYLE_MM:
- default:
- $txt2 = '15';
- break;
- }
-
- $mfw = $this->scale->minute->GetStrWidth($this->img,$txt2)+6;
- $n2 = ceil(60 / $this->scale->minute->GetIntervall() );
- $mw = $n2 * $mfw;
- }
- $hfw = $hfw < $mw ? $mw : $hfw ;
- $n = ceil(24*60 / $this->scale->TimeToMinutes($this->scale->hour->GetIntervall()) );
- $hw = $n * $hfw;
- $fw = $fw < $hw ? $hw : $fw ;
- }
- // We need to repeat this code block here as well.
- // THIS iS NOT A MISTAKE !
- // We really need it since we need to adjust for minutes both in the case
- // where hour scale is shown and when it is not shown.
- if( $this->scale->IsDisplayMinute() ) {
- // Depending on what format the user has choose we need different amount
- // of space. We therefore create a typical string for the choosen format
- // and determine the length of that string.
- switch( $this->scale->minute->iStyle ) {
- case HOURSTYLE_CUSTOM:
- $txt = date($this->scale->minute->iLabelFormStr,strtotime('2005-05-15 18:55'));
- break;
- case MINUTESTYLE_MM:
- default:
- $txt = '15';
- break;
- }
-
- $mfw = $this->scale->minute->GetStrWidth($this->img,$txt)+6;
- $n = ceil(60 / $this->scale->TimeToMinutes($this->scale->minute->GetIntervall()) );
- $mw = $n * $mfw;
- $fw = $fw < $mw ? $mw : $fw ;
- }
- // If we display week we must make sure that 7*$fw is enough
- // to fit up to 10 characters of the week font (if the week is enabled)
- if( $this->scale->IsDisplayWeek() ) {
- // Depending on what format the user has choose we need different amount
- // of space
- $fsw = strlen($this->scale->week->iLabelFormStr);
- if( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR ) {
- $fsw += 8;
- }
- elseif( $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ) {
- $fsw += 7;
- }
- else {
- $fsw += 4;
- }
-
- $ww = $fsw*$this->scale->week->GetFontWidth($this->img);
- if( 7*$fw < $ww ) {
- $fw = ceil($ww/7);
- }
- }
- if( !$this->scale->IsDisplayDay() && !$this->scale->IsDisplayHour() &&
- !( ($this->scale->week->iStyle==WEEKSTYLE_FIRSTDAYWNBR ||
- $this->scale->week->iStyle==WEEKSTYLE_FIRSTDAY2WNBR) && $this->scale->IsDisplayWeek() ) ) {
- // If we don't display the individual days we can shrink the
- // scale a little bit. This is a little bit pragmatic at the
- // moment and should be re-written to take into account
- // a) What scales exactly are shown and
- // b) what format do they use so we know how wide we need to
- // make each scale text space at minimum.
- $fw /= 2;
- if( !$this->scale->IsDisplayWeek() ) {
- $fw /= 1.8;
- }
- }
- $cw = $this->GetMaxActInfoColWidth() ;
- $this->scale->actinfo->SetMinColWidth($cw);
- if( $this->img->width <= 0 ) {
- // Now determine the width for the activity titles column
- // Firdst find out the maximum width of each object column
- $titlewidth = max(max($this->GetMaxLabelWidth(),
- $this->scale->tableTitle->GetWidth($this->img)),
- $this->scale->actinfo->GetWidth($this->img));
- // Add the width of the vertivcal divider line
- $titlewidth += $this->scale->divider->iWeight*2;
- // Now get the total width taking
- // titlewidth, left and rigt margin, dayfont size
- // into account
- $width = $titlewidth + $nd*$fw + $lm+$rm;
- }
- else {
- $width = $this->img->width;
- }
- $width = round($width);
- $height = round($height);
- // Make a sanity check on image size
- if( $width > MAX_GANTTIMG_SIZE_W || $height > MAX_GANTTIMG_SIZE_H ) {
- JpgraphError::RaiseL(6007,$width,$height);
- //("Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.");
- }
- $this->img->CreateImgCanvas($width,$height);
- $this->img->SetMargin($lm,$rm,$tm,$bm);
- }
- }
- // Return an array width the maximum width for each activity
- // column. This is used when we autosize the columns where we need
- // to find out the maximum width of each column. In order to do that we
- // must walk through all the objects, sigh...
- function GetMaxActInfoColWidth() {
- $n = count($this->iObj);
- if( $n == 0 ) return;
- $w = array();
- $m = $this->scale->actinfo->iLeftColMargin + $this->scale->actinfo->iRightColMargin;
-
- for( $i=0; $i < $n; ++$i ) {
- $tmp = $this->iObj[$i]->title->GetColWidth($this->img,$m);
- $nn = count($tmp);
- for( $j=0; $j < $nn; ++$j ) {
- if( empty($w[$j]) )
- $w[$j] = $tmp[$j];
- else
- $w[$j] = max($w[$j],$tmp[$j]);
- }
- }
- return $w;
- }
- // Stroke the gantt chart
- function Stroke($aStrokeFileName="") {
- // If the filename is the predefined value = '_csim_special_'
- // we assume that the call to stroke only needs to do enough
- // to correctly generate the CSIM maps.
- // We use this variable to skip things we don't strictly need
- // to do to generate the image map to improve performance
- // a best we can. Therefor you will see a lot of tests !$_csim in the
- // code below.
- $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
- // Should we autoscale dates?
- if( !$this->scale->IsRangeSet() ) {
- list($min,$max) = $this->GetBarMinMax();
- $this->scale->SetRange($min,$max);
- }
- $this->scale->AdjustStartEndDay();
- // Check if we should autoscale the image
- $this->AutoSize();
- // Should we start from the top or just spread the bars out even over the
- // available height
- $this->scale->SetVertLayout($this->iLayout);
- if( $this->iLayout == GANTT_FROMTOP ) {
- $maxheight=max($this->GetMaxLabelHeight(),$this->GetMaxBarAbsHeight());
- $this->scale->SetVertSpacing($maxheight*(1+$this->iLabelVMarginFactor));
- }
- // If it hasn't been set find out the maximum line number
- if( $this->scale->iVertLines == -1 )
- $this->scale->iVertLines = $this->GetBarMaxLineNumber()+1;
-
- $maxwidth=max($this->scale->actinfo->GetWidth($this->img),
- max($this->GetMaxLabelWidth(),
- $this->scale->tableTitle->GetWidth($this->img)));
- $this->scale->SetLabelWidth($maxwidth+$this->scale->divider->iWeight);//*(1+$this->iLabelHMarginFactor));
- if( !$_csim ) {
- $this->StrokePlotArea();
- if( $this->iIconDepth == DEPTH_BACK ) {
- $this->StrokeIcons();
- }
- }
- $this->scale->Stroke();
- if( !$_csim ) {
- // Due to a minor off by 1 bug we need to temporarily adjust the margin
- $this->img->right_margin--;
- $this->StrokePlotBox();
- $this->img->right_margin++;
- }
- // Stroke Grid line
- $this->hgrid->Stroke($this->img,$this->scale);
- $n = count($this->iObj);
- for($i=0; $i < $n; ++$i) {
- //$this->iObj[$i]->SetLabelLeftMargin(round($maxwidth*$this->iLabelHMarginFactor/2));
- $this->iObj[$i]->Stroke($this->img,$this->scale);
- }
- $this->StrokeTitles();
- if( !$_csim ) {
- $this->StrokeConstrains();
- $this->footer->Stroke($this->img);
- if( $this->iIconDepth == DEPTH_FRONT) {
- $this->StrokeIcons();
- }
- // Should we do any final image transformation
- if( $this->iImgTrans ) {
- if( !class_exists('ImgTrans',false) ) {
- require_once('jpgraph_imgtrans.php');
- }
-
- $tform = new ImgTrans($this->img->img);
- $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist,
- $this->iImgTransDirection,$this->iImgTransHighQ,
- $this->iImgTransMinSize,$this->iImgTransFillColor,
- $this->iImgTransBorder);
- }
-
-
- // If the filename is given as the special "__handle"
- // then the image handler is returned and the image is NOT
- // streamed back
- if( $aStrokeFileName == _IMG_HANDLER ) {
- return $this->img->img;
- }
- else {
- // Finally stream the generated picture
- $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,
- $aStrokeFileName);
- }
- }
- }
- function StrokeConstrains() {
- $n = count($this->iObj);
- // Stroke all constrains
- for($i=0; $i < $n; ++$i) {
- // Some gantt objects may not have constraints associated with them
- // for example we can add IconPlots which doesn't have this property.
- if( empty($this->iObj[$i]->constraints) ) continue;
- $numConstrains = count($this->iObj[$i]->constraints);
- for( $k = 0; $k < $numConstrains; $k++ ) {
- $vpos = $this->iObj[$i]->constraints[$k]->iConstrainRow;
- if( $vpos >= 0 ) {
- $c1 = $this->iObj[$i]->iConstrainPos;
- // Find out which object is on the target row
- $targetobj = -1;
- for( $j=0; $j < $n && $targetobj == -1; ++$j ) {
- if( $this->iObj[$j]->iVPos == $vpos ) {
- $targetobj = $j;
- }
- }
- if( $targetobj == -1 ) {
- JpGraphError::RaiseL(6008,$this->iObj[$i]->iVPos,$vpos);
- //('You have specifed a constrain from row='.$this->iObj[$i]->iVPos.' to row='.$vpos.' which does not have any activity.');
- }
- $c2 = $this->iObj[$targetobj]->iConstrainPos;
- if( count($c1) == 4 && count($c2 ) == 4) {
- switch( $this->iObj[$i]->constraints[$k]->iConstrainType ) {
- case CONSTRAIN_ENDSTART:
- if( $c1[1] < $c2[1] ) {
- $link = new GanttLink($c1[2],$c1[3],$c2[0],$c2[1]);
- }
- else {
- $link = new GanttLink($c1[2],$c1[1],$c2[0],$c2[3]);
- }
- $link->SetPath(3);
- break;
- case CONSTRAIN_STARTEND:
- if( $c1[1] < $c2[1] ) {
- $link = new GanttLink($c1[0],$c1[3],$c2[2],$c2[1]);
- }
- else {
- $link = new GanttLink($c1[0],$c1[1],$c2[2],$c2[3]);
- }
- $link->SetPath(0);
- break;
- case CONSTRAIN_ENDEND:
- if( $c1[1] < $c2[1] ) {
- $link = new GanttLink($c1[2],$c1[3],$c2[2],$c2[1]);
- }
- else {
- $link = new GanttLink($c1[2],$c1[1],$c2[2],$c2[3]);
- }
- $link->SetPath(1);
- break;
- case CONSTRAIN_STARTSTART:
- if( $c1[1] < $c2[1] ) {
- $link = new GanttLink($c1[0],$c1[3],$c2[0],$c2[1]);
- }
- else {
- $link = new GanttLink($c1[0],$c1[1],$c2[0],$c2[3]);
- }
- $link->SetPath(3);
- break;
- default:
- JpGraphError::RaiseL(6009,$this->iObj[$i]->iVPos,$vpos);
- //('Unknown constrain type specified from row='.$this->iObj[$i]->iVPos.' to row='.$vpos);
- break;
- }
- $link->SetColor($this->iObj[$i]->constraints[$k]->iConstrainColor);
- $link->SetArrow($this->iObj[$i]->constraints[$k]->iConstrainArrowSize,
- $this->iObj[$i]->constraints[$k]->iConstrainArrowType);
-
- $link->Stroke($this->img);
- }
- }
- }
- }
- }
- function GetCSIMAreas() {
- if( !$this->iHasStroked )
- $this->Stroke(_CSIM_SPECIALFILE);
-
- $csim = $this->title->GetCSIMAreas();
- $csim .= $this->subtitle->GetCSIMAreas();
- $csim .= $this->subsubtitle->GetCSIMAreas();
- $n = count($this->iObj);
- for( $i=$n-1; $i >= 0; --$i )
- $csim .= $this->iObj[$i]->GetCSIMArea();
- return $csim;
- }
- }
- //===================================================
- // CLASS PredefIcons
- // Description: Predefined icons for use with Gantt charts
- //===================================================
- DEFINE('GICON_WARNINGRED',0);
- DEFINE('GICON_TEXT',1);
- DEFINE('GICON_ENDCONS',2);
- DEFINE('GICON_MAIL',3);
- DEFINE('GICON_STARTCONS',4);
- DEFINE('GICON_CALC',5);
- DEFINE('GICON_MAGNIFIER',6);
- DEFINE('GICON_LOCK',7);
- DEFINE('GICON_STOP',8);
- DEFINE('GICON_WARNINGYELLOW',9);
- DEFINE('GICON_FOLDEROPEN',10);
- DEFINE('GICON_FOLDER',11);
- DEFINE('GICON_TEXTIMPORTANT',12);
- class PredefIcons {
- private $iBuiltinIcon = null, $iLen = -1 ;
- function GetLen() {
- return $this->iLen ;
- }
- function GetImg($aIdx) {
- if( $aIdx < 0 || $aIdx >= $this->iLen ) {
- JpGraphError::RaiseL(6010,$aIdx);
- //('Illegal icon index for Gantt builtin icon ['.$aIdx.']');
- }
- return Image::CreateFromString(base64_decode($this->iBuiltinIcon[$aIdx][1]));
- }
- function PredefIcons() {
- //==========================================================
- // warning.png
- //==========================================================
- $this->iBuiltinIcon[0][0]= 1043 ;
- $this->iBuiltinIcon[0][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
- 'B3RJTUUH0wgKFSgilWPhUQAAA6BJREFUeNrtl91rHFUYh5/3zMx+Z5JNUoOamCZNaqTZ6IWIkqRiQWmi1IDetHfeiCiltgXBP8AL'.
- '0SIUxf/AvfRSBS9EKILFFqyIH9CEmFZtPqrBJLs7c+b1YneT3WTTbNsUFPLCcAbmzPt73o9zzgzs2Z793231UOdv3w9k9Z2uzOdA'.
- '5+2+79yNeL7Hl7hw7oeixRMZ6PJM26W18DNAm/Vh7lR8fqh97NmMF11es1iFpMATqdirwMNA/J4DpIzkr5YsAF1PO6gIMYHRdPwl'.
- 'oO2elmB+qH3sm7XozbkgYvy8SzYnZPtcblyM6I+5z3jQ+0vJfgpEu56BfI9vUkbyi2HZd1QJoeWRiAjBd4SDCW8SSAOy6wBHMzF7'.
- 'YdV2A+ROuvRPLfHoiSU0EMY/cDAIhxJeGngKaN1VgHyPL7NBxI1K9P4QxBzw3K1zJ/zkG8B9uwaQ7/HNsRZv9kohBGD0o7JqMYS/'.
- '/ynPidQw/LrBiPBcS/yFCT95DvB2BWAy4575PaQbQKW+tPd3GCItu2odKI++YxiKu0d26oWmAD7paZU/rLz37VqIijD2YbnzNBBE'.
- 'IBHf8K8qjL7vYhCGErEU8CTg3xXAeMp96GrJEqkyXkm9Bhui1xfsunjdGhcYLq+IzjsGmBt5YH/cmJkFq6gIqlon3u4LxdKGuCIo'.
- 'Qu41g0E41po+2R33Xt5uz9kRIB2UTle7PnfKrROP1HD4sRjZlq0lzhwoZ6rDNeTi3nEg1si/7FT7kYQbXS6E5E65tA5uRF9tutq0'.
- 'K/VwAF+/FbIYWt6+tjQM/AqUms7A4Wy6d7YSfSNxgMmzi0ycWWworio4QJvj4LpuL5BqugTnXzzqJsJwurrlNhJXFaavW67NRw3F'.
- 'q+aJcCQVe9fzvJGmAY7/dPH0gi0f64OveGxa+usCuQMeZ0+kt8BVrX+qPO9Bzx0MgqBvs+a2PfDdYIf+WAjXU1ub4tqNaPPzRs8A'.
- 'blrli+WVn79cXn0cWKl+tGx7HLc7pu3CSmnfitL+l1UihAhwjFkPQev4K/fSABjBM8JCaFuurJU+rgW41SroA8aNMVNAFtgHJCsn'.
- 'XGy/58QVxAC9MccJtZ5kIzNlW440WrJ2ea4YPA9cAooA7i0A/gS+iqLoOpB1HOegqrYB3UBmJrAtQAJwpwPr1Ry92wVlgZsiYlW1'.
- 'uX1gU36dymgqYxJIJJNJT1W9QqHgNwFQBGYqo94OwHZQUuPD7ACglSvc+5n5T9m/wfJJX4U9qzEAAAAASUVORK5CYII=' ;
- //==========================================================
- // edit.png
- //==========================================================
- $this->iBuiltinIcon[1][0]= 959 ;
- $this->iBuiltinIcon[1][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAFgAWABY9j+ZuwAAAAlwSFlz'.
- 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AKDAwbIEXOA6AAAAM8SURBVHicpdRPaBxlHMbx76ZvsmOTmm1dsEqQSIIsEmGVBAQjivEQ'.
- 'PAUJngpWsAWlBw8egpQepKwplN4ULEG9CjkEyUFKlSJrWTG0IU51pCsdYW2ncUPjdtp9Z+f3vuNhu8nKbmhaf5cZeGc+PO8zf1Lc'.
- 'm0KhkACICCKCMeaBjiLC0tLSnjNvPmuOHRpH0TZTU1M8zBi9wakzn7OFTs5sw8YYACYmJrre7HkeuVyu69qPF77hlT1XmZ0eQ03O'.
- 'wOLJTvhBx1rLz18VmJ0eY+jVd2FxDkKXnvYLHgb97OgLzE4ON9Hzc1B1QaQzsed5O0Lta3Ec89OnR5h5McfQ+Mw2qgQUnfBOPbZ3'.
- 'bK3l+xOvMT0+3ERLp5FNF6UEjcL32+DdVmGt5WLhDYYPZrbRqreFumXwql0S3w9tnDvLWD5PZigPpdOwuYpSCo3C8wU3UHxQdHbf'.
- 'cZIkNM6dxcnlUM4k1eUFMlUPpUADbpkttFarHe6oYqeOr6yt4RzMQHYUcUsQVtGicHDwKprViuLDkkOtVnsHCHZVRVy/zcj1i5Af'.
- 'h8AjdIts+hUcGcYPK3iBtKM3gD/uAzf/AdY2mmmVgy6X8YNNKmGIvyloPcB8SUin07RQ4EZHFdsdG0wkJEnEaHAJxvKEpSLeaokV'.
- 'r4zWmhUZYLlY4b1D03y5eIEWCtS7vsciAgiIxkQRabWOrlQor66y4pUphoJb1jiO4uO5o0S3q6RSqVbiOmC7VCEgAhLSaDQ48dH7'.
- 'vD46REY0iysegSjKQciRt99ib7qXwX0O+pG4teM6YKHLB9JMq4mTmF9/+AKA4wvLZByH7OgYL7+UY2qvw/7Bfg5kHiXjJFyv3CGO'.
- 'Y1rof+BW4t/XLiPG0DCGr79d4XzRxRnIMn98huXSTYyJ6et1UNYQhRvcinpJq86H3wGPPPM0iBDd+QffD1g4eZjLvuG7S1Wef26E'.
- 'J7L7eSx7gAHVg7V3MSbi6m/r93baBd6qQjerAJg/9Ql/XrvG0ON1+vv7GH3qSfY5fahUnSTpwZgIEQesaVXRPbHRG/xyJSAxMYlp'.
- 'EOm71HUINiY7mGb95l/8jZCyQmJjMDGJjUmsdCROtZ0n/P/Z8v4Fs2MTUUf7vYoAAAAASUVORK5CYII=' ;
- //==========================================================
- // endconstrain.png
- //==========================================================
- $this->iBuiltinIcon[2][0]= 666 ;
- $this->iBuiltinIcon[2][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'.
- 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9ALEREILkh0+eQAAAIXSURBVHictZU9aFNRFMd/N81HX77aptJUWmp1LHRpIcWhg5sIDlUQ'.
- 'LAXB4t7RRUpwEhy7iQ46CCIoSHcl0CFaoVARU2MFMYktadLXJNok7x2HtCExvuYFmnO4w/3gx+Gc/z1HKRTdMEdXqHbB/sgc/sic'.
- 'nDoYAI8XwDa8o1RMLT+2hAsigtTvbIGVqhX46szUifBGswUeCPgAGB7QeLk0X4Ork+HOxo1VgSqGASjMqkn8W4r4vVtEgI/RRQEL'.
- 'vaoGD85cl5V3nySR/S1mxWxab7f35PnntNyMJeRr9kCMqiHTy09EoeToLwggx6ymiMOD/VwcD7Oa/MHkcIiQx026WGYto5P/U+ZZ'.
- '7gD0QwDuT5z9N3LrVPi0Xs543eQPKkRzaS54eviJIp4tMFQFMllAWN2qcRZHBnixNM8NYD162xq8u7ePSQ+GX2Pjwxc2dB2cLtB8'.
- '7GgamCb0anBYBeChMtl8855CarclxU1gvViiUK4w2OMkNDnGeJ8bt9fH90yOnOkCwLFTwhzykhvtYzOWoBBbY//R3dbaNTYhf2RO'.
- 'QpeuUMzv188MlwuHy0H13HnE48UzMcL0WAtUHX8OxZHoG1URiFw7rnLLCswuSPD1ulze/iWjT2PSf+dBXRFtVVGIvzqph0pQL7VE'.
- 'avXYaXXxPwsnt0imdttCocMmZBdK7YU9D8wuNOW0nXc6QWzPsSa5naZ1beb9BbGB6dxGtMnXAAAAAElFTkSuQmCC' ;
- //==========================================================
- // mail.png
- //==========================================================
- $this->iBuiltinIcon[3][0]= 1122 ;
- $this->iBuiltinIcon[3][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'.
- 'AAALEAAACxABrSO9dQAAAAd0SU1FB9AJHAMfFvL9OU8AAAPfSURBVHictZRdaBRXFMd/987H7tbNx8aYtGCrEexDsOBDaKHFxirb'.
- 'h0qhsiY0ykppKq1osI99C4H2WSiFFMHWUhXBrjRi0uCmtSEUGgP1QWqhWjGkoW7M1kTX3WRn5p4+TJJNGolQ6IXDnDtz+N0z/3PP'.
- 'UWBIpdpYa23b9g09PZ2kUrOrvmUyGVKp1Ao/mUyi56YnVgWfO/P1CihAd/dJMpmaNROIRq8BkM1m0bH6TasC3j6QXgFdXI+DR6PR'.
- 'JX/Pno8B+KLnMKqlpUU8z8MYs2RBEDzWf9J+0RcRbMdxGBsbw/fmCXwPMUEYID4iAVp8wIRmDIHMo4yHSIBSASKC+CWE0C/PF9jU'.
- '3B6Cp+4M07C5FUtKGNvGwQJctPgIsgD2wRhEIqAMGB+UQYkHJgYYZD7P1HwVlmWhHcfhyk83KeRGUW4t6CgoG5SNUS4KBWgQDUov'.
- '7AGlwYASBVqH0Bk49dXpCviVV3dw/tI1Bvr7kMIIlh0NYUpjlF0BAYvcxSXmEVLKceHSCJm+PnbueBHbtkNwTXUNBzo6aGpq4sSZ'.
- 'GwT5H7BsF6Wdf1GWHQAoM0upeI9PT1yioS7B7tdaSdSuw7KsUGMAy7HYsmUztTW1nMwM0txssX1rlHjjS5jy/Uq2YkK/eJuLl6/z'.
- 'x+1xkslW6mrixGIODx8EFSlEBC0+tmXT0NhA2763iEUjnLv4C8XpUbSbAB1mKkGJ3J83Od77HW5EszvZSqK2iljMIeJaRGNuJePF'.
- '6mspY7BJ1DXwQnCd2fxGRq5OUCz8xt72dyhMZcn++Cu3xu9SKhdp2b4ZHWnAtTSxmIWlhcIjlksR3lNBYzlxZsb7+f7ne+xtSzOd'.
- 'u83szH1OnThOPp/n+a0beeP1l4mvq+PU2Qyd+5PY1RuwlAqLYFaBfbTbyPSdfgaH77A//QF4f1O/vpr6RJyq+C5Kc/M8FbFxXItY'.
- 'xOHDrvfo/fxLDnbsJBp5BowBReVWYAzabeTh5ABDw7cWoNNL3YYYNtSv57lnn6Z+Qx01VeuIuBa2DV1HD3H63BAPZu4u1WGpeLHq'.
- 'Rh7+NcjA0O+0p4+CNwXigwnbWlQQdpuEpli+n+PIkcOc//YKuckJJFh2K2anrjFw+QZt6S6kPImIF/b+cqAJD1LihWAxC61twBTo'.
- 'fPcQF/oGsVW5ovHQlavs2/8+uYnRVSOUgHAmmAClBIOBwKC0gPjhIRgEIX2wg7NnwpZW3d3d4vs+vu8TBMGK51rvPM9b8hdteZxd'.
- 'LBbVR8feJDs0Rlv6GFKeXJ21rNRXESxMPR+CBUl0nN7PjtO+dye7Up/8v1I88bf/ixT/AO1/hZsqW+C6AAAAAElFTkSuQmCC' ;
- //==========================================================
- // startconstrain.png
- //==========================================================
- $this->iBuiltinIcon[4][0]= 725 ;
- $this->iBuiltinIcon[4][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'.
- 'AAALDgAACw4BQL7hQQAAAAd0SU1FB9ALEREICJp5fBkAAAJSSURBVHic3dS9a1NRGMfx77kxtS+xqS9FG6p1ER3qVJpBQUUc3CRU'.
- 'BwURVLB1EAuKIP0THJQiiNRJBK3iJl18AyeltRZa0bbaJMbUNmlNSm5e7s25j0NqpSSmyag/OMM9POdzDuflwn8djz8gClVRrVEV'.
- 'ur4Bl1FTNSzLrSS6vbml0jUUwSXj8Qfk3PkLtLW2AeBIybmrgz3+gFzpucjlE4f4btuFTuWuCF5XDr3a3UPf6cM8GQvxzbsRAJdh'.
- 'ScfxSywml5j7mVypN0eGEJ0tebIre+zxB6Tv7jPReS2hREpOvpmUXU+H5eC913JnNCSRVE60pUVbWoZjprR39Yq70bdqj4pW7PEH'.
- '5FpvL9e79jOTTHM7ssDL6CJZ08LbvAGnrpZg2mI2Z/MlZfN8IkxuSwu4V9+WIrj7zFlOHfXzKrLIi2SGh5ECKjnNVNxkQEc55vOw'.
- 'rb6O8JLFdHyJ+ayFElUeHvjwkfteL/V7fKTSkFvIQE4DoLI2Mz/muTkTApcBKIwaN8pwIUrKw+ajWwDknAO0d/r4zFaMuRS63sWm'.
- 'RoOdm+vRIriUYjKexrQV+t1o0YEVwfZSVJmD/dIABJuO0LG3lRFx0GOfiAELE9OgCrfU0XnIp5FwGLEy5WEAOxlR5uN+ARhP7GN3'.
- '5w7Gv4bQI2+xpt4jjv2nWBmIlcExE2vDAHYioszBZXw6CPE4ADoWVHmd/tuwlZR9eXYyoszBfpiNQqaAOU5+TXRN+DeeenADPT9b'.
- 'EVgKVsutKPl0TGWGhwofoquaoKK4apsq/tH/e/kFwBMXLgAEKK4AAAAASUVORK5CYII=' ;
- //==========================================================
- // calc.png
- //==========================================================
- $this->iBuiltinIcon[5][0]= 589 ;
- $this->iBuiltinIcon[5][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAA4AIwBbgMF12wAAAAlwSFlz'.
- 'AAALEQAACxEBf2RfkQAAAAd0SU1FB9AHBxQeFsqn0wQAAAHKSURBVHicnZWff+RAGIef3U/gcOEgUAgUCgcLhYXCwsHBQeGgUDgs'.
- 'FgMHB4VA/4Bg4XChWFgIFIqBwkJhsRAYeOGF+TQHmWSTTbKd9pU37/x45jvfTDITXEynAbdWKVQB0NazcVm0alcL4rJaRVzm+w/e'.
- '3iwAkzbYRcnnYgI04GCvsxxSPabYaEdt2Ra6D0atcvvvDmyrMWBX1zPq2ircP/Tk98DiJtjV/fim6ziOCL6dDHZNhxQ3arIMsox4'.
- 'vejleL2Ay9+jaw6A+4OSICG2cacGKhsGxg+CxeqAQS0Y7BYJvowq7iGMOhXHEfzpvpQkA9bLKgOgWKt+4Lo1mM9hs9m17QNsJ70P'.
- 'Fjc/O52joogoX8MZKiBiAFxd9Z1vcj9wfSpUlDRNMcYQxzFpmnJ0FPH8nDe1MQaWSz9woQpWSZKEojDkeaWoKAyr1tlu+s48wfVx'.
- 'u7n5i7jthmGIiEGcT+36PP+gFeJrxWLhb0UA/lb4ggGs1T0rZs0zwM/ZjNfilcIY5tutPxgOW3F6dUX464LrKILLiw+A7WErrl+2'.
- 'rABG1EL/BilZP8DjU2uR4U+2E49P1Z8QJmNXUzl24A9GBT0IruCfi86d9x+D12RGzt+pNAAAAABJRU5ErkJggg==' ;
- //==========================================================
- // mag.png
- //==========================================================
- $this->iBuiltinIcon[6][0]= 1415 ;
- $this->iBuiltinIcon[6][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlz'.
- 'AAALDAAACwwBP0AiyAAAAAd0SU1FB9ALDxEWDY6Ul+UAAAUESURBVHicdZVrbFRFGIafsyyF0nalV1R6WiggaAptlzsr1OgEogmC'.
- '0IgoBAsBgkIrBAPEhBj/AP6xRTCUFEwRI4jcgsitXMrFCJptJWvBNpXYbbXtbtttt6e7e86ec/yxadlCfZPJZDIz73zzzjfvR2VL'.
- 'F7U+hf0HD2JduIzTFy6SlJRkPtkcDgdCCE65OxFC8NPV6wghyM7OptankJ2dzbSC5QghEEIgCSHog9PpNAF27dlN6miZuPgElB4/'.
- 'nmY3O7ZtByA1NVUCkGWZweD1eklJScESTbqxuIjrd+/x6uIl5M19hSy7nfGOeUxf+g7VjU1sKi7C4/GYsiyz7tAJAD4/cRaA1tZW'.
- 'AHIPnECUVGD1+/3U19ebG4uLeHf1akamjsIwoVnVCOvQEdLoVILYYmMo3PIxSBJflpSaDX5FAmju1QAYv/8k/s8+wLVxOU0jR2LZ'.
- '8sMFAApWrCApbRRDrRZirBYSLBKaoRPQw3SFernf2sav7T0Ubt4KwL4FMwF4Vu8FoHBCKgCzDhwHwLIhZ7y5a89u4m2JhA0wTdDC'.
- 'OrphEjJMNElCHxKDEjaobmvlfo/Krj27CQQCJsCGJW8C0KXqAMxMiosQA8hZWcTFx9OsaniDKh1qmG7VoFsL0x0K06kbeAMhWpRe'.
- '/KpG+gwHAKUnz7Dz3BUMw6DK18nuw99wt0Nh6VdHI8RJicmETQgFg7SFwjSrGv+oKp6ghldV6dZ0ugJBlF6FmCESQ2w2AIqXLsan'.
- 'BrFYLJTnTCBrdBqveeopWZiPFaBHUegJhegMqGgxEkHDwB/UaQ9rdIV06v0+TD2EEQjQFtAY0dsNgNvt5sialQAIIXh7wQKuVf6J'.
- 'gTsSccPDWlQstClBGjr9eHpVWvUQncEwdYEedF8noQ4vmYmpZMTH0nTvDn25vLbrNmu7bvfnsYEbAMnhcPDgwQPzUo2LJusw/mhp'.
- 'QwlHNO0KBAnoIfxtrcQMT2De1Mm891wyUzNlUlJSpIyMDBobGzlzr5rFM/Koq6vrP8ASGxsLwPmKcvIShjPGZiPOakE3VFB8hHwd'.
- 'vJAxhrk5L7Ly+RQuH/sWgPdXrwFg/6HDFBUsIj09nehfbAWwPWOT9n5RYhqGwarNWxkRM5TRCfF4U1PQsDDJFk9uYhwXvzvKjm3b'.
- 'KSsro3DJInNW5RXp7u2bAKSlpeH1esnPz6eqqgqLpmmcr3Fht9ulfaV7mZk1Bs+lM6T1djM9fhg5egDPpTNMy5TZsW07kydPYdWM'.
- 'aXx96ixOp9O8cfUa80srmDpjOgAulytiQqZpMnvObLbt/JTtHxXj9/tRVdU0DGOAufRpevPDTeac0hJyc3NxOOawfv161lVWS6eX'.
- 'z+9/UOCxu1VWVvaTRGv16NFfjB2bNeAQp9NpTpmSM4DcbrdL0WsGDKLRR+52uwe1yP8jb2lpYfikyY9t80n03UCWZeaXVjw1f+zs'.
- 'Oen+/d+pqanhzp2fKSsrw+l0mi6XiyPl5ZGITdN8fAVJwjRNJEmi1qfw1kw7siyTnJxMe3s71dXV3GpoZO64DG41NPJylvxU5D/e'.
- 'qJKsfWQD9IkaZ2RmUvr9aV4aGYcQgjfO3aWoYBF5eXm4ewIsu/CbdPz1aWb0/p1bNoOrQxlUiuiaFo3c3FyEEOx9+C9CCD6paaTW'.
- 'p/TXyYkTJ0Xe59jf7QOyAKDWp/QXxcFQ61P4pT3ShBBcvnUHIQTjxmX19/8BCeVg+/GPpskAAAAASUVORK5CYII=' ;
- //==========================================================
- // lock.png
- //==========================================================
- $this->iBuiltinIcon[7][0]= 963 ;
- $this->iBuiltinIcon[7][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'.
- 'AAALCwAACwsBbQSEtwAAAAd0SU1FB9AKAw0XDmwMOwIAAANASURBVHic7ZXfS1t3GMY/3+PprI7aisvo2YU6h6ATA8JW4rrlsF4U'.
- 'qiAsF9mhl0N2cYTRy9G/wptAYWPD9iJtRy5asDe7cYFmyjaXOLaMImOrmkRrjL9yTmIS3120JybWQgfb3R74wuc8Lzw858vLOUpE'.
- 'OK6pqSm2trbY39+nu7tbPHYch7m5OcLhMIA67kWj0aMQEWk6tm17rNm2LSIie3t7ksvlJJ1OSyqVkls3Z8SyLMnlcqTTaVKpFLdu'.
- 'zmBZVj1HeY2VUti2TSQSQSml2bZdi0QirK2tMT09zerqKtlslqGhISYnJ4nHv2N+foFsNquOe9FotLlxOBwmk8lgWRbhcFgymYxY'.
- 'liUi0mqaJoAuIi2macrdO7fFsizx3to0Te7euV1vrXtXEgqFmJmZYWVlhXK5LB4/U9kwDL784kYV0A3DYHd3m4sXRymXywKoRi8U'.
- 'Ch01DgQCJBIJLMsiEAhIIpHw2uLz+eqtYrEYIqKZpimxWEyCwaCMjY01zYPBIJpXqVQqsby8TLVabWKA/v5+RkZGMAyDrq4ulFKH'.
- 'HsfjcWZnZ+ns7KTRqwcnk0mKxSKFQqGJlVKtruuSTCYB6O3trW9UI/v9/iZPB/j8s2HOnX0FgHfeXpeffnzK+fWf+fijvhLs0PtG'.
- 'D/n1OJ9+MsrlSwb3733DwMCAt1EyPj6uACYmJp56168NU6nUqFSE9nZdPE7+WqC/r4NKTagcCJVqDaUUB5VDAA4Pa9x7sMLlSwan'.
- 'WjRmv13D7/erpaWlo604qOp88OF7LC48rPNosMq5Th+Dgxd4/XyA1rbzADi7j8jnf2P++wdcvSr8MJ/i8eomAKlUqn41OsDAQDeD'.
- 'g++yuPCwzm/2vU8+n2a7sMFfj79mp7BBuVzioFSiXHJx3SKuW2Rzy0Up9dxnQVvODALQerqNRn4ZKe0Mvtc6TpzpmqbxalcY9Ato'.
- '2v06t515C73YQftZB9GLnDrt4LoujuPgOA4Ui+C6yOpXJwZrJ7r/gv4P/u+D9W7fLxTz+1ScQxrZ3atRLaVxdjbY2d184R6/sLHe'.
- 'opHP7/Do90Ua+WWUyezzZHObP/7cfX54/dowE1d66s8TV3oE+Mfn+L/zb4XmHPjRG9YjAAAAAElFTkSuQmCC' ;
- //==========================================================
- // stop.png
- //==========================================================
- $this->iBuiltinIcon[8][0]= 889 ;
- $this->iBuiltinIcon[8][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz'.
- 'AAALDwAACw8BkvkDpQAAAAd0SU1FB9AJDwEvNyD6M/0AAAL2SURBVHic1ZTLaxVnGIefb2bO5OScHJN4oWrFNqcUJYoUEgU3/Qf6'.
- 'F7gwCkIrvdBLUtqqiLhSg9bgBduFSHZdiG5ctkJ3xRDbUFwUmghNzBDanPGMkzOX79LFJGPMOSd204U/+Bbzvd/78F4H/ieJdoad'.
- 'pZKxRFszAI/DcP0HazXY22v+HB01kee1PA/v3zfnjx4xgGnHcNZe7OvuNj+cOEF1ZATv5nUA4jhBSgmADCVWo8Ge2Of9wb18P/G7'.
- 'oUXmYi30zqlTVEdGWLh1g2D6MYlKkXGE0Vl8aa2GEB149+4xXSzyoOIw/mimiZV/DPb25pFOj13A9gOMEChhUEqhVYqWKUk9QAUp'.
- 'sT/P4s8PmKlUmNhQaIJbkDVqBbpw6wZ2zUc4Nm+ePku5p4eOrgpueQOFUoVCVxcD4+N07dpF9+5tVJeWGPBjhvr7WF1zC8ASgtcP'.
- 'H8a7eZ1odh4sh50nzwCw9ZNh3M4Stutiu0X2nB/LyjZ6lcIbVTpdQU/jWVPzLADM8+ZGBRdtC7wrF/O7bR99iu26VL86iU4SAH4b'.
- 'Po5d6AQhstMSvGyI4wS5FJBKSRwnzF8byx/u+PjzzMF1mfryQ1K/jnCahqp1xEopjFLoNEFJSRJHzF799gWHqa+/QKcSUXBI609f'.
- 'Al5W4teQSiHDOipNUKnMI13RvnOXAIEKQixvGWya98SC560MFwPiqEG86JM8q79Q06lvhnOndy5/B6GPCUOMUu3BQgg8z0M3GmBZ'.
- 'iGJn3v2VmsqnfzNx7FDueODuj8ROCFpjtG5TCmOYv32bJ09msP0ISydMfnAUgF8/O45RAA6WTPjlvXcB+Gn7FuRf/zAnNX6x3ARe'.
- 'PSdmqL+P/YHkwMGDOGWDZTlQcNBRhPEComgB/YeHfq2InF1kLlXUOkpMbio1bd7aATRD/X0M1lPeSlM2vt2X1XBZjZnpLG2tmZO6'.
- 'LbQVOIcP+HG2UauH3xgwBqOz9Cc3l1tC24Fz+MvUDroeGNb5if9H/1dM/wLPCYMw9fryKgAAAABJRU5ErkJggg==' ;
- //==========================================================
- // error.png
- //==========================================================
- $this->iBuiltinIcon[9][0]= 541 ;
- $this->iBuiltinIcon[9][1]=
- 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaVBMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'.
- 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpYiYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'.
- 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTCAkUMSj9wWSOAAABLUlEQVR4'.
- '2s2U3ZKCMAxGjfzJanFAXFkUle/9H9JUKA1gKTN7Yy6YMjl+kNPK5rlZVSuxf1ZRnlZxFYAm93NnIKvR+MEHUgqBXx93wZGIUrSe'.
- 'h+ctEgbpiMo3iQ4kioHCGxir/ZYUbr7AgPXs9bX0BCYM8vN/cPe8oQYzom3tVsSBMVHEoOJ5dm5F1RsIe9CtqGgRacCAkUvRtevT'.
- 'e2pd6vOWF+gCuc/brcuhyARakBU9FgK5bUBWdHEH8tHpDsZnRTZQGzdLVvQ3CzyYZiTAmSIODEwzFCAdJopuvbpeZDisJ4pKEcjD'.
- 'ijWPJhU1MjCo9dkYfiUVjQNTDKY6CVbR6A0niUSZjRwFanR0l9i/TyvGnFdqwStq5axMfDbyBksld/FUumvxS/Bd9VyJvQDWiiMx'.
- 'iOsCHgAAAABJRU5ErkJggg==' ;
- //==========================================================
- // openfolder.png
- //====…
Large files files are truncated, but you can click here to view the full file