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.71,1.72


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.71,1.72
Date: Tue, 16 Apr 2002 12:52:39 -0400

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

Modified Files:
        class.uicalendar.inc.php 
Log Message:
This part of a major fix for the calendar.

Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -r1.71 -r1.72
*** class.uicalendar.inc.php    13 Apr 2002 03:20:53 -0000      1.71
--- class.uicalendar.inc.php    16 Apr 2002 16:52:36 -0000      1.72
***************
*** 30,33 ****
--- 30,34 ----
  
                var $cat_id;
+               var $datetime;
                var $tz_offset;
                var $theme;
***************
*** 68,72 ****
  
                        $this->bo = CreateObject('calendar.bocalendar',1);
!                       $this->tz_offset = $this->bo->datetime->tz_offset;
  
                        if($this->debug)
--- 69,74 ----
  
                        $this->bo = CreateObject('calendar.bocalendar',1);
!                       $this->datetime = $this->bo->datetime;
!                       $this->tz_offset = $this->datetime->tz_offset;
  
                        if($this->debug)
***************
*** 128,132 ****
                        $this->bo->read_holidays($params['year']);
  
!                       $date = 
$this->bo->datetime->makegmttime(0,0,0,$params['month'],$params['day'],$params['year']);
                        $month_ago = 
intval(date('Ymd',mktime(0,0,0,$params['month'] - 
1,$params['day'],$params['year'])));
                        $month_ahead = 
intval(date('Ymd',mktime(0,0,0,$params['month'] + 
1,$params['day'],$params['year'])));
--- 130,134 ----
                        $this->bo->read_holidays($params['year']);
  
!                       $date = 
$this->datetime->makegmttime(0,0,0,$params['month'],$params['day'],$params['year']);
                        $month_ago = 
intval(date('Ymd',mktime(0,0,0,$params['month'] - 
1,$params['day'],$params['year'])));
                        $month_ahead = 
intval(date('Ymd',mktime(0,0,0,$params['month'] + 
1,$params['day'],$params['year'])));
***************
*** 134,138 ****
                        $monthend = 
intval(date('Ymd',mktime(0,0,0,$params['month'] + 1,0,$params['year'])));
  
!                       $weekstarttime = 
$this->bo->datetime->get_weekday_start($params['year'],$params['month'],1);
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
--- 136,146 ----
                        $monthend = 
intval(date('Ymd',mktime(0,0,0,$params['month'] + 1,0,$params['year'])));
  
!                       $weekstarttime = 
$this->datetime->get_weekday_start($params['year'],$params['month'],1);
! 
!                       if($this->debug)
!                       {
!                               echo '<!-- mini_calendar:monthstart = 
'.$monthstart.' -->'."\n";
!                               echo '<!-- mini_calendar:weekstarttime = 
'.date('Ymd H:i:s',$weekstarttime).' -->'."\n";
!                       }
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
***************
*** 199,213 ****
                        {
                                $var = Array(
!                                       'dayname'       => '<b>' . 
substr(lang($this->bo->datetime->days[$i]),0,2) . '</b>',
                                        'day_image'     => ''
                                );
                                
$this->output_template_array($p,'daynames','mini_day',$var);
                        }
!                       $today = date('Ymd',time());
                        unset($date);
!                       for($i=$weekstarttime;date('Ymd',$i)<=$monthend;$i += 
(24 * 3600 * 7))
                        {
                                unset($var);
!                               $daily = 
$this->set_week_array($i,$cellcolor,$weekly);
                                @reset($daily);
                                while(list($date,$day_params) = each($daily))
--- 207,221 ----
                        {
                                $var = Array(
!                                       'dayname'       => '<b>' . 
substr(lang($this->datetime->days[$i]),0,2) . '</b>',
                                        'day_image'     => ''
                                );
                                
$this->output_template_array($p,'daynames','mini_day',$var);
                        }
!                       $today = date('Ymd',$this->datetime->gmtnow + 
$this->tz_offset);
                        unset($date);
!                       for($i=$weekstarttime + 
$this->tz_offset;date('Ymd',$i)<=$monthend;$i += (24 * 3600 * 7))
                        {
                                unset($var);
!                               $daily = $this->set_week_array($i - 
$this->tz_offset,$cellcolor,$weekly);
                                @reset($daily);
                                while(list($date,$day_params) = each($daily))
***************
*** 379,384 ****
                        $this->bo->read_holidays();
  
!                       $next = 
$this->bo->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day + 
7,$this->bo->year);
!                       $prev = 
$this->bo->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day - 
7,$this->bo->year);
  
                        if (!$this->bo->printer_friendly || 
($this->bo->printer_friendly && 
@$this->bo->prefs['calendar']['display_minicals']))
--- 387,392 ----
                        $this->bo->read_holidays();
  
!                       $next = 
$this->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day + 
7,$this->bo->year);
!                       $prev = 
$this->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day - 
7,$this->bo->year);
  
                        if (!$this->bo->printer_friendly || 
($this->bo->printer_friendly && 
@$this->bo->prefs['calendar']['display_minicals']))
***************
*** 502,506 ****
                        }
  
!                       $now    = $this->bo->datetime->makegmttime(0, 0, 0, 
$this->bo->month, $this->bo->day, $this->bo->year);
                        $now['raw'] += $this->tz_offset;
                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year);
--- 510,514 ----
                        }
  
!                       $now    = $this->datetime->makegmttime(0, 0, 0, 
$this->bo->month, $this->bo->day, $this->bo->year);
                        $now['raw'] += $this->tz_offset;
                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year);
***************
*** 905,911 ****
                                $vfs->write($output_file, array 
(RELATIVE_USER), $content);
  //                            $vfs->write($output_file, array 
(RELATIVE_USER_APP), $content);
! //                            echo 'DEBUG: Output Filename = 
'.$output_file."<br>\n";
! //                            echo 'DEBUG: Fakebase = 
'.$vfs->fakebase."<br>\n";
! //                            echo 'DEBUG: Path = '.$vfs->pwd()."<br>\n";
  
                                Header('Location: '.$this->index());
--- 913,922 ----
                                $vfs->write($output_file, array 
(RELATIVE_USER), $content);
  //                            $vfs->write($output_file, array 
(RELATIVE_USER_APP), $content);
!                               if($this->debug)
!                               {
!                                       echo '<!-- DEBUG: Output Filename = 
'.$output_file.' -->'."\n";
!                                       echo '<!-- DEBUG: Fakebase = 
'.$vfs->fakebase.' -->'."\n";
!                                       echo '<!-- DEBUG: Path = 
'.$vfs->pwd().' -->'."\n";
!                               }
  
                                Header('Location: '.$this->index());
***************
*** 1160,1164 ****
                        }
  
!                       $now    = $this->bo->datetime->makegmttime(0, 0, 0, 
$this->bo->month, $this->bo->day, $this->bo->year);
                        $now['raw'] += $this->tz_offset;
                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year);
--- 1171,1175 ----
                        }
  
!                       $now    = $this->datetime->makegmttime(0, 0, 0, 
$this->bo->month, $this->bo->day, $this->bo->year);
                        $now['raw'] += $this->tz_offset;
                        $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year);
***************
*** 1218,1222 ****
                        }
  
!                       $freetime = 
$this->bo->datetime->localdates(mktime(0,0,0,$event['start']['month'],$event['start']['mday'],$event['start']['year'])
 - $this->tz_offset);
                        echo $this->timematrix(
                                Array(
--- 1229,1233 ----
                        }
  
!                       $freetime = 
$this->datetime->localdates(mktime(0,0,0,$event['start']['month'],$event['start']['mday'],$event['start']['year'])
 - $this->tz_offset);
                        echo $this->timematrix(
                                Array(
***************
*** 1278,1282 ****
  
                        $startdate = 
mktime(0,0,0,$this->bo->month,1,$this->bo->year) - $this->tz_offset;
!                       $days = 
$this->bo->datetime->days_in_month($this->bo->month,$this->bo->year);
                        $enddate   = 
mktime(23,59,59,$this->bo->month,$this->bo->days,$this->bo->year) - 
$this->tz_offset;
  
--- 1289,1293 ----
  
                        $startdate = 
mktime(0,0,0,$this->bo->month,1,$this->bo->year) - $this->tz_offset;
!                       $days = 
$this->datetime->days_in_month($this->bo->month,$this->bo->year);
                        $enddate   = 
mktime(23,59,59,$this->bo->month,$this->bo->days,$this->bo->year) - 
$this->tz_offset;
  
***************
*** 1318,1322 ****
                                if($this->debug)
                                {
!                                       echo "For Date : $v : Count of items : 
".count($daily)."<br>\n";
                                }
                                for($g=0;$g<count($daily);$g++)
--- 1329,1333 ----
                                if($this->debug)
                                {
!                                       echo \'<!-- For Date : \'.$v.\' : Count 
of items : \'.count($daily).\' -->\'."\n";
                                }
                                for($g=0;$g<count($daily);$g++)
***************
*** 1608,1612 ****
                        {
                                case 'free/busy':
!                                       $freetime = 
$this->bo->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year);
                                        echo $this->timematrix(
                                                Array(
--- 1619,1623 ----
                        {
                                case 'free/busy':
!                                       $freetime = 
$this->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year);
                                        echo $this->timematrix(
                                                Array(
***************
*** 1876,1881 ****
                        unset($thisdate);
                        $thisdate = 
mktime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year) - 
$this->tz_offset;
! //                    $sun = 
$this->bo->datetime->get_weekday_start($this->bo->year,$this->bo->month,$this->bo->day)
 - $this->tz_offset - 7200;
!                       $sun = 
$this->bo->datetime->get_weekday_start($this->bo->year,$this->bo->month,$this->bo->day)
 - $this->tz_offset;
  
                        $str = '';
--- 1887,1891 ----
                        unset($thisdate);
                        $thisdate = 
mktime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year) - 
$this->tz_offset;
!                       $sun = 
$this->datetime->get_weekday_start($this->bo->year,$this->bo->month,$this->bo->day)
 - $this->tz_offset;
  
                        $str = '';
***************
*** 1978,1982 ****
                {
                        $str = '';
!                       $is_private = 
$this->bo->is_private($event,$this->bo->owner);
                        $editable = ((!$this->bo->printer_friendly) && 
(($is_private && $this->bo->check_perms(PHPGW_ACL_PRIVATE)) || !$is_private));
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
--- 1988,1992 ----
                {
                        $str = '';
!                       $is_private = 
$this->bo->is_private($event,$event['owner']);
                        $editable = ((!$this->bo->printer_friendly) && 
(($is_private && $this->bo->check_perms(PHPGW_ACL_PRIVATE)) || !$is_private));
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
***************
*** 2128,2132 ****
                function overlap($params)
                {
- 
                        if(!is_array($params))
                        {
--- 2138,2141 ----
***************
*** 2211,2215 ****
                        if($this->debug)
                        {
!                               echo "Inside participants() : $names<br>\n";
                        }
                        return $names;
--- 2220,2224 ----
                        if($this->debug)
                        {
!                               echo '<!-- Inside participants() : '.$names.' 
-->'."\n";
                        }
                        return $names;
***************
*** 2247,2251 ****
                function week_header($month,$year,$display_name = False)
                {
!                       $this->weekstarttime = 
$this->bo->datetime->get_weekday_start($year,$month,1);
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
--- 2256,2260 ----
                function week_header($month,$year,$display_name = False)
                {
!                       $this->weekstarttime = 
$this->datetime->get_weekday_start($year,$month,1);
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
***************
*** 2282,2286 ****
                        for($i=0;$i<7;$i++)
                        {
!                               
$p->set_var('col_title',lang($this->bo->datetime->days[$i]));
                                $p->parse('column_header','column_title',True);
                        }
--- 2291,2295 ----
                        for($i=0;$i<7;$i++)
                        {
!                               
$p->set_var('col_title',lang($this->datetime->days[$i]));
                                $p->parse('column_header','column_title',True);
                        }
***************
*** 2319,2324 ****
                                $p->set_var('col_width','12');
                        }
!                       $today = date('Ymd',time());
!                       $daily = 
$this->set_week_array($startdate,$cellcolor,$weekly);
                        @reset($daily);
                        while(list($date,$day_params) = each($daily))
--- 2328,2333 ----
                                $p->set_var('col_width','12');
                        }
!                       $today = date('Ymd',$this->datetime->gmtnow + 
$this->tz_offset);
!                       $daily = $this->set_week_array($startdate - 
$this->tz_offset,$cellcolor,$weekly);
                        @reset($daily);
                        while(list($date,$day_params) = each($daily))
***************
*** 2407,2410 ****
--- 2416,2424 ----
                function display_month($month,$year,$showyear,$owner=0)
                {
+                       if($this->debug)
+                       {
+                               echo '<!-- datetime:gmtdate = 
'.$this->datetime->gmtdate.' -->'."\n";
+                       }
+ 
                        $this->bo->store_to_cache(
                                Array(
***************
*** 2418,2422 ****
                        $monthend   = intval(date('Ymd',mktime(0,0,0,$month + 
1,0,$year)));
  
!                       $start = $this->bo->datetime->get_weekday_start($year, 
$month, 1);
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
--- 2432,2442 ----
                        $monthend   = intval(date('Ymd',mktime(0,0,0,$month + 
1,0,$year)));
  
!                       $start = $this->datetime->get_weekday_start($year, 
$month, 1);
! 
!                       if($this->debug)
!                       {
!                               echo '<!-- display_month:monthstart = 
'.$monthstart.' -->'."\n";
!                               echo '<!-- display_month:start = '.date('Ymd 
H:i:s',$start).' -->'."\n";
!                       }
  
                        $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
***************
*** 2440,2444 ****
                        $cellcolor = $this->theme['row_on'];
  
!                       for ($i=intval($start);intval(date('Ymd',$i)) <= 
$monthend;$i += 604800)
                        {
                                $cellcolor = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($cellcolor);
--- 2460,2464 ----
                        $cellcolor = $this->theme['row_on'];
  
!                       for ($i=intval($start + 
$this->tz_offset);intval(date('Ymd',$i)) <= $monthend;$i += 604800)
                        {
                                $cellcolor = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($cellcolor);
***************
*** 2475,2479 ****
                        $p->set_block('week','event','event');
                
!                       $start = $this->bo->datetime->get_weekday_start($year, 
$month, $day);
  
                        $cellcolor = $this->theme['row_off'];
--- 2495,2499 ----
                        $p->set_block('week','event','event');
                
!                       $start = $this->datetime->get_weekday_start($year, 
$month, $day);
  
                        $cellcolor = $this->theme['row_off'];
***************
*** 2785,2789 ****
                        }
  
!                       echo '<!-- in print_day() -->'."\n";
  
                        $this->bo->store_to_cache(
--- 2805,2812 ----
                        }
  
!                       if($this->debug)
!                       {
!                               echo '<!-- in print_day() -->'."\n";
!                       }
  
                        $this->bo->store_to_cache(
***************
*** 2832,2836 ****
                        if($this->debug)
                        {
!                               echo "Interval set to : 
".intval($this->bo->prefs['calendar']['interval'])."<br>\n";
                        }
  
--- 2855,2859 ----
                        if($this->debug)
                        {
!                               echo '<!-- Interval set to : 
'.intval($this->bo->prefs['calendar']['interval']).' -->'."\n";
                        }
  
***************
*** 2848,2855 ****
                        $time = Array();
  
!                       $daily = 
$this->set_week_array($this->bo->datetime->get_weekday_start($params['year'],$params['month'],$params['day']),$this->theme['row_on'],True);
                        if($this->debug)
                        {
!                               echo "Date to Eval : ".$date_to_eval."<br>\n";
                        }
                        if($daily[$date_to_eval]['appts'])
--- 2871,2878 ----
                        $time = Array();
  
!                       $daily = 
$this->set_week_array($this->datetime->get_weekday_start($params['year'],$params['month'],$params['day']),$this->theme['row_on'],True);
                        if($this->debug)
                        {
!                               echo '<!-- Date to Eval : '.$date_to_eval.' 
-->'."\n";
                        }
                        if($daily[$date_to_eval]['appts'])
***************
*** 2861,2869 ****
                                if($this->debug)
                                {
!                                       echo "Date : ".$date_to_eval." Count : 
".$c_events."<br>\n";
                                }
                                for($i=0;$i<$c_events;$i++)
                                {
- //                                    $event = $events[$i];
                                        if($events[$i]['recur_type'] == 
MCAL_RECUR_NONE)
                                        {
--- 2884,2891 ----
                                if($this->debug)
                                {
!                                       echo '<!-- Date : '.$date_to_eval.' 
Count : '.$c_events.' -->'."\n";
                                }
                                for($i=0;$i<$c_events;$i++)
                                {
                                        if($events[$i]['recur_type'] == 
MCAL_RECUR_NONE)
                                        {
***************
*** 2889,2894 ****
                                                        if($this->debug)
                                                        {
!                                                               echo 'Start 
Time Minutes : '.$events[$i]['start']['min']."<br>\n";
!                                                               echo 'Interval 
: '.$interval_start."<br>\n";
                                                        }
                                                }
--- 2911,2916 ----
                                                        if($this->debug)
                                                        {
!                                                               echo '<!-- 
Start Time Minutes : '.$events[$i]['start']['min'].' -->'."\n";
!                                                               echo '<!-- 
Interval : '.$interval_start.' -->'."\n";
                                                        }
                                                }
***************
*** 2909,2913 ****
                                                if($this->debug)
                                                {
!                                                       echo 'IND before = 
'.$ind."<br>\n";
                                                }
                                                if(($ind >= 
date('H',$last_starttime)) && ($ind <= date('H',$last_endtime)))
--- 2931,2935 ----
                                                if($this->debug)
                                                {
!                                                       echo '<!-- IND before = 
'.$ind.' -->'."\n";
                                                }
                                                if(($ind >= 
date('H',$last_starttime)) && ($ind <= date('H',$last_endtime)))
***************
*** 2918,2922 ****
                                                if($this->debug)
                                                {
!                                                       echo 'IND after = 
'.$ind."<br>\n";
                                                }
                                        }
--- 2940,2944 ----
                                                if($this->debug)
                                                {
!                                                       echo '<!-- IND after = 
'.$ind.' -->'."\n";
                                                }
                                        }
***************
*** 2926,2931 ****
                                        if($this->debug)
                                        {
!                                               echo 'IND = '.$ind."<br>\n";
!                                               echo 'TIME = 
'.$time[$ind][$interval_start]."<br>\n";
                                        }
  
--- 2948,2953 ----
                                        if($this->debug)
                                        {
!                                               echo '<!-- IND = '.$ind.' 
-->'."\n";
!                                               echo '<!-- TIME = 
'.$time[$ind][$interval_start].' -->'."\n";
                                        }
  
***************
*** 2953,2957 ****
                                                if($this->debug)
                                                {
!                                                       echo "Rowspan being set 
to : ".$rowspan."<br>\n";
                                                }
  
--- 2975,2979 ----
                                                if($this->debug)
                                                {
!                                                       echo '<!-- Rowspan 
being set to : '.$rowspan.' -->'."\n";
                                                }
  
***************
*** 2967,2971 ****
                                        if($this->debug)
                                        {
!                                               echo 'Time : 
'.$GLOBALS['phpgw']->common->show_date($this->bo->maketime($events[$i]['start'])
 - $this->tz_offset).' - 
'.$GLOBALS['phpgw']->common->show_date($this->bo->maketime($events[$i]['end']) 
- $this->tz_offset).' : Start : '.$ind.' : Interval # : 
'.$interval_start."<br>\n";
                                        }
                                }
--- 2989,2993 ----
                                        if($this->debug)
                                        {
!                                               echo '<!-- Time : 
'.$GLOBALS['phpgw']->common->show_date($this->bo->maketime($events[$i]['start'])
 - $this->tz_offset).' - 
'.$GLOBALS['phpgw']->common->show_date($this->bo->maketime($events[$i]['end']) 
- $this->tz_offset).' : Start : '.$ind.' : Interval # : '.$interval_start.' 
-->'."\n";
                                        }
                                }
***************
*** 3582,3586 ****
                function set_week_array($startdate,$cellcolor,$weekly)
                {
!                       for ($j=0,$datetime=$startdate - 
$this->tz_offset;$j<7;$j++,$datetime += 86400)
                        {
                                $date = date('Ymd',$datetime);
--- 3604,3608 ----
                function set_week_array($startdate,$cellcolor,$weekly)
                {
!                       for ($j=0,$datetime=$startdate;$j<7;$j++,$datetime += 
86400)
                        {
                                $date = date('Ymd',$datetime);
***************
*** 3588,3592 ****
                                if($this->debug)
                                {
!                                       echo "set_week_array : Date : 
".$date."<br>\n";
                                }
  
--- 3610,3614 ----
                                if($this->debug)
                                {
!                                       echo '<!-- set_week_array : Date : 
'.$date.' -->'."\n";
                                }
  
***************
*** 3595,3599 ****
                                        if($this->debug)
                                        {
!                                               echo "Date : ".$date." 
Appointments found : ".count($this->bo->cached_events[$date])."<br>\n";
                                        }
                                        $appts = True;
--- 3617,3621 ----
                                        if($this->debug)
                                        {
!                                               echo '<!-- Date : '.$date.' 
Appointments found : '.count($this->bo->cached_events[$date]).' -->'."\n";
                                        }
                                        $appts = True;
***************
*** 3617,3621 ****
                                        if ($date == $this->bo->today)
                                        {
!                                               $day_image = ' 
background="'.$GLOBALS['phpgw']->common->image('calendar','mini_day_block.gif').'"';
                                        }
                                }
--- 3639,3643 ----
                                        if ($date == $this->bo->today)
                                        {
!                                               $day_image = ' 
background="'.$GLOBALS['phpgw']->common->image('calendar','mini_day_block').'"';
                                        }
                                }
***************
*** 3629,3633 ****
                                        $extra = ' 
bgcolor="'.$GLOBALS['phpgw_info']['theme']['cal_today'].'"';
                                        $class = ($appts?'b':'').'minicalendar';
!                                       $day_image = ' 
background="'.$GLOBALS['phpgw']->common->image('calendar','mini_day_block.gif').'"';
                                }
  
--- 3651,3655 ----
                                        $extra = ' 
bgcolor="'.$GLOBALS['phpgw_info']['theme']['cal_today'].'"';
                                        $class = ($appts?'b':'').'minicalendar';
!                                       $day_image = ' 
background="'.$GLOBALS['phpgw']->common->image('calendar','mini_day_block').'"';
                                }
  




reply via email to

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