31if (!defined(
'NOREQUIREUSER')) {
32 define(
'NOREQUIREUSER',
'1');
35if (!defined(
'NOREQUIRESOC')) {
36 define(
'NOREQUIRESOC',
'1');
39if (!defined(
'NOCSRFCHECK')) {
40 define(
'NOCSRFCHECK', 1);
42if (!defined(
'NOTOKENRENEWAL')) {
43 define(
'NOTOKENRENEWAL', 1);
45if (!defined(
'NOLOGIN')) {
48if (!defined(
'NOREQUIREMENU')) {
49 define(
'NOREQUIREMENU', 1);
51if (!defined(
'NOREQUIREHTML')) {
52 define(
'NOREQUIREHTML', 1);
55require_once
'../main.inc.php';
56require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
59 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
63$langs->loadLangs(array(
"main",
"agenda"));
65$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
66$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
74print
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'.
"\n";
78 print
'<script nonce="'.getNonce().
'" type="text/javascript" src="'.DOL_URL_ROOT.
'/core/js/lib_head.js.php"></script>'.
"\n";
80 print
'<title>'.$langs->trans(
"Calendar").
'</title>';
85 $langs->trans(
"January"),
86 $langs->trans(
"February"),
87 $langs->trans(
"March"),
88 $langs->trans(
"April"),
90 $langs->trans(
"June"),
91 $langs->trans(
"July"),
92 $langs->trans(
"August"),
93 $langs->trans(
"September"),
94 $langs->trans(
"October"),
95 $langs->trans(
"November"),
96 $langs->trans(
"December")
98print
'<script nonce="'.getNonce().
'" type="text/javascript">';
99print
'var tradMonths = [';
100foreach ($tradTemp as $val) {
101 print
'"'.addslashes($val).
'",';
104print
'</script>'.
"\n";
113if (!isset($_GET[
"sd"])) {
114 $_GET[
"sd"] =
"00000000";
116if (!isset($_GET[
"m"]) || !isset($_GET[
"y"])) {
119if (isset($_GET[
"m"]) && isset($_GET[
"y"])) {
120 if ($_GET[
"m"] < 1 || $_GET[
"m"] > 12) {
123 if ($_GET[
"y"] < 0 || $_GET[
"y"] > 9999) {
136print
'</body></html>'.
"\n";
144function xyzToUnixTimestamp($mysqldate)
146 $year = (int) substr($mysqldate, 0, 4);
147 $month = (int) substr($mysqldate, 4, 2);
148 $day = (int) substr($mysqldate, 6, 2);
149 $unixtimestamp =
dol_mktime(12, 0, 0, $month, $day, $year);
151 return $unixtimestamp;
162function displayBox($selectedDate, $month, $year)
164 global $langs, $conf;
167 $thedate =
dol_mktime(12, 0, 0, $month, 1, $year);
171 if ($selectedDate !=
"00000000") {
172 $selDate = xyzToUnixTimestamp($selectedDate);
180 <td colspan=
"6" class=
"dpHead"><?php
183 echo $langs->trans(
"Month".$selectMonth).
", ".$selectYear; ?></td>
185 <
button type=
"button" class=
"dpInvisibleButtons" id=
"DPCancel"
186 onClick=
"closeDPBox();">X</
button>
190 <td
class=
"dpButtons"
191 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year - 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><<</td>
192 <td
class=
"dpButtons"
193 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 1) {
197 } ?>','<?php if ($month == 1) {
201 } ?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><</td>
202 <td colspan=
"3" class=
"dpButtons"
203 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo (int) dol_print_date($today, '%m')?>','<?php echo $todayArray["year
"]?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')"><?php echo
'-' ?></td>
204 <td
class=
"dpButtons"
205 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php if ($month == 12) {
209 } ?>','<?php if ($month == 12) {
213 } ?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">></td>
214 <td
class=
"dpButtons"
215 onClick=
"loadMonth('<?php echo DOL_URL_ROOT.'/core/' ?>','<?php echo $month?>','<?php echo $year + 1?>','<?php echo $xyz ?>','<?php echo $langs->defaultlang ?>')">>></td>
217 <tr
class=
"dpDayNames">
219 $startday = isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1;
220 $day_names = array(
'ShortSunday',
'ShortMonday',
'ShortTuesday',
'ShortWednesday',
'ShortThursday',
'ShortFriday',
'ShortSaturday');
221 for ($i = 0; $i < 7; $i++) {
222 echo
'<td width="', (int) (($i + 1) * 100 / 7) - (
int) ($i * 100 / 7),
'%">', $langs->trans($day_names[($i + $startday) % 7]),
'</td>',
"\n";
236 if ($mydate < $firstdate) {
237 echo
"<tr class=\"dpWeek\">";
240 for ($i = 0; $i < 7; $i++) {
241 $w = ($i + $startday) % 7;
242 if ($w == $firstdate[
"wday"]) {
243 $mydate = $firstdate;
246 echo
"<td> </td>";
250 if ($mydate[
"wday"] == $startday) {
251 echo
"<tr class=\"dpWeek\">";
257 if ($thedate == $selDate) {
258 $dayclass =
"dpSelected";
259 } elseif ($thedate == $today) {
260 $dayclass =
"dpToday";
263 if ($langs->trans(
"FormatDateShortJavaInput") ==
"FormatDateShortJavaInput") {
264 print
"ERROR FormatDateShortJavaInput not defined for language ".$langs->defaultlang;
269 echo
"<td class=\"".$dayclass.
"\"";
270 echo
" onMouseOver=\"dpHighlightDay(".$mydate[
"year"].
",parseInt('".
dol_print_date($thedate,
"%m").
"',10),".$mydate[
"mday"].
",tradMonths)\"";
271 echo
" onClick=\"dpClickDay(".$mydate[
"year"].
",parseInt('".
dol_print_date($thedate,
"%m").
"',10),".$mydate[
"mday"].
",'".$langs->trans(
"FormatDateShortJavaInput").
"')\"";
272 echo
">".sprintf(
"%02d", $mydate[
"mday"]).
"</td>";
275 if (($mydate[
"wday"] + 1) % 7 == $startday) {
281 $thedate =
dol_mktime(12, 0, 0, $month, $day, $year);
282 if ($thedate ==
'') {
286 if ($firstdate[
"month"] != $mydate[
"month"]) {
293 for ($i = 6; $i >= $cols; $i--) {
294 echo
"<td> </td>";
299 <td
id=
"dpExp" class=
"dpExplanation" colspan=
"7"><?php
302 print $langs->trans(
"Month".$selectMonth).
" ";
303 print sprintf(
"%02d", $tempDate[
"mday"]);
304 print
", ".$selectYear;
306 print
"Click a Date";
dol_get_first_day_week($day, $month, $year, $gm=false)
Return first day of week for a date.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type