2001-04-28 23:56:24 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* 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)
|
|
|
|
{
|
2001-07-18 19:34:48 +02:00
|
|
|
global $phpgw;
|
|
|
|
return '<a href="'.$link.'"><img src="'.$phpgw->common->image('calendar',$image).'" alt="'.$alt.'" border="0"></a>';
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$refer = explode('.',$menuaction);
|
|
|
|
$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');
|
|
|
|
$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');
|
|
|
|
$tpl->set_var('cols',$cols);
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$today = date('Ymd',time());
|
|
|
|
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%"> </td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$link = $this->page('day','&date='.$today);
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%">'.add_image_ahref($link,'today.gif',lang('Today')).'</td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$link = $this->page('week','&date='.$today);
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'week.gif',lang('This week')).'</td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$link = $this->page('month','&date='.$today);
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'month.gif',lang('This month')).'</td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$link = $this->page('year','&date='.$today);
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'year.gif',lang('This Year')).'</td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-28 15:17:30 +02:00
|
|
|
$link = $this->page('planner','&date='.$today);
|
|
|
|
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'planner.gif',lang('Planner')).'</td>';
|
|
|
|
add_col($tpl,$str);
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$link = $this->page('matrixselect');
|
2001-04-28 23:56:24 +02:00
|
|
|
$str = ' <td width="2%" align="left">'.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).'</td>';
|
2001-07-18 19:34:48 +02:00
|
|
|
add_col($tpl,$str);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
2001-07-28 15:17:30 +02:00
|
|
|
$remainder = 63;
|
2001-07-18 19:34:48 +02:00
|
|
|
if($this->bo->check_perms(PHPGW_ACL_PRIVATE))
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2001-07-28 15:17:30 +02:00
|
|
|
$remainder -= 28;
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars = '<input type="hidden" name="from" value="'.$menuaction.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
if(isset($date) && $date)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
|
|
|
|
}
|
2001-07-18 19:34:48 +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-04-28 23:56:24 +02:00
|
|
|
if(isset($keywords) && $keywords)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
|
|
|
|
}
|
|
|
|
if(isset($matrixtype) && $matrixtype)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="matrixtype" value="'.$matrixtype.'">'."\n";
|
|
|
|
}
|
|
|
|
if(isset($participants) && $participants)
|
|
|
|
{
|
|
|
|
for ($i=0;$i<count($participants);$i++)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="participants[]" value="'.$participants[$i].'">'."\n";
|
|
|
|
}
|
|
|
|
}
|
2001-07-18 19:34:48 +02:00
|
|
|
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";
|
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),
|
2001-04-28 23:56:24 +02:00
|
|
|
'form_name' => 'filter',
|
|
|
|
'title' => lang('Filter'),
|
|
|
|
'hidden_vars' => $hidden_vars,
|
|
|
|
'form_options' => $form_options,
|
|
|
|
'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
|
|
|
}
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
if(count($this->bo->grants) > 0)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars = ' <input type="hidden" name="from" value="'.$menuaction.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
if(isset($date) && $date)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
|
|
|
|
}
|
2001-07-18 19:34:48 +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-04-28 23:56:24 +02:00
|
|
|
if(isset($keywords) && $keywords)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\n";
|
|
|
|
}
|
2001-07-18 19:34:48 +02:00
|
|
|
if(isset($cal_id) && $cal_id != 0)
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars .= ' <input type="hidden" name="cal_id" value="'.$cal_id.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
|
|
|
$form_options = '';
|
2001-07-18 19:34:48 +02:00
|
|
|
reset($this->bo->grants);
|
|
|
|
while(list($grantor,$temp_rights) = each($this->bo->grants))
|
2001-04-28 23:56:24 +02:00
|
|
|
{
|
2001-07-18 19:34:48 +02:00
|
|
|
$form_options .= ' <option value="'.$grantor.'"'.($grantor==$this->bo->owner?' selected':'').'>'.$phpgw->common->grab_owner_name($grantor).'</option>'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
}
|
2001-07-18 19:34:48 +02:00
|
|
|
reset($this->bo->grants);
|
2001-04-28 23:56:24 +02:00
|
|
|
|
|
|
|
$var = Array(
|
|
|
|
'form_width' => $remainder,
|
2001-07-18 19:34:48 +02:00
|
|
|
'form_link' => $this->page($referrer),
|
2001-04-28 23:56:24 +02:00
|
|
|
'form_name' => 'owner',
|
|
|
|
'title' => lang('User'),
|
|
|
|
'hidden_vars' => $hidden_vars,
|
|
|
|
'form_options' => $form_options,
|
|
|
|
'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
|
|
|
}
|
|
|
|
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars = ' <input type="hidden" name="from" value="'.$menuaction.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
if(isset($date) && $date)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="date" value="'.$date.'">'."\n";
|
|
|
|
}
|
2001-07-18 19:34:48 +02:00
|
|
|
$hidden_vars .= ' <input type="hidden" name="month" value="'.$this->so->month.'">'."\n";
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="day" value="'.$this->so->day.'">'."\n";
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="year" value="'.$this->so->year.'">'."\n";
|
2001-04-28 23:56:24 +02:00
|
|
|
if(isset($keywords) && $keywords)
|
|
|
|
{
|
|
|
|
$hidden_vars .= ' <input type="hidden" name="keywords" value="'.$keywords.'">'."\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
|
|
|
}
|
|
|
|
$extra_field = $hidden_vars.' <input name="keywords"'.($keywords?' value="'.$keywords.'"':'').'>';
|
|
|
|
|
|
|
|
$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' => '',
|
|
|
|
'action_extra_field' => $extra_field
|
|
|
|
);
|
|
|
|
$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);
|
|
|
|
?>
|