2001-04-28 23:56:24 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2004-01-27 02:03:43 +01:00
|
|
|
* eGroupWare *
|
|
|
|
* http://www.egroupware.org *
|
2001-04-28 23:56:24 +02:00
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
function add_col(&$tpl,$str)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
|
|
|
$tpl->set_var('str',$str);
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_image_ahref($link,$image,$alt)
|
|
|
|
{
|
2002-08-25 06:07:21 +02:00
|
|
|
return '<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('calendar',$image).'" alt="'.$alt.'" title="'.$alt.'" border="0"></a>';
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
|
|
|
|
2003-08-28 16:31:11 +02:00
|
|
|
$refer = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
|
2001-07-18 19:34:48 +02:00
|
|
|
$referrer = $refer[2];
|
|
|
|
|
2001-04-28 23:56:24 +02:00
|
|
|
$templates = Array(
|
2001-05-13 05:48:17 +02:00
|
|
|
'head_tpl' => 'head.tpl',
|
2001-04-28 23:56:24 +02:00
|
|
|
'form_button_dropdown' => 'form_button_dropdown.tpl',
|
|
|
|
'form_button_script' => 'form_button_script.tpl'
|
|
|
|
);
|
|
|
|
$tpl->set_file($templates);
|
2001-05-13 05:48:17 +02:00
|
|
|
$tpl->set_block('head_tpl','head','head');
|
2001-09-20 23:29:16 +02:00
|
|
|
$tpl->set_block('head_tpl','head_table','head_table');
|
2001-05-13 05:48:17 +02:00
|
|
|
$tpl->set_block('head_tpl','head_col','head_col');
|
2001-04-28 23:56:24 +02:00
|
|
|
$tpl->set_block('form_button_script','form_button');
|
2001-09-20 23:29:16 +02:00
|
|
|
|
|
|
|
if(floor(phpversion()) >= 4)
|
|
|
|
{
|
|
|
|
$tpl->set_var('cols',8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$tpl->set_var('cols',7);
|
|
|
|
}
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
$today = date('Ymd',$GLOBALS['phpgw']->datetime->users_localtime);
|
2001-07-18 19:34:48 +02:00
|
|
|
|
2001-09-20 23:29:16 +02:00
|
|
|
$col_width = 12;
|
|
|
|
|
2001-08-13 23:35:26 +02:00
|
|
|
add_col($tpl,' <td width="2%"> </td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This week')).'</td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This month')).'</td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This Year')).'</td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-08-17 21:40:48 +02:00
|
|
|
if(floor(phpversion()) >= 4)
|
|
|
|
{
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
|
2001-09-20 23:29:16 +02:00
|
|
|
$col_width += 2;
|
2001-08-17 21:40:48 +02:00
|
|
|
}
|
2001-07-28 15:17:30 +02:00
|
|
|
|
2002-08-17 17:36:10 +02:00
|
|
|
add_col($tpl,' <td width="2%" align="left">'.add_image_ahref($this->page('matrixselect'),'view',lang('Daily Matrix View')).'</td>');
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-09-20 23:29:16 +02:00
|
|
|
add_col($tpl,' <td width="'.(100 - $col_width).'%" align="left"'.(floor(phpversion()) < 4?' colspan="2"':'').'> </td>');
|
|
|
|
|
2003-08-28 16:31:11 +02:00
|
|
|
$tpl->parse('row','head_table',True);
|
2001-09-20 23:29:16 +02:00
|
|
|
|
|
|
|
$tpl->set_var('header_column','');
|
|
|
|
$tpl->set_var('cols',$cols);
|
|
|
|
|
2002-04-05 15:56:08 +02:00
|
|
|
if($referrer!='view')
|
2001-09-20 23:29:16 +02:00
|
|
|
{
|
2002-04-05 15:56:08 +02:00
|
|
|
$remainder = 72;
|
2003-08-28 16:31:11 +02:00
|
|
|
|
|
|
|
$date = (isset($GLOBALS['date'])?$GLOBALS['date']:'');
|
|
|
|
$date = (isset($GLOBALS['HTTP_GET_VARS']['date'])?$GLOBALS['HTTP_GET_VARS']['date']:$date);
|
|
|
|
$date = ($date=='' && isset($GLOBALS['HTTP_POST_VARS']['date'])?$GLOBALS['HTTP_POST_VARS']['date']:$date);
|
2001-09-20 23:29:16 +02:00
|
|
|
|
2003-08-28 16:31:11 +02:00
|
|
|
$base_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)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2003-08-28 16:31:11 +02:00
|
|
|
$base_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'])
|
|
|
|
{
|
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="keywords" value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
2003-08-28 16:31:11 +02:00
|
|
|
if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype'])
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2003-08-28 16:31:11 +02:00
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$GLOBALS['HTTP_POST_VARS']['matrixtype'].'">'."\n";
|
|
|
|
}
|
|
|
|
if($date)
|
|
|
|
{
|
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
|
|
|
|
}
|
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="month" value="'.$this->bo->month.'">'."\n";
|
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="day" value="'.$this->bo->day.'">'."\n";
|
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="year" value="'.$this->bo->year.'">'."\n";
|
|
|
|
|
|
|
|
if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
|
|
|
|
{
|
|
|
|
for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);$i++)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2003-08-28 16:31:11 +02:00
|
|
|
$base_hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
|
|
|
}
|
2002-04-05 15:56:08 +02:00
|
|
|
|
2001-04-28 23:56:24 +02:00
|
|
|
$var = Array(
|
2001-07-28 15:17:30 +02:00
|
|
|
'form_width' => '28',
|
2001-07-18 19:34:48 +02:00
|
|
|
'form_link' => $this->page($referrer),
|
2002-04-05 15:56:08 +02:00
|
|
|
'form_name' => 'cat_id',
|
|
|
|
'title' => lang('Category'),
|
2003-08-28 16:31:11 +02:00
|
|
|
'hidden_vars' => $base_hidden_vars,
|
2004-02-29 18:04:33 +01:00
|
|
|
'form_options' => '<option value="0">'.lang('All').'</option>'.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'),
|
2001-04-28 23:56:24 +02:00
|
|
|
'button_value' => lang('Go!')
|
|
|
|
);
|
|
|
|
$tpl->set_var($var);
|
2001-07-18 19:34:48 +02:00
|
|
|
$tpl->set_var('str',$tpl->fp('out','form_button_dropdown'));
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2003-08-28 16:31:11 +02:00
|
|
|
if($GLOBALS['HTTP_GET_VARS']['menuaction'] == 'calendar.uicalendar.planner')
|
2002-08-25 14:33:57 +02:00
|
|
|
{
|
|
|
|
$remainder -= 28;
|
|
|
|
print_debug('Sort By',$this->bo->sortby);
|
|
|
|
|
|
|
|
$form_options = '<option value="user"'.($this->bo->sortby=='user'?' selected':'').'>'.lang('User').'</option>'."\n";
|
|
|
|
$form_options .= ' <option value="category"'.((!isset($this->bo->sortby) || !$this->bo->sortby) || $this->bo->sortby=='category'?' selected':'').'>'.lang('Category').'</option>'."\n";
|
|
|
|
|
|
|
|
$var = Array(
|
|
|
|
'form_width' => '28',
|
|
|
|
'form_link' => $this->page($referrer),
|
|
|
|
'form_name' => 'sortby',
|
|
|
|
'title' => lang('Sort By'),
|
|
|
|
'hidden_vars' => $base_hidden_vars,
|
|
|
|
'form_options' => $form_options,
|
|
|
|
'button_value' => lang('Go!')
|
|
|
|
);
|
|
|
|
$tpl->set_var($var);
|
|
|
|
$tpl->set_var('str',$tpl->fp('out','form_button_dropdown'));
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
|
|
|
}
|
|
|
|
|
2002-04-05 15:56:08 +02:00
|
|
|
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2002-04-05 15:56:08 +02:00
|
|
|
$remainder -= 28;
|
|
|
|
$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";
|
2003-08-28 16:31:11 +02:00
|
|
|
|
2002-04-05 15:56:08 +02:00
|
|
|
$var = Array(
|
|
|
|
'form_width' => '28',
|
|
|
|
'form_link' => $this->page($referrer),
|
|
|
|
'form_name' => 'filter',
|
|
|
|
'title' => lang('Filter'),
|
2003-08-28 16:31:11 +02:00
|
|
|
'hidden_vars' => $base_hidden_vars,
|
2002-04-05 15:56:08 +02:00
|
|
|
'form_options' => $form_options,
|
|
|
|
'button_value' => lang('Go!')
|
2001-09-18 03:00:50 +02:00
|
|
|
);
|
2002-04-05 15:56:08 +02:00
|
|
|
$tpl->set_var($var);
|
|
|
|
$tpl->set_var('str',$tpl->fp('out','form_button_dropdown'));
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
2001-09-18 03:00:50 +02:00
|
|
|
}
|
2002-01-10 03:01:07 +01:00
|
|
|
|
2002-04-05 15:56:08 +02:00
|
|
|
if((!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && count($this->bo->grants) > 0)
|
|
|
|
{
|
|
|
|
$form_options = '';
|
2003-08-28 16:31:11 +02:00
|
|
|
$drop_down = $this->bo->list_cals();
|
|
|
|
foreach($drop_down as $key => $grant)
|
2002-04-05 15:56:08 +02:00
|
|
|
{
|
|
|
|
$form_options .= ' <option value="'.$grant['value'].'"'.($grant['grantor']==$this->bo->owner?' selected':'').'>'.$grant['name'].'</option>'."\n";
|
2002-08-17 17:36:10 +02:00
|
|
|
}
|
2003-08-28 16:31:11 +02:00
|
|
|
|
2002-04-05 15:56:08 +02:00
|
|
|
$var = Array(
|
|
|
|
'form_width' => $remainder,
|
|
|
|
'form_link' => $this->page($referrer),
|
|
|
|
'form_name' => 'owner',
|
|
|
|
'title' => lang('User'),
|
2002-08-17 17:36:10 +02:00
|
|
|
'hidden_vars' => $base_hidden_vars,
|
2002-04-05 15:56:08 +02:00
|
|
|
'form_options' => $form_options,
|
|
|
|
'button_value' => lang('Go!')
|
|
|
|
);
|
|
|
|
$tpl->set_var($var);
|
|
|
|
$tpl->set_var('str',$tpl->fp('out','form_button_dropdown'));
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
|
|
|
}
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
|
|
|
|
2003-08-28 16:31:11 +02:00
|
|
|
$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'])
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2003-08-28 16:31:11 +02:00
|
|
|
$hidden_vars .= ' <input type="hidden" name="date" value="'.$GLOBALS['HTTP_GET_VARS']['date'].'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
2001-09-07 18:55:58 +02:00
|
|
|
$hidden_vars .= ' <input type="hidden" name="month" value="'.$this->bo->month.'">'."\n";
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="day" value="'.$this->bo->day.'">'."\n";
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="year" value="'.$this->bo->year.'">'."\n";
|
2001-07-18 19:34:48 +02:00
|
|
|
if(isset($this->bo->filter) && $this->bo->filter)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars .= ' <input type="hidden" name="filter" value="'.$this->bo->filter.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
2002-08-25 14:33:57 +02:00
|
|
|
if(isset($this->bo->sortby) && $this->bo->sortby)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="sortby" value="'.$this->bo->sortby.'">'."\n";
|
|
|
|
}
|
|
|
|
if(isset($this->bo->num_months) && $this->bo->num_months)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="num_months" value="'.$this->bo->num_months.'">'."\n";
|
|
|
|
}
|
2003-08-28 16:31:11 +02:00
|
|
|
$hidden_vars .= ' <input name="keywords"'.($GLOBALS['HTTP_POST_VARS']['keywords']?' value="'.$GLOBALS['HTTP_POST_VARS']['keywords'].'"':'').'>';
|
2002-08-17 17:36:10 +02:00
|
|
|
|
2001-04-28 23:56:24 +02:00
|
|
|
$var = Array(
|
2001-07-18 19:34:48 +02:00
|
|
|
'action_url_button' => $this->page('search'),
|
2001-04-28 23:56:24 +02:00
|
|
|
'action_text_button' => lang('Search'),
|
|
|
|
'action_confirm_button' => '',
|
2001-08-12 16:47:23 +02:00
|
|
|
'action_extra_field' => $hidden_vars
|
2001-04-28 23:56:24 +02:00
|
|
|
);
|
|
|
|
$tpl->set_var($var);
|
|
|
|
$button = $tpl->fp('out','form_button');
|
|
|
|
$tpl->set_var('str','<td align="right" valign="bottom">'.$button.'</td>');
|
|
|
|
$tpl->parse('header_column','head_col',True);
|
2003-08-28 16:31:11 +02:00
|
|
|
$tpl->parse('row','head_table',True);
|
2001-04-28 23:56:24 +02:00
|
|
|
?>
|