[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: calendar/inc hook_home_planner.inc.php,1.1,1.2 c
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: calendar/inc hook_home_planner.inc.php,1.1,1.2 class.boalarm.inc.php,1.3,1.4 class.bocalendar.inc.php,1.85,1.86 class.socalendar_sql.inc.php,1.31,1.32 class.uialarm.inc.php,1.4,1.5 class.uicalendar.inc.php,1.89,1.90 class.uipreferences.inc.php,1.7,1.8 hook_home.inc.php,1.38,1.39 |
Date: |
Sat, 23 Nov 2002 09:19:35 -0500 |
Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv13750
Modified Files:
class.boalarm.inc.php class.bocalendar.inc.php
class.socalendar_sql.inc.php class.uialarm.inc.php
class.uicalendar.inc.php class.uipreferences.inc.php
hook_home.inc.php
Added Files:
hook_home_planner.inc.php
Log Message:
merged differences from the .14 branch
Index: class.boalarm.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.boalarm.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boalarm.inc.php 28 Dec 2001 15:53:33 -0000 1.3
--- class.boalarm.inc.php 23 Nov 2002 14:19:32 -0000 1.4
***************
*** 68,77 ****
return $this->cal->read_entry($cal_id);
}
-
- function can_user_edit($event)
- {
- return $this->cal->can_user_edit($event);
- }
-
/* Public functions */
}
--- 68,71 ----
Index: class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -r1.85 -r1.86
*** class.bocalendar.inc.php 28 Sep 2002 20:01:43 -0000 1.85
--- class.bocalendar.inc.php 23 Nov 2002 14:19:32 -0000 1.86
***************
*** 144,163 ****
$this->use_session = True;
}
-
print_debug('BO Filter',$this->filter);
print_debug('Owner',$this->owner);
$this->prefs['calendar'] =
$GLOBALS['phpgw_info']['user']['preferences']['calendar'];
-
- $owner = get_var('owner',Array('GLOBAL','GET','POST'));
! if ((!isset($owner) || $owner == '')
! && MENUACTION == 'calendar.uicalendar.planner'
! && get_var('from',Array('POST')) !=
'calendar.uicalendar.planner'
! &&
$this->prefs['calendar']['planner_start_with_group'] != '-1')
! {
! $owner =
$this->prefs['calendar']['planner_start_with_group'];
}
!
if(isset($owner) && $owner!='' && substr($owner,0,2) ==
'g_')
{
--- 144,183 ----
$this->use_session = True;
}
print_debug('BO Filter',$this->filter);
print_debug('Owner',$this->owner);
$this->prefs['calendar'] =
$GLOBALS['phpgw_info']['user']['preferences']['calendar'];
! $owner =
(isset($GLOBALS['owner'])?$GLOBALS['owner']:'');
! $owner =
(isset($GLOBALS['HTTP_GET_VARS']['owner'])?$GLOBALS['HTTP_GET_VARS']['owner']:$owner);
! $owner = ($owner=='' &&
isset($GLOBALS['HTTP_POST_VARS']['owner'])?$GLOBALS['HTTP_POST_VARS']['owner']:$owner);
!
!
ereg('menuaction=([a-zA-Z.]+)',$GLOBALS['HTTP_REFERER'],$regs);
! $from = $regs[1];
! if ((substr($GLOBALS['PHP_SELF'],-8) == 'home.php' &&
substr($this->prefs['calendar']['defaultcalendar'],0,7) == 'planner'
! || $GLOBALS['HTTP_GET_VARS']['menuaction'] ==
'calendar.uicalendar.planner' &&
! $from != 'calendar.uicalendar.planner' &&
!$this->save_owner)
! &&
intval($this->prefs['calendar']['planner_start_with_group']) > 0)
! {
! // entering planner for the first time ==>
saving owner in save_owner, setting owner to default
! //
! $this->save_owner = $this->owner;
! $owner =
'g_'.$this->prefs['calendar']['planner_start_with_group'];
! }
! elseif ($GLOBALS['HTTP_GET_VARS']['menuaction'] !=
'calendar.uicalendar.planner' &&
! $this->save_owner)
! {
! // leaving planner with an unchanged user/owner
==> setting owner back to save_owner
! //
! $owner =
intval(isset($GLOBALS['HTTP_GET_VARS']['owner']) ?
$GLOBALS['HTTP_GET_VARS']['owner'] : $this->save_owner);
! unset($this->save_owner);
! }
! elseif (!empty($owner) && $owner != $this->owner &&
$from == 'calendar.uicalendar.planner')
! {
! // user/owner changed within planner ==>
forgetting save_owner
! //
! unset($this->save_owner);
}
!
if(isset($owner) && $owner!='' && substr($owner,0,2) ==
'g_')
{
***************
*** 187,191 ****
$this->users_timeformat = 'H:i';
}
-
$this->holiday_color =
(substr($GLOBALS['phpgw_info']['theme']['bg07'],0,1)=='#'?'':'#').$GLOBALS['phpgw_info']['theme']['bg07'];
--- 207,210 ----
***************
*** 197,205 ****
if(!isset($this->sortby))
{
! $default_calender =
$this->prefs['calendar']['defaultcalendar'];
! if ($default_calender == 'planner_cat' ||
$default_calender == 'planner_user')
! {
! $this->sortby = ($default_calender ==
'planner_cat' ? 'category' : 'user');
! }
}
--- 216,220 ----
if(!isset($this->sortby))
{
! $this->sortby =
$this->prefs['calendar']['defaultcalendar'] == 'planner_user' ? 'user' :
'category';
}
***************
*** 376,380 ****
}
! function save_sessiondata($data)
{
if ($this->use_session)
--- 391,395 ----
}
! function save_sessiondata($data='')
{
if ($this->use_session)
***************
*** 394,401 ****
--- 409,418 ----
$this->sortby = $data['sortby'];
$this->owner = intval($data['owner']);
+ $this->save_owner = intval($data['save_owner']);
$this->year = intval($data['year']);
$this->month = intval($data['month']);
$this->day = intval($data['day']);
$this->num_months = intval($data['num_months']);
+ $this->return_to = $data['return_to'];
}
***************
*** 445,449 ****
if($this->check_perms(PHPGW_ACL_DELETE,$id))
{
! $temp_event = $this->read_entry($id);
// if($this->owner == $temp_event['owner'])
// {
--- 462,466 ----
if($this->check_perms(PHPGW_ACL_DELETE,$id))
{
! // $temp_event = $this->read_entry($id);
// if($this->owner == $temp_event['owner'])
// {
***************
*** 514,528 ****
function expunge()
{
! if($this->check_perms(PHPGW_ACL_DELETE))
{
! reset($this->so->cal->deleted_events);
!
for($i=0;$i<count($this->so->cal->deleted_events);$i++)
{
- $event_id =
$this->so->cal->deleted_events[$i];
- $event =
$this->so->read_entry($event_id);
$this->send_update(MSG_DELETED,$event['participants'],$event);
}
! $this->so->expunge();
}
}
--- 531,548 ----
function expunge()
{
! reset($this->so->cal->deleted_events);
! while(list($i,$event_id) =
each($this->so->cal->deleted_events))
{
! $event = $this->so->read_entry($event_id);
! if($this->check_perms(PHPGW_ACL_DELETE,$event))
{
$this->send_update(MSG_DELETED,$event['participants'],$event);
}
! else
! {
!
unset($this->so->cal->deleted_events[$i]);
! }
}
+ $this->so->expunge();
}
***************
*** 796,799 ****
--- 816,825 ----
if($send_to_ui)
{
+ $this->read_sessiondata();
+ if ($this->return_to)
+ {
+ header('Location:
'.$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->return_to));
+
$GLOBALS['phpgw']->common->phpgw_exit();
+ }
Execmethod('calendar.uicalendar.index');
//
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
***************
*** 844,852 ****
}
- function can_user_edit($event)
- {
- return $this->check_perms(PHPGW_ACL_EDIT,$event);
- }
-
function fix_update_time(&$time_param)
{
--- 870,873 ----
***************
*** 1031,1039 ****
}
! function check_perms($needed,$event=0)
{
if (is_int($event) && $event == 0)
{
! $owner = $this->owner;
}
else
--- 1052,1070 ----
}
! /*!
! @function check_perms( )
! @syntax check_perms($needed,$event=0,$other=0)
! @abstract Checks if the current user has the necessary ACL
rights
! @author ralfbecker
! @discussion The check is performed on an event or general on
the cal of an other user
! @param $needed necessary ACL right: PHPGW_ACL_{READ|EDIT|DELETE}
! @param $event event as array or the event-id or 0 for general
check
! @param $other uid to check (if event==0) or 0 to check against
$this->owner
! */
! function check_perms($needed,$event=0,$other=0)
{
if (is_int($event) && $event == 0)
{
! $owner = $other > 0 ? $other : $this->owner;
}
else
***************
*** 1053,1058 ****
$grants = $this->grants[$owner];
! $access = $user == $owner || $grants & $needed &&
(!$private || $grants & PHPGW_ACL_PRIVATE);
! //echo "<p>rb_check_perms for user $user and needed_acl
$needed: event=$event[title]: owner=$owner, privat=$privat, grants=$grants ==>
access=$access</p>\n";
return $access;
--- 1084,1096 ----
$grants = $this->grants[$owner];
! if ($GLOBALS['phpgw']->accounts->get_type($owner) ==
'g' && $needed == PHPGW_ACL_ADD)
! {
! $access = False; // a group can't be the
owner of an event
! }
! else
! {
! $access = $user == $owner || $grants & $needed
&& (!$private || $grants & PHPGW_ACL_PRIVATE);
! }
! //echo "<p>rb_check_perms for user $user and needed_acl
$needed: event=$event[title]: owner=$owner, privat=$private, grants=$grants ==>
access=$access</p>\n";
return $access;
***************
*** 1077,1082 ****
function display_status($user_status)
{
! if(@$this->prefs['calendar']['display_status'])
{
return ' ('.$user_status.')';
}
--- 1115,1122 ----
function display_status($user_status)
{
! if(@$this->prefs['calendar']['display_status'] &&
$user_status)
{
+ $user_status =
substr($this->get_long_status($user_status),0,1);
+
return ' ('.$user_status.')';
}
***************
*** 1113,1117 ****
$owner = $this->owner;
}
! if ($owner ==
$GLOBALS['phpgw_info']['user']['account_id'] || ($event['public']==1) ||
($this->check_perms(PHPGW_ACL_PRIVATE,$owner) && $event['public']==0) ||
$event['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])
{
return False;
--- 1153,1157 ----
$owner = $this->owner;
}
! if ($owner ==
$GLOBALS['phpgw_info']['user']['account_id'] || ($event['public']==1) ||
($this->check_perms(PHPGW_ACL_PRIVATE,$event) && $event['public']==0) ||
$event['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])
{
return False;
***************
*** 1158,1182 ****
}
! function get_week_label()
{
! $first =
$GLOBALS['phpgw']->datetime->gmtdate($GLOBALS['phpgw']->datetime->get_weekday_start($this->year,
$this->month, $this->day));
! $last =
$GLOBALS['phpgw']->datetime->gmtdate($first['raw'] + 518400);
! // Week Label
! $week_id = lang(strftime("%B",$first['raw'])).'
'.$first['day'];
! if($first['month'] <> $last['month'] && $first['year']
<> $last['year'])
{
! $week_id .= ', '.$first['year'];
! }
! $week_id .= ' - ';
! if($first['month'] <> $last['month'])
! {
! $week_id .= lang(strftime("%B",$last['raw'])).'
';
! }
! $week_id .= $last['day'].', '.$last['year'];
! return $week_id;
}
function normalizeminutes(&$minutes)
{
--- 1198,1264 ----
}
! function long_date($first,$last=0)
{
! $datefmt = $this->prefs['common']['dateformat'];
!
! $month_before_day = $datefmt[0] == 'm' || $datefmt[2]
== 'm' && $datefmt[4] == 'd';
! for ($i = 0; $i < 5; $i += 2)
{
! switch($datefmt[$i])
! {
! case 'd':
! $range .= $first['day'] .
($datefmt[1] == '.' ? '.' : '');
! if ($first['month'] !=
$last['month'] || $first['year'] != $last['year'])
! {
! if (!$month_before_day)
! {
! $range .= '
'.lang(strftime('%B',$first['raw']));
! }
! if ($first['year'] !=
$last['year'] && $datefmt[0] != 'Y')
! {
! $range .=
($datefmt[0] != 'd' ? ', ' : ' ') . $first['year'];
! }
! if (!$last)
! {
! return $range;
! }
! $range .= ' - ';
!
! if ($first['year'] !=
$last['year'] && $datefmt[0] == 'Y')
! {
! $range .=
$last['year'] . ', ';
! }
! if ($month_before_day)
! {
! $range .=
lang(strftime('%B',$last['raw']));
! }
! }
! else
! {
! $range .= ' - ';
! }
! $range .= ' ' . $last['day'] .
($datefmt[1] == '.' ? '.' : '');
! break;
! case 'm':
! $range .= '
'.lang(strftime('%B',$month_before_day ? $first['raw'] : $last['raw'])) . ' ';
! break;
! case 'Y':
! $range .= ($datefmt[0] == 'm' ?
', ' : ' ') . ($datefmt[0] == 'Y' ? $first['year'].', ' : $last['year'].' ');
! break;
! }
! }
! return $range;
}
+ function get_week_label()
+ {
+ $first =
$GLOBALS['phpgw']->datetime->gmtdate($GLOBALS['phpgw']->datetime->get_weekday_start($this->year,
$this->month, $this->day));
+ $last =
$GLOBALS['phpgw']->datetime->gmtdate($first['raw'] + 518400);
+
+ return ($this->long_date($first,$last));
+ }
+
function normalizeminutes(&$minutes)
{
***************
*** 1899,1902 ****
--- 1981,1985 ----
{
$new_event_datetime =
$this->maketime($new_event['start']) - $GLOBALS['phpgw']->datetime->tz_offset;
+ $new_event_datetime_end =
$this->maketime($new_event['end']) - $GLOBALS['phpgw']->datetime->tz_offset;
}
***************
*** 1960,1963 ****
--- 2043,2047 ----
{
$new_event_date =
$GLOBALS['phpgw']->common->show_date($new_event_datetime);
+ $new_event_end =
$GLOBALS['phpgw']->common->show_date($new_event_datetime_end);
}
***************
*** 1987,1990 ****
--- 2071,2075 ----
$action_date =
$old_event_date;
$body = 'On
'.$GLOBALS['phpgw']->common->show_date(time() -
$GLOBALS['phpgw']->datetime->tz_offset).'
'.$GLOBALS['phpgw']->common->grab_owner_name($GLOBALS['phpgw_info']['user']['account_id']).'
'.$action.' your meeting request for '.$old_event_date;
+ $body = lang('On %1 %2
%3 your meeting request for %4',$GLOBALS['phpgw']->common->show_date(time() -
$GLOBALS['phpgw']->datetime->tz_offset),$GLOBALS['phpgw']->common->grab_owner_name($GLOBALS['phpgw_info']['user']['account_id']),lang($action),$old_event_date);
$event_head=$old_event['title'];
$event_description=$old_event['description'];
***************
*** 1997,2000 ****
--- 2082,2086 ----
$body .=
"\n\n".'***'.lang('Please confirm,accept,reject or examine changes in the
corresponding entry in your calendar').'***'."\n\n"
. '----'.lang('Event
Details Follow').'----';
+ $body .= ($new_event_date ?
"\n\n".lang('Start- and Enddates').":\n".$new_event_date.' -- '. $new_event_end
: '');
$body .=
($event_head?"\n\n".lang('TITLE').':'."\n".' '.$event_head:'');
$body .=
($event_description?"\n\n".lang('DESCRIPTION').':'."\n".'
'.$event_description:'');
Index: class.socalendar_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.socalendar_sql.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.socalendar_sql.inc.php 13 Nov 2002 03:30:15 -0000 1.31
--- class.socalendar_sql.inc.php 23 Nov 2002 14:19:32 -0000 1.32
***************
*** 119,126 ****
$this->set_class(intval($this->stream->f('is_public')));
$this->set_category($this->stream->f('category'));
!
$this->set_title($GLOBALS['phpgw']->strip_html($this->stream->f('title')));
!
$this->set_description($GLOBALS['phpgw']->strip_html($this->stream->f('description')));
$this->add_attribute('uid',$GLOBALS['phpgw']->strip_html($this->stream->f('uid')));
!
$this->add_attribute('location',$GLOBALS['phpgw']->strip_html($this->stream->f('location')));
$this->add_attribute('reference',intval($this->stream->f('reference')));
--- 119,126 ----
$this->set_class(intval($this->stream->f('is_public')));
$this->set_category($this->stream->f('category'));
!
$this->set_title(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('title'))));
!
$this->set_description(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('description'))));
$this->add_attribute('uid',$GLOBALS['phpgw']->strip_html($this->stream->f('uid')));
!
$this->add_attribute('location',stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('location'))));
$this->add_attribute('reference',intval($this->stream->f('reference')));
Index: class.uialarm.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uialarm.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.uialarm.inc.php 28 Dec 2001 15:53:33 -0000 1.4
--- class.uialarm.inc.php 23 Nov 2002 14:19:32 -0000 1.5
***************
*** 55,60 ****
$this->event = $this->bo->read_entry($this->bo->cal_id);
! $can_edit = $this->bo->can_user_edit($this->event);
!
if(!$can_edit)
{
--- 55,60 ----
$this->event = $this->bo->read_entry($this->bo->cal_id);
! $can_edit =
$this->bo->cal->check_perms(PHPGW_ACL_EDIT,$this->event);
!
if(!$can_edit)
{
Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -r1.89 -r1.90
*** class.uicalendar.inc.php 28 Sep 2002 20:01:43 -0000 1.89
--- class.uicalendar.inc.php 23 Nov 2002 14:19:32 -0000 1.90
***************
*** 47,51 ****
var $planner_end_month;
var $planner_end_year;
! var $planner_days_in_end_month;
var $public_functions = array(
--- 47,60 ----
var $planner_end_month;
var $planner_end_year;
! var $planner_days_in_end_month;
!
[...2050 lines suppressed...]
! $p->set_var($var);
! $extra_buttons .= ($event['id']>0?'<br>':'') .
$p->fp('out','form_button');
}
+ $p->set_var('extra_buttons',$extra_buttons);
+
$p->pparse('out','edit_entry');
}
***************
*** 4159,4163 ****
}
$week = '';
! if (!$j || ($j && substr($date,6,2) == '01'))
{
$week = lang('week').'
'.(int)((date('z',($startdate+(24*3600*4)))+7)/7);
--- 4243,4247 ----
}
$week = '';
! if (!$j || (!$weekly && $j && substr($date,6,2)
== '01'))
{
$week = lang('week').'
'.(int)((date('z',($startdate+(24*3600*4)))+7)/7);
Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uipreferences.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.uipreferences.inc.php 21 Sep 2002 21:50:30 -0000 1.7
--- class.uipreferences.inc.php 23 Nov 2002 14:19:33 -0000 1.8
***************
*** 115,122 ****
$user = $GLOBALS['phpgw_info']['user']['account_id'];
$groups =
$GLOBALS['phpgw']->accounts->membership($user);
! $str = '<option
value="-1"'.(intval($this->bo->prefs['calendar']['planner_start_with__group'])==-1?'
selected':'').'>none</option>'."\n";
while (list($key,$group) = each($groups))
{
! $str .= '<option
value="'.$key.'"'.(intval($this->bo->prefs['calendar']['planner_start_with_group'])==$key?'
selected':'').'>'.$GLOBALS['phpgw']->common->grab_owner_name($group['account_id']).'</option>'."\n";
}
$this->display_item(lang('Preselected group for
entering the planner'),'<select
name="prefs[planner_start_with_group]">'."\n".$str.'</select>'."\n");
--- 115,122 ----
$user = $GLOBALS['phpgw_info']['user']['account_id'];
$groups =
$GLOBALS['phpgw']->accounts->membership($user);
! $str = '<option
value="-1"'.(intval($this->bo->prefs['calendar']['planner_start_with_group'])==-1?'
selected':'').'>none</option>'."\n";
while (list($key,$group) = each($groups))
{
! $str .= '<option
value="'.$group['account_id'].'"'.(intval($this->bo->prefs['calendar']['planner_start_with_group'])==$group['account_id']?'
selected':'').'>'.$GLOBALS['phpgw']->common->grab_owner_name($group['account_id']).'</option>'."\n";
}
$this->display_item(lang('Preselected group for
entering the planner'),'<select
name="prefs[planner_start_with_group]">'."\n".$str.'</select>'."\n");
Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/hook_home.inc.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** hook_home.inc.php 26 Oct 2002 01:42:14 -0000 1.38
--- hook_home.inc.php 23 Nov 2002 14:19:33 -0000 1.39
***************
*** 39,44 ****
$page_ =
explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']);
! $_page = $page_[0];
! if ($_page=='index' || ($_page != 'day' && $_page != 'week' &&
$_page != 'month' && $_page != 'year'))
{
$_page = 'month';
--- 39,44 ----
$page_ =
explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']);
! $_page = substr($page_[0],0,7); // makes planner from
planner_{user|category}
! if ($_page=='index' || ($_page != 'day' && $_page != 'week' &&
$_page != 'month' && $_page != 'year' && $_page != 'planner'))
{
$_page = 'month';
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: calendar/inc hook_home_planner.inc.php,1.1,1.2 class.boalarm.inc.php,1.3,1.4 class.bocalendar.inc.php,1.85,1.86 class.socalendar_sql.inc.php,1.31,1.32 class.uialarm.inc.php,1.4,1.5 class.uicalendar.inc.php,1.89,1.90 class.uipreferences.inc.php,1.7,1.8 hook_home.inc.php,1.38,1.39,
Ralf Becker <address@hidden> <=