task #10885: Start work

This commit is contained in:
Juanjo Menent 2011-03-08 19:39:21 +00:00
parent 5fba658540
commit c9ee7d8b97
2 changed files with 17 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b %Y");
$nav.=" </span>\n";
$nav.="<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;region=".$region.$param."\">".img_next($langs->trans("Next"))."</a>\n";
}
if ($action=='show_week')
{
}
if ($action=='show_day')
{
@ -507,6 +516,10 @@ if (empty($action) || $action == 'show_month') // View by month
}
echo "</table>\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

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 '<td align="center" valign="middle" nowrap="nowrap">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" class="button" style="width:120px" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '<br>';
print img_picto($langs->trans("ViewWeek"),'object_calendarweek').' <input type="submit" class="button" style="width:120px" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '<br>';
print img_picto($langs->trans("ViewDay"),'object_calendarday').' <input type="submit" class="button" style="width:120px" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '<br>';
print img_picto($langs->trans("ViewList"),'object_list').' <input type="submit" class="button" style="width:120px" name="viewlist" value="'.$langs->trans("ViewList").'">';