diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 24de94121ca..8b886509081 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -462,8 +462,8 @@ if ($_GET["action"] == 'create')
print '';
if (! empty($_REQUEST["backtopage"])) print '';
- if ($_GET["actioncode"] == 'AC_RDV') print_titre ($langs->trans("AddActionRendezVous"));
- else print_titre ($langs->trans("AddAnAction"));
+ if ($_GET["actioncode"] == 'AC_RDV') print_fiche_titre ($langs->trans("AddActionRendezVous"));
+ else print_fiche_titre ($langs->trans("AddAnAction"));
if ($mesg) print $mesg.' ';
else print " ";
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 25058d3feeb..b93edb86263 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -121,9 +121,12 @@ $next_year = $next['year'];
$next_month = $next['month'];
$max_day_in_prev_month = date("t",dol_mktime(0,0,0,$prev_month,1,$prev_year)); // Nb of days in previous month
-$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); // Nb of days in next month
+$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); // Nb of days in next month
+// tmpday is a negative or null cursor to know how many days before the 1 to show on month view (if tmpday=0 we start on monday)
$tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2;
+$tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1);
if ($tmpday >= 1) $tmpday -= 7;
+// Define firstdaytoshow and lastdaytoshow
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
$next_day=7-($max_day_in_month+1-$tmpday)%7;
if ($next_day < 6) $next_day+=7;
@@ -433,17 +436,16 @@ else $link.=$langs->trans("AgendaHideBirthdayEvents");
$link.='';
print_fiche_titre('',$link);
-if ($_GET["action"] != 'show_day')
+if ($_GET["action"] != 'show_day') // View by month
{
echo '
\n";
// In loops, tmpday contains day nb in current month (can be negative for days of previous month)
@@ -491,22 +493,15 @@ if ($_GET["action"] != 'show_day')
}
echo "
\n";
}
-else
+else // View by day
{
// Code to show just one day
$style='cal_current_month';
$timestamp=dol_mktime(12,0,0,$month,$_GET["day"],$year);
$arraytimestamp=adodb_getdate(dol_mktime(12,0,0,$month,$_GET["day"],$year));
- $dayname=array( '0'=>'Sunday',
- '1'=>'Monday',
- '2'=>'Tuesday',
- '3'=>'Wednesday',
- '4'=>'Thursday',
- '5'=>'Friday',
- '6'=>'Saturday');
echo '