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

@ -62,26 +62,32 @@
$CPre = '|['; $CPreReg = '\|\['; // |{csv-fieldname} is expanded to the value of the csv-field $CPre = '|['; $CPreReg = '\|\['; // |{csv-fieldname} is expanded to the value of the csv-field
$CPos = ']'; $CPosReg = '\]'; // if used together with @ (replacement is eval-ed) value gets autom. quoted $CPos = ']'; $CPosReg = '\]'; // if used together with @ (replacement is eval-ed) value gets autom. quoted
function addr_id( $n_family,$n_given,$org_name ) function addr_id( $n_family,$n_given,$org_name )
{ // find in Addressbook, at least n_family AND (n_given OR org_name) have to match { // find in Addressbook, at least n_family AND (n_given OR org_name) have to match
$contacts = createobject('phpgwapi.contacts'); $contacts = createobject('phpgwapi.contacts');
$addrs = $contacts->read( 0,0,array('id'),'',"n_family=$n_family,n_given=$n_given,org_name=$org_name" ); $addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,n_given=$n_given,org_name=$org_name");
if (!count($addrs)) 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,n_given=$n_given");
$addrs = $contacts->read( 0,0,array('id'),'',"n_family=$n_family,org_name=$org_name" ); }
if(!count($addrs))
{
$addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,org_name=$org_name");
}
if (count($addrs)) if (count($addrs))
{
return $addrs[0]['id']; return $addrs[0]['id'];
}
return False; return False;
} }
$cat2id = array( ); $cat2id = array( );
function cat_id($cats) function cat_id($cats)
{ {
if (!$cats) if (!$cats)
{ {
return ''; return '';
@ -119,7 +125,7 @@ function cat_id($cats)
$id_str = ",$id_str,"; $id_str = ",$id_str,";
} }
return $id_str; return $id_str;
} }
if (!is_object($GLOBALS['phpgw']->html)) if (!is_object($GLOBALS['phpgw']->html))
{ {

View File

@ -36,7 +36,7 @@
function boalarm() 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) if($cal_id)
{ {
$this->cal_id = $cal_id; $this->cal_id = $cal_id;
@ -71,7 +71,7 @@
function read_entry($cal_id) 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; return -1;
} }
$alarm['enabled'] = intval(!$alarm['enabled']); $alarm['enabled'] = (int)(!$alarm['enabled']);
if ($this->so->save_alarm($alarm['cal_id'],$alarm)) if ($this->so->save_alarm($alarm['cal_id'],$alarm))
{ {
++$enabled; ++$enabled;

View File

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

View File

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

View File

@ -12,80 +12,78 @@
/* $Id$ */ /* $Id$ */
define('FOLD_LENGTH',75); define('FOLD_LENGTH',75);
define('VEVENT',1); define('VEVENT',1);
define('VTODO',2); define('VTODO',2);
define('NONE',0); define('NONE',0);
define('CHAIR',1); define('CHAIR',1);
define('REQ_PARTICIPANT',2); define('REQ_PARTICIPANT',2);
define('OPT_PARTICIPANT',3); define('OPT_PARTICIPANT',3);
define('NON_PARTICIPANT',4); define('NON_PARTICIPANT',4);
define('INDIVIDUAL',1); define('INDIVIDUAL',1);
define('GROUP',2); define('GROUP',2);
define('RESOURCE',4); define('RESOURCE',4);
define('ROOM',8); define('ROOM',8);
define('UNKNOWN',16); define('UNKNOWN',16);
define('NEEDS_ACTION',0); define('NEEDS_ACTION',0);
define('ACCEPTED',1); define('ACCEPTED',1);
define('DECLINED',2); define('DECLINED',2);
define('TENTATIVE',3); define('TENTATIVE',3);
define('DELEGATED',4); define('DELEGATED',4);
define('COMPLETED',5); define('COMPLETED',5);
define('IN_PROCESS',6); define('IN_PROCESS',6);
/* /*
* Class * Class
*/ */
define('PRIVATE',0); define('PRIVATE',0);
define('PUBLIC',1); define('PUBLIC',1);
define('CONFIDENTIAL',3); define('CONFIDENTIAL',3);
/* /*
* Transparency * Transparency
*/ */
define('TRANSPARENT',0); define('TRANSPARENT',0);
define('OPAQUE',1); define('OPAQUE',1);
/* /*
* Frequency * Frequency
*/ */
define('SECONDLY',1); define('SECONDLY',1);
define('MINUTELY',2); define('MINUTELY',2);
define('HOURLY',3); define('HOURLY',3);
define('DAILY',4); define('DAILY',4);
define('WEEKLY',5); define('WEEKLY',5);
define('MONTHLY',6); define('MONTHLY',6);
define('YEARLY',7); define('YEARLY',7);
define('FREE',0); define('FREE',0);
define('BUSY',1); define('BUSY',1);
define('BUSY_UNAVAILABLE',2); define('BUSY_UNAVAILABLE',2);
define('BUSY_TENTATIVE',3); define('BUSY_TENTATIVE',3);
define('THISANDPRIOR',0); define('THISANDPRIOR',0);
define('THISANDFUTURE',1); define('THISANDFUTURE',1);
define('START',0); define('START',0);
define('END',1); define('END',1);
define('_8BIT',0); define('_8BIT',0);
define('_BASE64',1); define('_BASE64',1);
define('OTHER',99); define('OTHER',99);
class boicalendar
{
class boicalendar
{
var $public_functions = array( var $public_functions = array(
'import' => True, 'import' => True,
'export' => True 'export' => True
); );
var $ical; var $ical;
var $line = 0; var $line = 0;
var $event = Array(); var $event = Array();
@ -967,7 +965,7 @@ class boicalendar
'dtstart' => True 'dtstart' => True
) )
), ),
'enocding' => Array( 'encoding' => Array( // was enocding ???
'type' => 'function', 'type' => 'function',
'function' => 'switch_encoding', 'function' => 'switch_encoding',
'quoted' => False, 'quoted' => False,
@ -1389,7 +1387,7 @@ class boicalendar
function parse_geo(&$event,$value) function parse_geo(&$event,$value)
{ {
// $return_value = $this->explode_param($value,True); // $return_value = $this->explode_param($value,True);
if(count($return_value) == 2) if(count($return_value) == 2)
{ {
$event['lat'] = $return_value[0]; $event['lat'] = $return_value[0];
@ -1506,7 +1504,7 @@ class boicalendar
$this->set_var($event,$name,$value); $this->set_var($event,$name,$value);
break; break;
case 'integer': case 'integer':
$this->set_var($event,$name,intval($value)); $this->set_var($event,$name,(int)$value);
break; break;
case 'value': case 'value':
if(@$this->property[$majortype]['type'] == 'date-time') if(@$this->property[$majortype]['type'] == 'date-time')
@ -1554,7 +1552,6 @@ class boicalendar
} }
} }
/* /*
* Build-Card Functions * Build-Card Functions
*/ */
@ -1913,7 +1910,7 @@ class boicalendar
} }
elseif(is_int($var)) elseif(is_int($var))
{ {
switch(intval($var)) switch((int)$var)
{ {
case PRIVATE: case PRIVATE:
return 'PRIVATE'; return 'PRIVATE';
@ -1999,14 +1996,14 @@ class boicalendar
$pos = explode(':',$var); $pos = explode(':',$var);
$var = $pos[1]; $var = $pos[1];
} }
$this->set_var($dtime,'year',intval(substr($var,0,4))); $this->set_var($dtime,'year',(int)(substr($var,0,4)));
$this->set_var($dtime,'month',intval(substr($var,4,2))); $this->set_var($dtime,'month',(int)(substr($var,4,2)));
$this->set_var($dtime,'mday',intval(substr($var,6,2))); $this->set_var($dtime,'mday',(int)(substr($var,6,2)));
if(substr($var,8,1) == 'T') if(substr($var,8,1) == 'T')
{ {
$this->set_var($dtime,'hour',intval(substr($var,9,2))); $this->set_var($dtime,'hour',(int)(substr($var,9,2)));
$this->set_var($dtime,'min',intval(substr($var,11,2))); $this->set_var($dtime,'min',(int)(substr($var,11,2)));
$this->set_var($dtime,'sec',intval(substr($var,13,2))); $this->set_var($dtime,'sec',(int)(substr($var,13,2)));
if(strlen($var) > 14) if(strlen($var) > 14)
{ {
if(substr($var,14,1) != 'Z') if(substr($var,14,1) != 'Z')
@ -2034,20 +2031,20 @@ class boicalendar
* *
* The implementor will need to consider how to convert that time to UTC. * The implementor will need to consider how to convert that time to UTC.
*/ */
// if($this->api) // if($this->api)
// { // {
// $dtime['hour'] -= $GLOBALS['phpgw_info']['users']['common']['tz_offset']; // $dtime['hour'] -= $GLOBALS['phpgw_info']['users']['common']['tz_offset'];
// if($dtime['hour'] < 0) // if($dtime['hour'] < 0)
// { // {
// $dtime['mday'] -= 1; // $dtime['mday'] -= 1;
// $dtime['hour'] = 24 - $dtime['hour']; // $dtime['hour'] = 24 - $dtime['hour'];
// } // }
// elseif($dtime['hour'] >= 24) // elseif($dtime['hour'] >= 24)
// { // {
// $dtime['mday'] += 1; // $dtime['mday'] += 1;
// $dtime['hour'] = $dtime['hour'] - 24; // $dtime['hour'] = $dtime['hour'] - 24;
// } // }
// } // }
} }
} }
else else
@ -2302,7 +2299,7 @@ class boicalendar
} }
elseif(is_int($var)) elseif(is_int($var))
{ {
switch(intval($var)) switch((int)$var)
{ {
case 0: // NEEDS_ACTION: case 0: // NEEDS_ACTION:
return 'NEEDS-ACTION'; return 'NEEDS-ACTION';
@ -2556,7 +2553,6 @@ class boicalendar
function parse($ical_text) function parse($ical_text)
{ {
$begin_regexp = '^'; $begin_regexp = '^';
$semi_colon_regexp = '[\;\:]'; $semi_colon_regexp = '[\;\:]';
$colon_regexp = '[\:]'; $colon_regexp = '[\:]';
@ -2611,47 +2607,62 @@ class boicalendar
unset($dur); unset($dur);
// Split «DURATION» // 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 */ /* Datecode */
if( isset($_f_["day_raw"]) OR $_f_["day_raw"] ) if(isset($_f_['day_raw']) OR $_f_['day_raw'])
{ {
// Days // Days
if(ereg("D", $_f_["day_raw"])) // if(ereg('D', $_f_['day_raw']))
$dur["days"] = eregi_replace("([0-9]+)D(.*)", "\\1", $_f_["day_raw"]); if(strstr($_f_['day_raw'],'D'))
{
$dur['days'] = eregi_replace("([0-9]+)D(.*)", "\\1", $_f_['day_raw']);
}
// Weeks // Weeks
if(ereg("W", $_f_["day_raw"])) // if(ereg("W", $_f_["day_raw"]))
$dur["weeks"] = eregi_replace("([^|.*]+D)?([0-9]+)W", "\\2", $_f_["day_raw"]); if(strstr($_f_['day_raw'],'W'))
{
$dur['weeks'] = eregi_replace("([^|.*]+D)?([0-9]+)W", "\\2", $_f_['day_raw']);
}
} }
/* Timecode */ /* Timecode */
if( isset($_f_["time_raw"]) OR $_f_["time_raw"] ) if(isset($_f_['time_raw']) OR $_f_['time_raw'])
{ {
// Hours // Hours
if(ereg("H", $_f_["time_raw"])) // if(ereg("H", $_f_["time_raw"]))
$dur["hours"] = eregi_replace("([0-9]+)H(.*)", "\\1", $_f_["time_raw"]); if(strstr($_f_['time_raw'],'H'))
{
$dur['hours'] = eregi_replace("([0-9]+)H(.*)", "\\1", $_f_['time_raw']);
}
// Minutes // Minutes
/* If you find better, contact me very quickly :) */ /* If you find better, contact me very quickly :) */
if(ereg("M", $_f_["time_raw"]) ) // if(ereg("M", $_f_["time_raw"]))
$dur["minutes"] = eregi_replace("([^|.*]+H)?([0-9]+)M(.*)", "\\2", $_f_["time_raw"]); if(strstr($_f_['time_raw'],'M'))
{
$dur['minutes'] = eregi_replace("([^|.*]+H)?([0-9]+)M(.*)", "\\2", $_f_['time_raw']);
}
// Seconds // Seconds
/* Same comment :) */ /* Same comment :) */
if(ereg("S", $_f_["time_raw"]) ) // if(ereg("S", $_f_["time_raw"]) )
$dur["seconds"] = eregi_replace("([^|.*]+M)?([0-9]+)S(.*)", "\\2", $_f_["time_raw"]); if(strstr($_f_['time_raw'],'S'))
{
$dur['seconds'] = eregi_replace("([^|.*]+M)?([0-9]+)S(.*)", "\\2", $_f_['time_raw']);
}
} }
$dur["raw"] = Array( $dur['raw'] = Array(
"timecode" => $_f_["time_raw"], 'timecode' => $_f_['time_raw'],
"datecode" => $_f_["day_raw"], 'datecode' => $_f_['day_raw'],
"all" => $value ); 'all' => $value
);
// Add new parameters in Event // Add new parameters in Event
$this->set_var($event, $majortype, $dur); $this->set_var($event, $majortype, $dur);
} }
if($majortype == 'begin') if($majortype == 'begin')
{ {
$tmode = $mode; $tmode = $mode;
@ -2778,11 +2789,11 @@ class boicalendar
case 'integer': case 'integer':
if($multiples) if($multiples)
{ {
$event[$majortype][] = intval($value); $event[$majortype][] = (int)$value;
} }
else else
{ {
$this->set_var($event,$majortype,intval($value)); $this->set_var($event,$majortype,(int)$value);
} }
break; break;
case 'float': case 'float':
@ -2790,7 +2801,7 @@ class boicalendar
$this->parse_geo($event->$majortype,$value); $this->parse_geo($event->$majortype,$value);
break; break;
case 'utc-offset': case 'utc-offset':
$this->set_var($event,$majortype,intval($value)); $this->set_var($event,$majortype,(int)$value);
break; break;
case 'uri': case 'uri':
$new_var = Array(); $new_var = Array();
@ -2928,7 +2939,7 @@ class boicalendar
{ {
if($this->is_owner($ical['attendee'][$j])) 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); @reset($date_array);
while(list($key,$var) = each($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']); $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 // recur_enddate
if(isset($ical['event'][$i]['rrule']['until'])) if(isset($ical['event'][$i]['rrule']['until']))
{ {
$recur_enddate['year'] = intval($ical['event'][$i]['rrule']['until']['year']); $recur_enddate['year'] = (int)($ical['event'][$i]['rrule']['until']['year']);
$recur_enddate['month'] = intval($ical['event'][$i]['rrule']['until']['month']); $recur_enddate['month'] = (int)($ical['event'][$i]['rrule']['until']['month']);
$recur_enddate['mday'] = intval($ical['event'][$i]['rrule']['until']['mday']); $recur_enddate['mday'] = (int)($ical['event'][$i]['rrule']['until']['mday']);
} }
elseif( isset($ical['event'][$i]['duration']) ) elseif( isset($ical['event'][$i]['duration']) )
{ {
@ -3176,7 +3187,6 @@ class boicalendar
$ical['event'][$i]['dtstart']['year'] $ical['event'][$i]['dtstart']['year']
); );
/* -- Fixbug -- /* -- Fixbug --
* if "DURATION" has 1 day (for example). * if "DURATION" has 1 day (for example).
* Event takes places between the first date * Event takes places between the first date
@ -3283,7 +3293,7 @@ class boicalendar
} }
else else
{ {
$interval = intval($ical['event'][$i]['rrule']['interval']); $interval = (int)$ical['event'][$i]['rrule']['interval'];
} }
// recur_type // recur_type
switch($ical['event'][$i]['rrule']['freq']) 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']))) 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('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 else
{ {
@ -3407,7 +3417,7 @@ class boicalendar
// use system's date info for caluculating local timezone's offset in minutes // 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 $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) if ($offset > 0)
{ {
$event['start']['min'] -= $offset; $event['start']['min'] -= $offset;
@ -3416,7 +3426,7 @@ class boicalendar
} }
$ical_event['priority'] = $event['priority']; $ical_event['priority'] = $event['priority'];
$ical_event['class'] = intval($event['public']); $ical_event['class'] = (int)$event['public'];
$dtstart_mktime = $so_event->maketime($event['start']); $dtstart_mktime = $so_event->maketime($event['start']);
$this->parse_value($ical_event,'dtstart',date('Ymd\THis\Z',$dtstart_mktime),'vevent'); $this->parse_value($ical_event,'dtstart',date('Ymd\THis\Z',$dtstart_mktime),'vevent');
$dtend_mktime = $so_event->maketime($event['end']); $dtend_mktime = $so_event->maketime($event['end']);
@ -3458,7 +3468,7 @@ class boicalendar
$GLOBALS['phpgw']->accounts->get_account_name($part,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($part,$lid,$fname,$lname);
$name = $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); $mail_prefs = $GLOBALS['phpgw']->preferences->create_email_preferences($part);
$mailto = $mail_prefs['email']['address']; $mailto = $mail_prefs['email']['address'];

View File

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

View File

@ -12,27 +12,25 @@
/* $Id$ */ /* $Id$ */
if (isset($phpgw_info['flags']['included_classes']['calendar_']) && if (isset($GLOBALS['phpgw_info']['flags']['included_classes']['calendar_']) &&
$phpgw_info['flags']['included_classes']['calendar_'] == True) $GLOBALS['phpgw_info']['flags']['included_classes']['calendar_'] == True)
{ {
return; return;
} }
$phpgw_info['flags']['included_classes']['calendar_'] = True; $GLOBALS['phpgw_info']['flags']['included_classes']['calendar_'] = True;
class calendar_ extends calendar__ class calendar_ extends calendar__
{ {
function open($calendar='',$user='',$passwd='',$options='') function open($calendar='',$user='',$passwd='',$options='')
{ {
global $phpgw, $phpgw_info;
if($user=='') if($user=='')
{ {
$user = $phpgw_info['user']['account_lid']; $user = $GLOBALS['phpgw_info']['user']['account_lid'];
} }
elseif(is_int($user)) elseif(is_int($user))
{ {
$this->user = $phpgw->accounts->id2name($user); $this->user = $GLOBALS['phpgw']->accounts->id2name($user);
} }
elseif(is_string($user)) elseif(is_string($user))
{ {
@ -40,25 +38,23 @@ class calendar_ extends calendar__
} }
if($options != '') 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 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='') function popen($calendar='',$user='',$passwd='',$options='')
{ {
global $phpgw, $phpgw_info;
if($user=='') if($user=='')
{ {
$this->user = $phpgw_info['user']['account_lid']; $this->user = $GLOBALS['phpgw_info']['user']['account_lid'];
} }
elseif(is_int($user)) elseif(is_int($user))
{ {
$this->user = $phpgw->accounts->id2name($user); $this->user = $GLOBALS['phpgw']->accounts->id2name($user);
} }
elseif(is_string($user)) elseif(is_string($user))
{ {
@ -66,11 +62,11 @@ class calendar_ extends calendar__
} }
if($options != '') 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 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);
} }
} }
@ -339,7 +335,7 @@ class calendar_ extends calendar__
ACCEPTED => 'A' ACCEPTED => 'A'
); );
$this->add_attribute('status['.$owner.']',$status_code_short[$status]); $this->add_attribute('status['.$owner.']',$status_code_short[$status]);
// $this->stream->query("UPDATE calendar_entry_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__); // $this->stream->query("UPDATE calendar_entry_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__);
return True; return True;
} }
} }

View File

@ -13,8 +13,8 @@
/* $Id$ */ /* $Id$ */
class holidaycalc { class holidaycalc
{
function calculate_date($holiday, &$holidays, $year, &$i) function calculate_date($holiday, &$holidays, $year, &$i)
{ {
static $cached_month; static $cached_month;
@ -149,5 +149,5 @@ class holidaycalc {
return $date; return $date;
} }
} }
?> ?>

View File

@ -13,11 +13,11 @@
/* $Id$ */ /* $Id$ */
class holidaycalc { class holidaycalc
{
function calculate_date($holiday, &$holidays, $year, &$i) function calculate_date($holiday, &$holidays, $year, &$i)
{ {
// if($holiday['day'] == 0 && $holiday['dow'] != 0 && $holiday['occurence'] != 0) // if($holiday['day'] == 0 && $holiday['dow'] != 0 && $holiday['occurence'] != 0)
if($holiday['day'] == 0 && $holiday['occurence'] != 0) if($holiday['day'] == 0 && $holiday['occurence'] != 0)
{ {
if($holiday['occurence'] != 99) if($holiday['occurence'] != 99)
@ -81,5 +81,5 @@ class holidaycalc {
return $date; return $date;
} }
} }
?> ?>

View File

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

View File

@ -14,17 +14,17 @@
/* $Id$ */ /* $Id$ */
if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar__']) if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar__'])
{ {
return; return;
} }
$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar__'] = True; $GLOBALS['phpgw_info']['flags']['included_classes']['socalendar__'] = True;
/* include(PHPGW_SERVER_ROOT.'/calendar/setup/setup.inc.php'); */ /* include(PHPGW_SERVER_ROOT.'/calendar/setup/setup.inc.php'); */
if(extension_loaded('mcal') == False) if(extension_loaded('mcal') == False)
{ {
define('MCAL_RECUR_NONE',0); define('MCAL_RECUR_NONE',0);
define('MCAL_RECUR_DAILY',1); define('MCAL_RECUR_DAILY',1);
define('MCAL_RECUR_WEEKLY',2); define('MCAL_RECUR_WEEKLY',2);
@ -43,29 +43,29 @@ if(extension_loaded('mcal') == False)
define('MCAL_M_WEEKDAYS',62); define('MCAL_M_WEEKDAYS',62);
define('MCAL_M_WEEKEND',65); define('MCAL_M_WEEKEND',65);
define('MCAL_M_ALLDAYS',127); define('MCAL_M_ALLDAYS',127);
} }
define('MSG_DELETED',0); define('MSG_DELETED',0);
define('MSG_MODIFIED',1); define('MSG_MODIFIED',1);
define('MSG_ADDED',2); define('MSG_ADDED',2);
define('MSG_REJECTED',3); define('MSG_REJECTED',3);
define('MSG_TENTATIVE',4); define('MSG_TENTATIVE',4);
define('MSG_ACCEPTED',5); define('MSG_ACCEPTED',5);
define('MSG_ALARM',6); define('MSG_ALARM',6);
define('REJECTED',0); define('REJECTED',0);
define('NO_RESPONSE',1); define('NO_RESPONSE',1);
define('TENTATIVE',2); define('TENTATIVE',2);
define('ACCEPTED',3); define('ACCEPTED',3);
class socalendar__ class socalendar__
{ {
var $event; var $event;
var $stream; var $stream;
var $user; var $user;
var $users_status; var $users_status;
var $debug = False; var $debug = False;
// var $debug = True; // var $debug = True;
function socalendar__() function socalendar__()
{ {
@ -84,7 +84,7 @@ class socalendar__
function event_init() function event_init()
{ {
$this->event = Array(); $this->event = Array();
$this->add_attribute('owner',intval($this->user)); $this->add_attribute('owner',(int)$this->user);
} }
function set_category($category='') function set_category($category='')
@ -104,12 +104,12 @@ class socalendar__
function set_date($element,$year,$month,$day=0,$hour=0,$min=0,$sec=0) 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,(int)$year,'year');
$this->add_attribute($element,intval($month),'month'); $this->add_attribute($element,(int)$month,'month');
$this->add_attribute($element,intval($day),'mday'); $this->add_attribute($element,(int)$day,'mday');
$this->add_attribute($element,intval($hour),'hour'); $this->add_attribute($element,(int)$hour,'hour');
$this->add_attribute($element,intval($min),'min'); $this->add_attribute($element,(int)$min,'min');
$this->add_attribute($element,intval($sec),'sec'); $this->add_attribute($element,(int)$sec,'sec');
$this->add_attribute($element,0,'alarm'); $this->add_attribute($element,0,'alarm');
} }
@ -125,7 +125,7 @@ class socalendar__
function set_alarm($alarm) function set_alarm($alarm)
{ {
$this->add_attribute('alarm',intval($alarm)); $this->add_attribute('alarm',(int)$alarm);
} }
function set_class($class) function set_class($class)
@ -135,7 +135,7 @@ class socalendar__
function set_common_recur($year=0,$month=0,$day=0,$interval=0) 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->set_date('recur_enddate',$year,$month,$day,0,0,0);
$this->add_attribute('recur_data',0); $this->add_attribute('recur_data',0);
} }
@ -148,32 +148,32 @@ class socalendar__
function set_recur_daily($year,$month,$day,$interval) 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); $this->add_attribute('recur_type',MCAL_RECUR_DAILY);
} }
function set_recur_weekly($year,$month,$day,$interval,$weekdays) 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_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) 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); $this->add_attribute('recur_type',MCAL_RECUR_MONTHLY_MDAY);
} }
function set_recur_monthly_wday($year,$month,$day,$interval) 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); $this->add_attribute('recur_type',MCAL_RECUR_MONTHLY_WDAY);
} }
function set_recur_yearly($year,$month,$day,$interval) 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); $this->add_attribute('recur_type',MCAL_RECUR_YEARLY);
} }
@ -197,4 +197,4 @@ class socalendar__
$this->event[$attribute] = $value; $this->event[$attribute] = $value;
} }
} }
} }

View File

@ -15,15 +15,15 @@
/* $Id$ */ /* $Id$ */
if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_']) if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_'])
{ {
return; return;
} }
$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_'] = True; $GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_'] = True;
class socalendar_ extends socalendar__ class socalendar_ extends socalendar__
{ {
var $deleted_events = Array(); var $deleted_events = Array();
var $cal_event; var $cal_event;
@ -44,7 +44,7 @@ class socalendar_ extends socalendar__
{ {
if($user=='') if($user=='')
{ {
// settype($user,'integer'); // settype($user,'integer');
$this->user = $GLOBALS['phpgw_info']['user']['account_id']; $this->user = $GLOBALS['phpgw_info']['user']['account_id'];
} }
elseif(is_int($user)) elseif(is_int($user))
@ -87,17 +87,17 @@ class socalendar_ extends socalendar__
function delete_calendar($calendar='') 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()) if($this->stream->num_rows())
{ {
while($this->stream->next_record()) 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->expunge();
} }
$this->stream->lock(array('phpgw_cal_user')); $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(); $this->stream->unlock();
return $calendar; return $calendar;
@ -113,7 +113,7 @@ class socalendar_ extends socalendar__
{ {
$alarms = array(); $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) foreach($jobs as $id => $job)
{ {
@ -165,7 +165,7 @@ class socalendar_ extends socalendar__
$n = count($alarms); $n = count($alarms);
do do
{ {
$id = 'cal:'.intval($cal_id).':'.$n; $id = 'cal:'.(int)$cal_id.':'.$n;
++$n; ++$n;
} }
while (@isset($alarms[$id])); while (@isset($alarms[$id]));
@ -216,7 +216,7 @@ class socalendar_ extends socalendar__
return False; 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'*/)); $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(); $this->stream->next_record();
// Load the calendar event data from the db into $event structure // 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 // 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('owner',(int)$this->stream->f('owner'));
$this->add_attribute('id',intval($this->stream->f('cal_id'))); $this->add_attribute('id',(int)$this->stream->f('cal_id'));
$this->set_class(intval($this->stream->f('is_public'))); $this->set_class((int)$this->stream->f('is_public'));
$this->set_category($this->stream->f('category')); $this->set_category($this->stream->f('category'));
$this->set_title(stripslashes($GLOBALS['phpgw']->strip_html($this->stream->f('title')))); $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->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('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('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 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... // But until then, do it this way...
//Legacy Support (New) //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']); $this->set_end($datetime['year'],$datetime['month'],$datetime['day'],$datetime['hour'],$datetime['minute'],$datetime['second']);
//Legacy Support //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') if($this->stream->f('cal_group') || $this->stream->f('groups') != 'NULL')
{ {
$groups = explode(',',$this->stream->f('groups')); $groups = explode(',',$this->stream->f('groups'));
@ -269,8 +269,8 @@ class socalendar_ extends socalendar__
{ {
$this->stream->next_record(); $this->stream->next_record();
$this->add_attribute('recur_type',intval($this->stream->f('recur_type'))); $this->add_attribute('recur_type',(int)$this->stream->f('recur_type'));
$this->add_attribute('recur_interval',intval($this->stream->f('recur_interval'))); $this->add_attribute('recur_interval',(int)$this->stream->f('recur_interval'));
$enddate = $this->stream->f('recur_enddate'); $enddate = $this->stream->f('recur_enddate');
if($enddate != 0 && $enddate != Null) if($enddate != 0 && $enddate != Null)
{ {
@ -317,11 +317,11 @@ class socalendar_ extends socalendar__
{ {
while($this->stream->next_record()) 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('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'));
} }
} }
@ -335,7 +335,7 @@ class socalendar_ extends socalendar__
} }
} }
/* OLD-ALARM /* OLD-ALARM
if($this->event['reference']) if($this->event['reference'])
{ {
// What is event['reference']??? // What is event['reference']???
@ -354,14 +354,14 @@ class socalendar_ extends socalendar__
while($this->stream->next_record()) while($this->stream->next_record())
{ {
$this->event['alarm'][] = Array( $this->event['alarm'][] = Array(
'id' => intval($this->stream->f('alarm_id')), 'id' => (int)$this->stream->f('alarm_id'),
'time' => intval($this->stream->f('cal_time')), 'time' => (int)$this->stream->f('cal_time'),
'text' => $this->stream->f('cal_text'), 'text' => $this->stream->f('cal_text'),
'enabled' => intval($this->stream->f('alarm_enabled')) 'enabled' => (int)$this->stream->f('alarm_enabled')
); );
} }
} }
*/ */
} }
else else
{ {
@ -407,7 +407,7 @@ class socalendar_ extends socalendar__
$member[] = $group_info['account_id']; $member[] = $group_info['account_id'];
} }
@reset($member); @reset($member);
// $user_where .= ','.implode(',',$member); // $user_where .= ','.implode(',',$member);
$user_where .= ')) '; $user_where .= ')) ';
if($this->debug) if($this->debug)
@ -420,7 +420,7 @@ class socalendar_ extends socalendar__
$enddate = ''; $enddate = '';
if($endYear != 0 && $endMonth != 0 && $endDay != 0) 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.') ) ' $endDate .= 'AND (phpgw_cal.edatetime <= '.$edatetime.') ) '
. 'OR ( (phpgw_cal.datetime <= '.$datetime.') ' . 'OR ( (phpgw_cal.datetime <= '.$datetime.') '
. 'AND (phpgw_cal.edatetime >= '.$edatetime.') ) ' . 'AND (phpgw_cal.edatetime >= '.$edatetime.') ) '
@ -474,7 +474,7 @@ class socalendar_ extends socalendar__
// Need more information for this function // Need more information for this function
function next_recurrence($weekstart,$next) function next_recurrence($weekstart,$next)
{ {
// return next_recurrence (int stream, int weekstart, array next); // return next_recurrence (int stream, int weekstart, array next);
} }
function expunge() function expunge()
@ -489,7 +489,7 @@ class socalendar_ extends socalendar__
'phpgw_cal_user', 'phpgw_cal_user',
'phpgw_cal_repeats', 'phpgw_cal_repeats',
'phpgw_cal_extra' 'phpgw_cal_extra'
// OLD-ALARM 'phpgw_cal_alarm' // OLD-ALARM 'phpgw_cal_alarm'
); );
$this->stream->lock($locks); $this->stream->lock($locks);
foreach($this->deleted_events as $cal_id) foreach($this->deleted_events as $cal_id)
@ -553,7 +553,7 @@ class socalendar_ extends socalendar__
while($this->stream->next_record()) while($this->stream->next_record())
{ {
$retval[] = intval($this->stream->f('cal_id')); $retval[] = (int)$this->stream->f('cal_id');
} }
if($this->debug) if($this->debug)
{ {
@ -569,7 +569,7 @@ class socalendar_ extends socalendar__
'phpgw_cal_user', 'phpgw_cal_user',
'phpgw_cal_repeats', 'phpgw_cal_repeats',
'phpgw_cal_extra' 'phpgw_cal_extra'
// OLD-ALARM 'phpgw_cal_alarm' // OLD-ALARM 'phpgw_cal_alarm'
); );
$this->stream->lock($locks); $this->stream->lock($locks);
if($event['id'] == 0) if($event['id'] == 0)
@ -601,7 +601,7 @@ class socalendar_ extends socalendar__
} }
$this->stream->query('INSERT INTO phpgw_cal(uid,title,owner,priority,is_public,category) ' $this->stream->query('INSERT INTO phpgw_cal(uid,title,owner,priority,is_public,category) '
. "values('".$event['uid']."','".$this->stream->db_addslashes($event['title']) . "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['category']."')",__LINE__,__FILE__);
$event['id'] = $this->stream->get_last_insert_id('phpgw_cal','cal_id'); $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 ' $sql = 'UPDATE phpgw_cal SET '
. 'owner='.intval($event['owner']).', ' . 'owner='.(int)$event['owner'].', '
. 'datetime='.intval($date).', ' . 'datetime='.(int)$date.', '
. 'mdatetime='.intval($today).', ' . 'mdatetime='.(int)$today.', '
. 'edatetime='.intval($enddate).', ' . 'edatetime='.(int)$enddate.', '
. 'priority='.intval($event['priority']).', ' . 'priority='.(int)$event['priority'].', '
. "category='".$this->stream->db_addslashes($event['category'])."', " . "category='".$this->stream->db_addslashes($event['category'])."', "
. "cal_type='".$this->stream->db_addslashes($type)."', " . "cal_type='".$this->stream->db_addslashes($type)."', "
. 'is_public='.intval($event['public']).', ' . 'is_public='.(int)$event['public'].', '
. "title='".$this->stream->db_addslashes($event['title'])."', " . "title='".$this->stream->db_addslashes($event['title'])."', "
. "description='".$this->stream->db_addslashes($event['description'])."', " . "description='".$this->stream->db_addslashes($event['description'])."', "
. "location='".$this->stream->db_addslashes($event['location'])."', " . "location='".$this->stream->db_addslashes($event['location'])."', "
. ($event['groups']?"groups='".(count($event['groups'])>1?implode(',',$event['groups']):','.$event['groups'][0].',')."', ":'') . ($event['groups']?"groups='".(count($event['groups'])>1?implode(',',$event['groups']):','.$event['groups'][0].',')."', ":'')
. 'reference='.intval($event['reference']).' ' . 'reference='.(int)$event['reference'].' '
. 'WHERE cal_id='.intval($event['id']); . 'WHERE cal_id='.(int)$event['id'];
$this->stream->query($sql,__LINE__,__FILE__); $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']); @reset($event['participants']);
while (list($key,$value) = @each($event['participants'])) while (list($key,$value) = @each($event['participants']))
{ {
if(intval($key) == $event['owner']) if((int)$key == $event['owner'])
{ {
$value = 'A'; $value = 'A';
} }
$this->stream->query('INSERT INTO phpgw_cal_user(cal_id,cal_login,cal_status) ' $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) if($event['recur_type'] != MCAL_RECUR_NONE)
@ -661,19 +661,19 @@ class socalendar_ extends socalendar__
$end = 0; $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(); $this->stream->next_record();
$num_rows = $this->stream->f(0); $num_rows = $this->stream->f(0);
if($num_rows == 0) if($num_rows == 0)
{ {
$this->stream->query('INSERT INTO phpgw_cal_repeats(cal_id,recur_type,recur_enddate,recur_data,recur_interval) ' $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 else
{ {
$this->stream->query('UPDATE phpgw_cal_repeats ' $this->stream->query('UPDATE phpgw_cal_repeats '
. 'SET recur_type='.$event['recur_type'].', ' . 'SET recur_type='.$event['recur_type'].', '
. 'recur_enddate='.intval($end).', ' . 'recur_enddate='.(int)$end.', '
. 'recur_data='.$event['recur_data'].', ' . 'recur_data='.$event['recur_data'].', '
. 'recur_interval='.$event['recur_interval'].', ' . '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]:''))."' " . "recur_exception='".(count($event['recur_exception'])>1?implode(',',$event['recur_exception']):(count($event['recur_exception'])==1?$event['recur_exception'][0]:''))."' "
@ -695,7 +695,7 @@ class socalendar_ extends socalendar__
. 'VALUES('.$event['id'].",'".addslashes(substr($name,1))."','".addslashes($value)."')",__LINE__,__FILE__); . 'VALUES('.$event['id'].",'".addslashes(substr($name,1))."','".addslashes($value)."')",__LINE__,__FILE__);
} }
} }
/* /*
$alarmcount = count($event['alarm']); $alarmcount = count($event['alarm']);
if ($alarmcount > 1) if ($alarmcount > 1)
{ {
@ -718,7 +718,7 @@ class socalendar_ extends socalendar__
$this->stream->next_record(); $this->stream->next_record();
$alarm['id'] = $this->stream->f(0); $alarm['id'] = $this->stream->f(0);
} }
*/ */
print_debug('Event Saved: ID #',$event['id']); print_debug('Event Saved: ID #',$event['id']);
$this->stream->unlock(); $this->stream->unlock();
@ -736,7 +736,7 @@ class socalendar_ extends socalendar__
function get_alarm($cal_id) function get_alarm($cal_id)
{ {
/* OLD-ALARM /* OLD-ALARM
$this->stream->query('SELECT cal_time, cal_text FROM phpgw_cal_alarm WHERE cal_id='.$id.' AND cal_owner='.$this->user,__LINE__,__FILE__); $this->stream->query('SELECT cal_time, cal_text FROM phpgw_cal_alarm WHERE cal_id='.$id.' AND cal_owner='.$this->user,__LINE__,__FILE__);
if($this->stream->num_rows()) if($this->stream->num_rows())
{ {
@ -751,7 +751,7 @@ class socalendar_ extends socalendar__
{ {
return False; return False;
} }
*/ */
$alarms = $this->read_alarms($cal_id); $alarms = $this->read_alarms($cal_id);
$ret = False; $ret = False;
@ -775,21 +775,21 @@ class socalendar_ extends socalendar__
); );
$this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__); $this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__);
/* OLD-ALARM /* OLD-ALARM
if ($status == 'R') if ($status == 'R')
{ {
$this->stream->query('UPDATE phpgw_cal_alarm set alarm_enabled=0 where cal_id='.$id.' and cal_owner='.$owner,__LINE__,__FILE__); $this->stream->query('UPDATE phpgw_cal_alarm set alarm_enabled=0 where cal_id='.$id.' and cal_owner='.$owner,__LINE__,__FILE__);
} }
*/ */
return True; return True;
} }
// End of ICal style support....... // End of ICal style support.......
function group_search($owner=0) function group_search($owner=0)
{ {
$owner = ($owner==$GLOBALS['phpgw_info']['user']['account_id']?0:$owner); $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) if (!$groups)
{ {
return ''; return '';
@ -817,7 +817,7 @@ class socalendar_ extends socalendar__
function date_to_epoch($d) 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) function list_dirty_events($lastmod=-1,$repeats=false)
@ -826,7 +826,7 @@ class socalendar_ extends socalendar__
{ {
return False; return False;
} }
$lastmod = intval($lastmod); $lastmod = (int) $lastmod;
$repeats = (bool) $repeats; $repeats = (bool) $repeats;
$user_where = " AND phpgw_cal_user.cal_login = $this->user"; $user_where = " AND phpgw_cal_user.cal_login = $this->user";
@ -838,7 +838,7 @@ class socalendar_ extends socalendar__
$member[] = $group_info['account_id']; $member[] = $group_info['account_id'];
} }
@reset($member); @reset($member);
// $user_where .= ','.implode(',',$member); // $user_where .= ','.implode(',',$member);
//$user_where .= ')) '; //$user_where .= ')) ';
if($this->debug) if($this->debug)
@ -859,7 +859,7 @@ class socalendar_ extends socalendar__
return $this->get_event_ids($repeats,$user_where.$wheremod.$extra.$order_by); return $this->get_event_ids($repeats,$user_where.$wheremod.$extra.$order_by);
} }
/* OLD-ALARM /* OLD-ALARM
function add_alarm($eventid,$alarm,$owner) function add_alarm($eventid,$alarm,$owner)
{ {
$this->stream->query('INSERT INTO phpgw_cal_alarm(cal_id,cal_owner,cal_time,cal_text,alarm_enabled) VALUES('.$eventid.','.$owner.','.$alarm['time'].",'".$alarm['text']."',1)",__LINE__,__FILE__); $this->stream->query('INSERT INTO phpgw_cal_alarm(cal_id,cal_owner,cal_time,cal_text,alarm_enabled) VALUES('.$eventid.','.$owner.','.$alarm['time'].",'".$alarm['text']."',1)",__LINE__,__FILE__);
@ -871,5 +871,5 @@ class socalendar_ extends socalendar__
{ {
$this->stream->query('DELETE FROM phpgw_cal_alarm WHERE alarm_id='.$alarmid,__LINE__,__FILE__); $this->stream->query('DELETE FROM phpgw_cal_alarm WHERE alarm_id='.$alarmid,__LINE__,__FILE__);
} }
*/ */
} }

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"; 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 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"; 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) ' $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__); $this->db->query($sql,__LINE__,__FILE__);
} }
@ -53,10 +53,10 @@
'index' => $this->db->f('hol_id'), 'index' => $this->db->f('hol_id'),
'locale' => $this->db->f('locale'), 'locale' => $this->db->f('locale'),
'name' => $GLOBALS['phpgw']->strip_html($this->db->f('name')), 'name' => $GLOBALS['phpgw']->strip_html($this->db->f('name')),
'day' => intval($this->db->f('mday')), 'day' => (int)$this->db->f('mday'),
'month' => intval($this->db->f('month_num')), 'month' => (int)$this->db->f('month_num'),
'occurence' => intval($this->db->f('occurence')), 'occurence' => (int)$this->db->f('occurence'),
'dow' => intval($this->db->f('dow')), 'dow' => (int)$this->db->f('dow'),
'observance_rule' => $this->db->f('observance_rule') 'observance_rule' => $this->db->f('observance_rule')
); );
if($this->debug) if($this->debug)
@ -136,7 +136,7 @@
{ {
$querymethod = " AND name like '%".$query."%'"; $querymethod = " AND name like '%".$query."%'";
} }
if (intval($year) > 1900) if ((int)$year > 1900)
{ {
$querymethod .= " AND (occurence < 1900 OR occurence = $year)"; $querymethod .= " AND (occurence < 1900 OR occurence = $year)";
} }
@ -172,7 +172,7 @@
{ {
$querymethod = " AND name like '%".$query."%'"; $querymethod = " AND name like '%".$query."%'";
} }
if (intval($year) >= 1900) if ((int)$year >= 1900)
{ {
$querymethod .= " AND (occurence < 1900 OR occurence = $year)"; $querymethod .= " AND (occurence < 1900 OR occurence = $year)";
} }
@ -185,7 +185,7 @@
$this->db->query($sql,__LINE__,__FILE__); $this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record(); $this->db->next_record();
$retval = intval($this->db->f(0)); $retval = (int)$this->db->f(0);
if($this->debug) if($this->debug)
{ {
echo 'Total Holidays for : '.$locale.' : '.$retval."<br>\n"; echo 'Total Holidays for : '.$locale.' : '.$retval."<br>\n";

View File

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

View File

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

View File

@ -264,7 +264,7 @@
} }
$var = Array( $var = Array(
'title_holiday'=> ($this->bo->id ? lang('Edit') : lang('Add')).' '.lang('Holiday'), 'title_holiday' => ($this->bo->id ? lang('Edit') : lang('Add')).' '.lang('Holiday'),
'message' => $message, 'message' => $message,
'actionurl' => $GLOBALS['phpgw']->link($this->base_url,'menuaction=calendar.boholiday.add&year='.$this->bo->year), 'actionurl' => $GLOBALS['phpgw']->link($this->base_url,'menuaction=calendar.boholiday.add&year='.$this->bo->year),
'hidden_vars' => '<input type="hidden" name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n" 'hidden_vars' => '<input type="hidden" name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n"

View File

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

View File

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

View File

@ -22,7 +22,7 @@
} }
unset($d1); 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) if($showevents>0)
{ {
$GLOBALS['phpgw']->translation->add_app('calendar'); $GLOBALS['phpgw']->translation->add_app('calendar');

View File

@ -11,7 +11,7 @@
/* $Id$ */ /* $Id$ */
$phpgw_flags = Array( $GLOBALS['phpgw']_flags = Array(
'currentapp' => 'calendar', 'currentapp' => 'calendar',
'enable_nextmatchs_class' => True, 'enable_nextmatchs_class' => True,
'noheader' => True, 'noheader' => True,
@ -20,82 +20,82 @@
'noappfooter' => True 'noappfooter' => True
); );
$phpgw_info['flags'] = $phpgw_flags; $GLOBALS['phpgw_info']['flags'] = $GLOBALS['phpgw']_flags;
include('../header.inc.php'); include('../header.inc.php');
if ($submit) if ($submit)
{ {
$phpgw->preferences->read_repository(); $GLOBALS['phpgw']->preferences->read_repository();
$phpgw->preferences->add('calendar','weekdaystarts'); $GLOBALS['phpgw']->preferences->add('calendar','weekdaystarts');
$phpgw->preferences->add('calendar','workdaystarts'); $GLOBALS['phpgw']->preferences->add('calendar','workdaystarts');
$phpgw->preferences->add('calendar','workdayends'); $GLOBALS['phpgw']->preferences->add('calendar','workdayends');
$phpgw->preferences->add('calendar','defaultcalendar'); $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar');
$phpgw->preferences->add('calendar','defaultfilter'); $GLOBALS['phpgw']->preferences->add('calendar','defaultfilter');
$phpgw->preferences->add('calendar','interval'); $GLOBALS['phpgw']->preferences->add('calendar','interval');
if ($mainscreen_showevents == True) if ($mainscreen_showevents == True)
{ {
$phpgw->preferences->add('calendar','mainscreen_showevents'); $GLOBALS['phpgw']->preferences->add('calendar','mainscreen_showevents');
} }
else else
{ {
$phpgw->preferences->delete('calendar','mainscreen_showevents'); $GLOBALS['phpgw']->preferences->delete('calendar','mainscreen_showevents');
} }
if ($send_updates == True) if ($send_updates == True)
{ {
$phpgw->preferences->add('calendar','send_updates'); $GLOBALS['phpgw']->preferences->add('calendar','send_updates');
} }
else else
{ {
$phpgw->preferences->delete('calendar','send_updates'); $GLOBALS['phpgw']->preferences->delete('calendar','send_updates');
} }
if ($display_status == True) if ($display_status == True)
{ {
$phpgw->preferences->add('calendar','display_status'); $GLOBALS['phpgw']->preferences->add('calendar','display_status');
} }
else else
{ {
$phpgw->preferences->delete('calendar','display_status'); $GLOBALS['phpgw']->preferences->delete('calendar','display_status');
} }
if ($default_private == True) if ($default_private == True)
{ {
$phpgw->preferences->add('calendar','default_private'); $GLOBALS['phpgw']->preferences->add('calendar','default_private');
} }
else else
{ {
$phpgw->preferences->delete('calendar','default_private'); $GLOBALS['phpgw']->preferences->delete('calendar','default_private');
} }
if ($display_minicals == True) if ($display_minicals == True)
{ {
$phpgw->preferences->add('calendar','display_minicals'); $GLOBALS['phpgw']->preferences->add('calendar','display_minicals');
} }
else else
{ {
$phpgw->preferences->delete('calendar','display_minicals'); $GLOBALS['phpgw']->preferences->delete('calendar','display_minicals');
} }
if ($print_black_white == True) if ($print_black_white == True)
{ {
$phpgw->preferences->add('calendar','print_black_white'); $GLOBALS['phpgw']->preferences->add('calendar','print_black_white');
} }
else 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')); Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
$phpgw->common->phpgw_exit(); $GLOBALS['phpgw']->common->phpgw_exit();
} }
function display_item($field,$data) 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( $var = Array(
'bg_color' => $tr_color, 'bg_color' => $tr_color,
'field' => $field, 'field' => $field,
@ -105,10 +105,10 @@
$p->parse('row','pref_list',True); $p->parse('row','pref_list',True);
} }
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); 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( $templates = Array(
'pref' => 'pref.tpl', 'pref' => 'pref.tpl',
'pref_colspan' => 'pref_colspan.tpl', 'pref_colspan' => 'pref_colspan.tpl',
@ -118,8 +118,8 @@
$var = Array( $var = Array(
'title' => lang('Calendar preferences'), 'title' => lang('Calendar preferences'),
'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/preferences.php'), 'action_url' => $GLOBALS['phpgw']->link('/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/preferences.php'),
'bg_color' => $phpgw_info['theme']['th_bg'], 'bg_color' => $GLOBALS['phpgw_info']['theme']['th_bg'],
'submit_lang' => lang('submit') 'submit_lang' => lang('submit')
); );
@ -129,13 +129,13 @@
// if ($totalerrors) // 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); 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">' $str = '<select name="weekdaystarts">'
. '<option value="Monday"'.$t_weekday['Monday'].'>'.lang('Monday').'</option>' . '<option value="Monday"'.$t_weekday['Monday'].'>'.lang('Monday').'</option>'
. '<option value="Sunday"'.$t_weekday['Sunday'].'>'.lang('Sunday').'</option>' . '<option value="Sunday"'.$t_weekday['Sunday'].'>'.lang('Sunday').'</option>'
@ -144,28 +144,28 @@
. '</select>'; . '</select>';
display_item(lang('weekday starts on'),$str); 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">'; $str = '<select name="workdaystarts">';
for ($i=0; $i<24; $i++) for ($i=0; $i<24; $i++)
{ {
$str .= '<option value="'.$i.'"'.$t_workdaystarts[$i].'>' $str .= '<option value="'.$i.'"'.$t_workdaystarts[$i].'>'
. $phpgw->common->formattime($i,'00') . '</option>'; . $GLOBALS['phpgw']->common->formattime($i,'00') . '</option>';
} }
$str .= '</select>'; $str .= '</select>';
display_item(lang('work day starts on'),$str); 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">'; $str = '<select name="workdayends">';
for ($i=0; $i<24; $i++) for ($i=0; $i<24; $i++)
{ {
$str .= '<option value="'.$i.'"'.$t_workdayends[$i].'>' $str .= '<option value="'.$i.'"'.$t_workdayends[$i].'>'
. $phpgw->common->formattime($i,'00') . '</option>'; . $GLOBALS['phpgw']->common->formattime($i,'00') . '</option>';
} }
$str .= '</select>'; $str .= '</select>';
display_item(lang('work day ends on'),$str); display_item(lang('work day ends on'),$str);
$selected[$phpgw_info['user']['preferences']['calendar']['defaultcalendar']] = ' selected'; $selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']] = ' selected';
if (!isset($phpgw_info['user']['preferences']['calendar']['defaultcalendar'])) if (!isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']))
{ {
$selected['month.php'] = ' selected'; $selected['month.php'] = ' selected';
} }
@ -179,8 +179,8 @@
$selected = array(); $selected = array();
$selected[$phpgw_info['user']['preferences']['calendar']['defaultfilter']] = ' selected'; $selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['defaultfilter']) || $phpgw_info['user']['preferences']['calendar']['defaultfilter'] == 'private') if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']) || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter'] == 'private')
{ {
$selected['private'] = ' selected'; $selected['private'] = ' selected';
} }
@ -196,8 +196,8 @@
display_item(lang('Default calendar filter'),$str); display_item(lang('Default calendar filter'),$str);
$selected = array(); $selected = array();
$selected[intval($phpgw_info['user']['preferences']['calendar']['interval'])] = ' selected'; $selected[intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval'])] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['interval'])) if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval']))
{ {
$selected[60] = ' selected'; $selected[60] = ' selected';
} }
@ -219,21 +219,21 @@
$str .= '</select>'; $str .= '</select>';
display_item(lang('Display interval in Day View'),$str); 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); 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); 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); 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); 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); display_item(lang('Print calendars in black & white'),$str);
$p->pparse('out','pref'); $p->pparse('out','pref');
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
?> ?>