From ede96854abb4b7ea1e8e9a9ae9246f747060adb9 Mon Sep 17 00:00:00 2001 From: skeeter Date: Tue, 13 Mar 2001 05:03:50 +0000 Subject: [PATCH] various fixes --- calendar/inc/class.calendar.inc.php | 2 +- calendar/inc/class.calendar_sql.inc.php | 7 ++++--- calendar/inc/functions.inc.php | 9 +++++++-- calendar/inc/header.inc.php | 10 +++++++++- calendar/month.php | 2 +- calendar/view.php | 20 ++++---------------- 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index 5729e309f6..80c158db72 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -80,7 +80,7 @@ class calendar extends calendar_ $this->image_dir = $phpgw->common->get_image_path('calendar'); $this->today = $this->localdates(time()); - $this->open($this->owner); + $this->open('',intval($this->owner)); $this->read_repeated_events($this->owner); $this->set_filter(); } diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index 9d53778e24..7c8edeb316 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -28,7 +28,8 @@ class calendar_ extends calendar__ $this->stream = $phpgw->db; if($user=='') { - $this->user = $phpgw_info['user']['account_id']; + settype($user,'integer'); + $user = $phpgw_info['user']['account_id']; } elseif(is_int($user)) { @@ -38,7 +39,7 @@ class calendar_ extends calendar__ { $this->user = $phpgw->accounts->name2id($user); } - + return $this->stream; } @@ -213,7 +214,7 @@ class calendar_ extends calendar__ $this->event->end->alarm = 0; //Legacy Support - $this->event->priority = $this->stream->f('cal_priority'); + $this->event->priority = intval($this->stream->f('cal_priority')); if($this->stream->f('cal_group')) { $groups = explode(',',$this->stream->f('cal_group')); diff --git a/calendar/inc/functions.inc.php b/calendar/inc/functions.inc.php index 9ce26a3065..587fb6ab12 100755 --- a/calendar/inc/functions.inc.php +++ b/calendar/inc/functions.inc.php @@ -47,13 +47,18 @@ $rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16; } } + else + { + $owner = $phpgw_info['user']['account_id']; + $rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16; + } } /* Load calendar class */ $parameters = Array( 'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False), - 'owner' => $owner, - 'rights' => $rights + 'owner' => intval($owner), + 'rights' => intval($rights) ); $phpgw->calendar = CreateObject('calendar.calendar',$parameters); diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php index 6830a30071..634939c696 100644 --- a/calendar/inc/header.inc.php +++ b/calendar/inc/header.inc.php @@ -88,8 +88,16 @@ 0) { + $page_array = explode('/',$phpgw_info['server']['webserver_url']); + $page_dir = '/'; + for($i=3;$i -
+ : diff --git a/calendar/month.php b/calendar/month.php index 50e5464d43..281750c580 100755 --- a/calendar/month.php +++ b/calendar/month.php @@ -55,7 +55,7 @@ { $printer = ''; $param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner; - $print = '[".lang('Printer Friendly').']'; + $print = '[".lang('Printer Friendly').']'; } else { diff --git a/calendar/view.php b/calendar/view.php index 8b5f59bd29..8e10af8a8a 100755 --- a/calendar/view.php +++ b/calendar/view.php @@ -55,33 +55,21 @@ echo '
'; - if (($event->owner == $owner) && ($rights & PHPGW_ACL_EDIT)) + if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) == True)) { $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry.php','id='.$id.'&owner='.$owner)); $p->set_var('action_text_button',' '.lang('Edit').' '); $p->set_var('action_confirm_button',''); - $p->parse('edit_button','form_button'); - } - else - { - $p->set_var('edit_button',''); + echo $p->finish($p->parse('out','form_button')); } - echo $p->finish($p->parse('out','form_button')); - - if (($event->owner == $owner) && ($rights & PHPGW_ACL_DELETE)) + if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_DELETE) == True)) { $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id.'&owner='.$owner)); $p->set_var('action_text_button',lang('Delete')); $p->set_var('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.")."')\""); - $p->parse('delete_button','form_button'); + echo $p->finish($p->parse('out','form_button')); } - else - { - $p->set_var('delete_button',''); - } - - echo $p->finish($p->parse('out','form_button')); echo '
';