Massive intval and formatting update - previous version in tag 'cal_008-2'

This commit is contained in:
Miles Lott 2004-01-04 00:47:37 +00:00
parent 27f2acb285
commit 94ea6c3c0a
24 changed files with 4975 additions and 4966 deletions

View File

@ -68,12 +68,18 @@ function addr_id( $n_family,$n_given,$org_name )
$addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,n_given=$n_given,org_name=$org_name");
if(!count($addrs))
{
$addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,n_given=$n_given");
}
if(!count($addrs))
{
$addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,org_name=$org_name");
}
if (count($addrs))
{
return $addrs[0]['id'];
}
return False;
}

View File

@ -36,7 +36,7 @@
function boalarm()
{
$cal_id = (isset($_POST['cal_id'])?intval($_POST['cal_id']):'');
$cal_id = (isset($_POST['cal_id'])?(int)$_POST['cal_id']:'');
if($cal_id)
{
$this->cal_id = $cal_id;
@ -71,7 +71,7 @@
function read_entry($cal_id)
{
return $this->bo->read_entry(intval($cal_id));
return $this->bo->read_entry((int)$cal_id);
}
/*!
@ -168,7 +168,7 @@
{
return -1;
}
$alarm['enabled'] = intval(!$alarm['enabled']);
$alarm['enabled'] = (int)(!$alarm['enabled']);
if ($this->so->save_alarm($alarm['cal_id'],$alarm))
{
++$enabled;

View File

@ -172,7 +172,7 @@
if ((substr($_SERVER['PHP_SELF'],-8) == 'home.php' && substr($this->prefs['calendar']['defaultcalendar'],0,7) == 'planner'
|| $_GET['menuaction'] == 'calendar.uicalendar.planner' &&
$from != 'calendar.uicalendar.planner' && !$this->save_owner)
&& intval($this->prefs['calendar']['planner_start_with_group']) > 0)
&& (int)$this->prefs['calendar']['planner_start_with_group'] > 0)
{
// entering planner for the first time ==> saving owner in save_owner, setting owner to default
//
@ -184,7 +184,7 @@
{
// leaving planner with an unchanged user/owner ==> setting owner back to save_owner
//
$owner = intval(isset($_GET['owner']) ? $_GET['owner'] : $this->save_owner);
$owner = (int)(isset($_GET['owner']) ? $_GET['owner'] : $this->save_owner);
unset($this->save_owner);
}
elseif (!empty($owner) && $owner != $this->owner && $from == 'calendar.uicalendar.planner')
@ -200,15 +200,15 @@
}
elseif(isset($owner) && $owner!='')
{
$this->owner = intval($owner);
$this->owner = (int)$owner;
}
elseif(!@isset($this->owner) || !@$this->owner)
{
$this->owner = intval($GLOBALS['phpgw_info']['user']['account_id']);
$this->owner = (int)$GLOBALS['phpgw_info']['user']['account_id'];
}
elseif(isset($this->owner) && $GLOBALS['phpgw']->accounts->get_type($this->owner) == 'g')
{
$this->set_owner_to_group(intval($this->owner));
$this->set_owner_to_group((int)$this->owner);
}
$this->prefs['common'] = $GLOBALS['phpgw_info']['user']['preferences']['common'];
@ -226,7 +226,7 @@
$friendly = (isset($_GET['friendly'])?$_GET['friendly']:'');
$friendly = ($friendly=='' && isset($_POST['friendly'])?$_POST['friendly']:$friendly);
$this->printer_friendly = (intval($friendly) == 1?True:False);
$this->printer_friendly = ((int)$friendly == 1?True:False);
if(isset($_POST['filter'])) { $this->filter = $_POST['filter']; }
if(isset($_POST['sortby'])) { $this->sortby = $_POST['sortby']; }
@ -304,9 +304,9 @@
if(isset($date) && $date!='')
{
$this->year = intval(substr($date,0,4));
$this->month = intval(substr($date,4,2));
$this->day = intval(substr($date,6,2));
$this->year = (int)(substr($date,0,4));
$this->month = (int)(substr($date,4,2));
$this->day = (int)(substr($date,6,2));
}
else
{
@ -435,7 +435,7 @@
function set_owner_to_group($owner)
{
print_debug('calendar::bocalendar::set_owner_to_group:owner',$owner);
$this->owner = intval($owner);
$this->owner = (int)$owner;
$this->is_group = True;
$this->g_owner = Array();
$members = $GLOBALS['phpgw']->accounts->member($owner);
@ -512,12 +512,12 @@
$this->filter = $data['filter'];
$this->cat_id = $data['cat_id'];
$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->owner = (int)$data['owner'];
$this->save_owner = (int)$data['save_owner'];
$this->year = (int)$data['year'];
$this->month = (int)$data['month'];
$this->day = (int)$data['day'];
$this->num_months = (int)$data['num_months'];
$this->return_to = $data['return_to'];
}
@ -533,7 +533,7 @@
$event = $this->so->read_entry($id);
if(!isset($event['participants'][$this->owner]) && $this->user_is_a_member($event,$this->owner))
{
$this->so->add_attribute('participants','U',intval($this->owner));
$this->so->add_attribute('participants','U',(int)$this->owner);
$this->so->add_entry($event);
$event = $this->get_cached_event();
}
@ -544,14 +544,14 @@
function delete_single($param)
{
if($this->check_perms(PHPGW_ACL_DELETE,intval($param['id'])))
if($this->check_perms(PHPGW_ACL_DELETE,(int)$param['id']))
{
$temp_event = $this->get_cached_event();
$event = $this->read_entry(intval($param['id']));
$event = $this->read_entry((int)$param['id']);
// if($this->owner == $event['owner'])
// {
$exception_time = mktime($event['start']['hour'],$event['start']['min'],0,$param['month'],$param['day'],$param['year']) - $GLOBALS['phpgw']->datetime->tz_offset;
$event['recur_exception'][] = intval($exception_time);
$event['recur_exception'][] = (int)$exception_time;
$this->so->cal->event = $event;
// print_debug('exception time',$event['recur_exception'][count($event['recur_exception']) -1]);
// print_debug('count event exceptions',count($event['recur_exception']));
@ -600,17 +600,17 @@
{
while(list($key,$value) = each($params['reinstate_index']))
{
print_debug('reinstate_index ['.$key.']',intval($value));
print_debug('exception time',$event['recur_exception'][intval($value)]);
unset($event['recur_exception'][intval($value)]);
print_debug('reinstate_index ['.$key.']',(int)$value);
print_debug('exception time',$event['recur_exception'][(int)$value]);
unset($event['recur_exception'][(int)$value]);
print_debug('count event exceptions',count($event['recur_exception']));
}
}
else
{
print_debug('reinstate_index[0]',intval($params['reinstate_index'][0]));
print_debug('exception time',$event['recur_exception'][intval($params['reinstate_index'][0])]);
unset($event['recur_exception'][intval($params['reinstate_index'][0])]);
print_debug('reinstate_index[0]',(int)$params['reinstate_index'][0]);
print_debug('exception time',$event['recur_exception'][(int)$params['reinstate_index'][0]]);
unset($event['recur_exception'][(int)$params['reinstate_index'][0]]);
print_debug('count event exceptions',count($event['recur_exception']));
}
$this->so->cal->event = $event;
@ -808,7 +808,7 @@
$l_categories = 0;
}
$is_public = intval(isset($l_cal['public']) ? $l_cal['public'] : $l_cal['private'] == 'public');
$is_public = (int)(isset($l_cal['public']) ? $l_cal['public'] : $l_cal['private'] == 'public');
$this->so->event_init();
$this->add_attribute('uid',$l_cal['uid']);
if(count($l_categories) >= 2)
@ -842,36 +842,36 @@
$l_recur_enddate = $this->jscal->input2date($l_recur_enddate['str'],False,'mday');
}
switch(intval($l_cal['recur_type']))
switch((int)$l_cal['recur_type'])
{
case MCAL_RECUR_NONE:
$this->so->set_recur_none();
break;
case MCAL_RECUR_DAILY:
$this->so->set_recur_daily(intval($l_recur_enddate['year']),intval($l_recur_enddate['month']),intval($l_recur_enddate['mday']),intval($l_cal['recur_interval']));
$this->so->set_recur_daily((int)$l_recur_enddate['year'],(int)$l_recur_enddate['month'],(int)$l_recur_enddate['mday'],(int)$l_cal['recur_interval']);
break;
case MCAL_RECUR_WEEKLY:
foreach(array('rpt_sun','rpt_mon','rpt_tue','rpt_wed','rpt_thu','rpt_fri','rpt_sat') as $rpt_day)
{
$l_cal['recur_data'] += intval($l_cal[$rpt_day]);
$l_cal['recur_data'] += (int)$l_cal[$rpt_day];
}
if (is_array($l_cal['rpt_day']))
{
foreach ($l_cal['rpt_day'] as $mask)
{
$l_cal['recur_data'] |= intval($mask);
$l_cal['recur_data'] |= (int)$mask;
}
}
$this->so->set_recur_weekly(intval($l_recur_enddate['year']),intval($l_recur_enddate['month']),intval($l_recur_enddate['mday']),intval($l_cal['recur_interval']),$l_cal['recur_data']);
$this->so->set_recur_weekly((int)$l_recur_enddate['year'],(int)$l_recur_enddate['month'],(int)$l_recur_enddate['mday'],(int)$l_cal['recur_interval'],$l_cal['recur_data']);
break;
case MCAL_RECUR_MONTHLY_MDAY:
$this->so->set_recur_monthly_mday(intval($l_recur_enddate['year']),intval($l_recur_enddate['month']),intval($l_recur_enddate['mday']),intval($l_cal['recur_interval']));
$this->so->set_recur_monthly_mday((int)$l_recur_enddate['year'],(int)$l_recur_enddate['month'],(int)$l_recur_enddate['mday'],(int)$l_cal['recur_interval']);
break;
case MCAL_RECUR_MONTHLY_WDAY:
$this->so->set_recur_monthly_wday(intval($l_recur_enddate['year']),intval($l_recur_enddate['month']),intval($l_recur_enddate['mday']),intval($l_cal['recur_interval']));
$this->so->set_recur_monthly_wday((int)$l_recur_enddate['year'],(int)$l_recur_enddate['month'],(int)$l_recur_enddate['mday'],(int)$l_cal['recur_interval']);
break;
case MCAL_RECUR_YEARLY:
$this->so->set_recur_yearly(intval($l_recur_enddate['year']),intval($l_recur_enddate['month']),intval($l_recur_enddate['mday']),intval($l_cal['recur_interval']));
$this->so->set_recur_yearly((int)$l_recur_enddate['year'],(int)$l_recur_enddate['month'],(int)$l_recur_enddate['mday'],(int)$l_cal['recur_interval']);
break;
}
@ -882,23 +882,23 @@
$part = Array();
for($i=0;$i<count($parts);$i++)
{
if (($accept_type = substr($parts[$i],-1,1)) == '0' || intval($accept_type) > 0)
if (($accept_type = substr($parts[$i],-1,1)) == '0' || (int)$accept_type > 0)
{
$accept_type = 'U';
}
$acct_type = $GLOBALS['phpgw']->accounts->get_type(intval($parts[$i]));
$acct_type = $GLOBALS['phpgw']->accounts->get_type((int)$parts[$i]);
if($acct_type == 'u')
{
$part[intval($parts[$i])] = $accept_type;
$part[(int)$parts[$i]] = $accept_type;
}
elseif($acct_type == 'g')
{
$part[intval($parts[$i])] = $accept_type;
$part[(int)$parts[$i]] = $accept_type;
$groups[] = $parts[$i];
/* This pulls ALL users of a group and makes them as participants to the event */
/* I would like to turn this back into a group thing. */
$acct = CreateObject('phpgwapi.accounts',intval($parts[$i]));
$members = $acct->member(intval($parts[$i]));
$acct = CreateObject('phpgwapi.accounts',(int)$parts[$i]);
$members = $acct->member((int)$parts[$i]);
unset($acct);
if($members == False)
{
@ -921,14 +921,14 @@
@reset($part);
while(list($key,$accept_type) = each($part))
{
$this->so->add_attribute('participants',$accept_type,intval($key));
$this->so->add_attribute('participants',$accept_type,(int)$key);
}
}
if($groups)
{
@reset($groups);
$this->so->add_attribute('groups',intval($group_id));
$this->so->add_attribute('groups',(int)$group_id);
}
$event = $this->get_cached_event();
@ -1083,7 +1083,7 @@
}
else
{
return intval($event['id']);
return (int)$event['id'];
}
}
return True;
@ -1141,13 +1141,13 @@
function time2array($time,$alarm = 0)
{
return array(
'year' => intval(date('Y',$time)),
'month' => intval(date('m',$time)),
'mday' => intval(date('d',$time)),
'hour' => intval(date('H',$time)),
'min' => intval(date('i',$time)),
'sec' => intval(date('s',$time)),
'alarm' => intval($alarm)
'year' => (int)(date('Y',$time)),
'month' => (int)(date('m',$time)),
'mday' => (int)(date('d',$time)),
'hour' => (int)(date('H',$time)),
'min' => (int)(date('i',$time)),
'sec' => (int)(date('s',$time)),
'alarm' => (int)($alarm)
);
}
@ -1265,14 +1265,14 @@
$temp_cache_events = $this->cached_events;
}
// $temp_start = intval($GLOBALS['phpgw']->common->show_date($starttime,'Ymd'));
// $temp_start_time = intval($GLOBALS['phpgw']->common->show_date($starttime,'Hi'));
// $temp_end = intval($GLOBALS['phpgw']->common->show_date($endtime,'Ymd'));
// $temp_end_time = intval($GLOBALS['phpgw']->common->show_date($endtime,'Hi'));
$temp_start = intval(date('Ymd',$starttime));
$temp_start_time = intval(date('Hi',$starttime));
$temp_end = intval(date('Ymd',$endtime));
$temp_end_time = intval(date('Hi',$endtime));
// $temp_start = (int)$GLOBALS['phpgw']->common->show_date($starttime,'Ymd');
// $temp_start_time = (int)($GLOBALS['phpgw']->common->show_date($starttime,'Hi');
// $temp_end = (int)$GLOBALS['phpgw']->common->show_date($endtime,'Ymd');
// $temp_end_time = (int)$GLOBALS['phpgw']->common->show_date($endtime,'Hi');
$temp_start = (int)(date('Ymd',$starttime));
$temp_start_time = (int)(date('Hi',$starttime));
$temp_end = (int)(date('Ymd',$endtime));
$temp_end_time = (int)(date('Hi',$endtime));
if($this->debug)
{
echo '<!-- Temp_Start: '.$temp_start.' -->'."\n";
@ -1447,7 +1447,7 @@
{
$access = $user == $owner || $grants & $needed && (!$private || $grants & PHPGW_ACL_PRIVATE);
}
//echo "<p>".function_backtrace()." check_perms($needed,$event_id,$other) for user $user and needed_acl $needed: event='$event[title]': owner=$owner, privat=$private, grants=$grants ==> access=$access</p>\n";
//echo "<p>".function_backtrace()." check_perms($needed,$event_id,$other) for user $user and needed_acl $needed: event='$event[title]': owner=$owner, private=$private, grants=$grants ==> access=$access</p>\n";
return $access;
}
@ -1618,7 +1618,7 @@
function normalizeminutes(&$minutes)
{
$hour = 0;
$min = intval($minutes);
$min = (int)$minutes;
if($min >= 60)
{
$hour += $min / 60;
@ -1633,9 +1633,9 @@
{
$temp = array('hour','minute','second','ampm');
$time = strrev($time);
$second = intval(strrev(substr($time,0,2)));
$minute = intval(strrev(substr($time,2,2)));
$hour = intval(strrev(substr($time,4)));
$second = (int)(strrev(substr($time,0,2)));
$minute = (int)(strrev(substr($time,2,2)));
$hour = (int)(strrev(substr($time,4)));
$hour += $this->normalizeminutes(&$minute);
$temp['second'] = $second;
$temp['minute'] = $minute;
@ -1671,12 +1671,12 @@
$exceptions = explode(',',$exception_str);
for($exception_count=0;$exception_count<count($exceptions);$exception_count++)
{
$exception[] = intval($exceptions[$exception_count]);
$exception[] = (int)$exceptions[$exception_count];
}
}
elseif($exception_str != '')
{
$exception[] = intval($exception_str);
$exception[] = (int)$exception_str;
}
return $exception;
}
@ -1699,7 +1699,7 @@
$inserted = False;
if(isset($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))) - $GLOBALS['phpgw']->datetime->tz_offset;
$event_time = mktime($event['start']['hour'],$event['start']['min'],0,(int)(substr($date,4,2)),(int)(substr($date,6,2)),(int)(substr($date,0,4))) - $GLOBALS['phpgw']->datetime->tz_offset;
while($inserted == False && list($key,$exception_time) = each($event['recur_exception']))
{
if($this->debug)
@ -2028,7 +2028,7 @@
return;
}
$cache_start = intval(sprintf("%04d%02d%02d",$syear,$smonth,$sday));
$cache_start = (int)(sprintf("%04d%02d%02d",$syear,$smonth,$sday));
if($c_cached_ids)
{
for($i=0;$i<$c_cached_ids;$i++)
@ -2038,15 +2038,15 @@
{
continue; // fetch recuring events only in 2. loop
}
$startdate = intval(date('Ymd',$this->maketime($event['start'])));
$enddate = intval(date('Ymd',$this->maketime($event['end'])));
$startdate = (int)(date('Ymd',$this->maketime($event['start'])));
$enddate = (int)(date('Ymd',$this->maketime($event['end'])));
$this->cached_events[$startdate][] = $event;
if($startdate != $enddate)
{
$start['year'] = intval(substr($startdate,0,4));
$start['month'] = intval(substr($startdate,4,2));
$start['mday'] = intval(substr($startdate,6,2));
for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=intval(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year']))))
$start['year'] = (int)(substr($startdate,0,4));
$start['month'] = (int)(substr($startdate,4,2));
$start['mday'] = (int)(substr($startdate,6,2));
for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=(int)(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year']))))
{
$c_evt_day = count($this->cached_events[$j]) - 1;
if($c_evt_day < 0)
@ -2206,7 +2206,7 @@
{
foreach(array('year','month','mday','hour','min','sec') as $n => $name)
{
$date[$name] = intval($arr[$n]);
$date[$name] = (int)$arr[$n];
}
return $timestamp ? mktime($date['hour'],$date['min'],$date['sec'],
$date['month'],$date['mday'],$date['year']) : $date;
@ -2336,7 +2336,7 @@
for($m=0;$m<$interval;$m++)
{
$minutes = $increment * $m;
if(intval($starttemp['minute']) > $minutes && intval($starttemp['minute']) < ($minutes + $increment))
if((int)$starttemp['minute'] > $minutes && (int)$starttemp['minute'] < ($minutes + $increment))
{
$subminute = ($starttemp['minute'] - $minutes) * 100;
}
@ -2362,11 +2362,11 @@
$startminute = 0;
$endminute = $interval;
$hour = $h * 10000;
if($h == intval($starttemp['hour']))
if($h == (int)$starttemp['hour'])
{
$startminute = ($starttemp['minute'] / $increment);
}
if($h == intval($endtemp['hour']))
if($h == (int)$endtemp['hour'])
{
$endminute = ($endtemp['minute'] / $increment);
}
@ -2495,7 +2495,7 @@
$temp_timeformat = $this->prefs['common']['timeformat'];
$temp_dateformat = $this->prefs['common']['dateformat'];
$tz_offset = ((60 * 60) * intval($temp_tz_offset));
$tz_offset = ((60 * 60) * (int)$temp_tz_offset);
if($old_event != False)
{
@ -2593,7 +2593,7 @@
foreach($to_notify as $userid => $statusid)
{
$userid = intval($userid);
$userid = (int)$userid;
if ($statusid == 'R')
{
@ -2626,7 +2626,7 @@
$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] = $part_prefs['common']['timeformat'];
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] = $part_prefs['common']['dateformat'];
$GLOBALS['phpgw']->datetime->tz_offset = ((60 * 60) * intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
$GLOBALS['phpgw']->datetime->tz_offset = ((60 * 60) * (int)$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']);
if($old_starttime)
{
@ -2773,12 +2773,12 @@
if(isset($new_event['participants'][$old_userid]))
{
print_debug('Modifying event for user',$old_userid);
$this->modified[intval($old_userid)] = $new_status;
$this->modified[(int)$old_userid] = $new_status;
}
else
{
print_debug('Deleting user from the event',$old_userid);
$this->deleted[intval($old_userid)] = $old_status;
$this->deleted[(int)$old_userid] = $old_status;
}
}
// Find new users.....
@ -3013,7 +3013,7 @@
$var['access'] = Array(
'field' => lang('Access'),
'data' => $event['public'] ? lang('Public') : lang('Privat')
'data' => $event['public'] ? lang('Public') : lang('Private')
);
if(@isset($event['groups'][0]))

View File

@ -48,7 +48,7 @@
{
$this->so = CreateObject('calendar.soholiday');
$this->start = intval(get_var('start',array('POST','GET')));
$this->start = (int)get_var('start',array('POST','GET'));
$this->query = get_var('query',array('POST','GET'));
$this->sort = get_var('sort',array('POST','GET'));
$this->order = get_var('order',array('POST','GET'));
@ -270,11 +270,11 @@
{
$holiday['locale'] = $holiday[0];
$holiday['name'] = $GLOBALS['phpgw']->db->db_addslashes($holiday[1]);
$holiday['mday'] = intval($holiday[2]);
$holiday['month_num'] = intval($holiday[3]);
$holiday['occurence'] = intval($holiday[4]);
$holiday['dow'] = intval($holiday[5]);
$holiday['observance_rule'] = intval($holiday[6]);
$holiday['mday'] = (int)$holiday[2];
$holiday['month_num'] = (int)$holiday[3];
$holiday['occurence'] = (int)$holiday[4];
$holiday['dow'] = (int)$holiday[5];
$holiday['observance_rule'] = (int)$holiday[6];
$holiday['hol_id'] = 0;
$this->so->save_holiday($holiday);
}
@ -322,11 +322,10 @@
}
else
{
$holiday['occurence'] = intval($holiday['occurence'] ? $holiday['occurence'] : $holiday['year']);
$holiday['occurence'] = (int)($holiday['occurence'] ? $holiday['occurence'] : $holiday['year']);
unset($holiday['year']);
}
// Still need to put some validation in here.....
$this->ui = CreateObject('calendar.uiholiday');

View File

@ -79,13 +79,11 @@ define('OTHER',99);
class boicalendar
{
var $public_functions = array(
'import' => True,
'export' => True
);
var $ical;
var $line = 0;
var $event = Array();
@ -967,7 +965,7 @@ class boicalendar
'dtstart' => True
)
),
'enocding' => Array(
'encoding' => Array( // was enocding ???
'type' => 'function',
'function' => 'switch_encoding',
'quoted' => False,
@ -1506,7 +1504,7 @@ class boicalendar
$this->set_var($event,$name,$value);
break;
case 'integer':
$this->set_var($event,$name,intval($value));
$this->set_var($event,$name,(int)$value);
break;
case 'value':
if(@$this->property[$majortype]['type'] == 'date-time')
@ -1554,7 +1552,6 @@ class boicalendar
}
}
/*
* Build-Card Functions
*/
@ -1913,7 +1910,7 @@ class boicalendar
}
elseif(is_int($var))
{
switch(intval($var))
switch((int)$var)
{
case PRIVATE:
return 'PRIVATE';
@ -1999,14 +1996,14 @@ class boicalendar
$pos = explode(':',$var);
$var = $pos[1];
}
$this->set_var($dtime,'year',intval(substr($var,0,4)));
$this->set_var($dtime,'month',intval(substr($var,4,2)));
$this->set_var($dtime,'mday',intval(substr($var,6,2)));
$this->set_var($dtime,'year',(int)(substr($var,0,4)));
$this->set_var($dtime,'month',(int)(substr($var,4,2)));
$this->set_var($dtime,'mday',(int)(substr($var,6,2)));
if(substr($var,8,1) == 'T')
{
$this->set_var($dtime,'hour',intval(substr($var,9,2)));
$this->set_var($dtime,'min',intval(substr($var,11,2)));
$this->set_var($dtime,'sec',intval(substr($var,13,2)));
$this->set_var($dtime,'hour',(int)(substr($var,9,2)));
$this->set_var($dtime,'min',(int)(substr($var,11,2)));
$this->set_var($dtime,'sec',(int)(substr($var,13,2)));
if(strlen($var) > 14)
{
if(substr($var,14,1) != 'Z')
@ -2302,7 +2299,7 @@ class boicalendar
}
elseif(is_int($var))
{
switch(intval($var))
switch((int)$var)
{
case 0: // NEEDS_ACTION:
return 'NEEDS-ACTION';
@ -2556,7 +2553,6 @@ class boicalendar
function parse($ical_text)
{
$begin_regexp = '^';
$semi_colon_regexp = '[\;\:]';
$colon_regexp = '[\:]';
@ -2611,47 +2607,62 @@ class boicalendar
unset($dur);
// Split «DURATION»
list($_f_["day_raw"], $_f_["time_raw"]) = split("T", substr($value, 1, strlen($value)-1) );
list($_f_['day_raw'], $_f_['time_raw']) = split('T', substr($value, 1, strlen($value)-1));
/* Datecode */
if( isset($_f_["day_raw"]) OR $_f_["day_raw"] )
if(isset($_f_['day_raw']) OR $_f_['day_raw'])
{
// Days
if(ereg("D", $_f_["day_raw"]))
$dur["days"] = eregi_replace("([0-9]+)D(.*)", "\\1", $_f_["day_raw"]);
// if(ereg('D', $_f_['day_raw']))
if(strstr($_f_['day_raw'],'D'))
{
$dur['days'] = eregi_replace("([0-9]+)D(.*)", "\\1", $_f_['day_raw']);
}
// Weeks
if(ereg("W", $_f_["day_raw"]))
$dur["weeks"] = eregi_replace("([^|.*]+D)?([0-9]+)W", "\\2", $_f_["day_raw"]);
// if(ereg("W", $_f_["day_raw"]))
if(strstr($_f_['day_raw'],'W'))
{
$dur['weeks'] = eregi_replace("([^|.*]+D)?([0-9]+)W", "\\2", $_f_['day_raw']);
}
}
/* Timecode */
if( isset($_f_["time_raw"]) OR $_f_["time_raw"] )
if(isset($_f_['time_raw']) OR $_f_['time_raw'])
{
// Hours
if(ereg("H", $_f_["time_raw"]))
$dur["hours"] = eregi_replace("([0-9]+)H(.*)", "\\1", $_f_["time_raw"]);
// if(ereg("H", $_f_["time_raw"]))
if(strstr($_f_['time_raw'],'H'))
{
$dur['hours'] = eregi_replace("([0-9]+)H(.*)", "\\1", $_f_['time_raw']);
}
// Minutes
/* If you find better, contact me very quickly :) */
if(ereg("M", $_f_["time_raw"]) )
$dur["minutes"] = eregi_replace("([^|.*]+H)?([0-9]+)M(.*)", "\\2", $_f_["time_raw"]);
// if(ereg("M", $_f_["time_raw"]))
if(strstr($_f_['time_raw'],'M'))
{
$dur['minutes'] = eregi_replace("([^|.*]+H)?([0-9]+)M(.*)", "\\2", $_f_['time_raw']);
}
// Seconds
/* Same comment :) */
if(ereg("S", $_f_["time_raw"]) )
$dur["seconds"] = eregi_replace("([^|.*]+M)?([0-9]+)S(.*)", "\\2", $_f_["time_raw"]);
// if(ereg("S", $_f_["time_raw"]) )
if(strstr($_f_['time_raw'],'S'))
{
$dur['seconds'] = eregi_replace("([^|.*]+M)?([0-9]+)S(.*)", "\\2", $_f_['time_raw']);
}
}
$dur["raw"] = Array(
"timecode" => $_f_["time_raw"],
"datecode" => $_f_["day_raw"],
"all" => $value );
$dur['raw'] = Array(
'timecode' => $_f_['time_raw'],
'datecode' => $_f_['day_raw'],
'all' => $value
);
// Add new parameters in Event
$this->set_var($event, $majortype, $dur);
}
if($majortype == 'begin')
{
$tmode = $mode;
@ -2778,11 +2789,11 @@ class boicalendar
case 'integer':
if($multiples)
{
$event[$majortype][] = intval($value);
$event[$majortype][] = (int)$value;
}
else
{
$this->set_var($event,$majortype,intval($value));
$this->set_var($event,$majortype,(int)$value);
}
break;
case 'float':
@ -2790,7 +2801,7 @@ class boicalendar
$this->parse_geo($event->$majortype,$value);
break;
case 'utc-offset':
$this->set_var($event,$majortype,intval($value));
$this->set_var($event,$majortype,(int)$value);
break;
case 'uri':
$new_var = Array();
@ -2928,7 +2939,7 @@ class boicalendar
{
if($this->is_owner($ical['attendee'][$j]))
{
$so_event->add_attribute('participants',$this->switch_to_phpgw_status($ical['attendee'][$j]['partstat']),intval($GLOBALS['phpgw_info']['user']['account_id']));
$so_event->add_attribute('participants',$this->switch_to_phpgw_status($ical['attendee'][$j]['partstat']),(int)$GLOBALS['phpgw_info']['user']['account_id']);
}
}
}
@ -3102,7 +3113,7 @@ class boicalendar
@reset($date_array);
while(list($key,$var) = each($date_array))
{
$event[$e_datevar][$var] = intval(date($key,$temp_time));
$event[$e_datevar][$var] = (int)(date($key,$temp_time));
}
$so_event->set_date($e_datevar,$event[$e_datevar]['year'],$event[$e_datevar]['month'],$event[$e_datevar]['mday'],$event[$e_datevar]['hour'],$event[$e_datevar]['min'],$event[$e_datevar]['sec']);
}
@ -3161,9 +3172,9 @@ class boicalendar
// recur_enddate
if(isset($ical['event'][$i]['rrule']['until']))
{
$recur_enddate['year'] = intval($ical['event'][$i]['rrule']['until']['year']);
$recur_enddate['month'] = intval($ical['event'][$i]['rrule']['until']['month']);
$recur_enddate['mday'] = intval($ical['event'][$i]['rrule']['until']['mday']);
$recur_enddate['year'] = (int)($ical['event'][$i]['rrule']['until']['year']);
$recur_enddate['month'] = (int)($ical['event'][$i]['rrule']['until']['month']);
$recur_enddate['mday'] = (int)($ical['event'][$i]['rrule']['until']['mday']);
}
elseif( isset($ical['event'][$i]['duration']) )
{
@ -3176,7 +3187,6 @@ class boicalendar
$ical['event'][$i]['dtstart']['year']
);
/* -- Fixbug --
* if "DURATION" has 1 day (for example).
* Event takes places between the first date
@ -3283,7 +3293,7 @@ class boicalendar
}
else
{
$interval = intval($ical['event'][$i]['rrule']['interval']);
$interval = (int)$ical['event'][$i]['rrule']['interval'];
}
// recur_type
switch($ical['event'][$i]['rrule']['freq'])
@ -3312,7 +3322,7 @@ class boicalendar
if(!isset($ical['event'][$i]['organizer']) || (isset($ical['event'][$i]['organizer']) && $this->is_owner($ical['event'][$i]['organizer'])))
{
$so_event->add_attribute('owner',$GLOBALS['phpgw_info']['user']['account_id']);
$so_event->add_attribute('participants','A',intval($GLOBALS['phpgw_info']['user']['account_id']));
$so_event->add_attribute('participants','A',(int)$GLOBALS['phpgw_info']['user']['account_id']);
}
else
{
@ -3407,7 +3417,7 @@ class boicalendar
// use system's date info for caluculating local timezone's offset in minutes
//
$gmt_offset = date('O',$GLOBALS['phpgw']->datetime->users_localtime); // offset to GMT
$offset = intval(substr($gmt_offset, 1, 2)) * 60 + intval(substr($gmt_offset, 3, 2));
$offset = (int)(substr($gmt_offset, 1, 2)) * 60 + (int)(substr($gmt_offset, 3, 2));
if ($offset > 0)
{
$event['start']['min'] -= $offset;
@ -3416,7 +3426,7 @@ class boicalendar
}
$ical_event['priority'] = $event['priority'];
$ical_event['class'] = intval($event['public']);
$ical_event['class'] = (int)$event['public'];
$dtstart_mktime = $so_event->maketime($event['start']);
$this->parse_value($ical_event,'dtstart',date('Ymd\THis\Z',$dtstart_mktime),'vevent');
$dtend_mktime = $so_event->maketime($event['end']);
@ -3458,7 +3468,7 @@ class boicalendar
$GLOBALS['phpgw']->accounts->get_account_name($part,$lid,$fname,$lname);
$name = $fname.' '.$lname;
$owner_status = $this->switch_partstat(intval($this->switch_phpgw_status($event['participants'][$part])));
$owner_status = $this->switch_partstat((int)$this->switch_phpgw_status($event['participants'][$part]));
$mail_prefs = $GLOBALS['phpgw']->preferences->create_email_preferences($part);
$mailto = $mail_prefs['email']['address'];

View File

@ -24,20 +24,18 @@ class calendar_holiday
function calendar_holiday($owner='')
{
global $phpgw, $phpgw_info;
$this->datetime = CreateObject('phpgwapi.datetime');
$this->db = $phpgw->db;
if(@$phpgw_info['user']['preferences']['common']['country'])
$this->db = $GLOBALS['phpgw']->db;
if(@$GLOBALS['phpgw_info']['user']['preferences']['common']['country'])
{
$this->users['user'] = $phpgw_info['user']['preferences']['common']['country'];
$this->users['user'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['country'];
}
else
{
$this->users['user'] = 'US';
}
$owner_id = get_account_id($owner);
if($owner_id != $phpgw_info['user']['account_id'])
if($owner_id != $GLOBALS['phpgw_info']['user']['account_id'])
{
$owner_pref = CreateObject('phpgwapi.preferences',$owner_id);
$owner_prefs = $owner_pref->read_repository();
@ -49,9 +47,8 @@ class calendar_holiday
{
$this->users['owner'] = 'US';
}
}
if($phpgw_info['server']['auto_load_holidays'] == True)
if($GLOBALS['phpgw_info']['server']['auto_load_holidays'] == True)
{
while(list($key,$value) = each($this->users))
{
@ -77,13 +74,13 @@ class calendar_holiday
if(isset($holiday['hol_id']) && $holiday['hol_id'])
{
// echo "Updating LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
$sql = "UPDATE phpgw_cal_holidays SET name='".$holiday['name']."', mday=".$holiday['mday'].', month_num='.$holiday['month_num'].', occurence='.$holiday['occurence'].', dow='.$holiday['dow'].', observance_rule='.intval($holiday['observance_rule']).' WHERE hol_id='.$holiday['hol_id'];
$sql = "UPDATE phpgw_cal_holidays SET name='".$holiday['name']."', mday=".$holiday['mday'].', month_num='.$holiday['month_num'].', occurence='.$holiday['occurence'].', dow='.$holiday['dow'].', observance_rule='.(int)$holiday['observance_rule'].' WHERE hol_id='.$holiday['hol_id'];
}
else
{
// echo "Inserting LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
$sql = 'INSERT INTO phpgw_cal_holidays(locale,name,mday,month_num,occurence,dow,observance_rule) '
. "VALUES('".strtoupper($holiday['locale'])."','".$holiday['name']."',".$holiday['mday'].','.$holiday['month_num'].','.$holiday['occurence'].','.$holiday['dow'].','.intval($holiday['observance_rule']).")";
. "VALUES('".strtoupper($holiday['locale'])."','".$holiday['name']."',".$holiday['mday'].','.$holiday['month_num'].','.$holiday['occurence'].','.$holiday['dow'].','.(int)$holiday['observance_rule'].")";
}
$this->db->query($sql,__LINE__,__FILE__);
}
@ -102,23 +99,21 @@ class calendar_holiday
function load_from_network($locale)
{
global $phpgw_info, $HTTP_HOST, $SERVER_PORT;
@set_time_limit(0);
// get the file that contains the calendar events for your locale
// "http://www.phpgroupware.org/headlines.rdf";
$network = CreateObject('phpgwapi.network');
if(isset($phpgw_info['server']['holidays_url_path']) && $phpgw_info['server']['holidays_url_path'] != 'localhost')
if(isset($GLOBALS['phpgw_info']['server']['holidays_url_path']) && $GLOBALS['phpgw_info']['server']['holidays_url_path'] != 'localhost')
{
$load_from = $phpgw_info['server']['holidays_url_path'];
$load_from = $GLOBALS['phpgw_info']['server']['holidays_url_path'];
}
else
{
$pos = strpos(' '.$phpgw_info['server']['webserver_url'],$HTTP_HOST);
$pos = strpos(' '.$GLOBALS['phpgw_info']['server']['webserver_url'],$_SERVER['HTTP_HOST']);
if($pos == 0)
{
switch($SERVER_PORT)
switch($_SERVER['SERVER_PORT'])
{
case 80:
$http_protocol = 'http://';
@ -127,17 +122,20 @@ class calendar_holiday
$http_protocol = 'https://';
break;
}
$server_host = $http_protocol.$HTTP_HOST.$phpgw_info['server']['webserver_url'];
$server_host = $http_protocol.$_SERVER['HTTP_HOST'].$GLOBALS['phpgw_info']['server']['webserver_url'];
}
else
{
$server_host = $phpgw_info['server']['webserver_url'];
$server_host = $GLOBALS['phpgw_info']['server']['webserver_url'];
}
$load_from = $server_host.'/calendar/setup';
}
// echo 'Loading from: '.$load_from.'/holidays.'.strtoupper($locale)."<br>\n";
$lines = $network->gethttpsocketfile($load_from.'/holidays.'.strtoupper($locale));
if (!$lines) return false;
if(!$lines)
{
return False;
}
$c_lines = count($lines);
for($i=0;$i<$c_lines;$i++)
{
@ -147,11 +145,11 @@ class calendar_holiday
{
$holiday['locale'] = $holiday[0];
$holiday['name'] = addslashes($holiday[1]);
$holiday['mday'] = intval($holiday[2]);
$holiday['month_num'] = intval($holiday[3]);
$holiday['occurence'] = intval($holiday[4]);
$holiday['dow'] = intval($holiday[5]);
$holiday['observance_rule'] = intval($holiday[6]);
$holiday['mday'] = (int)$holiday[2];
$holiday['month_num'] = (int)$holiday[3];
$holiday['occurence'] = (int)$holiday[4];
$holiday['dow'] = (int)$holiday[5];
$holiday['observance_rule'] = (int)$holiday[6];
$holiday['hol_id'] = 0;
$this->save_holiday($holiday);
}
@ -160,28 +158,27 @@ class calendar_holiday
function read_holiday()
{
global $phpgw, $phpgw_info;
$this->year = intval($phpgw->calendar->tempyear);
$this->year = (int)$GLOBALS['phpgw']->calendar->tempyear;
$sql = $this->build_holiday_query();
if($sql == False)
{ return False;
{
return False;
}
$this->holidays = Null;
$this->db->query($sql,__LINE__,__FILE__);
$i = 0;
$temp_locale = $phpgw_info['user']['preferences']['common']['country'];
$temp_locale = $GLOBALS['phpgw_info']['user']['preferences']['common']['country'];
while($this->db->next_record())
{
$this->index[$this->db->f('hol_id')] = $i;
$this->holidays[$i]['locale'] = $this->db->f('locale');
$this->holidays[$i]['name'] = $phpgw->strip_html($this->db->f('name'));
$this->holidays[$i]['day'] = intval($this->db->f('mday'));
$this->holidays[$i]['month'] = intval($this->db->f('month_num'));
$this->holidays[$i]['occurence'] = intval($this->db->f('occurence'));
$this->holidays[$i]['dow'] = intval($this->db->f('dow'));
$this->holidays[$i]['name'] = $GLOBALS['phpgw']->strip_html($this->db->f('name'));
$this->holidays[$i]['day'] = (int)$this->db->f('mday');
$this->holidays[$i]['month'] = (int)$this->db->f('month_num');
$this->holidays[$i]['occurence'] = (int)$this->db->f('occurence');
$this->holidays[$i]['dow'] = (int)$this->db->f('dow');
$this->holidays[$i]['observance_rule'] = $this->db->f('observance_rule');
if(count($this->users) == 2 && $this->users[0] != $this->users[1])
{
@ -199,7 +196,7 @@ class calendar_holiday
$this->holidays[$i]['owner'] = 'user';
}
$c = $i;
$phpgw_info['user']['preferences']['common']['country'] = $this->holidays[$i]['locale'];
$GLOBALS['phpgw_info']['user']['preferences']['common']['country'] = $this->holidays[$i]['locale'];
$holidaycalc = CreateObject('calendar.holidaycalc');
$this->holidays[$i]['date'] = $holidaycalc->calculate_date($this->holidays[$i], $this->holidays, $this->year, $this->datetime, $c);
unset($holidaycalc);
@ -210,25 +207,23 @@ class calendar_holiday
$i++;
}
$this->holidays = $this->sort_by_date($this->holidays);
$phpgw_info['user']['preferences']['common']['country'] = $temp_locale;
$GLOBALS['phpgw_info']['user']['preferences']['common']['country'] = $temp_locale;
return $this->holidays;
}
function build_list_for_submission($locale)
{
global $phpgw;
$i = -1;
$this->db->query("SELECT * FROM phpgw_cal_holidays WHERE locale='".$locale."'");
while($this->db->next_record())
{
$i++;
$holidays[$i]['locale'] = $this->db->f('locale');
$holidays[$i]['name'] = $phpgw->strip_html($this->db->f('name'));
$holidays[$i]['day'] = intval($this->db->f('mday'));
$holidays[$i]['month'] = intval($this->db->f('month_num'));
$holidays[$i]['occurence'] = intval($this->db->f('occurence'));
$holidays[$i]['dow'] = intval($this->db->f('dow'));
$holidays[$i]['name'] = $GLOBALS['phpgw']->strip_html($this->db->f('name'));
$holidays[$i]['day'] = (int)$this->db->f('mday');
$holidays[$i]['month'] = (int)$this->db->f('month_num');
$holidays[$i]['occurence'] = (int)$this->db->f('occurence');
$holidays[$i]['dow'] = (int)$this->db->f('dow');
$holidays[$i]['observance_rule'] = $this->db->f('observance_rule');
}
return $holidays;
@ -278,8 +273,6 @@ class calendar_holiday
function find_date($date)
{
global $phpgw;
if($this->holidays == Null)
{
return False;
@ -297,7 +290,7 @@ class calendar_holiday
$return_value[] = $i;
}
}
// echo 'Searching for '.$phpgw->common->show_date($date).' Found = '.count($return_value)."<br>\n";
// echo 'Searching for '.$GLOBALS['phpgw']->common->show_date($date).' Found = '.count($return_value)."<br>\n";
if(isset($return_value))
{
return $return_value;

View File

@ -12,27 +12,25 @@
/* $Id$ */
if (isset($phpgw_info['flags']['included_classes']['calendar_']) &&
$phpgw_info['flags']['included_classes']['calendar_'] == True)
if (isset($GLOBALS['phpgw_info']['flags']['included_classes']['calendar_']) &&
$GLOBALS['phpgw_info']['flags']['included_classes']['calendar_'] == True)
{
return;
}
$phpgw_info['flags']['included_classes']['calendar_'] = True;
$GLOBALS['phpgw_info']['flags']['included_classes']['calendar_'] = True;
class calendar_ extends calendar__
{
function open($calendar='',$user='',$passwd='',$options='')
{
global $phpgw, $phpgw_info;
if($user=='')
{
$user = $phpgw_info['user']['account_lid'];
$user = $GLOBALS['phpgw_info']['user']['account_lid'];
}
elseif(is_int($user))
{
$this->user = $phpgw->accounts->id2name($user);
$this->user = $GLOBALS['phpgw']->accounts->id2name($user);
}
elseif(is_string($user))
{
@ -40,25 +38,23 @@ class calendar_ extends calendar__
}
if($options != '')
{
$this->stream = mcal_open('{'.$phpgw_info['server']['icap_server'].'/'.$phpgw_info['server']['icap_type'].'}'.$calendar,$this->user,$passwd,$options);
$this->stream = mcal_open('{'.$GLOBALS['phpgw_info']['server']['icap_server'].'/'.$GLOBALS['phpgw_info']['server']['icap_type'].'}'.$calendar,$this->user,$passwd,$options);
}
else
{
$this->stream = mcal_open('{'.$phpgw_info['server']['icap_server'].'/'.$phpgw_info['server']['icap_type'].'}'.$calendar,$this->user,$passwd);
$this->stream = mcal_open('{'.$GLOBALS['phpgw_info']['server']['icap_server'].'/'.$GLOBALS['phpgw_info']['server']['icap_type'].'}'.$calendar,$this->user,$passwd);
}
}
function popen($calendar='',$user='',$passwd='',$options='')
{
global $phpgw, $phpgw_info;
if($user=='')
{
$this->user = $phpgw_info['user']['account_lid'];
$this->user = $GLOBALS['phpgw_info']['user']['account_lid'];
}
elseif(is_int($user))
{
$this->user = $phpgw->accounts->id2name($user);
$this->user = $GLOBALS['phpgw']->accounts->id2name($user);
}
elseif(is_string($user))
{
@ -66,11 +62,11 @@ class calendar_ extends calendar__
}
if($options != '')
{
$this->stream = mcal_popen('{'.$phpgw_info['server']['icap_server'].'/'.$phpgw_info['server']['icap_type'].'}'.$calendar,$this->user,$passwd,$options);
$this->stream = mcal_popen('{'.$GLOBALS['phpgw_info']['server']['icap_server'].'/'.$GLOBALS['phpgw_info']['server']['icap_type'].'}'.$calendar,$this->user,$passwd,$options);
}
else
{
$this->stream = mcal_popen('{'.$phpgw_info['server']['icap_server'].'/'.$phpgw_info['server']['icap_type'].'}'.$calendar,$this->user,$passwd);
$this->stream = mcal_popen('{'.$GLOBALS['phpgw_info']['server']['icap_server'].'/'.$GLOBALS['phpgw_info']['server']['icap_type'].'}'.$calendar,$this->user,$passwd);
}
}

View File

@ -13,8 +13,8 @@
/* $Id$ */
class holidaycalc {
class holidaycalc
{
function calculate_date($holiday, &$holidays, $year, &$i)
{
static $cached_month;

View File

@ -13,8 +13,8 @@
/* $Id$ */
class holidaycalc {
class holidaycalc
{
function calculate_date($holiday, &$holidays, $year, &$i)
{
// if($holiday['day'] == 0 && $holiday['dow'] != 0 && $holiday['occurence'] != 0)

View File

@ -55,7 +55,7 @@
function open_box($owner)
{
$this->cal->open('INBOX',intval($owner));
$this->cal->open('INBOX',(int)$owner);
}
function maketime($time)
@ -130,7 +130,7 @@
$members[] = $this->owner;
}
$sql = 'AND (phpgw_cal_user.cal_login IN ('.implode(',',$members).')) AND '.
'(phpgw_cal_user.cal_login='.intval($this->owner).' OR phpgw_cal.is_public=1) AND (';
'(phpgw_cal_user.cal_login=' . (int)$this->owner . ' OR phpgw_cal.is_public=1) AND (';
$words = split(' ',$keywords);
foreach($words as $i => $word)
@ -286,7 +286,7 @@
{
while($this->cal->next_record())
{
$arr[] = intval($this->cal->f('datetime'));
$arr[] = (int)$this->cal->f('datetime');
}
}
if(count($arr) == 0)

View File

@ -84,7 +84,7 @@ class socalendar__
function event_init()
{
$this->event = Array();
$this->add_attribute('owner',intval($this->user));
$this->add_attribute('owner',(int)$this->user);
}
function set_category($category='')
@ -104,12 +104,12 @@ class socalendar__
function set_date($element,$year,$month,$day=0,$hour=0,$min=0,$sec=0)
{
$this->add_attribute($element,intval($year),'year');
$this->add_attribute($element,intval($month),'month');
$this->add_attribute($element,intval($day),'mday');
$this->add_attribute($element,intval($hour),'hour');
$this->add_attribute($element,intval($min),'min');
$this->add_attribute($element,intval($sec),'sec');
$this->add_attribute($element,(int)$year,'year');
$this->add_attribute($element,(int)$month,'month');
$this->add_attribute($element,(int)$day,'mday');
$this->add_attribute($element,(int)$hour,'hour');
$this->add_attribute($element,(int)$min,'min');
$this->add_attribute($element,(int)$sec,'sec');
$this->add_attribute($element,0,'alarm');
}
@ -125,7 +125,7 @@ class socalendar__
function set_alarm($alarm)
{
$this->add_attribute('alarm',intval($alarm));
$this->add_attribute('alarm',(int)$alarm);
}
function set_class($class)
@ -135,7 +135,7 @@ class socalendar__
function set_common_recur($year=0,$month=0,$day=0,$interval=0)
{
$this->add_attribute('recur_interval',intval($interval));
$this->add_attribute('recur_interval',(int)$interval);
$this->set_date('recur_enddate',$year,$month,$day,0,0,0);
$this->add_attribute('recur_data',0);
}
@ -148,32 +148,32 @@ class socalendar__
function set_recur_daily($year,$month,$day,$interval)
{
$this->set_common_recur(intval($year),intval($month),intval($day),$interval);
$this->set_common_recur((int)$year,(int)$month,(int)$day,$interval);
$this->add_attribute('recur_type',MCAL_RECUR_DAILY);
}
function set_recur_weekly($year,$month,$day,$interval,$weekdays)
{
$this->set_common_recur(intval($year),intval($month),intval($day),$interval);
$this->set_common_recur((int)$year,(int)$month,(int)$day,$interval);
$this->add_attribute('recur_type',MCAL_RECUR_WEEKLY);
$this->add_attribute('recur_data',intval($weekdays));
$this->add_attribute('recur_data',(int)$weekdays);
}
function set_recur_monthly_mday($year,$month,$day,$interval)
{
$this->set_common_recur(intval($year),intval($month),intval($day),$interval);
$this->set_common_recur((int)$year,(int)$month,(int)$day,$interval);
$this->add_attribute('recur_type',MCAL_RECUR_MONTHLY_MDAY);
}
function set_recur_monthly_wday($year,$month,$day,$interval)
{
$this->set_common_recur(intval($year),intval($month),intval($day),$interval);
$this->set_common_recur((int)$year,(int)$month,(int)$day,$interval);
$this->add_attribute('recur_type',MCAL_RECUR_MONTHLY_WDAY);
}
function set_recur_yearly($year,$month,$day,$interval)
{
$this->set_common_recur(intval($year),intval($month),intval($day),$interval);
$this->set_common_recur((int)$year,(int)$month,(int)$day,$interval);
$this->add_attribute('recur_type',MCAL_RECUR_YEARLY);
}

View File

@ -87,17 +87,17 @@ class socalendar_ extends socalendar__
function delete_calendar($calendar='')
{
$this->stream->query('SELECT cal_id FROM phpgw_cal WHERE owner='.intval($calendar),__LINE__,__FILE__);
$this->stream->query('SELECT cal_id FROM phpgw_cal WHERE owner='.(int)$calendar,__LINE__,__FILE__);
if($this->stream->num_rows())
{
while($this->stream->next_record())
{
$this->delete_event(intval($this->stream->f('cal_id')));
$this->delete_event((int)$this->stream->f('cal_id'));
}
$this->expunge();
}
$this->stream->lock(array('phpgw_cal_user'));
$this->stream->query('DELETE FROM phpgw_cal_user WHERE cal_login='.intval($calendar),__LINE__,__FILE__);
$this->stream->query('DELETE FROM phpgw_cal_user WHERE cal_login='.(int)$calendar,__LINE__,__FILE__);
$this->stream->unlock();
return $calendar;
@ -113,7 +113,7 @@ class socalendar_ extends socalendar__
{
$alarms = array();
if ($jobs = $this->async->read('cal:'.intval($cal_id).':%'))
if ($jobs = $this->async->read('cal:'.(int)$cal_id.':%'))
{
foreach($jobs as $id => $job)
{
@ -165,7 +165,7 @@ class socalendar_ extends socalendar__
$n = count($alarms);
do
{
$id = 'cal:'.intval($cal_id).':'.$n;
$id = 'cal:'.(int)$cal_id.':'.$n;
++$n;
}
while (@isset($alarms[$id]));
@ -216,7 +216,7 @@ class socalendar_ extends socalendar__
return False;
}
$event_id = intval($event_id);
$event_id = (int)$event_id;
$this->stream->lock(array('phpgw_cal','phpgw_cal_user','phpgw_cal_repeats','phpgw_cal_extra'/* OLD-ALARM,'phpgw_cal_alarm'*/));
@ -229,18 +229,18 @@ class socalendar_ extends socalendar__
$this->stream->next_record();
// Load the calendar event data from the db into $event structure
// Use http://www.php.net/manual/en/function.mcal-fetch-event.php as the reference
$this->add_attribute('owner',intval($this->stream->f('owner')));
$this->add_attribute('id',intval($this->stream->f('cal_id')));
$this->set_class(intval($this->stream->f('is_public')));
$this->add_attribute('owner',(int)$this->stream->f('owner'));
$this->add_attribute('id',(int)$this->stream->f('cal_id'));
$this->set_class((int)$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')));
$this->add_attribute('reference',(int)$this->stream->f('reference'));
// This is the preferred method once everything is normalized...
//$this->event->alarm = intval($this->stream->f('alarm'));
//$this->event->alarm = (int)$this->stream->f('alarm');
// But until then, do it this way...
//Legacy Support (New)
@ -254,7 +254,7 @@ class socalendar_ extends socalendar__
$this->set_end($datetime['year'],$datetime['month'],$datetime['day'],$datetime['hour'],$datetime['minute'],$datetime['second']);
//Legacy Support
$this->add_attribute('priority',intval($this->stream->f('priority')));
$this->add_attribute('priority',(int)$this->stream->f('priority'));
if($this->stream->f('cal_group') || $this->stream->f('groups') != 'NULL')
{
$groups = explode(',',$this->stream->f('groups'));
@ -269,8 +269,8 @@ class socalendar_ extends socalendar__
{
$this->stream->next_record();
$this->add_attribute('recur_type',intval($this->stream->f('recur_type')));
$this->add_attribute('recur_interval',intval($this->stream->f('recur_interval')));
$this->add_attribute('recur_type',(int)$this->stream->f('recur_type'));
$this->add_attribute('recur_interval',(int)$this->stream->f('recur_interval'));
$enddate = $this->stream->f('recur_enddate');
if($enddate != 0 && $enddate != Null)
{
@ -317,11 +317,11 @@ class socalendar_ extends socalendar__
{
while($this->stream->next_record())
{
if(intval($this->stream->f('cal_login')) == intval($this->user))
if((int)$this->stream->f('cal_login') == (int)$this->user)
{
$this->add_attribute('users_status',$this->stream->f('cal_status'));
}
$this->add_attribute('participants',$this->stream->f('cal_status'),intval($this->stream->f('cal_login')));
$this->add_attribute('participants',$this->stream->f('cal_status'),(int)$this->stream->f('cal_login'));
}
}
@ -354,10 +354,10 @@ class socalendar_ extends socalendar__
while($this->stream->next_record())
{
$this->event['alarm'][] = Array(
'id' => intval($this->stream->f('alarm_id')),
'time' => intval($this->stream->f('cal_time')),
'id' => (int)$this->stream->f('alarm_id'),
'time' => (int)$this->stream->f('cal_time'),
'text' => $this->stream->f('cal_text'),
'enabled' => intval($this->stream->f('alarm_enabled'))
'enabled' => (int)$this->stream->f('alarm_enabled')
);
}
}
@ -420,7 +420,7 @@ class socalendar_ extends socalendar__
$enddate = '';
if($endYear != 0 && $endMonth != 0 && $endDay != 0)
{
$edatetime = mktime(23,59,59,intval($endMonth),intval($endDay),intval($endYear)) - $tz_offset;
$edatetime = mktime(23,59,59,(int)$endMonth,(int)$endDay,(int)$endYear) - $tz_offset;
$endDate .= 'AND (phpgw_cal.edatetime <= '.$edatetime.') ) '
. 'OR ( (phpgw_cal.datetime <= '.$datetime.') '
. 'AND (phpgw_cal.edatetime >= '.$edatetime.') ) '
@ -553,7 +553,7 @@ class socalendar_ extends socalendar__
while($this->stream->next_record())
{
$retval[] = intval($this->stream->f('cal_id'));
$retval[] = (int)$this->stream->f('cal_id');
}
if($this->debug)
{
@ -601,7 +601,7 @@ class socalendar_ extends socalendar__
}
$this->stream->query('INSERT INTO phpgw_cal(uid,title,owner,priority,is_public,category) '
. "values('".$event['uid']."','".$this->stream->db_addslashes($event['title'])
. "',".intval($event['owner']).','.intval($event['priority']).','.intval($event['public']).",'"
. "',".(int)$event['owner'].','.(int)$event['priority'].','.(int)$event['public'].",'"
. $event['category']."')",__LINE__,__FILE__);
$event['id'] = $this->stream->get_last_insert_id('phpgw_cal','cal_id');
}
@ -620,34 +620,34 @@ class socalendar_ extends socalendar__
}
$sql = 'UPDATE phpgw_cal SET '
. 'owner='.intval($event['owner']).', '
. 'datetime='.intval($date).', '
. 'mdatetime='.intval($today).', '
. 'edatetime='.intval($enddate).', '
. 'priority='.intval($event['priority']).', '
. 'owner='.(int)$event['owner'].', '
. 'datetime='.(int)$date.', '
. 'mdatetime='.(int)$today.', '
. 'edatetime='.(int)$enddate.', '
. 'priority='.(int)$event['priority'].', '
. "category='".$this->stream->db_addslashes($event['category'])."', "
. "cal_type='".$this->stream->db_addslashes($type)."', "
. 'is_public='.intval($event['public']).', '
. 'is_public='.(int)$event['public'].', '
. "title='".$this->stream->db_addslashes($event['title'])."', "
. "description='".$this->stream->db_addslashes($event['description'])."', "
. "location='".$this->stream->db_addslashes($event['location'])."', "
. ($event['groups']?"groups='".(count($event['groups'])>1?implode(',',$event['groups']):','.$event['groups'][0].',')."', ":'')
. 'reference='.intval($event['reference']).' '
. 'WHERE cal_id='.intval($event['id']);
. 'reference='.(int)$event['reference'].' '
. 'WHERE cal_id='.(int)$event['id'];
$this->stream->query($sql,__LINE__,__FILE__);
$this->stream->query('DELETE FROM phpgw_cal_user WHERE cal_id='.intval($event['id']),__LINE__,__FILE__);
$this->stream->query('DELETE FROM phpgw_cal_user WHERE cal_id='.(int)$event['id'],__LINE__,__FILE__);
@reset($event['participants']);
while (list($key,$value) = @each($event['participants']))
{
if(intval($key) == $event['owner'])
if((int)$key == $event['owner'])
{
$value = 'A';
}
$this->stream->query('INSERT INTO phpgw_cal_user(cal_id,cal_login,cal_status) '
. 'VALUES('.intval($event['id']).','.intval($key).",'".$this->stream->db_addslashes($value)."')",__LINE__,__FILE__);
. 'VALUES('.(int)$event['id'].','.(int)$key.",'".$this->stream->db_addslashes($value)."')",__LINE__,__FILE__);
}
if($event['recur_type'] != MCAL_RECUR_NONE)
@ -661,19 +661,19 @@ class socalendar_ extends socalendar__
$end = 0;
}
$this->stream->query('SELECT count(cal_id) FROM phpgw_cal_repeats WHERE cal_id='.intval($event['id']),__LINE__,__FILE__);
$this->stream->query('SELECT count(cal_id) FROM phpgw_cal_repeats WHERE cal_id='.(int)$event['id'],__LINE__,__FILE__);
$this->stream->next_record();
$num_rows = $this->stream->f(0);
if($num_rows == 0)
{
$this->stream->query('INSERT INTO phpgw_cal_repeats(cal_id,recur_type,recur_enddate,recur_data,recur_interval) '
.'VALUES('.intval($event['id']).','.$event['recur_type'].','.intval($end).','.$event['recur_data'].','.$event['recur_interval'].')',__LINE__,__FILE__);
.'VALUES('.(int)$event['id'].','.$event['recur_type'].','.(int)$end.','.$event['recur_data'].','.$event['recur_interval'].')',__LINE__,__FILE__);
}
else
{
$this->stream->query('UPDATE phpgw_cal_repeats '
. 'SET recur_type='.$event['recur_type'].', '
. 'recur_enddate='.intval($end).', '
. 'recur_enddate='.(int)$end.', '
. 'recur_data='.$event['recur_data'].', '
. 'recur_interval='.$event['recur_interval'].', '
. "recur_exception='".(count($event['recur_exception'])>1?implode(',',$event['recur_exception']):(count($event['recur_exception'])==1?$event['recur_exception'][0]:''))."' "
@ -789,7 +789,7 @@ class socalendar_ extends socalendar__
function group_search($owner=0)
{
$owner = ($owner==$GLOBALS['phpgw_info']['user']['account_id']?0:$owner);
$groups = substr($GLOBALS['phpgw']->common->sql_search('phpgw_cal.groups',intval($owner)),4);
$groups = substr($GLOBALS['phpgw']->common->sql_search('phpgw_cal.groups',(int)$owner),4);
if (!$groups)
{
return '';
@ -817,7 +817,7 @@ class socalendar_ extends socalendar__
function date_to_epoch($d)
{
return $this->localdates(mktime(0,0,0,intval(substr($d,4,2)),intval(substr($d,6,2)),intval(substr($d,0,4))));
return $this->localdates(mktime(0,0,0,(int)(substr($d,4,2)),(int)(substr($d,6,2)),(int)(substr($d,0,4))));
}
function list_dirty_events($lastmod=-1,$repeats=false)
@ -826,7 +826,7 @@ class socalendar_ extends socalendar__
{
return False;
}
$lastmod = intval($lastmod);
$lastmod = (int) $lastmod;
$repeats = (bool) $repeats;
$user_where = " AND phpgw_cal_user.cal_login = $this->user";

View File

@ -31,7 +31,7 @@
{
echo "Updating LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
}
$sql = "UPDATE phpgw_cal_holidays SET name='".$holiday['name']."', mday=".$holiday['mday'].', month_num='.$holiday['month_num'].', occurence='.$holiday['occurence'].', dow='.$holiday['dow'].', observance_rule='.intval($holiday['observance_rule']).' WHERE hol_id='.$holiday['hol_id'];
$sql = "UPDATE phpgw_cal_holidays SET name='".$holiday['name']."', mday=".$holiday['mday'].', month_num='.$holiday['month_num'].', occurence='.$holiday['occurence'].', dow='.$holiday['dow'].', observance_rule='.(int)$holiday['observance_rule'].' WHERE hol_id='.$holiday['hol_id'];
}
else
{
@ -40,7 +40,7 @@
echo "Inserting LOCALE='".$holiday['locale']."' NAME='".$holiday['name']."' extra=(".$holiday['mday'].'/'.$holiday['month_num'].'/'.$holiday['occurence'].'/'.$holiday['dow'].'/'.$holiday['observance_rule'].")<br>\n";
}
$sql = 'INSERT INTO phpgw_cal_holidays(locale,name,mday,month_num,occurence,dow,observance_rule) '
. "VALUES('".strtoupper($holiday['locale'])."','".$holiday['name']."',".$holiday['mday'].','.$holiday['month_num'].','.$holiday['occurence'].','.$holiday['dow'].','.intval($holiday['observance_rule']).")";
. "VALUES('".strtoupper($holiday['locale'])."','".$holiday['name']."',".$holiday['mday'].','.$holiday['month_num'].','.$holiday['occurence'].','.$holiday['dow'].','.(int)$holiday['observance_rule'].")";
}
$this->db->query($sql,__LINE__,__FILE__);
}
@ -53,10 +53,10 @@
'index' => $this->db->f('hol_id'),
'locale' => $this->db->f('locale'),
'name' => $GLOBALS['phpgw']->strip_html($this->db->f('name')),
'day' => intval($this->db->f('mday')),
'month' => intval($this->db->f('month_num')),
'occurence' => intval($this->db->f('occurence')),
'dow' => intval($this->db->f('dow')),
'day' => (int)$this->db->f('mday'),
'month' => (int)$this->db->f('month_num'),
'occurence' => (int)$this->db->f('occurence'),
'dow' => (int)$this->db->f('dow'),
'observance_rule' => $this->db->f('observance_rule')
);
if($this->debug)
@ -136,7 +136,7 @@
{
$querymethod = " AND name like '%".$query."%'";
}
if (intval($year) > 1900)
if ((int)$year > 1900)
{
$querymethod .= " AND (occurence < 1900 OR occurence = $year)";
}
@ -172,7 +172,7 @@
{
$querymethod = " AND name like '%".$query."%'";
}
if (intval($year) >= 1900)
if ((int)$year >= 1900)
{
$querymethod .= " AND (occurence < 1900 OR occurence = $year)";
}
@ -185,7 +185,7 @@
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$retval = intval($this->db->f(0));
$retval = (int)$this->db->f(0);
if($this->debug)
{
echo 'Total Holidays for : '.$locale.' : '.$retval."<br>\n";

View File

@ -122,9 +122,9 @@
if ($_POST['add'])
{
$time = intval($_POST['time']['days'])*24*3600 +
intval($_POST['time']['hours'])*3600 +
intval($_POST['time']['mins'])*60;
$time = (int)($_POST['time']['days'])*24*3600 +
(int)($_POST['time']['hours'])*3600 +
(int)($_POST['time']['mins'])*60;
if ($time > 0 && !$this->bo->add($this->event,$time,$_POST['owner']))
{
@ -184,7 +184,7 @@
}
$this->template->parse('rows','buttons',True);
}
if (isset($this->event['participants'][intval($GLOBALS['phpgw_info']['user']['account_id'])]))
if (isset($this->event['participants'][(int)$GLOBALS['phpgw_info']['user']['account_id']]))
{
$this->template->set_var(Array(
'input_days' => $this->html->select('time[days]',$_POST['time']['days'],range(0,31),True).' '.lang('days'),

View File

@ -176,10 +176,10 @@
$this->bo->read_holidays($params['year']);
$date = $GLOBALS['phpgw']->datetime->makegmttime(0,0,0,$params['month'],$params['day'],$params['year']);
$month_ago = intval(date('Ymd',mktime(0,0,0,$params['month'] - 1,$params['day'],$params['year'])));
$month_ahead = intval(date('Ymd',mktime(0,0,0,$params['month'] + 1,$params['day'],$params['year'])));
$monthstart = intval(date('Ymd',mktime(0,0,0,$params['month'],1,$params['year'])));
$monthend = intval(date('Ymd',mktime(0,0,0,$params['month'] + 1,0,$params['year'])));
$month_ago = (int)(date('Ymd',mktime(0,0,0,$params['month'] - 1,$params['day'],$params['year'])));
$month_ahead = (int)(date('Ymd',mktime(0,0,0,$params['month'] + 1,$params['day'],$params['year'])));
$monthstart = (int)(date('Ymd',mktime(0,0,0,$params['month'],1,$params['year'])));
$monthend = (int)(date('Ymd',mktime(0,0,0,$params['month'] + 1,0,$params['year'])));
$weekstarttime = $GLOBALS['phpgw']->datetime->get_weekday_start($params['year'],$params['month'],1);
@ -269,9 +269,9 @@
foreach($daily as $date => $day_params)
{
print_debug('Mini-Cal Date',$date);
$year = intval(substr($date,0,4));
$month = intval(substr($date,4,2));
$day = intval(substr($date,6,2));
$year = (int)(substr($date,0,4));
$month = (int)(substr($date,4,2));
$day = (int)(substr($date,6,2));
$str = '';
if(($date >= $monthstart && $date <= $monthend) || $params['outside_month'] == True)
{
@ -702,7 +702,7 @@
$cal_id = get_var('cal_id',array('GET','POST'),$vcal_id);
$date = $cal_date ? $cal_date : 0;
$date = $date?$date:intval($_GET['date']);
$date = $date ? $date : (int)$_GET['date'];
// First, make sure they have permission to this entry
if ($cal_id < 1)
@ -948,7 +948,7 @@
}
elseif(isset($_GET['cal_id']))
{
$cal_id = intval($_GET['cal_id']);
$cal_id = (int)$_GET['cal_id'];
$event = $this->bo->read_entry($cal_id);
if(!$this->bo->check_perms(PHPGW_ACL_EDIT,$event))
@ -1018,17 +1018,17 @@
// $vfs->mkdir('.calendar',array(RELATIVE_USER));
// }
$content = ExecMethod('calendar.boicalendar.export',
Array(
$content = ExecMethod('calendar.boicalendar.export', Array(
'l_event_id' => $_POST['cal_id'],
'chunk_split' => False,
)
);
));
$vfs->cd(array('string' => '/',
$vfs->cd(array(
'string' => '/',
'relatives' => array(RELATIVE_USER)
));
$vfs->write(array('string' => $output_file,
$vfs->write(array(
'string' => $output_file,
'relatives' => array (RELATIVE_USER),
'content' => $content
));
@ -1150,11 +1150,11 @@
{
$this->index();
}
$cal_id = (isset($params['cal_id'])?intval($params['cal_id']):'');
$cal_id = ($cal_id==''?intval($_GET['cal_id']):$cal_id);
$cal_id = (isset($params['cal_id']) ? (int)$params['cal_id'] : '');
$cal_id = ($cal_id == '' ? (int)$_GET['cal_id'] : $cal_id);
$reinstate_index = (isset($params['reinstate_index'])?intval($params['reinstate_index']):'');
$reinstate_index = ($reinstate_index==''?intval($_POST['reinstate_index']):$reinstate_index);
$reinstate_index = (isset($params['reinstate_index']) ? (int)$params['reinstate_index'] : '');
$reinstate_index = ($reinstate_index == '' ? (int)$_POST['reinstate_index'] : $reinstate_index);
if($this->debug)
{
echo '<!-- Calling bo->reinstate -->'."\n";
@ -1203,9 +1203,9 @@
$can_edit = True;
$starthour = intval(get_var('hour',array('GET'),$this->bo->prefs['calendar']['workdaystarts']));
$startmin = intval(get_var('minute',array('GET'),0));
$endmin = $startmin + intval($this->bo->prefs['calendar']['defaultlength']);
$starthour = (int)(get_var('hour',array('GET'),$this->bo->prefs['calendar']['workdaystarts']));
$startmin = (int)(get_var('minute',array('GET'),0));
$endmin = $startmin + (int)$this->bo->prefs['calendar']['defaultlength'];
$endhour = $starthour + $this->bo->normalizeminutes($endmin);
;
$this->bo->set_start($this->bo->year,$this->bo->month,$this->bo->day,$starthour,$startmin,0);
@ -1244,7 +1244,7 @@
}
$date = sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day);
if($this->bo->check_perms(PHPGW_ACL_DELETE,$cal_id=intval($_GET['cal_id'])))
if($this->bo->check_perms(PHPGW_ACL_DELETE,$cal_id = (int)$_GET['cal_id']))
{
if(isset($_POST['delete_type']) && $_POST['delete_type'] == 'single')
{
@ -1368,7 +1368,7 @@
$label=$todo_label;
$showall=true;
}
$maxshow = intval($GLOBALS['phpgw_info']['user']['preferences']['infolog']['mainscreen_maxshow']);
$maxshow = (int)$GLOBALS['phpgw_info']['user']['preferences']['infolog']['mainscreen_maxshow'];
if($maxshow<=0)
{
$maxshow=10;
@ -1462,7 +1462,7 @@
return;
}
$this->bo->set_status(intval($_GET['cal_id']),intval($_GET['action']));
$this->bo->set_status((int)$_GET['cal_id'],(int)$_GET['action']);
if ($this->bo->return_to)
{
@ -1660,8 +1660,8 @@
$this->planner_end_month = $m - 1;
$this->planner_end_year = $y;
$this->planner_days_in_end_month = $GLOBALS['phpgw']->datetime->days_in_month($this->planner_end_month,$this->planner_end_year);
$this->planner_firstday = intval(date('Ymd',mktime(0,0,0,$this->bo->month,1,$this->bo->year)));
$this->planner_lastday = intval(date('Ymd',mktime(0,0,0,$this->planner_end_month,$this->planner_days_in_end_month,$this->planner_end_year)));
$this->planner_firstday = (int)(date('Ymd',mktime(0,0,0,$this->bo->month,1,$this->bo->year)));
$this->planner_lastday = (int)(date('Ymd',mktime(0,0,0,$this->planner_end_month,$this->planner_days_in_end_month,$this->planner_end_year)));
// generate line with calendar weeks in observed interval
//
@ -1669,9 +1669,9 @@
$w = date('W', $d);
if ($w == 'W') // php < 4.1
{
$w = 1 + intval(date('z',$d) / 7); // a bit simplistic
$w = 1 + (int)(date('z',$d) / 7); // a bit simplistic
}
$offset = (7-date("w", $d)+1)%7;
$offset = (7-date('w', $d)+1)%7;
$offset = $offset == 0 ? 7 : $offset;
$color = $this->theme[$w % 2 ? 'th_bg' : 'row_on'];
@ -1691,7 +1691,7 @@
$w = date('W', $d);
if ($w == 'W') // php < 4.1
{
$w = 1 + intval(date('z',$d) / 7); // a bit simplistic
$w = 1 + (int)(date('z',$d) / 7); // a bit simplistic
}
$w += (isset($hdr[1][$w]))?1:0; // bug in "date('W')" ?
@ -1777,7 +1777,7 @@
if (!$is_private)
{
$max_chars = intval(3*$colspan/$intervals_per_day-2);
$max_chars = (int)(3*$colspan/$intervals_per_day-2);
$min_chars = 3; // minimum for max_chars to display -> this should be configurable
if ($max_chars >= $min_chars)
@ -1878,12 +1878,18 @@
// caluculate start and end of event
//
$event_start = intval(date('Ymd',mktime(0,0,0,$event['start']['month'],
$event_start = (int)(date('Ymd',mktime(
0,0,0,
$event['start']['month'],
$event['start']['mday'],
$event['start']['year'])));
$event_end = intval(date('Ymd',mktime(0,0,0,$event['end']['month'],
$event['start']['year']
)));
$event_end = (int)(date('Ymd',mktime(
0,0,0,
$event['end']['month'],
$event['end']['mday'],
$event['end']['year'])));
$event['end']['year']
)));
// calculate first cell of event within observed interval
//
@ -2096,9 +2102,9 @@
$var[] = Array(
'field' => lang('Date'),
'data' => $GLOBALS['phpgw']->common->dateformatorder(
$sb->getYears('year',intval($GLOBALS['phpgw']->common->show_date($datetime,'Y')),intval($GLOBALS['phpgw']->common->show_date($datetime,'Y'))),
$sb->getMonthText('month',intval($GLOBALS['phpgw']->common->show_date($datetime,'n'))),
$sb->getDays('day',intval($GLOBALS['phpgw']->common->show_date($datetime,'d')))
$sb->getYears('year',(int)$GLOBALS['phpgw']->common->show_date($datetime,'Y'),(int)$GLOBALS['phpgw']->common->show_date($datetime,'Y')),
$sb->getMonthText('month',(int)$GLOBALS['phpgw']->common->show_date($datetime,'n')),
$sb->getDays('day',(int)$GLOBALS['phpgw']->common->show_date($datetime,'d'))
)
);
@ -2201,7 +2207,7 @@
switch ($GLOBALS['phpgw']->accounts->get_type($participant))
{
case 'g':
if ($members = $acct->member(intval($participant)))
if ($members = $acct->member((int)$participant))
{
foreach($members as $member)
{
@ -2616,11 +2622,11 @@
$GLOBALS['phpgw']->browser->browser();
if($GLOBALS['phpgw']->browser->get_agent() == 'MOZILLA')
{
$time_width = (intval($this->bo->prefs['common']['time_format']) == 12?12:8);
$time_width = ((int)($this->bo->prefs['common']['time_format']) == 12?12:8);
}
else
{
$time_width = (intval($this->bo->prefs['common']['time_format']) == 12?10:7);
$time_width = ((int)($this->bo->prefs['common']['time_format']) == 12?10:7);
}
return 'A.minicalendar { color: #000000; font: x-small '.$this->theme['font'].' }'."\n"
@ -2665,7 +2671,7 @@
$rawdate = mktime(0,0,0,$month,$day,$year);
$rawdate_offset = $rawdate - $GLOBALS['phpgw']->datetime->tz_offset;
$nextday = mktime(0,0,0,$month,$day + 1,$year) - $GLOBALS['phpgw']->datetime->tz_offset;
if (intval($GLOBALS['phpgw']->common->show_date($starttime,'Hi')) && $starttime == $endtime)
if ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') && $starttime == $endtime)
{
$time = $GLOBALS['phpgw']->common->show_date($starttime,$this->bo->users_timeformat);
}
@ -2673,7 +2679,7 @@
{
$time = '[ '.lang('All Day').' ]';
}
elseif (intval($GLOBALS['phpgw']->common->show_date($starttime,'Hi')) || $starttime != $endtime)
elseif ((int)$GLOBALS['phpgw']->common->show_date($starttime,'Hi') || $starttime != $endtime)
{
if($starttime < $rawdate_offset && $event['recur_type'] == MCAL_RECUR_NONE)
{
@ -3030,9 +3036,9 @@
$daily = $this->set_week_array($startdate - $GLOBALS['phpgw']->datetime->tz_offset,$cellcolor,$weekly);
foreach($daily as $date => $day_params)
{
$year = intval(substr($date,0,4));
$month = intval(substr($date,4,2));
$day = intval(substr($date,6,2));
$year = (int)substr($date,0,4);
$month = (int)substr($date,4,2);
$day = (int)substr($date,6,2);
$var = Array(
'column_data' => '',
'extra' => ''
@ -3132,8 +3138,8 @@
)
);
$monthstart = intval(date('Ymd',mktime(0,0,0,$month ,1,$year)));
$monthend = intval(date('Ymd',mktime(0,0,0,$month + 1,0,$year)));
$monthstart = (int)(date('Ymd',mktime(0,0,0,$month ,1,$year)));
$monthend = (int)(date('Ymd',mktime(0,0,0,$month + 1,0,$year)));
$start = $GLOBALS['phpgw']->datetime->get_weekday_start($year, $month, 1);
@ -3154,7 +3160,6 @@
$p->set_block('week','m_w_table','m_w_table');
$p->set_block('week','event','event');
$var = Array(
'cols' => 7,
'day_events'=> $this->week_header($month,$year,False)
@ -3163,7 +3168,7 @@
$cellcolor = $this->theme['row_on'];
for ($i=intval($start + $GLOBALS['phpgw']->datetime->tz_offset);intval(date('Ymd',$i)) <= $monthend;$i += 604800)
for($i = (int)($start + $GLOBALS['phpgw']->datetime->tz_offset);(int)(date('Ymd',$i)) <= $monthend;$i += 604800)
{
$cellcolor = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($cellcolor);
$var = Array(
@ -3328,7 +3333,7 @@
{
$time = $day_end;
}
$slot = intval(($time - $day_start) / $interval);
$slot = (int)(($time - $day_start) / $interval);
return $slot < 0 ? 0 : 1+$slot;
}
@ -3483,7 +3488,7 @@
}
else
{
$rowspan = intval($row_span[$slot]);
$rowspan = (int)$row_span[$slot];
if ($rowspan > 1)
{
$p->set_var('extras',' rowspan="'.$rowspan.'"');
@ -3758,12 +3763,12 @@
@reset($temp_cats);
while(list($key,$value) = each($temp_cats))
{
$check_cats[] = intval($value);
$check_cats[] = (int)$value;
}
}
elseif($event['category'])
{
$check_cats[] = intval($event['category']);
$check_cats[] = (int)$event['category'];
}
else
{
@ -3787,9 +3792,9 @@
'field' => lang('Start Date'),
/*
'data' => $GLOBALS['phpgw']->common->dateformatorder(
$sb->getYears('start[year]',intval($GLOBALS['phpgw']->common->show_date($start,'Y'))),
$sb->getMonthText('start[month]',intval($GLOBALS['phpgw']->common->show_date($start,'n'))),
$sb->getDays('start[mday]',intval($GLOBALS['phpgw']->common->show_date($start,'d')))
$sb->getYears('start[year]',(int)$GLOBALS['phpgw']->common->show_date($start,'Y')),
$sb->getMonthText('start[month]',(int)$GLOBALS['phpgw']->common->show_date($start,'n')),
$sb->getDays('start[mday]',(int)$GLOBALS['phpgw']->common->show_date($start,'d'))
)
*/
'data' => $jscal->input('start[str]',$start)
@ -3812,9 +3817,9 @@
'field' => lang('End Date'),
/*
'data' => $GLOBALS['phpgw']->common->dateformatorder(
$sb->getYears('end[year]',intval($GLOBALS['phpgw']->common->show_date($end,'Y'))),
$sb->getMonthText('end[month]',intval($GLOBALS['phpgw']->common->show_date($end,'n'))),
$sb->getDays('end[mday]',intval($GLOBALS['phpgw']->common->show_date($end,'d')))
$sb->getYears('end[year]',(int)$GLOBALS['phpgw']->common->show_date($end,'Y')),
$sb->getMonthText('end[month]',(int)$GLOBALS['phpgw']->common->show_date($end,'n')),
$sb->getDays('end[mday]',(int)$GLOBALS['phpgw']->common->show_date($end,'d'))
)
*/
'data' => $jscal->input('end[str]',$end)
@ -3859,7 +3864,7 @@
case 'popup':
while (is_array($event['participants']) && list($id) = each($event['participants']))
{
if($id != intval($event['owner']))
if($id != (int)$event['owner'])
{
$str .= '<option value="' . $id.$event['participants'][$id] . '"'.($event['participants'][$id]?' selected':'').'>('.$GLOBALS['phpgw']->accounts->get_type($id)
.') ' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '</option>' . "\n";
@ -3875,7 +3880,7 @@
default:
foreach($users as $id => $user_array)
{
if($id != intval($event['owner']))
if($id != (int)$event['owner'])
{
$str .= ' <option value="' . $id.$event['participants'][$id] . '"'.($event['participants'][$id]?' selected':'').'>('.$user_array['type'].') '.$user_array['name'].'</option>'."\n";
}
@ -3971,9 +3976,9 @@
// just get the first one see above!!!
list($key,$alarm) = @each($event['alarm']);
$diff = $start - $alarm['time'];
$days = intval($diff / (24*3600));
$hours = intval(($diff - ($days * 24 * 3600))/3600);
$min = intval(($diff - ($days * 24 * 3600) - ($hours * 3600))/60);
$days = (int)($diff / (24*3600));
$hours = (int)(($diff - ($days * 24 * 3600))/3600);
$min = (int)(($diff - ($days * 24 * 3600) - ($hours * 3600))/60);
}
// days
@ -4032,9 +4037,9 @@
'data' => '<input type="checkbox" name="cal[rpt_use_end]" value="y"'.$checked.'>'.lang('Use End Date').' '.
/*
$GLOBALS['phpgw']->common->dateformatorder(
$sb->getYears('recur_enddate[year]',intval($GLOBALS['phpgw']->common->show_date($recur_end,'Y'))),
$sb->getMonthText('recur_enddate[month]',intval($GLOBALS['phpgw']->common->show_date($recur_end,'n'))),
$sb->getDays('recur_enddate[mday]',intval($GLOBALS['phpgw']->common->show_date($recur_end,'d')))
$sb->getYears('recur_enddate[year]',(int)$GLOBALS['phpgw']->common->show_date($recur_end,'Y')),
$sb->getMonthText('recur_enddate[month]',(int)$GLOBALS['phpgw']->common->show_date($recur_end,'n')),
$sb->getDays('recur_enddate[mday]',(int)$GLOBALS['phpgw']->common->show_date($recur_end,'d'))
)
*/
$jscal->input('recur_enddate[str]',$recur_end)
@ -4247,7 +4252,7 @@
if ($control_data['action'] == lang('Add Contact'))
{
$id = $_POST['id_addr'];
if (isset($id) && intval($id) != 0)
if (isset($id) && (int)$id != 0)
{
list($contact) = $this->read_contact($id);
$participant[$id] = array();
@ -4349,7 +4354,7 @@
}
foreach($accounts as $id)
{
$id = intval($id);
$id = (int)$id;
if($id == $owner)
{
continue;

View File

@ -129,8 +129,8 @@
$ordered[$order] = array(
'field' => $field,
'name' => stripslashes($_POST['name'][$field]),
'length' => intval($_POST['length'][$field]),
'shown' => intval($_POST['shown'][$field]),
'length' => (int)$_POST['length'][$field],
'shown' => (int)$_POST['shown'][$field],
'title' => !!$_POST['title'][$field],
'disabled' => !!$_POST['disabled'][$field]
);
@ -158,8 +158,8 @@
$ordered[$order] = array(
'field' => '#'.$name,
'name' => $name,
'length' => intval($_POST['length']['***new***']),
'shown' => intval($_POST['shown']['***new***']),
'length' => (int)$_POST['length']['***new***'],
'shown' => (int)$_POST['shown']['***new***'],
'title' => !!$_POST['title']['***new***'],
'disabled' => !!$_POST['disabled']['***new***']
);

View File

@ -13,10 +13,10 @@
/* $Id$ */
global $pref;
$pref->change("calendar","weekstarts","Monday");
$pref->change("calendar","workdaystarts","9");
$pref->change("calendar","workdayends","17");
$pref->change("calendar","defaultcalendar","month.php");
$pref->change("calendar","defaultfilter","all");
$pref->change("calendar","mainscreen_showevents","Y");
$pref->change('calendar','weekstarts','Monday');
$pref->change('calendar','workdaystarts','9');
$pref->change('calendar','workdayends','17');
$pref->change('calendar','defaultcalendar','month.php');
$pref->change('calendar','defaultfilter',"all');
$pref->change('calendar','mainscreen_showevents','Y');
?>

View File

@ -12,16 +12,16 @@
/* $Id$ */
// Delete all records for a user
if(intval($GLOBALS['HTTP_POST_VARS']['new_owner'])==0)
if((int)$_POST['new_owner'] == 0)
{
ExecMethod('calendar.bocalendar.delete_calendar',intval($GLOBALS['HTTP_POST_VARS']['account_id']));
ExecMethod('calendar.bocalendar.delete_calendar',(int)$_POST['account_id']);
}
else
{
ExecMethod('calendar.bocalendar.change_owner',
Array(
'old_owner' => intval($GLOBALS['HTTP_POST_VARS']['account_id']),
'new_owner' => intval($GLOBALS['HTTP_POST_VARS']['new_owner'])
'old_owner' => (int)$_POST['account_id'],
'new_owner' => (int)$_POST['new_owner']
)
);
}

View File

@ -22,7 +22,7 @@
}
unset($d1);
$showevents = intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents']);
$showevents = (int)$GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents'];
if($showevents>0)
{
$GLOBALS['phpgw']->translation->add_app('calendar');

View File

@ -11,7 +11,7 @@
/* $Id$ */
$phpgw_flags = Array(
$GLOBALS['phpgw']_flags = Array(
'currentapp' => 'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
@ -20,82 +20,82 @@
'noappfooter' => True
);
$phpgw_info['flags'] = $phpgw_flags;
$GLOBALS['phpgw_info']['flags'] = $GLOBALS['phpgw']_flags;
include('../header.inc.php');
if ($submit)
{
$phpgw->preferences->read_repository();
$phpgw->preferences->add('calendar','weekdaystarts');
$phpgw->preferences->add('calendar','workdaystarts');
$phpgw->preferences->add('calendar','workdayends');
$phpgw->preferences->add('calendar','defaultcalendar');
$phpgw->preferences->add('calendar','defaultfilter');
$phpgw->preferences->add('calendar','interval');
$GLOBALS['phpgw']->preferences->read_repository();
$GLOBALS['phpgw']->preferences->add('calendar','weekdaystarts');
$GLOBALS['phpgw']->preferences->add('calendar','workdaystarts');
$GLOBALS['phpgw']->preferences->add('calendar','workdayends');
$GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar');
$GLOBALS['phpgw']->preferences->add('calendar','defaultfilter');
$GLOBALS['phpgw']->preferences->add('calendar','interval');
if ($mainscreen_showevents == True)
{
$phpgw->preferences->add('calendar','mainscreen_showevents');
$GLOBALS['phpgw']->preferences->add('calendar','mainscreen_showevents');
}
else
{
$phpgw->preferences->delete('calendar','mainscreen_showevents');
$GLOBALS['phpgw']->preferences->delete('calendar','mainscreen_showevents');
}
if ($send_updates == True)
{
$phpgw->preferences->add('calendar','send_updates');
$GLOBALS['phpgw']->preferences->add('calendar','send_updates');
}
else
{
$phpgw->preferences->delete('calendar','send_updates');
$GLOBALS['phpgw']->preferences->delete('calendar','send_updates');
}
if ($display_status == True)
{
$phpgw->preferences->add('calendar','display_status');
$GLOBALS['phpgw']->preferences->add('calendar','display_status');
}
else
{
$phpgw->preferences->delete('calendar','display_status');
$GLOBALS['phpgw']->preferences->delete('calendar','display_status');
}
if ($default_private == True)
{
$phpgw->preferences->add('calendar','default_private');
$GLOBALS['phpgw']->preferences->add('calendar','default_private');
}
else
{
$phpgw->preferences->delete('calendar','default_private');
$GLOBALS['phpgw']->preferences->delete('calendar','default_private');
}
if ($display_minicals == True)
{
$phpgw->preferences->add('calendar','display_minicals');
$GLOBALS['phpgw']->preferences->add('calendar','display_minicals');
}
else
{
$phpgw->preferences->delete('calendar','display_minicals');
$GLOBALS['phpgw']->preferences->delete('calendar','display_minicals');
}
if ($print_black_white == True)
{
$phpgw->preferences->add('calendar','print_black_white');
$GLOBALS['phpgw']->preferences->add('calendar','print_black_white');
}
else
{
$phpgw->preferences->delete('calendar','print_black_white');
$GLOBALS['phpgw']->preferences->delete('calendar','print_black_white');
}
$phpgw->preferences->save_repository(True);
$GLOBALS['phpgw']->preferences->save_repository(True);
Header('Location: '.$phpgw->link('/preferences/index.php'));
$phpgw->common->phpgw_exit();
Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
function display_item($field,$data)
{
global $phpgw, $p, $tr_color;
global $GLOBALS['phpgw'], $p, $tr_color;
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$var = Array(
'bg_color' => $tr_color,
'field' => $field,
@ -105,10 +105,10 @@
$p->parse('row','pref_list',True);
}
$phpgw->common->phpgw_header();
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
$p = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('calendar'));
$templates = Array(
'pref' => 'pref.tpl',
'pref_colspan' => 'pref_colspan.tpl',
@ -118,8 +118,8 @@
$var = Array(
'title' => lang('Calendar preferences'),
'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/preferences.php'),
'bg_color' => $phpgw_info['theme']['th_bg'],
'action_url' => $GLOBALS['phpgw']->link('/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/preferences.php'),
'bg_color' => $GLOBALS['phpgw_info']['theme']['th_bg'],
'submit_lang' => lang('submit')
);
@ -129,13 +129,13 @@
// if ($totalerrors)
// {
// echo '<p><center>' . $phpgw->common->error_list($errors) . '</center>';
// echo '<p><center>' . $GLOBALS['phpgw']->common->error_list($errors) . '</center>';
// }
$str = '<input type="checkbox" name="mainscreen_showevents" value="True"'.($phpgw_info['user']['preferences']['calendar']['mainscreen_showevents'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['mainscreen_showevents'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="mainscreen_showevents" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents'] == True?' checked':'').'>';
display_item(lang('show day view on main screen'),$str);
$t_weekday[$phpgw_info['user']['preferences']['calendar']['weekdaystarts']] = ' selected';
$t_weekday[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['weekdaystarts']] = ' selected';
$str = '<select name="weekdaystarts">'
. '<option value="Monday"'.$t_weekday['Monday'].'>'.lang('Monday').'</option>'
. '<option value="Sunday"'.$t_weekday['Sunday'].'>'.lang('Sunday').'</option>'
@ -144,28 +144,28 @@
. '</select>';
display_item(lang('weekday starts on'),$str);
$t_workdaystarts[$phpgw_info['user']['preferences']['calendar']['workdaystarts']] = ' selected';
$t_workdaystarts[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['workdaystarts']] = ' selected';
$str = '<select name="workdaystarts">';
for ($i=0; $i<24; $i++)
{
$str .= '<option value="'.$i.'"'.$t_workdaystarts[$i].'>'
. $phpgw->common->formattime($i,'00') . '</option>';
. $GLOBALS['phpgw']->common->formattime($i,'00') . '</option>';
}
$str .= '</select>';
display_item(lang('work day starts on'),$str);
$t_workdayends[$phpgw_info['user']['preferences']['calendar']['workdayends']] = ' selected';
$t_workdayends[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['workdayends']] = ' selected';
$str = '<select name="workdayends">';
for ($i=0; $i<24; $i++)
{
$str .= '<option value="'.$i.'"'.$t_workdayends[$i].'>'
. $phpgw->common->formattime($i,'00') . '</option>';
. $GLOBALS['phpgw']->common->formattime($i,'00') . '</option>';
}
$str .= '</select>';
display_item(lang('work day ends on'),$str);
$selected[$phpgw_info['user']['preferences']['calendar']['defaultcalendar']] = ' selected';
if (!isset($phpgw_info['user']['preferences']['calendar']['defaultcalendar']))
$selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']] = ' selected';
if (!isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']))
{
$selected['month.php'] = ' selected';
}
@ -179,8 +179,8 @@
$selected = array();
$selected[$phpgw_info['user']['preferences']['calendar']['defaultfilter']] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['defaultfilter']) || $phpgw_info['user']['preferences']['calendar']['defaultfilter'] == 'private')
$selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']] = ' selected';
if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']) || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter'] == 'private')
{
$selected['private'] = ' selected';
}
@ -196,8 +196,8 @@
display_item(lang('Default calendar filter'),$str);
$selected = array();
$selected[intval($phpgw_info['user']['preferences']['calendar']['interval'])] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['interval']))
$selected[intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval'])] = ' selected';
if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval']))
{
$selected[60] = ' selected';
}
@ -219,21 +219,21 @@
$str .= '</select>';
display_item(lang('Display interval in Day View'),$str);
$str = '<input type="checkbox" name="send_updates" value="True"'.($phpgw_info['user']['preferences']['calendar']['send_updates'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['send_updates'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="send_updates" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['send_updates'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['send_updates'] == True?' checked':'').'>';
display_item(lang('Send/receive updates via email'),$str);
$str = '<input type="checkbox" name="display_status" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_status'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_status'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="display_status" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['display_status'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['display_status'] == True?' checked':'').'>';
display_item(lang('Display status of events'),$str);
$str = '<input type="checkbox" name="default_private" value="True"'.($phpgw_info['user']['preferences']['calendar']['default_private'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['default_private'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="default_private" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['default_private'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['default_private'] == True?' checked':'').'>';
display_item(lang('When creating new events default set to private'),$str);
$str = '<input type="checkbox" name="display_minicals" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="display_minicals" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['display_minicals'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['display_minicals'] == True?' checked':'').'>';
display_item(lang('Display mini calendars when printing'),$str);
$str = '<input type="checkbox" name="print_black_white" value="True"'.($phpgw_info['user']['preferences']['calendar']['print_black_white'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['print_black_white'] == True?' checked':'').'>';
$str = '<input type="checkbox" name="print_black_white" value="True"'.($GLOBALS['phpgw_info']['user']['preferences']['calendar']['print_black_white'] == 'Y' || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['print_black_white'] == True?' checked':'').'>';
display_item(lang('Print calendars in black & white'),$str);
$p->pparse('out','pref');
$phpgw->common->phpgw_footer();
$GLOBALS['phpgw']->common->phpgw_footer();
?>