[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.80,1.81
From: |
Mark A Peters <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.80,1.81 class.bopreferences.inc.php,1.3,1.4 class.socalendar.inc.php,1.24,1.25 class.uicalendar.inc.php,1.83,1.84 class.uipreferences.inc.php,1.4,1.5 |
Date: |
Mon, 16 Sep 2002 22:25:42 -0400 |
Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv15931/inc
Modified Files:
class.bocalendar.inc.php class.bopreferences.inc.php
class.socalendar.inc.php class.uicalendar.inc.php
class.uipreferences.inc.php
Log Message:
GNU Patch #439.
Index: class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -r1.80 -r1.81
*** class.bocalendar.inc.php 25 Aug 2002 04:07:21 -0000 1.80
--- class.bocalendar.inc.php 17 Sep 2002 02:25:39 -0000 1.81
***************
*** 192,196 ****
$this->filter =
get_var('filter',Array('HTTP_POST_VARS','DEFAULT'),'
'.$this->prefs['calendar']['defaultfilter'].' ');
! $this->sortby =
get_var('sortby',Array('HTTP_POST_VARS'));
$this->cat_id =
get_var('cat_id',Array('HTTP_POST_VARS'));
--- 192,201 ----
$this->filter =
get_var('filter',Array('HTTP_POST_VARS','DEFAULT'),'
'.$this->prefs['calendar']['defaultfilter'].' ');
!
if($GLOBALS['phpgw']->accounts->get_type($this->owner)=='g')
! {
! $this->filter = ' all ';
! }
!
! $this->sortby =
get_var('sortby',Array('HTTP_POST_VARS','DEFAULT'),'category');
$this->cat_id =
get_var('cat_id',Array('HTTP_POST_VARS'));
***************
*** 389,393 ****
function read_entry($id)
{
! if($this->check_perms(PHPGW_ACL_READ))
{
$event = $this->so->read_entry($id);
--- 394,398 ----
function read_entry($id)
{
! if($this->check_perms(PHPGW_ACL_READ,$id))
{
$event = $this->so->read_entry($id);
***************
*** 404,409 ****
function delete_single($param)
{
!
! if($this->check_perms(PHPGW_ACL_DELETE))
{
$temp_event = $this->get_cached_event();
--- 409,413 ----
function delete_single($param)
{
!
if($this->check_perms(PHPGW_ACL_DELETE,intval($param['id'])))
{
$temp_event = $this->get_cached_event();
***************
*** 431,435 ****
function delete_entry($id)
{
! if($this->check_perms(PHPGW_ACL_DELETE))
{
$temp_event = $this->read_entry($id);
--- 435,439 ----
function delete_entry($id)
{
! if($this->check_perms(PHPGW_ACL_DELETE,$id))
{
$temp_event = $this->read_entry($id);
***************
*** 449,453 ****
function reinstate($params='')
{
! if($this->check_perms(PHPGW_ACL_EDIT) &&
isset($params['cal_id']) && isset($params['reinstate_index']))
{
$event =
$this->so->read_entry($params['cal_id']);
--- 453,457 ----
function reinstate($params='')
{
! if($this->check_perms(PHPGW_ACL_EDIT,$params['cal_id'])
&& isset($params['reinstate_index']))
{
$event =
$this->so->read_entry($params['cal_id']);
***************
*** 539,549 ****
}
! if($this->debug)
! {
! echo '<!-- ID : '.$l_cal['id'].' -->'."\n";
! }
! if(isset($GLOBALS['HTTP_GET_VARS']['readsess']))
! {
$event = $this->restore_from_appsession();
$event['title'] = stripslashes($event['title']);
--- 543,550 ----
}
! print_debug('ID',$l_cal['id']);
! if(get_var('readsess',Array('GET')))
! {
$event = $this->restore_from_appsession();
$event['title'] = stripslashes($event['title']);
***************
*** 558,577 ****
)
);
! $GLOBALS['phpgw']->common->phpgw_exit(True);
}
$overlapping_events = False;
! }
! else
{
! if((!$l_cal['id'] &&
!$this->check_perms(PHPGW_ACL_ADD)) || ($l_cal['id'] &&
!$this->check_perms(PHPGW_ACL_EDIT)))
! {
! ExecMethod('calendar.uicalendar.index');
! $GLOBALS['phpgw']->common->phpgw_exit();
! }
!
! if($this->debug)
{
! echo '<!-- Prior to fix_update_time()
-->'."\n";
}
$this->fix_update_time($l_start);
$this->fix_update_time($l_end);
--- 559,575 ----
)
);
!
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
$overlapping_events = False;
! }
! else
{
! if((!$l_cal['id'] &&
!$this->check_perms(PHPGW_ACL_ADD)) || ($l_cal['id'] &&
!$this->check_perms(PHPGW_ACL_EDIT,$l_cal['id'])))
{
! ExecMethod('calendar.uicalendar.index');
! $GLOBALS['phpgw']->common->phpgw_exit();
}
+
+ print_debug('prior to fix_update_time()');
$this->fix_update_time($l_start);
$this->fix_update_time($l_end);
***************
*** 654,663 ****
if($acct_type == 'u')
{
- // $part[$parts[$i]] = 1;
$part[intval($parts[$i])] = $accept_type;
}
elseif($acct_type == 'g')
{
- // $part[$parts[$i]] = 1;
$part[intval($parts[$i])] = $accept_type;
$groups[] = $parts[$i];
--- 652,659 ----
***************
*** 673,678 ****
while($member =
each($members))
{
! //
$part[$member[1]['account_id']] = 1;
! +
$part[$member[1]['account_id']] = $accept_type;
}
}
--- 669,673 ----
while($member =
each($members))
{
!
$part[$member[1]['account_id']] = $accept_type;
}
}
***************
*** 851,871 ****
function can_user_edit($event)
{
! $can_edit = False;
!
! if(($event['owner'] == $this->owner) &&
($this->check_perms(PHPGW_ACL_EDIT) == True))
! {
! if($event['public'] == False ||
$event['public'] == 0)
! {
!
if($this->check_perms(PHPGW_ACL_PRIVATE) == True)
! {
! $can_edit = True;
! }
! }
! else
! {
! $can_edit = True;
! }
! }
! return $can_edit;
}
--- 846,850 ----
function can_user_edit($event)
{
! return $this->check_perms(PHPGW_ACL_EDIT,$event);
}
***************
*** 1130,1149 ****
}
! function check_perms($needed,$user=0)
{
! if($user == 0)
{
! $allowed = !!($this->grants[$this->owner] &
$needed);
! if($this->debug)
! {
! echo '<!-- Grantor: '.$this->owner.'
Rights: '.$this->grants[$this->owner].' Allowed: '.$allowed.'-->'."\n";
! }
!
! return $allowed;
}
else
{
! return !!($this->grants[intval($user)] &
$needed);
}
}
--- 1109,1155 ----
}
! // function check_perms($needed,$user=0)
! // {
! // if($user == 0)
! // {
! // $allowed = !!($this->grants[$this->owner] &
$needed);
! // if($this->debug)
! // {
! // echo '<!-- Grantor: '.$this->owner.'
Rights: '.$this->grants[$this->owner].' Allowed: '.$allowed.'-->'."\n";
! // }
! // return $allowed;
! // }
! // else
! // {
! // return !!($this->grants[intval($user)] &
$needed);
! // }
! // }
!
! function check_perms($needed,$event=0)
{
! if (is_int($event) && $event == 0)
{
! $owner = $this->owner;
}
else
{
! if (!is_array($event))
! {
! $event = $this->so->read_entry((int)
$event);
! }
! if (!is_array($event))
! {
! return False;
! }
! $owner = $event['owner'];
! $private = $event['public'] == False ||
$event['public'] == 0;
}
+ $user = $GLOBALS['phpgw_info']['user']['account_id'];
+ $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;
}
***************
*** 1236,1240 ****
return 'private';
}
! elseif(strlen($event[$field]) > 19 &&
!$this->printer_friendly)
{
return substr($event[$field], 0 , 19) . '...';
--- 1242,1247 ----
return 'private';
}
! // elseif(strlen($event[$field]) > 19 &&
!$this->printer_friendly)
! elseif(strlen($event[$field]) > 19 &&
$this->printer_friendly)
{
return substr($event[$field], 0 , 19) . '...';
***************
*** 2032,2040 ****
)
{
! if($this->debug)
! {
! echo '<!-- Msg Type =
'.$msg_type.' -->'."\n";
! echo '<!-- userid = '.$userid.'
-->'."\n";
! }
if(!is_object($send))
{
--- 2039,2044 ----
)
{
! print_debug('Msg Type',$msg_type);
! print_debug('UserID',$userid);
if(!is_object($send))
{
***************
*** 2050,2058 ****
$part_prefs =
$preferences->create_email_preferences(intval($userid));
$to = $part_prefs['email']['address'];
!
! if($this->debug)
! {
! echo '<!-- Email being sent to:
'.$to.' -->'."\n";
! }
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'] =
$part_prefs['common']['tz_offset'];
--- 2054,2059 ----
$part_prefs =
$preferences->create_email_preferences(intval($userid));
$to = $part_prefs['email']['address'];
!
! print_debug('Email being sent to',$to);
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'] =
$part_prefs['common']['tz_offset'];
***************
*** 2129,2152 ****
$y_time = $t_time - 86400;
$tt_time = $t_time + 86399;
! if($this->debug)
! {
! echo '<!-- T_TIME : '.$t_time.' :
'.$GLOBALS['phpgw']->common->show_date($t_time).' -->'."\n";
! echo '<!-- Y_TIME : '.$y_time.' :
'.$GLOBALS['phpgw']->common->show_date($y_time).'-->'."\n";
! echo '<!-- TT_TIME : '.$tt_time.' :
'.$GLOBALS['phpgw']->common->show_date($tt_time).'-->'."\n";
! }
while(list($key,$alarm) = each($event['alarm']))
{
if($alarm['enabled'])
{
! if($this->debug)
! {
! echo '<!-- TIME :
'.$alarm['time'].' : '.$GLOBALS['phpgw']->common->show_date($alarm['time']).'
('.$event['id'].') -->'."\n";
! }
if($event['recur_type'] !=
MCAL_RECUR_NONE) /* Recurring Event */
{
! if($this->debug)
! {
! echo '<!-- Recurring
Event -->'."\n";
! }
if($alarm['time'] > $y_time &&
$GLOBALS['phpgw']->common->show_date($alarm['time'],'Hi') < $starttime_hi &&
$alarm['time'] < $t_time)
{
--- 2130,2144 ----
$y_time = $t_time - 86400;
$tt_time = $t_time + 86399;
! print_debug('T_TIME',$t_time.' :
'.$GLOBALS['phpgw']->common->show_date($t_time));
! print_debug('Y_TIME',$y_time.' :
'.$GLOBALS['phpgw']->common->show_date($y_time));
! print_debug('TT_TIME',$tt_time.' :
'.$GLOBALS['phpgw']->common->show_date($tt_time));
while(list($key,$alarm) = each($event['alarm']))
{
if($alarm['enabled'])
{
! print_debug('TIME',$alarm['time'].' :
'.$GLOBALS['phpgw']->common->show_date($alarm['time']).' ('.$event['id'].')');
if($event['recur_type'] !=
MCAL_RECUR_NONE) /* Recurring Event */
{
! print_debug('Recurring Event');
if($alarm['time'] > $y_time &&
$GLOBALS['phpgw']->common->show_date($alarm['time'],'Hi') < $starttime_hi &&
$alarm['time'] < $t_time)
{
***************
*** 2160,2167 ****
}
}
! if($this->debug)
! {
! echo '<!-- Found: '.$found.' -->'."\n";
! }
return $found;
}
--- 2152,2156 ----
}
}
! print_debug('Found',$found);
return $found;
}
***************
*** 2174,2189 ****
if(isset($new_event['participants'][$old_userid]))
{
! if($this->debug)
! {
! echo '<!-- Modifying event for
user '.$old_userid.' -->'."\n";
! }
$this->modified[intval($old_userid)] =
$new_status;
}
else
{
! if($this->debug)
! {
! echo '<!-- Deleting user
'.$old_userid.' from the event -->'."\n";
! }
$this->deleted[intval($old_userid)] =
$old_status;
}
--- 2163,2172 ----
if(isset($new_event['participants'][$old_userid]))
{
! print_debug('Modifying event for
user',$old_userid);
$this->modified[intval($old_userid)] =
$new_status;
}
else
{
! print_debug('Deleting user from the
event',$old_userid);
$this->deleted[intval($old_userid)] =
$old_status;
}
***************
*** 2194,2208 ****
if(!isset($old_event['participants'][$new_userid]))
{
! if($this->debug)
! {
! echo '<!-- Adding event for
user '.$new_userid.' -->'."\n";
! }
$this->added[$new_userid] = 'U';
$new_event['participants'][$new_userid]
= 'U';
}
}
!
! if(count($this->added) > 0 || count($this->modified) > 0 ||
count($this->deleted) > 0)
! {
if(count($this->added) > 0)
{
--- 2177,2188 ----
if(!isset($old_event['participants'][$new_userid]))
{
! print_debug('Adding event for
user',$new_userid);
$this->added[$new_userid] = 'U';
$new_event['participants'][$new_userid]
= 'U';
}
}
!
! if(count($this->added) > 0 || count($this->modified) >
0 || count($this->deleted) > 0)
! {
if(count($this->added) > 0)
{
***************
*** 2223,2226 ****
--- 2203,2207 ----
{
$already_moved = Array();
+ $has_category = Array(); // remove only multiple
occurences of a category per event/day
for($v=$firstday;$v<=$lastday;$v++)
{
***************
*** 2232,2239 ****
{
$start =
sprintf('%04d%02d%02d',$event['start']['year'],$event['start']['month'],$event['start']['mday']);
! if($this->debug)
{
! echo "<p>Event:<br>";
print_r($event); echo "</p>";
! echo '<!-- start='.$start.',
v='.$v.' ';
}
--- 2213,2223 ----
{
$start =
sprintf('%04d%02d%02d',$event['start']['year'],$event['start']['month'],$event['start']['mday']);
!
print_debug('EVENT',print_r($event,False));
! print_debug('start',$start);
! print_debug('v',$v);
!
! if($start < $firstday)
{
! $start = $firstday; // event
continues into current month/year
}
***************
*** 2244,2247 ****
--- 2228,2235 ----
if($g !=
count($this->cached_events[$v]))
{
+ if
($has_category[$event['id']]['category'] != True)
+ {
+ continue; // we
need at least one evidence for this category
+ }
for($h=$g +
1;$h<$c_daily;$h++)
{
***************
*** 2249,2252 ****
--- 2237,2241 ----
}
unset($this->cached_events[$v][$h]);
+
$has_category[$event['id']]['category'] = True;
}
***************
*** 2268,2293 ****
$this->cached_events[$firstday][] = $event;
$already_moved[$event['id']] = 1;
! if($this->debug)
! {
! echo
'moved --> '."\n";
! }
}
else
{
$already_moved[$event['id']] = 2;
! if($this->debug)
! {
! echo
'removed (not moved) -->'."\n";
! }
}
! }
! elseif($this->debug)
{
! echo 'removed -->'."\n";
}
}
! elseif($this->debug)
{
! echo 'ok -->'."\n";
}
}
--- 2257,2276 ----
$this->cached_events[$firstday][] = $event;
$already_moved[$event['id']] = 1;
!
print_debug('Event moved');
}
else
{
$already_moved[$event['id']] = 2;
!
print_debug('Event removed (not moved)');
}
! }
! else
{
! print_debug('Event
removed');
}
}
! else
{
! print_debug('Event OK');
}
}
***************
*** 2302,2304 ****
}
}
! ?>
--- 2285,2287 ----
}
}
! ?>
\ No newline at end of file
Index: class.bopreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bopreferences.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bopreferences.inc.php 17 Apr 2002 23:43:29 -0000 1.3
--- class.bopreferences.inc.php 17 Sep 2002 02:25:40 -0000 1.4
***************
*** 42,46 ****
'defaultcalendar',
'defaultfilter',
! 'interval'
);
--- 42,47 ----
'defaultcalendar',
'defaultfilter',
! 'interval',
! 'planner_intervals_per_day'
);
***************
*** 79,81 ****
}
}
! ?>
--- 80,82 ----
}
}
! ?>
\ No newline at end of file
Index: class.socalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.socalendar.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.socalendar.inc.php 24 Jun 2002 23:24:24 -0000 1.24
--- class.socalendar.inc.php 17 Sep 2002 02:25:40 -0000 1.25
***************
*** 136,140 ****
function list_events_keyword($keywords)
{
! $sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.')
';
$words = split(' ',$keywords);
--- 136,159 ----
function list_events_keyword($keywords)
{
! // $sql = 'AND (phpgw_cal_user.cal_login='.$this->owner.')
';
! $o = $this->owner;
! $type = $GLOBALS['phpgw']->accounts->get_type($o);
!
! if($type == 'g')
! {
! $members =
$GLOBALS['phpgw']->acl->get_ids_for_location($o, 1, 'phpgw_group');
! }
! else
! {
! $members[0] = $o;
! }
!
! $sql = 'AND (phpgw_cal_user.cal_login='.$members[0];
!
! for($i=1; $i<count($members); $i++)
! {
! $sql .= ' OR phpgw_cal_user.cal_login='.$members[$i];
! }
! $sql .= ') ';
$words = split(' ',$keywords);
***************
*** 213,218 ****
if($GLOBALS['phpgw_info']['server']['calendar_type'] ==
'sql')
{
$this->cal->stream->query('UPDATE phpgw_cal SET
owner='.$new_owner.' WHERE owner='.$account_id,__LINE__,__FILE__);
- $this->cal->stream->query('UPDATE
phpgw_cal_user SET cal_login='.$new_owner.' WHERE cal_login='.$account_id);
}
}
--- 232,251 ----
if($GLOBALS['phpgw_info']['server']['calendar_type'] ==
'sql')
{
+ $db2 = $this->cal->stream;
+ $this->cal->stream->query('SELECT cal_id FROM
phpgw_cal_user WHERE cal_login='.$account_id,__LINE__,__FILE__)
+ while($this->cal->stream->next_record())
+ {
+ $id = $this->cal->stream->f('cal_id');
+ $db2->query('SELECT count(*) FROM
phpgw_cal_user WHERE cal_id='.$id.' AND
cal_login='.$new_owner,__LINE__,__FILE__);
+ if($db2->f(0) == 0)
+ {
+ $db2->query('UPDATE
phpgw_cal_user SET cal_login='.$new_owner.' WHERE cal_id='.$id.' AND
cal_login='.$account_id,__LINE__,__FILE__);
+ }
+ else
+ {
+ $db2->query('DELETE FROM
phpgw_cal_user WHERE cal_id='.$id.' AND
cal_login='.$account_id,__LINE__,__FILE__);
+ }
+ }
$this->cal->stream->query('UPDATE phpgw_cal SET
owner='.$new_owner.' WHERE owner='.$account_id,__LINE__,__FILE__);
}
}
***************
*** 350,352 ****
/* End mcal equiv functions */
}
! ?>
--- 383,385 ----
/* End mcal equiv functions */
}
! ?>
\ No newline at end of file
Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -r1.83 -r1.84
*** class.uicalendar.inc.php 25 Aug 2002 04:07:21 -0000 1.83
--- class.uicalendar.inc.php 17 Sep 2002 02:25:40 -0000 1.84
***************
*** 33,36 ****
--- 33,52 ----
var $link_tpl;
+ // planner related variables
+ var $planner_html;
+
+ var $planner_header;
+ var $planner_rows;
+
+ var $planner_group_members;
[...1686 lines suppressed...]
$new_hour += 12;
}
!
$open_link .= '<a
href="'.$this->page('add','&date='.$date_to_eval.'&hour='.$new_hour.'&minute='.substr($dtime,strpos($dtime,':')+1,2)).'">';
!
$close_link = '</a>';
}
***************
*** 3137,3141 ****
'close_link' => $close_link
);
!
$this->output_template_array($p,'item','day_time',$var);
$p->parse('row','day_row',True);
--- 3574,3578 ----
'close_link' => $close_link
);
!
$this->output_template_array($p,'item','day_time',$var);
$p->parse('row','day_row',True);
Index: class.uipreferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uipreferences.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.uipreferences.inc.php 17 Apr 2002 23:43:29 -0000 1.4
--- class.uipreferences.inc.php 17 Sep 2002 02:25:40 -0000 1.5
***************
*** 104,107 ****
--- 104,108 ----
}
$str = '<select name="prefs[defaultcalendar]">'
+ . '<option
value="planner"'.$selected['planner'].'>'.lang('Planner').'</option>'
. '<option
value="year"'.$selected['year'].'>'.lang('Yearly').'</option>'
. '<option
value="month"'.$selected['month'].'>'.lang('Monthly').'</option>'
***************
*** 145,148 ****
--- 146,163 ----
$this->display_item(lang('Display interval in Day
View'),'<select name="prefs[interval]">'."\n".$str.'</select>'."\n");
+ $var = Array(
+ 1 => '1',
+ 2 => '2',
+ 3 => '3',
+ 4 => '4',
+ );
+
+ $str = '';
+ while(list($key,$value) = each($var))
+ {
+ $str .= '<option
value="'.$key.'"'.(intval($this->bo->prefs['calendar']['planner_intervals_per_day'])==$key?'
selected':'').'>'.$value.'</option>'."\n";
+ }
+ $this->display_item(lang('Number of Intervals per Day
in Planner View'),'<select
name="prefs[planner_intervals_per_day]">'."\n".$str.'</select>'."\n");
+
$checkboxes = Array(
'send_updates' => lang('Send/receive updates
via email'),
***************
*** 179,181 ****
$this->output_template_array('row','pref_list',$var);
}
! }
--- 194,196 ----
$this->output_template_array('row','pref_list',$var);
}
! }
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.80,1.81 class.bopreferences.inc.php,1.3,1.4 class.socalendar.inc.php,1.24,1.25 class.uicalendar.inc.php,1.83,1.84 class.uipreferences.inc.php,1.4,1.5,
Mark A Peters <address@hidden> <=