From 864d201ed5e5747921b867aa2b2bd2b03a1bce23 Mon Sep 17 00:00:00 2001 From: skeeter Date: Mon, 27 Aug 2001 03:03:41 +0000 Subject: [PATCH] Fix for a reference malfunction, and a fix to disallow the owner of the event to reject his participation status. --- calendar/inc/class.bocalendar.inc.php | 3 +-- calendar/inc/class.uicalendar.inc.php | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index d55d6048a2..cf70f065d5 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -347,7 +347,6 @@ $l_start = ($params['start']?$params['start']:$GLOBALS['HTTP_POST_VARS']['start']); $l_end = ($params['end']?$params['end']:$GLOBALS['HTTP_POST_VARS']['end']); $l_recur_enddate = ($params['recur_enddate']?$params['recur_enddate']:$GLOBALS['HTTP_POST_VARS']['recur_enddate']); - $l_reference = ($params['reference']?$params['reference']:$GLOBALS['HTTP_POST_VARS']['reference']); $send_to_ui = True; if($p_cal || $p_participants || $p_start || $p_end || $p_recur_enddata) @@ -404,7 +403,7 @@ $this->so->set_start($l_start['year'],$l_start['month'],$l_start['mday'],$l_start['hour'],$l_start['min'],0); $this->so->set_end($l_end['year'],$l_end['month'],$l_end['mday'],$l_end['hour'],$l_end['min'],0); $this->so->set_class($is_public); - $this->so->add_attribute('reference',($l_reference?$l_reference:0)); + $this->so->add_attribute('reference',$l_cal['reference']); if($l_cal['id']) { $this->so->add_attribute('id',$l_cal['id']); diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 48dc7379cd..c6de2aa338 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -2659,6 +2659,7 @@ ) ); + $ev = $this->bo->get_cached_event(); $response_choices = Array( ACCEPTED => lang('Accept'), REJECTED => lang('Reject'), @@ -2668,14 +2669,17 @@ $str = ''; while(list($param,$text) = each($response_choices)) { - $var = Array( - 'action_url_button' => $this->page('set_action','&cal_id='.$cal_id.'&action='.$param), - 'action_text_button' => ' '.$text.' ', - 'action_confirm_button' => '', - 'action_extra_field' => '' - ); - $p->set_var($var); - $str .= ''.$p->fp('out','form_button').''."\n"; + if(!($param == REJECTED && $ev['owner'] == $this->bo->owner)) + { + $var = Array( + 'action_url_button' => $this->page('set_action','&cal_id='.$cal_id.'&action='.$param), + 'action_text_button' => ' '.$text.' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); + $str .= ''.$p->fp('out','form_button').''."\n"; + } } return ''."\n".$str.'
'."\n"; } @@ -2720,7 +2724,8 @@ 'action_url' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.bocalendar.update')), 'common_hidden' => ''."\n" . ''."\n" - . ($GLOBALS['HTTP_GET_VARS']['cal_id'] && $event['id'] == 0?''."\n":''), + . ($GLOBALS['HTTP_GET_VARS']['cal_id'] && $event['id'] == 0?''."\n": + ($event['reference']?''."\n":'')), 'errormsg' => ($params['cd']?$GLOBALS['phpgw']->common->check_code($params['cd']):'') ); $p->set_var($vars);