From 94f920324e504317b13783c8e4585177e25f7d8f Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 10:14:17 +0300 Subject: [PATCH 01/25] fix case compose email --- client/modules/crm/src/views/case/record/panels/activities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/modules/crm/src/views/case/record/panels/activities.js b/client/modules/crm/src/views/case/record/panels/activities.js index 7f4db30c00..2a11913d1a 100644 --- a/client/modules/crm/src/views/case/record/panels/activities.js +++ b/client/modules/crm/src/views/case/record/panels/activities.js @@ -64,7 +64,7 @@ Espo.define('crm:views/case/record/panels/activities', 'crm:views/record/panels/ }, function () {resolve([])}); }, this); } else if (parentModel.get('leadId')) { - this.getModelFactory().create('Lead', function (account) { + this.getModelFactory().create('Lead', function (lead) { lead.id = parentModel.get('leadId'); lead.fetch().then(function () { resolve([lead]); From 1ae39d1a40266fcc48b247a170bbd693e864d4b3 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 10:20:45 +0300 Subject: [PATCH 02/25] fix campaign revenue empty --- application/Espo/Modules/Crm/Services/Campaign.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/Espo/Modules/Crm/Services/Campaign.php b/application/Espo/Modules/Crm/Services/Campaign.php index 5bfde37ad5..fa41308208 100644 --- a/application/Espo/Modules/Crm/Services/Campaign.php +++ b/application/Espo/Modules/Crm/Services/Campaign.php @@ -139,12 +139,14 @@ class Campaign extends \Espo\Services\Record $sth = $pdo->prepare($sql); $sth->execute(); + $revenue = null; if ($row = $sth->fetch(\PDO::FETCH_ASSOC)) { $revenue = floatval($row['SUM:amountConverted']); - if ($revenue > 0) { - $entity->set('revenue', $revenue); + if (!$revenue) { + $revenue = null; } } + $entity->set('revenue', $revenue); } public function logSent($campaignId, $queueItemId = null, Entity $target, Entity $emailOrEmailTemplate = null, $emailAddress, $actionDate = null, $isTest = false) From f8839518d5c2ed9b8234658ac337736619cc5a04 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 15:48:00 +0300 Subject: [PATCH 03/25] avatar check exif read data exists --- application/Espo/EntryPoints/Image.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/Espo/EntryPoints/Image.php b/application/Espo/EntryPoints/Image.php index 4d8e52d110..695fbf5060 100644 --- a/application/Espo/EntryPoints/Image.php +++ b/application/Espo/EntryPoints/Image.php @@ -197,9 +197,10 @@ class Image extends \Espo\Core\EntryPoints\Base break; } - $targetImage = imagerotate($targetImage, array_values([0, 0, 0, 180, 0, 0, -90, 0, 90])[@exif_read_data($filePath)['Orientation'] ?: 0], 0); + if (function_exists('exif_read_data')) { + $targetImage = imagerotate($targetImage, array_values([0, 0, 0, 180, 0, 0, -90, 0, 90])[@exif_read_data($filePath)['Orientation'] ?: 0], 0); + } return $targetImage; } } - From f137298c4973baeb654e97543a4f7047c8a83402 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 15:50:17 +0300 Subject: [PATCH 04/25] add exif extension --- composer.json | 1 + install/core/config.php | 1 + 2 files changed, 2 insertions(+) diff --git a/composer.json b/composer.json index b10c75811d..ee796a83dc 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-curl": "*", + "ext-exif": "*", "doctrine/dbal": "2.*", "slim/slim": "2.6.2", "mtdowling/cron-expression": "1.0.*", diff --git a/install/core/config.php b/install/core/config.php index 2ced280f56..627dc89dcf 100644 --- a/install/core/config.php +++ b/install/core/config.php @@ -46,6 +46,7 @@ return array( 'mbstring', 'curl', 'xml', + 'exif', 'max_execution_time' => 180, 'max_input_time' => 180, 'memory_limit' => '256M', From 6adad84a29f81403e33e7c62d116036d49782edf Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 15:52:16 +0300 Subject: [PATCH 05/25] installer config formatting --- install/core/config.php | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/install/core/config.php b/install/core/config.php index 627dc89dcf..22668186f8 100644 --- a/install/core/config.php +++ b/install/core/config.php @@ -27,20 +27,16 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -return array( - +return [ 'apiPath' => '/api/v1', - - 'requirements' => array( + 'requirements' => [ 'phpVersion' => '5.6', - - 'phpRequires' => array( + 'phpRequires' => [ 'JSON', 'openssl', 'pdo_mysql' - ), - - 'phpRecommendations' => array( + ], + 'phpRecommendations' => [ 'zip', 'gd', 'mbstring', @@ -52,19 +48,12 @@ return array( 'memory_limit' => '256M', 'post_max_size' => '20M', 'upload_max_filesize' => '20M', - ), - + ], 'mysqlVersion' => '5.5.3', - 'mysqlRequires' => array( - - ), - - 'mysqlRecommendations' => array( - - ), - ), - - 'rewriteRules' => array( + 'mysqlRequires' => [], + 'mysqlRecommendations' => [], + ], + 'rewriteRules' => [ 'APACHE1' => 'a2enmod rewrite service apache2 restart', 'APACHE2' => '<Directory /PATH_TO_ESPO/> @@ -132,10 +121,9 @@ service apache2 restart', deny all; } }', - ), + ], 'blog' => 'http://blog.espocrm.com', 'twitter' => 'https://twitter.com/espocrm', 'forum' => 'http://forum.espocrm.com', - -); \ No newline at end of file +]; \ No newline at end of file From 276db37bafbb6d08b89a25fb1152c70744d758d6 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 15:59:11 +0300 Subject: [PATCH 06/25] required extensions change --- install/core/config.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install/core/config.php b/install/core/config.php index 22668186f8..623bf421f6 100644 --- a/install/core/config.php +++ b/install/core/config.php @@ -32,14 +32,14 @@ return [ 'requirements' => [ 'phpVersion' => '5.6', 'phpRequires' => [ - 'JSON', + 'json', 'openssl', - 'pdo_mysql' - ], - 'phpRecommendations' => [ + 'pdo_mysql', + 'mbstring', 'zip', 'gd', - 'mbstring', + ], + 'phpRecommendations' => [ 'curl', 'xml', 'exif', From f07b43abdaf9050f3cf4ce696793c11475c362e7 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 30 Jul 2018 16:05:13 +0300 Subject: [PATCH 07/25] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b75bad4785..6058431a75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "5.3.5", + "version": "5.3.6", "description": "", "main": "index.php", "repository": { From b7ae252d3d311750d06f9fb750099e1579aed354 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 1 Aug 2018 10:24:02 +0300 Subject: [PATCH 08/25] modal forceSelectAllAttributes --- client/src/views/modals/select-records.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/client/src/views/modals/select-records.js b/client/src/views/modals/select-records.js index 885d45463e..479818de59 100644 --- a/client/src/views/modals/select-records.js +++ b/client/src/views/modals/select-records.js @@ -225,15 +225,26 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu }, this); } - view.getSelectAttributeList(function (selectAttributeList) { - if (selectAttributeList) { - this.collection.data.select = selectAttributeList.join(','); - } + if (this.options.forceSelectAllAttributes || this.forceSelectAllAttributes) { this.listenToOnce(view, 'after:build-rows', function () { this.wait(false); }, this); this.collection.fetch(); - }.bind(this)); + } else { + view.getSelectAttributeList(function (selectAttributeList) { + if (!~selectAttributeList.indexOf('name')) { + selectAttributeList.push('name'); + } + selectAttributeList.push('hello'); + if (selectAttributeList) { + this.collection.data.select = selectAttributeList.join(','); + } + this.listenToOnce(view, 'after:build-rows', function () { + this.wait(false); + }, this); + this.collection.fetch(); + }.bind(this)); + } }); }, From fa5d63253b7b1e0d5d2a914c42e64b69e309631e Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 1 Aug 2018 10:46:48 +0300 Subject: [PATCH 09/25] naming fix --- client/src/views/email/detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/views/email/detail.js b/client/src/views/email/detail.js index ceadf59819..ee41421106 100644 --- a/client/src/views/email/detail.js +++ b/client/src/views/email/detail.js @@ -267,7 +267,7 @@ Espo.define('views/email/detail', ['views/detail', 'email-helper'], function (De } attributes.emailId = this.model.id; - var viewName = this.getMetadata().get('clientDefs.Contact.modalViews.detail') || 'Modals.Edit'; + var viewName = this.getMetadata().get('clientDefs.Contact.modalViews.detail') || 'views/modals/edit'; this.notify('Loading...'); this.createView('quickCreate', viewName, { From 2c65c9ff9f03c9107e2da699c95ed5a106f5ca6b Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 1 Aug 2018 11:13:00 +0300 Subject: [PATCH 10/25] modal select attributes --- client/src/views/fields/link-multiple.js | 4 +++- client/src/views/fields/link-parent.js | 12 +++++++++++- client/src/views/fields/link.js | 4 +++- client/src/views/modals/select-records.js | 9 ++++++++- client/src/views/portal-user/list.js | 13 ++++++++++++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/client/src/views/fields/link-multiple.js b/client/src/views/fields/link-multiple.js index d097211838..3dccfccedd 100644 --- a/client/src/views/fields/link-multiple.js +++ b/client/src/views/fields/link-multiple.js @@ -126,7 +126,9 @@ Espo.define('views/fields/link-multiple', 'views/fields/base', function (Dep) { boolFilterList: this.getSelectBoolFilterList(), primaryFilterName: this.getSelectPrimaryFilterName(), multiple: true, - createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null + createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null, + mandatorySelectAttributeList: this.mandatorySelectAttributeList, + forceSelectAllAttributes: this.forceSelectAllAttributes }, function (dialog) { dialog.render(); self.notify(false); diff --git a/client/src/views/fields/link-parent.js b/client/src/views/fields/link-parent.js index bbed73e8e8..f40202c525 100644 --- a/client/src/views/fields/link-parent.js +++ b/client/src/views/fields/link-parent.js @@ -133,7 +133,9 @@ Espo.define('views/fields/link-parent', 'views/fields/base', function (Dep) { filters: this.getSelectFilters(), boolFilterList: this.getSelectBoolFilterList(), primaryFilterName: this.getSelectPrimaryFilterName(), - createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null + createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null, + mandatorySelectAttributeList: this.getMandatorySelectAttributeList(), + forceSelectAllAttributes: this.isForceSelectAllAttributes() }, function (dialog) { dialog.render(); Espo.Ui.notify(false); @@ -181,6 +183,14 @@ Espo.define('views/fields/link-parent', 'views/fields/base', function (Dep) { this.trigger('change'); }, + getMandatorySelectAttributeList: function () { + this.mandatorySelectAttributeList; + }, + + isForceSelectAllAttributes: function () { + this.forceSelectAllAttributes; + }, + getAutocompleteUrl: function () { var url = this.foreignScope + '?sortBy=name&maxCount=' + this.AUTOCOMPLETE_RESULT_MAX_COUNT; var boolList = this.getSelectBoolFilterList(); diff --git a/client/src/views/fields/link.js b/client/src/views/fields/link.js index bd63946ebe..025bacafb1 100644 --- a/client/src/views/fields/link.js +++ b/client/src/views/fields/link.js @@ -116,7 +116,9 @@ Espo.define('views/fields/link', 'views/fields/base', function (Dep) { filters: this.getSelectFilters(), boolFilterList: this.getSelectBoolFilterList(), primaryFilterName: this.getSelectPrimaryFilterName(), - createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null + createAttributes: (this.mode === 'edit') ? this.getCreateAttributes() : null, + mandatorySelectAttributeList: this.mandatorySelectAttributeList, + forceSelectAllAttributes: this.forceSelectAllAttributes }, function (view) { view.render(); this.notify(false); diff --git a/client/src/views/modals/select-records.js b/client/src/views/modals/select-records.js index 479818de59..1bfc0b2aac 100644 --- a/client/src/views/modals/select-records.js +++ b/client/src/views/modals/select-records.js @@ -235,7 +235,14 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu if (!~selectAttributeList.indexOf('name')) { selectAttributeList.push('name'); } - selectAttributeList.push('hello'); + + var mandatorySelectAttributeList = this.options.mandatorySelectAttributeList || this.mandatorySelectAttributeList || []; + mandatorySelectAttributeList.forEach(function (attribute) { + if (!~selectAttributeList.indexOf(attribute)) { + selectAttributeList.push(attribute); + } + }, this); + if (selectAttributeList) { this.collection.data.select = selectAttributeList.join(','); } diff --git a/client/src/views/portal-user/list.js b/client/src/views/portal-user/list.js index 15fdbafc8f..02f7aa1c58 100644 --- a/client/src/views/portal-user/list.js +++ b/client/src/views/portal-user/list.js @@ -42,7 +42,18 @@ Espo.define('views/portal-user/list', 'views/list', function (Dep) { this.createView('modal', viewName, { scope: 'Contact', primaryFilterName: 'notPortalUsers', - createButton: false + createButton: false, + mandatorySelectAttributeList: [ + 'salutationName', + 'firstName', + 'lastName', + 'accountName', + 'accountId', + 'emailAddress', + 'emailAddressData', + 'phoneNumber', + 'phoneNumberData' + ] }, function (view) { view.render(); From 32d47db15a58e3cca4abe2e5d48ec2550cb3197c Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 1 Aug 2018 11:16:50 +0300 Subject: [PATCH 11/25] emailFolderMaxCount --- application/Espo/Services/EmailFolder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/Espo/Services/EmailFolder.php b/application/Espo/Services/EmailFolder.php index ecdcd271e0..8d87a64d2e 100644 --- a/application/Espo/Services/EmailFolder.php +++ b/application/Espo/Services/EmailFolder.php @@ -109,9 +109,11 @@ class EmailFolder extends Record public function listAll() { + $limit = $this->getConfig()->get('emailFolderMaxCount', 100); + $folderList = $this->getRepository()->where(array( 'assignedUserId' => $this->getUser()->id - ))->order('order')->limit(0, 20)->find(); + ))->order('order')->limit(0, $limit)->find(); $list = new \Espo\ORM\EntityCollection(); From cba8867389c3a6728bbb33cf406db5b3534d6f82 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 1 Aug 2018 18:49:40 +0300 Subject: [PATCH 12/25] Bug fixes for MySQL 8 --- .../Utils/Database/DBAL/Platforms/MySqlPlatform.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php b/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php index 6aa7d812f9..19dc3609ba 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php +++ b/application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php @@ -452,5 +452,17 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform return 'MEDIUMTEXT'; } + + public function getColumnDeclarationListSQL(array $fields) + { + $queryFields = array(); + + foreach ($fields as $fieldName => $field) { + $quotedFieldName = $this->espoQuote($fieldName); + $queryFields[] = $this->getColumnDeclarationSQL($quotedFieldName, $field); + } + + return implode(', ', $queryFields); + } //end: ESPO } \ No newline at end of file From 54d615b64dff291769f4aa2715de495c1532aca9 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 10:46:16 +0300 Subject: [PATCH 13/25] fix attachment preview in list --- client/src/views/fields/attachment-multiple.js | 8 +++++++- client/src/views/stream/fields/attachment-multiple.js | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index 44cc9365e8..76cc59f135 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -495,7 +495,13 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D for (var id in nameHash) { var type = typeHash[id] || false; var name = nameHash[id]; - if (this.showPreviews && ~this.previewTypeList.indexOf(type) && this.mode !== 'list') { + if ( + this.showPreviews + && + ~this.previewTypeList.indexOf(type) + && + (this.mode === 'detail' || this.mode === 'list' && this.showPreviewsInListMode) + ) { previews.push('
' + this.getDetailPreview(name, type, id) + '
'); continue; } diff --git a/client/src/views/stream/fields/attachment-multiple.js b/client/src/views/stream/fields/attachment-multiple.js index e422e1eeff..4064f6f7f6 100644 --- a/client/src/views/stream/fields/attachment-multiple.js +++ b/client/src/views/stream/fields/attachment-multiple.js @@ -30,7 +30,9 @@ Espo.define('views/stream/fields/attachment-multiple', 'views/fields/attachment- return Dep.extend({ - showPreviews: true + showPreviews: true, + + showPreviewsInListMode: true, }); From 7fed72d3918fb7bead2205130961e3e2d015a658 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 10:55:39 +0300 Subject: [PATCH 14/25] fix image sized download extension --- application/Espo/EntryPoints/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Espo/EntryPoints/Image.php b/application/Espo/EntryPoints/Image.php index 695fbf5060..3b7ec020ed 100644 --- a/application/Espo/EntryPoints/Image.php +++ b/application/Espo/EntryPoints/Image.php @@ -129,7 +129,7 @@ class Image extends \Espo\Core\EntryPoints\Base } if (!empty($size)) { - $fileName = $sourceId . '_' . $size . '.jpg'; + $fileName = $size . '-' . $attachment->get('name'); } else { $fileName = $attachment->get('name'); } From be82244c6b1abd4ce0daf2a6aa5888e6fff4d6a2 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 11:30:28 +0300 Subject: [PATCH 15/25] showing attachments in notifications --- application/Espo/Services/Notification.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/Espo/Services/Notification.php b/application/Espo/Services/Notification.php index 4416cc003c..0f8259b620 100644 --- a/application/Espo/Services/Notification.php +++ b/application/Espo/Services/Notification.php @@ -218,6 +218,7 @@ class Notification extends \Espo\Services\Record $note->set('relatedName', $related->get('name')); } } + $note->loadLinkMultipleField('attachments'); $entity->set('noteData', $note->toArray()); } else { unset($collection[$k]); From 9f84d3f233107bf5a3726b03057384279fc89077 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 11:53:41 +0300 Subject: [PATCH 16/25] notifications attachment preview small size --- client/src/views/fields/attachment-multiple.js | 5 ++++- client/src/views/notification/fields/container.js | 2 ++ client/src/views/stream/note.js | 12 +++++++++--- client/src/views/stream/notes/mention-in-post.js | 4 +++- client/src/views/stream/notes/post.js | 4 +++- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index 76cc59f135..716af6d3ce 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -40,6 +40,8 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D searchTemplate: 'fields/link-multiple/search', + previewSize: 'medium', + nameHashName: null, idsName: null, @@ -478,9 +480,10 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D name = Handlebars.Utils.escapeExpression(name); var preview = name; + var size = this.options.previewSize || this.params.previewSize || this.previewSize; if (this.isTypeIsImage(type)) { - preview = ''; + preview = ''; } return preview; }, diff --git a/client/src/views/notification/fields/container.js b/client/src/views/notification/fields/container.js index de104df0e5..6676d0b6f5 100644 --- a/client/src/views/notification/fields/container.js +++ b/client/src/views/notification/fields/container.js @@ -72,6 +72,7 @@ Espo.define('views/notification/fields/container', 'views/fields/base', function isUserStream: true, el: this.params.containerEl + ' li[data-id="' + this.model.id + '"]', onlyContent: true, + isNotification: true }); this.wait(false); }, this); @@ -88,6 +89,7 @@ Espo.define('views/notification/fields/container', 'views/fields/base', function isUserStream: true, el: this.params.containerEl + ' li[data-id="' + this.model.id + '"]', onlyContent: true, + isNotification: true }); this.wait(false); }, this); diff --git a/client/src/views/stream/note.js b/client/src/views/stream/note.js index eec88c601e..e944a10689 100644 --- a/client/src/views/stream/note.js +++ b/client/src/views/stream/note.js @@ -118,9 +118,9 @@ Espo.define('views/stream/note', 'view', function (Dep) { return string; }, - createField: function (name, type, params, view) { + createField: function (name, type, params, view, options) { type = type || this.model.getFieldType(name) || 'base'; - this.createView(name, view || this.getFieldManager().getViewName(type), { + var o = { model: this.model, defs: { name: name, @@ -128,7 +128,13 @@ Espo.define('views/stream/note', 'view', function (Dep) { }, el: this.options.el + ' .cell-' + name, mode: 'list' - }); + }; + if (options) { + for (var i in options) { + o[i] = options[i]; + } + } + this.createView(name, view || this.getFieldManager().getViewName(type), o); }, isMale: function () { diff --git a/client/src/views/stream/notes/mention-in-post.js b/client/src/views/stream/notes/mention-in-post.js index 35b47ed853..2c225a14ca 100644 --- a/client/src/views/stream/notes/mention-in-post.js +++ b/client/src/views/stream/notes/mention-in-post.js @@ -46,7 +46,9 @@ Espo.define('views/stream/notes/mention-in-post', 'views/stream/note', function this.createField('post', null, null, 'views/stream/fields/post'); } if ((this.model.get('attachmentsIds') || []).length) { - this.createField('attachments', 'attachmentMultiple', {}, 'views/stream/fields/attachment-multiple'); + this.createField('attachments', 'attachmentMultiple', {}, 'views/stream/fields/attachment-multiple', { + previewSize: this.options.isNotification ? 'small' : null + }); } var data = this.model.get('data'); diff --git a/client/src/views/stream/notes/post.js b/client/src/views/stream/notes/post.js index 0c047c59bc..083d425030 100644 --- a/client/src/views/stream/notes/post.js +++ b/client/src/views/stream/notes/post.js @@ -49,7 +49,9 @@ Espo.define('views/stream/notes/post', 'views/stream/note', function (Dep) { setup: function () { this.createField('post', null, null, 'views/stream/fields/post'); - this.createField('attachments', 'attachmentMultiple', {}, 'views/stream/fields/attachment-multiple'); + this.createField('attachments', 'attachmentMultiple', {}, 'views/stream/fields/attachment-multiple', { + previewSize: this.options.isNotification ? 'small' : 'medium' + }); this.isInternal = this.model.get('isInternal'); From f77a7c32d5b8604205f91090c2ff359b690d644c Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 12:04:33 +0300 Subject: [PATCH 17/25] link multiple preview size param --- .../Resources/metadata/fields/attachmentMultiple.json | 6 ++++++ client/src/views/fields/attachment-multiple.js | 6 +++--- client/src/views/fields/file.js | 2 ++ client/src/views/fields/image.js | 11 +---------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/application/Espo/Resources/metadata/fields/attachmentMultiple.json b/application/Espo/Resources/metadata/fields/attachmentMultiple.json index 44127549d4..cf425e8a26 100644 --- a/application/Espo/Resources/metadata/fields/attachmentMultiple.json +++ b/application/Espo/Resources/metadata/fields/attachmentMultiple.json @@ -15,6 +15,12 @@ "type": "float", "tooltip": true, "min": 0 + }, + { + "name": "previewSize", + "type": "enum", + "default": "medium", + "options": ["", "x-small", "small", "medium", "large"] } ], "actualFields":[ diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index 716af6d3ce..c8c24b68f7 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -157,6 +157,8 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D this.idsName = this.name + 'Ids'; this.foreignScope = 'Attachment'; + this.previewSize = this.options.previewSize || this.params.previewSize || this.previewSize; + var self = this; this.nameHash = _.clone(this.model.get(this.nameHashName)) || {}; @@ -480,10 +482,8 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D name = Handlebars.Utils.escapeExpression(name); var preview = name; - var size = this.options.previewSize || this.params.previewSize || this.previewSize; - if (this.isTypeIsImage(type)) { - preview = ''; + preview = ''; } return preview; }, diff --git a/client/src/views/fields/file.js b/client/src/views/fields/file.js index f67b655c4d..6a7b9a0c3b 100644 --- a/client/src/views/fields/file.js +++ b/client/src/views/fields/file.js @@ -153,6 +153,8 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) { this.typeName = this.name + 'Type'; this.foreignScope = 'Attachment'; + this.previewSize = this.options.previewSize || this.params.previewSize || this.previewSize; + var sourceDefs = this.getMetadata().get(['clientDefs', 'Attachment', 'sourceDefs']) || {}; this.sourceList = Espo.Utils.clone(this.params.sourceList || []).filter(function (item) { diff --git a/client/src/views/fields/image.js b/client/src/views/fields/image.js index 088302a020..bb7e21b4d8 100644 --- a/client/src/views/fields/image.js +++ b/client/src/views/fields/image.js @@ -38,16 +38,7 @@ Espo.define('views/fields/image', 'views/fields/file', function (Dep) { defaultType: 'image/jpeg', - previewSize: 'small', - - setup: function () { - Dep.prototype.setup.call(this); - - if ('previewSize' in this.params && this.params.previewSize) { - this.previewSize = this.params.previewSize; - } - } + previewSize: 'small' }); }); - From b14b199d4382dde26bd801ec5167315d6e7bdc8a Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 12:28:14 +0300 Subject: [PATCH 18/25] preview resize fix --- client/src/views/modals/image-preview.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/views/modals/image-preview.js b/client/src/views/modals/image-preview.js index 9e6aed9883..0d9f194ee5 100644 --- a/client/src/views/modals/image-preview.js +++ b/client/src/views/modals/image-preview.js @@ -55,6 +55,10 @@ Espo.define('views/modals/image-preview', 'views/modal', function (Dep) { this.navigationEnabled = (this.options.imageList && this.options.imageList.length > 1); this.imageList = this.options.imageList || []; + + this.once('remove', function () { + $(window).off('resize.image-review'); + }, this); }, getImageUrl: function () { @@ -90,7 +94,8 @@ Espo.define('views/modals/image-preview', 'views/modal', function (Dep) { $img.css('maxWidth', width); }.bind(this); - $(window).on('resize', function () { + $(window).off('resize.image-review'); + $(window).on('resize.image-review', function () { manageSize(); }); From e27e9de70181f112e0949094baa67a0e236ea18c Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 12:37:16 +0300 Subject: [PATCH 19/25] attachment preview resize --- .../src/views/fields/attachment-multiple.js | 23 ++++++++++++++++++- client/src/views/fields/file.js | 22 +++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/client/src/views/fields/attachment-multiple.js b/client/src/views/fields/attachment-multiple.js index c8c24b68f7..7a36e10f86 100644 --- a/client/src/views/fields/attachment-multiple.js +++ b/client/src/views/fields/attachment-multiple.js @@ -186,6 +186,12 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D this.listenTo(this.model, 'change:' + this.nameHashName, function () { this.nameHash = _.clone(this.model.get(this.nameHashName)) || {}; }.bind(this)); + + this.once('remove', function () { + if (this.resizeIsBeingListened) { + $(window).off('resize.' + this.cid); + } + }.bind(this)); }, setupSearch: function () { @@ -202,6 +208,11 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D this.$attachments.empty(); }, + handleResize: function () { + var width = this.$el.width(); + this.$el.find('img.image-preview').css('maxWidth', width + 'px'); + }, + deleteAttachment: function (id) { this.removeId(id); if (this.model.isNew()) { @@ -466,6 +477,16 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D var type = this.$el.find('select.search-type').val(); this.handleSearchType(type); } + + if (this.mode === 'detail') { + if (this.previewSize === 'large') { + this.handleResize(); + this.resizeIsBeingListened = true; + $(window).on('resize.' + this.cid, function () { + this.handleResize(); + }.bind(this)); + } + } }, isTypeIsImage: function (type) { @@ -483,7 +504,7 @@ Espo.define('views/fields/attachment-multiple', 'views/fields/base', function (D var preview = name; if (this.isTypeIsImage(type)) { - preview = ''; + preview = ''; } return preview; }, diff --git a/client/src/views/fields/file.js b/client/src/views/fields/file.js index 6a7b9a0c3b..16e155924e 100644 --- a/client/src/views/fields/file.js +++ b/client/src/views/fields/file.js @@ -183,6 +183,11 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) { this.acceptAttribue = this.accept.join('|'); } + this.once('remove', function () { + if (this.resizeIsBeingListened) { + $(window).off('resize.' + this.cid); + } + }.bind(this)); }, afterRender: function () { @@ -221,6 +226,21 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) { var type = this.$el.find('select.search-type').val(); this.handleSearchType(type); } + + if (this.mode === 'detail') { + if (this.previewSize === 'large') { + this.handleResize(); + this.resizeIsBeingListened = true; + $(window).on('resize.' + this.cid, function () { + this.handleResize(); + }.bind(this)); + } + } + }, + + handleResize: function () { + var width = this.$el.width(); + this.$el.find('img.image-preview').css('maxWidth', width + 'px'); }, getDetailPreview: function (name, type, id) { @@ -231,7 +251,7 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) { case 'image/png': case 'image/jpeg': case 'image/gif': - preview = ''; + preview = ''; } return preview; }, From 342a18e0ac4474eb249217e943f82cdaded90f41 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 12:51:44 +0300 Subject: [PATCH 20/25] fix installer css --- install/core/tpl/main.tpl | 2 +- install/core/tpl/step1.tpl | 6 +++--- install/css/install.css | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/install/core/tpl/main.tpl b/install/core/tpl/main.tpl index e1b6b055bd..ca031568a6 100644 --- a/install/core/tpl/main.tpl +++ b/install/core/tpl/main.tpl @@ -12,7 +12,7 @@
- +
- +
+ +
diff --git a/install/css/install.css b/install/css/install.css index 6c10977abc..a646a0dfb9 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -71,10 +71,6 @@ select[name="user-lang"] { color: #999; } -input[type=checkbox].btn-default { - margin: 0; -} - .cron-help { margin: 20px; } @@ -170,4 +166,9 @@ span.ok { @-moz-keyframes left { from { -moz-transform: rotate(0deg);} to { -moz-transform: rotate(360deg);} +} + +#license-agree { + margin-right: 5px; + margin-top: -1px; } \ No newline at end of file From b032aa4d8dbb773d8e62bc13183f973ad4d16b51 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Thu, 2 Aug 2018 13:26:46 +0300 Subject: [PATCH 21/25] Upgrades bug fixes --- application/Espo/Core/Upgrades/Actions/Base.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/Upgrades/Actions/Base.php b/application/Espo/Core/Upgrades/Actions/Base.php index 47530373c5..55e04f0fe8 100644 --- a/application/Espo/Core/Upgrades/Actions/Base.php +++ b/application/Espo/Core/Upgrades/Actions/Base.php @@ -631,7 +631,13 @@ abstract class Base protected function systemRebuild() { - return $this->getContainer()->get('dataManager')->rebuild(); + try { + return $this->getContainer()->get('dataManager')->rebuild(); + } catch (\Exception $e) { + $GLOBALS['log']->error('Database rebuild failure, details: '.$e->getMessage().'.'); + } + + return false; } /** From 71864056bc3f60ca34ffd030308ddeb71c624b9e Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 15:05:00 +0300 Subject: [PATCH 22/25] navbar panel height --- client/src/views/global-search/panel.js | 24 ++++++++++++++++++------ client/src/views/notification/panel.js | 14 +++++++++++--- frontend/less/espo/variables.less | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/client/src/views/global-search/panel.js b/client/src/views/global-search/panel.js index 3f517becbf..22c1bcb48b 100644 --- a/client/src/views/global-search/panel.js +++ b/client/src/views/global-search/panel.js @@ -32,8 +32,14 @@ Espo.define('views/global-search/panel', 'view', function (Dep) { template: 'global-search/panel', - afterRender: function () { + setup: function () { + this.maxSize = this.getConfig().get('globalSearchMaxSize') || 10; + this.navbarPanelHeightSpace = this.getThemeManager().getParam('navbarPanelHeightSpace') || 100; + this.navbarPanelBodyMaxHeight = this.getThemeManager().getParam('navbarPanelBodyMaxHeight') || 600; + }, + + afterRender: function () { this.listenToOnce(this.collection, 'sync', function () { this.createView('list', 'views/record/list-expanded', { el: this.options.el + ' .list-container', @@ -46,7 +52,7 @@ Espo.define('views/global-search/panel', 'view', function (Dep) { view: 'views/global-search/name-field', params: { containerEl: this.options.el - }, + } } ] ], @@ -59,12 +65,18 @@ Espo.define('views/global-search/panel', 'view', function (Dep) { }, function (view) { view.render(); }); - }.bind(this)); - this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 10; + }, this); + + this.collection.reset(); + this.collection.maxSize = this.maxSize; this.collection.fetch(); + + var windowHeight = $(window).height(); + if (windowHeight - this.navbarPanelBodyMaxHeight < this.navbarPanelHeightSpace) { + var maxHeight = windowHeight - this.navbarPanelHeightSpace; + this.$el.find('> .panel > .panel-body').css('maxHeight', maxHeight + 'px'); + } } }); - }); - diff --git a/client/src/views/notification/panel.js b/client/src/views/notification/panel.js index be815655be..24c6c18d7e 100644 --- a/client/src/views/notification/panel.js +++ b/client/src/views/notification/panel.js @@ -51,9 +51,12 @@ Espo.define('views/notification/panel', 'view', function (Dep) { this.wait(true); this.getCollectionFactory().create('Notification', function (collection) { this.collection = collection; - collection.maxSize = 5; + collection.maxSize = this.getConfig().get('notificationsMaxSize') || 5; this.wait(false); }, this); + + this.navbarPanelHeightSpace = this.getThemeManager().getParam('navbarPanelHeightSpace') || 100; + this.navbarPanelBodyMaxHeight = this.getThemeManager().getParam('navbarPanelBodyMaxHeight') || 600; }, afterRender: function () { @@ -71,7 +74,7 @@ Espo.define('views/notification/panel', 'view', function (Dep) { view: 'views/notification/fields/container', params: { containerEl: this.options.el - }, + } } ] ], @@ -86,8 +89,13 @@ Espo.define('views/notification/panel', 'view', function (Dep) { }); }, this); this.collection.fetch(); + + var windowHeight = $(window).height(); + if (windowHeight - this.navbarPanelBodyMaxHeight < this.navbarPanelHeightSpace) { + var maxHeight = windowHeight - this.navbarPanelHeightSpace; + this.$el.find('> .panel > .panel-body').css('maxHeight', maxHeight + 'px'); + } } }); - }); diff --git a/frontend/less/espo/variables.less b/frontend/less/espo/variables.less index 464766efe7..f3683610ce 100644 --- a/frontend/less/espo/variables.less +++ b/frontend/less/espo/variables.less @@ -137,7 +137,7 @@ @panel-border-width: 2px; -@navbar-panel-body-max-height: 350px; +@navbar-panel-body-max-height: 600px; @form-group-margin-bottom: 12px; From 8d6db725169e8b196f6260867580a26df2bd4603 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 15:08:32 +0300 Subject: [PATCH 23/25] icons fix --- client/res/templates/email/fields/icon/detail.tpl | 2 +- client/res/templates/notification/items/email-received.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/res/templates/email/fields/icon/detail.tpl b/client/res/templates/email/fields/icon/detail.tpl index ce183c448c..f0a4d369b9 100644 --- a/client/res/templates/email/fields/icon/detail.tpl +++ b/client/res/templates/email/fields/icon/detail.tpl @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/client/res/templates/notification/items/email-received.tpl b/client/res/templates/notification/items/email-received.tpl index 8d8a1db800..4cdeace817 100644 --- a/client/res/templates/notification/items/email-received.tpl +++ b/client/res/templates/notification/items/email-received.tpl @@ -4,7 +4,7 @@ {{{avatar}}}
- + {{{message}}}
From c30c4163a6273e6bacb0c0999a4fc232de6fe5ec Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 2 Aug 2018 16:21:40 +0300 Subject: [PATCH 24/25] increase container max size --- frontend/less/espo-vertical/layout.less | 6 +++--- frontend/less/espo/layout.less | 6 +++--- frontend/less/espo/variables.less | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/less/espo-vertical/layout.less b/frontend/less/espo-vertical/layout.less index df2a7fc80a..25a0e89cbc 100644 --- a/frontend/less/espo-vertical/layout.less +++ b/frontend/less/espo-vertical/layout.less @@ -356,9 +356,9 @@ body > #header .navbar-brand span.home-icon { } @media (min-width: @screen-lg-min) { - .container { - max-width: 1580px; - } + .container { + max-width: @container-max-width; + } } diff --git a/frontend/less/espo/layout.less b/frontend/less/espo/layout.less index 327607f5cf..440542dafa 100644 --- a/frontend/less/espo/layout.less +++ b/frontend/less/espo/layout.less @@ -123,7 +123,7 @@ body > #header .navbar-brand span.home-icon { } @media (min-width: @screen-lg-min) { - .container { - max-width: 1366px; - } + .container { + max-width: @container-max-width; + } } diff --git a/frontend/less/espo/variables.less b/frontend/less/espo/variables.less index f3683610ce..050d0fd481 100644 --- a/frontend/less/espo/variables.less +++ b/frontend/less/espo/variables.less @@ -144,3 +144,5 @@ @modal-title-line-height: floor(@font-size-h4 * @line-height-base); @navbar-color-border-width: 4px; + +@container-max-width: 1800px; From eadf7835dbfc14d771d88aeb9d570971607acbae Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 3 Aug 2018 13:16:22 +0300 Subject: [PATCH 25/25] fix css --- frontend/less/espo/custom.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index 3c637e0b5d..c43988dda7 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -557,7 +557,8 @@ ul.dropdown-menu > li.checkbox:last-child { margin-top: 1px; } -.field .link-container > .list-group-item.link-with-role a { +.field .link-container > .list-group-item.link-with-role > a, +.field .link-container > .list-group-item.link-with-role > div > a { margin-top: 6px; }