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,1.67


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.66,1.67
Date: Sat, 16 Feb 2002 22:57:00 -0500

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

Modified Files:
        class.uicalendar.inc.php 
Log Message:
MAJOR fix for GNU Bug #100366. Also, changed some of the images to be more 
compliant with image_typing.

Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** class.uicalendar.inc.php    9 Jan 2002 18:12:23 -0000       1.66
--- class.uicalendar.inc.php    17 Feb 2002 03:56:58 -0000      1.67
***************
*** 440,443 ****
--- 440,512 ----
                        $p->set_var($var);
                        return $p->fp('out','week_t');
+ 
+ /*
+                       $this->bo->read_holidays();
+                       
+                       if (!$this->bo->printer_friendly || 
($this->bo->printer_friendly && 
@$this->bo->prefs['calendar']['display_minicals']))
+                       {
+                               $minical = $this->mini_calendar(
+                                       Array(
+                                               'day'   => $this->bo->day,
+                                               'month' => $this->bo->month,
+                                               'year'  => $this->bo->year,
+                                               'link'  => 'day'
+                                       )
+                               );
+                       }
+                       else
+                       {
+                               $minical = '';
+                       }
+                       
+                       if (!$this->bo->printer_friendly)
+                       {
+                               
unset($GLOBALS['phpgw_info']['flags']['noheader']);
+                               
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
+                               $GLOBALS['phpgw']->common->phpgw_header();
+                               $printer = '';
+                               $param = 
'&date='.sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day).'&friendly=1';
+                               $print = '<a 
href="'.$this->page('day'.$param)."\" TARGET=\"cal_printer_friendly\" 
onMouseOver=\"window.status = '".lang('Generate printer-friendly 
version')."'\">[".lang('Printer Friendly').']</a>';
+                       }
+                       else
+                       {
+                               $GLOBALS['phpgw_info']['flags']['nofooter'] = 
True;
+                               $printer = '<body 
bgcolor="'.$this->theme['bg_color'].'">';
+                               $print =        '';
+                       }
+ 
+                       $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);
+ 
+                       $p = 
CreateObject('phpgwapi.Template',$this->template_dir);
+                       $p->set_file(
+                               Array(
+                                       'day_t' => 'day.tpl'
+                               )
+                       );
+                       $p->set_block('day_t','day','day');
+                       $p->set_block('day_t','day_event','day_event');
+ 
+                       $var = Array(
+                               'printer_friendly'              => $printer,
+                               'bg_text'                       => 
$this->theme['bg_text'],
+                               'daily_events'                  => 
$this->print_day(
+                                       Array(
+                                               'year'  => $this->bo->year,
+                                               'month' => $this->bo->month,
+                                               'day'   => $this->bo->day
+                                       )
+                               ),
+                               'small_calendar'                => $minical,
+                               'date'                          => 
lang(date('F',$m)).' '.sprintf("%02d",$this->bo->day).', '.$this->bo->year,
+                               'username'                      => 
$GLOBALS['phpgw']->common->grab_owner_name($this->bo->owner),
+                               'print'                         => $print
+                       );
+ 
+                       $p->set_var($var);
+                       $p->parse('day_events','day_event');
+                       $p->pparse('out','day');
+ */
                }
  
***************
*** 1952,1956 ****
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','high.gif'),
                                                'width' => 8,
                                                'height'=> 17
--- 2021,2025 ----
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','high'),
                                                'width' => 8,
                                                'height'=> 17
***************
*** 1960,1964 ****
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','circle.gif'),
                                                'width' => 5,
                                                'height'=> 7
--- 2029,2033 ----
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','circle'),
                                                'width' => 5,
                                                'height'=> 7
***************
*** 1968,1972 ****
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','recur.gif'),
                                                'width' => 12,
                                                'height'=> 12
--- 2037,2041 ----
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','recur'),
                                                'width' => 12,
                                                'height'=> 12
***************
*** 1976,1980 ****
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','multi_3.gif'),
                                                'width' => 14,
                                                'height'=> 14
--- 2045,2049 ----
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','multi_3'),
                                                'width' => 14,
                                                'height'=> 14
***************
*** 1984,1988 ****
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','private.gif'),
                                                'width' => 13,
                                                'height'=> 13
--- 2053,2057 ----
                                {
                                        $picture[] = Array(
!                                               'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','private'),
                                                'width' => 13,
                                                'height'=> 13
***************
*** 1994,1998 ****
                                        {
                                                $picture[] = Array(
!                                                       'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','alarm.gif'),
                                                        'width' => 13,
                                                        'height'=> 13
--- 2063,2067 ----
                                        {
                                                $picture[] = Array(
!                                                       'pict'  => 
$GLOBALS['phpgw']->common->image('calendar','alarm'),
                                                        'width' => 13,
                                                        'height'=> 13
***************
*** 2759,2762 ****
--- 2828,2833 ----
                        if($daily[$date_to_eval]['appts'])
                {
+                       $starttime = 0;
+                       $endtime = 0;
                                $events = 
$this->bo->cached_events[$date_to_eval];
                                $c_events = count($events);
***************
*** 2770,2773 ****
--- 2841,2846 ----
                                        if($events[$i]['recur_type'] == 
MCAL_RECUR_NONE)
                                        {
+                                               $ind = 0;
+                                               $interval_start = 0;
                                                if($events[$i]['start']['mday'] 
< $params['day'])
                                                {
***************
*** 2800,2811 ****
                                        }
  
!                                       if($ind < 
(int)$this->bo->prefs['calendar']['workdaystarts'] || $ind > 
(int)$this->bo->prefs['calendar']['workdayends'])
!                                       {
!                                               $ind = 99;
                                                $interval_start = 0;
!                                       }
  
                                        $time[$ind][$interval_start] .= 
$this->link_to_entry($events[$i],$params['month'],$params['day'],$params['year']);
  
                                        $starttime = 
$this->bo->maketime($events[$i]['start']);
                                        $endtime = 
$this->bo->maketime($events[$i]['end']);
--- 2873,2906 ----
                                        }
  
!                                       if(($ind < 
intval($this->bo->prefs['calendar']['workdaystarts'])) || ($ind > 
intval($this->bo->prefs['calendar']['workdayends'])))
!                                       {
!                                               $ind = 99;
                                                $interval_start = 0;
!                                       }
!                                       if((($ind <> 99) && ($ind <> 0)) && 
(($starttime <> 0) && ($endtime <> 0)))
!                                       {
!                                               if($this->debug)
!                                               {
!                                                       echo 'IND before = 
'.$ind."<br>\n";
!                                               }
!                                               if(($ind >= 
date('H',$starttime)) || ($ind <= date('H',$endtime)))
!                                               {
!                                                       $ind = $last_ind;
!                                                       $interval_start = 
$last_interval_start;
!                                               }
!                                               if($this->debug)
!                                               {
!                                                       echo 'IND after = 
'.$ind."<br>\n";
!                                               }
!                                       }
  
                                        $time[$ind][$interval_start] .= 
$this->link_to_entry($events[$i],$params['month'],$params['day'],$params['year']);
  
+                                       if($this->debug)
+                                       {
+                                               echo 'IND = '.$ind."<br>\n";
+                                               echo 'TIME = 
'.$time[$ind][$interval_start]."<br>\n";
+                                       }
+ 
                                        $starttime = 
$this->bo->maketime($events[$i]['start']);
                                        $endtime = 
$this->bo->maketime($events[$i]['end']);
***************
*** 2813,2817 ****
                                        if ($starttime <> $endtime)
                                        {
!                                               $rowspan = intval(($endtime - 
$starttime) / (60 * intval($this->bo->prefs['calendar']['interval'])));
                                                $mins = (int)((($endtime - 
$starttime) / 60) % 60);
                        
--- 2908,2921 ----
                                        if ($starttime <> $endtime)
                                        {
!                                               $rowspan = 
$rowspan_arr[$ind][$interval_start];
!                                               if($rowspan == 0)
!                                               {
!                                                       $rowspan = 
intval(($endtime - $starttime) / (60 * 
intval($this->bo->prefs['calendar']['interval'])));
!                                               }
!                                               elseif($last_endtime < $endtime)
!                                               {
!                                                       $rowspan = 
intval(($endtime - $last_starttime) / (60 * 
intval($this->bo->prefs['calendar']['interval'])));
!                                               }
!                                               
                                                $mins = (int)((($endtime - 
$starttime) / 60) % 60);
                        
***************
*** 2830,2833 ****
--- 2934,2941 ----
                                                }
                                        }
+                                       $last_ind = $ind;
+                                       $last_interval_start = $interval_start;
+                                       $last_starttime = $starttime;
+                                       $last_endtime = $endtime;
                                        if($this->debug)
                                        {




reply via email to

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