mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-22 10:52:00 +02:00
Tons of major fixes to the n-tier calendar. Still need to incorporate ralfbeckers enhancements to the planner.
This commit is contained in:
parent
1edb9cfbaf
commit
1609677f71
@ -237,7 +237,7 @@
|
|||||||
if($this->check_perms(PHPGW_ACL_DELETE))
|
if($this->check_perms(PHPGW_ACL_DELETE))
|
||||||
{
|
{
|
||||||
$temp_event = $this->read_entry($id);
|
$temp_event = $this->read_entry($id);
|
||||||
if($this->owner == $temp_event->owner)
|
if($this->owner == $temp_event['owner'])
|
||||||
{
|
{
|
||||||
$this->so->delete_entry($id);
|
$this->so->delete_entry($id);
|
||||||
$cd = 16;
|
$cd = 16;
|
||||||
@ -272,6 +272,7 @@
|
|||||||
{
|
{
|
||||||
if($this->check_perms(PHPGW_ACL_DELETE))
|
if($this->check_perms(PHPGW_ACL_DELETE))
|
||||||
{
|
{
|
||||||
|
reset($this->so->cal->delete_events);
|
||||||
for($i=0;$i<count($this->so->cal->deleted_events);$i++)
|
for($i=0;$i<count($this->so->cal->deleted_events);$i++)
|
||||||
{
|
{
|
||||||
$event_id = $this->so->cal->deleted_events[$i];
|
$event_id = $this->so->cal->deleted_events[$i];
|
||||||
@ -298,12 +299,15 @@
|
|||||||
$recur_enddate = ($p_recur_enddate?$p_recur_enddate:$recur_enddate);
|
$recur_enddate = ($p_recur_enddate?$p_recur_enddate:$recur_enddate);
|
||||||
|
|
||||||
$send_to_ui = True;
|
$send_to_ui = True;
|
||||||
if($p_cal && $p_participants && $p_start && $p_end && $p_recur_enddata)
|
if($p_cal || $p_participants || $p_start || $p_end || $p_recur_enddata)
|
||||||
{
|
{
|
||||||
$send_to_ui = False;
|
$send_to_ui = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
$overlapping_events = False;
|
if($this->debug)
|
||||||
|
{
|
||||||
|
echo "ID : ".$cal['id']."<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
$ui = CreateObject('calendar.uicalendar');
|
$ui = CreateObject('calendar.uicalendar');
|
||||||
|
|
||||||
@ -313,12 +317,12 @@
|
|||||||
$datetime_check = $this->validate_update($event);
|
$datetime_check = $this->validate_update($event);
|
||||||
if($datetime_check)
|
if($datetime_check)
|
||||||
{
|
{
|
||||||
$ui->edit($datetime_check,True);
|
$ui->edit($datetime_check,1);
|
||||||
}
|
}
|
||||||
|
$overlapping_events = False;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!$cal['id'] && !$this->check_perms(PHPGW_ACL_ADD))
|
if(!$cal['id'] && !$this->check_perms(PHPGW_ACL_ADD))
|
||||||
{
|
{
|
||||||
$ui->index();
|
$ui->index();
|
||||||
@ -410,15 +414,20 @@
|
|||||||
@reset($part);
|
@reset($part);
|
||||||
while(list($key,$value) = each($part))
|
while(list($key,$value) = each($part))
|
||||||
{
|
{
|
||||||
$this->so->add_attribute('participants','U',$key);
|
$this->so->add_attribute('participants','U',intval($key));
|
||||||
}
|
}
|
||||||
|
|
||||||
reset($participants);
|
// reset($participants);
|
||||||
$event = $this->get_cached_event();
|
$event = $this->get_cached_event();
|
||||||
|
|
||||||
if(!@$event['participants'][$cal['owner']])
|
if(!@$event['participants'][$cal['owner']])
|
||||||
{
|
{
|
||||||
$this->so->add_attribute('owner',$minparts);
|
$this->so->add_attribute('owner',$minparts);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->so->add_attribute('owner',$cal['owner']);
|
||||||
|
}
|
||||||
$this->so->add_attribute('priority',$cal['priority']);
|
$this->so->add_attribute('priority',$cal['priority']);
|
||||||
$event = $this->get_cached_event();
|
$event = $this->get_cached_event();
|
||||||
|
|
||||||
@ -426,23 +435,27 @@
|
|||||||
$datetime_check = $this->validate_update($event);
|
$datetime_check = $this->validate_update($event);
|
||||||
if($datetime_check)
|
if($datetime_check)
|
||||||
{
|
{
|
||||||
$ui = CreateObject('calendar.uicalendar');
|
$ui->edit($datetime_check,1);
|
||||||
$ui->edit($datetime_check,True);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
settype($start,'integer');
|
$overlapping_events = $this->overlap(
|
||||||
settype($end,'integer');
|
$this->maketime($event['start']) - $this->datetime->tz_offset,
|
||||||
$start = $this->maketime($event['start']) - $this->datetime->tz_offset;
|
$this->maketime($event['end']) - $this->datetime->tz_offset,
|
||||||
$end = $this->maketime($event['end']) - $this->datetime->tz_offset;
|
$event['participants'],
|
||||||
|
$event['owner'],
|
||||||
$overlapping_events = $this->overlap($start,$end,$event['participants'],$event->owner,$event->id);
|
$event['id']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($overlapping_events)
|
if($overlapping_events)
|
||||||
{
|
{
|
||||||
if($send_to_ui)
|
if($send_to_ui)
|
||||||
{
|
{
|
||||||
|
unset($phpgw_info['flags']['noheader']);
|
||||||
|
unset($phpgw_info['flags']['nonavbar']);
|
||||||
$ui->overlap($overlapping_events,$event);
|
$ui->overlap($overlapping_events,$event);
|
||||||
|
$phpgw_info['flags']['nofooter'] = True;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -459,8 +472,9 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$new_event = $event;
|
$new_event = $event;
|
||||||
$old_event = $this->read_entry($new_event['id']);
|
$old_event = $this->read_entry($event['id']);
|
||||||
$this->prepare_recipients($new_event,$old_event);
|
$this->prepare_recipients($new_event,$old_event);
|
||||||
|
$this->so->cal->event = $event;
|
||||||
$this->so->add_entry($event);
|
$this->so->add_entry($event);
|
||||||
}
|
}
|
||||||
$date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']);
|
$date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']);
|
||||||
@ -561,9 +575,9 @@
|
|||||||
{
|
{
|
||||||
$can_edit = False;
|
$can_edit = False;
|
||||||
|
|
||||||
if(($event->owner == $this->owner) && ($this->check_perms(PHPGW_ACL_EDIT) == True))
|
if(($event['owner'] == $this->owner) && ($this->check_perms(PHPGW_ACL_EDIT) == True))
|
||||||
{
|
{
|
||||||
if($event->public != True)
|
if($event['public'] != True)
|
||||||
{
|
{
|
||||||
if($this->check_perms(PHPGW_ACL_PRIVATE) == True)
|
if($this->check_perms(PHPGW_ACL_PRIVATE) == True)
|
||||||
{
|
{
|
||||||
@ -608,7 +622,7 @@
|
|||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
// do a little form verifying
|
// do a little form verifying
|
||||||
if ($event->title == '')
|
if ($event['title'] == '')
|
||||||
{
|
{
|
||||||
$error = 40;
|
$error = 40;
|
||||||
}
|
}
|
||||||
@ -1144,12 +1158,21 @@
|
|||||||
for($i=0;$i<$c_cached_ids;$i++)
|
for($i=0;$i<$c_cached_ids;$i++)
|
||||||
{
|
{
|
||||||
$event = $this->so->read_entry($cached_event_ids[$i]);
|
$event = $this->so->read_entry($cached_event_ids[$i]);
|
||||||
$starttime = $this->maketime($event['start']);
|
$startdate = intval(date('Ymd',$this->maketime($event['start'])));
|
||||||
$endtime = $this->maketime($event['end']);
|
$enddate= intval(date('Ymd',$this->maketime($event['end'])));
|
||||||
$this->cached_events[date('Ymd',$starttime)][] = $event;
|
$this->cached_events[$startdate][] = $event;
|
||||||
if($this->cached_events[date('Ymd',$endtime)][count($this->cached_events[date('Ymd',$starttime)]) - 1] != $event)
|
// if($startdate != $enddate)
|
||||||
|
// {
|
||||||
|
$start['year'] = intval(substr($startdate,0,4));
|
||||||
|
$start['month'] = intval(substr($startdate,4,2));
|
||||||
|
$start['day'] = intval(substr($startdate,6,2));
|
||||||
|
for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=intval(date('Ymd',mktime(0,0,0,$start['month'],$start['day'] + $k,$start['year']))))
|
||||||
{
|
{
|
||||||
$this->cached_events[date('Ymd',$endtime)][] = $event;
|
if($this->cached_events[$j][count($this->cached_events[$j]) - 1] != $event)
|
||||||
|
{
|
||||||
|
$this->cached_events[$j][] = $event;
|
||||||
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1181,7 +1204,8 @@
|
|||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
$this->event_init();
|
$this->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"',serialize($phpgw->session->appsession('entry','calendar'))));
|
||||||
|
$event = $phpgw->session->appsession('entry','calendar');
|
||||||
$this->so->cal->event = $event;
|
$this->so->cal->event = $event;
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
@ -1500,8 +1524,6 @@
|
|||||||
|
|
||||||
$phpgw_info['user']['preferences'] = $phpgw->common->create_emailpreferences($phpgw_info['user']['preferences'],$user);
|
$phpgw_info['user']['preferences'] = $phpgw->common->create_emailpreferences($phpgw_info['user']['preferences'],$user);
|
||||||
|
|
||||||
$send = CreateObject('phpgwapi.send');
|
|
||||||
|
|
||||||
switch($msg_type)
|
switch($msg_type)
|
||||||
{
|
{
|
||||||
case MSG_DELETED:
|
case MSG_DELETED:
|
||||||
@ -1552,6 +1574,11 @@
|
|||||||
{
|
{
|
||||||
// echo "Msg Type = ".$msg_type."<br>\n";
|
// echo "Msg Type = ".$msg_type."<br>\n";
|
||||||
// echo "userid = ".$userid."<br>\n";
|
// echo "userid = ".$userid."<br>\n";
|
||||||
|
if(!is_object($send))
|
||||||
|
{
|
||||||
|
$send = CreateObject('phpgwapi.send');
|
||||||
|
}
|
||||||
|
|
||||||
$preferences = CreateObject('phpgwapi.preferences',intval($userid));
|
$preferences = CreateObject('phpgwapi.preferences',intval($userid));
|
||||||
$part_prefs = $preferences->read_repository();
|
$part_prefs = $preferences->read_repository();
|
||||||
if(!isset($part_prefs['calendar']['send_updates']) || !$part_prefs['calendar']['send_updates'])
|
if(!isset($part_prefs['calendar']['send_updates']) || !$part_prefs['calendar']['send_updates'])
|
||||||
|
@ -230,9 +230,9 @@
|
|||||||
return $this->cal->event;
|
return $this->cal->event;
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_attribute($var,$value)
|
function add_attribute($var,$value,$element='False')
|
||||||
{
|
{
|
||||||
$this->cal->add_attribute($var,$value);
|
$this->cal->add_attribute($var,$value,$element);
|
||||||
}
|
}
|
||||||
|
|
||||||
function event_init()
|
function event_init()
|
||||||
|
@ -184,22 +184,11 @@ class socalendar__
|
|||||||
}
|
}
|
||||||
if($element!='False')
|
if($element!='False')
|
||||||
{
|
{
|
||||||
if(is_int($element))
|
$this->event[$attribute][$element] = $value;
|
||||||
{
|
|
||||||
eval("\$this->event['".$attribute."'][".$element."] = ".$value.";");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("\$this->event['".$attribute."']['".$element."'] = ".$value.";");
|
$this->event[$attribute] = $value;
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif(is_int($value))
|
|
||||||
{
|
|
||||||
eval("\$this->event['".$attribute."'] = ".$value.";");
|
|
||||||
}
|
|
||||||
elseif(is_string($value))
|
|
||||||
{
|
|
||||||
eval("\$this->event['".$attribute."'] = '".$value."';");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class socalendar_ extends socalendar__
|
|||||||
if($user=='')
|
if($user=='')
|
||||||
{
|
{
|
||||||
settype($user,'integer');
|
settype($user,'integer');
|
||||||
$user = $phpgw_info['user']['account_id'];
|
$this->user = $phpgw_info['user']['account_id'];
|
||||||
}
|
}
|
||||||
elseif(is_int($user))
|
elseif(is_int($user))
|
||||||
{
|
{
|
||||||
@ -270,6 +270,7 @@ class socalendar_ extends socalendar__
|
|||||||
|
|
||||||
function expunge()
|
function expunge()
|
||||||
{
|
{
|
||||||
|
reset($this->deleted_events);
|
||||||
if(count($this->deleted_events) <= 0)
|
if(count($this->deleted_events) <= 0)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -103,10 +103,11 @@
|
|||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$p->set_unknowns('remove');
|
$p->set_unknowns('remove');
|
||||||
|
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'mini_calendar' => 'mini_cal.tpl'
|
'mini_calendar' => 'mini_cal.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$p->set_file($templates);
|
|
||||||
$p->set_block('mini_calendar','mini_cal','mini_cal');
|
$p->set_block('mini_calendar','mini_cal','mini_cal');
|
||||||
$p->set_block('mini_calendar','mini_week','mini_week');
|
$p->set_block('mini_calendar','mini_week','mini_week');
|
||||||
$p->set_block('mini_calendar','mini_day','mini_day');
|
$p->set_block('mini_calendar','mini_day','mini_day');
|
||||||
@ -161,8 +162,11 @@
|
|||||||
|
|
||||||
for($i=0;$i<7;$i++)
|
for($i=0;$i<7;$i++)
|
||||||
{
|
{
|
||||||
$p->set_var('dayname','<b>' . substr(lang($this->bo->datetime->days[$i]),0,2) . '</b>');
|
$var = Array(
|
||||||
$p->parse('daynames','mini_day',True);
|
'dayname' => '<b>' . substr(lang($this->bo->datetime->days[$i]),0,2) . '</b>',
|
||||||
|
'day_image' => ''
|
||||||
|
);
|
||||||
|
$this->output_template_array($p,'daynames','mini_day',$var);
|
||||||
}
|
}
|
||||||
$today = date('Ymd',time());
|
$today = date('Ymd',time());
|
||||||
unset($date);
|
unset($date);
|
||||||
@ -270,10 +274,11 @@
|
|||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$p->set_unknowns('remove');
|
$p->set_unknowns('remove');
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'index_t' => 'index.tpl'
|
'index_t' => 'index.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$p->set_file($templates);
|
|
||||||
$p->set_var($var);
|
$p->set_var($var);
|
||||||
$p->pparse('out','index_t');
|
$p->pparse('out','index_t');
|
||||||
}
|
}
|
||||||
@ -337,11 +342,11 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'week_t' => 'week.tpl'
|
'week_t' => 'week.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$p->set_file($templates);
|
|
||||||
$p->set_var($var);
|
$p->set_var($var);
|
||||||
$p->pparse('out','week_t');
|
$p->pparse('out','week_t');
|
||||||
}
|
}
|
||||||
@ -381,10 +386,11 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'year_t' => 'year.tpl'
|
'year_t' => 'year.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$p->set_file($templates);
|
|
||||||
$p->set_block('year_t','year','year');
|
$p->set_block('year_t','year','year');
|
||||||
$p->set_block('year_t','month','month');
|
$p->set_block('year_t','month','month');
|
||||||
$p->set_block('year_t','month_sep','month_sep');
|
$p->set_block('year_t','month_sep','month_sep');
|
||||||
@ -413,7 +419,7 @@
|
|||||||
|
|
||||||
echo '<center>';
|
echo '<center>';
|
||||||
|
|
||||||
if(!@$cal_id && $vcal_id)
|
if(!isset($cal_id) && $vcal_id)
|
||||||
{
|
{
|
||||||
$cal_id = $vcal_id;
|
$cal_id = $vcal_id;
|
||||||
}
|
}
|
||||||
@ -445,10 +451,11 @@
|
|||||||
if($this->bo->owner == $event['owner'])
|
if($this->bo->owner == $event['owner'])
|
||||||
{
|
{
|
||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'form_button' => 'form_button_script.tpl'
|
'form_button' => 'form_button_script.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$p->set_file($templates);
|
|
||||||
|
|
||||||
if ($this->bo->check_perms(PHPGW_ACL_EDIT))
|
if ($this->bo->check_perms(PHPGW_ACL_EDIT))
|
||||||
{
|
{
|
||||||
@ -502,10 +509,10 @@
|
|||||||
$this->view($cal_id);
|
$this->view($cal_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->edit_form($event);
|
$this->edit_form($event,$cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
function add($cd,$readsess)
|
function add($cd=0,$readsess=0)
|
||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info, $cal_id, $hour, $minute;
|
global $phpgw, $phpgw_info, $cal_id, $hour, $minute;
|
||||||
|
|
||||||
@ -514,7 +521,7 @@
|
|||||||
$this->index();
|
$this->index();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($readsess))
|
if($readsess)
|
||||||
{
|
{
|
||||||
$event = $this->bo->restore_from_appsession;
|
$event = $this->bo->restore_from_appsession;
|
||||||
if(!$event['owner'])
|
if(!$event['owner'])
|
||||||
@ -549,14 +556,15 @@
|
|||||||
$this->bo->set_recur_none();
|
$this->bo->set_recur_none();
|
||||||
$event = $this->bo->get_cached_event();
|
$event = $this->bo->get_cached_event();
|
||||||
}
|
}
|
||||||
$this->edit_form($event);
|
$this->edit_form($event,$cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
global $cal_id;
|
global $cal_id;
|
||||||
|
|
||||||
$event = $this->bo->read_entry(intval($cal_id));
|
$event = $this->bo->read_entry(intval($cal_id));
|
||||||
if(($cal_id > 0) && ($event['owner'] == $this->bo->owner) && !$this->bo->check_perms(PHPGW_ACL_DELETE))
|
if(($cal_id > 0) && ($event['owner'] == $this->bo->owner) && $this->bo->check_perms(PHPGW_ACL_DELETE))
|
||||||
{
|
{
|
||||||
$date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']);
|
$date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']);
|
||||||
|
|
||||||
@ -837,7 +845,7 @@
|
|||||||
{
|
{
|
||||||
$dayname = substr(lang(date('D',mktime(0,0,0,$this->bo->month,$d,$this->bo->year))),0,2);
|
$dayname = substr(lang(date('D',mktime(0,0,0,$this->bo->month,$d,$this->bo->year))),0,2);
|
||||||
|
|
||||||
$header['.'.$d] = "colspan=$intervals_per_day align=center";
|
$header['.'.$d] = 'colspan="'.$intervals_per_day.'" align="center"';
|
||||||
$header[$d] = '<a href="'.$html->link('/index.php',
|
$header[$d] = '<a href="'.$html->link('/index.php',
|
||||||
array(
|
array(
|
||||||
'menuaction' => 'calendar.uicalendar.add',
|
'menuaction' => 'calendar.uicalendar.add',
|
||||||
@ -904,7 +912,7 @@
|
|||||||
if ($i > 1) // further line - no name
|
if ($i > 1) // further line - no name
|
||||||
{
|
{
|
||||||
$rows[$k] = array();
|
$rows[$k] = array();
|
||||||
$rows[$c.'_1']['._name'] = "rowspan=$i";
|
$rows[$c.'_1']['._name'] = 'rowspan="'.$i.'"';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -919,7 +927,7 @@
|
|||||||
if ($akt_cell < $start_cell)
|
if ($akt_cell < $start_cell)
|
||||||
{
|
{
|
||||||
$row[$event->id.'_1'] = ' ';
|
$row[$event->id.'_1'] = ' ';
|
||||||
$row['.'.$event['id'].'_1'] = 'colspan='.($start_cell-$akt_cell);
|
$row['.'.$event['id'].'_1'] = 'colspan="'.($start_cell-$akt_cell).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$opt = &$row['.'.$event['id'].'_2'];
|
$opt = &$row['.'.$event['id'].'_2'];
|
||||||
@ -962,7 +970,7 @@
|
|||||||
if ($akt_cell <= $last_cell)
|
if ($akt_cell <= $last_cell)
|
||||||
{
|
{
|
||||||
$row['3'] = ' ';
|
$row['3'] = ' ';
|
||||||
$row['.3'] = 'colspan='.(1+$last_cell-$akt_cell);
|
$row['.3'] = 'colspan="'.(1+$last_cell-$akt_cell).'"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -973,7 +981,7 @@
|
|||||||
'_h' => $header,
|
'_h' => $header,
|
||||||
'._h' => $bgcolor
|
'._h' => $bgcolor
|
||||||
)+$rows,
|
)+$rows,
|
||||||
'width="100%" cols='.(1+$days*$intervals_per_day)
|
'width="100%" cols="'.(1+$days*$intervals_per_day).'"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,11 +1376,11 @@
|
|||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
|
|
||||||
$templates = Array(
|
$p->set_file(
|
||||||
|
Array(
|
||||||
'footer' => 'footer.tpl'
|
'footer' => 'footer.tpl'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$p->set_file($templates);
|
|
||||||
$p->set_block('footer','footer_table','footer_table');
|
$p->set_block('footer','footer_table','footer_table');
|
||||||
$p->set_block('footer','footer_row','footer_row');
|
$p->set_block('footer','footer_row','footer_row');
|
||||||
|
|
||||||
@ -1618,11 +1626,11 @@
|
|||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
$month = $event->start->month;
|
$month = $event['start']['month'];
|
||||||
$mday = $event->start->mday;
|
$mday = $event['start']['mday'];
|
||||||
$year = $event->start->year;
|
$year = $event['start']['year'];
|
||||||
|
|
||||||
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$month,$mday,$year) - $this->bo->datetime->tz_offset;
|
$start = mktime($event['start']['hour'],$event['start']['min'],$event['start']['sec'],$month,$mday,$year) - $this->bo->datetime->tz_offset;
|
||||||
$end = $this->bo->maketime($event['end']) - $this->bo->datetime->tz_offset;
|
$end = $this->bo->maketime($event['end']) - $this->bo->datetime->tz_offset;
|
||||||
|
|
||||||
$overlap = '';
|
$overlap = '';
|
||||||
@ -1633,9 +1641,10 @@
|
|||||||
|
|
||||||
unset($phpgw_info['flags']['noheader']);
|
unset($phpgw_info['flags']['noheader']);
|
||||||
unset($phpgw_info['flags']['nonavbar']);
|
unset($phpgw_info['flags']['nonavbar']);
|
||||||
|
$phpgw_info['flags']['nofooter'] = True;
|
||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||||
$p->set_file(
|
$p->set_file(
|
||||||
Array(
|
Array(
|
||||||
'overlap' => 'overlap.tpl',
|
'overlap' => 'overlap.tpl',
|
||||||
@ -1666,7 +1675,7 @@
|
|||||||
'action_confirm_button' => '',
|
'action_confirm_button' => '',
|
||||||
'action_extra_field' => ''
|
'action_extra_field' => ''
|
||||||
);
|
);
|
||||||
$this->output_template_array($p,'resubmit_button','form_button',$var);
|
$this->output_template_array($p,'reedit_button','form_button',$var);
|
||||||
$p->pparse('out','overlap');
|
$p->pparse('out','overlap');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1804,7 +1813,7 @@
|
|||||||
{
|
{
|
||||||
if ($day_params['new_event'])
|
if ($day_params['new_event'])
|
||||||
{
|
{
|
||||||
$new_event_link = '<a href="'.$this->page('add','&date'.$date).'">'
|
$new_event_link = '<a href="'.$this->page('add','&date='.$date).'">'
|
||||||
. '<img src="'.$phpgw->common->image('calendar','new.gif').'" width="10" height="10" alt="'.lang('New Entry').'" border="0" align="center">'
|
. '<img src="'.$phpgw->common->image('calendar','new.gif').'" width="10" height="10" alt="'.lang('New Entry').'" border="0" align="center">'
|
||||||
. '</a>';
|
. '</a>';
|
||||||
$day_number = '<a href="'.$this->page('day','&month='.$month.'&day='.$day.'&year='.$year).'">'.$day.'</a>';
|
$day_number = '<a href="'.$this->page('day','&month='.$month.'&day='.$day.'&year='.$year).'">'.$day.'</a>';
|
||||||
@ -2066,11 +2075,10 @@
|
|||||||
$cal_grps = '';
|
$cal_grps = '';
|
||||||
for($i=0;$i<count($event['groups']);$i++)
|
for($i=0;$i<count($event['groups']);$i++)
|
||||||
{
|
{
|
||||||
if($i>0)
|
if($phpgw->accounts->exists($event['groups'][$i]))
|
||||||
{
|
{
|
||||||
$cal_grps .= '<br>';
|
$cal_grps .= ($i>0?'<br>':'').$phpgw->accounts->id2name($event['groups'][$i]);
|
||||||
}
|
}
|
||||||
$cal_grps .= $phpgw->accounts->id2name($event['groups'][$i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
@ -2085,14 +2093,7 @@
|
|||||||
{
|
{
|
||||||
if($phpgw->accounts->exists($user))
|
if($phpgw->accounts->exists($user))
|
||||||
{
|
{
|
||||||
if($str)
|
$str .= ($str?'<br>':'').$phpgw->common->grab_owner_name($user).' ('.($this->bo->check_perms(PHPGW_ACL_EDIT,$user)?'<a href="'.$this->page('edit_status','&cal_id='.$event['id'].'&owner='.$user).'">'.$this->bo->get_long_status($short_status).'</a>':$this->bo->get_long_status($short_status)).')'."\n";
|
||||||
{
|
|
||||||
$str .= '<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$long_status = $this->bo->get_long_status($short_status);
|
|
||||||
|
|
||||||
$str .= $phpgw->common->grab_owner_name($user).' ('.($this->bo->check_perms(PHPGW_ACL_EDIT,$user)?'<a href="'.$this->page('edit_status','&cal_id='.$event->id.'&owner='.$user).'">'.$long_status.'</a>':$long_status).')'."\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
@ -2566,7 +2567,7 @@
|
|||||||
return '<table width="100%" cols="4"><tr align="center">'."\n".$str.'</tr></table>'."\n";
|
return '<table width="100%" cols="4"><tr align="center">'."\n".$str.'</tr></table>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_form($event)
|
function edit_form($event,$cd)
|
||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
@ -2574,9 +2575,6 @@
|
|||||||
|
|
||||||
$sb = CreateObject('phpgwapi.sbox');
|
$sb = CreateObject('phpgwapi.sbox');
|
||||||
|
|
||||||
$start = $this->bo->maketime($event['start']) - $this->bo->datetime->tz_offset;
|
|
||||||
$end = $this->bo->maketime($event['end']) - $this->bo->datetime->tz_offset;
|
|
||||||
|
|
||||||
unset($phpgw_info['flags']['noheader']);
|
unset($phpgw_info['flags']['noheader']);
|
||||||
unset($phpgw_info['flags']['nonavbar']);
|
unset($phpgw_info['flags']['nonavbar']);
|
||||||
$phpgw_info['flags']['noappheader'] = True;
|
$phpgw_info['flags']['noappheader'] = True;
|
||||||
@ -2625,6 +2623,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
|
$start = $this->bo->maketime($event['start']) - $this->bo->datetime->tz_offset;
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
'field' => lang('Start Date'),
|
'field' => lang('Start Date'),
|
||||||
'data' => $phpgw->common->dateformatorder(
|
'data' => $phpgw->common->dateformatorder(
|
||||||
@ -2637,8 +2636,8 @@
|
|||||||
// Time
|
// Time
|
||||||
if ($this->bo->prefs['common']['timeformat'] == '12')
|
if ($this->bo->prefs['common']['timeformat'] == '12')
|
||||||
{
|
{
|
||||||
$str .= '<input type="radio" name="start[ampm]" value="am"'.($event->start->hour >= 12?'':' checked').'>am'."\n"
|
$str .= '<input type="radio" name="start[ampm]" value="am"'.($event['start']['hour'] >= 12?'':' checked').'>am'."\n"
|
||||||
. '<input type="radio" name="start[ampm]" value="pm"'.($event->start->hour >= 12?' checked':'').'>pm'."\n";
|
. '<input type="radio" name="start[ampm]" value="pm"'.($event['start']['hour'] >= 12?' checked':'').'>pm'."\n";
|
||||||
}
|
}
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
'field' => lang('Start Time'),
|
'field' => lang('Start Time'),
|
||||||
@ -2646,6 +2645,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
// End Date
|
// End Date
|
||||||
|
$end = $this->bo->maketime($event['end']) - $this->bo->datetime->tz_offset;
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
'field' => lang('End Date'),
|
'field' => lang('End Date'),
|
||||||
'data' => $phpgw->common->dateformatorder(
|
'data' => $phpgw->common->dateformatorder(
|
||||||
@ -2658,8 +2658,8 @@
|
|||||||
// End Time
|
// End Time
|
||||||
if ($this->bo->prefs['common']['timeformat'] == '12')
|
if ($this->bo->prefs['common']['timeformat'] == '12')
|
||||||
{
|
{
|
||||||
$str = '<input type="radio" name="end[ampm]" value="am"'.($event->end->hour >= 12?'':' checked').'>am'."\n"
|
$str = '<input type="radio" name="end[ampm]" value="am"'.($event['end']['hour'] >= 12?'':' checked').'>am'."\n"
|
||||||
. '<input type="radio" name="end[ampm]" value="pm"'.($event->end->hour >= 12?' checked':'').'>pm'."\n";
|
. '<input type="radio" name="end[ampm]" value="pm"'.($event['end']['hour'] >= 12?' checked':'').'>pm'."\n";
|
||||||
}
|
}
|
||||||
$var[] = Array(
|
$var[] = Array(
|
||||||
'field' => lang("End Time"),
|
'field' => lang("End Time"),
|
||||||
@ -2681,7 +2681,7 @@
|
|||||||
// Participants
|
// Participants
|
||||||
$accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar');
|
$accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar');
|
||||||
$users = Array();
|
$users = Array();
|
||||||
$this->build_part_list($users,$accounts,$owner);
|
$this->build_part_list($users,$accounts,$event['owner']);
|
||||||
|
|
||||||
$str = '';
|
$str = '';
|
||||||
@asort($users);
|
@asort($users);
|
||||||
@ -2699,7 +2699,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
// I Participate
|
// I Participate
|
||||||
if((($cal_id > 0) && isset($event['participants'][$this->bo->owner])) || !isset($cal_id))
|
if((($event['id'] > 0) && isset($event['participants'][$this->bo->owner])) || !$event['id'])
|
||||||
{
|
{
|
||||||
$checked = ' checked';
|
$checked = ' checked';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user