From 2d9dab1a1f18aad8784f727adc8401db046ad9c0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 15 Nov 2003 15:28:15 +0000 Subject: [PATCH] private events: no 2. private (for not shown description), added icon with participant-name(s) removed the alt-attribute from the images --- calendar/inc/class.uicalendar.inc.php | 122 +++++++++++++------------- 1 file changed, 59 insertions(+), 63 deletions(-) diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 0001fed68d..b5b3f13027 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -2637,7 +2637,7 @@ { $str = ''; $is_private = !$event['public'] && !$this->bo->check_perms(PHPGW_ACL_READ,$event); - $editable = !$this->bo->printer_friendly && $this->bo->check_perms(PHPGW_ACL_READ,$event); + $viewable = !$this->bo->printer_friendly && $this->bo->check_perms(PHPGW_ACL_READ,$event); $starttime = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; $endtime = $this->bo->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset; @@ -2678,26 +2678,30 @@ $time = ''; } $text = ''; + if(!$is_private) { $text .= $this->bo->display_status($event['users_status']); } - $text = ' '.$time.'  '.$this->bo->get_short_field($event,$is_private,'title').$text.': '.$this->bo->get_short_field($event,$is_private,'description').''.$GLOBALS['phpgw']->browser->br; + $text = ' '.$time.'  '.$this->bo->get_short_field($event,$is_private,'title').$text. + (!$is_private && $event['description'] ? ': '.$this->bo->get_short_field($event,$is_private,'description').'':''). + $GLOBALS['phpgw']->browser->br; - if ($editable) + if ($viewable) { $date = sprintf('%04d%02d%02d',$year,$month,$day); $this->link_tpl->set_var('link_link',$this->page('view','&cal_id='.$event['id'].'&date='.$date)); $this->link_tpl->set_var('lang_view',lang('View this entry')); $this->link_tpl->parse('picture','link_open',True); - + } + if (!$is_private) + { if($event['priority'] == 3) { $picture[] = Array( 'pict' => $GLOBALS['phpgw']->common->image('calendar','high'), 'width' => 8, 'height'=> 17, - 'alt' => lang('high priority'), 'title' => lang('high priority') ); } @@ -2707,7 +2711,6 @@ 'pict' => $GLOBALS['phpgw']->common->image('calendar','circle'), 'width' => 5, 'height'=> 7, - 'alt' => lang('single event'), 'title' => lang('single event') ); } @@ -2717,71 +2720,64 @@ 'pict' => $GLOBALS['phpgw']->common->image('calendar','recur'), 'width' => 12, 'height'=> 12, - 'alt' => lang('recurring event'), 'title' => lang('recurring event') ); } - - $participants = $this->planner_participants($event['participants']); - if(count($event['participants']) > 1) + } + $participants = $this->planner_participants($event['participants']); + if(count($event['participants']) > 1) + { + $picture[] = Array( + 'pict' => $GLOBALS['phpgw']->common->image('calendar','multi_3'), + 'width' => 14, + 'height'=> 14, + 'title' => $participants + ); + } + else + { + $picture[] = Array( + 'pict' => $GLOBALS['phpgw']->common->image('calendar','single'), + 'width' => 14, + 'height'=> 14, + 'title' => $participants + ); + } + if($event['public'] == 0) + { + $picture[] = Array( + 'pict' => $GLOBALS['phpgw']->common->image('calendar','private'), + 'width' => 13, + 'height'=> 13, + 'title' => lang('private') + ); + } + if(@isset($event['alarm']) && count($event['alarm']) >= 1 && !$is_private) + { + // if the alarm is to go off the day before the event + // the icon does not show up because of 'alarm_today' + // - TOM + if($this->bo->alarm_today($event,$rawdate_offset,$starttime)) { $picture[] = Array( - 'pict' => $GLOBALS['phpgw']->common->image('calendar','multi_3'), - 'width' => 14, - 'height'=> 14, - 'alt' => $participants, - 'title' => $participants - ); - } - else - { - $picture[] = Array( - 'pict' => $GLOBALS['phpgw']->common->image('calendar','single'), - 'width' => 14, - 'height'=> 14, - 'alt' => $participants, - 'title' => $participants - ); - } - if($event['public'] == 0) - { - $picture[] = Array( - 'pict' => $GLOBALS['phpgw']->common->image('calendar','private'), + 'pict' => $GLOBALS['phpgw']->common->image('calendar','alarm'), 'width' => 13, 'height'=> 13, - 'alt' => lang('private'), - 'title' => lang('private') + 'title' => lang('alarm') ); } - if(@isset($event['alarm']) && count($event['alarm']) >= 1) - { - // if the alarm is to go off the day before the event - // the icon does not show up because of 'alarm_today' - // - TOM - if($this->bo->alarm_today($event,$rawdate_offset,$starttime)) - { - $picture[] = Array( - 'pict' => $GLOBALS['phpgw']->common->image('calendar','alarm'), - 'width' => 13, - 'height'=> 13, - 'alt' => lang('alarm'), - 'title' => lang('alarm') - ); - } - } + } - $description = $this->bo->get_short_field($event,$is_private,'description'); - for($i=0;$i $picture[$i]['pict'], - 'width' => $picture[$i]['width'], - 'height' => $picture[$i]['height'], - 'alt' => $picture[$i]['alt'], - 'title' => $picture[$i]['title'] - ); - $this->output_template_array($this->link_tpl,'picture','pict',$var); - } + $description = $this->bo->get_short_field($event,$is_private,'description'); + for($i=0;$i $picture[$i]['pict'], + 'width' => $picture[$i]['width'], + 'height' => $picture[$i]['height'], + 'title' => $picture[$i]['title'] + ); + $this->output_template_array($this->link_tpl,'picture','pict',$var); } if ($text) { @@ -2791,7 +2787,7 @@ $this->output_template_array($this->link_tpl,'picture','link_text',$var); } - if ($editable) + if ($viewable) { $this->link_tpl->parse('picture','link_close',True); } @@ -3026,7 +3022,7 @@ if ($day_params['new_event']) { $new_event_link = ' ' - . ''.lang('New Entry').'' + . '' . ''; $day_number = ''.$day.''; }