forked from extern/egroupware
various fixes
This commit is contained in:
parent
57e1b92f8f
commit
ede96854ab
@ -80,7 +80,7 @@ class calendar extends calendar_
|
|||||||
$this->image_dir = $phpgw->common->get_image_path('calendar');
|
$this->image_dir = $phpgw->common->get_image_path('calendar');
|
||||||
$this->today = $this->localdates(time());
|
$this->today = $this->localdates(time());
|
||||||
|
|
||||||
$this->open($this->owner);
|
$this->open('',intval($this->owner));
|
||||||
$this->read_repeated_events($this->owner);
|
$this->read_repeated_events($this->owner);
|
||||||
$this->set_filter();
|
$this->set_filter();
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,8 @@ class calendar_ extends calendar__
|
|||||||
$this->stream = $phpgw->db;
|
$this->stream = $phpgw->db;
|
||||||
if($user=='')
|
if($user=='')
|
||||||
{
|
{
|
||||||
$this->user = $phpgw_info['user']['account_id'];
|
settype($user,'integer');
|
||||||
|
$user = $phpgw_info['user']['account_id'];
|
||||||
}
|
}
|
||||||
elseif(is_int($user))
|
elseif(is_int($user))
|
||||||
{
|
{
|
||||||
@ -38,7 +39,7 @@ class calendar_ extends calendar__
|
|||||||
{
|
{
|
||||||
$this->user = $phpgw->accounts->name2id($user);
|
$this->user = $phpgw->accounts->name2id($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->stream;
|
return $this->stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +214,7 @@ class calendar_ extends calendar__
|
|||||||
$this->event->end->alarm = 0;
|
$this->event->end->alarm = 0;
|
||||||
|
|
||||||
//Legacy Support
|
//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'))
|
if($this->stream->f('cal_group'))
|
||||||
{
|
{
|
||||||
$groups = explode(',',$this->stream->f('cal_group'));
|
$groups = explode(',',$this->stream->f('cal_group'));
|
||||||
|
@ -47,13 +47,18 @@
|
|||||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
$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 */
|
/* Load calendar class */
|
||||||
$parameters = Array(
|
$parameters = Array(
|
||||||
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
|
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
|
||||||
'owner' => $owner,
|
'owner' => intval($owner),
|
||||||
'rights' => $rights
|
'rights' => intval($rights)
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
||||||
|
@ -88,8 +88,16 @@
|
|||||||
<?php
|
<?php
|
||||||
if(count($grants) > 0)
|
if(count($grants) > 0)
|
||||||
{
|
{
|
||||||
|
$page_array = explode('/',$phpgw_info['server']['webserver_url']);
|
||||||
|
$page_dir = '/';
|
||||||
|
for($i=3;$i<count($page_array);$i++)
|
||||||
|
{
|
||||||
|
$page_dir .= $page_array[$i].'/';
|
||||||
|
}
|
||||||
|
$page_dir = substr($page_dir,0,strlen($page_dir)-1);
|
||||||
|
$page = str_replace($page_dir,'',$PHP_SELF);
|
||||||
?>
|
?>
|
||||||
<form action="<?php echo $phpgw->link($PHP_SELF); ?>" method="POST" name="setowner">
|
<form action="<?php echo $phpgw->link($page); ?>" method="POST" name="setowner">
|
||||||
<td width="20%" align="center" valign="center">
|
<td width="20%" align="center" valign="center">
|
||||||
<b><?php echo lang('User'); ?>:</b>
|
<b><?php echo lang('User'); ?>:</b>
|
||||||
<input type="hidden" name="from" value="<?php echo $PHP_SELF; ?>">
|
<input type="hidden" name="from" value="<?php echo $PHP_SELF; ?>">
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
{
|
{
|
||||||
$printer = '';
|
$printer = '';
|
||||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||||
$print = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/month.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
$print = '<a href="'.$phpgw->link('/calendar/month.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -55,33 +55,21 @@
|
|||||||
|
|
||||||
echo '<center>';
|
echo '<center>';
|
||||||
|
|
||||||
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_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_text_button',' '.lang('Edit').' ');
|
||||||
$p->set_var('action_confirm_button','');
|
$p->set_var('action_confirm_button','');
|
||||||
$p->parse('edit_button','form_button');
|
echo $p->finish($p->parse('out','form_button'));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$p->set_var('edit_button','');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $p->finish($p->parse('out','form_button'));
|
if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_DELETE) == True))
|
||||||
|
|
||||||
if (($event->owner == $owner) && ($rights & PHPGW_ACL_DELETE))
|
|
||||||
{
|
{
|
||||||
$p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id.'&owner='.$owner));
|
$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_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->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 '</center>';
|
echo '</center>';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user