From 27cc0d812e5195301c009788759a4880798765a0 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 23 Mar 2016 16:06:45 +0200 Subject: [PATCH 1/3] url field title --- client/res/templates/fields/url/list.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/res/templates/fields/url/list.tpl b/client/res/templates/fields/url/list.tpl index c8081c3882..958faebb64 100644 --- a/client/res/templates/fields/url/list.tpl +++ b/client/res/templates/fields/url/list.tpl @@ -1,3 +1,3 @@ {{#if value}} - {{value}} + {{value}} {{/if}} From 7a953c9a4775addb1010dc6a8018cc76dfedca49 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 23 Mar 2016 16:09:07 +0200 Subject: [PATCH 2/3] use word-break for long field --- frontend/less/espo/custom.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index f9d62a15f6..8ca908ce4a 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -275,6 +275,11 @@ ul.dropdown-menu > li.checkbox:last-child { margin: 0 20px; } +.cell > .field { + overflow-wrap: break-word; + word-wrap: break-word; +} + .field .row { margin-left: -5px !important; margin-right: -5px !important; From c0242a18e3761c8dff5abcf7012184b27e75a7db Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 23 Mar 2016 16:57:18 +0200 Subject: [PATCH 3/3] fix invitation email and email template --- .../Modules/Crm/Business/Event/Invitations.php | 15 ++++++++++++--- application/Espo/Services/EmailTemplate.php | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/application/Espo/Modules/Crm/Business/Event/Invitations.php b/application/Espo/Modules/Crm/Business/Event/Invitations.php index fddc7b637a..6b93452157 100644 --- a/application/Espo/Modules/Crm/Business/Event/Invitations.php +++ b/application/Espo/Modules/Crm/Business/Event/Invitations.php @@ -75,17 +75,26 @@ class Invitations $key = '{'.$field.'}'; switch ($d['type']) { case 'datetime': - $contents = str_replace($key, $this->dateTime->convertSystemDateTime($entity->get($field)), $contents); + $value = $entity->get($field); + if ($value) { + $contents = str_replace($key, $this->dateTime->convertSystemDateTime($value), $contents); + } break; case 'date': - $contents = str_replace($key, $this->dateTime->convertSystemDate($entity->get($field)), $contents); + $value = $entity->get($field); + if ($value) { + $contents = str_replace($key, $this->dateTime->convertSystemDate($value), $contents); + } break; case 'jsonArray': break; case 'jsonObject': break; default: - $contents = str_replace($key, $entity->get($field), $contents); + $value = $entity->get($field); + if (is_string($value) || $value === null || is_scalar($value) || is_callable([$value, '__toString'])) { + $contents = str_replace($key, $value, $contents); + } } } diff --git a/application/Espo/Services/EmailTemplate.php b/application/Espo/Services/EmailTemplate.php index a325defb69..87958c7e02 100644 --- a/application/Espo/Services/EmailTemplate.php +++ b/application/Espo/Services/EmailTemplate.php @@ -192,7 +192,9 @@ class EmailTemplate extends Record $value = $this->getDateTime()->convertSystemDateTime($value); } } - $text = str_replace('{' . $type . '.' . $field . '}', $value, $text); + if (is_string($value) || $value === null || is_scalar($value) || is_callable([$value, '__toString'])) { + $text = str_replace('{' . $type . '.' . $field . '}', $value, $text); + } } return $text; }