| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function process(): void |
||
| 29 | { |
||
| 30 | $data = (new \App\Db\Query())->select(['time', 'message'])->from(\App\Integrations\Comarch::LOG_TABLE_NAME) |
||
| 31 | ->where([ |
||
| 32 | 'and', |
||
| 33 | ['error' => 1], |
||
| 34 | ['>=', 'time', date('Y-m-d H:i:s', strtotime('-24 hours'))] |
||
| 35 | ])->orderBy(['id' => SORT_DESC]) |
||
| 36 | ->all(\App\DB::getInstance('log')); |
||
| 37 | if ($data) { |
||
| 38 | $this->status = 0; |
||
| 39 | $this->description = \App\Language::translate('LBL_CHECK_COMARCH_INTEGRATION_LOG_DESC', 'Settings:SystemWarnings'); |
||
| 40 | $this->description .= '<br>' . \App\TextUtils::getHtmlTable($data, [ |
||
| 41 | 'time' => \App\Language::translate('LBL_TIME', 'Settings:Log'), |
||
| 42 | 'message' => \App\Language::translate('LBL_MESSAGE', 'Settings:Comarch') |
||
| 43 | ]); |
||
| 44 | if (\App\Security\AdminAccess::isPermitted('Log')) { |
||
| 45 | $this->link = 'index.php?parent=Settings&module=Log&view=LogsViewer&type=mail'; |
||
| 46 | $this->linkTitle = \App\Language::translate('LBL_LOGS_VIEWER', 'Settings:Log'); |
||
| 47 | } |
||
| 48 | } else { |
||
| 49 | $this->status = 1; |
||
| 50 | } |
||
| 53 |