fix for bug #834436: changeing to an other year, month or week in the search-result get a template-error, set_root ...

This commit is contained in:
Ralf Becker 2003-11-03 09:21:26 +00:00
parent cde51aa8dd
commit 8ee52d717c

View File

@ -1,10 +1,11 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* phpGroupWare - Calendar * * eGroupWare - Calendar *
* http://www.phpgroupware.org * * http://www.eGroupWare.org *
* Maintained and further developed by RalfBecker@outdoor-training.de *
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> * * Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
* http://www.radix.net/~cknudsen * * http://www.radix.net/~cknudsen *
* Modified by Mark Peters <skeeter@phpgroupware.org> * * Originaly modified by Mark Peters <skeeter@phpgroupware.org> *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * 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 * * under the terms of the GNU General Public License as published by the *
@ -311,6 +312,16 @@
function index($params='') function index($params='')
{ {
if (!$params)
{
foreach(array('date','year','month','day') as $field)
{
if (isset($_GET[$field]))
{
$params[$field] = $_GET[$field];
}
}
}
$GLOBALS['phpgw']->redirect($this->page('',$params)); $GLOBALS['phpgw']->redirect($this->page('',$params));
} }
@ -2218,13 +2229,21 @@
{ {
if (empty($_POST['keywords'])) if (empty($_POST['keywords']))
{ {
// If we reach this, it is because they didn't search for anything, // If we reach this, it is because they didn't search for anything
// attempt to send them back to where they where. // or they used one of the selectboxes (year, month, week) in the search-result
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',array( // attempt to send them back to where they came from.
'menuaction' => $_POST['from'],
'date' => $_POST['year'].$_POST['month'].$_POST['day'] $vars['menuaction'] = isset($_POST['from']) && $_POST['from'] != 'calendar.uicalendar.search' ?
))); $_POST['from'] : 'calendar.uicalendar.index';
$GLOBALS['phpgw']->common->phpgw_exit();
foreach(array('date','year','month','day') as $field)
{
if (isset($_POST[$field]))
{
$vars[$field] = $_POST[$field];
}
}
$GLOBALS['phpgw']->redirect_link('/index.php',$vars);
} }
unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['noheader']);
@ -2370,7 +2389,15 @@
{ {
$page_app = $GLOBALS['phpgw_info']['flags']['currentapp']; $page_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
} }
return $GLOBALS['phpgw']->link('/index.php','menuaction='.$page_app.'.ui'.$page_app.'.'.$_page.$params); if (is_array($params))
{
$params['menuaction'] = $page_app.'.ui'.$page_app.'.'.$_page;
}
else
{
$params = 'menuaction='.$page_app.'.ui'.$page_app.'.'.$_page.$params;
}
return $GLOBALS['phpgw']->link('/index.php',$params);
} }
function header() function header()