Skip to content
Snippets Groups Projects
Commit 37ecf4d0 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #14975 TIME 0:25 disable processLimitDate

parent daa4ae12
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ while ($state <> 'END') { ...@@ -75,7 +75,7 @@ while ($state <> 'END') {
$user = $users[0]; $user = $users[0];
// Alert 1 = limit - n days // Alert 1 = limit - n days
if ($myDoc['flag_alarm1'] != 'Y' && $myDoc['flag_alarm2'] != 'Y') { if ($myDoc['flag_alarm1'] != 'Y' && $myDoc['flag_alarm2'] != 'Y' && $myDoctype['delay1'] > 0) {
$processDate = \Resource\controllers\IndexingController::calculateProcessDate(['date' => $myDoc['process_limit_date'], 'delay' => $myDoctype['delay1'], 'sub' => true]); $processDate = \Resource\controllers\IndexingController::calculateProcessDate(['date' => $myDoc['process_limit_date'], 'delay' => $myDoctype['delay1'], 'sub' => true]);
if (strtotime($processDate) <= time()) { if (strtotime($processDate) <= time()) {
Bt_writeLog(['level' => 'INFO', 'message' => "Alarm 1 will be sent"]); Bt_writeLog(['level' => 'INFO', 'message' => "Alarm 1 will be sent"]);
...@@ -96,7 +96,7 @@ while ($state <> 'END') { ...@@ -96,7 +96,7 @@ while ($state <> 'END') {
} }
// Alert 2 = limit + n days // Alert 2 = limit + n days
if ($myDoc['flag_alarm2'] != 'Y') { if ($myDoc['flag_alarm2'] != 'Y' && $myDoctype['delay2'] > 0) {
$processDate = \Resource\controllers\IndexingController::calculateProcessDate(['date' => $myDoc['process_limit_date'], 'delay' => $myDoctype['delay2']]); $processDate = \Resource\controllers\IndexingController::calculateProcessDate(['date' => $myDoc['process_limit_date'], 'delay' => $myDoctype['delay2']]);
if (strtotime($processDate) <= time()) { if (strtotime($processDate) <= time()) {
Bt_writeLog(['level' => 'INFO', 'message' => "Alarm 2 will be sent"]); Bt_writeLog(['level' => 'INFO', 'message' => "Alarm 2 will be sent"]);
......
...@@ -233,10 +233,13 @@ class IndexingController ...@@ -233,10 +233,13 @@ class IndexingController
if (!empty($queryParams['doctype'])) { if (!empty($queryParams['doctype'])) {
$doctype = DoctypeModel::getById(['id' => $queryParams['doctype'], 'select' => ['process_delay']]); $doctype = DoctypeModel::getById(['id' => $queryParams['doctype'], 'select' => ['process_delay']]);
$delay = $doctype['process_delay']; $delay = $doctype['process_delay'];
} elseif (!empty($queryParams['priority'])) { } elseif (!empty($queryParams['priority'])) {
$priority = PriorityModel::getById(['id' => $queryParams['priority'], 'select' => ['delays']]); $priority = PriorityModel::getById(['id' => $queryParams['priority'], 'select' => ['delays']]);
$delay = $priority['delays']; $delay = $priority['delays'];
}
if ($delay == 0) {
return $response->withJson(['processLimitDate' => null]);
} }
if (!isset($delay) || !Validator::intVal()->validate($delay)) { if (!isset($delay) || !Validator::intVal()->validate($delay)) {
return $response->withStatus(400)->withJson(['errors' => 'Delay is not a numeric value']); return $response->withStatus(400)->withJson(['errors' => 'Delay is not a numeric value']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment