phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.66.2.30,


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.66.2.30,1.66.2.31
Date: Tue, 29 Oct 2002 09:47:25 -0500

Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv27213

Modified Files:
      Tag: Version-0_9_14-branch
        class.uicalendar.inc.php 
Log Message:
some fixes on the optic of the planner:
- themable colors like the rest of the calendar used
- highlight additionaly today and holidays
- enlarged month-name and added to link to quickly change the month


Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.66.2.30
retrieving revision 1.66.2.31
diff -C2 -r1.66.2.30 -r1.66.2.31
*** class.uicalendar.inc.php    29 Oct 2002 13:09:17 -0000      1.66.2.30
--- class.uicalendar.inc.php    29 Oct 2002 14:47:22 -0000      1.66.2.31
***************
*** 1356,1364 ****
                                        $m = $this->bo->month;
                                        $y = $this->bo->year;
                                        for ($i=1; $i<=$this->bo->num_months; 
$i++,$m++)
                                        {
                                                if ($m == 13)
                                                {
!                                                 $m = 1; $y++; // 
"wrap-around" into new year
                                                }
                                                $days = 
$GLOBALS[\'phpgw\']->datetime->days_in_month($m,$y);
--- 1356,1366 ----
                                        $m = $this->bo->month;
                                        $y = $this->bo->year;
+                                       $this->bo->read_holidays($y);
                                        for ($i=1; $i<=$this->bo->num_months; 
$i++,$m++)
                                        {
                                                if ($m == 13)
                                                {
!                                                       $m = 1; $y++; // 
"wrap-around" into new year
!                                                       
$this->bo->read_holidays($y);
                                                }
                                                $days = 
$GLOBALS[\'phpgw\']->datetime->days_in_month($m,$y);
***************
*** 1366,1374 ****
                                                $d     = mktime(0,0,0,$m,1,$y);
                                                $month = lang(date(\'F\', 
$d)).strftime(\' %Y\', $d);
!                                               $color = 
$m%2==0?"ccffff":"ccffcc";
                                                $cols  = $days * 
$intervals_per_day;
  
!                                               $hdr[0][\'.\'.$i] = 
\'bgcolor="#\'.$color.\'" colspan="\'.$cols.\'" align="center"\';
!                                               $hdr[0][$i]  = \'<font 
size="-2"> \'.$month.\'</font>\';
  
                                                for ($d=1; $d<=$days; $d++)
--- 1368,1380 ----
                                                $d     = mktime(0,0,0,$m,1,$y);
                                                $month = lang(date(\'F\', 
$d)).strftime(\' %Y\', $d);
!                                               $color = $this->theme[$m % 2 || 
$this->bo->num_months == 1 ? \'th_bg\' : \'row_on\'];
                                                $cols  = $days * 
$intervals_per_day;
  
!                                               $hdr[0][\'.\'.$i] = 
\'bgcolor="\'.$color.\'" colspan="\'.$cols.\'" align="center"\';
!                                               $prev_month = 
sprintf(\'%04d%02d01\',$y-($m==1),$m > 1?$m-1:12);
!                                               $next_month = 
sprintf(\'%04d%02d01\',$y+($m==12),$m < 12?$m+1:1);
!                                               $prev_link = 
$GLOBALS[\'phpgw\']->session->link("/index.php?menuaction=calendar.uicalendar.planner&date=$prev_month");
!                                               $next_link = 
$GLOBALS[\'phpgw\']->session->link("/index.php?menuaction=calendar.uicalendar.planner&date=$next_month");
!                                               $hdr[0][$i] = "<b><a 
href=\"$prev_link\">&lt;&lt;</a> &nbsp $month &nbsp <a 
href=\"$next_link\">&gt;&gt;</a></b>";
  
                                                for ($d=1; $d<=$days; $d++)
***************
*** 1379,1396 ****
                                                        $hdr[2][\'.\'.$index] = 
\'colspan="\'.$intervals_per_day.\'" align="center"\';
  
!                                                       // highlight saturdays 
and sundays using bgcolor
!                                                       // FIXME: what about 
holidays?
                                                        //
                                                        $dow = 
$GLOBALS[\'phpgw\']->datetime->day_of_week($y,$m,$d);
!                                                       if ($dow == 0 || $dow 
== 6)
                                                        {
!                                                               
$hdr[2][\'.\'.$index] .= \'" bgcolor=\';
!                                                               
$hdr[2][\'.\'.$index] .= $dow == 0 ? \'"#ff8866"\' : \'"#ffcccc"\';
                                                        }
  
                                                        $hdr[2][$index] = \'<a 
href="\'.$this->planner_html->link(\'/index.php\',
                                                                                
array(
                                                                                
        \'menuaction\' => \'calendar.uicalendar.add\',
!                                                                               
        \'date\' => sprintf("%04d%02d%02d",$y,$m,$d)
                                                                                
)
                                                                        
).\'">\'.$dayname.\'<br>\'.$d.\'</a>\';
--- 1385,1408 ----
                                                        $hdr[2][\'.\'.$index] = 
\'colspan="\'.$intervals_per_day.\'" align="center"\';
  
!                                                       // highlight today, 
saturday, sunday and holidays
                                                        //
+                                                       $color = 
$this->theme[\'row_off\'];
                                                        $dow = 
$GLOBALS[\'phpgw\']->datetime->day_of_week($y,$m,$d);
!                                                       $date = 
sprintf("%04d%02d%02d",$y,$m,$d);
!                                                       if ($date == 
date(\'Ymd\'))
                                                        {
!                                                               $color = 
$GLOBALS[\'phpgw_info\'][\'theme\'][\'cal_today\'];
!                                                       }
!                                                       elseif ($dow == 0 || 
$dow == 6 || $this->bo->cached_holidays[$date])
!                                                       {
!                                                               $color = 
$this->theme[\'holiday_color\'];
                                                        }
  
+                                                       $hdr[2][\'.\'.$index] 
.= " bgcolor=\"$color\"";
+                                                       
                                                        $hdr[2][$index] = \'<a 
href="\'.$this->planner_html->link(\'/index.php\',
                                                                                
array(
                                                                                
        \'menuaction\' => \'calendar.uicalendar.add\',
!                                                                               
        \'date\' => $date
                                                                                
)
                                                                        
).\'">\'.$dayname.\'<br>\'.$d.\'</a>\';
***************
*** 1417,1423 ****
                                        $offset = (7-date("w", $d)+1)%7;
                                        $offset = $offset == 0 ? 7 : $offset;
!                                       $color = $w%2==0?"ccccff":"ffffcc";
  
!                                       $hdr[1][\'.\'.$w] = 
\'bgcolor="#\'.$color.\'" colspan="\'.$intervals_per_day * $offset.\'" 
align="left"\';
                                        $hdr[1][$w] = \'\';
                                        if ($offset >= 3)
--- 1429,1435 ----
                                        $offset = (7-date("w", $d)+1)%7;
                                        $offset = $offset == 0 ? 7 : $offset;
!                                       $color = $this->theme[$w % 2 ? 
\'th_bg\' : \'row_on\'];
  
!                                       $hdr[1][\'.\'.$w] = 
\'bgcolor="\'.$color.\'" colspan="\'.$intervals_per_day * $offset.\'" 
align="left"\';
                                        $hdr[1][$w] = \'\';
                                        if ($offset >= 3)
***************
*** 1439,1444 ****
                                                $w += (isset($hdr[1][$w]))?1:0; 
// bug in "date(\'W\')" ?
  
!                                               $color = 
$w%2==0?"ccccff":"ffffcc";
!                                               $hdr[1][\'.\'.$w] = 
\'bgcolor="#\'.$color.\'" colspan="\'.$colspan.\'" align="left"\';
                                                $hdr[1][$w] = \'\';
                                                if ($days_left >= 3)
--- 1451,1456 ----
                                                $w += (isset($hdr[1][$w]))?1:0; 
// bug in "date(\'W\')" ?
  
!                                               $color = $this->theme[$w % 2 ? 
\'th_bg\' : \'row_on\'];
!                                               $hdr[1][\'.\'.$w] = 
\'bgcolor="\'.$color.\'" colspan="\'.$colspan.\'" align="left"\';
                                                $hdr[1][$w] = \'\';
                                                if ($days_left >= 3)
***************
*** 1795,1799 ****
                                                reset($rows);
                                        }
!                                       echo $this->planner_html->table(
                                                array(
                                                        \'_hdr0\' => 
$this->planner_header[0],
--- 1807,1811 ----
                                                reset($rows);
                                        }
!                                       echo "<p>".$this->planner_html->table(
                                                array(
                                                        \'_hdr0\' => 
$this->planner_header[0],





reply via email to

[Prev in Thread] Current Thread [Next in Thread]