From 73e3ef3a823fd6eea98205c5492774bf98daa75c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jun 2013 22:12:17 +0200 Subject: [PATCH] Fix: Bad return url --- htdocs/comm/action/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7e59a9e2748..165101e3cfa 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -759,7 +759,9 @@ if (empty($action) || $action == 'show_month') // View by month $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewcal=1'; echo ''; echo ' '; $i=0; @@ -830,7 +832,9 @@ elseif ($action == 'show_week') // View by week $newparam=preg_replace('/day=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/month=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/year=[0-9]+&?/i','',$newparam); + $newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter + $newparam.='&viewweek=1'; echo '
'; echo ' '; $i=0; @@ -884,6 +888,8 @@ else // View by day $newparam=$param; // newparam is for birthday links $newparam=preg_replace('/action=show_month&?/i','',$newparam); $newparam=preg_replace('/action=show_week&?/i','',$newparam); + $newparam=preg_replace('/viewday=[0-9]+&?/i','',$newparam); + $newparam.='&viewday=1'; // Code to show just one day $style='cal_current_month'; $today=0; @@ -950,6 +956,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $theme_datacolor; global $cachethirdparties, $cachecontacts, $colorindexused; + print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print '
'; @@ -957,7 +964,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; if ($showinfo) print dol_print_date($curtime,'daytext'); else print dol_print_date($curtime,'%d'); @@ -965,6 +971,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; print '';