89 if (!isset($this->settings[
'dateFormat'])) {
90 $this->settings[
'dateFormat'] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ?
'm-d-Y' :
'd-m-Y';
92 if (!isset($this->settings[
'timeFormat'])) {
93 $this->settings[
'timeFormat'] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm'];
95 $constraintConfiguration = $this->arguments->getArgument(
'constraint')->getPropertyMappingConfiguration();
96 $constraintConfiguration->allowAllProperties();
106 public function listAction(Constraint $constraint =
null,
int $pageId =
null,
string $layout =
'Default')
110 if ($constraint ===
null) {
115 $constraint->setPageId($pageId);
119 $logEntries = $this->logEntryRepository->findByConstraint($constraint);
121 $this->view->assignMultiple([
124 'groupedLogEntries' => $groupedLogEntries,
125 'constraint' => $constraint,
141 $logEntry = $this->logEntryRepository->findByUid($errorUid);
146 $numberOfDeletedRows = $this->logEntryRepository->deleteByMessageDetails($logEntry);
158 $serializedConstraint =
$GLOBALS[
'BE_USER']->getModuleData(static::class);
160 if (is_string($serializedConstraint) && !empty($serializedConstraint)) {
161 $constraint = @unserialize($serializedConstraint, [
'allowed_classes' => [Constraint::class, \DateTime::class]]);
163 return $constraint ?: $this->objectManager->get(Constraint::class);
173 $GLOBALS[
'BE_USER']->pushModuleData(static::class, serialize($constraint));
183 $reservedMemory = new \SplFixedArray(187500);
184 register_shutdown_function(
function () use (&$reservedMemory) {
185 $reservedMemory =
null;
186 $error = error_get_last();
187 if (strpos($error[
'message'],
'Allowed memory size of') !==
false) {
188 $constraint = $this->objectManager->get(Constraint::class);
210 $targetStructure = [];
212 foreach ($logEntries as $entry) {
215 $pid = $entry->getEventPid();
220 if (!is_array($targetStructure[$pid])) {
221 $targetStructure[$pid] = [];
224 $timestampDay = strtotime(strftime(
'%d.%m.%Y', $entry->getTstamp()));
225 if (!is_array($targetStructure[$pid][$timestampDay])) {
226 $targetStructure[$pid][$timestampDay] = [];
229 $targetStructure[$pid][$timestampDay][] = $entry;
231 ksort($targetStructure);
232 return $targetStructure;
244 $userGroupArray = [];
250 foreach ($groups as $group) {
255 foreach ($users as $user) {
258 return $userGroupArray;
268 if (!\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'workspaces')) {
271 $workspaceArray = [];
275 $workspaces = $this->objectManager->get(\
TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository::class)->findAll();
277 foreach ($workspaces as $workspace) {
278 $workspaceArray[$workspace->getUid()] = $workspace->getUid() .
': ' . $workspace->getTitle();
280 return $workspaceArray;
292 if (
$GLOBALS[
'BE_USER']->workspace !== 0) {
293 $constraint->setWorkspaceUid(
$GLOBALS[
'BE_USER']->workspace);
294 $this->view->assign(
'showWorkspaceSelector',
false);
296 $this->view->assign(
'showWorkspaceSelector',
true);
329 switch ($constraint->getTimeFrame()) {
332 $week = (date(
'w') ?: 7) - 1;
333 $startTime = mktime(0, 0, 0) - $week * 3600 * 24;
337 $week = (date(
'w') ?: 7) - 1;
338 $startTime = mktime(0, 0, 0) - ($week + 7) * 3600 * 24;
339 $endTime = mktime(0, 0, 0) - $week * 3600 * 24;
343 $startTime = mktime(0, 0, 0) - 7 * 3600 * 24;
347 $startTime = mktime(0, 0, 0, date(
'm'), 1);
351 $startTime = mktime(0, 0, 0, date(
'm') - 1, 1);
352 $endTime = mktime(0, 0, 0, date(
'm'), 1);
356 $startTime = mktime(0, 0, 0) - 31 * 3600 * 24;
359 $startTime = $constraint->getManualDateStart() ? $constraint->getManualDateStart()->getTimestamp() : 0;
360 $endTime = $constraint->getManualDateStop() ? $constraint->getManualDateStop()->getTimestamp() : 0;
361 if ($endTime <= $startTime) {
367 $constraint->setStartTimestamp($startTime);
368 $constraint->setEndTimestamp($endTime);