phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.20,


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.20,1.71.2.21 class.uicalendar.inc.php,1.66.2.32,1.66.2.33
Date: Wed, 30 Oct 2002 19:57:26 -0500

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

Modified Files:
      Tag: Version-0_9_14-branch
        class.bocalendar.inc.php class.uicalendar.inc.php 
Log Message:
several fixes:
- planner's intervals_per_day was not setting any interval
- privat was only based public attr of event not on ACL
- default group/owner on entering planner was not reset correct in all 
situations when leaving
- edit/view/add was allways returning to the default view and not the actual 
view

Index: class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.71.2.20
retrieving revision 1.71.2.21
diff -C2 -r1.71.2.20 -r1.71.2.21
*** class.bocalendar.inc.php    29 Oct 2002 12:56:09 -0000      1.71.2.20
--- class.bocalendar.inc.php    31 Oct 2002 00:57:23 -0000      1.71.2.21
***************
*** 158,175 ****
                                $this->use_session = True;
                        }
- 
                        print_debug('BO Filter',$this->filter);
                        print_debug('Owner',$this->owner);
  
                        $this->prefs['calendar']    = 
$GLOBALS['phpgw_info']['user']['preferences']['calendar'];
!                       
                        $owner = 
(isset($GLOBALS['owner'])?$GLOBALS['owner']:'');
                        $owner = 
(isset($GLOBALS['HTTP_GET_VARS']['owner'])?$GLOBALS['HTTP_GET_VARS']['owner']:$owner);
                        $owner = ($owner=='' && 
isset($GLOBALS['HTTP_POST_VARS']['owner'])?$GLOBALS['HTTP_POST_VARS']['owner']:$owner);
  
                        if ($GLOBALS['HTTP_GET_VARS']['menuaction'] == 
'calendar.uicalendar.planner'
!                                && $GLOBALS['HTTP_POST_VARS']['from'] != 
'calendar.uicalendar.planner'
                                 && 
intval($this->prefs['calendar']['planner_start_with_group']) > 0)
                        {
                                $this->save_owner = $this->owner;
                                $owner = 
'g_'.$this->prefs['calendar']['planner_start_with_group'];
--- 158,178 ----
                                $this->use_session = True;
                        }
                        print_debug('BO Filter',$this->filter);
                        print_debug('Owner',$this->owner);
  
                        $this->prefs['calendar']    = 
$GLOBALS['phpgw_info']['user']['preferences']['calendar'];
! 
                        $owner = 
(isset($GLOBALS['owner'])?$GLOBALS['owner']:'');
                        $owner = 
(isset($GLOBALS['HTTP_GET_VARS']['owner'])?$GLOBALS['HTTP_GET_VARS']['owner']:$owner);
                        $owner = ($owner=='' && 
isset($GLOBALS['HTTP_POST_VARS']['owner'])?$GLOBALS['HTTP_POST_VARS']['owner']:$owner);
  
+                       
ereg('menuaction=([a-zA-Z.]+)',$GLOBALS['HTTP_REFERER'],$regs);
+                       $from = $regs[1];
                        if ($GLOBALS['HTTP_GET_VARS']['menuaction'] == 
'calendar.uicalendar.planner'
!                                && $from  != 'calendar.uicalendar.planner' && 
!$this->save_owner
                                 && 
intval($this->prefs['calendar']['planner_start_with_group']) > 0)
                        {
+                               // entering planner for the first time ==> 
saving owner in save_owner, setting owner to default
+                               //
                                $this->save_owner = $this->owner;
                                $owner = 
'g_'.$this->prefs['calendar']['planner_start_with_group'];
***************
*** 178,188 ****
                                $this->save_owner)
                        {
                                $owner = intval($this->save_owner);
                                unset($this->save_owner);
                        }
!                       else
                        {
!                               if ($owner) unset($this->save_owner);
                        }
                        if(isset($owner) && $owner!='' && substr($owner,0,2) == 
'g_')
                        {
--- 181,196 ----
                                $this->save_owner)
                        {
+                               // leaving planner with an unchanged user/owner 
==> setting owner back to save_owner
+                               //
                                $owner = intval($this->save_owner);
                                unset($this->save_owner);
                        }
!                       elseif (!empty($owner) && $owner != $this->owner && 
$from == 'calendar.uicalendar.planner')
                        {
!                               // user/owner changed within planner ==> 
forgetting save_owner
!                               //
!                               unset($this->save_owner);
                        }
+ 
                        if(isset($owner) && $owner!='' && substr($owner,0,2) == 
'g_')
                        {
***************
*** 212,216 ****
                                $this->users_timeformat = 'H:i';
                        }
- 
                        $this->holiday_color = 
(substr($GLOBALS['phpgw_info']['theme']['bg07'],0,1)=='#'?'':'#').$GLOBALS['phpgw_info']['theme']['bg07'];
  
--- 220,223 ----
***************
*** 423,430 ****
                }
  
!               function save_sessiondata($data)
                {
                        if ($this->use_session)
                        {
                                if($this->debug)
                                {
--- 430,453 ----
                }
  
!               function save_sessiondata($data='')
                {
                        if ($this->use_session)
                        {
+                               if (!is_array($data))
+                               {
+                                       $data = array(
+                                               'filter'     => $this->filter,
+                                               'cat_id'     => $this->cat_id,
+                                               'owner'      => $this->owner,
+                                               'save_owner' => 
$this->save_owner,
+                                               'year'       => $this->year,
+                                               'month'      => $this->month,
+                                               'day'        => $this->day,
+                                               'date'       => $this->date,
+                                               'sortby'     => $this->sortby,
+                                               'num_months' => 
$this->num_months,
+                                               'return_to'  => $this->return_to
+                                       );
+                               }
                                if($this->debug)
                                {
***************
*** 458,461 ****
--- 481,485 ----
                        $this->day    = intval($data['day']);
                        $this->num_months = intval($data['num_months']);
+                       $this->return_to = $data['return_to'];
                }
  
***************
*** 855,858 ****
--- 879,888 ----
                                if($send_to_ui)
                                {
+                                       $this->read_sessiondata();
+                                       if ($this->return_to)
+                                       {
+                                               header('Location: 
'.$GLOBALS['phpgw']->link("/index.php?menuaction=$this->return_to"));
+                                               
$GLOBALS['phpgw']->common->phpgw_exit();
+                                       }
                                        Execmethod('calendar.uicalendar.index');
  //                                    $GLOBALS['phpgw']->common->phpgw_exit();

Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.66.2.32
retrieving revision 1.66.2.33
diff -C2 -r1.66.2.32 -r1.66.2.33
*** class.uicalendar.inc.php    30 Oct 2002 14:07:35 -0000      1.66.2.32
--- class.uicalendar.inc.php    31 Oct 2002 00:57:23 -0000      1.66.2.33
***************
*** 47,51 ****
                var $planner_end_month;
                var $planner_end_year;
!               var $planner_days_in_end_month;
  
                var $public_functions = array(
--- 47,60 ----
                var $planner_end_month;
                var $planner_end_year;
!               var $planner_days_in_end_month; 
! 
!               var $planner_intervals = array( // conversation hour and 
interval depending on intervals_per_day
!                                       //                                  1 1 
1 1 1 1 1 1 1 1 2 2 2 2
!                                       //              0 1 2 3 4 5 6 7 8 9 0 1 
2 3 4 5 6 7 8 9 0 1 2 3
!                                               '1' => 
array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), // 0=0-23h
!                                               '2' => 
array(0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0), // 0=0-12h, 1=12-23h
!                                               '3' => 
array(0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2), // 0=0-12h, 2=12-18h, 
3=18-23h
!                                               '4' => 
array(0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3)  // 0=0-7, 7-12h, 
3=12-18h, 4=18-23h
!                                       );
  
                var $public_functions = array(
***************
*** 111,117 ****
                        if($this->bo->use_session)
                        {
!                               $this->save_sessiondata();
                        }
- 
                        print_debug('UI',$this->_debug_sqsof());
                }
--- 120,132 ----
                        if($this->bo->use_session)
                        {
!                               // save return-fkt for add, view, ...
!                               list(,,$fkt) = 
explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
!                               if ($fkt == 'day' || $fkt == 'week' || $fkt == 
'month' || $fkt == 'year' || $fkt == 'planner')
!                               {
!                                       $this->bo->return_to = 
$GLOBALS['HTTP_GET_VARS']['menuaction'].
!                                               
sprintf('&date=%04d%02d%02d',$this->bo->year,$this->bo->month,$this->bo->day);
!                               }
!                               $this->bo->save_sessiondata();
                        }
                        print_debug('UI',$this->_debug_sqsof());
                }
***************
*** 808,812 ****
                        );
                        $p->set_var($var);
!                       echo $p->fp('out','form_button').'</center>';
                }
  
--- 823,840 ----
                        );
                        $p->set_var($var);
!                       echo $p->fp('out','form_button');
! 
!                       if ($this->bo->return_to)
!                       {
!                               $var = Array(
!                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php?menuaction='.$this->bo->return_to),
!                                       'action_text_button'    => lang('Done'),
!                                       'action_confirm_button' => '',
!                                       'action_extra_field'    => ''
!                               );
!                               $p->set_var($var);
!                               echo $p->fp('out','form_button');
!                       }
!                       echo '</center>';
                }
  
***************
*** 931,936 ****
                                        echo '<!-- DEBUG: Path = 
'.$vfs->pwd().' -->'."\n";
                                }
! 
!                               Header('Location: '.$this->index());
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
--- 959,970 ----
                                        echo '<!-- DEBUG: Path = 
'.$vfs->pwd().' -->'."\n";
                                }
!                               if ($this->bo->return_to)
!                               {
!                                       Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php?menuaction='.$this->bo->return_to));
!                               }
!                               else
!                               {
!                                       Header('Location: '.$this->index());
!                               }
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
***************
*** 1015,1019 ****
  
                        $var = Array(
!                               'action_url_button'     => $this->page(''),
                                'action_text_button'    => lang('Cancel'),
                                'action_confirm_button' => '',
--- 1049,1053 ----
  
                        $var = Array(
!                               'action_url_button'     => $this->bo->return_to 
? $GLOBALS['phpgw']->link('/index.php?menuaction='.$this->bo->return_to) : 
$this->page(''),
                                'action_text_button'    => lang('Cancel'),
                                'action_confirm_button' => '',
***************
*** 1053,1057 ****
                                echo '<!-- Return Value = '.$cd.' -->'."\n";
                        }
!                       Header('Location: 
'.$this->page('',($cd?'&cd='.$cd:'')));
                        $GLOBALS['phpgw']->common->phpgw_exit();        
                }
--- 1087,1098 ----
                                echo '<!-- Return Value = '.$cd.' -->'."\n";
                        }
!                       if ($this->bo->return_to)
!                       {
!                               Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php?menuaction='.$this->bo->return_to));
!                       }                       
!                       else
!                       {
!                               Header('Location: 
'.$this->page('',($cd?'&cd='.$cd:'')));
!                       }
                        $GLOBALS['phpgw']->common->phpgw_exit();        
                }
***************
*** 1142,1146 ****
                                $cd = '';
                        }
!                       Header('Location: 
'.$this->page('','&date='.$date.($cd?'&cd='.$cd:'')));
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
--- 1183,1194 ----
                                $cd = '';
                        }
!                       if ($this->bo->return_to)
!                       {
!                               Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php?menuaction='.$this->bo->return_to));
!                       }
!                       else
!                       {
!                               Header('Location: 
'.$this->page('','&date='.$date.($cd?'&cd='.$cd:'')));
!                       }
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
***************
*** 1316,1320 ****
                                        }
                                        $intervals_per_day = 
$this->bo->prefs[\'calendar\'][\'planner_intervals_per_day\'];
!                                       $this->save_sessiondata();      // need 
to save $this->bo->save_owner
        
                                        // set title for table and rows of 
planner view
--- 1364,1368 ----
                                        }
                                        $intervals_per_day = 
$this->bo->prefs[\'calendar\'][\'planner_intervals_per_day\'];
!                                       $this->bo->save_sessiondata();  // need 
to save $this->bo->save_owner
        
                                        // set title for table and rows of 
planner view
***************
*** 1374,1379 ****
                                                $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>";
  
--- 1422,1427 ----
                                                $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\']->link("/index.php?menuaction=calendar.uicalendar.planner&date=$prev_month");
!                                               $next_link = 
$GLOBALS[\'phpgw\']->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>";
  
***************
*** 1495,1500 ****
                                        $rows              = 
&$this->planner_rows;
                                        $intervals_per_day = 
$this->bo->prefs[\'calendar\'][\'planner_intervals_per_day\'];
!                                       $is_private        = 
!$event[\'public\'] && $this->bo->owner != $event[\'owner\']
!                                          || 
!$this->bo->check_perms(PHPGW_ACL_READ,$event);
  
                                        $view = 
$this->planner_html->link(\'/index.php\',
--- 1543,1547 ----
                                        $rows              = 
&$this->planner_rows;
                                        $intervals_per_day = 
$this->bo->prefs[\'calendar\'][\'planner_intervals_per_day\'];
!                                       $is_private        = 
!$this->bo->check_perms(PHPGW_ACL_READ,$event);
  
                                        $view = 
$this->planner_html->link(\'/index.php\',
***************
*** 1588,1597 ****
                                           if ($event[\'description\'])
                                                {
!                                                       $opt .= " 
\n".lang(\'Description\').": ".$event[\'description\'];
                                                }
                                        }
                                        else
                                        {
!                                               $opt .= \' title="\'.lang(\'You 
do not have permission to read this record!\').\'"\';
                                        }
  
--- 1635,1644 ----
                                           if ($event[\'description\'])
                                                {
!                                                       $opt .= 
"\n".lang(\'Description\').": ".$event[\'description\'];
                                                }
                                        }
                                        else
                                        {
!                                               $opt .= \' title="\'.lang(\'You 
do not have permission to read this record!\');
                                        }
  
***************
*** 1600,1604 ****
                                        $opt .= "\n".lang(\'Start 
Date/Time\').": ".$start."\n".lang(\'End Date/Time\').": ".$end;
  
!                                       if ($event[\'location\'])
                                        {
                                                $opt .= " 
\n".lang(\'Location\').": ".$event[\'location\'];
--- 1647,1651 ----
                                        $opt .= "\n".lang(\'Start 
Date/Time\').": ".$start."\n".lang(\'End Date/Time\').": ".$end;
  
!                                       if ($event[\'location\'] && 
!$is_private)
                                        {
                                                $opt .= " 
\n".lang(\'Location\').": ".$event[\'location\'];
***************
*** 1612,1615 ****
--- 1659,1663 ----
                                        else
                                        {
+                                               $opt .= \'"\';
                                                $cel = \'\';
                                        }
***************
*** 1644,1647 ****
--- 1692,1696 ----
                                eval('
                                        $intervals_per_day = 
$this->bo->prefs[\'calendar\'][\'planner_intervals_per_day\'];
+                                       $interval = 
$this->planner_intervals[$intervals_per_day];
                                        $last_cell = $intervals_per_day * 
$this->planner_days - 1;
  
***************
*** 2196,2217 ****
                }
  
-               /* Called only by get_list(), just prior to page footer. */
-               function save_sessiondata()
-               {
-                       $data = array(
-                               'filter'     => $this->bo->filter,
-                               'cat_id'     => $this->bo->cat_id,
-                               'owner'      => $this->bo->owner,
-                               'save_owner' => $this->bo->save_owner,
-                               'year'       => $this->bo->year,
-                               'month'      => $this->bo->month,
-                               'day'        => $this->bo->day,
-                               'date'       => $this->bo->date,
-                               'sortby'     => $this->bo->sortby,
-                               'num_months' => $this->bo->num_months
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
- 
                function output_template_array(&$p,$row,$list,$var)
                {
--- 2245,2248 ----
***************
*** 2312,2322 ****
                        }
  
-                       $hidden_vars = '    <input type="hidden" name="from" 
value="'.$menuaction.'">'."\n";
- 
                        $var = Array(
                                'action_url'    => $this->page($method,''),
                                'form_name'     => 'SelectMonth',
                                'label'         => lang('Month'),
-                               'hidden_vars' => $hidden_vars,
                                'form_label'    => 'date',
                                'form_onchange' => 
'document.SelectMonth.submit()',
--- 2343,2350 ----
***************
*** 2346,2350 ****
                                        'form_name'     => 'SelectWeek',
                                        'label'         => lang('Week'),
-                                       'hidden_vars' => $hidden_vars,
                                        'form_label'    => 'date',
                                        'form_onchange' => 
'document.SelectWeek.submit()',
--- 2374,2377 ----
***************
*** 2361,2370 ****
                                $str .= '<option value="'.$i.'"'.($i == 
$this->bo->year?' selected':'').'>'.$i.'</option>'."\n";
                        }
!   
                        $var = Array(
                                'action_url'    => $this->page($method,''),
                                'form_name'     => 'SelectYear',
                                'label'         => lang('Year'),
-                               'hidden_vars' => $hidden_vars,
                                'form_label'    => 'year',
                                'form_onchange' => 
'document.SelectYear.submit()',
--- 2388,2396 ----
                                $str .= '<option value="'.$i.'"'.($i == 
$this->bo->year?' selected':'').'>'.$i.'</option>'."\n";
                        }
! 
                        $var = Array(
                                'action_url'    => $this->page($method,''),
                                'form_name'     => 'SelectYear',
                                'label'         => lang('Year'),
                                'form_label'    => 'year',
                                'form_onchange' => 
'document.SelectYear.submit()',
***************
*** 2378,2382 ****
                                $str = '';
                                $date_str = '';
!                               
                                if(isset($GLOBALS['HTTP_GET_VARS']['date']) && 
$GLOBALS['HTTP_GET_VARS']['date'])
                                {
--- 2404,2408 ----
                                $str = '';
                                $date_str = '';
! 
                                if(isset($GLOBALS['HTTP_GET_VARS']['date']) && 
$GLOBALS['HTTP_GET_VARS']['date'])
                                {
***************
*** 2392,2402 ****
                                }
  
-                               $hidden_vars .= $date_str;
- 
                                $var = Array(
                                        'action_url'    => 
$this->page($method,''),
                                        'form_name'     => 
'SelectNumberOfMonths',
                                        'label'         => lang('Number of 
Months'),
!                                       'hidden_vars' => $hidden_vars,
                                        'form_label'    => 'num_months',
                                        'form_onchange' => 
'document.SelectNumberOfMonths.submit()',
--- 2418,2426 ----
                                }
  
                                $var = Array(
                                        'action_url'    => 
$this->page($method,''),
                                        'form_name'     => 
'SelectNumberOfMonths',
                                        'label'         => lang('Number of 
Months'),
!                                       'hidden_vars' => $date_str,
                                        'form_label'    => 'num_months',
                                        'form_onchange' => 
'document.SelectNumberOfMonths.submit()',





reply via email to

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