mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
fixes for acl - not working with day view
This commit is contained in:
parent
5a4b832fa2
commit
bad09776e3
105
calendar/day.php
105
calendar/day.php
@ -14,67 +14,70 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_flags = Array (
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
$phpgw_flags = Array (
|
||||
'currentapp' => 'calendar',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
$phpgw_info['flags'] = $phpgw_flags;
|
||||
|
||||
if (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw_info['flags']['noheader'] = True;
|
||||
$phpgw_info['flags']['nonavbar'] = True;
|
||||
$phpgw_info['flags']['noappheader'] = True;
|
||||
$phpgw_info['flags']['noappfooter'] = True;
|
||||
$phpgw_info['flags']['nofooter'] = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
$friendly = 0;
|
||||
}
|
||||
if (isset($friendly) && $friendly)
|
||||
{
|
||||
$phpgw_info['flags']['noheader'] = True;
|
||||
$phpgw_info['flags']['nonavbar'] = True;
|
||||
$phpgw_info['flags']['noappheader'] = True;
|
||||
$phpgw_info['flags']['noappfooter'] = True;
|
||||
$phpgw_info['flags']['nofooter'] = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
$friendly = 0;
|
||||
}
|
||||
|
||||
include('../header.inc.php');
|
||||
$view = 'day';
|
||||
include('../header.inc.php');
|
||||
|
||||
$view = 'day';
|
||||
|
||||
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
|
||||
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
|
||||
|
||||
$template = Array(
|
||||
'day_t' => 'day.tpl'
|
||||
);
|
||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||
$template = Array(
|
||||
'day_t' => 'day.tpl'
|
||||
);
|
||||
|
||||
$phpgw->template->set_file($template);
|
||||
$p->set_file($template);
|
||||
|
||||
//$phpgw->template->set_block('day_t');
|
||||
// $phpgw->template->set_block('day_t');
|
||||
|
||||
if ($friendly)
|
||||
{
|
||||
$phpgw->template->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->template->set_var('printer_friendly','');
|
||||
}
|
||||
if ($friendly)
|
||||
{
|
||||
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
|
||||
}
|
||||
else
|
||||
{
|
||||
$p->set_var('printer_friendly','');
|
||||
}
|
||||
|
||||
$phpgw->template->set_var('bg_text',$phpgw_info['theme']['bg_text']);
|
||||
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
|
||||
|
||||
$m = mktime(2,0,0,$thismonth,1,$thisyear);
|
||||
$phpgw->template->set_var('date',lang(date('F',$m)).' '.$thisday.', '.$thisyear);
|
||||
$phpgw->template->set_var('username',$phpgw->common->grab_owner_name($owner));
|
||||
$phpgw->template->set_var('daily_events',$phpgw->calendar->print_day_at_a_glance($now,$owner));
|
||||
$phpgw->template->set_var('small_calendar',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
|
||||
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
||||
$p->set_var('date',lang(date('F',$m)).' '.$thisday.', '.$thisyear);
|
||||
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
|
||||
$p->set_var('daily_events',$phpgw->calendar->print_day_at_a_glance($now,$owner));
|
||||
$p->set_var('small_calendar',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
|
||||
|
||||
if (!$friendly)
|
||||
{
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$phpgw->template->set_var('print','<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</A>');
|
||||
$phpgw->template->pparse('out','day_t');
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpgw->template->set_var('print','');
|
||||
$phpgw->template->pparse('out','day_t');
|
||||
}
|
||||
if ($friendly == 0)
|
||||
{
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$print = '';
|
||||
}
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
$p->set_var('print',$print);
|
||||
|
||||
$p->pparse('out','day_t');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -676,6 +676,7 @@ class calendar_
|
||||
$p->set_var('pic_image',$phpgw->common->get_image_path('calendar').'/'.$pic);
|
||||
$p->set_var('description',$description);
|
||||
$str = $p->finish($p->parse('out','link_pict'));
|
||||
unset($p);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
@ -1072,7 +1073,7 @@ class calendar_
|
||||
}
|
||||
|
||||
$p->set_var('new_event_link',$str);
|
||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/day.php','month='.$date['month'].'&day='.$date['day'].'&year='.$date['year']).'">'.$date['day'].'</a>';
|
||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/day.php','month='.$date['month'].'&day='.$date['day'].'&year='.$date['year'].'&owner='.$this->owner).'">'.$date['day'].'</a>';
|
||||
$p->set_var('day_number',$str);
|
||||
}
|
||||
else
|
||||
@ -1156,7 +1157,7 @@ class calendar_
|
||||
|
||||
if(!$this->printer_friendly)
|
||||
{
|
||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/week.php','date='.$date['full']).'">week ' .(int)((date('z',($startdate+(24*3600*4)))+7)/7).'</a>';
|
||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/week.php','date='.$date['full'].'&owner='.$this->owner).'">week ' .(int)((date('z',($startdate+(24*3600*4)))+7)/7).'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1639,10 +1640,10 @@ class calendar_
|
||||
$this->hour_arr[$ind] = '';
|
||||
}
|
||||
|
||||
if (!$this->printer_friendly)
|
||||
if ($this->printer_friendly == False)
|
||||
{
|
||||
$this->hour_arr[$ind] .= '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url']
|
||||
.'/calendar/view.php','id='.$event->id)
|
||||
.'/calendar/view.php','id='.$event->id.'&owner='.$this->owner)
|
||||
. "\" onMouseOver=\"window.status='"
|
||||
. lang('View this entry')."'; return true;\">";
|
||||
}
|
||||
@ -1678,7 +1679,12 @@ class calendar_
|
||||
}
|
||||
}
|
||||
$this->hour_arr[$ind] .= '] ';
|
||||
$this->hour_arr[$ind] .= '<img src="'.$phpgw->common->get_image_path('calendar').'/circle.gif" border="0" alt="' . $event->description . '"></a>';
|
||||
$this->hour_arr[$ind] .= '<img src="'.$phpgw->common->get_image_path('calendar').'/circle.gif" border="0" alt="' . $event->description . '">';
|
||||
|
||||
if ($this->printer_friendly == False)
|
||||
{
|
||||
$this->hour_arr[$ind] .= '</a>';
|
||||
}
|
||||
|
||||
if ($event->priority == 3)
|
||||
{
|
||||
@ -1863,19 +1869,19 @@ class calendar_
|
||||
$p->set_var('close_link','');
|
||||
$str = ' - ';
|
||||
|
||||
if(!$this->printer_friendly && $this->check_perms(PHPGW_ACL_EDIT))
|
||||
if(($this->printer_friendly == False) && ($this->check_perms(PHPGW_ACL_EDIT) == True))
|
||||
{
|
||||
$str .= '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url']
|
||||
. '/calendar/edit_entry.php','year='.$date['year']
|
||||
. '&month='.$date['month'].'&day='.$date['day']
|
||||
. '&hour='.substr($time,0,strpos($time,':'))
|
||||
. '&minute='.substr($time,strpos($time,':')+1,2)).'">';
|
||||
. '&minute='.substr($time,strpos($time,':')+1,2).'&owner='.$this->owner).'">';
|
||||
}
|
||||
|
||||
$p->set_var('open_link',$str);
|
||||
$p->set_var('time',(intval(substr($time,0,strpos($time,':'))) < 10 ? '0'.$time : $time) );
|
||||
|
||||
if(!$this->printer_friendly && $this->check_perms(PHPGW_ACL_EDIT))
|
||||
if(($this->printer_friendly == False) && ($this->check_perms(PHPGW_ACL_EDIT) == True))
|
||||
{
|
||||
$p->set_var('close_link','</a>');
|
||||
}
|
||||
|
@ -99,6 +99,9 @@
|
||||
<input type="hidden" name="year" value="<?php echo $thisyear; ?>">
|
||||
<?php if(isset($keywords) && $keywords) { ?>
|
||||
<input type="hidden" name="keywords" value="<?php echo $keywords; ?>">
|
||||
<?php } ?>
|
||||
<?php if(isset($id) && $id != 0) { ?>
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
||||
<?php } ?>
|
||||
<select name="owner" onchange="document.setowner.submit()">
|
||||
<?php
|
||||
|
@ -51,16 +51,18 @@
|
||||
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
|
||||
$p->set_var('small_calendar_next',$phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'));
|
||||
$p->set_var('large_month',$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
|
||||
if (!$friendly) {
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$p->set_var('print','<a href="'.$phpgw->link('',$param).'" TARGET="cal_printer_friendly" onMouseOver="window.'
|
||||
. "status = '" . lang('Generate printer-friendly version'). "'\">[". lang('Printer Friendly') . ']</a>');
|
||||
$p->parse('out','index_t');
|
||||
$p->pparse('out','index_t');
|
||||
} else {
|
||||
$p->set_var('print','');
|
||||
$p->parse('out','index_t');
|
||||
$p->pparse('out','index_t');
|
||||
}
|
||||
|
||||
if ($friendly == 0)
|
||||
{
|
||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$print = '';
|
||||
}
|
||||
|
||||
$p->set_var('print',$print);
|
||||
$p->pparse('out','index_t');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user