mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-04 00:37:01 +00:00
Compare commits
166 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f45e26028 | ||
|
|
f6892877c1 | ||
|
|
c7cc44edf6 | ||
|
|
e958d7c488 | ||
|
|
77ff11990b | ||
|
|
994e0c1eda | ||
|
|
d51e88be60 | ||
|
|
9595d528a8 | ||
|
|
9bfb27e10a | ||
|
|
be50630d2f | ||
|
|
d8b629a5a0 | ||
|
|
6d0b39f2b6 | ||
|
|
b778f74628 | ||
|
|
6db658c0b3 | ||
|
|
6fb88665bb | ||
|
|
f20a47542a | ||
|
|
c77e3b7e92 | ||
|
|
e7b033304c | ||
|
|
2b8a8d23eb | ||
|
|
0f59f79a9e | ||
|
|
2904cd1f53 | ||
|
|
d87ae60fea | ||
|
|
0d17cf6e78 | ||
|
|
81739d59f5 | ||
|
|
7704d5afd0 | ||
|
|
da268f2b29 | ||
|
|
01dc251ef2 | ||
|
|
9054d70f4c | ||
|
|
788b265cd4 | ||
|
|
c96640bcb1 | ||
|
|
66fb7b4e81 | ||
|
|
d83a19e316 | ||
|
|
452e39903e | ||
|
|
797fcc172c | ||
|
|
cdb7c919b3 | ||
|
|
0f7f438935 | ||
|
|
7c01eedda8 | ||
|
|
bab7f3e9fc | ||
|
|
761d85a112 | ||
|
|
52e323123a | ||
|
|
01af1677cf | ||
|
|
d4f4fcb10e | ||
|
|
74fd228bfb | ||
|
|
f452d2e5d2 | ||
|
|
3a01348e02 | ||
|
|
b1743ee4a2 | ||
|
|
ab14769387 | ||
|
|
5c800601e4 | ||
|
|
8aea81340b | ||
|
|
8513911f21 | ||
|
|
6a46c453cd | ||
|
|
2029dc5e10 | ||
|
|
70664d1a7a | ||
|
|
7d212ec62f | ||
|
|
fa7b145e07 | ||
|
|
830645cb73 | ||
|
|
94e03b3c18 | ||
|
|
3ace85eebc | ||
|
|
c6cfdd9e90 | ||
|
|
d1b2dfae3e | ||
|
|
98fb345a5a | ||
|
|
481314886f | ||
|
|
ad90cd171a | ||
|
|
8272e0e652 | ||
|
|
f218de2e04 | ||
|
|
53529fc506 | ||
|
|
aef99fb4fd | ||
|
|
86f690c79f | ||
|
|
71f9e90436 | ||
|
|
75608f41b1 | ||
|
|
0730ae5b3f | ||
|
|
a7f537879e | ||
|
|
6066cf1d65 | ||
|
|
ccda236b6e | ||
|
|
32ec348369 | ||
|
|
d85f66171d | ||
|
|
8c6aa46ec8 | ||
|
|
d2f7bc475a | ||
|
|
410cf02518 | ||
|
|
958414017e | ||
|
|
8fbfad9637 | ||
|
|
07e8f94748 | ||
|
|
4db162f9f7 | ||
|
|
459dfb7937 | ||
|
|
56b0536152 | ||
|
|
5bb7dd3ccd | ||
|
|
6e50e4fd8e | ||
|
|
878e1616da | ||
|
|
64a410099e | ||
|
|
9cb8664ddf | ||
|
|
6d5c3c8ad5 | ||
|
|
f07c8fca64 | ||
|
|
944c76ad93 | ||
|
|
ae8f9df02b | ||
|
|
6da3659b7d | ||
|
|
1f1d9f3abd | ||
|
|
530d7f2d81 | ||
|
|
e67ecded2a | ||
|
|
b9343d5e64 | ||
|
|
898393c7ac | ||
|
|
9b2ea5298d | ||
|
|
0d2b56c58f | ||
|
|
076c920dc7 | ||
|
|
638df642ec | ||
|
|
d2f4190612 | ||
|
|
7201f517e8 | ||
|
|
c91365f627 | ||
|
|
f3bc4dbccf | ||
|
|
d4daef6012 | ||
|
|
dbf4f68a44 | ||
|
|
8a7325963b | ||
|
|
fc0d8dffcd | ||
|
|
f8498e3adc | ||
|
|
e4b51ba675 | ||
|
|
83f9ead607 | ||
|
|
bf6778770e | ||
|
|
093b80293a | ||
|
|
34dee314e7 | ||
|
|
313b94168e | ||
|
|
d6085bbdcf | ||
|
|
160dc5d61c | ||
|
|
987b383d7c | ||
|
|
8b4cb1568e | ||
|
|
aef4028180 | ||
|
|
9b779ee8cd | ||
|
|
ccc339cf48 | ||
|
|
6aabbfd944 | ||
|
|
0e87626e34 | ||
|
|
8641181511 | ||
|
|
123c3ef8ab | ||
|
|
07bd5a9d60 | ||
|
|
deca89039a | ||
|
|
1542fa86d8 | ||
|
|
93ca814fe3 | ||
|
|
4d9e5ee302 | ||
|
|
0a697cdc0a | ||
|
|
1b01e476ac | ||
|
|
ee689fb351 | ||
|
|
92a76d80f2 | ||
|
|
a662c1a5fe | ||
|
|
3ffa949276 | ||
|
|
371966e2cf | ||
|
|
8f1a4d2a02 | ||
|
|
3128b6f25a | ||
|
|
0920821f1e | ||
|
|
0f8f9c01ff | ||
|
|
1d9621bc91 | ||
|
|
e138daec5f | ||
|
|
4a51e754d7 | ||
|
|
e6e0bc1703 | ||
|
|
49fbc6e082 | ||
|
|
a0ed610f60 | ||
|
|
9f8c0eb4a2 | ||
|
|
be29fac010 | ||
|
|
b3cefd9bcb | ||
|
|
501d6f2692 | ||
|
|
3d7560024f | ||
|
|
a201b45d04 | ||
|
|
41f88a4015 | ||
|
|
52a131ef93 | ||
|
|
7ab28601ca | ||
|
|
5de509a0de | ||
|
|
2534b14dce | ||
|
|
27f98b95eb | ||
|
|
b08bee78b9 | ||
|
|
a39327a95b |
@@ -126,7 +126,8 @@ module.exports = function (grunt) {
|
||||
'modules/**',
|
||||
'img/**',
|
||||
'css/**',
|
||||
'sounds/**'
|
||||
'sounds/**',
|
||||
'custom/**'
|
||||
],
|
||||
dest: 'build/tmp/client',
|
||||
},
|
||||
@@ -154,6 +155,7 @@ module.exports = function (grunt) {
|
||||
'bootstrap.php',
|
||||
'cron.php',
|
||||
'rebuild.php',
|
||||
'clear_cache.php',
|
||||
'upgrade.php',
|
||||
'index.php',
|
||||
'LICENSE.txt',
|
||||
|
||||
17
README.md
17
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
<a href='http://www.espocrm.com'>EspoCRM is an Open Source CRM</a> (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities - all in an easy and intuitive interface.
|
||||
|
||||
It's a web application with a frontend designed as a single page application based on backbone.js and a RESTful backend written in PHP.
|
||||
It's a web application with a frontend designed as a single page application based on backbone.js and a REST API backend written in PHP.
|
||||
|
||||
Download the latest release from our [website](http://www.espocrm.com).
|
||||
|
||||
@@ -33,6 +33,21 @@ You need to have nodejs and Grunt CLI installed.
|
||||
|
||||
The build will be created in the `build` directory.
|
||||
|
||||
### How to make translation
|
||||
|
||||
Build po file with command:
|
||||
`node po.js en_EN`
|
||||
(specify needed language instead of en_EN)
|
||||
|
||||
After that tranlate the generated po file.
|
||||
|
||||
Build json files from the translated po file:
|
||||
|
||||
1. Put your po file espocrm-en_EN.po to the `build` directory
|
||||
2. Run `node lang.js en_EN`
|
||||
|
||||
The files will be created in build directory.
|
||||
|
||||
### License
|
||||
|
||||
EspoCRM is published under the GNU GPLv3 [license](https://raw.githubusercontent.com/espocrm/espocrm/master/LICENSE.txt).
|
||||
|
||||
@@ -41,7 +41,7 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (empty($data['password'])) {
|
||||
if (is_null($data['password'])) {
|
||||
if ($data['type'] == 'preferences') {
|
||||
if (!$this->getUser()->isAdmin() && $data['id'] != $this->getUser()->id) {
|
||||
throw new Forbidden();
|
||||
@@ -75,5 +75,13 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
|
||||
return $this->getRecordService()->markAsReadByIds($ids);
|
||||
}
|
||||
|
||||
public function actionMarkAllAsRead($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getRecordService()->markAllAsRead();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,5 +44,27 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data['id']);
|
||||
if (!$emailAccount) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
if ($emailAccount->get('assignedUserId') != $this->getUser()->id && !$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('password'));
|
||||
}
|
||||
|
||||
return $this->getRecordService()->testConnection($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,50 +18,94 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Core\Utils as Utils;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class Import extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
class Import extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->getContainer()->get('fileManager');
|
||||
}
|
||||
|
||||
|
||||
protected function getEntityManager()
|
||||
{
|
||||
return $this->getContainer()->get('entityManager');
|
||||
}
|
||||
|
||||
|
||||
public function actionUploadFile($params, $data)
|
||||
{
|
||||
{
|
||||
$contents = $data;
|
||||
|
||||
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment');
|
||||
$attachment->set('type', 'text/csv');
|
||||
$attachment->set('role', 'Import File');
|
||||
$attachment->set('role', 'Import File');
|
||||
$attachment->set('name', 'import-file.csv');
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
|
||||
|
||||
$this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents);
|
||||
|
||||
|
||||
return array(
|
||||
'attachmentId' => $attachment->id
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function actionRevert($params, $data)
|
||||
{
|
||||
return $this->getService('Import')->revert($data['entityType'], $data['idsToRemove']);
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getService('Import')->revert($data['id']);
|
||||
}
|
||||
|
||||
|
||||
public function actionRemoveDuplicates($params, $data)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getService('Import')->removeDuplicates($data['id']);
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
{
|
||||
{
|
||||
$importParams = array(
|
||||
'headerRow' => $data['headerRow'],
|
||||
'fieldDelimiter' => $data['fieldDelimiter'],
|
||||
@@ -74,13 +118,13 @@ class Import extends \Espo\Core\Controllers\Base
|
||||
'defaultValues' => $data['defaultValues'],
|
||||
'action' => $data['action'],
|
||||
);
|
||||
|
||||
|
||||
$attachmentId = $data['attachmentId'];
|
||||
|
||||
|
||||
if (!$this->getAcl()->check($data['entityType'], 'edit')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
|
||||
return $this->getService('Import')->import($data['entityType'], $data['fields'], $attachmentId, $importParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,12 @@ class Application
|
||||
$dataManager->rebuild();
|
||||
}
|
||||
|
||||
public function runClearCache()
|
||||
{
|
||||
$dataManager = $this->getContainer()->get('dataManager');
|
||||
$dataManager->clearCache();
|
||||
}
|
||||
|
||||
public function isInstalled()
|
||||
{
|
||||
$config = $this->getContainer()->get('config');
|
||||
|
||||
@@ -93,10 +93,10 @@ class HookManager
|
||||
}
|
||||
}
|
||||
|
||||
public function process($scope, $hookName, $injection = null)
|
||||
public function process($scope, $hookName, $injection = null, array $options = array())
|
||||
{
|
||||
if ($scope != 'Common') {
|
||||
$this->process('Common', $hookName, $injection);
|
||||
$this->process('Common', $hookName, $injection, $options);
|
||||
}
|
||||
|
||||
if (!empty($this->data[$scope])) {
|
||||
@@ -106,7 +106,7 @@ class HookManager
|
||||
$this->hooks[$className] = $this->createHookByClassName($className);
|
||||
}
|
||||
$hook = $this->hooks[$className];
|
||||
$hook->$hookName($injection);
|
||||
$hook->$hookName($injection, $options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Espo\Core\Hooks;
|
||||
|
||||
use \Espo\Core\Interfaces\Injectable;
|
||||
|
||||
class Base implements Injectable
|
||||
abstract class Base implements Injectable
|
||||
{
|
||||
protected $dependencies = array(
|
||||
'entityManager',
|
||||
@@ -52,6 +52,11 @@ class Base implements Injectable
|
||||
return $this->dependencies;
|
||||
}
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
}
|
||||
|
||||
protected function getInjection($name)
|
||||
{
|
||||
return $this->injections[$name];
|
||||
|
||||
@@ -74,7 +74,10 @@ class Importer
|
||||
|
||||
$fromArr = $this->getAddressListFromMessage($message, 'from');
|
||||
if (isset($message->from)) {
|
||||
$email->set('fromName', $message->from);
|
||||
$email->set('fromString', $message->from);
|
||||
}
|
||||
if (isset($message->replyTo)) {
|
||||
$email->set('replyToString', $message->replyTo);
|
||||
}
|
||||
|
||||
$toArr = $this->getAddressListFromMessage($message, 'to');
|
||||
@@ -107,7 +110,9 @@ class Importer
|
||||
$dateSent = $dt->setTimezone(new \DateTimeZone('UTC'))->format('Y-m-d H:i:s');
|
||||
$email->set('dateSent', $dateSent);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$email->set('dateSent', date('Y-m-d H:i:s'));
|
||||
}
|
||||
if (isset($message->deliveryDate)) {
|
||||
$dt = new \DateTime($message->deliveryDate);
|
||||
if ($dt) {
|
||||
@@ -123,7 +128,7 @@ class Importer
|
||||
$this->importPartDataToEmail($email, $part, $inlineIds);
|
||||
}
|
||||
} else {
|
||||
$this->importPartDataToEmail($email, $message, $inlineIds);
|
||||
$this->importPartDataToEmail($email, $message, $inlineIds, 'text/plain');
|
||||
}
|
||||
|
||||
$body = $email->get('body');
|
||||
@@ -194,7 +199,16 @@ class Importer
|
||||
$email->set('parentType', 'Account');
|
||||
$email->set('parentId', $account->id);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
$lead = $this->getEntityManager()->getRepository('Lead')->where(array(
|
||||
'emailAddress' => $emailAddress
|
||||
))->findOne();
|
||||
if ($lead) {
|
||||
$email->set('parentType', 'Lead');
|
||||
$email->set('parentId', $lead->id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,19 +237,29 @@ class Importer
|
||||
return $addressList;
|
||||
}
|
||||
|
||||
protected function importPartDataToEmail(\Espo\Entities\Email $email, $part, &$inlineIds = array())
|
||||
protected function importPartDataToEmail(\Espo\Entities\Email $email, $part, &$inlineIds = array(), $defaultContentType = null)
|
||||
{
|
||||
try {
|
||||
if (!$part->getHeaders() || !isset($part->contentType)) {
|
||||
return;
|
||||
$type = null;
|
||||
|
||||
if ($part->getHeaders() && isset($part->contentType)) {
|
||||
$type = strtok($part->contentType, ';');
|
||||
}
|
||||
|
||||
if (empty($type)) {
|
||||
if (!empty($defaultContentType)) {
|
||||
$type = $defaultContentType;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$type = strtok($part->contentType, ';');
|
||||
$encoding = null;
|
||||
|
||||
$isAttachment = true;
|
||||
|
||||
if ($type == 'text/plain' || $type == 'text/html') {
|
||||
|
||||
$isAttachment = false;
|
||||
$content = $this->getContentFromPart($part);
|
||||
if ($type == 'text/plain') {
|
||||
|
||||
@@ -284,9 +284,12 @@ class Sender
|
||||
|
||||
$message->setBody($body);
|
||||
|
||||
if ($message->getHeaders()->has('content-type')) {
|
||||
$message->getHeaders()->get('content-type')->setType($messageType);
|
||||
if (!$message->getHeaders()->has('content-type')) {
|
||||
$contentTypeHeader = new \Zend\Mail\Header\ContentType();
|
||||
$message->getHeaders()->addHeader($contentTypeHeader);
|
||||
}
|
||||
$message->getHeaders()->get('content-type')->setType($messageType);
|
||||
|
||||
$message->setEncoding('UTF-8');
|
||||
|
||||
try {
|
||||
@@ -304,7 +307,7 @@ class Sender
|
||||
|
||||
$this->transport->send($message);
|
||||
|
||||
$email->set('messageId', $messageId);
|
||||
$email->set('messageId', '<' . $messageId . '>');
|
||||
$email->set('status', 'Sent');
|
||||
$email->set('dateSent', date("Y-m-d H:i:s"));
|
||||
} catch (\Exception $e) {
|
||||
|
||||
103
application/Espo/Core/Notificators/Base.php
Normal file
103
application/Espo/Core/Notificators/Base.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Notificators;
|
||||
|
||||
use \Espo\Core\Interfaces\Injectable;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Base implements Injectable
|
||||
{
|
||||
protected $dependencies = array(
|
||||
'user',
|
||||
'entityManager',
|
||||
);
|
||||
|
||||
protected $injections = array();
|
||||
|
||||
public static $order = 9;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
}
|
||||
|
||||
protected function init()
|
||||
{
|
||||
}
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
}
|
||||
|
||||
public function getDependencyList()
|
||||
{
|
||||
return $this->dependencies;
|
||||
}
|
||||
|
||||
protected function getInjection($name)
|
||||
{
|
||||
return $this->injections[$name];
|
||||
}
|
||||
|
||||
public function inject($name, $object)
|
||||
{
|
||||
$this->injections[$name] = $object;
|
||||
}
|
||||
|
||||
protected function getEntityManager()
|
||||
{
|
||||
return $this->injections['entityManager'];
|
||||
}
|
||||
|
||||
protected function getUser()
|
||||
{
|
||||
return $this->injections['user'];
|
||||
}
|
||||
|
||||
public function process(Entity $entity)
|
||||
{
|
||||
if ($entity->has('assignedUserId') && $entity->get('assignedUserId')) {
|
||||
$assignedUserId = $entity->get('assignedUserId');
|
||||
if ($assignedUserId != $this->getUser()->id && $entity->isFieldChanged('assignedUserId')) {
|
||||
$notification = $this->getEntityManager()->getEntity('Notification');
|
||||
$notification->set(array(
|
||||
'type' => 'Assign',
|
||||
'userId' => $assignedUserId,
|
||||
'data' => array(
|
||||
'entityType' => $entity->getEntityType(),
|
||||
'entityId' => $entity->id,
|
||||
'entityName' => $entity->get('name'),
|
||||
'isNew' => $entity->isNew(),
|
||||
'userId' => $this->getUser()->id,
|
||||
'userName' => $this->getUser()->get('name')
|
||||
)
|
||||
));
|
||||
$this->getEntityManager()->saveEntity($notification);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,17 +41,20 @@ class Entity extends \Espo\ORM\Entity
|
||||
$columnsData = new \stdClass();
|
||||
}
|
||||
|
||||
foreach ($collection as $e) {
|
||||
$id = $e->id;
|
||||
$ids[] = $id;
|
||||
$names->$id = $e->get('name');
|
||||
if (!empty($columns)) {
|
||||
$columnsData->$id = new \stdClass();
|
||||
foreach ($columns as $column => $f) {
|
||||
$columnsData->$id->$column = $e->get($f);
|
||||
if ($collection) {
|
||||
foreach ($collection as $e) {
|
||||
$id = $e->id;
|
||||
$ids[] = $id;
|
||||
$names->$id = $e->get('name');
|
||||
if (!empty($columns)) {
|
||||
$columnsData->$id = new \stdClass();
|
||||
foreach ($columns as $column => $f) {
|
||||
$columnsData->$id->$column = $e->get($f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->set($field . 'Ids', $ids);
|
||||
$this->set($field . 'Names', $names);
|
||||
if (!empty($columns)) {
|
||||
|
||||
@@ -140,10 +140,10 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
}
|
||||
}
|
||||
|
||||
protected function beforeRemove(Entity $entity)
|
||||
protected function beforeRemove(Entity $entity, array $options = array())
|
||||
{
|
||||
parent::beforeRemove($entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity);
|
||||
parent::beforeRemove($entity, $options);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity, $options);
|
||||
|
||||
$nowString = date('Y-m-d H:i:s', time());
|
||||
if ($entity->hasField('modifiedAt')) {
|
||||
@@ -154,53 +154,53 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
}
|
||||
}
|
||||
|
||||
protected function afterRemove(Entity $entity)
|
||||
protected function afterRemove(Entity $entity, array $options = array())
|
||||
{
|
||||
parent::afterRemove($entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity);
|
||||
parent::afterRemove($entity, $options);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity, $options);
|
||||
}
|
||||
|
||||
public function remove(Entity $entity)
|
||||
public function remove(Entity $entity, array $options = array())
|
||||
{
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity, $options);
|
||||
|
||||
$result = parent::remove($entity);
|
||||
$result = parent::remove($entity, $options);
|
||||
if ($result) {
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity, $options);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function beforeSave(Entity $entity)
|
||||
protected function beforeSave(Entity $entity, array $options = array())
|
||||
{
|
||||
parent::beforeSave($entity);
|
||||
parent::beforeSave($entity, $options);
|
||||
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeSave', $entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeSave', $entity, $options);
|
||||
}
|
||||
|
||||
protected function afterSave(Entity $entity)
|
||||
protected function afterSave(Entity $entity, array $options = array())
|
||||
{
|
||||
if (!empty($this->restoreData)) {
|
||||
$entity->set($this->restoreData);
|
||||
$this->restoreData = null;
|
||||
}
|
||||
parent::afterSave($entity);
|
||||
parent::afterSave($entity, $options);
|
||||
|
||||
$this->handleEmailAddressSave($entity);
|
||||
$this->handlePhoneNumberSave($entity);
|
||||
$this->handleSpecifiedRelations($entity);
|
||||
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterSave', $entity);
|
||||
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterSave', $entity, $options);
|
||||
}
|
||||
|
||||
public function save(Entity $entity)
|
||||
public function save(Entity $entity, array $options = array())
|
||||
{
|
||||
$nowString = date('Y-m-d H:i:s', time());
|
||||
$restoreData = array();
|
||||
|
||||
if ($entity->isNew()) {
|
||||
if (!$entity->has('id')) {
|
||||
$entity->set('id', uniqid());
|
||||
$entity->set('id', Util::generateId());
|
||||
}
|
||||
|
||||
if ($entity->hasField('createdAt')) {
|
||||
@@ -221,11 +221,13 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
}
|
||||
$entity->clear('modifiedById');
|
||||
} else {
|
||||
if ($entity->hasField('modifiedAt')) {
|
||||
$entity->set('modifiedAt', $nowString);
|
||||
}
|
||||
if ($entity->hasField('modifiedById')) {
|
||||
$entity->set('modifiedById', $this->entityManager->getUser()->id);
|
||||
if (empty($options['silent'])) {
|
||||
if ($entity->hasField('modifiedAt')) {
|
||||
$entity->set('modifiedAt', $nowString);
|
||||
}
|
||||
if ($entity->hasField('modifiedById')) {
|
||||
$entity->set('modifiedById', $this->entityManager->getUser()->id);
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->has('createdById')) {
|
||||
@@ -239,7 +241,7 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
}
|
||||
$this->restoreData = $restoreData;
|
||||
|
||||
$result = parent::save($entity);
|
||||
$result = parent::save($entity, $options);
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -268,6 +270,10 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
|
||||
if ($entity->has($fieldName) || $entity->has($columnsFieldsName)) {
|
||||
|
||||
if ($this->getMetadata()->get("entityDefs." . $entity->getEntityType() . ".fields.{$name}.noSave")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($entity->has($fieldName)) {
|
||||
$specifiedIds = $entity->get($fieldName);
|
||||
} else {
|
||||
@@ -283,24 +289,27 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
$existingColumnsData = new \stdClass();
|
||||
|
||||
$defs = array();
|
||||
$columns = $this->getMetadata()->get("entityDefs." . $entity->getEntityName() . ".fields.{$name}.columns");
|
||||
$columns = $this->getMetadata()->get("entityDefs." . $entity->getEntityType() . ".fields.{$name}.columns");
|
||||
if (!empty($columns)) {
|
||||
$columnData = $entity->get($columnsFieldsName);
|
||||
$defs['additionalColumns'] = $columns;
|
||||
}
|
||||
|
||||
foreach ($entity->get($name, $defs) as $foreignEntity) {
|
||||
$existingIds[] = $foreignEntity->id;
|
||||
if (!empty($columns)) {
|
||||
$data = new \stdClass();
|
||||
foreach ($columns as $columnName => $columnField) {
|
||||
$foreignId = $foreignEntity->id;
|
||||
$data->$columnName = $foreignEntity->get($columnField);
|
||||
$foreignCollection = $entity->get($name, $defs);
|
||||
if ($foreignCollection) {
|
||||
foreach ($foreignCollection as $foreignEntity) {
|
||||
$existingIds[] = $foreignEntity->id;
|
||||
if (!empty($columns)) {
|
||||
$data = new \stdClass();
|
||||
foreach ($columns as $columnName => $columnField) {
|
||||
$foreignId = $foreignEntity->id;
|
||||
$data->$columnName = $foreignEntity->get($columnField);
|
||||
}
|
||||
$existingColumnsData->$foreignId = $data;
|
||||
$entity->setFetched($columnsFieldsName, $existingColumnsData);
|
||||
}
|
||||
$existingColumnsData->$foreignId = $data;
|
||||
$entity->setFetched($columnsFieldsName, $existingColumnsData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->has($fieldName)) {
|
||||
|
||||
@@ -42,6 +42,8 @@ class Base
|
||||
|
||||
private $seed = null;
|
||||
|
||||
private $userTimeZone = null;
|
||||
|
||||
const MIN_LENGTH_FOR_CONTENT_SEARCH = 4;
|
||||
|
||||
public function __construct($entityManager, \Espo\Entities\User $user, Acl $acl, $metadata)
|
||||
@@ -139,7 +141,7 @@ class Base
|
||||
$where = array();
|
||||
|
||||
foreach ($params['where'] as $item) {
|
||||
if ($item['type'] == 'boolFilters' && !empty($item['value']) && is_array($item['value'])) {
|
||||
if ($item['type'] == 'bool' && !empty($item['value']) && is_array($item['value'])) {
|
||||
foreach ($item['value'] as $filter) {
|
||||
$p = $this->getBoolFilterWhere($filter);
|
||||
if (!empty($p)) {
|
||||
@@ -151,11 +153,13 @@ class Base
|
||||
if (!empty($item['value'])) {
|
||||
$this->textFilter($item['value'], $result);
|
||||
}
|
||||
} else if ($item['type'] == 'primary' && !empty($item['value'])) {
|
||||
$this->primaryFilter($item['value'], $result);
|
||||
}
|
||||
}
|
||||
|
||||
$linkedWith = array();
|
||||
$ignoreList = array('linkedWith', 'boolFilters');
|
||||
$ignoreList = array('linkedWith', 'bool', 'primary');
|
||||
foreach ($params['where'] as $item) {
|
||||
if (!in_array($item['type'], $ignoreList)) {
|
||||
$part = $this->getWherePart($item);
|
||||
@@ -186,7 +190,7 @@ class Base
|
||||
$joins[] = $link;
|
||||
if (!empty($defs['relationName']) && !empty($defs['midKeys'])) {
|
||||
$key = $defs['midKeys'][1];
|
||||
$relationName = $defs['relationName'];
|
||||
$relationName = lcfirst($defs['relationName']);
|
||||
$part[$relationName . '.' . $key] = $idsValue;
|
||||
}
|
||||
} else if ($defs['type'] == 'belongsTo') {
|
||||
@@ -268,7 +272,7 @@ class Base
|
||||
}
|
||||
$result['whereClause'][] = array(
|
||||
'OR' => array(
|
||||
'Team.id' => $this->user->get('teamsIds'),
|
||||
'teams.id' => $this->user->get('teamsIds'),
|
||||
'assignedUserId' => $this->getUser()->id
|
||||
)
|
||||
);
|
||||
@@ -301,6 +305,17 @@ class Base
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getUserTimeZone()
|
||||
{
|
||||
if (empty($this->userTimeZone)) {
|
||||
$preferences = $this->getEntityManager()->getEntity('Preferences', $this->getUser()->id);
|
||||
$timeZone = $preferences->get('timeZone');
|
||||
$this->userTimeZone = $timeZone;
|
||||
}
|
||||
|
||||
return $this->userTimeZone;
|
||||
}
|
||||
|
||||
protected function convertDateTimeWhere($item)
|
||||
{
|
||||
$format = 'Y-m-d H:i:s';
|
||||
@@ -541,6 +556,14 @@ class Base
|
||||
}
|
||||
}
|
||||
|
||||
protected function primaryFilter($filterName, &$result)
|
||||
{
|
||||
$method = 'filter' . ucfirst($filterName);
|
||||
if (method_exists($this, $method)) {
|
||||
$this->$method($result);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getBoolFilterWhere($filterName)
|
||||
{
|
||||
$method = 'getBoolFilterWhere' . ucfirst($filterName);
|
||||
|
||||
@@ -53,6 +53,11 @@ abstract class Base implements Injectable
|
||||
return $this->injections[$name];
|
||||
}
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
}
|
||||
|
||||
public function getDependencyList()
|
||||
{
|
||||
return $this->dependencies;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"controller": "Controllers.Record",
|
||||
"boolFilters": ["onlyMy"]
|
||||
"boolFilterList": ["onlyMy"]
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
"teams": {
|
||||
"type": "hasMany",
|
||||
"entity": "Team",
|
||||
"relationName": "EntityTeam"
|
||||
"relationName": "EntityTeam",
|
||||
"layoutRelationshipsDisabled": true
|
||||
}
|
||||
},
|
||||
"collection": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"controller": "Controllers.Record",
|
||||
"boolFilters": ["onlyMy"]
|
||||
"boolFilterList": ["onlyMy"]
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@
|
||||
"teams": {
|
||||
"type": "hasMany",
|
||||
"entity": "Team",
|
||||
"relationName": "EntityTeam"
|
||||
"relationName": "EntityTeam",
|
||||
"layoutRelationshipsDisabled": true
|
||||
}
|
||||
},
|
||||
"collection": {
|
||||
|
||||
@@ -551,7 +551,7 @@ abstract class Base
|
||||
$result = $this->getFileManager()->isWritableList($fullFileList);
|
||||
if (!$result) {
|
||||
$permissionDeniedList = $this->getFileManager()->getLastPermissionDeniedList();
|
||||
throw new Error("Permission denied in <br>". implode(", <br>", $permissionDeniedList));
|
||||
throw new Error("Permission denied for <br>". implode(", <br>", $permissionDeniedList));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,6 @@ use Espo\Core\Utils\Util;
|
||||
|
||||
class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
{
|
||||
/**
|
||||
* Is copied extension files to Espo
|
||||
*
|
||||
* @var [type]
|
||||
*/
|
||||
protected $isCopied = null;
|
||||
|
||||
/**
|
||||
* Main installation process
|
||||
*
|
||||
@@ -54,8 +47,6 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->initialize();
|
||||
|
||||
$this->isCopied = false;
|
||||
|
||||
/** check if an archive is unzipped, if no then unzip */
|
||||
$packagePath = $this->getPackagePath();
|
||||
if (!file_exists($packagePath)) {
|
||||
@@ -77,7 +68,6 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
if (!$this->copyFiles()) {
|
||||
$this->throwErrorAndRemovePackage('Cannot copy files.');
|
||||
}
|
||||
$this->isCopied = true;
|
||||
|
||||
/* remove files defined in a manifest */
|
||||
$this->deleteFiles(true);
|
||||
@@ -103,10 +93,6 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
protected function restoreFiles()
|
||||
{
|
||||
if (!$this->isCopied) {
|
||||
return;
|
||||
}
|
||||
|
||||
$GLOBALS['log']->info('Installer: Restore previous files.');
|
||||
|
||||
$backupPath = $this->getPath('backupPath');
|
||||
|
||||
@@ -160,7 +160,7 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
$extensionEntity = $this->getExtensionEntity();
|
||||
|
||||
if (isset($extensionEntity)) {
|
||||
$comparedVersion = version_compare($manifest['version'], $extensionEntity->get('version'));
|
||||
$comparedVersion = version_compare($manifest['version'], $extensionEntity->get('version'), '>=');
|
||||
if ($comparedVersion <= 0) {
|
||||
$this->throwErrorAndRemovePackage('You cannot install an older version of this extension.');
|
||||
}
|
||||
|
||||
@@ -67,7 +67,9 @@ class Output
|
||||
$currentRoute = $this->getSlim()->router()->getCurrentRoute();
|
||||
|
||||
if (isset($currentRoute)) {
|
||||
$GLOBALS['log']->error('API ['.$this->getSlim()->request()->getMethod().']:'.$currentRoute->getPattern().', Params:'.print_r($currentRoute->getParams(), true).', InputData: '.$this->getSlim()->request()->getBody().' - '.$message);
|
||||
$inputData = $this->getSlim()->request()->getBody();
|
||||
$inputData = $this->clearPasswords($inputData);
|
||||
$GLOBALS['log']->error('API ['.$this->getSlim()->request()->getMethod().']:'.$currentRoute->getPattern().', Params:'.print_r($currentRoute->getParams(), true).', InputData: '.$inputData.' - '.$message);
|
||||
}
|
||||
|
||||
$this->displayError($message, $code, $isPrint);
|
||||
@@ -118,5 +120,17 @@ class Output
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear passwords for inputData
|
||||
*
|
||||
* @param string $inputData
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function clearPasswords($inputData)
|
||||
{
|
||||
return preg_replace('/"(.*?password.*?)":".*?"/i', '"$1":"*****"', $inputData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ class Auth
|
||||
$authenticationMethod = $this->config->get('authenticationMethod', 'Espo');
|
||||
$authenticationClassName = "\\Espo\\Core\\Utils\\Authentication\\" . $authenticationMethod;
|
||||
$this->authentication = new $authenticationClassName($this->config, $this->entityManager, $this);
|
||||
|
||||
$this->request = $this->container->get('slim')->request();
|
||||
}
|
||||
|
||||
public function useNoAuth($isAdmin = false)
|
||||
@@ -78,20 +80,21 @@ class Auth
|
||||
$entityManager->setUser($user);
|
||||
$this->container->setUser($user);
|
||||
|
||||
if (!$authToken) {
|
||||
$authToken = $entityManager->getEntity('AuthToken');
|
||||
$token = $this->createToken($user);
|
||||
$authToken->set('token', $token);
|
||||
$authToken->set('hash', $user->get('password'));
|
||||
$authToken->set('ipAddress', $_SERVER['REMOTE_ADDR']);
|
||||
$authToken->set('userId', $user->id);
|
||||
if ($this->request->headers->get('HTTP_ESPO_AUTHORIZATION')) {
|
||||
if (!$authToken) {
|
||||
$authToken = $entityManager->getEntity('AuthToken');
|
||||
$token = $this->createToken($user);
|
||||
$authToken->set('token', $token);
|
||||
$authToken->set('hash', $user->get('password'));
|
||||
$authToken->set('ipAddress', $_SERVER['REMOTE_ADDR']);
|
||||
$authToken->set('userId', $user->id);
|
||||
}
|
||||
$authToken->set('lastAccess', date('Y-m-d H:i:s'));
|
||||
|
||||
$entityManager->saveEntity($authToken);
|
||||
$user->set('token', $authToken->get('token'));
|
||||
}
|
||||
|
||||
$authToken->set('lastAccess', date('Y-m-d H:i:s'));
|
||||
|
||||
$entityManager->saveEntity($authToken);
|
||||
$user->set('token', $authToken->get('token'));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,7 @@ class Converter
|
||||
}
|
||||
|
||||
$ormMeta[$entityName]['fields'] = $this->convertFields($entityName, $entityMeta);
|
||||
$ormMeta = $this->correctFields($entityName, $ormMeta);
|
||||
|
||||
$convertedLinks = $this->convertLinks($entityName, $entityMeta, $ormMeta);
|
||||
|
||||
@@ -168,47 +169,6 @@ class Converter
|
||||
|
||||
public function afterProcess(array $ormMeta)
|
||||
{
|
||||
$entityDefs = $this->getEntityDefs();
|
||||
|
||||
$currentOrmMeta = $ormMeta;
|
||||
//load custom field definitions and customCodes
|
||||
foreach($currentOrmMeta as $entityName => $entityParams) {
|
||||
foreach($entityParams['fields'] as $fieldName => $fieldParams) {
|
||||
|
||||
//load custom field definitions
|
||||
$fieldType = ucfirst($fieldParams['type']);
|
||||
$className = '\Espo\Custom\Core\Utils\Database\Orm\Fields\\'.$fieldType;
|
||||
if (!class_exists($className)) {
|
||||
$className = '\Espo\Core\Utils\Database\Orm\Fields\\'.$fieldType;
|
||||
}
|
||||
|
||||
if (class_exists($className) && method_exists($className, 'load')) {
|
||||
$helperClass = new $className($this->metadata, $ormMeta, $entityDefs);
|
||||
$fieldResult = $helperClass->process( $fieldName, $entityName );
|
||||
if (isset($fieldResult['unset'])) {
|
||||
$ormMeta = Util::unsetInArray($ormMeta, $fieldResult['unset']);
|
||||
unset($fieldResult['unset']);
|
||||
}
|
||||
|
||||
$ormMeta = Util::merge($ormMeta, $fieldResult);
|
||||
|
||||
} //END: load custom field definitions
|
||||
|
||||
//todo move to separate file
|
||||
//add a field 'isFollowed' for scopes with 'stream => true'
|
||||
$scopeDefs = $this->getMetadata()->get('scopes.'.$entityName);
|
||||
if (isset($scopeDefs['stream']) && $scopeDefs['stream']) {
|
||||
if (!isset($entityParams['fields']['isFollowed'])) {
|
||||
$ormMeta[$entityName]['fields']['isFollowed'] = array(
|
||||
'type' => 'varchar',
|
||||
'notStorable' => true,
|
||||
);
|
||||
}
|
||||
} //END: add a field 'isFollowed' for stream => true
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach($ormMeta as $entityName => &$entityParams) {
|
||||
foreach($entityParams['fields'] as $fieldName => &$fieldParams) {
|
||||
|
||||
@@ -226,7 +186,9 @@ class Converter
|
||||
|
||||
case 'foreignType':
|
||||
$fieldParams['dbType'] = Entity::VARCHAR;
|
||||
$fieldParams['len'] = $this->defaultLength['varchar'];
|
||||
if (empty($fieldParams['len'])) {
|
||||
$fieldParams['len'] = $this->defaultLength['varchar'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'bool':
|
||||
@@ -234,7 +196,6 @@ class Converter
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $ormMeta;
|
||||
@@ -308,6 +269,56 @@ class Converter
|
||||
return $outputMeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct fields defenitions based on \Espo\Custom\Core\Utils\Database\Orm\Fields
|
||||
*
|
||||
* @param array $ormMeta
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function correctFields($entityName, array $ormMeta)
|
||||
{
|
||||
$entityDefs = $this->getEntityDefs();
|
||||
|
||||
$entityMeta = $ormMeta[$entityName];
|
||||
//load custom field definitions and customCodes
|
||||
foreach($entityMeta['fields'] as $fieldName => $fieldParams) {
|
||||
|
||||
//load custom field definitions
|
||||
$fieldType = ucfirst($fieldParams['type']);
|
||||
$className = '\Espo\Custom\Core\Utils\Database\Orm\Fields\\' . $fieldType;
|
||||
if (!class_exists($className)) {
|
||||
$className = '\Espo\Core\Utils\Database\Orm\Fields\\' . $fieldType;
|
||||
}
|
||||
|
||||
if (class_exists($className) && method_exists($className, 'load')) {
|
||||
$helperClass = new $className($this->metadata, $ormMeta, $entityDefs);
|
||||
$fieldResult = $helperClass->process( $fieldName, $entityName );
|
||||
if (isset($fieldResult['unset'])) {
|
||||
$ormMeta = Util::unsetInArray($ormMeta, $fieldResult['unset']);
|
||||
unset($fieldResult['unset']);
|
||||
}
|
||||
|
||||
$ormMeta = Util::merge($ormMeta, $fieldResult);
|
||||
|
||||
} //END: load custom field definitions
|
||||
}
|
||||
|
||||
//todo move to separate file
|
||||
//add a field 'isFollowed' for scopes with 'stream => true'
|
||||
$scopeDefs = $this->getMetadata()->get('scopes.'.$entityName);
|
||||
if (isset($scopeDefs['stream']) && $scopeDefs['stream']) {
|
||||
if (!isset($entityMeta['fields']['isFollowed'])) {
|
||||
$ormMeta[$entityName]['fields']['isFollowed'] = array(
|
||||
'type' => 'varchar',
|
||||
'notStorable' => true,
|
||||
);
|
||||
}
|
||||
} //END: add a field 'isFollowed' for stream => true
|
||||
|
||||
return $ormMeta;
|
||||
}
|
||||
|
||||
protected function convertField($entityName, $fieldName, array $fieldParams, $fieldTypeMeta = null)
|
||||
{
|
||||
/** set default type if exists */
|
||||
|
||||
@@ -30,7 +30,7 @@ class Email extends Base
|
||||
$entityName => array(
|
||||
'fields' => array(
|
||||
$fieldName => array(
|
||||
'select' => 'email_address.name',
|
||||
'select' => 'emailAddresses.name',
|
||||
'where' =>
|
||||
array (
|
||||
'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN (
|
||||
@@ -58,7 +58,7 @@ class Email extends Base
|
||||
email_address.deleted = 0 AND email_address.name <> {value}
|
||||
)"
|
||||
),
|
||||
'orderBy' => 'email_address.name {direction}',
|
||||
'orderBy' => 'emailAddresses.name {direction}',
|
||||
),
|
||||
$fieldName .'Data' => array(
|
||||
'type' => 'text',
|
||||
|
||||
57
application/Espo/Core/Utils/Database/Orm/Fields/Link.php
Normal file
57
application/Espo/Core/Utils/Database/Orm/Fields/Link.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm\Fields;
|
||||
|
||||
class Link extends Base
|
||||
{
|
||||
protected function load($fieldName, $entityName)
|
||||
{
|
||||
$fieldParams = $this->getFieldParams();
|
||||
|
||||
$data = array(
|
||||
$entityName => array (
|
||||
'fields' => array(
|
||||
$fieldName.'Id' => array(
|
||||
'type' => 'foreignId',
|
||||
'index' => $fieldName,
|
||||
),
|
||||
$fieldName.'Name' => array(
|
||||
'type' => 'varchar',
|
||||
'notStorable' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
'unset' => array(
|
||||
$entityName => array(
|
||||
'fields.'.$fieldName,
|
||||
),
|
||||
),
|
||||
);
|
||||
if (!empty($fieldParams['notStorable'])) {
|
||||
$data[$entityName]['fields'][$fieldName.'Id']['notStorable'] = true;
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,11 @@ class LinkParent extends Base
|
||||
),
|
||||
),
|
||||
),
|
||||
'unset' => array(
|
||||
$entityName => array(
|
||||
'fields.'.$fieldName,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class Phone extends Base
|
||||
$entityName => array(
|
||||
'fields' => array(
|
||||
$fieldName => array(
|
||||
'select' => 'phone_number.name',
|
||||
'select' => 'phoneNumbers.name',
|
||||
'where' =>
|
||||
array (
|
||||
'LIKE' => \Espo\Core\Utils\Util::toUnderScore($entityName) . ".id IN (
|
||||
@@ -58,7 +58,7 @@ class Phone extends Base
|
||||
phone_number.deleted = 0 AND phone_number.name <> {value}
|
||||
)"
|
||||
),
|
||||
'orderBy' => 'phone_number.name {direction}',
|
||||
'orderBy' => 'phoneNumbers.name {direction}',
|
||||
),
|
||||
$fieldName .'Data' => array(
|
||||
'type' => 'text',
|
||||
|
||||
@@ -42,6 +42,7 @@ class BelongsTo extends Base
|
||||
'type' => 'foreign',
|
||||
'relation' => $linkName,
|
||||
'foreign' => $this->getForeignField('name', $foreignEntityName),
|
||||
'notStorable' => false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Utils\Database\Orm\Relations;
|
||||
|
||||
class BelongsToParent extends Base
|
||||
{
|
||||
protected function load($linkName, $entityName)
|
||||
{
|
||||
$linkParams = $this->getLinkParams();
|
||||
|
||||
return array(
|
||||
$entityName => array (
|
||||
'fields' => array(
|
||||
$linkName.'Id' => array(
|
||||
'type' => 'foreignId',
|
||||
'index' => $linkName,
|
||||
),
|
||||
$linkName.'Type' => array(
|
||||
'type' => 'foreignType',
|
||||
'notNull' => false,
|
||||
'index' => $linkName,
|
||||
'len' => 100
|
||||
),
|
||||
$linkName.'Name' => array(
|
||||
'type' => 'varchar',
|
||||
'notStorable' => true,
|
||||
),
|
||||
),
|
||||
'relations' => array(
|
||||
$linkName => array(
|
||||
'type' => 'belongsToParent',
|
||||
'key' => $linkName.'Id',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
return array(
|
||||
|
||||
'ImportEntity' => array(
|
||||
'fields' => array(
|
||||
'id' => array(
|
||||
'type' => 'id',
|
||||
'dbType' => 'int',
|
||||
'len' => '11',
|
||||
'autoincrement' => true,
|
||||
'unique' => true
|
||||
),
|
||||
'entityId' => array(
|
||||
'type' => 'varchar',
|
||||
'len' => '24',
|
||||
'index' => 'entity'
|
||||
),
|
||||
'entityType' => array(
|
||||
'type' => 'varchar',
|
||||
'len' => '100',
|
||||
'index' => 'entity'
|
||||
),
|
||||
'importId' => array(
|
||||
'type' => 'varchar',
|
||||
'len' => '24',
|
||||
'index' => true
|
||||
),
|
||||
'isImported' => array(
|
||||
'type' => 'bool'
|
||||
),
|
||||
'isUpdated' => array(
|
||||
'type' => 'bool'
|
||||
),
|
||||
'isDuplicate' => array(
|
||||
'type' => 'bool'
|
||||
),
|
||||
),
|
||||
"indexes" => array(
|
||||
"entityImport" => array(
|
||||
"columns" => ["importId", "entityType"]
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
@@ -136,7 +136,8 @@ class EntityManager
|
||||
'customizable' => true,
|
||||
'importable' => true,
|
||||
'type' => $type,
|
||||
'stream' => $stream
|
||||
'stream' => $stream,
|
||||
'notifications' => true
|
||||
);
|
||||
$this->getMetadata()->set('scopes', $name, $scopeData);
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ class Manager
|
||||
$fullPath = $this->concatPaths($path); //todo remove after changing the params
|
||||
|
||||
if ($this->checkCreateFile($fullPath) === false) {
|
||||
throw new Error('Permission denied in '. $fullPath);
|
||||
throw new Error('Permission denied for '. $fullPath);
|
||||
}
|
||||
|
||||
$res = (file_put_contents($fullPath, $data, $flags, $context) !== FALSE);
|
||||
@@ -459,7 +459,7 @@ class Manager
|
||||
|
||||
if (!empty($permissionDeniedList)) {
|
||||
$betterPermissionList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList);
|
||||
throw new Error("Permission denied in <br>". implode(", <br>", $betterPermissionList));
|
||||
throw new Error("Permission denied for <br>". implode(", <br>", $betterPermissionList));
|
||||
}
|
||||
|
||||
$res = true;
|
||||
@@ -472,7 +472,7 @@ class Manager
|
||||
$sourceFile = is_file($sourcePath) ? $sourcePath : $this->concatPaths(array($sourcePath, $file));
|
||||
$destFile = $this->concatPaths(array($destPath, $file));
|
||||
|
||||
if (file_exists($sourceFile)) {
|
||||
if (file_exists($sourceFile) && is_file($sourceFile)) {
|
||||
$res &= copy($sourceFile, $destFile);
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ class Manager
|
||||
|
||||
if (!empty($permissionDeniedList)) {
|
||||
$betterPermissionList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList);
|
||||
throw new Error("Permission denied in <br>". implode(", <br>", $betterPermissionList));
|
||||
throw new Error("Permission denied for <br>". implode(", <br>", $betterPermissionList));
|
||||
}
|
||||
|
||||
$result = true;
|
||||
|
||||
@@ -136,7 +136,7 @@ class Layout
|
||||
}
|
||||
|
||||
$layoutPath = $this->getLayoutPath($controllerName, true);
|
||||
$data = Json::encode($layoutData);
|
||||
$data = Json::encode($layoutData, \JSON_PRETTY_PRINT);
|
||||
|
||||
$result &= $this->getFileManager()->putContents(array($layoutPath, $layoutName.'.json'), $data);
|
||||
}
|
||||
|
||||
@@ -510,6 +510,11 @@ class Util
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function generateId()
|
||||
{
|
||||
return uniqid() . substr(md5(rand()), 0, 4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ return array (
|
||||
'ru_RU',
|
||||
'pl_PL',
|
||||
'pt_BR',
|
||||
'uk_UA',
|
||||
'vi_VN'
|
||||
),
|
||||
'language' => 'en_US',
|
||||
@@ -93,10 +94,12 @@ return array (
|
||||
'disableExport' => false,
|
||||
'assignmentEmailNotifications' => false,
|
||||
'assignmentEmailNotificationsEntityList' => array('Lead', 'Opportunity', 'Task', 'Case'),
|
||||
'assignmentNotificationsEntityList' => array('Meeting', 'Call', 'Task', 'Email'),
|
||||
'emailMessageMaxSize' => 10,
|
||||
'notificationsCheckInterval' => 10,
|
||||
'disabledCountQueryEntityList' => array('Email'),
|
||||
'maxEmailAccountCount' => 2,
|
||||
'followCreatedEntities' => false,
|
||||
'isInstalled' => false,
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[{
|
||||
"label":"Overview",
|
||||
"rows": [
|
||||
[{"name":"name"}]
|
||||
[{"name":"name"}, false]
|
||||
]
|
||||
}]
|
||||
|
||||
28
application/Espo/Entities/Import.php
Normal file
28
application/Espo/Entities/Import.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Entities;
|
||||
|
||||
class Import extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -26,12 +26,13 @@ use Espo\ORM\Entity;
|
||||
|
||||
class AssignmentEmailNotification extends \Espo\Core\Hooks\Base
|
||||
{
|
||||
|
||||
public function afterSave(Entity $entity)
|
||||
{
|
||||
if (
|
||||
$this->getConfig()->get('assignmentEmailNotifications')
|
||||
&&
|
||||
$entity->has('assignedUserId')
|
||||
&&
|
||||
in_array($entity->getEntityName(), $this->getConfig()->get('assignmentEmailNotificationsEntityList', array()))
|
||||
) {
|
||||
|
||||
|
||||
106
application/Espo/Hooks/Common/Notifications.php
Normal file
106
application/Espo/Hooks/Common/Notifications.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://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/.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Hooks\Common;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\Utils\Util;
|
||||
|
||||
class Notifications extends \Espo\Core\Hooks\Base
|
||||
{
|
||||
public static $order = 10;
|
||||
|
||||
protected $noticatorsHash = array();
|
||||
|
||||
protected function init()
|
||||
{
|
||||
$this->dependencies[] = 'container';
|
||||
$this->dependencies[] = 'metadata';
|
||||
}
|
||||
|
||||
private $hasStreamCache = array();
|
||||
|
||||
protected function getContainer()
|
||||
{
|
||||
return $this->getInjection('container');
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->getInjection('metadata');
|
||||
}
|
||||
|
||||
protected function checkHasStream($entityType)
|
||||
{
|
||||
if (!array_key_exists($entityType, $this->hasStreamCache)) {
|
||||
$this->hasStreamCache[$entityType] = $this->getMetadata()->get("scopes.{$entityType}.stream");
|
||||
}
|
||||
return $this->hasStreamCache[$entityType];
|
||||
}
|
||||
|
||||
protected function getNotificator($entityType)
|
||||
{
|
||||
if (empty($this->noticatorsHash[$entityType])) {
|
||||
$normalizedName = Util::normilizeClassName($entityType);
|
||||
|
||||
$className = '\\Espo\\Custom\\Notificators\\' . $normalizedName;
|
||||
if (!class_exists($className)) {
|
||||
$moduleName = $this->getMetadata()->getScopeModuleName($entityType);
|
||||
if ($moduleName) {
|
||||
$className = '\\Espo\\Modules\\' . $moduleName . '\\Notificators\\' . $normalizedName;
|
||||
} else {
|
||||
$className = '\\Espo\\Notificators\\' . $normalizedName;
|
||||
}
|
||||
if (!class_exists($className)) {
|
||||
$className = '\\Espo\\Core\\Notificators\\Base';
|
||||
}
|
||||
}
|
||||
|
||||
$notificator = new $className();
|
||||
$dependencies = $notificator->getDependencyList();
|
||||
foreach ($dependencies as $name) {
|
||||
$notificator->inject($name, $this->getContainer()->get($name));
|
||||
}
|
||||
|
||||
$this->noticatorsHash[$entityType] = $notificator;
|
||||
}
|
||||
return $this->noticatorsHash[$entityType];
|
||||
}
|
||||
|
||||
public function afterSave(Entity $entity, array $options = array())
|
||||
{
|
||||
$entityType = $entity->getEntityType();
|
||||
|
||||
if (!empty($options['silent']) && !empty($options['noNotifications'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->checkHasStream($entityType)) {
|
||||
if (in_array($entityType, $this->getConfig()->get('assignmentNotificationsEntityList', []))) {
|
||||
$notificator = $this->getNotificator($entityType);
|
||||
$notificator->process($entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,11 +34,9 @@ class Stream extends \Espo\Core\Hooks\Base
|
||||
|
||||
protected $isLinkObservableInStreamCache = array();
|
||||
|
||||
protected $statusDefs = array(
|
||||
'Lead' => 'status',
|
||||
'Case' => 'status',
|
||||
'Opportunity' => 'stage',
|
||||
);
|
||||
protected $statusFields = null;
|
||||
|
||||
public static $order = 9;
|
||||
|
||||
protected function init()
|
||||
{
|
||||
@@ -154,31 +152,31 @@ class Stream extends \Espo\Core\Hooks\Base
|
||||
return $userIdList;
|
||||
}
|
||||
|
||||
public function afterSave(Entity $entity)
|
||||
public function afterSave(Entity $entity, array $options = array())
|
||||
{
|
||||
$entityName = $entity->getEntityName();
|
||||
|
||||
if ($this->checkHasStream($entity)) {
|
||||
if ($entity->isNew()) {
|
||||
$userIdList = [];
|
||||
|
||||
$assignedUserId = $entity->get('assignedUserId');
|
||||
$createdById = $entity->get('createdById');
|
||||
|
||||
$userIdList = [];
|
||||
if (!empty($createdById)) {
|
||||
if ($this->getConfig()->get('followCreatedEntities') && !empty($createdById)) {
|
||||
$userIdList[] = $createdById;
|
||||
}
|
||||
if (!empty($assignedUserId) && $createdById != $assignedUserId) {
|
||||
if (!empty($assignedUserId) && !in_array($assignedUserId, $userIdList)) {
|
||||
$userIdList[] = $assignedUserId;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($userIdList)) {
|
||||
$this->getStreamService()->followEntityMass($entity, $userIdList);
|
||||
}
|
||||
|
||||
$this->getStreamService()->noteCreate($entity);
|
||||
|
||||
if (empty($options['noStream'])) {
|
||||
$this->getStreamService()->noteCreate($entity);
|
||||
}
|
||||
|
||||
$autofollowUserIdList = $this->getAutofollowUserIdList($entity, $userIdList);
|
||||
foreach ($autofollowUserIdList as $i => $userId) {
|
||||
@@ -195,7 +193,7 @@ class Stream extends \Espo\Core\Hooks\Base
|
||||
'method' => 'afterRecordCreatedJob',
|
||||
'data' => array(
|
||||
'userIdList' => $autofollowUserIdList,
|
||||
'entityType' => $entity->getEntityName(),
|
||||
'entityType' => $entity->getEntityType(),
|
||||
'entityId' => $entity->id
|
||||
)
|
||||
));
|
||||
@@ -203,31 +201,43 @@ class Stream extends \Espo\Core\Hooks\Base
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($entity->isFieldChanged('assignedUserId')) {
|
||||
$assignedUserId = $entity->get('assignedUserId');
|
||||
if (!empty($assignedUserId)) {
|
||||
$this->getStreamService()->followEntity($entity, $assignedUserId);
|
||||
$this->getStreamService()->noteAssign($entity);
|
||||
if (empty($options['noStream'])) {
|
||||
if ($entity->isFieldChanged('assignedUserId')) {
|
||||
$assignedUserId = $entity->get('assignedUserId');
|
||||
if (!empty($assignedUserId)) {
|
||||
$this->getStreamService()->followEntity($entity, $assignedUserId);
|
||||
$this->getStreamService()->noteAssign($entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->getStreamService()->handleAudited($entity);
|
||||
$this->getStreamService()->handleAudited($entity);
|
||||
|
||||
if (array_key_exists($entityName, $this->statusDefs)) {
|
||||
$field = $this->statusDefs[$entityName];
|
||||
$value = $entity->get($field);
|
||||
if (!empty($value) && $value != $entity->getFetched($field)) {
|
||||
$this->getStreamService()->noteStatus($entity, $field);
|
||||
$statusFields = $this->getStatusFields();
|
||||
|
||||
if (array_key_exists($entityName, $this->statusFields)) {
|
||||
$field = $this->statusFields[$entityName];
|
||||
$value = $entity->get($field);
|
||||
if (!empty($value) && $value != $entity->getFetched($field)) {
|
||||
$this->getStreamService()->noteStatus($entity, $field);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($entity->isNew() && $this->getMetadata()->get("scopes.{$entityName}.tab")) {
|
||||
if ($entity->isNew() && empty($options['noStream']) && $this->getMetadata()->get("scopes.{$entityName}.tab")) {
|
||||
$this->handleCreateRelated($entity);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getStatusFields()
|
||||
{
|
||||
if (is_null($this->statusFields)) {
|
||||
$this->statusFields = $this->getMetadata()->get("entityDefs.Note.statusFields", array());
|
||||
}
|
||||
return $this->statusFields;
|
||||
}
|
||||
|
||||
protected function getStreamService()
|
||||
{
|
||||
if (empty($this->streamService)) {
|
||||
|
||||
@@ -40,7 +40,7 @@ class Notifications extends \Espo\Core\Hooks\Base
|
||||
return $this->getInjection('serviceFactory');
|
||||
}
|
||||
|
||||
protected function getMentionedUserList($entity)
|
||||
protected function getMentionedUserIdList($entity)
|
||||
{
|
||||
$mentionedUserList = array();
|
||||
$data = $entity->get('data');
|
||||
@@ -53,33 +53,49 @@ class Notifications extends \Espo\Core\Hooks\Base
|
||||
return $mentionedUserList;
|
||||
}
|
||||
|
||||
protected function getSubscriberIdList($parentType, $parentId)
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
$sql = "
|
||||
SELECT user_id AS userId
|
||||
FROM subscription
|
||||
WHERE entity_id = " . $pdo->quote($parentId) . " AND entity_type = " . $pdo->quote($parentType);
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
$userIdList = [];
|
||||
while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if ($this->getUser()->id != $row['userId']) {
|
||||
$userIdList[] = $row['userId'];
|
||||
}
|
||||
}
|
||||
return $userIdList;
|
||||
}
|
||||
|
||||
public function afterSave(Entity $entity)
|
||||
{
|
||||
if ($entity->isNew()) {
|
||||
|
||||
$parentType = $entity->get('parentType');
|
||||
$parentId = $entity->get('parentId');
|
||||
|
||||
$superParentType = $entity->get('superParentType');
|
||||
$superParentTypeId = $entity->get('superParentTypeId');
|
||||
|
||||
$userIdList = [];
|
||||
|
||||
if ($parentType && $parentId) {
|
||||
$userIdList = array_merge($userIdList, $this->getSubscriberIdList($parentType, $parentId));
|
||||
}
|
||||
|
||||
$mentionedUserList = $this->getMentionedUserList($entity);
|
||||
if ($superParentType && $superParentTypeId) {
|
||||
$userIdList = array_merge($userIdList, $this->getSubscriberIdList($superParentType, $superParentTypeId));
|
||||
}
|
||||
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
$sql = "
|
||||
SELECT user_id AS userId
|
||||
FROM subscription
|
||||
WHERE entity_id = " . $pdo->quote($parentId) . " AND entity_type = " . $pdo->quote($parentType);
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
$userIdList = array();
|
||||
while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if ($this->getUser()->id != $row['userId'] && !in_array($row['userId'], $mentionedUserList)) {
|
||||
$userIdList[] = $row['userId'];
|
||||
}
|
||||
}
|
||||
if (!empty($userIdList)) {
|
||||
$this->getNotificationService()->notifyAboutNote($userIdList, $entity);
|
||||
}
|
||||
//$userIdList = array_merge($userIdList, $this->getMentionedUserIdList($entity));
|
||||
|
||||
$userIdList = array_unique($userIdList);
|
||||
|
||||
if (!empty($userIdList)) {
|
||||
$this->getNotificationService()->notifyAboutNote($userIdList, $entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ class Cleanup extends \Espo\Core\Jobs\Base
|
||||
$this->cleanupJobs();
|
||||
$this->cleanupScheduledJobLog();
|
||||
$this->cleanupAttachments();
|
||||
$this->cleanupEmails();
|
||||
$this->cleanupNotes();
|
||||
$this->cleanupNotifications();
|
||||
}
|
||||
|
||||
protected function cleanupJobs()
|
||||
@@ -72,19 +75,84 @@ class Cleanup extends \Espo\Core\Jobs\Base
|
||||
|
||||
protected function cleanupAttachments()
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
|
||||
$dateBefore = date('Y-m-d H:i:s', time() - 3600 * 24);
|
||||
|
||||
$collection = $this->getEntityManager()->getRepository('Attachment')->where(array(
|
||||
'role' => array(
|
||||
'Import File',
|
||||
'Export File'
|
||||
),
|
||||
'role' => ['Export File'],
|
||||
'createdAt<' => $dateBefore
|
||||
))->limit(0, 100)->find();
|
||||
|
||||
foreach ($collection as $e) {
|
||||
$this->getEntityManager()->removeEntity($e);
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM attachment WHERE deleted = 1 AND created_at < ".$pdo->quote($dateBefore);
|
||||
$sth = $pdo->query($sql);
|
||||
}
|
||||
|
||||
protected function cleanupEmails()
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
|
||||
$dateBefore = date('Y-m-d H:i:s', time() - 3600 * 24 * 20);
|
||||
|
||||
$sql = "SELECT * FROM email WHERE deleted = 1 AND created_at < ".$pdo->quote($dateBefore);
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$id = $row['id'];
|
||||
$attachments = $this->getEntityManager()->getRepository('Attachment')->where(array(
|
||||
'parentId' => $id,
|
||||
'parentType' => 'Email'
|
||||
))->find();
|
||||
foreach ($attachments as $attachment) {
|
||||
$this->getEntityManager()->removeEntity($attachment);
|
||||
}
|
||||
$sqlDel = "DELETE FROM email WHERE deleted = 1 AND id = ".$pdo->quote($id);
|
||||
$pdo->query($sqlDel);
|
||||
$sqlDel = "DELETE FROM email_user WHERE email_id = ".$pdo->quote($id);
|
||||
$pdo->query($sqlDel);
|
||||
}
|
||||
}
|
||||
|
||||
protected function cleanupNotes()
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
|
||||
$dateBefore = date('Y-m-d H:i:s', time() - 3600 * 24 * 20);
|
||||
|
||||
$sql = "SELECT * FROM `note` WHERE deleted = 1 AND created_at < ".$pdo->quote($dateBefore);
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$id = $row['id'];
|
||||
$attachments = $this->getEntityManager()->getRepository('Attachment')->where(array(
|
||||
'parentId' => $id,
|
||||
'parentType' => 'Note'
|
||||
))->find();
|
||||
foreach ($attachments as $attachment) {
|
||||
$this->getEntityManager()->removeEntity($attachment);
|
||||
}
|
||||
$sqlDel = "DELETE FROM `note` WHERE deleted = 1 AND id = ".$pdo->quote($id);
|
||||
$pdo->query($sqlDel);
|
||||
}
|
||||
}
|
||||
|
||||
protected function cleanupNotifications()
|
||||
{
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
|
||||
$dateBefore = date('Y-m-d H:i:s', time() - 3600 * 24 * 50);
|
||||
|
||||
$sql = "SELECT * FROM `notification` WHERE created_at < ".$pdo->quote($dateBefore);
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
while ($row = $sth->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$id = $row['id'];
|
||||
$this->getEntityManager()->getRepository('Notification')->deleteFromDb($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Controllers;
|
||||
|
||||
@@ -30,9 +30,9 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function actionGetFolders($params, $data, $request)
|
||||
{
|
||||
{
|
||||
return $this->getRecordService()->getFolders(array(
|
||||
'host' => $request->get('host'),
|
||||
'port' => $request->get('port'),
|
||||
@@ -41,7 +41,23 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
'password' => $request->get('password'),
|
||||
'id' => $request->get('id')
|
||||
));
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data['id']);
|
||||
if (!$inboundEmail) {
|
||||
throw new Error();
|
||||
}
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($inboundEmail->get('password'));
|
||||
}
|
||||
|
||||
return $this->getRecordService()->testConnection($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,24 +29,24 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
|
||||
public function handleSelectParams(&$params)
|
||||
{
|
||||
parent::handleSelectParams($params);
|
||||
|
||||
|
||||
if (empty($params['customJoin'])) {
|
||||
$params['customJoin'] = '';
|
||||
}
|
||||
|
||||
|
||||
$params['customJoin'] .= "
|
||||
LEFT JOIN `account_contact` AS accountContact
|
||||
ON accountContact.contact_id = contact.id AND accountContact.account_id = contact.account_id AND accountContact.deleted = 0
|
||||
";
|
||||
}
|
||||
|
||||
public function afterSave(Entity $entity)
|
||||
|
||||
public function afterSave(Entity $entity, array $options)
|
||||
{
|
||||
$result = parent::afterSave($entity);
|
||||
|
||||
$result = parent::afterSave($entity, $options);
|
||||
|
||||
$accountIdChanged = $entity->has('accountId') && $entity->get('accountId') != $entity->getFetched('accountId');
|
||||
$titleChanged = $entity->has('title') && $entity->get('title') != $entity->getFetched('title');
|
||||
|
||||
|
||||
if ($accountIdChanged) {
|
||||
$accountId = $entity->get('accountId');
|
||||
if (empty($accountId)) {
|
||||
@@ -54,7 +54,7 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($titleChanged) {
|
||||
if (empty($accountId)) {
|
||||
$accountId = $entity->getFetched('accountId');
|
||||
@@ -63,11 +63,10 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($accountIdChanged || $titleChanged) {
|
||||
$pdo = $this->getEntityManager()->getPDO();
|
||||
|
||||
|
||||
$sql = "
|
||||
SELECT id, role FROM account_contact
|
||||
WHERE
|
||||
@@ -92,7 +91,7 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,15 +18,21 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
class Lead extends \Espo\Core\ORM\Repositories\RDB
|
||||
{
|
||||
|
||||
{
|
||||
public function afterSave(Entity $entity, array $options)
|
||||
{
|
||||
parent::afterSave($entity, $options);
|
||||
|
||||
if ($entity->has('targetListId') && $entity->isNew()) {
|
||||
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,16 +26,16 @@ use Espo\ORM\Entity;
|
||||
|
||||
class Meeting extends \Espo\Core\ORM\Repositories\RDB
|
||||
{
|
||||
protected function beforeSave(Entity $entity)
|
||||
protected function beforeSave(Entity $entity, array $options)
|
||||
{
|
||||
parent::beforeSave($entity);
|
||||
|
||||
parent::beforeSave($entity, $options);
|
||||
|
||||
$parentId = $entity->get('parentId');
|
||||
$parentType = $entity->get('parentType');
|
||||
if (!empty($parentId) || !empty($parentType)) {
|
||||
$parent = $this->getEntityManager()->getEntity($parentType, $parentId);
|
||||
if (!empty($parent)) {
|
||||
if ($parent->getEntityName() == 'Account') {
|
||||
if ($parent->getEntityType() == 'Account') {
|
||||
$accountId = $parent->id;
|
||||
} else if ($parent->has('accountId')) {
|
||||
$accountId = $parent->get('accountId');
|
||||
@@ -73,7 +73,7 @@ class Meeting extends \Espo\Core\ORM\Repositories\RDB
|
||||
SELECT id, `seconds`, `type`
|
||||
FROM `reminder`
|
||||
WHERE
|
||||
`entity_type` = ".$pdo->quote($entity->getEntityName())." AND
|
||||
`entity_type` = ".$pdo->quote($entity->getEntityType())." AND
|
||||
`entity_id` = ".$pdo->quote($entity->id)." AND
|
||||
`deleted` = 0
|
||||
ORDER BY `seconds` ASC
|
||||
@@ -95,9 +95,9 @@ class Meeting extends \Espo\Core\ORM\Repositories\RDB
|
||||
$entity->set('reminders', $reminders);
|
||||
}
|
||||
|
||||
protected function afterSave(Entity $entity)
|
||||
protected function afterSave(Entity $entity, array $options)
|
||||
{
|
||||
parent::afterSave($entity);
|
||||
parent::afterSave($entity, $options);
|
||||
|
||||
if (
|
||||
$entity->isNew() ||
|
||||
@@ -125,7 +125,7 @@ class Meeting extends \Espo\Core\ORM\Repositories\RDB
|
||||
";
|
||||
$pdo->query($sql);
|
||||
}
|
||||
|
||||
|
||||
if (empty($reminders) || !is_array($reminders)) return;
|
||||
|
||||
$entityType = $entity->getEntityName();
|
||||
|
||||
@@ -18,15 +18,14 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
class Opportunity extends \Espo\Core\ORM\Repositories\RDB
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ class Task extends \Espo\Core\ORM\Repositories\RDB
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function beforeSave(Entity $entity)
|
||||
protected function beforeSave(Entity $entity, array $options)
|
||||
{
|
||||
parent::beforeSave($entity);
|
||||
parent::beforeSave($entity, $options);
|
||||
|
||||
if ($entity->has('dateStartDate')) {
|
||||
$dateStartDate = $entity->get('dateStartDate');
|
||||
@@ -84,6 +84,22 @@ class Task extends \Espo\Core\ORM\Repositories\RDB
|
||||
$entity->set('dateEndDate', null);
|
||||
}
|
||||
}
|
||||
|
||||
$parentId = $entity->get('parentId');
|
||||
$parentType = $entity->get('parentType');
|
||||
if (!empty($parentId) || !empty($parentType)) {
|
||||
$parent = $this->getEntityManager()->getEntity($parentType, $parentId);
|
||||
if (!empty($parent)) {
|
||||
if ($parent->getEntityType() == 'Account') {
|
||||
$accountId = $parent->id;
|
||||
} else if ($parent->has('accountId')) {
|
||||
$accountId = $parent->get('accountId');
|
||||
}
|
||||
if (!empty($accountId)) {
|
||||
$entity->set('accountId', $accountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"sicCode": "Sic Code",
|
||||
"industry": "Industry",
|
||||
"type": "Type",
|
||||
"contactRole": "Role",
|
||||
"contactRole": "Title",
|
||||
"campaign": "Campaign"
|
||||
},
|
||||
"links": {
|
||||
@@ -18,9 +18,10 @@
|
||||
"opportunities": "Opportunities",
|
||||
"cases": "Cases",
|
||||
"documents": "Documents",
|
||||
"meetingsPrimary": "Meetings (Internal)",
|
||||
"callsPrimary": "Calls (Internal)",
|
||||
"tasksPrimary": "Tasks (Internal)",
|
||||
"meetingsPrimary": "Meetings (expanded)",
|
||||
"callsPrimary": "Calls (expanded)",
|
||||
"tasksPrimary": "Tasks (expanded)",
|
||||
"emailsPrimary": "Emails (expanded)",
|
||||
"targetLists": "Target Lists",
|
||||
"campaignLogRecords": "Campaign Log"
|
||||
},
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
"doNotCall": "Do Not Call",
|
||||
"address": "Address",
|
||||
"opportunityRole": "Opportunity Role",
|
||||
"accountRole": "Role",
|
||||
"accountRole": "Title",
|
||||
"description": "Description",
|
||||
"campaign": "Campaign"
|
||||
"campaign": "Campaign",
|
||||
"targetLists": "Target Lists",
|
||||
"targetList": "Target List"
|
||||
},
|
||||
"links": {
|
||||
"opportunities": "Opportunities",
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
"createdAccount": "Account",
|
||||
"createdContact": "Contact",
|
||||
"createdOpportunity": "Opportunity",
|
||||
"campaign": "Campaign"
|
||||
"campaign": "Campaign",
|
||||
"targetLists": "Target Lists",
|
||||
"targetList": "Target List"
|
||||
},
|
||||
"links": {
|
||||
"targetLists": "Target Lists",
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
"status": "Status",
|
||||
"dateStart": "Date Start",
|
||||
"dateEnd": "Date Due",
|
||||
"dateStartDate": "Date Start (all day)",
|
||||
"dateEndDate": "Date End (all day)",
|
||||
"priority": "Priority",
|
||||
"description": "Description",
|
||||
"isOverdue": "Is Overdue"
|
||||
"isOverdue": "Is Overdue",
|
||||
"account": "Account"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
|
||||
@@ -10,13 +10,19 @@
|
||||
"sicCode": "CNPJ",
|
||||
"industry": "Indústria",
|
||||
"type": "Tipo",
|
||||
"contactRole": "Regra"
|
||||
"contactRole": "Regra",
|
||||
"campaign": "Campanha"
|
||||
},
|
||||
"links": {
|
||||
"contacts": "Contatos",
|
||||
"opportunities": "Oportunidades",
|
||||
"cases": "Atendimentos",
|
||||
"documents": "Documentos"
|
||||
"documents": "Documentos",
|
||||
"meetingsPrimary": "Reuniões (Interno)",
|
||||
"callsPrimary": "Ligações (Interno)",
|
||||
"tasksPrimary": "Tarefas (Interno)",
|
||||
"targetLists": "Lista de alvos",
|
||||
"campaignLogRecords": "Log da Campanha"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
@@ -26,13 +32,32 @@
|
||||
"Reseller": "Revendedor"
|
||||
},
|
||||
"industry": {
|
||||
"Apparel": "Vestuário",
|
||||
"Banking": "Banco",
|
||||
"Computer Software": "Software",
|
||||
"Education": "Educação",
|
||||
"Electronics": "Eletrônicos",
|
||||
"Finance": "Finanças",
|
||||
"Insurance": "Seguros"
|
||||
"Agriculture": "Agricultura",
|
||||
"Advertising": "Publicidade",
|
||||
"Apparel & Accessories": "Apparel & Accessories",
|
||||
"Automotive": "Automotiva",
|
||||
"Banking": "Banco",
|
||||
"Biotechnology": "Biotecnologia",
|
||||
"Chemical": "Química",
|
||||
"Computer": "Computadores",
|
||||
"Education": "Educação",
|
||||
"Electronics": "Electrônicos",
|
||||
"Entertainment & Leisure": "Entertainment & Leisure",
|
||||
"Finance": "Finanças",
|
||||
"Food & Beverage": "Alimentação",
|
||||
"Grocery": "Grocery",
|
||||
"Insurance": "Insurance",
|
||||
"Legal": "Legal",
|
||||
"Publishing": "Publishing",
|
||||
"Real Estate": "Real Estate",
|
||||
"Service": "Service",
|
||||
"Sports": "Sports",
|
||||
"Software": "Software",
|
||||
"Technology": "Technology",
|
||||
"Telecommunications": "Telecommunications",
|
||||
"Television": "Television",
|
||||
"Transportation": "Transportation",
|
||||
"Venture Capital": "Venture Capital"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"users": "Usuários",
|
||||
"contacts": "Contatos",
|
||||
"leads": "Leads",
|
||||
"reminders": "Lembretes"
|
||||
"reminders": "Lembretes",
|
||||
"account": "Conta"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
@@ -28,7 +29,8 @@
|
||||
"acceptanceStatus": {
|
||||
"None": "Nenhum",
|
||||
"Accepted": "Aceita",
|
||||
"Declined": "Rejeitada"
|
||||
"Declined": "Rejeitada",
|
||||
"Tentative": "Tentativa"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Nome",
|
||||
"description": "Descrição",
|
||||
"status": "Status",
|
||||
"type": "Tipo",
|
||||
"startDate": "Data de início",
|
||||
"endDate": "Data de fim",
|
||||
"targetLists": "Lista de alvos",
|
||||
"sentCount": "Enviar",
|
||||
"openedCount": "Abertos",
|
||||
"clickedCount": "Clicados",
|
||||
"optedOutCount": "Cancelamentos",
|
||||
"bouncedCount": "Bounces",
|
||||
"hardBouncedCount": "Hard Bounce",
|
||||
"softBouncedCount": "Soft Bounce",
|
||||
"leadCreatedCount": "Leads Criados",
|
||||
"revenue": "Receita"
|
||||
},
|
||||
"links": {
|
||||
"targetLists": "Lista de alvos",
|
||||
"accounts": "Contas",
|
||||
"contacts": "Contatos",
|
||||
"leads": "Leads",
|
||||
"opportunities": "Oportunidades",
|
||||
"campaignLogRecords": "Log"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
"Email": "E-mail",
|
||||
"Web": "Web",
|
||||
"Television": "Televisão",
|
||||
"Radio": "Rádio",
|
||||
"Newsletter": "Newsletter",
|
||||
"Mail": "Correio"
|
||||
},
|
||||
"status": {
|
||||
"Planning": "Planejamento",
|
||||
"Active": "Ativa",
|
||||
"Inactive": "Inativa",
|
||||
"Complete": "Completa"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Campaign": "Criar Campanha",
|
||||
"Target Lists": "Lista de alvos",
|
||||
"Statistics": "Estatísticas",
|
||||
"hard": "hard",
|
||||
"soft": "soft"
|
||||
},
|
||||
"presetFilters": {
|
||||
"active": "Ativa"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"fields": {
|
||||
"action": "Ação",
|
||||
"actionDate": "Data",
|
||||
"data": "Dados",
|
||||
"campaign": "Campanha",
|
||||
"parent": "Alvo",
|
||||
"object": "Objeto",
|
||||
"application": "Aplicação"
|
||||
},
|
||||
"options": {
|
||||
"action": {
|
||||
"Sent": "Enviado",
|
||||
"Opened": "Aberto",
|
||||
"Opted Out": "Cancelado",
|
||||
"Bounced": "Bounced",
|
||||
"Clicked": "Clicado",
|
||||
"Lead Created": "Lead Criado"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"All": "Tudo"
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,14 @@
|
||||
"address": "Endereço",
|
||||
"opportunityRole": "Regra de Oportunidade",
|
||||
"accountRole": "Regra",
|
||||
"description": "Descrição"
|
||||
"description": "Descrição",
|
||||
"campaign": "Campanha"
|
||||
},
|
||||
"links": {
|
||||
"opportunities": "Oportunidades",
|
||||
"cases": "Atendimento"
|
||||
"cases": "Atendimento",
|
||||
"targetLists": "Lista de Alvos",
|
||||
"campaignLogRecords": "Log das Campanhas"
|
||||
},
|
||||
"labels": {
|
||||
"Create Contact": "Criar Contato"
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
"Task": "Tarefa",
|
||||
"Case": "Atendimento",
|
||||
"InboundEmail": "E-mail de Entrada",
|
||||
"Document": "Documento"
|
||||
"Document": "Documento",
|
||||
"Campaign": "Campanha",
|
||||
"TargetList": "Lista de Alvos"
|
||||
},
|
||||
"scopeNamesPlural": {
|
||||
"Account": "Contas",
|
||||
@@ -25,7 +27,9 @@
|
||||
"Task": "Tarefas",
|
||||
"Case": "Atendimentos",
|
||||
"InboundEmail": "E-mails de Entrada",
|
||||
"Document": "Documentos"
|
||||
"Document": "Documentos",
|
||||
"Campaign": "Campaign",
|
||||
"TargetList": "Target List"
|
||||
},
|
||||
"dashlets": {
|
||||
"Leads": "Meus Leads",
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"replyToAddress": "Especifique o endereço de e-mail desta caixa postal para que as respostas cheguem aqui.",
|
||||
"caseDistribution": "Como os atendimentos serão distribuídos. Assinados diretamente ao usuário ou entregues ao time.",
|
||||
"assignToUser": "Usuário responsável pelos e-mails/atendimentos.",
|
||||
"team": "Time que será relacionado aos e-mails/atendimentos."
|
||||
"team": "Time que será relacionado aos e-mails/atendimentos.",
|
||||
"targetUserPosition": "Define a posição dos usuários para quem serão distribuídos os atendimentos."
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
|
||||
@@ -20,9 +20,12 @@
|
||||
"description": "Descrição",
|
||||
"createdAccount": "Conta",
|
||||
"createdContact": "Contato",
|
||||
"createdOpportunity": "Oportunidade"
|
||||
"createdOpportunity": "Oportunidade",
|
||||
"campaign": "Campanha"
|
||||
},
|
||||
"links": {
|
||||
"targetLists": "Lista de Alvos",
|
||||
"campaignLogRecords": "Logs das Camapnhas"
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"users": "Usuários",
|
||||
"contacts": "Contatos",
|
||||
"leads": "Leads",
|
||||
"reminders": "Lembretes"
|
||||
"reminders": "Lembretes",
|
||||
"account": "Conta"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
@@ -23,7 +24,8 @@
|
||||
"acceptanceStatus": {
|
||||
"None": "Nenhum",
|
||||
"Accepted": "Aceita",
|
||||
"Declined": "Rejeitada"
|
||||
"Declined": "Rejeitada",
|
||||
"Tentative": "Tentativa"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
"stage": "Estágio",
|
||||
"amount": "Valor",
|
||||
"probability": "Probabilidade, %",
|
||||
"leadSource": "Lead de Origem",
|
||||
"leadSource": "Origem do Lead",
|
||||
"doNotCall": "Não ligar",
|
||||
"closeDate": "Data de Fechamento",
|
||||
"contacts": "Contatos",
|
||||
"description": "Descrição",
|
||||
"amountConverted": "Valor (convertido)",
|
||||
"amountWeightedConverted": "Valor Quantificado"
|
||||
"amountWeightedConverted": "Valor Quantificado",
|
||||
"campaign": "Campanha"
|
||||
},
|
||||
"links": {
|
||||
"contacts": "Contatos",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"options": {
|
||||
"job": {
|
||||
"CheckInboundEmails": "Verificar e-mails recebidos",
|
||||
"CheckEmailAccounts": "Verificar contas de e-mail pessoais",
|
||||
"SendEmailReminders": "Enviar lembretes por e-mail"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Nome",
|
||||
"description": "Descrção",
|
||||
"entryCount": "Contagem de entrada",
|
||||
"campaigns": "Campanhas",
|
||||
"endDate": "Data final",
|
||||
"targetLists": "Lista de alvos"
|
||||
},
|
||||
"links": {
|
||||
"accounts": "Contas",
|
||||
"contacts": "Contatos",
|
||||
"leads": "Leads",
|
||||
"campaigns": "Campanhas"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
"Email": "E-mail",
|
||||
"Web": "Web",
|
||||
"Television": "Televisão",
|
||||
"Radio": "Rádio",
|
||||
"Newsletter": "Newsletter"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create TargetList": "Criar Lista de Alvos"
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,8 @@
|
||||
"Not Started": "Não Iniciada",
|
||||
"Started": "Iniciada",
|
||||
"Completed": "Completa",
|
||||
"Canceled": "Cancelada"
|
||||
"Canceled": "Cancelada",
|
||||
"Deferred": "Adiada"
|
||||
},
|
||||
"priority": {
|
||||
"Low": "Baixa",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"links": {
|
||||
"targetLists": "Lista de alvos"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"emailAddress": "Електронна пошта",
|
||||
"website": "Інтернет сайт",
|
||||
"phoneNumber": "Телефон",
|
||||
"billingAddress": "Платіжний адреса",
|
||||
"shippingAddress": "Поштова адреса",
|
||||
"description": "Опис",
|
||||
"sicCode": "SicCode",
|
||||
"industry": "Промисловість",
|
||||
"type": "Тип",
|
||||
"contactRole": "Назва",
|
||||
"campaign": "Кампанія"
|
||||
},
|
||||
"links": {
|
||||
"contacts": "Контакти",
|
||||
"opportunities": "Угоди",
|
||||
"cases": "Звернення",
|
||||
"documents": "Документи",
|
||||
"meetingsPrimary": "Meetings (expanded)",
|
||||
"callsPrimary": "Calls (expanded)",
|
||||
"tasksPrimary": "Tasks (expanded)",
|
||||
"emailsPrimary": "Emails (expanded)",
|
||||
"targetLists": "Цільові Списки",
|
||||
"campaignLogRecords": "Кампанія Журналу"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
"Customer": "Замовник",
|
||||
"Investor": "Вкладник",
|
||||
"Partner": "Партнер",
|
||||
"Reseller": "Посередник"
|
||||
},
|
||||
"industry": {
|
||||
"Agriculture": "Сільське господарство",
|
||||
"Advertising": "Реклама",
|
||||
"Apparel & Accessories": "Одяг Та Аксесуари",
|
||||
"Automotive": "Автомобільні",
|
||||
"Banking": "Банківська справа",
|
||||
"Biotechnology": "Біотехнології",
|
||||
"Chemical": "Хімічний",
|
||||
"Computer": "Комп'ютер",
|
||||
"Education": "Освіта",
|
||||
"Electronics": "Електроніка",
|
||||
"Entertainment & Leisure": "Розваги Та Відпочинок",
|
||||
"Finance": "Фінанси",
|
||||
"Food & Beverage": "Їжа І Напої",
|
||||
"Grocery": "Доставка",
|
||||
"Insurance": "Страхування",
|
||||
"Legal": "Юридичні",
|
||||
"Publishing": "Публікації",
|
||||
"Real Estate": "Нерухомість",
|
||||
"Service": "Сервіс",
|
||||
"Sports": "Спорт",
|
||||
"Software": "Програмне забезпечення",
|
||||
"Technology": "Технологія",
|
||||
"Telecommunications": "Телекомунікації",
|
||||
"Television": "Телебачення",
|
||||
"Transportation": "Транспорт",
|
||||
"Venture Capital": "Венчурний Капітал"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Account": "Створити контрагента",
|
||||
"Copy Billing": "Копію Білінгу"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"layouts": {
|
||||
"detailConvert": "Перетворити потенційного клієнта"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"modes": {
|
||||
"month": "місяць",
|
||||
"week": "тиждень",
|
||||
"day": "день",
|
||||
"agendaWeek": "тиждень",
|
||||
"agendaDay": "день"
|
||||
},
|
||||
"labels": {
|
||||
"Today": "Сьогодні",
|
||||
"Create": "Створити"
|
||||
}
|
||||
}
|
||||
47
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Call.json
Normal file
47
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Call.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"parent": "Джерело",
|
||||
"status": "статус",
|
||||
"dateStart": "Дата початку",
|
||||
"dateEnd": "Дата закінчення",
|
||||
"direction": "Категорія",
|
||||
"duration": "Тривалість",
|
||||
"description": "Опис",
|
||||
"users": "Користувачі",
|
||||
"contacts": "Контакти",
|
||||
"leads": "Потенційні клієнти",
|
||||
"reminders": "Нагадування",
|
||||
"account": "Контрагент"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"Planned": "Запланований",
|
||||
"Held": "Виконаний",
|
||||
"Not Held": "Не відбувся"
|
||||
},
|
||||
"direction": {
|
||||
"Outbound": "Вихідний",
|
||||
"Inbound": "Вхідний"
|
||||
},
|
||||
"acceptanceStatus": {
|
||||
"None": "Нема",
|
||||
"Accepted": "Прийнятий",
|
||||
"Declined": "Відхилений",
|
||||
"Tentative": "Попередній"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Call": "Новий дзвінок",
|
||||
"Set Held": "Був виконаний",
|
||||
"Set Not Held": "Набір Не Проводиться",
|
||||
"Send Invitations": "Відправити запрошення"
|
||||
},
|
||||
"presetFilters": {
|
||||
"planned": "Запланований",
|
||||
"held": "Виконаний",
|
||||
"todays": "На сьогодні"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"description": "Опис",
|
||||
"status": "статус",
|
||||
"type": "Тип",
|
||||
"startDate": "Дата Початку",
|
||||
"endDate": "Дата Закінчення",
|
||||
"targetLists": "Цільові Списки",
|
||||
"sentCount": "Відправлено",
|
||||
"openedCount": "Відкритий",
|
||||
"clickedCount": "Натиснув",
|
||||
"optedOutCount": "Відмовлено",
|
||||
"bouncedCount": "Відскочив",
|
||||
"hardBouncedCount": "Жорсткий Відскочив",
|
||||
"softBouncedCount": "М'яка Відскочив",
|
||||
"leadCreatedCount": "Призводить Створена",
|
||||
"revenue": "Виручка"
|
||||
},
|
||||
"links": {
|
||||
"targetLists": "Цільові Списки",
|
||||
"accounts": "Контрагенти",
|
||||
"contacts": "Контакти",
|
||||
"leads": "Потенційні клієнти",
|
||||
"opportunities": "Угоди",
|
||||
"campaignLogRecords": "Лоґ"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
"Email": "Електронна пошта",
|
||||
"Web": "Веб -",
|
||||
"Television": "Телебачення",
|
||||
"Radio": "Радіо",
|
||||
"Newsletter": "Розсилку",
|
||||
"Mail": "Пошта"
|
||||
},
|
||||
"status": {
|
||||
"Planning": "Планування",
|
||||
"Active": "Активний",
|
||||
"Inactive": "Неактивний",
|
||||
"Complete": "Повне"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Campaign": "Створити Кампанію",
|
||||
"Target Lists": "Цільові Списки",
|
||||
"Statistics": "Статистика",
|
||||
"hard": "жорсткий",
|
||||
"soft": "м'який"
|
||||
},
|
||||
"presetFilters": {
|
||||
"active": "Активний"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"fields": {
|
||||
"action": "Дія",
|
||||
"actionDate": "Дата",
|
||||
"data": "Дані",
|
||||
"campaign": "Кампанія",
|
||||
"parent": "Цільовий",
|
||||
"object": "Об'єкт",
|
||||
"application": "Додаток"
|
||||
},
|
||||
"options": {
|
||||
"action": {
|
||||
"Sent": "Відправлено",
|
||||
"Opened": "Відкритий",
|
||||
"Opted Out": "Відмовлено",
|
||||
"Bounced": "Відскочив",
|
||||
"Clicked": "Натиснув",
|
||||
"Lead Created": "Привести Створена"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"All": "Все"
|
||||
}
|
||||
}
|
||||
42
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Case.json
Normal file
42
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Case.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"number": "Номер",
|
||||
"status": "статус",
|
||||
"account": "Контрагент",
|
||||
"contact": "Контакт",
|
||||
"priority": "Пріоритет",
|
||||
"type": "Тип",
|
||||
"description": "Опис"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"New": "Новий",
|
||||
"Assigned": "На розгляді",
|
||||
"Pending": "Поточне",
|
||||
"Closed": "Закрито",
|
||||
"Rejected": "Відмовлено",
|
||||
"Duplicate": "Дуплікат"
|
||||
},
|
||||
"priority" : {
|
||||
"Low": "Низький",
|
||||
"Normal": "Нормальний",
|
||||
"High": "Високий",
|
||||
"Urgent": "Терміново"
|
||||
},
|
||||
"type": {
|
||||
"Question": "Питання",
|
||||
"Incident": "Подія",
|
||||
"Problem": "Проблема"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Case": "Створити звернення"
|
||||
},
|
||||
"presetFilters": {
|
||||
"open": "Відкрити",
|
||||
"closed": "Закрито"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"emailAddress": "Електронна пошта",
|
||||
"title": "Назва",
|
||||
"account": "Контрагент",
|
||||
"accounts": "Контрагенти",
|
||||
"phoneNumber": "Телефон",
|
||||
"accountType": "Тип контрагента",
|
||||
"doNotCall": "Не дзвонити",
|
||||
"address": "Адреса",
|
||||
"opportunityRole": "Роль угоди",
|
||||
"accountRole": "Назва",
|
||||
"description": "Опис",
|
||||
"campaign": "Кампанія",
|
||||
"targetLists": "Цільові Списки",
|
||||
"targetList": "Цільовий Список"
|
||||
},
|
||||
"links": {
|
||||
"opportunities": "Угоди",
|
||||
"cases": "Звернення",
|
||||
"targetLists": "Цільові Списки",
|
||||
"campaignLogRecords": "Кампанія Журналу"
|
||||
},
|
||||
"labels": {
|
||||
"Create Contact": "Створити контакт"
|
||||
},
|
||||
"options": {
|
||||
"opportunityRole": {
|
||||
"": "--Ні--",
|
||||
"Decision Maker": "Приймає рішення",
|
||||
"Evaluator": "Оцінювач",
|
||||
"Influencer": "Консультант"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"labels": {
|
||||
"Create Document": "Створити Документ",
|
||||
"Details": "Деталі"
|
||||
},
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"status": "статус",
|
||||
"file": "Файл",
|
||||
"type": "Тип",
|
||||
"source": "Джерело",
|
||||
"publishDate": "Дата Публікації",
|
||||
"expirationDate": "Термін Придатності",
|
||||
"description": "Опис"
|
||||
},
|
||||
"links": {
|
||||
"accounts": "Контрагенти",
|
||||
"opportunities": "Угоди"
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"Active": "Активний",
|
||||
"Draft": "Чернетка",
|
||||
"Expired": "Закінчився",
|
||||
"Canceled": "Скасовано"
|
||||
}
|
||||
},
|
||||
"presetFilters": {
|
||||
"active": "Активний",
|
||||
"draft": "Чернетка"
|
||||
}
|
||||
}
|
||||
100
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Global.json
Normal file
100
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Global.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"scopeNames": {
|
||||
"Account": "Контрагент",
|
||||
"Contact": "Контакт",
|
||||
"Lead": "Потенційний клієнт",
|
||||
"Target": "Цільовий",
|
||||
"Opportunity": "Угода",
|
||||
"Meeting": "Зустріч",
|
||||
"Calendar": "Календар",
|
||||
"Call": "Виклик",
|
||||
"Task": "Завдання",
|
||||
"Case": "Звернення",
|
||||
"InboundEmail": "Вхідна пошта",
|
||||
"Document": "Документ",
|
||||
"Campaign": "Кампанія",
|
||||
"TargetList": "Цільовий Список"
|
||||
},
|
||||
"scopeNamesPlural": {
|
||||
"Account": "Контрагенти",
|
||||
"Contact": "Контакти",
|
||||
"Lead": "Потенційні клієнти",
|
||||
"Target": "Цілі",
|
||||
"Opportunity": "Угоди",
|
||||
"Meeting": "Зустрічі",
|
||||
"Calendar": "Календар",
|
||||
"Call": "Дзвінки",
|
||||
"Task": "Завдання",
|
||||
"Case": "Звернення",
|
||||
"InboundEmail": "Вхідні повідомлення",
|
||||
"Document": "Документи",
|
||||
"Campaign": "Кампаній",
|
||||
"TargetList": "Цільові Списки"
|
||||
},
|
||||
"dashlets": {
|
||||
"Leads": "Мої потенційні клієнти",
|
||||
"Opportunities": "Мої угоди",
|
||||
"Tasks": "Мої завдання",
|
||||
"Cases": "Мої звернення",
|
||||
"Calendar": "Календар",
|
||||
"Calls": "Мої дзвінки",
|
||||
"Meetings": "Мої зустрічі",
|
||||
"OpportunitiesByStage": "Угоди на стадії",
|
||||
"OpportunitiesByLeadSource": "Операції з джерела потенційного клієнта",
|
||||
"SalesByMonth": "Продажу по місяцях",
|
||||
"SalesPipeline": "Джерела продажу"
|
||||
},
|
||||
"labels": {
|
||||
"Create InboundEmail": "Створити вхідну пошту",
|
||||
"Activities": "Заходи",
|
||||
"History": "Історія",
|
||||
"Attendees": "Учасники",
|
||||
"Schedule Meeting": "Запланувати зустріч",
|
||||
"Schedule Call": "Запланувати дзвінок",
|
||||
"Compose Email": "Створити e-mail",
|
||||
"Log Meeting": "Записати зустріч",
|
||||
"Log Call": "Записати дзвінок",
|
||||
"Archive Email": "Архівувати листа",
|
||||
"Create Task": "Створити завдання",
|
||||
"Tasks": "Завдання"
|
||||
},
|
||||
"fields": {
|
||||
"billingAddressCity": "Місто",
|
||||
"billingAddressCountry": "Країна",
|
||||
"billingAddressPostalCode": "Поштовий індекс",
|
||||
"billingAddressState": "Реґіон",
|
||||
"billingAddressStreet": "Вулиця",
|
||||
"addressCity": "Місто",
|
||||
"addressStreet": "Вулиця",
|
||||
"addressCountry": "Країна",
|
||||
"addressState": "Реґіон",
|
||||
"addressPostalCode": "Поштовий індекс",
|
||||
"shippingAddressCity": "Місто доставки",
|
||||
"shippingAddressStreet": "Вулиця доставки",
|
||||
"shippingAddressCountry": "Країна доставки",
|
||||
"shippingAddressState": "Регіон доставки",
|
||||
"shippingAddressPostalCode": "Поштовий код доставки"
|
||||
},
|
||||
"links": {
|
||||
"contacts": "Контакти",
|
||||
"opportunities": "Угоди",
|
||||
"leads": "Потенційні клієнти",
|
||||
"meetings": "Зустрічі",
|
||||
"calls": "Дзвінки",
|
||||
"tasks": "Завдання",
|
||||
"emails": "Листи",
|
||||
"accounts": "Контрагенти",
|
||||
"cases": "Звернення",
|
||||
"documents": "Документи",
|
||||
"account": "Контрагент",
|
||||
"opportunity": "Угода",
|
||||
"contact": "Контакт",
|
||||
"parent": "Джерело"
|
||||
},
|
||||
"options": {
|
||||
"reminderTypes": {
|
||||
"Popup": "Спливаюче вікно",
|
||||
"Email": "Електронна пошта"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"team": "Команда",
|
||||
"status": "статус",
|
||||
"assignToUser": "Зв'язатися з користувачем",
|
||||
"host": "Хост",
|
||||
"username": "Ім'я користувача",
|
||||
"password": "Пароль",
|
||||
"port": "Порт",
|
||||
"monitoredFolders": "Відслідковувані теки",
|
||||
"trashFolder": "Кошик",
|
||||
"ssl": "SSL",
|
||||
"createCase": "Створити звернення",
|
||||
"reply": "Авто-Відповідь",
|
||||
"caseDistribution": "Розподіл звернень",
|
||||
"replyEmailTemplate": "Відповісти за зразком",
|
||||
"replyFromAddress": "Відповісти адреси",
|
||||
"replyToAddress": "Адреса для отримання відповіді",
|
||||
"replyFromName": "Від імені відповісти",
|
||||
"targetUserPosition": "Цільовий Користувач Позиції"
|
||||
},
|
||||
"tooltips": {
|
||||
"reply": "Повідомити відправників, що їхні листи були отримані.",
|
||||
"createCase": "Автоматично створювати звернення з вхідних листів.",
|
||||
"replyToAddress": "Вкажіть адресу для цього ящика, щоб відповіді приходили до нього.",
|
||||
"caseDistribution": "Як звернення будуть призначатися: на користувача або серед групи.",
|
||||
"assignToUser": "Користувач, на якого листи та звернення будуть призначатися.",
|
||||
"team": "Група, до якої будуть відноситися листи і звернення.",
|
||||
"targetUserPosition": "Визначити положення користувачів, які будуть розподілені справ."
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"Active": "Активний",
|
||||
"Inactive": "Неактивний"
|
||||
},
|
||||
"caseDistribution": {
|
||||
"Direct-Assignment": "Пряма завдання",
|
||||
"Round-Robin": "Циклічна",
|
||||
"Least-Busy": "Найбільш вільний"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create InboundEmail": "Створити вхідну пошту",
|
||||
"IMAP": "IMAP",
|
||||
"Actions": "Дії",
|
||||
"Main": "Основне"
|
||||
},
|
||||
"messages": {
|
||||
"couldNotConnectToImap": "Не вдається підключитися до сервера IMAP"
|
||||
}
|
||||
}
|
||||
55
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Lead.json
Normal file
55
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Lead.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"labels": {
|
||||
"Converted To": "Перетворений в",
|
||||
"Create Lead": "Створити потенційного клієнта",
|
||||
"Convert": "Перетворити"
|
||||
},
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"emailAddress": "Електронна пошта",
|
||||
"title": "Назва",
|
||||
"website": "Інтернет сайт",
|
||||
"phoneNumber": "Телефон",
|
||||
"accountName": "Ім'я контрагента",
|
||||
"doNotCall": "Не дзвонити",
|
||||
"address": "Адреса",
|
||||
"status": "статус",
|
||||
"source": "Джерело",
|
||||
"opportunityAmount": "Сума угоди",
|
||||
"opportunityAmountConverted": "Сума угоди (конвертований)",
|
||||
"description": "Опис",
|
||||
"createdAccount": "Контрагент",
|
||||
"createdContact": "Контакт",
|
||||
"createdOpportunity": "Угода",
|
||||
"campaign": "Кампанія",
|
||||
"targetLists": "Цільові Списки",
|
||||
"targetList": "Цільовий Список"
|
||||
},
|
||||
"links": {
|
||||
"targetLists": "Цільові Списки",
|
||||
"campaignLogRecords": "Кампанія Журналу"
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"New": "Новий",
|
||||
"Assigned": "На розгляді",
|
||||
"In Process": "У процесі",
|
||||
"Converted": "Перетворене",
|
||||
"Recycled": "Відновлений",
|
||||
"Dead": "Мертвий"
|
||||
},
|
||||
"source": {
|
||||
"Call": "Виклик",
|
||||
"Email": "Електронна пошта",
|
||||
"Existing Customer": "Існуючі Служби",
|
||||
"Partner": "Партнер",
|
||||
"Public Relations": "Зв'язки З Громадськістю",
|
||||
"Web Site": "Веб-Сайт",
|
||||
"Campaign": "Кампанія",
|
||||
"Other": "Додатково"
|
||||
}
|
||||
},
|
||||
"presetFilters": {
|
||||
"active": "Активний"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"parent": "Джерело",
|
||||
"status": "статус",
|
||||
"dateStart": "Дата початку",
|
||||
"dateEnd": "Дата закінчення",
|
||||
"duration": "Тривалість",
|
||||
"description": "Опис",
|
||||
"users": "Користувачі",
|
||||
"contacts": "Контакти",
|
||||
"leads": "Потенційні клієнти",
|
||||
"reminders": "Нагадування",
|
||||
"account": "Контрагент"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"Planned": "Запланований",
|
||||
"Held": "Виконаний",
|
||||
"Not Held": "Не відбувся"
|
||||
},
|
||||
"acceptanceStatus": {
|
||||
"None": "Нема",
|
||||
"Accepted": "Прийнятий",
|
||||
"Declined": "Відхилений",
|
||||
"Tentative": "Попередній"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Meeting": "Створити зустріч",
|
||||
"Set Held": "Був виконаний",
|
||||
"Set Not Held": "Набір Не Проводиться",
|
||||
"Send Invitations": "Відправити запрошення",
|
||||
"on time": "на час",
|
||||
"before": "перед"
|
||||
},
|
||||
"presetFilters": {
|
||||
"planned": "Запланований",
|
||||
"held": "Виконаний",
|
||||
"todays": "На сьогодні"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"account": "Контрагент",
|
||||
"stage": "Стадія",
|
||||
"amount": "Сума",
|
||||
"probability": "Ймовірність успіху, %",
|
||||
"leadSource": "Джерело потенційного клієнта",
|
||||
"doNotCall": "Не дзвонити",
|
||||
"closeDate": "Дата закриття",
|
||||
"contacts": "Контакти",
|
||||
"description": "Опис",
|
||||
"amountConverted": "Сума (сконвертирована)",
|
||||
"amountWeightedConverted": "Сума Зважених",
|
||||
"campaign": "Кампанія"
|
||||
},
|
||||
"links": {
|
||||
"contacts": "Контакти",
|
||||
"documents": "Документи"
|
||||
},
|
||||
"options": {
|
||||
"stage": {
|
||||
"Prospecting": "Залучення клієнта",
|
||||
"Qualification": "Оцінка можливості",
|
||||
"Needs Analysis": "Вимагає аналізу",
|
||||
"Value Proposition": "Вибір пропозиції/оферти",
|
||||
"Id. Decision Makers": "Визначення відповідальної особи",
|
||||
"Perception Analysis": "Проведення аналізу",
|
||||
"Proposal/Price Quote": "Відправлено пропозиція/оферта",
|
||||
"Negotiation/Review": "Узгодження/розгляд",
|
||||
"Closed Won": "Закрито - Успіх",
|
||||
"Closed Lost": "Закрито - Провал"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Opportunity": "Створити угоду"
|
||||
},
|
||||
"presetFilters": {
|
||||
"open": "Відкрити",
|
||||
"won": "Успішні"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
|
||||
"options": {
|
||||
"job": {
|
||||
"CheckInboundEmails": "Перевірити пошту",
|
||||
"CheckEmailAccounts": "Перевірка Особистих Облікових Записів Електронної Пошти",
|
||||
"SendEmailReminders": "Відправляти Нагадування По Електронній Пошті"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"emailAddress": "Електронна пошта",
|
||||
"title": "Назва",
|
||||
"website": "Інтернет сайт",
|
||||
"accountName": "Ім'я контрагента",
|
||||
"phoneNumber": "Телефон",
|
||||
"doNotCall": "Не дзвонити",
|
||||
"address": "Адреса",
|
||||
"description": "Опис"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"labels": {
|
||||
"Create Target": "Створити мета",
|
||||
"Convert to Lead": "Перетворити потенційного клієнта"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"description": "Опис",
|
||||
"entryCount": "Запис Графа",
|
||||
"campaigns": "Кампаній",
|
||||
"endDate": "Дата Закінчення",
|
||||
"targetLists": "Цільові Списки"
|
||||
},
|
||||
"links": {
|
||||
"accounts": "Контрагенти",
|
||||
"contacts": "Контакти",
|
||||
"leads": "Потенційні клієнти",
|
||||
"campaigns": "Кампаній"
|
||||
},
|
||||
"options": {
|
||||
"type": {
|
||||
"Email": "Електронна пошта",
|
||||
"Web": "Веб -",
|
||||
"Television": "Телебачення",
|
||||
"Radio": "Радіо",
|
||||
"Newsletter": "Розсилку"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create TargetList": "Створити Цільовий Список"
|
||||
}
|
||||
}
|
||||
42
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Task.json
Normal file
42
application/Espo/Modules/Crm/Resources/i18n/uk_UA/Task.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": "Ім'я",
|
||||
"parent": "Джерело",
|
||||
"status": "статус",
|
||||
"dateStart": "Дата початку",
|
||||
"dateEnd": "Дата Зв'язку",
|
||||
"dateStartDate": "Date Start (all day)",
|
||||
"dateEndDate": "Date End (all day)",
|
||||
"priority": "Пріоритет",
|
||||
"description": "Опис",
|
||||
"isOverdue": "Прострочена",
|
||||
"account": "Контрагент"
|
||||
},
|
||||
"links": {
|
||||
},
|
||||
"options": {
|
||||
"status": {
|
||||
"Not Started": "Не почалася",
|
||||
"Started": "Почалася",
|
||||
"Completed": "Завершено",
|
||||
"Canceled": "Скасовано",
|
||||
"Deferred": "Відстрочені"
|
||||
},
|
||||
"priority" : {
|
||||
"Low": "Низький",
|
||||
"Normal": "Нормальний",
|
||||
"High": "Високий",
|
||||
"Urgent": "Терміново"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"Create Task": "Створити завдання",
|
||||
"Complete": "Повне"
|
||||
},
|
||||
"presetFilters": {
|
||||
"actual": "Фактичні",
|
||||
"completed": "Завершено",
|
||||
"todays": "На сьогодні",
|
||||
"overdue": "Прострочені"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"links": {
|
||||
"targetLists": "Цільові Списки"
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
{
|
||||
"label":"Overview",
|
||||
"rows": [
|
||||
[{"name":"name"},false],
|
||||
[{"name":"name"},false],
|
||||
[{"name":"emailAddress"},{"name":"phoneNumber"}],
|
||||
[{"name":"website"},false],
|
||||
[{"name":"billingAddress"},{"name":"shippingAddress"}],
|
||||
[{"name":"description", "fullWidth": true}]
|
||||
[{"name":"billingAddress"},{"name":"shippingAddress"}]
|
||||
]
|
||||
},
|
||||
{
|
||||
"label":"Details",
|
||||
"rows": [
|
||||
[{"name":"type"},{"name":"sicCode"}],
|
||||
[{"name":"industry"},false]
|
||||
[{"name":"industry"},false],
|
||||
[{"name":"description","fullWidth": true}]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
[{"name":"name"},false],
|
||||
[{"name":"website"},{"name":"phoneNumber"}],
|
||||
[{"name":"emailAddress"},false],
|
||||
[{"name":"billingAddress"},{"name":"shippingAddress"}],
|
||||
[{"name":"description", "fullWidth": true}]
|
||||
[{"name":"billingAddress"},{"name":"shippingAddress"}]
|
||||
]
|
||||
}, {
|
||||
"label":"Details",
|
||||
"rows":[
|
||||
[{"name":"type"},{"name":"sicCode"}],
|
||||
[{"name":"industry"},false]
|
||||
[{"name":"industry"},false],
|
||||
[{"name":"description", "fullWidth": true}]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[
|
||||
"assignedUser",
|
||||
"billingAddress",
|
||||
"createdAt",
|
||||
"emailAddress",
|
||||
"industry",
|
||||
"type"
|
||||
|
||||
@@ -1 +1,14 @@
|
||||
[{"label":"","rows":[[{"name":"name"}],[{"name":"status"}],[{"name":"direction"}],[{"name":"dateStart"}],[{"name":"duration"}],[{"name":"parent"}]]}]
|
||||
[
|
||||
{
|
||||
"label":"",
|
||||
"rows":[
|
||||
[{"name":"name"}],
|
||||
[{"name":"status"}],
|
||||
[{"name":"direction"}],
|
||||
[{"name":"dateStart"}],
|
||||
[{"name":"duration"}],
|
||||
[{"name":"parent"}],
|
||||
[{"name":"description"}]
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1,5 +1,7 @@
|
||||
[
|
||||
"account",
|
||||
"assignedUser",
|
||||
"createdAt",
|
||||
"dateStart",
|
||||
"direction",
|
||||
"status",
|
||||
|
||||
@@ -1 +1,13 @@
|
||||
[{"label":"","rows":[[{"name":"name"}],[{"name":"status"}],[{"name":"priority"}],[{"name":"type"}],[{"name":"account"}]]}]
|
||||
[
|
||||
{
|
||||
"label":"",
|
||||
"rows":[
|
||||
[{"name":"name"}],
|
||||
[{"name":"status"}],
|
||||
[{"name":"priority"}],
|
||||
[{"name":"type"}],
|
||||
[{"name":"account"}],
|
||||
[{"name":"description"}]
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -2,6 +2,7 @@
|
||||
"account",
|
||||
"assignedUser",
|
||||
"contact",
|
||||
"createdAt",
|
||||
"number",
|
||||
"status",
|
||||
"priority",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[
|
||||
{"name":"number","width":12},
|
||||
{"name":"name","width":30,"link":true},
|
||||
{"name":"status"},
|
||||
{"name":"priority"},
|
||||
{"name":"number","width":12},
|
||||
{"name":"status", "width":11},
|
||||
{"name":"priority", "width":11},
|
||||
{"name":"account"},
|
||||
{"name":"assignedUser"}
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{"name":"number","width":18},
|
||||
{"name":"name","width":35,"link":true},
|
||||
{"name":"number","width":18},
|
||||
{"name":"status"},
|
||||
{"name":"priority"}
|
||||
]
|
||||
@@ -1,7 +1,9 @@
|
||||
[
|
||||
"account",
|
||||
"assignedUser",
|
||||
"createdAt",
|
||||
"emailAddress",
|
||||
"title",
|
||||
"address",
|
||||
"title"
|
||||
"targetLists"
|
||||
]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[
|
||||
"createdAt",
|
||||
"expirationDate",
|
||||
"type",
|
||||
"status",
|
||||
"publishDate",
|
||||
"expirationDate"
|
||||
"publishDate"
|
||||
]
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
],
|
||||
[
|
||||
{"name":"monitoredFolders"},{"name":"password"}
|
||||
]
|
||||
],
|
||||
[{"name": "testConnection", "customLabel": null, "view": "Crm:InboundEmail.Fields.TestConnection"}]
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
[{"name":"name"},{"name":"accountName"}],
|
||||
[{"name":"emailAddress"},{"name":"phoneNumber"}],
|
||||
[{"name":"title"},{"name":"doNotCall"}],
|
||||
[{"name":"address"},{"name":"website"}],
|
||||
[{"name":"description", "fullWidth": true}]
|
||||
[{"name":"address"},{"name":"website"}]
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
"label":"Details",
|
||||
"rows": [
|
||||
[{"name":"status"},{"name":"source"}],
|
||||
[{"name":"opportunityAmount"},false]
|
||||
[{"name":"opportunityAmount"},{"name":"campaign"}],
|
||||
[{"name":"description", "fullWidth": true}]
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user