A couple more fixes and even a speed enhancement.

This commit is contained in:
skeeter 2002-08-17 15:36:10 +00:00
parent edca7e8da3
commit 111ba30246
4 changed files with 211 additions and 243 deletions

View File

@ -22,7 +22,7 @@
return '<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('calendar',$image).'" alt="'.$alt.'" border="0"></a>';
}
$refer = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
$refer = explode('.',MENUACTION);
$referrer = $refer[2];
$templates = Array(
@ -45,27 +45,27 @@
$tpl->set_var('cols',7);
}
$today = date('Ymd',time());
$today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
$col_width = 12;
add_col($tpl,' <td width="2%">&nbsp;</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).'</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week.gif',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month.gif',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year.gif',lang('This Year')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This Year')).'</td>');
if(floor(phpversion()) >= 4)
{
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
$col_width += 2;
}
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="'.(100 - $col_width).'%" align="left"'.(floor(phpversion()) < 4?' colspan="2"':'').'>&nbsp;</td>');
@ -77,35 +77,51 @@
if($referrer!='view')
{
$remainder = 72;
$cal_id = get_var('cal_id',Array('GET','DEFAULT'),0);
$keywords = get_var('keywords',Array('POST','DEFAULT'),'');
$matrixtype = get_var('matrixtype',Array('POST','DEFAULT'),'');
$participants = get_var('participants',Array('POST'));
$var_list = Array(
'cal_id',
'keywords',
'matrixtype'
);
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$base_hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
for($i=0;$i<count($var_list);$i++)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
if($($var_list[$i]))
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$($var_list[$i]).'">'."\n";
}
}
// if($cal_id != 0)
// {
// $base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
// }
// if($keywords)
// {
// $base_hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
// }
// if($matrixtype)
// {
// $base_hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
// }
$hidden_vars = '';
if($participants)
{
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")<br>\n"; }
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'cat_id',
'title' => lang('Category'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => '<option value="0">All</option>'.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'),
'button_value' => lang('Go!')
);
@ -116,36 +132,23 @@
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$hidden_vars = '';
if($participants)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Filter = ('.$this->bo->filter.")<br>\n"; }
$form_options = '<option value=" all "'.($this->bo->filter==' all '?' selected':'').'>'.lang('All').'</option>'."\n";
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -156,16 +159,6 @@
if((!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && count($this->bo->grants) > 0)
{
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
$hidden_vars .= ' <!-- BO Owner = '.$this->bo->owner.' -->'."\n";
$form_options = '';
reset($this->bo->grants);
while(list($grantor,$temp_rights) = each($this->bo->grants))
@ -198,21 +191,21 @@
);
}
}
@reset($drop_down);
@ksort($drop_down);
while(list($key,$grant) = each($drop_down))
{
$form_options .= ' <option value="'.$grant['value'].'"'.($grant['grantor']==$this->bo->owner?' selected':'').'>'.$grant['name'].'</option>'."\n";
}
}
reset($this->bo->grants);
$var = Array(
'form_width' => $remainder,
'form_link' => $this->page($referrer),
'form_name' => 'owner',
'title' => lang('User'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -222,10 +215,11 @@
}
}
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date'])
$hidden_vars = ' <input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
$date = get_var('date',Array('GET'));
if($date)
{
$hidden_vars .= ' <input type="hidden" name="date" value="'.$GLOBALS['HTTP_GET_VARS']['date'].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
}
$hidden_vars .= ' <input type="hidden" name="month" value="'.$this->bo->month.'">'."\n";
$hidden_vars .= ' <input type="hidden" name="day" value="'.$this->bo->day.'">'."\n";
@ -234,7 +228,8 @@
{
$hidden_vars .= ' <input type="hidden" name="filter" value="'.$this->bo->filter.'">'."\n";
}
$hidden_vars .= ' <input name="keywords"'.($GLOBALS['HTTP_POST_VARS']['keywords']?' value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'"':'').'>';
$hidden_vars .= ' <input name="keywords"'.($keywords?' value="'.$keywords.'"':'').'>';
$var = Array(
'action_url_button' => $this->page('search'),
'action_text_button' => lang('Search'),

View File

@ -45,27 +45,27 @@
$tpl->set_var('cols',7);
}
$today = date('Ymd',$GLOBALS['phpgw']['datetime']->users_localtime);
$today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
$col_width = 12;
add_col($tpl,' <td width="2%">&nbsp;</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).'</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week.gif',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month.gif',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year.gif',lang('This Year')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This Year')).'</td>');
if(floor(phpversion()) >= 4)
{
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
$col_width += 2;
}
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="'.(100 - $col_width).'%" align="left"'.(floor(phpversion()) < 4?' colspan="2"':'').'>&nbsp;</td>');
@ -81,20 +81,33 @@
$keywords = get_var('keywords',Array('POST','DEFAULT'),'');
$matrixtype = get_var('matrixtype',Array('POST','DEFAULT'),'');
$participants = get_var('participants',Array('POST'));
$var_list = Array(
'cal_id',
'keywords',
'matrixtype'
);
$hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
if($cal_id != 0)
$base_hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
for($i=0;$i<count($var_list);$i++)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
}
if($keywords)
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
}
if($matrixtype)
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
if($($var_list[$i]))
{
$base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$($var_list[$i]).'">'."\n";
}
}
// if($cal_id != 0)
// {
// $base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
// }
// if($keywords)
// {
// $base_hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
// }
// if($matrixtype)
// {
// $base_hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
// }
$hidden_vars = '';
if($participants)
{
for ($i=0;$i<count($participants);$i++)
@ -102,14 +115,13 @@
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")<br>\n"; }
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'cat_id',
'title' => lang('Category'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => '<option value="0">All</option>'.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'),
'button_value' => lang('Go!')
);
@ -120,19 +132,7 @@
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
if($cal_id)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
}
if($keywords)
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
}
if($matrixtype)
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
}
$hidden_vars = '';
if($participants)
{
for ($i=0;$i<count($participants);$i++)
@ -140,16 +140,15 @@
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Filter = ('.$this->bo->filter.")<br>\n"; }
$form_options = '<option value=" all "'.($this->bo->filter==' all '?' selected':'').'>'.lang('All').'</option>'."\n";
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -160,20 +159,6 @@
if((!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && count($this->bo->grants) > 0)
{
$hidden_vars = ' <input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
if($keywords)
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
}
if($cal_id)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
}
if($matrixtype)
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
}
$hidden_vars .= ' <!-- BO Owner = '.$this->bo->owner.' -->'."\n";
$form_options = '';
reset($this->bo->grants);
while(list($grantor,$temp_rights) = each($this->bo->grants))
@ -206,21 +191,21 @@
);
}
}
@reset($drop_down);
@ksort($drop_down);
while(list($key,$grant) = each($drop_down))
{
$form_options .= ' <option value="'.$grant['value'].'"'.($grant['grantor']==$this->bo->owner?' selected':'').'>'.$grant['name'].'</option>'."\n";
}
}
reset($this->bo->grants);
$var = Array(
'form_width' => $remainder,
'form_link' => $this->page($referrer),
'form_name' => 'owner',
'title' => lang('User'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -231,7 +216,7 @@
}
$hidden_vars = ' <input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
$date = get_vars('date',Array('GET'));
$date = get_var('date',Array('GET'));
if($date)
{
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";

View File

@ -22,7 +22,7 @@
return '<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('calendar',$image).'" alt="'.$alt.'" border="0"></a>';
}
$refer = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
$refer = explode('.',MENUACTION);
$referrer = $refer[2];
$templates = Array(
@ -45,27 +45,27 @@
$tpl->set_var('cols',7);
}
$today = date('Ymd',time());
$today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
$col_width = 12;
add_col($tpl,' <td width="2%">&nbsp;</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).'</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week.gif',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month.gif',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year.gif',lang('This Year')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This Year')).'</td>');
if(floor(phpversion()) >= 4)
{
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
$col_width += 2;
}
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="'.(100 - $col_width).'%" align="left"'.(floor(phpversion()) < 4?' colspan="2"':'').'>&nbsp;</td>');
@ -77,35 +77,51 @@
if($referrer!='view')
{
$remainder = 72;
$cal_id = get_var('cal_id',Array('GET','DEFAULT'),0);
$keywords = get_var('keywords',Array('POST','DEFAULT'),'');
$matrixtype = get_var('matrixtype',Array('POST','DEFAULT'),'');
$participants = get_var('participants',Array('POST'));
$var_list = Array(
'cal_id',
'keywords',
'matrixtype'
);
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$base_hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
for($i=0;$i<count($var_list);$i++)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
if($($var_list[$i]))
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$($var_list[$i]).'">'."\n";
}
}
// if($cal_id != 0)
// {
// $base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
// }
// if($keywords)
// {
// $base_hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
// }
// if($matrixtype)
// {
// $base_hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
// }
$hidden_vars = '';
if($participants)
{
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")<br>\n"; }
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'cat_id',
'title' => lang('Category'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => '<option value="0">All</option>'.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'),
'button_value' => lang('Go!')
);
@ -116,36 +132,23 @@
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$hidden_vars = '';
if($participants)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Filter = ('.$this->bo->filter.")<br>\n"; }
$form_options = '<option value=" all "'.($this->bo->filter==' all '?' selected':'').'>'.lang('All').'</option>'."\n";
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -156,16 +159,6 @@
if((!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && count($this->bo->grants) > 0)
{
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
$hidden_vars .= ' <!-- BO Owner = '.$this->bo->owner.' -->'."\n";
$form_options = '';
reset($this->bo->grants);
while(list($grantor,$temp_rights) = each($this->bo->grants))
@ -198,13 +191,13 @@
);
}
}
@reset($drop_down);
@ksort($drop_down);
while(list($key,$grant) = each($drop_down))
{
$form_options .= ' <option value="'.$grant['value'].'"'.($grant['grantor']==$this->bo->owner?' selected':'').'>'.$grant['name'].'</option>'."\n";
}
}
reset($this->bo->grants);
$var = Array(
@ -212,7 +205,7 @@
'form_link' => $this->page($referrer),
'form_name' => 'owner',
'title' => lang('User'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -221,11 +214,12 @@
$tpl->parse('header_column','head_col',True);
}
}
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date'])
$hidden_vars = ' <input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
$date = get_var('date',Array('GET'));
if($date)
{
$hidden_vars .= ' <input type="hidden" name="date" value="'.$GLOBALS['HTTP_GET_VARS']['date'].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
}
$hidden_vars .= ' <input type="hidden" name="month" value="'.$this->bo->month.'">'."\n";
$hidden_vars .= ' <input type="hidden" name="day" value="'.$this->bo->day.'">'."\n";
@ -234,7 +228,7 @@
{
$hidden_vars .= ' <input type="hidden" name="filter" value="'.$this->bo->filter.'">'."\n";
}
$hidden_vars .= ' <input name="keywords"'.($GLOBALS['HTTP_POST_VARS']['keywords']?' value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'"':'').'>';
$hidden_vars .= ' <input name="keywords"'.($keywords?' value="'.$keywords.'"':'').'>';
$var = Array(
'action_url_button' => $this->page('search'),

View File

@ -22,7 +22,7 @@
return '<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('calendar',$image).'" alt="'.$alt.'" border="0"></a>';
}
$refer = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
$refer = explode('.',MENUACTION);
$referrer = $refer[2];
$templates = Array(
@ -45,27 +45,27 @@
$tpl->set_var('cols',7);
}
$today = date('Ymd',time());
$today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
$col_width = 12;
add_col($tpl,' <td width="2%">&nbsp;</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).'</td>');
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week.gif',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This week')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month.gif',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This month')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year.gif',lang('This Year')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This Year')).'</td>');
if(floor(phpversion()) >= 4)
{
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
$col_width += 2;
}
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view',lang('Daily Matrix View')).'</td>');
add_col($tpl,' <td width="'.(100 - $col_width).'%" align="left"'.(floor(phpversion()) < 4?' colspan="2"':'').'>&nbsp;</td>');
@ -77,35 +77,51 @@
if($referrer!='view')
{
$remainder = 72;
$cal_id = get_var('cal_id',Array('GET','DEFAULT'),0);
$keywords = get_var('keywords',Array('POST','DEFAULT'),'');
$matrixtype = get_var('matrixtype',Array('POST','DEFAULT'),'');
$participants = get_var('participants',Array('POST'));
$var_list = Array(
'cal_id',
'keywords',
'matrixtype'
);
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$base_hidden_vars = '<input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
for($i=0;$i<count($var_list);$i++)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
if($($var_list[$i]))
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$($var_list[$i]).'">'."\n";
}
}
// if($cal_id != 0)
// {
// $base_hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
// }
// if($keywords)
// {
// $base_hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
// }
// if($matrixtype)
// {
// $base_hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
// }
$hidden_vars = '';
if($participants)
{
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")<br>\n"; }
$var = Array(
'form_width' => '28',
'form_link' => $this->page($referrer),
'form_name' => 'cat_id',
'title' => lang('Category'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => '<option value="0">All</option>'.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'),
'button_value' => lang('Go!')
);
@ -116,27 +132,14 @@
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
{
$remainder -= 28;
$hidden_vars = '<input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
$hidden_vars = '';
if($participants)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
{
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
}
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
{
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
for ($i=0;$i<count($participants);$i++)
{
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
}
}
if($this->debug) { echo 'Filter = ('.$this->bo->filter.")<br>\n"; }
$form_options = '<option value=" all "'.($this->bo->filter==' all '?' selected':'').'>'.lang('All').'</option>'."\n";
$form_options .= ' <option value=" private "'.((!isset($this->bo->filter) || !$this->bo->filter) || $this->bo->filter==' private '?' selected':'').'>'.lang('Private Only').'</option>'."\n";
@ -145,7 +148,7 @@
'form_link' => $this->page($referrer),
'form_name' => 'filter',
'title' => lang('Filter'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars.$hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -156,16 +159,6 @@
if((!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && count($this->bo->grants) > 0)
{
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords'])
{
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
}
if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0)
{
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$GLOBALS['HTTP_GET_VARS']['cal_id'].'">'."\n";
}
$hidden_vars .= ' <!-- BO Owner = '.$this->bo->owner.' -->'."\n";
$form_options = '';
reset($this->bo->grants);
while(list($grantor,$temp_rights) = each($this->bo->grants))
@ -198,21 +191,21 @@
);
}
}
@reset($drop_down);
@ksort($drop_down);
while(list($key,$grant) = each($drop_down))
{
$form_options .= ' <option value="'.$grant['value'].'"'.($grant['grantor']==$this->bo->owner?' selected':'').'>'.$grant['name'].'</option>'."\n";
}
}
reset($this->bo->grants);
$var = Array(
'form_width' => $remainder,
'form_link' => $this->page($referrer),
'form_name' => 'owner',
'title' => lang('User'),
'hidden_vars' => $hidden_vars,
'hidden_vars' => $base_hidden_vars,
'form_options' => $form_options,
'button_value' => lang('Go!')
);
@ -222,10 +215,11 @@
}
}
$hidden_vars = ' <input type="hidden" name="from" value="'.$GLOBALS['HTTP_GET_VARS']['menuaction'].'">'."\n";
if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date'])
$hidden_vars = ' <input type="hidden" name="from" value="'.MENUACTION.'">'."\n";
$date = get_var('date',Array('GET'));
if($date)
{
$hidden_vars .= ' <input type="hidden" name="date" value="'.$GLOBALS['HTTP_GET_VARS']['date'].'">'."\n";
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
}
$hidden_vars .= ' <input type="hidden" name="month" value="'.$this->bo->month.'">'."\n";
$hidden_vars .= ' <input type="hidden" name="day" value="'.$this->bo->day.'">'."\n";
@ -234,7 +228,7 @@
{
$hidden_vars .= ' <input type="hidden" name="filter" value="'.$this->bo->filter.'">'."\n";
}
$hidden_vars .= ' <input name="keywords"'.($GLOBALS['HTTP_POST_VARS']['keywords']?' value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'"':'').'>';
$hidden_vars .= ' <input name="keywords"'.($keywords?' value="'.$keywords.'"':'').'>';
$var = Array(
'action_url_button' => $this->page('search'),