mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-10 04:47:02 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b788c3c2d | ||
|
|
17e487d011 | ||
|
|
3c64db25b9 | ||
|
|
7af819a656 | ||
|
|
275ee96750 | ||
|
|
b66cb676a1 | ||
|
|
975b7b72c3 | ||
|
|
2dfd14f3c5 | ||
|
|
caf6217b9a | ||
|
|
8ef2ed4144 | ||
|
|
befec82120 |
@@ -115,6 +115,14 @@ class CurrencyType extends FloatType
|
||||
$currency = $entity->get($attribute);
|
||||
$currencyList = $this->config->get('currencyList') ?? [$this->config->get('defaultCurrency')];
|
||||
|
||||
if (
|
||||
$currency === null &&
|
||||
!$entity->has($field) &&
|
||||
$entity->isNew()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
$currency === null &&
|
||||
$entity->has($field) &&
|
||||
|
||||
@@ -40,6 +40,7 @@ use Espo\Core\Api\ErrorOutput;
|
||||
use Espo\Core\Api\RequestWrapper;
|
||||
use Espo\Core\Api\ResponseWrapper;
|
||||
use Espo\Core\Api\AuthBuilderFactory;
|
||||
use Espo\Core\Portal\Utils\Url;
|
||||
use Espo\Core\Utils\Route;
|
||||
use Espo\Core\Utils\ClientManager;
|
||||
use Espo\Core\ApplicationRunners\EntryPoint as EntryPointRunner;
|
||||
@@ -87,6 +88,14 @@ class Starter
|
||||
throw new BadRequest("No 'entryPoint' param.");
|
||||
}
|
||||
|
||||
$portalId = Url::getPortalIdFromEnv();
|
||||
|
||||
if ($portalId && !$final) {
|
||||
$this->runThroughPortal($portalId, $entryPoint);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$responseWrapped = new ResponseWrapper(new Response());
|
||||
|
||||
try {
|
||||
@@ -206,7 +215,11 @@ class Starter
|
||||
{
|
||||
$app = new PortalApplication($portalId);
|
||||
|
||||
$app->setClientBasePath($this->clientManager->getBasePath());
|
||||
$clientManager = $app->getContainer()
|
||||
->getByClass(ClientManager::class);
|
||||
|
||||
$clientManager->setBasePath($this->clientManager->getBasePath());
|
||||
$clientManager->setApiUrl('api/v1/portal-access/' . $portalId);
|
||||
|
||||
$params = RunnerParams::fromArray([
|
||||
'entryPoint' => $entryPoint,
|
||||
|
||||
@@ -37,7 +37,6 @@ use RuntimeException;
|
||||
class DatabaseParamsFactory
|
||||
{
|
||||
private const DEFAULT_PLATFORM = 'Mysql';
|
||||
private const DEFAULT_CHARSET = 'utf8';
|
||||
|
||||
public function __construct(private Config $config) {}
|
||||
|
||||
@@ -55,7 +54,7 @@ class DatabaseParamsFactory
|
||||
->withName($config->get('database.dbname'))
|
||||
->withUsername($config->get('database.user'))
|
||||
->withPassword($config->get('database.password'))
|
||||
->withCharset($config->get('database.charset') ?? self::DEFAULT_CHARSET)
|
||||
->withCharset($config->get('database.charset'))
|
||||
->withPlatform($config->get('database.platform'))
|
||||
->withSslCa($config->get('database.sslCA'))
|
||||
->withSslCert($config->get('database.sslCert'))
|
||||
|
||||
@@ -47,9 +47,14 @@ class Url
|
||||
return explode('/', $url)[count(explode('/', $scriptNameModified)) - 1] ?? null;
|
||||
}
|
||||
|
||||
public static function getPortalIdFromEnv(): ?string
|
||||
{
|
||||
return $_SERVER['ESPO_PORTAL_ID'] ?? null;
|
||||
}
|
||||
|
||||
public static function detectPortalId(): ?string
|
||||
{
|
||||
$portalId = $_SERVER['ESPO_PORTAL_ID'] ?? null;
|
||||
$portalId = self::getPortalIdFromEnv();
|
||||
|
||||
if ($portalId) {
|
||||
return $portalId;
|
||||
|
||||
@@ -46,6 +46,7 @@ class ClientManager
|
||||
protected string $runScript = "app.start();";
|
||||
private string $basePath = '';
|
||||
private string $libsConfigPath = 'client/cfg/libs.json';
|
||||
private string $apiUrl = 'api/v1';
|
||||
|
||||
private string $nonce;
|
||||
|
||||
@@ -233,7 +234,7 @@ class ClientManager
|
||||
|
||||
$data = [
|
||||
'applicationId' => 'espocrm-application-id',
|
||||
'apiUrl' => 'api/v1',
|
||||
'apiUrl' => $this->apiUrl,
|
||||
'applicationName' => $this->config->get('applicationName', 'EspoCRM'),
|
||||
'cacheTimestamp' => $cacheTimestamp,
|
||||
'loaderCacheTimestamp' => $loaderCacheTimestamp,
|
||||
@@ -293,4 +294,9 @@ class ClientManager
|
||||
{
|
||||
return $this->devModeJsFileListProvider->get();
|
||||
}
|
||||
|
||||
public function setApiUrl(string $apiUrl): void
|
||||
{
|
||||
$this->apiUrl = $apiUrl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +264,10 @@ class DiffModifier
|
||||
->setNotnull(false)
|
||||
->setDefault(null);
|
||||
|
||||
if ($name === 'id') {
|
||||
$column->setNotnull(true);
|
||||
}
|
||||
|
||||
self::unsetChangedColumnProperty($tableDiff, $columnDiff, $name, 'autoincrement');
|
||||
|
||||
return true;
|
||||
|
||||
@@ -216,7 +216,7 @@ class Note extends Record
|
||||
$siteUrl = $this->config->getSiteUrl();
|
||||
|
||||
$regexp = '/' . preg_quote($siteUrl, '/') .
|
||||
'(\/portal|\/portal\/[a-zA-Z0-9]*)?\/#([A-Z][a-zA-Z0-9]*)\/view\/([a-zA-Z0-9]*)/';
|
||||
'(\/portal|\/portal\/[a-zA-Z0-9]*)?\/#([A-Z][a-zA-Z0-9]*)\/view\/([a-zA-Z0-9-]*)/';
|
||||
|
||||
$post = preg_replace($regexp, '[\2/\3](#\2/view/\3)', $post);
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ use Espo\Core\Record\ServiceContainer as RecordServiceContainer;
|
||||
use Espo\Core\Utils\SystemUser;
|
||||
use Espo\Entities\Subscription;
|
||||
use Espo\Modules\Crm\Entities\Account;
|
||||
use Espo\ORM\Query\Part\Expression as Expr;
|
||||
use Espo\ORM\Query\Part\Order;
|
||||
use Espo\Repositories\EmailAddress as EmailAddressRepository;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
@@ -1103,7 +1105,10 @@ class Service
|
||||
->buildQueryBuilder();
|
||||
|
||||
if (!$searchParams->getOrderBy()) {
|
||||
$builder->order('LIST:id:' . $this->user->getId(), 'DESC');
|
||||
$builder->order([]);
|
||||
$builder->order(
|
||||
Order::createByPositionInList(Expr::column('id'), [$this->user->getId()])
|
||||
);
|
||||
$builder->order('name');
|
||||
}
|
||||
|
||||
@@ -1168,10 +1173,10 @@ class Service
|
||||
->where([
|
||||
'isActive' => true,
|
||||
])
|
||||
->order([
|
||||
['LIST:id:' . $this->user->getId(), 'DESC'],
|
||||
['name'],
|
||||
])
|
||||
->order(
|
||||
Order::createByPositionInList(Expr::column('id'), [$this->user->getId()])
|
||||
)
|
||||
->order('name')
|
||||
->find();
|
||||
|
||||
$data = [
|
||||
|
||||
@@ -37,7 +37,8 @@ define('views/event/fields/name-for-history', ['views/fields/varchar'], function
|
||||
|
||||
let status = this.model.get('status');
|
||||
|
||||
let canceledStatusList = this.getMetadata().get(['scopes', this.model.entityType, 'canceledStatusList']);
|
||||
let canceledStatusList = this.getMetadata()
|
||||
.get(['scopes', this.model.entityType, 'canceledStatusList']) || [];
|
||||
|
||||
data.strikethrough = canceledStatusList.includes(status);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"yzalis/identicon": "*",
|
||||
"zordius/lightncandy": "dev-espo#v1.2.5e",
|
||||
"composer/semver": "^3",
|
||||
"spatie/async": "1.5.5",
|
||||
"spatie/async": "1.5.6",
|
||||
"tecnickcom/tcpdf": "6.3.5",
|
||||
"symfony/process": "4.4.*",
|
||||
"symfony/http-foundation": "4.4.*",
|
||||
|
||||
14
composer.lock
generated
14
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a5da894e2eec9f396d3f1ea9ec7f2251",
|
||||
"content-hash": "5940278db62a149dd58d48975ac8525e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "async-aws/core",
|
||||
@@ -4416,16 +4416,16 @@
|
||||
},
|
||||
{
|
||||
"name": "spatie/async",
|
||||
"version": "1.5.5",
|
||||
"version": "1.5.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/async.git",
|
||||
"reference": "742708736b1e6d606dd1cd0f60acb7e354211e41"
|
||||
"reference": "24a8ffa98f4fe0f9dc5daef3bab02a65729fe23b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/async/zipball/742708736b1e6d606dd1cd0f60acb7e354211e41",
|
||||
"reference": "742708736b1e6d606dd1cd0f60acb7e354211e41",
|
||||
"url": "https://api.github.com/repos/spatie/async/zipball/24a8ffa98f4fe0f9dc5daef3bab02a65729fe23b",
|
||||
"reference": "24a8ffa98f4fe0f9dc5daef3bab02a65729fe23b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4471,7 +4471,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/spatie/async/issues",
|
||||
"source": "https://github.com/spatie/async/tree/1.5.5"
|
||||
"source": "https://github.com/spatie/async/tree/1.5.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4479,7 +4479,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-21T06:40:45+00:00"
|
||||
"time": "2023-08-25T15:47:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "7.5.3",
|
||||
"version": "7.5.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "espocrm",
|
||||
"version": "7.5.3",
|
||||
"version": "7.5.6",
|
||||
"hasInstallScript": true,
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "7.5.3",
|
||||
"version": "7.5.6",
|
||||
"description": "Open-source CRM.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user