Fix for a reference malfunction, and a fix to disallow the owner of the event to reject his participation status.

This commit is contained in:
skeeter 2001-08-27 03:03:41 +00:00
parent 3bf1728dc6
commit 864d201ed5
2 changed files with 15 additions and 11 deletions

View File

@ -347,7 +347,6 @@
$l_start = ($params['start']?$params['start']:$GLOBALS['HTTP_POST_VARS']['start']); $l_start = ($params['start']?$params['start']:$GLOBALS['HTTP_POST_VARS']['start']);
$l_end = ($params['end']?$params['end']:$GLOBALS['HTTP_POST_VARS']['end']); $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_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; $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)
@ -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_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_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->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']) if($l_cal['id'])
{ {
$this->so->add_attribute('id',$l_cal['id']); $this->so->add_attribute('id',$l_cal['id']);

View File

@ -2659,6 +2659,7 @@
) )
); );
$ev = $this->bo->get_cached_event();
$response_choices = Array( $response_choices = Array(
ACCEPTED => lang('Accept'), ACCEPTED => lang('Accept'),
REJECTED => lang('Reject'), REJECTED => lang('Reject'),
@ -2667,6 +2668,8 @@
); );
$str = ''; $str = '';
while(list($param,$text) = each($response_choices)) while(list($param,$text) = each($response_choices))
{
if(!($param == REJECTED && $ev['owner'] == $this->bo->owner))
{ {
$var = Array( $var = Array(
'action_url_button' => $this->page('set_action','&cal_id='.$cal_id.'&action='.$param), 'action_url_button' => $this->page('set_action','&cal_id='.$cal_id.'&action='.$param),
@ -2677,6 +2680,7 @@
$p->set_var($var); $p->set_var($var);
$str .= '<td>'.$p->fp('out','form_button').'</td>'."\n"; $str .= '<td>'.$p->fp('out','form_button').'</td>'."\n";
} }
}
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";
} }
@ -2720,7 +2724,8 @@
'action_url' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.bocalendar.update')), 'action_url' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.bocalendar.update')),
'common_hidden' => '<input type="hidden" name="cal[id]" value="'.$event['id'].'">'."\n" 'common_hidden' => '<input type="hidden" name="cal[id]" value="'.$event['id'].'">'."\n"
. '<input type="hidden" name="cal[owner]" value="'.$this->bo->owner.'">'."\n" . '<input type="hidden" name="cal[owner]" value="'.$this->bo->owner.'">'."\n"
. ($GLOBALS['HTTP_GET_VARS']['cal_id'] && $event['id'] == 0?'<input type="hidden" name="reference" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n":''), . ($GLOBALS['HTTP_GET_VARS']['cal_id'] && $event['id'] == 0?'<input type="hidden" name="cal[reference]" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n":
($event['reference']?'<input type="hidden" name="cal[reference]" value="'.$event['reference'].'">'."\n":'')),
'errormsg' => ($params['cd']?$GLOBALS['phpgw']->common->check_code($params['cd']):'') 'errormsg' => ($params['cd']?$GLOBALS['phpgw']->common->check_code($params['cd']):'')
); );
$p->set_var($vars); $p->set_var($vars);