Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
9b3aaeaf
Verified
Commit
9b3aaeaf
authored
6 years ago
by
Giovannoni Laurent
Browse files
Options
Downloads
Patches
Plain Diff
FIX #8494
parent
fc2837d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/class/class_alert_engine.php
+21
-16
21 additions, 16 deletions
core/class/class_alert_engine.php
with
21 additions
and
16 deletions
core/class/class_alert_engine.php
+
21
−
16
View file @
9b3aaeaf
...
...
@@ -64,15 +64,18 @@ class alert_engine extends Database
if
(
$calendarType
<>
'calendar'
&&
$calendarType
<>
'workingDay'
)
{
$calendarType
=
$_SESSION
[
'features'
][
'type_calendar'
];
}
if
(
$calendarType
==
'calendar'
){
if
(
empty
(
$calendarType
))
{
$calendarType
=
'workingDay'
;
}
if
(
$calendarType
==
'calendar'
)
{
if
(
$isMinus
)
{
return
date
(
'Y-m-d H:i:s'
,
$Date
+
(
86400
*-
$Delta
));
}
else
{
return
date
(
'Y-m-d H:i:s'
,
$Date
+
(
86400
*
$Delta
));
}
}
elseif
(
$calendarType
==
'workingDay'
){
}
elseif
(
$calendarType
==
'workingDay'
)
{
$Hollidays
=
array
(
'1_1'
,
'1_5'
,
...
...
@@ -83,20 +86,23 @@ class alert_engine extends Database
'11_11'
,
'25_12'
);
require_once
'core/class/class_db_pdo.php'
;
$db
=
new
Database
();
$stmt
=
$db
->
query
(
"select * from parameters where id like 'alert_stop%'"
);
while
(
$result
=
$stmt
->
fetchObject
())
{
if
(
$result
->
param_value_date
<>
''
)
{
$compare
=
$this
->
compare_date
(
$result
->
param_value_date
,
date
(
"d-m-Y"
));
//take the alert stop only if > now
if
(
$compare
==
'date1'
||
$compare
==
'equal'
)
{
$dateExploded
=
explode
(
"-"
,
str_replace
(
" 00:00:00"
,
""
,
$result
->
param_value_date
));
array_push
(
$Hollidays
,
(
int
)
$dateExploded
[
2
]
.
"_"
.
(
int
)
$dateExploded
[
1
]);
if
(
!
empty
(
$_SESSION
[
'features'
][
'type_calendar'
]))
{
require_once
'core/class/class_db_pdo.php'
;
$db
=
new
Database
();
$stmt
=
$db
->
query
(
"select * from parameters where id like 'alert_stop%'"
);
while
(
$result
=
$stmt
->
fetchObject
())
{
if
(
$result
->
param_value_date
<>
''
)
{
$compare
=
$this
->
compare_date
(
$result
->
param_value_date
,
date
(
"d-m-Y"
));
//take the alert stop only if > now
if
(
$compare
==
'date1'
||
$compare
==
'equal'
)
{
$dateExploded
=
explode
(
"-"
,
str_replace
(
" 00:00:00"
,
""
,
$result
->
param_value_date
));
array_push
(
$Hollidays
,
(
int
)
$dateExploded
[
2
]
.
"_"
.
(
int
)
$dateExploded
[
1
]);
}
}
}
}
//var_dump($Hollidays);
if
(
function_exists
(
'easter_date'
))
{
...
...
@@ -136,8 +142,7 @@ class alert_engine extends Database
}
else
{
return
date
(
'Y-m-d H:i:s'
,
$Date
+
(
86400
*
$Delta
));
}
}
}
}
...
...
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