Skip to content
Snippets Groups Projects

Feat/24620 journal 24h

Merged Jerome Boucher requested to merge feat/24620_journal_24h into develop
1 file
+ 16
7
Compare changes
  • Side-by-side
  • Inline
@@ -921,8 +921,12 @@ class journal
$fromDate = $previousJournal->toDate;
} else {
$previousJournalId = null;
$firstEvent = $this->sdoFactory->find('lifeCycle/event', null, null, "<eventDate", 0, 1);
$fromDate = $firstEvent->eventDate;
$firstEvents = $this->sdoFactory->find('lifeCycle/event', null, null, "<timestamp", 0, 1);
if (count($firstEvents)) {
$fromDate = $firstEvents[0]->timestamp;
} else {
return [];
}
}
// End date is now, will be lowered to start of current second
@@ -945,7 +949,7 @@ class journal
$minDate = $startTime,
$maxDate = $endTime,
$org = $ownerOrgRegNumber,
$sortBy = ">timestamp",
$sortBy = "<timestamp",
$maxResults = null
);
@@ -1031,15 +1035,15 @@ class journal
return $this->logController->archiveJournal($journalFilename, $journal, $timestampFileName);
}
protected function getPreviousJournalEvent($journal, $previousJournal)
protected function getPreviousJournalEvent($journal, $previousJournal = null)
{
// First event : chain with previous journal
$eventLine = array();
$eventLine[0] = (string) $newJournal->archiveId;
$eventLine[0] = (string) $journal->archiveId;
$eventLine[1] = "lifeCycle/chainJournal";
$eventLine[2] = (string) $newJournal->fromDate;
$eventLine[3] = (string) $newJournal->toDate;
$eventLine[2] = (string) $journal->fromDate;
$eventLine[3] = (string) $journal->toDate;
$eventLine[4] = $eventLine[5] = $eventLine[6] = $eventLine[7] = "";
// Write previous journal informations
@@ -1071,6 +1075,11 @@ class journal
$event->eventInfo = json_decode($event->eventInfo);
if (is_array($event->eventInfo)) {
foreach ($event->eventInfo as $i => $val) {
if (!is_scalar($val)) {
$event->eventInfo[$i] = "";
}
}
$eventLine = array_merge($eventLine, $event->eventInfo);
}
Loading