made a fix to seek3r's fix. Introduced the interval preference to the user.

This commit is contained in:
skeeter 2001-06-03 01:06:12 +00:00
parent 7df8c9ccc9
commit 8a855989a5
2 changed files with 56 additions and 12 deletions

View File

@ -459,7 +459,7 @@ class calendar extends calendar_
$search_date_dow = date('w',$datetime);
$search_beg_day = mktime(0,0,0,$search_date_month,$search_date_day,$search_date_year);
@reset($this->repeated_events);
$repeated = $this->repeated_event;
$repeated = $this->repeated_events;
$r_events = count($repeated);
for ($i=0;$i<$r_events;$i++)
{
@ -1864,23 +1864,42 @@ class calendar extends calendar_
switch($j)
{
case 0:
if($interval == 4)
{
$k = ($i<=9?'0':substr($i,0,1));
}
$str .= '<td align="right" bgcolor="'.$phpgw_info['theme']['bg_color'].'"><font color="'.$phpgw_info['theme']['bg_text'].'" face="'.$phpgw_info['theme']['font'].'" size="-2">';
$str .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date['year'].'&month='.$date['month'].'&day='.$date['day'].'&hour='.$i.'&minute='.(interval * $j))."\" onMouseOver=\"window.status='".$i.':'.($increment * $j<=9?'0':'').($increment * $j)."'; return true;\">";
$str .= $k.'</a></font></td>';
break;
case 1:
if($interval == 4)
// if($interval == 4)
// {
// $k = ($i<=9?'0':substr($i,$j,$j+1));
// }
// else
// {
switch($j)
{
$k = ($i<=9?substr($i,0,1):substr($i,1,2));
case 0:
$pre = '0';
break;
case 1:
$pre = substr($i,0,1);
break;
}
$k = ($i<=9?$pre:substr($i,$j,$j+1));
// }
$str .= '<td align="right" bgcolor="'.$phpgw_info['theme']['bg_color'].'"><font color="'.$phpgw_info['theme']['bg_text'].'" face="'.$phpgw_info['theme']['font'].'" size="-2">';
$str .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date['year'].'&month='.$date['month'].'&day='.$date['day'].'&hour='.$i.'&minute='.(interval * $j))."\" onMouseOver=\"window.status='".$i.':'.($increment * $j)."'; return true;\">";
$str .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date['year'].'&month='.$date['month'].'&day='.$date['day'].'&hour='.$i.'&minute='.(interval * $j))."\" onMouseOver=\"window.status='".$i.':'.(($increment * $j)<=9?'0':'').($increment * $j)."'; return true;\">";
$str .= $k.'</a></font></td>';
break;
// case 1:
// if($interval == 4)
// {
// $k = ($i<=9?substr($i,0,1):substr($i,1,2));
// }
// else
// {
// $k = ($i<=9?substr($i,0,1):substr($i,1,2));
// }
// $str .= '<td align="right" bgcolor="'.$phpgw_info['theme']['bg_color'].'"><font color="'.$phpgw_info['theme']['bg_text'].'" face="'.$phpgw_info['theme']['font'].'" size="-2">';
// $str .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date['year'].'&month='.$date['month'].'&day='.$date['day'].'&hour='.$i.'&minute='.(($increment * $j)<=9?'0':'').($increment * $j))."\" onMouseOver=\"window.status='".$i.':'.(($increment * $j)<=9?'0':'').($increment * $j)."'; return true;\">";
// $str .= $k.'</a></font></td>';
// break;
default:
$str .= '<td align="left" bgcolor="'.$phpgw_info['theme']['bg_color'].'"><font color="'.$phpgw_info['theme']['bg_text'].'" face="'.$phpgw_info['theme']['font'].'" size="-2">';
$str .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date['year'].'&month='.$date['month'].'&day='.$date['day'].'&hour='.$i.'&minute='.(interval * $j))."\" onMouseOver=\"window.status='".$i.':'.($increment * $j)."'; return true;\">";

View File

@ -32,6 +32,7 @@
$phpgw->preferences->add('calendar','defaultcalendar');
$phpgw->preferences->add('calendar','defaultfilter');
$phpgw->preferences->add('calendar','locale');
$phpgw->preferences->add('calendar','interval');
if ($mainscreen_showevents == True)
{
$phpgw->preferences->add('calendar','mainscreen_showevents');
@ -185,6 +186,30 @@
. '</select>';
display_item(lang('Default calendar filter'),$str);
$selected = array();
$selected[intval($phpgw_info['user']['preferences']['calendar']['interval'])] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['interval']))
{
$selected[60] = ' selected';
}
$var = Array(
5 => '5',
10 => '10',
15 => '15',
20 => '20',
30 => '30',
45 => '45',
60 => '60'
);
$str = '<select name="interval">';
while(list($key,$value) = each($var))
{
$str .= '<option value="'.$key.'"'.$selected[$key].'>'.$value.'</option>';
}
$str .= '</select>';
display_item(lang('Display interval in Day View'),$str);
$str = '<input type="checkbox" name="send_updates" value="True"'.($phpgw_info['user']['preferences']['calendar']['send_updates'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['send_updates'] == True?' checked':'').'>';
display_item(lang('Send/receive updates via email'),$str);