Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
c73f4a14
Commit
c73f4a14
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Bad days returned by function
parent
742d0e37
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/comm/action/index.php
+22
-33
22 additions, 33 deletions
htdocs/comm/action/index.php
with
22 additions
and
33 deletions
htdocs/comm/action/index.php
+
22
−
33
View file @
c73f4a14
...
@@ -184,18 +184,19 @@ if ($action=='show_week')
...
@@ -184,18 +184,19 @@ if ($action=='show_week')
$prev_month
=
$prev
[
'prev_month'
];
$prev_month
=
$prev
[
'prev_month'
];
$prev_day
=
$prev
[
'prev_day'
];
$prev_day
=
$prev
[
'prev_day'
];
$first_day
=
$prev
[
'first_day'
];
$first_day
=
$prev
[
'first_day'
];
$first_month
=
$prev
[
'first_month'
];
$first_year
=
$prev
[
'first_year'
];
$week
=
$prev
[
'week'
];
$week
=
$prev
[
'week'
];
$day
=
(
int
)
$day
;
$day
=
(
int
)
$day
;
$next
=
dol_get_next_week
(
$day
,
$week
,
$month
,
$year
);
$next
=
dol_get_next_week
(
$
first_
day
,
$week
,
$
first_
month
,
$
first_
year
);
$next_year
=
$next
[
'year'
];
$next_year
=
$next
[
'year'
];
$next_month
=
$next
[
'month'
];
$next_month
=
$next
[
'month'
];
$next_day
=
$next
[
'day'
];
$next_day
=
$next
[
'day'
];
// Define firstdaytoshow and lastdaytoshow
// Define firstdaytoshow and lastdaytoshow
$firstdaytoshow
=
dol_mktime
(
0
,
0
,
0
,
$
prev
_month
,
$first_day
,
$
prev
_year
);
$firstdaytoshow
=
dol_mktime
(
0
,
0
,
0
,
$
first
_month
,
$first_day
,
$
first
_year
);
$lastdaytoshow
=
dol_
mk
time
(
0
,
0
,
0
,
$next_month
,
$next_day
,
$next_year
);
$lastdaytoshow
=
dol_time
_plus_duree
(
$firstdaytoshow
,
7
,
'd'
);
$max_day_in_month
=
date
(
"t"
,
dol_mktime
(
0
,
0
,
0
,
$month
,
1
,
$year
));
$max_day_in_month
=
date
(
"t"
,
dol_mktime
(
0
,
0
,
0
,
$month
,
1
,
$year
));
...
@@ -870,40 +871,28 @@ elseif ($action == 'show_week') // View by week
...
@@ -870,40 +871,28 @@ elseif ($action == 'show_week') // View by week
}
}
echo
" </tr>
\n
"
;
echo
" </tr>
\n
"
;
// In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month)
//var_dump($eventarray);
//print $tmpday;
echo
" <tr>
\n
"
;
echo
" <tr>
\n
"
;
for
(
$iter_day
=
0
;
$iter_day
<
7
;
$iter_day
++
)
for
(
$iter_day
=
0
;
$iter_day
<
7
;
$iter_day
++
)
{
if
((
$tmpday
<=
$max_day_in_month
))
{
{
// Show days of the current week
// Show days of the current week
$curtime
=
dol_mktime
(
0
,
0
,
0
,
$month
,
$tmpday
,
$year
);
$curtime
=
dol_time_plus_duree
(
$firstdaytoshow
,
$iter_day
,
'd'
);
$tmparray
=
dol_getdate
(
$curtime
,
'fast'
);
$tmpday
=
$tmparray
[
'mday'
];
$tmpmonth
=
$tmparray
[
'mon'
];
$tmpyear
=
$tmparray
[
'year'
];
$style
=
'cal_current_month'
;
$style
=
'cal_current_month'
;
if
(
$iter_day
==
6
)
$style
.
=
' cal_other_month_right'
;
if
(
$iter_day
==
6
)
$style
.
=
' cal_other_month_right'
;
$today
=
0
;
$today
=
0
;
$todayarray
=
dol_getdate
(
$now
,
'fast'
);
$todayarray
=
dol_getdate
(
$now
,
'fast'
);
if
(
$todayarray
[
'mday'
]
==
$tmpday
&&
$todayarray
[
'mon'
]
==
$month
&&
$todayarray
[
'year'
]
==
$year
)
$today
=
1
;
if
(
$todayarray
[
'mday'
]
==
$tmpday
&&
$todayarray
[
'mon'
]
==
$
tmp
month
&&
$todayarray
[
'year'
]
==
$
tmp
year
)
$today
=
1
;
if
(
$today
)
$style
=
'cal_today'
;
if
(
$today
)
$style
=
'cal_today'
;
echo
' <td class="'
.
$style
.
'
nowrap
" width="14%" valign="top">'
;
echo
' <td class="'
.
$style
.
'" width="14%" valign="top">'
;
show_day_events
(
$db
,
$tmpday
,
$month
,
$year
,
$month
,
$style
,
$eventarray
,
0
,
$maxnbofchar
,
$newparam
,
1
,
300
);
show_day_events
(
$db
,
$tmpday
,
$
tmp
month
,
$
tmp
year
,
$month
,
$style
,
$eventarray
,
0
,
$maxnbofchar
,
$newparam
,
1
,
300
);
echo
" </td>
\n
"
;
echo
" </td>
\n
"
;
}
}
else
{
$style
=
'cal_current_month'
;
if
(
$iter_day
==
6
)
$style
.
=
' cal_other_month_right'
;
echo
' <td class="'
.
$style
.
' nowrap" width="14%" valign="top">'
;
show_day_events
(
$db
,
$tmpday
-
$max_day_in_month
,
$next_month
,
$next_year
,
$month
,
$style
,
$eventarray
,
0
,
$maxnbofchar
,
$newparam
,
1
,
300
);
echo
"</td>
\n
"
;
}
$tmpday
++
;
}
echo
" </tr>
\n
"
;
echo
" </tr>
\n
"
;
echo
"</table>
\n
"
;
echo
"</table>
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment