From 9dd35f1e32b6902371b5b97135c78abe4ae63fd8 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 11:45:47 +0300 Subject: [PATCH 01/11] opp empty probability for stages --- application/Espo/Modules/Crm/Repositories/Opportunity.php | 4 +++- client/modules/crm/src/views/opportunity/fields/stage.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/Espo/Modules/Crm/Repositories/Opportunity.php b/application/Espo/Modules/Crm/Repositories/Opportunity.php index 725059a4eb..78312efc68 100644 --- a/application/Espo/Modules/Crm/Repositories/Opportunity.php +++ b/application/Espo/Modules/Crm/Repositories/Opportunity.php @@ -38,7 +38,9 @@ class Opportunity extends \Espo\Core\ORM\Repositories\RDB if ($entity->isNew()) { if (!$entity->has('probability') && $entity->get('stage')) { $probability = $this->getMetadata()->get('entityDefs.Opportunity.fields.stage.probabilityMap.' . $entity->get('stage'), 0); - $entity->set('probability', $probability); + if (!is_null($probability)) { + $entity->set('probability', $probability); + } } } diff --git a/client/modules/crm/src/views/opportunity/fields/stage.js b/client/modules/crm/src/views/opportunity/fields/stage.js index 47e72dab99..9b20374ac8 100644 --- a/client/modules/crm/src/views/opportunity/fields/stage.js +++ b/client/modules/crm/src/views/opportunity/fields/stage.js @@ -37,7 +37,10 @@ Espo.define('crm:views/opportunity/fields/stage', 'views/fields/enum', function if (this.mode != 'list') { this.on('change', function () { - this.model.set('probability', this.probabilityMap[this.model.get(this.name)]); + var probability = this.probabilityMap[this.model.get(this.name)]; + if (probability !== null && probability !== undefined) { + this.model.set('probability', probability); + } }, this); } } From 22600893016887c8cc423b3c326f3aa55a5638bf Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 11:57:22 +0300 Subject: [PATCH 02/11] upgrade message --- application/Espo/Resources/i18n/en_US/Admin.json | 3 ++- client/res/templates/admin/upgrade/index.tpl | 8 +++++++- client/src/views/admin/upgrade/index.js | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json index 2f21bd280d..25cb545395 100644 --- a/application/Espo/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Resources/i18n/en_US/Admin.json @@ -202,7 +202,8 @@ "cronIsNotConfigured": "Scheduled jobs are not running. Hence inbound emails, notifications and reminders are not working. Please follow the [instructions](https://www.espocrm.com/documentation/administration/server-configuration/#user-content-setup-a-crontab) to setup cron job.", "newVersionIsAvailable": "New EspoCRM version {latestVersion} is available.", "newExtensionVersionIsAvailable": "New {extensionName} version {latestVersion} is available.", - "uninstallConfirmation": "Are you sure you want to uninstall the extension?" + "uninstallConfirmation": "Are you sure you want to uninstall the extension?", + "upgradeInfo": "Check the documentation about how to upgrade your EspoCRM instance." }, "descriptions": { "settings": "System settings of application.", diff --git a/client/res/templates/admin/upgrade/index.tpl b/client/res/templates/admin/upgrade/index.tpl index e17cefe1c0..78d3719aff 100644 --- a/client/res/templates/admin/upgrade/index.tpl +++ b/client/res/templates/admin/upgrade/index.tpl @@ -1,10 +1,15 @@ +
+
+

{{versionMsg}}

+ {{{infoMsg}}} +

{{backupsMsg}}

@@ -29,4 +34,5 @@
- +
+ \ No newline at end of file diff --git a/client/src/views/admin/upgrade/index.js b/client/src/views/admin/upgrade/index.js index eaa8e23263..9cd79fa1ab 100644 --- a/client/src/views/admin/upgrade/index.js +++ b/client/src/views/admin/upgrade/index.js @@ -37,8 +37,9 @@ Espo.define('views/admin/upgrade/index', 'view', function (Dep) { data: function () { return { versionMsg: this.translate('Current version') + ': ' + this.getConfig().get('version'), + infoMsg: this.translate('upgradeInfo', 'messages', 'Admin').replace('{url}', 'https://www.espocrm.com/documentation/administration/upgrading/'), backupsMsg: this.translate('upgradeBackup', 'messages', 'Admin'), - downloadMsg: this.translate('downloadUpgradePackage', 'messages', 'Admin').replace('{url}', 'http://www.espocrm.com/download/upgrades') + downloadMsg: this.translate('downloadUpgradePackage', 'messages', 'Admin').replace('{url}', 'https://www.espocrm.com/download/upgrades') }; }, From ab4b975912ba38554f5ac674989771aee0e7af61 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 11:59:38 +0300 Subject: [PATCH 03/11] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 57832d6a2d..76519d17c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "5.6.1", + "version": "5.6.2", "description": "", "main": "index.php", "repository": { From 74fa9289a75b745364404b9a12fed7ea92b03fee Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 13:13:35 +0300 Subject: [PATCH 04/11] lead capture enhancements --- .../Resources/i18n/en_US/LeadCapture.json | 3 +- .../Resources/layouts/LeadCapture/detail.json | 1 + .../LeadCaptureLogRecord/detailSmall.json | 10 +++++ .../layouts/LeadCaptureLogRecord/filters.json | 4 ++ .../listForLeadCapture.json | 5 ++- .../metadata/clientDefs/LeadCapture.json | 2 +- .../clientDefs/LeadCaptureLogRecord.json | 5 +++ .../metadata/entityDefs/LeadCapture.json | 4 ++ application/Espo/Services/LeadCapture.php | 4 +- .../lead-capture-log-record/modals/detail.js | 38 +++++++++++++++++++ 10 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 application/Espo/Resources/layouts/LeadCaptureLogRecord/detailSmall.json create mode 100644 application/Espo/Resources/layouts/LeadCaptureLogRecord/filters.json create mode 100644 application/Espo/Resources/metadata/clientDefs/LeadCaptureLogRecord.json create mode 100644 client/src/views/lead-capture-log-record/modals/detail.js diff --git a/application/Espo/Resources/i18n/en_US/LeadCapture.json b/application/Espo/Resources/i18n/en_US/LeadCapture.json index 654da64b3e..80d9fbb9f2 100644 --- a/application/Espo/Resources/i18n/en_US/LeadCapture.json +++ b/application/Espo/Resources/i18n/en_US/LeadCapture.json @@ -16,7 +16,8 @@ "targetTeam": "Target Team", "exampleRequestMethod": "Method", "exampleRequestUrl": "URL", - "exampleRequestPayload": "Payload" + "exampleRequestPayload": "Payload", + "duplicateCheck": "Duplicate Check" }, "links": { "targetList": "Target List", diff --git a/application/Espo/Resources/layouts/LeadCapture/detail.json b/application/Espo/Resources/layouts/LeadCapture/detail.json index de4ea0f71f..a36784680a 100644 --- a/application/Espo/Resources/layouts/LeadCapture/detail.json +++ b/application/Espo/Resources/layouts/LeadCapture/detail.json @@ -7,6 +7,7 @@ [{"name": "subscribeContactToTargetList"}, {"name": "targetList"}], [{"name": "targetTeam"}, {"name": "leadSource"}], [{"name": "fieldList", "fullWidth": true}], + [{"name": "duplicateCheck"}, false], [{"name": "apiKey", "fullWidth": true}] ] }, diff --git a/application/Espo/Resources/layouts/LeadCaptureLogRecord/detailSmall.json b/application/Espo/Resources/layouts/LeadCaptureLogRecord/detailSmall.json new file mode 100644 index 0000000000..366995b4ad --- /dev/null +++ b/application/Espo/Resources/layouts/LeadCaptureLogRecord/detailSmall.json @@ -0,0 +1,10 @@ +[ + { + "label":"", + "rows":[ + [{"name": "target"}, {"name":"leadCapture"}], + [{"name": "isCreated"}, {"name":"createdAt"}], + [{"name": "data", "fullWidth": true}] + ] + } +] diff --git a/application/Espo/Resources/layouts/LeadCaptureLogRecord/filters.json b/application/Espo/Resources/layouts/LeadCaptureLogRecord/filters.json new file mode 100644 index 0000000000..1646ce0d17 --- /dev/null +++ b/application/Espo/Resources/layouts/LeadCaptureLogRecord/filters.json @@ -0,0 +1,4 @@ +[ + "isCreated", + "createdAt" +] diff --git a/application/Espo/Resources/layouts/LeadCaptureLogRecord/listForLeadCapture.json b/application/Espo/Resources/layouts/LeadCaptureLogRecord/listForLeadCapture.json index 17942039ae..55ede72410 100644 --- a/application/Espo/Resources/layouts/LeadCaptureLogRecord/listForLeadCapture.json +++ b/application/Espo/Resources/layouts/LeadCaptureLogRecord/listForLeadCapture.json @@ -1,4 +1,5 @@ [ - {"name":"target"}, - {"name":"createdAt", "width": "30"} + {"name":"target", "notSortable": true}, + {"name":"isCreated", "width": "25", "notSortable": true}, + {"name":"createdAt", "width": "30", "notSortable": true} ] diff --git a/application/Espo/Resources/metadata/clientDefs/LeadCapture.json b/application/Espo/Resources/metadata/clientDefs/LeadCapture.json index 4f863db890..a526ebb2c5 100644 --- a/application/Espo/Resources/metadata/clientDefs/LeadCapture.json +++ b/application/Espo/Resources/metadata/clientDefs/LeadCapture.json @@ -112,7 +112,7 @@ }, "relationshipPanels": { "logRecords": { - "rowActionsView": "views/record/row-actions/remove-only", + "rowActionsView": "views/record/row-actions/view-and-remove", "layout": "listForLeadCapture", "select": false, "create": false diff --git a/application/Espo/Resources/metadata/clientDefs/LeadCaptureLogRecord.json b/application/Espo/Resources/metadata/clientDefs/LeadCaptureLogRecord.json new file mode 100644 index 0000000000..aa38b03391 --- /dev/null +++ b/application/Espo/Resources/metadata/clientDefs/LeadCaptureLogRecord.json @@ -0,0 +1,5 @@ +{ + "modalViews": { + "detail": "views/lead-capture-log-record/modals/detail" + } +} diff --git a/application/Espo/Resources/metadata/entityDefs/LeadCapture.json b/application/Espo/Resources/metadata/entityDefs/LeadCapture.json index 945755566d..7595152e13 100644 --- a/application/Espo/Resources/metadata/entityDefs/LeadCapture.json +++ b/application/Espo/Resources/metadata/entityDefs/LeadCapture.json @@ -41,6 +41,10 @@ "createdContact" ] }, + "duplicateCheck": { + "type": "bool", + "default": true + }, "optInConfirmation": { "type": "bool" }, diff --git a/application/Espo/Services/LeadCapture.php b/application/Espo/Services/LeadCapture.php index e161f2df0a..c4a5c4cbd7 100644 --- a/application/Espo/Services/LeadCapture.php +++ b/application/Espo/Services/LeadCapture.php @@ -242,7 +242,9 @@ class LeadCapture extends Record $groupOr['phoneNumber'] = $lead->get('phoneNumber'); } - $duplicate = $this->getEntityManager()->getRepository('Lead')->where(['OR' => $groupOr])->findOne(); + if ($leadCapture->get('duplicateCheck')) { + $duplicate = $this->getEntityManager()->getRepository('Lead')->where(['OR' => $groupOr])->findOne(); + } $contact = $this->getEntityManager()->getRepository('Contact')->where(['OR' => $groupOr])->findOne(); if ($contact) { $target = $contact; diff --git a/client/src/views/lead-capture-log-record/modals/detail.js b/client/src/views/lead-capture-log-record/modals/detail.js new file mode 100644 index 0000000000..ce3a4c5af1 --- /dev/null +++ b/client/src/views/lead-capture-log-record/modals/detail.js @@ -0,0 +1,38 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + * Website: https://www.espocrm.com + * + * EspoCRM is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * EspoCRM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. + ************************************************************************/ + +define('views/lead-capture-log-record/modals/detail', 'views/modals/detail', function (Dep) { + + return Dep.extend({ + + editDisabled: true, + + fullFormDisabled: true, + + }); +}); From 6a25c283ec5a31422206e9b38cc60a845f16fa8d Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 13:45:02 +0300 Subject: [PATCH 05/11] upgrade info msg --- application/Espo/Resources/i18n/en_US/Admin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json index 25cb545395..aee31315c9 100644 --- a/application/Espo/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Resources/i18n/en_US/Admin.json @@ -203,7 +203,7 @@ "newVersionIsAvailable": "New EspoCRM version {latestVersion} is available.", "newExtensionVersionIsAvailable": "New {extensionName} version {latestVersion} is available.", "uninstallConfirmation": "Are you sure you want to uninstall the extension?", - "upgradeInfo": "Check the documentation about how to upgrade your EspoCRM instance." + "upgradeInfo": "Check the documentation about how to upgrade your EspoCRM instance. Upgrading from CLI is the most preferable way." }, "descriptions": { "settings": "System settings of application.", From 5f91505b8e080f3fae56b7681c0a6b0cdb33692a Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 14:49:16 +0300 Subject: [PATCH 06/11] fix typo --- client/src/web-socket-manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/web-socket-manager.js b/client/src/web-socket-manager.js index e72bb34e9f..51f8acc454 100644 --- a/client/src/web-socket-manager.js +++ b/client/src/web-socket-manager.js @@ -116,7 +116,7 @@ define('web-socket-manager', [], function () { if (e.message) { console.error(e.message); } else { - console.error("WebSocket: Coud not subscribe to "+category+"."); + console.error("WebSocket: Could not subscribe to "+category+"."); } } }, @@ -129,7 +129,7 @@ define('web-socket-manager', [], function () { if (e.message) { console.error(e.message); } else { - console.error("WebSocket: Coud not unsubscribe from "+category+"."); + console.error("WebSocket: Could not unsubscribe from "+category+"."); } } }, From de945008fb40d8578353f3188fc2071faa12c68a Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 10 Apr 2019 16:32:29 +0300 Subject: [PATCH 07/11] fix email send --- application/Espo/Services/Email.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/Espo/Services/Email.php b/application/Espo/Services/Email.php index 5f28c65a54..1b1333e1c2 100644 --- a/application/Espo/Services/Email.php +++ b/application/Espo/Services/Email.php @@ -123,6 +123,7 @@ class Email extends Record $primaryUserAddress = strtolower($this->getUser()->get('emailAddress')); $fromAddress = strtolower($entity->get('from')); + $originalFromAddress = $entity->get('from'); if (empty($fromAddress)) { throw new Error("Can't send with empty from address."); @@ -143,7 +144,7 @@ class Email extends Record } $emailAccountService = $this->getServiceFactory()->create('EmailAccount'); - $emailAccount = $emailAccountService->findAccountForUser($this->getUser(), $fromAddress); + $emailAccount = $emailAccountService->findAccountForUser($this->getUser(), $originalFromAddress); if (!$smtpParams) { if ($emailAccount && $emailAccount->get('useSmtp')) { @@ -156,15 +157,15 @@ class Email extends Record } if ($smtpParams) { - if ($fromAddress) { - $this->applySmtpHandler($this->getUser()->id, $fromAddress, $smtpParams); + if ($originalFromAddress) { + $this->applySmtpHandler($this->getUser()->id, $originalFromAddress, $smtpParams); } $emailSender->useSmtp($smtpParams); } if (!$smtpParams) { $inboundEmailService = $this->getServiceFactory()->create('InboundEmail'); - $inboundEmail = $inboundEmailService->findSharedAccountForUser($this->getUser(), $fromAddress); + $inboundEmail = $inboundEmailService->findSharedAccountForUser($this->getUser(), $originalFromAddress); if ($inboundEmail) { $smtpParams = $inboundEmailService->getSmtpParamsFromAccount($inboundEmail); } From 66f88e0e8eb0e9a4f8b04ed1b8ba5411ff1a4d8f Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 11 Apr 2019 11:44:01 +0300 Subject: [PATCH 08/11] fix email address smtp apply case insesitive --- application/Espo/Services/Email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/Espo/Services/Email.php b/application/Espo/Services/Email.php index 1b1333e1c2..b49129ec72 100644 --- a/application/Espo/Services/Email.php +++ b/application/Espo/Services/Email.php @@ -157,8 +157,8 @@ class Email extends Record } if ($smtpParams) { - if ($originalFromAddress) { - $this->applySmtpHandler($this->getUser()->id, $originalFromAddress, $smtpParams); + if ($emailAddress) { + $this->applySmtpHandler($this->getUser()->id, $emailAddress, $smtpParams); } $emailSender->useSmtp($smtpParams); } From 273698e2fce45845cf52a9923efd1ccf70d5e6d2 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 11 Apr 2019 11:46:16 +0300 Subject: [PATCH 09/11] imap hander case insensitive --- application/Espo/Services/EmailAccount.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/Espo/Services/EmailAccount.php b/application/Espo/Services/EmailAccount.php index 01cb1926d2..3ad09e49ef 100644 --- a/application/Espo/Services/EmailAccount.php +++ b/application/Espo/Services/EmailAccount.php @@ -119,6 +119,7 @@ class EmailAccount extends Record $imapParams = null; if ($emailAddress && $userId) { + $emailAddress = strtolower($emailAddress); $userData = $this->getEntityManager()->getRepository('UserData')->getByUserId($userId); if ($userData) { $imapHandlers = $userData->get('imapHandlers') ?? (object) []; From 17e87f58c3e9a6e07fb056e9bc64efe74de093de Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 11 Apr 2019 16:30:41 +0300 Subject: [PATCH 10/11] css fix --- frontend/less/espo/custom.less | 8 ++++++++ frontend/less/espo/variables.less | 2 ++ 2 files changed, 10 insertions(+) diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index ff497bcb93..62724331cc 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -178,6 +178,14 @@ blockquote { font-weight: normal; } +.table tr > th { + font-weight: normal; +} + +.table tr.accented { + background-color: @table-bg-accent; +} + .form-group.hidden-cell { margin-bottom: 0; } diff --git a/frontend/less/espo/variables.less b/frontend/less/espo/variables.less index 30c1f144d1..db96e86c78 100644 --- a/frontend/less/espo/variables.less +++ b/frontend/less/espo/variables.less @@ -84,6 +84,8 @@ @btn-default-bg: @main-gray; @btn-default-border: @main-gray; +@table-bg-accent: #f9f9f9; + @code-bg: #f9f9f9; @code-color: @text-color; From f0f6cac84a020d2c5834fcc49ea076a6a53ec271 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 12 Apr 2019 13:25:08 +0300 Subject: [PATCH 11/11] fix; php clear_cache.php --- .../Resources/metadata/entityDefs/Campaign.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json index 371d4b907d..8b94e51ca6 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json @@ -61,6 +61,7 @@ "sentCount": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, @@ -68,6 +69,7 @@ "view": "crm:views/campaign/fields/int-with-percentage", "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, @@ -75,12 +77,14 @@ "view": "crm:views/campaign/fields/int-with-percentage", "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "optedInCount": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, @@ -88,6 +92,7 @@ "view": "crm:views/campaign/fields/int-with-percentage", "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, @@ -95,54 +100,63 @@ "view": "crm:views/campaign/fields/int-with-percentage", "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "hardBouncedCount": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "softBouncedCount": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "leadCreatedCount": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "openedPercentage": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "clickedPercentage": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "optedOutPercentage": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "bouncedPercentage": { "type": "int", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true }, "revenue": { "type": "currency", "notStorable": true, + "directAccessDisabled": true, "readOnly": true, "disabled": true },