From 1bbba0e9b3b6882e4d394b6a4b51316908812207 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 8 Feb 2019 11:11:53 +0200 Subject: [PATCH 1/4] fix formula floatval --- .../Core/Formula/Functions/EntityGroup/SumRelatedType.php | 2 +- .../Espo/Core/Formula/Functions/NumericGroup/DivisionType.php | 4 ++-- .../Espo/Core/Formula/Functions/NumericGroup/ModuloType.php | 4 ++-- .../Formula/Functions/NumericGroup/MultiplicationType.php | 4 ++-- .../Core/Formula/Functions/NumericGroup/SubtractionType.php | 4 ++-- .../Core/Formula/Functions/NumericGroup/SummationType.php | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/application/Espo/Core/Formula/Functions/EntityGroup/SumRelatedType.php b/application/Espo/Core/Formula/Functions/EntityGroup/SumRelatedType.php index 80c5ffd1d9..31fbeaf88b 100644 --- a/application/Espo/Core/Formula/Functions/EntityGroup/SumRelatedType.php +++ b/application/Espo/Core/Formula/Functions/EntityGroup/SumRelatedType.php @@ -118,6 +118,6 @@ class SumRelatedType extends \Espo\Core\Formula\Functions\Base return 0; } - return $rowList[0]['SUM:' . $field]; + return floatval($rowList[0]['SUM:' . $field]); } } \ No newline at end of file diff --git a/application/Espo/Core/Formula/Functions/NumericGroup/DivisionType.php b/application/Espo/Core/Formula/Functions/NumericGroup/DivisionType.php index e4a2edcea4..f81fc7b9f4 100644 --- a/application/Espo/Core/Formula/Functions/NumericGroup/DivisionType.php +++ b/application/Espo/Core/Formula/Functions/NumericGroup/DivisionType.php @@ -1,4 +1,4 @@ -evaluate($item->value[0]); $part = $this->evaluate($item->value[1]); if (!is_float($part) && !is_int($part)) { - $part = intval($part); + $part = floatval($part); } $result /= $part; diff --git a/application/Espo/Core/Formula/Functions/NumericGroup/ModuloType.php b/application/Espo/Core/Formula/Functions/NumericGroup/ModuloType.php index c4d6e58f42..1f4087b7ed 100644 --- a/application/Espo/Core/Formula/Functions/NumericGroup/ModuloType.php +++ b/application/Espo/Core/Formula/Functions/NumericGroup/ModuloType.php @@ -1,4 +1,4 @@ -evaluate($subItem); if (!is_float($part) && !is_int($part)) { - $part = intval($part); + $part = floatval($part); } $result %= $part; diff --git a/application/Espo/Core/Formula/Functions/NumericGroup/MultiplicationType.php b/application/Espo/Core/Formula/Functions/NumericGroup/MultiplicationType.php index 33a5251e72..6dd3a31877 100644 --- a/application/Espo/Core/Formula/Functions/NumericGroup/MultiplicationType.php +++ b/application/Espo/Core/Formula/Functions/NumericGroup/MultiplicationType.php @@ -1,4 +1,4 @@ -evaluate($subItem); if (!is_float($part) && !is_int($part)) { - $part = intval($part); + $part = floatval($part); } $result *= $part; diff --git a/application/Espo/Core/Formula/Functions/NumericGroup/SubtractionType.php b/application/Espo/Core/Formula/Functions/NumericGroup/SubtractionType.php index cb5b336a19..3abb84d22b 100644 --- a/application/Espo/Core/Formula/Functions/NumericGroup/SubtractionType.php +++ b/application/Espo/Core/Formula/Functions/NumericGroup/SubtractionType.php @@ -1,4 +1,4 @@ -evaluate($item->value[0]); $part = $this->evaluate($item->value[1]); if (!is_float($part) && !is_int($part)) { - $part = intval($part); + $part = floatval($part); } $result -= $part; diff --git a/application/Espo/Core/Formula/Functions/NumericGroup/SummationType.php b/application/Espo/Core/Formula/Functions/NumericGroup/SummationType.php index a275d30b4d..7d5378ca72 100644 --- a/application/Espo/Core/Formula/Functions/NumericGroup/SummationType.php +++ b/application/Espo/Core/Formula/Functions/NumericGroup/SummationType.php @@ -1,4 +1,4 @@ -evaluate($subItem); if (!is_float($part) && !is_int($part)) { - $part = intval($part); + $part = floatval($part); } $result += $part; From 618792b54115a8ae9200a6be8e1e53490e0d82fc Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 8 Feb 2019 12:56:49 +0200 Subject: [PATCH 2/4] fix flotr --- client/lib/flotr2.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/lib/flotr2.js b/client/lib/flotr2.js index 4cc8f70302..16f5c3553d 100644 --- a/client/lib/flotr2.js +++ b/client/lib/flotr2.js @@ -5156,7 +5156,7 @@ Flotr.addPlugin('hit', { x: (this.plotWidth)/2, y: (this.plotHeight)/2 }, - radius = (Math.min(this.canvasWidth, this.canvasHeight) * s.pie.sizeRatio) / 2, + radius = (Math.min(this.canvasWidth, this.canvasHeight) * s.pie.sizeRatio), // EspoCRM fix line bisection = n.sAngle this.plotHeight * 2 / 3) { + p = 'n'; + } else { + p = 's'; + } + } // EspoCRM fix end pos += 'top:'; From ed64c93aa070c08b6b8aefc1843411968333ffc9 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 8 Feb 2019 13:44:29 +0200 Subject: [PATCH 3/4] custom mass action ignore select all result --- client/src/views/record/list.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index 8f847261f9..3ef8be09fb 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -876,6 +876,7 @@ Espo.define('views/record/list', 'view', function (Dep) { this.checkAllResultMassActionList = checkAllResultMassActionList; (this.getMetadata().get(['clientDefs', this.scope, 'checkAllResultMassActionList']) || []).forEach(function (item) { + if (this.collection.url !== this.entityType) return; if (~this.massActionList.indexOf(item)) { var defs = this.getMetadata().get(['clientDefs', this.scope, 'massActionDefs', item]) || {}; var acl = defs.acl; From 9b78cf401b7a9bc31e9b8371e805140b352dec03 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 8 Feb 2019 14:02:47 +0200 Subject: [PATCH 4/4] fix mass actions --- client/src/views/record/list.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index 3ef8be09fb..e52fa20361 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -406,6 +406,8 @@ Espo.define('views/record/list', 'view', function (Dep) { selectAllResult: function () { this.allResultIsChecked = true; + this.hideActions(); + this.$el.find('input.record-checkbox').prop('checked', true).attr('disabled', 'disabled'); this.$el.find('input.select-all').prop('checked', true); @@ -926,14 +928,14 @@ Espo.define('views/record/list', 'view', function (Dep) { this.addMassAction('printPdf'); } - if (this.collection.url !== this.entityType) { - this.removeAllResultMassAction('massUpdate'); - this.removeAllResultMassAction('remove'); - this.removeAllResultMassAction('export'); - } - this.setupMassActionItems(); + if (this.collection.url !== this.entityType) { + Espo.Utils.clone(this.checkAllResultMassActionList).forEach(function (item) { + this.removeAllResultMassAction(item); + }, this); + } + if (this.selectable) { this.events['click .list a.link'] = function (e) { e.preventDefault();