Fixes for the rename of the constants to fit in line with mcal support

This commit is contained in:
skeeter 2001-06-16 19:07:12 +00:00
parent 51e871070c
commit 18372e44a5
2 changed files with 40 additions and 37 deletions

View File

@ -322,20 +322,20 @@ echo "Owner = ".$users[$owner]."<br>\n";
$p->parse('row','hr',True);
$str = '<select name="recur_type">';
$rpt_type = Array(
RECUR_NONE,
RECUR_DAILY,
RECUR_WEEKLY,
RECUR_MONTHLY_WDAY,
RECUR_MONTHLY_MDAY,
RECUR_YEARLY
MCAL_RECUR_NONE,
MCAL_RECUR_DAILY,
MCAL_RECUR_WEEKLY,
MCAL_RECUR_MONTHLY_WDAY,
MCAL_RECUR_MONTHLY_MDAY,
MCAL_RECUR_YEARLY
);
$rpt_type_out = Array(
RECUR_NONE => 'None',
RECUR_DAILY => 'Daily',
RECUR_WEEKLY => 'Weekly',
RECUR_MONTHLY_WDAY => 'Monthly (by day)',
RECUR_MONTHLY_MDAY => 'Monthly (by date)',
RECUR_YEARLY => 'Yearly'
MCAL_RECUR_NONE => 'None',
MCAL_RECUR_DAILY => 'Daily',
MCAL_RECUR_WEEKLY => 'Weekly',
MCAL_RECUR_MONTHLY_WDAY => 'Monthly (by day)',
MCAL_RECUR_MONTHLY_MDAY => 'Monthly (by date)',
MCAL_RECUR_YEARLY => 'Yearly'
);
for($l=0;$l<count($rpt_type);$l++)
{
@ -370,13 +370,13 @@ echo "Owner = ".$users[$owner]."<br>\n";
display_item($p,lang('Repeat End Date'),$str);
$str = '<input type="checkbox" name="cal[rpt_sun]" value="'.M_SUNDAY.'"'.(($event->recur_data & M_SUNDAY) ?' checked':'').'> '.lang('Sunday').' ';
$str .= '<input type="checkbox" name="cal[rpt_mon]" value="'.M_MONDAY.'"'.(($event->recur_data & M_MONDAY) ?' checked':'').'> '.lang('Monday').' ';
$str .= '<input type="checkbox" name="cal[rpt_tue]" value="'.M_TUESDAY.'"'.(($event->recur_data & M_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' ';
$str .= '<input type="checkbox" name="cal[rpt_wed]" value="'.M_WEDNESDAY.'"'.(($event->recur_data & M_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').' <br>';
$str .= '<input type="checkbox" name="cal[rpt_thu]" value="'.M_THURSDAY.'"'.(($event->recur_data & M_THURSDAY) ?' checked':'').'> '.lang('Thursday').' ';
$str .= '<input type="checkbox" name="cal[rpt_fri]" value="'.M_FRIDAY.'"'.(($event->recur_data & M_FRIDAY) ?' checked':'').'> '.lang('Friday').' ';
$str .= '<input type="checkbox" name="cal[rpt_sat]" value="'.M_SATURDAY.'"'.(($event->recur_data & M_SATURDAY) ?' checked':'').'> '.lang('Saturday').' ';
$str = '<input type="checkbox" name="cal[rpt_sun]" value="'.MCAL_SUNDAY.'"'.(($event->recur_data & MCAL_SUNDAY) ?' checked':'').'> '.lang('Sunday').' ';
$str .= '<input type="checkbox" name="cal[rpt_mon]" value="'.MCAL_MONDAY.'"'.(($event->recur_data & MCAL_MONDAY) ?' checked':'').'> '.lang('Monday').' ';
$str .= '<input type="checkbox" name="cal[rpt_tue]" value="'.MCAL_TUESDAY.'"'.(($event->recur_data & MCAL_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' ';
$str .= '<input type="checkbox" name="cal[rpt_wed]" value="'.MCAL_WEDNESDAY.'"'.(($event->recur_data & MCAL_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').' <br>';
$str .= '<input type="checkbox" name="cal[rpt_thu]" value="'.MCAL_THURSDAY.'"'.(($event->recur_data & MCAL_THURSDAY) ?' checked':'').'> '.lang('Thursday').' ';
$str .= '<input type="checkbox" name="cal[rpt_fri]" value="'.MCAL_FRIDAY.'"'.(($event->recur_data & MCAL_FRIDAY) ?' checked':'').'> '.lang('Friday').' ';
$str .= '<input type="checkbox" name="cal[rpt_sat]" value="'.MCAL_SATURDAY.'"'.(($event->recur_data & MCAL_SATURDAY) ?' checked':'').'> '.lang('Saturday').' ';
display_item($p,lang('Repeat Day').'<br>'.lang('(for weekly)'),$str);

View File

@ -134,22 +134,22 @@
switch($recur_type)
{
case RECUR_NONE:
case MCAL_RECUR_NONE:
$phpgw->calendar->set_recur_none();
break;
case RECUR_DAILY:
case MCAL_RECUR_DAILY:
$phpgw->calendar->set_recur_daily($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
break;
case RECUR_WEEKLY:
case MCAL_RECUR_WEEKLY:
$phpgw->calendar->set_recur_weekly($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval,$recur_data);
break;
case RECUR_MONTHLY_MDAY:
case MCAL_RECUR_MONTHLY_MDAY:
$phpgw->calendar->set_recur_monthly_mday($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
break;
case RECUR_MONTHLY_WDAY:
case MCAL_RECUR_MONTHLY_WDAY:
$phpgw->calendar->set_recur_monthly_wday($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
break;
case RECUR_YEARLY:
case MCAL_RECUR_YEARLY:
$phpgw->calendar->set_recur_yearly($recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval);
break;
}
@ -179,42 +179,45 @@
}
}
// $participants = Array();
@reset($part);
while(list($key,$value) = each($part))
{
$phpgw->calendar->add_attribute('participants['.$key.']','U');
}
// reset($participants);
// $phpgw->calendar->add_attribute('participants',$participants);
$phpgw->calendar->add_attribute('priority',$priority);
$event = $phpgw->calendar->event;
$phpgw->session->appsession('entry','calendar',$event);
$datetime_check = validate($event);
if($datetime_check)
{
Header('Location: '.$phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&cd='.$datetime_check));
}
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->datetime->tz_offset;
$end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $phpgw->calendar->datetime->tz_offset;
$overlapping_events = $phpgw->calendar->overlap($start,$end,$event->participants,$event->owner,$event->id);
}
else
{
$phpgw->calendar->open('INBOX',intval($owner),'');
$phpgw->calendar->event_init();
$event = unserialize(str_replace('O:8:"stdClass"','O:13:"calendar_time"',serialize($phpgw->session->appsession('entry','calendar'))));
$event = unserialize(str_replace('O:8:"stdClass"','O:13:"calendar_time"',$phpgw->session->appsession('entry','calendar')));
$phpgw->calendar->event = $event;
$datetime_check = validate($event);
if($datetime_check)
{
Header('Location: '.$phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&cd='.$datetime_check));
}
}
if($datetime_check)
{
Header('Location: '.$phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&cd='.$datetime_check));
}
elseif($overlapping_events)
{
if(count($overlapping_events) > 0 && $overlapping_events != False)
{
$phpgw->common->phpgw_header();
echo parse_navbar();