From c9ee7d8b97379cff0a2eefc4a75fe2311234902c Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 8 Mar 2011 19:39:21 +0000 Subject: [PATCH] task #10885: Start work --- htdocs/comm/action/index.php | 15 ++++++++++++++- htdocs/lib/agenda.lib.php | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 139fd4b878a..2474349e2d2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011 Juanjo Menent * * 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 @@ -74,7 +75,7 @@ $status=GETPOST("status"); $maxprint=GETPOST("maxprint"); if (GETPOST('viewcal')) { $action='show_month'; $day=''; } // View by month -if (GETPOST('viewweek')) { $action='show_week'; $week='TODO'; } // View by week +if (GETPOST('viewweek')) { $action='show_week'; $week=date("W"); } // View by week if (GETPOST('viewday')) { $action='show_day'; $day=date("d"); } // View by day $langs->load("other"); @@ -141,6 +142,10 @@ if (empty($action) || $action=='show_month') $next_day=7-($max_day_in_month+1-$tmpday)%7; if ($next_day < 6) $next_day+=7; $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); +} +if ($action=='show_week') +{ + } if ($action=='show_day') { @@ -186,6 +191,10 @@ if (empty($action) || $action=='show_month') $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b %Y"); $nav.=" \n"; $nav.="".img_next($langs->trans("Next"))."\n"; +} +if ($action=='show_week') +{ + } if ($action=='show_day') { @@ -507,6 +516,10 @@ if (empty($action) || $action == 'show_month') // View by month } echo "\n"; } +elseif ($action == 'show_week') // View by day +{ + print $langs->trans("FeatureNotYetAvailable"); //Work in progress... +} else // View by day { // Code to show just one day diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php index 65366fab7dc..6fdcb4f3cb3 100644 --- a/htdocs/lib/agenda.lib.php +++ b/htdocs/lib/agenda.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2011 Juanjo Menent * * 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 @@ -103,6 +104,8 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbort print ''; print img_picto($langs->trans("ViewCal"),'object_calendar').' '; print '
'; + print img_picto($langs->trans("ViewWeek"),'object_calendarweek').' '; + print '
'; print img_picto($langs->trans("ViewDay"),'object_calendarday').' '; print '
'; print img_picto($langs->trans("ViewList"),'object_list').' ';