|
|
|
@ -2128,8 +2128,8 @@ class GanttScale {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get day in week for start and ending date (Sun==0) |
|
|
|
|
$ds=strftime("%w",$this->iStartDate); |
|
|
|
|
$de=strftime("%w",$this->iEndDate); |
|
|
|
|
$ds=strftime_("%w",$this->iStartDate); |
|
|
|
|
$de=strftime_("%w",$this->iEndDate); |
|
|
|
|
|
|
|
|
|
// We want to start on iWeekStart day. But first we subtract a week |
|
|
|
|
// if the startdate is "behind" the day the week start at. |
|
|
|
@ -2216,11 +2216,11 @@ class GanttScale {
|
|
|
|
|
|
|
|
|
|
// Get week number |
|
|
|
|
function GetWeekNbr($aDate,$aSunStart=true) { |
|
|
|
|
// We can't use the internal strftime() since it gets the weeknumber |
|
|
|
|
// We can't use the internal strftime_() since it gets the weeknumber |
|
|
|
|
// wrong since it doesn't follow ISO on all systems since this is |
|
|
|
|
// system linrary dependent. |
|
|
|
|
// Even worse is that this works differently if we are on a Windows |
|
|
|
|
// or UNIX box (it even differs between UNIX boxes how strftime() |
|
|
|
|
// or UNIX box (it even differs between UNIX boxes how strftime_() |
|
|
|
|
// is natively implemented) |
|
|
|
|
// |
|
|
|
|
// Credit to Nicolas Hoizey <nhoizey@phpheaven.net> for this elegant |
|
|
|
@ -2278,17 +2278,17 @@ class GanttScale {
|
|
|
|
|
|
|
|
|
|
// Get day in month |
|
|
|
|
function GetMonthDayNbr($aDate) { |
|
|
|
|
return 0+strftime("%d",$aDate); |
|
|
|
|
return 0+strftime_("%d",$aDate); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get day in year |
|
|
|
|
function GetYearDayNbr($aDate) { |
|
|
|
|
return 0+strftime("%j",$aDate); |
|
|
|
|
return 0+strftime_("%j",$aDate); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get month number |
|
|
|
|
function GetMonthNbr($aDate) { |
|
|
|
|
return 0+strftime("%m",$aDate); |
|
|
|
|
return 0+strftime_("%m",$aDate); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Translate a date to screen coordinates (horizontal scale) |
|
|
|
@ -2599,63 +2599,63 @@ class GanttScale {
|
|
|
|
|
$x+$daywidth,$yb-$this->day->iFrameWeight); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$mn = strftime('%m',$datestamp); |
|
|
|
|
$mn = strftime_('%m',$datestamp); |
|
|
|
|
if( $mn[0]=='0' ) |
|
|
|
|
$mn = $mn[1]; |
|
|
|
|
|
|
|
|
|
switch( $this->day->iStyle ) { |
|
|
|
|
case DAYSTYLE_LONG: |
|
|
|
|
// "Monday" |
|
|
|
|
$txt = strftime('%A',$datestamp); |
|
|
|
|
$txt = strftime_('%A',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORT: |
|
|
|
|
// "Mon" |
|
|
|
|
$txt = strftime('%a',$datestamp); |
|
|
|
|
$txt = strftime_('%a',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDAYDATE1: |
|
|
|
|
// "Mon 23/6" |
|
|
|
|
$txt = strftime('%a %d/'.$mn,$datestamp); |
|
|
|
|
$txt = strftime_('%a %d/'.$mn,$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDAYDATE2: |
|
|
|
|
// "Mon 23 Jun" |
|
|
|
|
$txt = strftime('%a %d %b',$datestamp); |
|
|
|
|
$txt = strftime_('%a %d %b',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDAYDATE3: |
|
|
|
|
// "Mon 23 Jun 2003" |
|
|
|
|
$txt = strftime('%a %d %b %Y',$datestamp); |
|
|
|
|
$txt = strftime_('%a %d %b %Y',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_LONGDAYDATE1: |
|
|
|
|
// "Monday 23 Jun" |
|
|
|
|
$txt = strftime('%A %d %b',$datestamp); |
|
|
|
|
$txt = strftime_('%A %d %b',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_LONGDAYDATE2: |
|
|
|
|
// "Monday 23 Jun 2003" |
|
|
|
|
$txt = strftime('%A %d %b %Y',$datestamp); |
|
|
|
|
$txt = strftime_('%A %d %b %Y',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDATE1: |
|
|
|
|
// "23/6" |
|
|
|
|
$txt = strftime('%d/'.$mn,$datestamp); |
|
|
|
|
$txt = strftime_('%d/'.$mn,$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDATE2: |
|
|
|
|
// "23 Jun" |
|
|
|
|
$txt = strftime('%d %b',$datestamp); |
|
|
|
|
$txt = strftime_('%d %b',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDATE3: |
|
|
|
|
// "Mon 23" |
|
|
|
|
$txt = strftime('%a %d',$datestamp); |
|
|
|
|
$txt = strftime_('%a %d',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_SHORTDATE4: |
|
|
|
|
// "23" |
|
|
|
|
$txt = strftime('%d',$datestamp); |
|
|
|
|
$txt = strftime_('%d',$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_CUSTOM: |
|
|
|
|
// Custom format |
|
|
|
|
$txt = strftime($this->day->iLabelFormStr,$datestamp); |
|
|
|
|
$txt = strftime_($this->day->iLabelFormStr,$datestamp); |
|
|
|
|
break; |
|
|
|
|
case DAYSTYLE_ONELETTER: |
|
|
|
|
default: |
|
|
|
|
// "M" |
|
|
|
|
$txt = strftime('%A',$datestamp); |
|
|
|
|
$txt = strftime_('%A',$datestamp); |
|
|
|
|
$txt = strtoupper($txt[0]); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -2808,7 +2808,7 @@ class GanttScale {
|
|
|
|
|
|
|
|
|
|
$img->SetLineWeight($this->month->grid->iWeight); |
|
|
|
|
$img->SetColor($this->month->iTextColor); |
|
|
|
|
$year = 0+strftime("%Y",$this->iStartDate); |
|
|
|
|
$year = 0+strftime_("%Y",$this->iStartDate); |
|
|
|
|
$img->SetTextAlign("center"); |
|
|
|
|
if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate) |
|
|
|
|
&& $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) { |
|
|
|
|