Various fixes... including the footer for weekly, and for handling daily events on/or about midnight.

This commit is contained in:
skeeter 2001-04-02 17:24:57 +00:00
parent 34a0553649
commit f67a1de2cd
4 changed files with 53 additions and 19 deletions

View File

@ -844,6 +844,8 @@ class calendar extends calendar_
{
global $phpgw, $phpgw_info, $grants;
$startdate -= 7200;
if($owner == 0) { $owner= $phpgw_info['user']['account_id']; }
$str = '';
@ -927,7 +929,7 @@ class calendar extends calendar_
$p->parse('column_data','month_day',True);
$rep_events = $this->get_sorted_by_date($date['raw'] - 7200,$owner);
$rep_events = $this->get_sorted_by_date($date['raw'],$owner);
if ($this->sorted_events_matching)
{

View File

@ -19,6 +19,11 @@
$phpgw->common->phpgw_exit();
}
if(floor($PHP_VERSION) == 4)
{
global $phpgw_info, $thisday, $thismonth, $thisyear;
}
$p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir);
$templates = Array(
@ -63,7 +68,7 @@
}
$var = Array(
'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/month.php','owner='.$owner),
'action_url' => $phpgw->link('/calendar/month.php','owner='.$owner),
'form_name' => 'SelectMonth',
'label' => lang('Month'),
'form_label' => 'date',
@ -78,28 +83,54 @@
$str = '';
if ($phpgw->calendar->tempyear && $phpgw->calendar->tempmonth)
if ($phpgw->calendar->tempyear)
{
$m = $phpgw->calendar->tempmonth;
$y = $phpgw->calendar->tempyear;
}
else
{
$m = date('m');
$y = date('Y');
}
if ($thisday)
if ($phpgw->calendar->tempmonth)
{
$d = $thisday;
$m = $phpgw->calendar->tempmonth;
}
else
{
$m = date('m');
}
if ($phpgw->calendar->tempday)
{
$d = $phpgw->calendar->tempday;
}
else
{
$d = date('d');
}
// if ($phpgw->calendar->tempyear && $phpgw->calendar->tempmonth)
// {
// $m = $phpgw->calendar->tempmonth;
// $y = $phpgw->calendar->tempyear;
// }
// else
// {
// $m = date('m');
// $y = date('Y');
// }
//
// if ($thisday)
// {
// $d = $thisday;
// }
// else
// {
// $d = date ('d');
// }
unset($thisdate);
$thisdate = $phpgw->calendar->makegmttime(0,0,0,$m,$d,$y);
$sun = $phpgw->calendar->get_weekday_start($y,$m,$d) -
((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset']));
$sun = $phpgw->calendar->get_weekday_start($y,$m,$d) - $phpgw->calendar->tz_offset - 7200;
$str = '';
@ -117,7 +148,7 @@
}
$var = Array(
'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','owner='.$owner),
'action_url' => $phpgw->link('/calendar/week.php','owner='.$owner),
'form_name' => 'SelectWeek',
'label' => lang('Week'),
'form_label' => 'date',
@ -150,7 +181,7 @@
}
$var = Array(
'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/year.php','owner='.$owner),
'action_url' => $phpgw->link('/calendar/year.php','owner='.$owner),
'form_name' => 'SelectYear',
'label' => lang('Year'),
'form_label' => 'year',

View File

@ -71,6 +71,7 @@
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
{
$phpgw_info['user']['preferences']['calendar']['weekdaystarts'] = 'Sunday';
$phpgw->preferences->save_repository();
}
if (isset($date) && strlen($date) > 0)

View File

@ -32,27 +32,27 @@
 
</td>
<td width="2%">
<a href="<?php echo $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/day.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<a href="<?php echo $phpgw->link('/calendar/day.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<img src="<?php echo $phpgw_info['server']['app_images']; ?>/today.gif" alt="<?php echo lang('Today'); ?>" border="0">
</a>
</td>
<td width="2%" align="left">
<a href="<?php echo $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<a href="<?php echo $phpgw->link('/calendar/week.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<img src="<?php echo $phpgw_info['server']['app_images']; ?>/week.gif" alt="<?php echo lang('This week'); ?>" border="0">
</a>
</td>
<td width="2%" align="left">
<a href="<?php echo $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/month.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<a href="<?php echo $phpgw->link('/calendar/month.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<img src="<?php echo $phpgw_info['server']['app_images']; ?>/month.gif" alt="<?php echo lang('This month'); ?>" border="0">
</a>
</td>
<td width="2%" align="left">
<a href="<?php echo $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/year.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<a href="<?php echo $phpgw->link('/calendar/year.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<img src="<?php echo $phpgw_info['server']['app_images']; ?>/year.gif" alt="<?php echo lang('This year'); ?>" border="0">
</a>
</td>
<td width="2%" align="left">
<a href="<?php echo $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/matrixselect.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<a href="<?php echo $phpgw->link('/calendar/matrixselect.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); ?>">
<img src="<?php echo $phpgw_info['server']['app_images']; ?>/view.gif" alt="<?php echo lang('Daily Matrix View'); ?>" border="0">
</a>
</td>