various fixes

This commit is contained in:
skeeter 2001-03-13 05:03:50 +00:00
parent 57e1b92f8f
commit ede96854ab
6 changed files with 26 additions and 24 deletions

View File

@ -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();
}

View File

@ -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))
{
@ -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'));

View File

@ -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);

View File

@ -88,8 +88,16 @@
<?php
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">
<b><?php echo lang('User'); ?>:</b>
<input type="hidden" name="from" value="<?php echo $PHP_SELF; ?>">

View File

@ -55,7 +55,7 @@
{
$printer = '';
$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
{

View File

@ -55,33 +55,21 @@
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_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 '</center>';