[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17651]
From: |
nelson . guerra |
Subject: |
[Fmsystem-commits] [17651] |
Date: |
Fri, 19 Jan 2018 23:01:16 -0500 (EST) |
Revision: 17651
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17651
Author: nelson224
Date: 2018-01-19 23:01:16 -0500 (Fri, 19 Jan 2018)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind/calendar/inc/class.bocalendar.inc.php
Modified: branches/dev-syncromind/calendar/inc/class.bocalendar.inc.php
===================================================================
--- branches/dev-syncromind/calendar/inc/class.bocalendar.inc.php
2018-01-20 04:01:01 UTC (rev 17650)
+++ branches/dev-syncromind/calendar/inc/class.bocalendar.inc.php
2018-01-20 04:01:16 UTC (rev 17651)
@@ -456,13 +456,17 @@
{
$owner = ( $owner == 0 ?
$GLOBALS['phpgw_info']['user']['account_id'] : $owner);
$group_owners =
$GLOBALS['phpgw']->accounts->membership();
- while($group_owners && list($index,$group_info) =
each($group_owners))
- {
+ //while($group_owners && list($index,$group_info) =
each($group_owners))
+ if (is_array($group_owners))
+ {
+ foreach($group_owners as $index => $group_info)
+ {
if($this->owner ==
$this->contacts->is_contact($group_info['account_id']) )
{
return True;
}
- }
+ }
+ }
return False;
}
@@ -601,7 +605,8 @@
print_debug('Count of
reinstate_index',count($params['reinstate_index']));
if(count($params['reinstate_index']) > 1)
{
- while(list($key,$value) =
each($params['reinstate_index']))
+ //while(list($key,$value) =
each($params['reinstate_index']))
+ foreach($params['reinstate_index'] as
$key => $value)
{
print_debug('reinstate_index
['.$key.']',intval($value));
print_debug('exception
time',$event['recur_exception'][intval($value)]);
@@ -649,8 +654,11 @@
function expunge()
{
reset($this->so->cal->deleted_events);
- while(list($i,$event_id) =
each($this->so->cal->deleted_events))
- {
+ //while(list($i,$event_id) =
each($this->so->cal->deleted_events))
+ if (is_array($this->so->cal->deleted_events))
+ {
+ foreach($this->so->cal->deleted_events as $i =>
$event_id)
+ {
$event = $this->so->read_entry($event_id);
if($this->check_perms(PHPGW_ACL_DELETE,$event))
{
@@ -660,7 +668,8 @@
{
unset($this->so->cal->deleted_events[$i]);
}
- }
+ }
+ }
$this->so->expunge();
}
@@ -1019,20 +1028,28 @@
return false;
}
- while(!$uim && $event['participants'] &&
$security_equals && list($participant,$status) = each($event['participants']))
- {
+ //while(!$uim && $event['participants'] &&
$security_equals && list($participant,$status) = each($event['participants']))
+ foreach($event['participants'] as $participant =>
$status)
+ {
if($GLOBALS['phpgw']->accounts->get_type($participant) == 'g')
{
- @reset($security_equals);
- while(list($key,$group_info) =
each($security_equals))
+ //@reset($security_equals);
+ //while(list($key,$group_info) =
each($security_equals))
+ foreach($security_equals as $key =>
$group_info)
{
if($group_info['account_id'] ==
$participant)
{
- return True;
+ //return True;
$uim = True;
+ break;
}
}
}
+
+ if ($uim)
+ {
+ break;
+ }
}
return $uim;
}
@@ -1218,7 +1235,8 @@
$users = array();
if(count($participants))
{
- while(list($user,$status) = each($participants))
+ //while(list($user,$status) =
each($participants))
+ foreach($participants as $user => $status)
{
$users[] = $user;
}
@@ -1262,10 +1280,11 @@
foreach (
$possible_conflicts[$temp_start] as $key => $event )
{
$found = False;
- if($id)
+ if(is_array($id))
{
@reset($id);
-
while(list($key,$event_id) = each($id))
+
//while(list($key,$event_id) = each($id))
+ foreach($id as $key =>
$event_id)
{
if($this->debug)
{
@@ -1554,13 +1573,17 @@
{
$is_private = True;
$groups =
$GLOBALS['phpgw']->accounts->membership($owner);
- while (list($key,$group) = each($groups))
- {
+ //while (list($key,$group) = each($groups))
+ if (is_array($groups))
+ {
+ foreach($groups as $key => $group)
+ {
if (strpos('
'.implode(',',$event['groups']).' ',$group['account_id']))
{
return False;
}
- }
+ }
+ }
}
else
{
@@ -1748,10 +1771,11 @@
function sort_event($event,$date)
{
$inserted = False;
- if(isset($event['recur_exception']))
+ if (is_array($event['recur_exception']))
{
$event_time =
mktime($event['start']['hour'],$event['start']['min'],0,intval(substr($date,4,2)),intval(substr($date,6,2)),intval(substr($date,0,4)))
- phpgwapi_datetime::user_timezone();
- while($inserted == False &&
list($key,$exception_time) = each($event['recur_exception']))
+ //while($inserted == False &&
list($key,$exception_time) = each($event['recur_exception']))
+ foreach($event['recur_exception'] as $key =>
$exception_time)
{
if($this->debug)
{
@@ -1760,6 +1784,7 @@
if($exception_time == $event_time)
{
$inserted = True;
+ break;
}
}
}
@@ -2671,8 +2696,11 @@
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']))
- {
+ //while(list($key,$alarm) = @each($event['alarm']))
+ if (is_array($event['alarm']))
+ {
+ foreach($event['alarm'] as $key => $alarm)
+ {
if($alarm['enabled'])
{
print_debug('TIME',$alarm['time'].' :
'.$GLOBALS['phpgw']->common->show_date($alarm['time']).' ('.$event['id'].')');
@@ -2689,7 +2717,8 @@
$found = True;
}
}
- }
+ }
+ }
print_debug('Found',$found);
return $found;
}
@@ -2697,8 +2726,11 @@
function prepare_recipients(&$new_event,$old_event)
{
// Find modified and deleted users.....
- while(list($old_userid,$old_status) =
each($old_event['participants']))
- {
+ //while(list($old_userid,$old_status) =
each($old_event['participants']))
+ if (is_array($old_event['participants']))
+ {
+ foreach($old_event['participants'] as $old_userid
=> $old_status)
+ {
if(isset($new_event['participants'][$old_userid]))
{
print_debug('Modifying event for
user',$old_userid);
@@ -2709,10 +2741,14 @@
print_debug('Deleting user from the
event',$old_userid);
$this->deleted[intval($old_userid)] =
$old_status;
}
- }
+ }
+ }
// Find new users.....
- while(list($new_userid,$new_status) =
each($new_event['participants']))
- {
+ //while(list($new_userid,$new_status) =
each($new_event['participants']))
+ if (is_array($new_event['participants']))
+ {
+ foreach($new_event['participants'] as $new_userid
=> $new_status)
+ {
if(!isset($old_event['participants'][$new_userid]))
{
print_debug('Adding event for
user',$new_userid);
@@ -2719,7 +2755,8 @@
$this->added[$new_userid] = 'U';
$new_event['participants'][$new_userid]
= 'U';
}
- }
+ }
+ }
if(count($this->added) > 0 || count($this->modified) >
0 || count($this->deleted) > 0)
{
@@ -2749,8 +2786,11 @@
}
$cached = $this->cached_events[$v];
$this->cached_events[$v] = array();
- while (list($g,$event) = each($cached))
- {
+ //while (list($g,$event) = each($cached))
+ if (is_array($cached))
+ {
+ foreach($cached as $g => $event)
+ {
$end =
date('Ymd',$this->maketime($event['end']));
print_debug('EVENT',_debug_array($event,False));
// print_debug('start',$start);
@@ -2762,7 +2802,8 @@
$already_moved[$event['id']] =
1;
print_debug('Event moved');
}
- }
+ }
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17651],
nelson . guerra <=