From 3cf94bb728c16912d36d29a13e471f9c86e77e81 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 31 Mar 2021 12:17:18 +0300 Subject: [PATCH 1/4] Notification fixes --- client/src/views/notification/badge.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/views/notification/badge.js b/client/src/views/notification/badge.js index f0972bf9ca..2cffe3f72d 100644 --- a/client/src/views/notification/badge.js +++ b/client/src/views/notification/badge.js @@ -152,7 +152,11 @@ define('views/notification/badge', 'view', function (Dep) { checkBypass: function () { var last = this.getRouter().getLast() || {}; - if (last.controller == 'Admin' && last.action == 'upgrade') { + if ( + last.controller == 'Admin' + && + ~['upgrade', 'extensions'].indexOf(last.action) + ) { return true; } }, From c8bd2ec1a137ddaf9a3b5ebb185cf02ef84461b6 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 31 Mar 2021 14:39:47 +0300 Subject: [PATCH 2/4] Time format fixes --- .../Espo/Resources/defaults/config.php | 2 +- upgrades/6.1.5-6.1.6/data.json | 4 ++ upgrades/6.1.5-6.1.6/scripts/AfterUpgrade.php | 52 +++++++++++++++++++ upgrades/6.1/scripts/AfterUpgrade.php | 25 ++++++--- 4 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 upgrades/6.1.5-6.1.6/data.json create mode 100644 upgrades/6.1.5-6.1.6/scripts/AfterUpgrade.php diff --git a/application/Espo/Resources/defaults/config.php b/application/Espo/Resources/defaults/config.php index 12601e155d..2263b1bbef 100644 --- a/application/Espo/Resources/defaults/config.php +++ b/application/Espo/Resources/defaults/config.php @@ -44,7 +44,7 @@ return [ 'version' => '@@version', 'timeZone' => 'UTC', 'dateFormat' => 'DD.MM.YYYY', - 'timeFormat' => 'hh:mm', + 'timeFormat' => 'HH:mm', 'weekStart' => 0, 'thousandSeparator' => ',', 'decimalMark' => '.', diff --git a/upgrades/6.1.5-6.1.6/data.json b/upgrades/6.1.5-6.1.6/data.json new file mode 100644 index 0000000000..bdca4f6cfd --- /dev/null +++ b/upgrades/6.1.5-6.1.6/data.json @@ -0,0 +1,4 @@ +{ + "manifest": { + } +} \ No newline at end of file diff --git a/upgrades/6.1.5-6.1.6/scripts/AfterUpgrade.php b/upgrades/6.1.5-6.1.6/scripts/AfterUpgrade.php new file mode 100644 index 0000000000..f380ed73b6 --- /dev/null +++ b/upgrades/6.1.5-6.1.6/scripts/AfterUpgrade.php @@ -0,0 +1,52 @@ +container = $container; + + $this->fixTimeFormat(); + } + + protected function fixTimeFormat() + { + $config = $this->container->get('config'); + + $actualTimeFormat = $config->get('timeFormat'); + + if ($actualTimeFormat === 'hh:mm') { + $config->set('timeFormat', 'HH:mm'); + $config->save(); + } + } +} diff --git a/upgrades/6.1/scripts/AfterUpgrade.php b/upgrades/6.1/scripts/AfterUpgrade.php index 1696d5cb8a..79660d39a4 100644 --- a/upgrades/6.1/scripts/AfterUpgrade.php +++ b/upgrades/6.1/scripts/AfterUpgrade.php @@ -35,17 +35,28 @@ class AfterUpgrade { $this->container = $container; - $config = $container->get('config'); - - $config->set('pdfEngine', 'Tcpdf'); - - $config->save(); + $this->updateConfig(); $this->removeUnnecessaryFiles(); $this->removeUnnecessaryDirectories(); } - public function removeUnnecessaryFiles() + protected function updateConfig() + { + $config = $this->container->get('config'); + + $actualTimeFormat = $config->get('timeFormat'); + + if ($actualTimeFormat === 'hh:mm') { + $config->set('timeFormat', 'HH:mm'); + } + + $config->set('pdfEngine', 'Tcpdf'); + + $config->save(); + } + + protected function removeUnnecessaryFiles() { $fileList = [ 'vendor/spatie/async/.git/objects/pack/pack-14ab89d3ff365322e20cfd44252880928aaa4ed6.idx', @@ -72,7 +83,7 @@ class AfterUpgrade } } - public function removeUnnecessaryDirectories() + protected function removeUnnecessaryDirectories() { $directoryList = [ 'vendor/spatie/async/.git', From e86ec32dd7a7d356a70df76f2a641f3d5e76d1af Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 31 Mar 2021 15:12:46 +0300 Subject: [PATCH 3/4] Hide permission warnings --- application/Espo/Core/Utils/File/Permission.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/Utils/File/Permission.php b/application/Espo/Core/Utils/File/Permission.php index 679c9e0e06..e6eddf68a4 100644 --- a/application/Espo/Core/Utils/File/Permission.php +++ b/application/Espo/Core/Utils/File/Permission.php @@ -390,7 +390,7 @@ class Permission protected function chmodReal($filename, $mode) { try { - $result = chmod($filename, $mode); + $result = @chmod($filename, $mode); } catch (\Exception $e) { $result = false; } @@ -400,7 +400,7 @@ class Permission $this->chgrp($filename, $this->getDefaultGroup(true)); try { - $result = chmod($filename, $mode); + $result = @chmod($filename, $mode); } catch (\Exception $e) { throw new Error($e->getMessage()); } @@ -412,7 +412,7 @@ class Permission protected function chownReal($path, $user) { try { - $result = chown($path, $user); + $result = @chown($path, $user); } catch (\Exception $e) { throw new Error($e->getMessage()); } @@ -423,7 +423,7 @@ class Permission protected function chgrpReal($path, $group) { try { - $result = chgrp($path, $group); + $result = @chgrp($path, $group); } catch (\Exception $e) { throw new Error($e->getMessage()); } From c1b7e0630822cd7bc31b6373893da3d5d99ce97c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 1 Apr 2021 13:27:42 +0300 Subject: [PATCH 4/4] remove noJoin --- .../Modules/Crm/Resources/metadata/entityDefs/Contact.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json index 0c1476706d..a980cd347d 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json @@ -645,8 +645,7 @@ "campaign": { "type": "belongsTo", "entity": "Campaign", - "foreign": "contacts", - "noJoin": true + "foreign": "contacts" }, "campaignLogRecords": { "type": "hasChildren",