mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-10 15:17:01 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db26c579b0 | ||
|
|
623b26f60f | ||
|
|
fec6bf8ee0 | ||
|
|
f5a655b9fc | ||
|
|
1a5abe6363 | ||
|
|
aced5fcab9 | ||
|
|
f786690f1e |
@@ -69,7 +69,7 @@ class Saver implements SaverInterface
|
||||
$emailAddressData = $entity->get('emailAddressData');
|
||||
}
|
||||
|
||||
if ($emailAddressData !== null) {
|
||||
if ($emailAddressData !== null && $entity->isAttributeChanged('emailAddressData')) {
|
||||
$this->storeData($entity);
|
||||
|
||||
return;
|
||||
|
||||
@@ -74,7 +74,7 @@ class Saver implements SaverInterface
|
||||
$phoneNumberData = $entity->get('phoneNumberData');
|
||||
}
|
||||
|
||||
if ($phoneNumberData !== null) {
|
||||
if ($phoneNumberData !== null && $entity->isAttributeChanged('phoneNumberData')) {
|
||||
$this->storeData($entity);
|
||||
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM – Open Source CRM application.
|
||||
* Copyright (C) 2014-2024 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Classes\Acl\MassEmail\LinkCheckers;
|
||||
|
||||
use Espo\Core\Acl\LinkChecker;
|
||||
use Espo\Entities\InboundEmail;
|
||||
use Espo\Entities\User;
|
||||
use Espo\Modules\Crm\Entities\MassEmail;
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
/**
|
||||
* @implements LinkChecker<MassEmail, InboundEmail>
|
||||
* @noinspection PhpUnused
|
||||
*/
|
||||
class InboundEmailLinkChecker implements LinkChecker
|
||||
{
|
||||
public function check(User $user, Entity $entity, Entity $foreignEntity): bool
|
||||
{
|
||||
return $foreignEntity->smtpIsForMassEmail();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"ownershipCheckerClassName": "Espo\\Modules\\Crm\\Classes\\Acl\\MassEmail\\OwnershipChecker"
|
||||
"ownershipCheckerClassName": "Espo\\Modules\\Crm\\Classes\\Acl\\MassEmail\\OwnershipChecker",
|
||||
"linkCheckerClassNameMap": {
|
||||
"inboundEmail": "Espo\\Modules\\Crm\\Classes\\Acl\\MassEmail\\LinkCheckers\\InboundEmailLinkChecker"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ class CalendarView extends View {
|
||||
|
||||
const todayUnix = moment().unix();
|
||||
const startUnix = moment(view.activeStart).unix();
|
||||
const endUnix = moment(view.activeStart).unix();
|
||||
const endUnix = moment(view.activeEnd).unix();
|
||||
|
||||
return startUnix <= todayUnix && todayUnix < endUnix;
|
||||
}
|
||||
|
||||
@@ -42,16 +42,18 @@ class ViewHelper {
|
||||
|
||||
/** @private */
|
||||
this.mdBeforeList = [
|
||||
{
|
||||
regex: /```\n?([\s\S]*?)```/g,
|
||||
/*{
|
||||
regex: /```\n?([\s\S]*?)```/g,
|
||||
value: (s, string) => {
|
||||
return '```\n' + string + '```';
|
||||
return '```\n' + string.replace(/\\\>/g, '>') + '```';
|
||||
},
|
||||
},
|
||||
},*/
|
||||
{
|
||||
regex: /`([\s\S]*?)`/g,
|
||||
// Also covers triple-backtick blocks.
|
||||
regex: /`([\s\S]*?)`/g,
|
||||
value: (s, string) => {
|
||||
return '`' + string + '`';
|
||||
// noinspection RegExpRedundantEscape
|
||||
return '`' + string.replace(/\\\</g, '<') + '`';
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -689,7 +691,8 @@ class ViewHelper {
|
||||
transformMarkdownText(text, options) {
|
||||
text = text || '';
|
||||
|
||||
text = Handlebars.Utils.escapeExpression(text).replace(/>+/g, '>');
|
||||
// noinspection RegExpRedundantEscape
|
||||
text = text.replace(/\</g, '\\<');
|
||||
|
||||
this.mdBeforeList.forEach(item => {
|
||||
text = text.replace(item.regex, item.value);
|
||||
@@ -697,12 +700,9 @@ class ViewHelper {
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (options.inline) {
|
||||
text = marked.parseInline(text);
|
||||
}
|
||||
else {
|
||||
text = marked.parse(text);
|
||||
}
|
||||
text = options.inline ?
|
||||
marked.parseInline(text) :
|
||||
marked.parse(text);
|
||||
|
||||
text = DOMPurify.sanitize(text, {}).toString();
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "8.1.2",
|
||||
"version": "8.1.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "espocrm",
|
||||
"version": "8.1.2",
|
||||
"version": "8.1.4",
|
||||
"hasInstallScript": true,
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "8.1.2",
|
||||
"version": "8.1.4",
|
||||
"description": "Open-source CRM.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -31,10 +31,12 @@ namespace tests\integration\Espo\Core\FieldProcessing;
|
||||
|
||||
use Espo\Core\ORM\EntityManager;
|
||||
|
||||
use Espo\Modules\Crm\Entities\Contact;
|
||||
use Espo\Core\{
|
||||
Field\EmailAddressGroup,
|
||||
Field\EmailAddress,
|
||||
};
|
||||
Record\ServiceContainer,
|
||||
Record\UpdateParams};
|
||||
|
||||
class EmailAddressTest extends \tests\integration\Core\BaseTestCase
|
||||
{
|
||||
@@ -120,4 +122,22 @@ class EmailAddressTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$this->assertEquals('test@test.com', $group->getPrimary()->getAddress());
|
||||
}
|
||||
|
||||
public function testEmailAddress3(): void
|
||||
{
|
||||
$service = $this->getContainer()->getByClass(ServiceContainer::class)->getByClass(Contact::class);
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
/** @var Contact $contact */
|
||||
$contact = $em->createEntity(Contact::ENTITY_TYPE);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$service->update($contact->getId(), (object) [
|
||||
'emailAddress' => 'test@test.com',
|
||||
], UpdateParams::create());
|
||||
|
||||
$em->refreshEntity($contact);
|
||||
|
||||
$this->assertEquals('test@test.com', $contact->getEmailAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,12 @@ namespace tests\integration\Espo\Core\FieldProcessing;
|
||||
|
||||
use Espo\Core\ORM\EntityManager;
|
||||
|
||||
use Espo\Modules\Crm\Entities\Contact;
|
||||
use Espo\Core\{
|
||||
Field\PhoneNumberGroup,
|
||||
Field\PhoneNumber,
|
||||
};
|
||||
Record\ServiceContainer,
|
||||
Record\UpdateParams};
|
||||
|
||||
class PhoneNumberTest extends \tests\integration\Core\BaseTestCase
|
||||
{
|
||||
@@ -99,4 +101,22 @@ class PhoneNumberTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$this->assertEquals(1, $group5->getCount());
|
||||
}
|
||||
|
||||
public function testPhoneNumber2(): void
|
||||
{
|
||||
$service = $this->getContainer()->getByClass(ServiceContainer::class)->getByClass(Contact::class);
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
/** @var Contact $contact */
|
||||
$contact = $em->createEntity(Contact::ENTITY_TYPE);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$service->update($contact->getId(), (object) [
|
||||
'phoneNumber' => '+11111111111',
|
||||
], UpdateParams::create());
|
||||
|
||||
$em->refreshEntity($contact);
|
||||
|
||||
$this->assertEquals('+11111111111', $contact->getPhoneNumber());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user