@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | switch ($this->get('type')) { |
| 216 | 216 | case 1: |
| 217 | 217 | $this->queryGenerator->addNativeCondition([ |
| 218 | - 'and', ['>=', $columnA, $startFormatted], ['<=', $columnA, $endFormatted] |
|
| 218 | + 'and', ['>=', $columnA, $startFormatted], ['<=', $columnA, $endFormatted] |
|
| 219 | 219 | ]); |
| 220 | 220 | break; |
| 221 | 221 | case 3: |
@@ -224,9 +224,9 @@ discard block |
||
| 224 | 224 | $this->queryGenerator->setField($fieldB->getName()); |
| 225 | 225 | $this->queryGenerator->addNativeCondition([ |
| 226 | 226 | 'or', |
| 227 | - ['and', ['>=', $columnA, $startFormatted], ['<=', $columnA, $endFormatted]], |
|
| 228 | - ['and', ['>=', $columnB, $startFormatted], ['<=', $columnB, $endFormatted]], |
|
| 229 | - ['and', ['<', $columnA, $startFormatted], ['>', $columnB, $endFormatted]], |
|
| 227 | + ['and', ['>=', $columnA, $startFormatted], ['<=', $columnA, $endFormatted]], |
|
| 228 | + ['and', ['>=', $columnB, $startFormatted], ['<=', $columnB, $endFormatted]], |
|
| 229 | + ['and', ['<', $columnA, $startFormatted], ['>', $columnB, $endFormatted]], |
|
| 230 | 230 | ]); |
| 231 | 231 | break; |
| 232 | 232 | case 2: |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | 'or', |
| 238 | 238 | [ |
| 239 | 239 | 'and', |
| 240 | - ['>=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $startDateTime], |
|
| 241 | - ['<=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $endDateTime], |
|
| 240 | + ['>=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $startDateTime], |
|
| 241 | + ['<=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $endDateTime], |
|
| 242 | 242 | ], |
| 243 | 243 | ]); |
| 244 | 244 | break; |
@@ -256,16 +256,16 @@ discard block |
||
| 256 | 256 | 'or', |
| 257 | 257 | [ |
| 258 | 258 | 'and', |
| 259 | - ['>=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $startDateTime], |
|
| 260 | - ['<=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $endDateTime], |
|
| 259 | + ['>=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $startDateTime], |
|
| 260 | + ['<=', new \yii\db\Expression("CONCAT($columnA, ' ', $columnATime)"), $endDateTime], |
|
| 261 | 261 | ], |
| 262 | 262 | [ |
| 263 | 263 | 'and', |
| 264 | - ['>=', new \yii\db\Expression("CONCAT($columnB, ' ', $columnBTime)"), $startDateTime], |
|
| 265 | - ['<=', new \yii\db\Expression("CONCAT($columnB, ' ', $columnBTime)"), $endDateTime], |
|
| 264 | + ['>=', new \yii\db\Expression("CONCAT($columnB, ' ', $columnBTime)"), $startDateTime], |
|
| 265 | + ['<=', new \yii\db\Expression("CONCAT($columnB, ' ', $columnBTime)"), $endDateTime], |
|
| 266 | 266 | ], |
| 267 | 267 | [ |
| 268 | - 'and', ['<', $columnA, $startDate], ['>', $columnB, $endDate], |
|
| 268 | + 'and', ['<', $columnA, $startDate], ['>', $columnB, $endDate], |
|
| 269 | 269 | ], |
| 270 | 270 | ]); |
| 271 | 271 | break; |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | { |
| 105 | 105 | $dbCommand = \App\Db::getInstance('admin')->createCommand(); |
| 106 | 106 | if (null !== $name) { |
| 107 | - $data = ['name' => "{$type}_last_{$name}", 'value' => $id]; |
|
| 107 | + $data = ['name' => "{$type}_last_{$name}", 'value' => $id]; |
|
| 108 | 108 | } else { |
| 109 | 109 | $data = ['name' => $type . '_start_date', 'value' => date('Y-m-d H:i:s')]; |
| 110 | 110 | } |
@@ -464,7 +464,7 @@ |
||
| 464 | 464 | public function addToQueue(string $type, int $id): void |
| 465 | 465 | { |
| 466 | 466 | $data = ['server_id' => $this->config->get('id'), |
| 467 | - 'name' => $this->name, 'type' => $type, 'value' => $id, |
|
| 467 | + 'name' => $this->name, 'type' => $type, 'value' => $id, |
|
| 468 | 468 | ]; |
| 469 | 469 | $db = \App\Db::getInstance('admin'); |
| 470 | 470 | if ((new \App\Db\Query())->from(\App\Integrations\Comarch::QUEUE_TABLE_NAME) |
@@ -256,7 +256,7 @@ |
||
| 256 | 256 | \App\Log::trace("Updated: {$field['tablename']}.{$field['columnname']} |maximumlength: before:{$field['maximumlength']} after: $range |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__); |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | - return ['NotSupported' => $notSupported, 'TypeNotFound' => $typeNotFound, 'RequiresVerification' => $requiresVerification, 'RequiresVerificationInfo' => $requiresVerificationInfo, 'Updated' => $updated, 'UpdatedInfo' => $updatedInfo]; |
|
| 259 | + return ['NotSupported' => $notSupported, 'TypeNotFound' => $typeNotFound, 'RequiresVerification' => $requiresVerification, 'RequiresVerificationInfo' => $requiresVerificationInfo, 'Updated' => $updated, 'UpdatedInfo' => $updatedInfo]; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -17,41 +17,41 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class Comarch extends \App\SystemWarnings\Template |
| 19 | 19 | { |
| 20 | - /** {@inheritdoc} */ |
|
| 21 | - protected $title = 'LBL_CHECK_COMARCH_INTEGRATION_LOG'; |
|
| 20 | + /** {@inheritdoc} */ |
|
| 21 | + protected $title = 'LBL_CHECK_COMARCH_INTEGRATION_LOG'; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Checks for suspended email accounts. |
|
| 25 | - * |
|
| 26 | - * @return void |
|
| 27 | - */ |
|
| 28 | - public function process(): void |
|
| 29 | - { |
|
| 30 | - $db = \App\DB::getInstance('log'); |
|
| 31 | - if(!$db->isTableExists(\App\Integrations\Comarch::LOG_TABLE_NAME)) { |
|
| 32 | - $this->status = 1; |
|
| 33 | - return; |
|
| 34 | - } |
|
| 35 | - $data = (new \App\Db\Query())->select(['time', 'message'])->from(\App\Integrations\Comarch::LOG_TABLE_NAME) |
|
| 36 | - ->where([ |
|
| 37 | - 'and', |
|
| 38 | - ['error' => 1], |
|
| 39 | - ['>=', 'time', date('Y-m-d H:i:s', strtotime('-24 hours'))] |
|
| 40 | - ])->orderBy(['id' => SORT_DESC]) |
|
| 41 | - ->all($db); |
|
| 42 | - if ($data) { |
|
| 43 | - $this->status = 0; |
|
| 44 | - $this->description = \App\Language::translate('LBL_CHECK_COMARCH_INTEGRATION_LOG_DESC', 'Settings:SystemWarnings'); |
|
| 45 | - $this->description .= '<br>' . \App\TextUtils::getHtmlTable($data, [ |
|
| 46 | - 'time' => \App\Language::translate('LBL_TIME', 'Settings:Log'), |
|
| 47 | - 'message' => \App\Language::translate('LBL_MESSAGE', 'Settings:Comarch') |
|
| 48 | - ]); |
|
| 49 | - if (\App\Security\AdminAccess::isPermitted('Log')) { |
|
| 50 | - $this->link = 'index.php?parent=Settings&module=Log&view=LogsViewer&type=mail'; |
|
| 51 | - $this->linkTitle = \App\Language::translate('LBL_LOGS_VIEWER', 'Settings:Log'); |
|
| 52 | - } |
|
| 53 | - } else { |
|
| 54 | - $this->status = 1; |
|
| 55 | - } |
|
| 56 | - } |
|
| 23 | + /** |
|
| 24 | + * Checks for suspended email accounts. |
|
| 25 | + * |
|
| 26 | + * @return void |
|
| 27 | + */ |
|
| 28 | + public function process(): void |
|
| 29 | + { |
|
| 30 | + $db = \App\DB::getInstance('log'); |
|
| 31 | + if(!$db->isTableExists(\App\Integrations\Comarch::LOG_TABLE_NAME)) { |
|
| 32 | + $this->status = 1; |
|
| 33 | + return; |
|
| 34 | + } |
|
| 35 | + $data = (new \App\Db\Query())->select(['time', 'message'])->from(\App\Integrations\Comarch::LOG_TABLE_NAME) |
|
| 36 | + ->where([ |
|
| 37 | + 'and', |
|
| 38 | + ['error' => 1], |
|
| 39 | + ['>=', 'time', date('Y-m-d H:i:s', strtotime('-24 hours'))] |
|
| 40 | + ])->orderBy(['id' => SORT_DESC]) |
|
| 41 | + ->all($db); |
|
| 42 | + if ($data) { |
|
| 43 | + $this->status = 0; |
|
| 44 | + $this->description = \App\Language::translate('LBL_CHECK_COMARCH_INTEGRATION_LOG_DESC', 'Settings:SystemWarnings'); |
|
| 45 | + $this->description .= '<br>' . \App\TextUtils::getHtmlTable($data, [ |
|
| 46 | + 'time' => \App\Language::translate('LBL_TIME', 'Settings:Log'), |
|
| 47 | + 'message' => \App\Language::translate('LBL_MESSAGE', 'Settings:Comarch') |
|
| 48 | + ]); |
|
| 49 | + if (\App\Security\AdminAccess::isPermitted('Log')) { |
|
| 50 | + $this->link = 'index.php?parent=Settings&module=Log&view=LogsViewer&type=mail'; |
|
| 51 | + $this->linkTitle = \App\Language::translate('LBL_LOGS_VIEWER', 'Settings:Log'); |
|
| 52 | + } |
|
| 53 | + } else { |
|
| 54 | + $this->status = 1; |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function process(): void |
| 29 | 29 | { |
| 30 | 30 | $db = \App\DB::getInstance('log'); |
| 31 | - if(!$db->isTableExists(\App\Integrations\Comarch::LOG_TABLE_NAME)) { |
|
| 31 | + if (!$db->isTableExists(\App\Integrations\Comarch::LOG_TABLE_NAME)) { |
|
| 32 | 32 | $this->status = 1; |
| 33 | 33 | return; |
| 34 | 34 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $separator = '-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~::~:~::-'; |
| 715 | 715 | $value = (string) $this->vcomponent->{$davName}; |
| 716 | 716 | if (false !== strpos($value, $separator)) { |
| 717 | - [$html,$text] = explode($separator, $value, 2); |
|
| 717 | + [$html, $text] = explode($separator, $value, 2); |
|
| 718 | 718 | $value = trim(strip_tags($html)) . "\n" . trim(str_replace($separator, '', $text)); |
| 719 | 719 | } else { |
| 720 | 720 | $value = trim(str_replace('\n', PHP_EOL, $value)); |
@@ -877,14 +877,14 @@ discard block |
||
| 877 | 877 | $currentUser = \App\User::getCurrentUserModel(); |
| 878 | 878 | $userTimeZone = new \DateTimeZone($currentUser->getDetail('time_zone')); |
| 879 | 879 | $sysTimeZone = new \DateTimeZone(\App\Fields\DateTime::getTimeZone()); |
| 880 | - [$hour , $minute] = explode(':', $currentUser->getDetail('start_hour')); |
|
| 880 | + [$hour, $minute] = explode(':', $currentUser->getDetail('start_hour')); |
|
| 881 | 881 | $date = new \DateTime('now', $userTimeZone); |
| 882 | 882 | $date->setTime($hour, $minute); |
| 883 | 883 | $date->setTimezone($sysTimeZone); |
| 884 | 884 | $timeStart = $date->format('H:i:s'); |
| 885 | 885 | |
| 886 | 886 | $date->setTimezone($userTimeZone); |
| 887 | - [$hour , $minute] = explode(':', $currentUser->getDetail('end_hour')); |
|
| 887 | + [$hour, $minute] = explode(':', $currentUser->getDetail('end_hour')); |
|
| 888 | 888 | $date->setTime($hour, $minute); |
| 889 | 889 | $date->setTimezone($sysTimeZone); |
| 890 | 890 | $timeEnd = $date->format('H:i:s'); |