phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] calendar incclass.bocalendar.inc.php incclass.b...


From: Dave Hall
Subject: [Phpgroupware-cvs] calendar incclass.bocalendar.inc.php incclass.b...
Date: Mon, 05 Jun 2006 12:11:03 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    calendar
Changes by:     Dave Hall <skwashd>     06/06/05 12:11:03

Modified files:
        inc            : class.bocalendar.inc.php 
                         class.boicalendar.inc.php 
                         class.uicalendar.inc.php 
        setup          : phpgw_en.lang 

Log message:
        bug fixes and some more export extras

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.bocalendar.inc.php?cvsroot=phpgroupware&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.boicalendar.inc.php?cvsroot=phpgroupware&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.uicalendar.inc.php?cvsroot=phpgroupware&r1=1.121&r2=1.122
http://cvs.savannah.gnu.org/viewcvs/calendar/setup/phpgw_en.lang?cvsroot=phpgroupware&r1=1.32&r2=1.33

Patches:
Index: inc/class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- inc/class.bocalendar.inc.php        7 Jan 2006 11:14:56 -0000       1.103
+++ inc/class.bocalendar.inc.php        5 Jun 2006 12:11:03 -0000       1.104
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.bocalendar.inc.php,v 1.103 2006/01/07 11:14:56 skwashd 
Exp $ */
+       /* $Id: class.bocalendar.inc.php,v 1.104 2006/06/05 12:11:03 skwashd 
Exp $ */
 
        class bocalendar
        {
@@ -954,7 +954,7 @@
                                        $this->read_sessiondata();
                                        if ($this->return_to)
                                        {
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', "menuaction={$this->return_to}");
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php', $this->return_to);
                                                
$GLOBALS['phpgw']->common->phpgw_exit();
                                        }
                                        Execmethod('calendar.uicalendar.index');
@@ -2886,7 +2886,7 @@
 
                        $var['owner'] = array(
                                'field' => lang('Created By'),
-                               'data'  => 
$GLOBALS['phpgw']->contacts->get_name_of_person_id($GLOBALS['phpgw']->contacts->is_contact($event['owner']))
+                               'data'  => 
$GLOBALS['phpgw']->contacts->get_name_of_person_id($event['owner'])
                        );
 
                        $var['updated'] = array(

Index: inc/class.boicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.boicalendar.inc.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- inc/class.boicalendar.inc.php       7 Jan 2006 15:44:15 -0000       1.33
+++ inc/class.boicalendar.inc.php       5 Jun 2006 12:11:03 -0000       1.34
@@ -10,7 +10,7 @@
  *  option) any later version.                                              *
  \**************************************************************************/
 
-/* $Id: class.boicalendar.inc.php,v 1.33 2006/01/07 15:44:15 skwashd Exp $ */
+/* $Id: class.boicalendar.inc.php,v 1.34 2006/06/05 12:11:03 skwashd Exp $ */
 
 define('FOLD_LENGTH',75);
 
@@ -3912,17 +3912,27 @@
                $GLOBALS['phpgw']->common->phpgw_exit();
        }
 
+       
        function export($params)
        {
                $event_id = 
get_var('cal_id',array('GET','DEFAULT'),$params['l_event_id']);
 
+               if(isset($params['alarms_only']))
+               {
+                       $alarms_only = true;
+               }
+               else
+               {
+                       $alarms_only = false;
+               }
+               
                if ( isset($params['chunk_split']) )
                {
                        $this->chunk_split = $params['chunk_split'];
                        $method = ($params['method'] ? $params['method'] : 
'publish');
                }
 
-               $method = ($params['method']?$params['method']:"publish");
+               $method = ($params['method'] ? $params['method'] : "publish");
 
                $string_array = array
                                (
@@ -3983,12 +3993,21 @@
                $this->set_var($ical['version'],'value','2.0');
                $this->set_var($ical['method'],'value',strtoupper($method));
                unset($version, $versiona);
-
+               if(isset($params['minutes'])) {
+                       $minutes = (int)$params['minutes'];
+               }
                foreach ( $ids as $key => $value )
                {
                        $ical_event = array();
+                       // $event seems to get the wrong dates & not get the 
alarm part filled in
                        $event = $so_event->read_entry($value);
 
+                       if($alarms_only && !(isset($event['alarm']) && 
is_array($event['alarm']) && !empty($event['alarm'])))
+                       {
+                               continue;
+                       }
+
+
                        $ical_event['priority'] = $event['priority'];
                        $ical_event['class'] = intval($event['public']);
                        $dtstart_mktime = $so_event->maketime($event['start']);
@@ -4010,6 +4029,13 @@
                        {
                                foreach ( $event['alarm'] as $alarm )
                                {
+                                       // if alarm is earlier than now(), or 
later than now()+$minutes, skip it
+                                       if( isset($minutes) ) {
+                                               if ( ($alarm['time'] < 
strtotime("now")) || ($alarm['time'] > time() + $minutes*60) )
+                                               { 
+                                                       continue;
+                                               }
+                                       }
                                        $ical_temp = Array();
                                        $ical_temp['action']['value'] = 
'DISPLAY';
                                        $ical_temp['description']['value'] = 
$alarm['text'];

Index: inc/class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- inc/class.uicalendar.inc.php        16 Dec 2005 13:24:44 -0000      1.121
+++ inc/class.uicalendar.inc.php        5 Jun 2006 12:11:03 -0000       1.122
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.uicalendar.inc.php,v 1.121 2005/12/16 13:24:44 skwashd 
Exp $ */
+       /* $Id: class.uicalendar.inc.php,v 1.122 2006/06/05 12:11:03 skwashd 
Exp $ */
 
        class uicalendar
        {
@@ -61,35 +61,35 @@
 
                var $public_functions = array
                        (
-                               'mini_calendar' => True,
-                               'index'         => True,
-                               'month'         => True,
-                               'get_month'     => True,
-                               'week'          => True,
-                               'get_week'      => True,
-                               'week_new'      => True,
-                               'get_week_new'  => True,
-                               'year'          => True,
-                               'view'          => True,
-                               'edit'          => True,
-                               'export'        => True,
-                               'reinstate_list'=> True,
-                               'reinstate'     => True,
-                               'add'           => True,
-                               'delete'        => True,
-                               'preferences'   => True,
-                               'day'           => True,
-                               'edit_status'   => True,
-                               'set_action'    => True,
-                               'planner'       => True,
-                               'modify_ext_partlist' => True,
-                               'matrixselect'  => True,
-                               'viewmatrix'    => True,
-                               'search'        => True,
-                               'header'        => True,
-                               'footer'        => True,
-                               'css'           => True,
-                               'participants_popup'    => True
+                               'mini_calendar' => true,
+                               'index'                 => true,
+                               'month'                 => true,
+                               'get_month'             => true,
+                               'week'                  => true,
+                               'get_week'              => true,
+                               'week_new'              => true,
+                               'get_week_new'  => true,
+                               'year'                  => true,
+                               'view'                  => true,
+                               'edit'                  => true,
+                               'export'                => true,
+                               'reinstate_list'=> true,
+                               'reinstate'             => true,
+                               'add'                   => true,
+                               'delete'                => true,
+                               'preferences'   => true,
+                               'day'                   => true,
+                               'edit_status'   => true,
+                               'set_action'    => true,
+                               'planner'               => true,
+                               'modify_ext_partlist' => true,
+                               'matrixselect'  => true,
+                               'viewmatrix'    => true,
+                               'search'                => true,
+                               'header'                => true,
+                               'footer'                => true,
+                               'css'                   => true,
+                               'participants_popup'    => true
                        );
 
                function uicalendar()
@@ -128,8 +128,11 @@
                                list(,,$fkt) = 
explode('.',$GLOBALS['phpgw_info']['menuaction']);
                                if ($fkt == 'day' || $fkt == 'week' || $fkt == 
'week_new' || $fkt == 'month' || $fkt == 'year' || $fkt == 'planner')
                                {
-                                       $this->bo->return_to = 
$GLOBALS['phpgw_info']['menuaction'].
-                                               
sprintf('&date=%04d%02d%02d',$this->bo->year,$this->bo->month,$this->bo->day);
+                                       $this->bo->return_to = array
+                                       (
+                                               'menuaction'    => 
$GLOBALS['phpgw_info']['menuaction'],
+                                               'date'                  => 
sprintf('%04d%02d%02d', $this->bo->year, $this->bo->month, $this->bo->day)
+                                       );
                                }
                                $this->bo->save_sessiondata();
                        }
@@ -317,7 +320,7 @@
 
                function index($params='')
                {
-                       $GLOBALS['phpgw']->redirect($this->page('',$params));
+                       $GLOBALS['phpgw']->redirect($this->page('', $params, 
true));
                }
 
                //TODO Replace this with better CSS driven print mode
@@ -349,7 +352,8 @@
                                {
                                        
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.$app_header;
                                }
-                               $GLOBALS['phpgw']->common->phpgw_header();
+                               $this->header();
+                               //$GLOBALS['phpgw']->common->phpgw_header();
                                $new_body = $this->bo->debug_string.$body;
                        }
                        return $new_body;
@@ -630,12 +634,12 @@
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('View');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $cal_id = 
get_var('cal_id',array('GET','POST'),$vcal_id);
 
-                       $date = $cal_date?$cal_date:0;
-                       $date = $date?$date:intval($_GET['date']);
+                       $date = $cal_date ? $cal_date : 0;
+                       $date = $date ? $date : (int)$_GET['date'];
 
                        // First, make sure they have permission to this entry
                        if ($cal_id < 1)
@@ -743,7 +747,7 @@
                                if($event['recur_type'] != MCAL_RECUR_NONE)
                                {
                                        $var = array(
-                                               'action_url_button'     => 
$this->page('delete','&cal_id='.$cal_id),
+                                               'action_url_button'     => 
$this->page('delete', array('cal_id' => $cal_id)),
                                                'action_text_button'    => 
lang('Delete Single'),
                                                'action_confirm_button' => 
"onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this 
single occurence ?\\n\\nThis will delete\\nthis entry for all users.")."')\"",
                                                'action_extra_field'    => 
'<input type="hidden" name="delete_type" value="single">'
@@ -753,7 +757,7 @@
                                        $button_right .= 
'<td>'.$p->fp('button','form_button').'</td>';
 
                                        $var = array(
-                                               'action_url_button'     => 
$this->page('delete','&cal_id='.$cal_id),
+                                               'action_url_button'     => 
$this->page('delete', array('cal_id' => $cal_id)),
                                                'action_text_button'    => 
lang('Delete Series'),
                                                'action_confirm_button' => 
"onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this 
entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\"",
                                                'action_extra_field'    => 
'<input type="hidden" name="delete_type" value="series">'
@@ -764,7 +768,7 @@
                                        if($event['recur_exception'])
                                        {
                                                $var = array(
-                                                       'action_url_button'     
=> $this->page('reinstate_list','&cal_id='.$cal_id),
+                                                       'action_url_button'     
=> $this->page('reinstate_list',array('cal_id' => $cal_id)),
                                                        'action_text_button'    
=> lang('Reinstate'),
                                                        'action_confirm_button' 
=> '',
                                                        'action_extra_field'    
=> ''
@@ -776,7 +780,7 @@
                                else
                                {
                                        $var = array(
-                                               'action_url_button'     => 
$this->page('delete','&cal_id='.$cal_id),
+                                               'action_url_button'     => 
$this->page('delete',array('cal_id' => $cal_id)), 
                                                'action_text_button'    => 
lang('Delete'),
                                                'action_confirm_button' => 
"onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this 
entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\"",
                                                'action_extra_field'    => ''
@@ -818,7 +822,7 @@
                        if ($this->bo->return_to)
                        {
                                $var = array(
-                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to),
+                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php', $this->bo->return_to),
                                        'action_text_button'    => lang('Done'),
                                        'action_confirm_button' => '',
                                        'action_extra_field'    => ''
@@ -876,7 +880,7 @@
 
                                
if(!$this->bo->check_perms(PHPGW_ACL_EDIT,$event))
                                {
-                                       Header('Location: 
'.$this->page('view','&cal_id='.$cal_id));
+                                       Header('Location: '.$this->page('view', 
array('cal_id' => $cal_id), true) );
                                        $GLOBALS['phpgw']->common->phpgw_exit();
                                }
                                if(@isset($_POST['edit_type']) && 
$_POST['edit_type'] == 'single')
@@ -904,7 +908,7 @@
                {
                        if(!isset($_POST['cal_id']) || !$_POST['cal_id'])
                        {
-                               Header('Location: '.$this->index());
+                               Header('Location: ' . $this->index());
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                        $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
@@ -935,7 +939,8 @@
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Reinstate');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $cal_id = 
get_var('cal_id',array('GET'),$params['cal_id']);
 
@@ -998,7 +1003,7 @@
                        $button_left = 
'<td>'.$p->fp('out','form_button').'</td>';
 
                        $var = array(
-                               'action_url_button'     => $this->bo->return_to 
? $GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to) : 
$this->page(''),
+                               'action_url_button'             => 
$this->bo->return_to ? $GLOBALS['phpgw']->link('/index.php', 
$this->bo->return_to) : $this->page(''),
                                'action_text_button'    => lang('Cancel'),
                                'action_confirm_button' => '',
                                'action_extra_field'    => ''
@@ -1041,11 +1046,11 @@
                        }
                        if ($this->bo->return_to)
                        {
-                               Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->bo->return_to);
                        }                       
                        else
                        {
-                               Header('Location: 
'.$this->page('',($cd?'&cd='.$cd:'')));
+                               Header('Location: ' . $this->page('', ($cd ? 
array('cd' => $cd) : array()), true) );
                        }
                        $GLOBALS['phpgw']->common->phpgw_exit();        
                }
@@ -1108,11 +1113,10 @@
                {
                        if(!isset($_GET['cal_id']))
                        {
-                               Header('Location: 
'.$this->page('','&date='.sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day)));
+                               Header('Location: '.$this->page('', 
array('date' => sprintf('%04d%02d%02d', $this->bo->year, $this->bo->month, 
$this->bo->day) ), true) );
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
-
-                       $date = 
sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day);
+                       $date = sprintf('%04d%02d%02d', $this->bo->year, 
$this->bo->month, $this->bo->day);
                        
if($this->bo->check_perms(PHPGW_ACL_DELETE,$cal_id=intval($_GET['cal_id'])))
                        {
                                if(isset($_POST['delete_type']) && 
$_POST['delete_type'] == 'single')
@@ -1135,15 +1139,15 @@
                        }
                        else
                        {
-                               $cd = '';
+                               $cd = '0';
                        }
                        if ($this->bo->return_to)
                        {
-                               Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->bo->return_to );
                        }
                        else
                        {
-                               Header('Location: 
'.$this->page('','&date='.$date.($cd?'&cd='.$cd:'')));
+                               Header('Location: ' . $this->page('', 
array('date' => $date, 'cd' => ($cd ? $cd : '0')), true));
                        }
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
@@ -1235,7 +1239,8 @@
                        $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Change Status');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
                        
                        $event = $this->bo->read_entry($_GET['cal_id']);
 
@@ -1282,11 +1287,11 @@
 
                        if ($this->bo->return_to)
                        {
-                               Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$this->bo->return_to);
                        }
                        else
                        {
-                               Header('Location: '.$this->page('','')); 
+                               Header('Location: ' . $this->page('','', 
true)); 
                        }
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
@@ -1354,8 +1359,12 @@
                        {
                                
unset($GLOBALS['phpgw_info']['flags']['noheader']);
                                
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                               if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Group Planner');
-                               $GLOBALS['phpgw']->common->phpgw_header();
+                               if ($this->always_app_header)
+                               {
+                                       
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Group Planner');
+                               }
+                               //$GLOBALS['phpgw']->common->phpgw_header();
+                               $this->header();
                        }
 
                        // intervals_per_day can be configured in preferences 
now :-)
@@ -1890,8 +1899,12 @@
 
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       if ($this->always_app_header)
+                       {
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
+                       }
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $p = &$GLOBALS['phpgw']->template;
                        $p->set_file(
@@ -2004,7 +2017,7 @@
 
                        $vars = array(
                                'submit_button'         => lang('View'),
-                               'action_url_button'     => $this->bo->return_to 
? $GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to) : 
$this->page(''),
+                               'action_url_button'     => $this->bo->return_to 
? $GLOBALS['phpgw']->link('/index.php', $this->bo->return_to) : $this->page(''),
                                'action_text_button'    => lang('Cancel'),
                                'action_confirm_button' => '',
                                'action_extra_field'    => ''
@@ -2063,9 +2076,12 @@
 
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       if ($this->always_app_header) 
$GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
-                       $GLOBALS['phpgw']->common->phpgw_header();
-
+                       if ($this->always_app_header)
+                       {
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview');
+                       }
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        switch($_POST['matrixtype'])
                        {
@@ -2173,7 +2189,8 @@
                        {
                                // If we reach this, it is because they didn't 
search for anything,
                                // attempt to send them back to where they 
where.
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',array(
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array
+                               (
                                        'menuaction' => $_POST['from'],
                                        'date' => 
$_POST['year'].$_POST['month'].$_POST['day']
                                )));
@@ -2183,7 +2200,8 @@
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Search 
Results');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $error = '';
 
@@ -2296,7 +2314,7 @@
                        $p->parse($row,$list,True);
                }
 
-               function page($_page='',$params='')
+               function page($_page='',$params='', $redirect = false)
                {
                        if($_page == '')
                        {
@@ -2328,30 +2346,39 @@
                                parse_str($params, $new_params);
                                $params =& $new_params;
                        }
-                       
                        $params['menuaction'] = 
"{$page_app}.ui{$page_app}.{$_page}";
-                       return $GLOBALS['phpgw']->link('/index.php', $params);
+                       return $GLOBALS['phpgw']->link('/index.php', $params, 
$redirect);
                }
 
                function header()
                {
+                       if ( $this->header_included )
+                       {
+                               return false;
+                       }
+                       $this->header_included = true;
+
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       echo parse_navbar();
+
                        $cols = 8;
                        if($this->bo->check_perms(PHPGW_ACL_PRIVATE) == True)
                        {
                                $cols++;
                        }
 
-                       $tpl = $GLOBALS['phpgw']->template;
+                       $tpl =& $GLOBALS['phpgw']->template;
+                       $tpl->set_root(PHPGW_APP_TPL);
                        $tpl->set_unknowns('remove');
 
+                       /*
                        if (!file_exists($file = 
$this->template_dir.'/header.inc.php'))
                        {
-                               $file = PHPGW_SERVER_ROOT . 
'/calendar/templates/default/header.inc.php';
+                               $file = PHPGW_SERVER_ROOT . 
'/calendar/templates/base/header.inc.php';
                        }
                        include($file);
-                       $header = $tpl->fp('out','head');
-                       unset($tpl);
-                       echo $header;
+                       $tpl->pfp('out','head_tpl');
+                       */
                }
 
                function footer()
@@ -2553,7 +2580,8 @@
                                $GLOBALS['phpgw_info']['flags']['noappheader'] 
= True;
                                $GLOBALS['phpgw_info']['flags']['noappfooter'] 
= True;
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Permission 
denied');
-                               $GLOBALS['phpgw']->common->phpgw_header();
+                               //$GLOBALS['phpgw']->common->phpgw_header();
+                               $this->header();
                        }
                        echo '<center>You do not have permission to edit this 
appointment!</center>';
                        return;
@@ -2863,7 +2891,8 @@
                        $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Scheduling 
Conflict');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       //$GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $p = $GLOBALS['phpgw']->template;
                        $p->set_file(
@@ -2963,7 +2992,7 @@
                        return $ret_val;
                }
 
-               function week_header($month,$year,$display_name = False)
+               function week_header($month, $year, $display_name = False)
                {
                        $this->weekstarttime = 
$GLOBALS['phpgw']->datetime->get_weekday_start($year,$month,1);
 
@@ -3719,7 +3748,7 @@
                        if ($this->bo->return_to)
                        {
                                $var = array(
-                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to),
+                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php', $this->bo->return_to),
                                        'action_text_button'    => 
lang('cancel'),
                                        'action_confirm_button' => '',
                                        'action_extra_field'    => ''
@@ -3851,17 +3880,14 @@
                        
                        // $sb = CreateObject('phpgwapi.sbox');
                        $sb = CreateObject('phpgwapi.sbox2');
-                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
-## by tb
-                       $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
-## by tb
+                       $jscal = CreateObject('phpgwapi.jscalendar');
 
                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
                        $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$event['id'] ? lang('Calendar - Edit') : lang('Calendar - Add');
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       $this->header();
 
                        $p = &$GLOBALS['phpgw']->template;
                        $p->set_file(
@@ -4255,7 +4281,7 @@
                        if ($this->bo->return_to)
                        {
                                $var = array(
-                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->bo->return_to),
+                                       'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php', $this->bo->return_to),
                                        'action_text_button'    => 
lang('Cancel'),
                                        'action_confirm_button' => '',
                                        'action_extra_field'    => ''

Index: setup/phpgw_en.lang
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/setup/phpgw_en.lang,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- setup/phpgw_en.lang 23 Oct 2005 12:57:16 -0000      1.32
+++ setup/phpgw_en.lang 5 Jun 2006 12:11:03 -0000       1.33
@@ -66,7 +66,7 @@
 delete series  calendar        en      Delete Series
 delete single  calendar        en      Delete Single
 deleted        calendar        en      Deleted
-description    calendar        en      DESCRIPTION
+description    calendar        en      Description
 display interval in day view   calendar        en      Display interval in Day 
View
 display mini calendars when printing   calendar        en      Display mini 
calendars when printing
 display status of events       calendar        en      Display Status of Events




reply via email to

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