Compare commits

...

166 Commits
3.1.0 ... 3.2.2

Author SHA1 Message Date
yuri
6f45e26028 version 2015-04-24 10:04:19 +03:00
Taras Machyshyn
f6892877c1 Extension can be installed with the same version 2015-04-23 15:44:31 +03:00
yuri
c7cc44edf6 Merge branch 'hotfix/3.2.2' of ssh://172.20.0.1/var/git/espo/backend into hotfix/3.2.2 2015-04-23 11:56:41 +03:00
yuri
e958d7c488 fix inbound email 2015-04-23 11:55:25 +03:00
Taras Machyshyn
77ff11990b Installer: disable prompt password saving while installing 2015-04-23 11:48:23 +03:00
Taras Machyshyn
994e0c1eda Extensions: improved restore functionality of install script 2015-04-23 10:48:42 +03:00
Taras Machyshyn
d51e88be60 Minor bug fixes for fileManager 2015-04-23 10:42:24 +03:00
yuri
9595d528a8 wysywyg strip base tag 2015-04-17 15:22:29 +03:00
yuri
9bfb27e10a layout pretty print 2015-04-17 11:57:00 +03:00
yuri
be50630d2f fix primary address 2015-04-17 11:51:16 +03:00
yuri
d8b629a5a0 fix email note if sent is fail 2015-04-16 10:31:03 +03:00
yuri
6d0b39f2b6 fix email note 2015-04-15 16:43:06 +03:00
yuri
b778f74628 Test Connection for email account 2015-04-15 12:10:59 +03:00
yuri
6db658c0b3 fix follow button 2015-04-15 10:47:03 +03:00
yuri
6fb88665bb messageId fix 2015-04-15 10:05:08 +03:00
yuri
f20a47542a disable escape for quick edit 2015-04-14 14:30:55 +03:00
yuri
c77e3b7e92 link field placeholder 2015-04-14 12:28:50 +03:00
yuri
e7b033304c clear_cache.php 2015-04-14 12:11:45 +03:00
yuri
2b8a8d23eb fix notifications hook 2015-04-14 11:51:34 +03:00
yuri
0f59f79a9e fix email search 2015-04-14 11:50:05 +03:00
yuri
2904cd1f53 performance tweeks 2015-04-14 11:43:29 +03:00
yuri
d87ae60fea version 2015-04-13 12:16:30 +03:00
yuri
0d17cf6e78 lang cache issue 2015-04-13 11:53:22 +03:00
yuri
81739d59f5 quickDetailDisabled 2015-04-13 11:07:16 +03:00
yuri
7704d5afd0 layout change 2015-04-13 10:43:18 +03:00
yuri
da268f2b29 note email from === parent 2015-04-13 10:30:57 +03:00
yuri
01dc251ef2 fix email RE 2015-04-13 10:17:20 +03:00
yuri
9054d70f4c fix email from 2015-04-13 10:14:05 +03:00
yuri
788b265cd4 email fixes 2015-04-13 10:00:48 +03:00
yuri
c96640bcb1 fix orm double join 2015-04-10 15:41:45 +03:00
yuri
66fb7b4e81 fix import 2015-04-10 11:49:42 +03:00
yuri
d83a19e316 fix lang 2015-04-10 10:24:58 +03:00
yuri
452e39903e ua lang 2015-04-09 15:28:07 +03:00
yuri
797fcc172c email to lead: use reply to 2015-04-09 14:06:11 +03:00
yuri
cdb7c919b3 sort layout field list 2015-04-09 12:27:38 +03:00
yuri
0f7f438935 layoutSearch fix 2015-04-09 12:12:10 +03:00
yuri
7c01eedda8 followCreatedEntities param 2015-04-09 12:05:40 +03:00
yuri
bab7f3e9fc email notifications 2015-04-09 11:56:47 +03:00
yuri
761d85a112 fix email import and send 2015-04-09 11:02:55 +03:00
yuri
52e323123a notifications 2 2015-04-08 18:23:14 +03:00
yuri
01af1677cf notifications 2015-04-08 17:38:32 +03:00
yuri
d4f4fcb10e email optimization 2015-04-07 16:54:54 +03:00
yuri
74fd228bfb fix email small layout 2015-04-07 15:46:31 +03:00
yuri
f452d2e5d2 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-04-07 15:25:29 +03:00
yuri
3a01348e02 improve draft email 2015-04-07 15:25:15 +03:00
Taras Machyshyn
b1743ee4a2 Cleared passwords when loggin input data 2015-04-07 12:32:13 +03:00
Taras Machyshyn
ab14769387 Changed current year for installer 2015-04-07 12:04:13 +03:00
yuri
5c800601e4 cleanup addition 2015-04-07 11:23:25 +03:00
yuri
8aea81340b default layout changes 2015-04-07 10:28:26 +03:00
yuri
8513911f21 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-04-06 17:38:33 +03:00
yuri
6a46c453cd add client custom dir 2015-04-06 17:38:10 +03:00
yuri
2029dc5e10 fix tasks panel 2015-04-06 17:34:04 +03:00
yuri
70664d1a7a fix template entityDefs 2015-04-06 16:13:08 +03:00
yuri
7d212ec62f fix default detail layout 2015-04-06 16:10:20 +03:00
yuri
fa7b145e07 fix link manager 2015-04-06 16:02:10 +03:00
yuri
830645cb73 parent type length 100 2015-04-06 15:43:47 +03:00
yuri
94e03b3c18 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-04-06 15:36:46 +03:00
Taras Machyshyn
3ace85eebc Improved Orm convertor 2015-04-06 15:36:14 +03:00
yuri
c6cfdd9e90 version 2015-04-06 12:37:57 +03:00
yuri
d1b2dfae3e default task status 2015-04-06 12:29:48 +03:00
yuri
98fb345a5a dont create auth token if logged browser basic auth 2015-04-06 11:26:18 +03:00
Yuri Kuznetsov
481314886f Update README.md 2015-04-03 18:59:02 +03:00
yuri
ad90cd171a leadSource field 2015-04-03 12:50:14 +03:00
yuri
8272e0e652 default duration 2015-04-03 12:07:11 +03:00
yuri
f218de2e04 fix messages 2015-04-03 11:58:58 +03:00
yuri
53529fc506 duration options 2015-04-03 11:47:55 +03:00
yuri
aef99fb4fd lang 2015-04-03 11:08:42 +03:00
yuri
86f690c79f midAlias ORM 2015-04-03 10:29:28 +03:00
yuri
71f9e90436 join many alias 2015-04-02 17:48:46 +03:00
yuri
75608f41b1 Merge branch 'hotfix/3.1.2' 2015-04-02 15:30:19 +03:00
yuri
0730ae5b3f fix forgot password 2015-04-02 15:27:29 +03:00
yuri
a7f537879e change dev index.php 2015-04-02 15:20:05 +03:00
yuri
6066cf1d65 change version 2015-04-02 14:24:20 +03:00
yuri
ccda236b6e Merge branch 'hotfix/3.1.2' 2015-04-02 11:46:22 +03:00
yuri
32ec348369 pt_BR fixes 2015-04-02 11:46:04 +03:00
yuri
d85f66171d Merge branch 'hotfix/3.1.2' 2015-04-02 11:13:26 +03:00
yuri
8c6aa46ec8 fix email plain 2015-04-02 11:12:56 +03:00
yuri
d2f7bc475a fix role and team list layout 2015-04-02 10:57:25 +03:00
yuri
410cf02518 filters layout changes 2015-04-01 16:49:44 +03:00
yuri
958414017e Merge branch 'hotfix/3.1.2' 2015-04-01 16:22:30 +03:00
yuri
8fbfad9637 async false for upgrade 2015-04-01 16:22:17 +03:00
yuri
07e8f94748 fix form leave out 2015-04-01 15:52:21 +03:00
yuri
4db162f9f7 fix form leave out 2015-04-01 15:33:03 +03:00
yuri
459dfb7937 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-04-01 15:07:55 +03:00
yuri
56b0536152 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-04-01 15:07:42 +03:00
yuri
5bb7dd3ccd list buttons 2015-04-01 15:07:27 +03:00
yuri
6e50e4fd8e hide cc field if empty 2015-04-01 12:23:00 +03:00
yuri
878e1616da change email layout and email from name fix 2015-04-01 12:16:35 +03:00
yuri
64a410099e form leave out 2015-04-01 11:32:37 +03:00
yuri
9cb8664ddf fix token remove 2015-04-01 09:49:41 +03:00
Taras Machyshyn
6d5c3c8ad5 Code optimization for Orm convertation 2015-03-31 17:23:53 +03:00
Yuri Kuznetsov
f07c8fca64 Update README.md 2015-03-31 16:41:56 +03:00
yuri
944c76ad93 imprort improvements 2015-03-31 15:50:33 +03:00
yuri
ae8f9df02b fix metadata to orm 2015-03-31 10:57:10 +03:00
yuri
6da3659b7d Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-03-31 10:48:13 +03:00
yuri
1f1d9f3abd Merge branch 'hotfix/3.1.2' 2015-03-31 10:48:08 +03:00
yuri
530d7f2d81 import email: findParent lead 2015-03-31 10:47:53 +03:00
Taras Machyshyn
e67ecded2a Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-03-31 10:43:31 +03:00
Taras Machyshyn
b9343d5e64 Improved Orm convertation 2015-03-31 10:43:14 +03:00
yuri
898393c7ac Merge branch 'hotfix/3.1.2' 2015-03-30 17:44:16 +03:00
yuri
9b2ea5298d fix iframe links 2015-03-30 17:14:37 +03:00
yuri
0d2b56c58f signature fix 2015-03-30 17:07:28 +03:00
yuri
076c920dc7 upgrade summernote 2015-03-30 16:58:45 +03:00
yuri
638df642ec import dev 2015-03-30 16:47:27 +03:00
yuri
d2f4190612 field changes 2015-03-30 16:18:29 +03:00
yuri
7201f517e8 row actions change 2015-03-30 15:32:18 +03:00
yuri
c91365f627 change calendar query 2015-03-30 15:03:41 +03:00
yuri
f3bc4dbccf import dev 2015-03-30 13:39:14 +03:00
yuri
d4daef6012 autoincrement creatable 2015-03-30 12:29:53 +03:00
yuri
dbf4f68a44 user filters 2015-03-30 12:28:54 +03:00
yuri
8a7325963b import revert/remove duplicates 2015-03-30 12:26:41 +03:00
yuri
fc0d8dffcd fix prev 2015-03-30 11:34:54 +03:00
yuri
f8498e3adc save and remove options 2015-03-30 11:22:14 +03:00
yuri
e4b51ba675 fix isOverdue 2015-03-27 16:49:32 +02:00
yuri
83f9ead607 record getEntity 2015-03-27 16:44:34 +02:00
yuri
bf6778770e fix label 2015-03-27 16:23:40 +02:00
yuri
093b80293a import dev 2015-03-27 16:20:44 +02:00
yuri
34dee314e7 import dev 2015-03-27 15:46:59 +02:00
yuri
313b94168e search.tpl fix 2015-03-27 13:10:56 +02:00
yuri
d6085bbdcf createdAt to filters 2015-03-27 12:43:09 +02:00
yuri
160dc5d61c Merge branch 'hotfix/3.1.2' 2015-03-27 12:10:41 +02:00
yuri
987b383d7c fix plainText signature 2015-03-27 12:10:12 +02:00
yuri
8b4cb1568e import dev 2015-03-27 12:00:10 +02:00
yuri
aef4028180 replace tabs 2015-03-27 11:52:07 +02:00
yuri
9b779ee8cd change streamRelated for account 2015-03-26 18:08:35 +02:00
yuri
ccc339cf48 import 1 2015-03-26 17:23:26 +02:00
yuri
6aabbfd944 replace tabs 2015-03-26 13:58:32 +02:00
yuri
0e87626e34 cleanup 2015-03-26 13:22:20 +02:00
yuri
8641181511 fix task panel 2015-03-26 13:20:21 +02:00
yuri
123c3ef8ab grand filters change 2015-03-26 13:14:13 +02:00
yuri
07bd5a9d60 opp by stage w/o Closed Won 2015-03-25 16:07:05 +02:00
yuri
deca89039a calendar dashlet changes 2015-03-25 15:58:08 +02:00
yuri
1542fa86d8 Merge branch 'hotfix/3.1.1' 2015-03-25 15:28:11 +02:00
yuri
93ca814fe3 fix save filters margin 2015-03-25 15:27:54 +02:00
yuri
4d9e5ee302 accountId improvements 2015-03-25 15:25:39 +02:00
yuri
0a697cdc0a note superParent 2 2015-03-25 14:42:19 +02:00
yuri
1b01e476ac clearnup 2015-03-25 14:09:10 +02:00
yuri
ee689fb351 remove dashletOptions when dashlet removed 2015-03-25 14:08:34 +02:00
yuri
92a76d80f2 Merge branch 'hotfix/3.1.1' 2015-03-25 10:26:56 +02:00
yuri
a662c1a5fe improve uniqid 2015-03-25 10:26:02 +02:00
yuri
3ffa949276 fix create in select 2015-03-24 17:44:16 +02:00
yuri
371966e2cf add super parent for note 2015-03-24 17:24:38 +02:00
yuri
8f1a4d2a02 link, linkParent and belondToParent fix 2015-03-24 16:44:15 +02:00
yuri
3128b6f25a add index to email 2015-03-24 15:51:36 +02:00
yuri
0920821f1e change lang message 2015-03-24 12:12:24 +02:00
yuri
0f8f9c01ff change css 2015-03-24 12:06:29 +02:00
yuri
1d9621bc91 change version 2015-03-24 11:25:09 +02:00
yuri
e138daec5f fix table head hight 2015-03-24 11:16:26 +02:00
yuri
4a51e754d7 fix in inbound email 2015-03-24 11:01:55 +02:00
yuri
e6e0bc1703 fix inbound email double notification 2015-03-24 10:52:33 +02:00
yuri
49fbc6e082 email fromName changes 2015-03-24 10:39:08 +02:00
yuri
a0ed610f60 search by target lists 2015-03-23 18:07:39 +02:00
yuri
9f8c0eb4a2 cleanup 2015-03-23 16:50:32 +02:00
yuri
be29fac010 rename role to title 2015-03-23 16:02:07 +02:00
yuri
b3cefd9bcb change case layout 2015-03-23 15:54:34 +02:00
yuri
501d6f2692 fix markdown parsing 2015-03-23 15:45:48 +02:00
yuri
3d7560024f fixes email reply 2015-03-23 14:39:01 +02:00
yuri
a201b45d04 change stream messages 2015-03-23 11:45:30 +02:00
yuri
41f88a4015 modal.detail scroll to top hack 2015-03-23 11:18:45 +02:00
yuri
52a131ef93 fix dashlet actions 2015-03-23 10:34:54 +02:00
yuri
7ab28601ca dashlet options clone 2015-03-23 10:04:34 +02:00
yuri
5de509a0de fix warnings 2015-03-23 10:00:08 +02:00
yuri
2534b14dce fix frontend acl 2015-03-23 09:50:40 +02:00
yuri
27f98b95eb fix currency field 2015-03-20 17:09:02 +02:00
yuri
b08bee78b9 iframe fix 2015-03-20 16:57:46 +02:00
yuri
a39327a95b 2015 2015-03-20 16:23:18 +02:00
373 changed files with 7535 additions and 1978 deletions

View File

@@ -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',

View File

@@ -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).

View File

@@ -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();
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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');

View File

@@ -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);
}
}
}

View File

@@ -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];

View File

@@ -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') {

View File

@@ -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) {

View 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);
}
}
}
}

View File

@@ -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)) {

View File

@@ -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)) {

View File

@@ -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);

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
{
"controller": "Controllers.Record",
"boolFilters": ["onlyMy"]
"boolFilterList": ["onlyMy"]
}

View File

@@ -47,7 +47,8 @@
"teams": {
"type": "hasMany",
"entity": "Team",
"relationName": "EntityTeam"
"relationName": "EntityTeam",
"layoutRelationshipsDisabled": true
}
},
"collection": {

View File

@@ -1,4 +1,4 @@
{
"controller": "Controllers.Record",
"boolFilters": ["onlyMy"]
"boolFilterList": ["onlyMy"]
}

View File

@@ -89,7 +89,8 @@
"teams": {
"type": "hasMany",
"entity": "Team",
"relationName": "EntityTeam"
"relationName": "EntityTeam",
"layoutRelationshipsDisabled": true
}
},
"collection": {

View File

@@ -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));
}
}

View File

@@ -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');

View File

@@ -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.');
}

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -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 */

View File

@@ -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',

View 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;
}
}

View File

@@ -44,6 +44,11 @@ class LinkParent extends Base
),
),
),
'unset' => array(
$entityName => array(
'fields.'.$fieldName,
),
),
);
}
}

View File

@@ -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',

View File

@@ -42,6 +42,7 @@ class BelongsTo extends Base
'type' => 'foreign',
'relation' => $linkName,
'foreign' => $this->getForeignField('name', $foreignEntityName),
'notStorable' => false,
);
}

View File

@@ -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',
),
),
),
);
}
}

View File

@@ -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"]
)
)
),
);

View File

@@ -136,7 +136,8 @@ class EntityManager
'customizable' => true,
'importable' => true,
'type' => $type,
'stream' => $stream
'stream' => $stream,
'notifications' => true
);
$this->getMetadata()->set('scopes', $name, $scopeData);

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -510,6 +510,11 @@ class Util
return true;
}
public static function generateId()
{
return uniqid() . substr(md5(rand()), 0, 4);
}
}

View File

@@ -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,
);

View File

@@ -1,6 +1,6 @@
[{
"label":"Overview",
"rows": [
[{"name":"name"}]
[{"name":"name"}, false]
]
}]

View 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
{
}

View File

@@ -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()))
) {

View 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);
}
}
}
}

View File

@@ -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)) {

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -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'));
}
}
}

View File

@@ -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();

View File

@@ -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
{
{
}

View File

@@ -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);
}
}
}
}
}

View File

@@ -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"
},

View File

@@ -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",

View File

@@ -21,7 +21,9 @@
"createdAccount": "Account",
"createdContact": "Contact",
"createdOpportunity": "Opportunity",
"campaign": "Campaign"
"campaign": "Campaign",
"targetLists": "Target Lists",
"targetList": "Target List"
},
"links": {
"targetLists": "Target Lists",

View File

@@ -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": {
},

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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"
}
}

View File

@@ -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"
}
}

View File

@@ -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"

View File

@@ -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",

View File

@@ -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": {
},

View File

@@ -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": {

View File

@@ -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": {

View File

@@ -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",

View File

@@ -3,6 +3,7 @@
"options": {
"job": {
"CheckInboundEmails": "Verificar e-mails recebidos",
"CheckEmailAccounts": "Verificar contas de e-mail pessoais",
"SendEmailReminders": "Enviar lembretes por e-mail"
}
}

View File

@@ -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"
}
}

View File

@@ -16,7 +16,8 @@
"Not Started": "Não Iniciada",
"Started": "Iniciada",
"Completed": "Completa",
"Canceled": "Cancelada"
"Canceled": "Cancelada",
"Deferred": "Adiada"
},
"priority": {
"Low": "Baixa",

View File

@@ -0,0 +1,5 @@
{
"links": {
"targetLists": "Lista de alvos"
}
}

View File

@@ -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": "Копію Білінгу"
}
}

View File

@@ -0,0 +1,5 @@
{
"layouts": {
"detailConvert": "Перетворити потенційного клієнта"
}
}

View File

@@ -0,0 +1,13 @@
{
"modes": {
"month": "місяць",
"week": "тиждень",
"day": "день",
"agendaWeek": "тиждень",
"agendaDay": "день"
},
"labels": {
"Today": "Сьогодні",
"Create": "Створити"
}
}

View 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": "На сьогодні"
}
}

View File

@@ -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": "Активний"
}
}

View File

@@ -0,0 +1,24 @@
{
"fields": {
"action": "Дія",
"actionDate": "Дата",
"data": "Дані",
"campaign": "Кампанія",
"parent": "Цільовий",
"object": "Об'єкт",
"application": "Додаток"
},
"options": {
"action": {
"Sent": "Відправлено",
"Opened": "Відкритий",
"Opted Out": "Відмовлено",
"Bounced": "Відскочив",
"Clicked": "Натиснув",
"Lead Created": "Привести Створена"
}
},
"labels": {
"All": "Все"
}
}

View 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": "Закрито"
}
}

View File

@@ -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": "Консультант"
}
}
}

View File

@@ -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": "Чернетка"
}
}

View 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": "Електронна пошта"
}
}
}

View File

@@ -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"
}
}

View 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": "Активний"
}
}

View File

@@ -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": "На сьогодні"
}
}

View File

@@ -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": "Успішні"
}
}

View File

@@ -0,0 +1,10 @@
{
"options": {
"job": {
"CheckInboundEmails": "Перевірити пошту",
"CheckEmailAccounts": "Перевірка Особистих Облікових Записів Електронної Пошти",
"SendEmailReminders": "Відправляти Нагадування По Електронній Пошті"
}
}
}

View File

@@ -0,0 +1,19 @@
{
"fields": {
"name": "Ім'я",
"emailAddress": "Електронна пошта",
"title": "Назва",
"website": "Інтернет сайт",
"accountName": "Ім'я контрагента",
"phoneNumber": "Телефон",
"doNotCall": "Не дзвонити",
"address": "Адреса",
"description": "Опис"
},
"links": {
},
"labels": {
"Create Target": "Створити мета",
"Convert to Lead": "Перетворити потенційного клієнта"
}
}

View File

@@ -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": "Створити Цільовий Список"
}
}

View 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": "Прострочені"
}
}

View File

@@ -0,0 +1,5 @@
{
"links": {
"targetLists": "Цільові Списки"
}
}

View File

@@ -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}]
]
}
]

View File

@@ -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}]
]
}
]

View File

@@ -1,6 +1,7 @@
[
"assignedUser",
"billingAddress",
"createdAt",
"emailAddress",
"industry",
"type"

View File

@@ -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"}]
]
}
]

View File

@@ -1,5 +1,7 @@
[
"account",
"assignedUser",
"createdAt",
"dateStart",
"direction",
"status",

View File

@@ -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"}]
]
}
]

View File

@@ -2,6 +2,7 @@
"account",
"assignedUser",
"contact",
"createdAt",
"number",
"status",
"priority",

View File

@@ -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"}
]

View File

@@ -1,6 +1,6 @@
[
{"name":"number","width":18},
{"name":"name","width":35,"link":true},
{"name":"number","width":18},
{"name":"status"},
{"name":"priority"}
]

View File

@@ -1,7 +1,9 @@
[
"account",
"assignedUser",
"createdAt",
"emailAddress",
"title",
"address",
"title"
"targetLists"
]

View File

@@ -1,6 +1,7 @@
[
"createdAt",
"expirationDate",
"type",
"status",
"publishDate",
"expirationDate"
"publishDate"
]

View File

@@ -26,7 +26,8 @@
],
[
{"name":"monitoredFolders"},{"name":"password"}
]
],
[{"name": "testConnection", "customLabel": null, "view": "Crm:InboundEmail.Fields.TestConnection"}]
]
},
{

View File

@@ -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