$next = dol_get_next_week($first_day, $week, $first_month, $first_year); $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); $tmpday = $first_day; } if ($action == 'show_day') { $prev = dol_get_prev_day($day, $month, $year); $prev_year = $prev['year']; $prev_month = $prev['month']; $prev_day = $prev['day']; $next = dol_get_next_day($day, $month, $year); $next_year = $next['year']; $next_month = $next['month']; $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year); $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; //print dol_print_date($firstdaytoshow,'day'); //print dol_print_date($lastdaytoshow,'day'); $title = $langs->trans("DoneAndToDoActions"); if ($status == 'done') { $title = $langs->trans("DoneActions"); }
$param .= "&type=" . $type; } if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month' || $action != 'show_peruser' || $action != 'show_pertype') { $param .= '&action=' . $action; } $param .= "&maxprint=" . $maxprint; $prev = dol_get_first_day($year, 1); $prev_year = $year - 1; $prev_month = $month; $prev_day = $day; $first_day = 1; $first_month = 1; $first_year = $year; $week = $prev['week']; $day = (int) $day; $next = dol_get_next_day(31, 12, $year); $next_year = $year + 1; $next_month = $month; $next_day = $day; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); //print $firstday.'-'.$first_month.'-'.$first_year; //print dol_print_date($firstdaytoshow,'dayhour'); //print dol_print_date($lastdaytoshow,'dayhour'); $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); $tmpday = $first_day; $nav = "<a href=\"?year=" . $prev_year . "&month=" . $prev_month . "&day=" . $prev_day . $param . "\">" . img_previous($langs->trans("Previous")) . "</a>\n"; $nav .= " <span id=\"month_name\">" . dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y") . "</span> \n"; $nav .= "<a href=\"?year=" . $next_year . "&month=" . $next_month . "&day=" . $next_day . $param . "\">" . img_next($langs->trans("Next")) . "</a>\n"; $nav .= " (<a href=\"?year=" . $nowyear . "&month=" . $nowmonth . "&day=" . $nowday . $param . "\">" . $langs->trans("Today") . "</a>)";