Compare commits

...

157 Commits
4.3.1 ... 4.4.1

Author SHA1 Message Date
yuri
4edf4ef9ea button fix 2017-02-02 14:13:27 +02:00
yuri
4b24491fe4 fix mass email 2017-02-02 12:44:05 +02:00
yuri
96458ab26a admin iframe height 2017-02-02 12:38:40 +02:00
yuri
494227324a formula field fix 2017-02-02 11:59:08 +02:00
yuri
6d4b3f24cb fix formula 2017-02-02 11:18:25 +02:00
yuri
a26436d3de fix formula field 2017-02-01 15:55:38 +02:00
yuri
741f7f65c2 formula fix 2017-02-01 12:12:10 +02:00
yuri
cd6da3ba87 fix formula 2017-02-01 12:05:57 +02:00
yuri
ba0a79cc9b year 2017 2017-02-01 11:43:56 +02:00
yuri
c76823f9ee fix timeline 2017-02-01 11:14:43 +02:00
yuri
5b777d3f1e fix default schedulings 2017-01-31 15:30:17 +02:00
yuri
4f19109ba1 duration sortable 2017-01-31 14:29:40 +02:00
yuri
7f3b874061 fix array search 2017-01-31 12:22:36 +02:00
yuri
d9315763a6 v 2017-01-31 11:53:21 +02:00
yuri
c732f30e40 resize admin iframe 2017-01-31 11:46:32 +02:00
yuri
793cb4b878 installer theme 2017-01-31 11:38:48 +02:00
yuri
85c476c548 hazyblue horizontal theme 2017-01-31 11:34:32 +02:00
yuri
da7635f68f diff 2017-01-27 15:50:41 +02:00
yuri
2fc66f14f3 field manager: fix default date 2017-01-27 15:10:58 +02:00
yuri
6623d9fa8b change install footer 2017-01-27 12:09:26 +02:00
yuri
774984a5a4 fix field manager tpl 2017-01-26 16:54:19 +02:00
yuri
30dec6bc02 fix css 2017-01-26 15:34:10 +02:00
yuri
3e56a1117d mass email filters 2017-01-26 15:08:12 +02:00
yuri
c28d680bf4 fix labels 2017-01-26 12:46:38 +02:00
yuri
89aa2950fa fix person name 2017-01-26 12:45:03 +02:00
yuri
d1c13bf03f css 2017-01-26 12:44:55 +02:00
yuri
5dc79086b7 fix attachment 2017-01-26 10:54:04 +02:00
yuri
406d241bc8 fix css 2017-01-25 14:57:21 +02:00
yuri
021760d75f fix css 2017-01-25 14:53:17 +02:00
yuri
77bae5a5e2 error message 2017-01-25 13:56:04 +02:00
yuri
d2cacdc8d9 text field fix 2017-01-25 11:12:59 +02:00
yuri
30097c32b5 fix list view 2017-01-24 17:35:56 +02:00
yuri
c114e08541 fix css 2017-01-24 16:00:26 +02:00
yuri
bf660e81ae css fix 2017-01-24 11:18:54 +02:00
yuri
cf9c4ec0b1 word wrapping in list view 2017-01-23 17:15:50 +02:00
yuri
7649f4d680 user acl fixes 2017-01-23 13:27:59 +02:00
yuri
9d238d270e css fixes 2017-01-23 12:47:00 +02:00
yuri
b89a128292 default tab list and theme change 2017-01-23 12:35:53 +02:00
yuri
ac2e244b11 fix notification update 2017-01-20 17:19:51 +02:00
yuri
76551a59fe modal fixes 2017-01-20 15:46:07 +02:00
yuri
61c1732b9c export fix 2017-01-20 14:34:47 +02:00
yuri
c54c4e9a17 cleanup 2017-01-19 16:29:40 +02:00
yuri
9bc7cefbc5 test fix 2017-01-19 16:22:27 +02:00
yuri
9a918e5d97 after x days filter 2017-01-19 15:21:14 +02:00
yuri
5f578298b4 Merge branch 'master' of https://github.com/espocrm/espocrm 2017-01-19 12:26:36 +02:00
Alasdair Campbell
cf63b1c779 Add .editorconfig file (#373) 2017-01-19 12:26:19 +02:00
yuri
85992dde1a installer fix 2017-01-19 11:58:55 +02:00
yuri
17dac5bde8 diff change 2017-01-18 16:18:21 +02:00
yuri
3887acfbf8 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2017-01-18 16:07:45 +02:00
Taras Machyshyn
ad5a0b2060 Added support PHP 7.1 2017-01-18 16:06:06 +02:00
yuri
bb2ddb3d1d version 2017-01-18 16:05:33 +02:00
yuri
6a6e0adb57 css change 2017-01-18 15:21:59 +02:00
yuri
4fa8d9b919 ui dialog change 2017-01-18 15:21:49 +02:00
yuri
908d2f69d3 css change 2017-01-18 11:13:26 +02:00
yuri
4c3c0db2c5 theme changes 2017-01-17 15:28:15 +02:00
yuri
fb4db584c2 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2017-01-17 15:11:57 +02:00
yuri
fcf645e73f changes theme 2017-01-17 15:10:09 +02:00
Taras Machyshyn
fac5704c9e Added 2017 year 2017-01-17 15:07:08 +02:00
Taras Machyshyn
a3548bc194 Improved crontab command for scheduled jobs 2017-01-17 13:59:03 +02:00
yuri
055a7daad5 theme change 2017-01-17 13:02:24 +02:00
Taras Machyshyn
e4a8bc38df Merge branch 'hotfix/4.3.2' 2017-01-17 12:59:58 +02:00
yuri
86bd451b05 fix theme 2017-01-17 12:44:53 +02:00
yuri
1101510817 cleanup 2017-01-17 12:27:33 +02:00
yuri
01d8dddeac portal tab list 2017-01-17 12:27:21 +02:00
yuri
ee2a8d2a39 theme changes 2017-01-17 12:21:15 +02:00
yuri
d8894d6645 fix nav 2017-01-16 18:03:34 +02:00
yuri
07daf6f5a0 rename theme 2017-01-16 16:44:40 +02:00
yuri
496ede69ac navbar: more delimiter 2017-01-16 16:34:45 +02:00
yuri
6068cbf3cc fix settings page title 2017-01-16 15:57:10 +02:00
yuri
7264fce1dd Merge branch 'hotfix/4.3.2' 2017-01-13 17:45:05 +02:00
yuri
a8a1acdbd0 fix dashlet translation 2017-01-13 17:44:54 +02:00
yuri
059c43f840 slim version certain 2017-01-13 16:56:10 +02:00
yuri
a5cb393447 ditch mcrypt 2017-01-13 16:12:17 +02:00
yuri
0b98c7beb5 fix theme 2017-01-12 16:00:13 +02:00
yuri
be735e572e sortable side panels 2017-01-12 15:28:29 +02:00
yuri
807dcb7901 theme changes 2017-01-12 12:19:12 +02:00
yuri
19241aca7a smtp admin changes 2017-01-12 12:10:59 +02:00
yuri
05e1145084 fix z index 2017-01-12 12:06:44 +02:00
yuri
22972b32b4 internal smtp 2017-01-12 11:58:39 +02:00
yuri
0d89218031 theme changes 2017-01-11 17:57:27 +02:00
yuri
baa0dd91d0 theme changes 2017-01-11 16:48:42 +02:00
yuri
09c11b2d7a calendar shadow 2017-01-11 16:37:00 +02:00
yuri
bb26bc1eab theme fixes 2017-01-11 16:31:41 +02:00
yuri
26a60fb68b theme lang change 2017-01-11 15:15:05 +02:00
yuri
3cebf73464 rtl and new cool theme 2017-01-11 15:11:12 +02:00
yuri
9e8550b572 Merge branch 'master' of https://github.com/espocrm/espocrm 2017-01-10 16:05:29 +02:00
yuri
cb8b6654e7 Merge branch 'hotfix/4.3.2' 2017-01-10 16:05:03 +02:00
yuri
8969866aec fix nl in email template text field 2017-01-10 16:04:54 +02:00
Taras Machyshyn
91ba7dfaf0 Fixed warnig for preg_match for some class names 2017-01-10 15:20:16 +02:00
Mauricio Panuncio
deb4dad643 Translate es (#359)
* Translate es_ES: Globals. Admin.

* Tickets.

* Emails.

* New translations (missing).

* New translations (missing) II.

* Various.

* Opportunities: Improvement. Self-explanatory names.

* Some small fixes.

* Undo Tickets. Redo Casos.

* Fix: 'Lenguaje' to 'Idioma'.

* Fix some erros in the installation screens.

* Fix some erros in the installation screens II.

* Chamge mod

* Translate. Round 1.

* Translate ES. Stream: Actividades to Historia.

* Translate ES. Lead: Potencial to Posible Cliente.

* Translate ES. Log: Registros.

* Translate ES. Round 2.

* Translate ES. Round 3.

* Translate ES. Round 4.

* Translate ES. New translations.

* Translate ES. Fix bugs.

* Translate ES. Activity: Actividades to Actividades planeadas.

* Translate ES. Hostory: Historia to Historial de aactividades.

* Translate ES. Improvements.
2017-01-09 20:57:42 +02:00
yuri
720635d7a3 older than x days filter 2017-01-09 13:18:35 +02:00
yuri
e5e082c48b permissions 2017-01-09 12:41:52 +02:00
yuri
d8b2a13c20 mass follow/unfollow actions 2017-01-09 12:36:34 +02:00
yuri
535607e089 Merge branch 'hotfix/4.3.2' 2017-01-09 11:42:18 +02:00
yuri
20f15e749e automatically follow case by portal user 2017-01-09 11:42:09 +02:00
yuri
d14faee83d es_ES lang 2017-01-09 11:12:15 +02:00
yuri
a53ccb66c5 change permissions 2017-01-09 11:02:57 +02:00
yuri
90bc01e467 Merge branch 'master' of https://github.com/espocrm/espocrm 2017-01-09 10:50:44 +02:00
Yuri Kuznetsov
399ac5348a Revert "es_ES - Update translations to today" (#357) 2017-01-08 00:18:39 +02:00
Mauricio Panuncio
61c8a125c3 es_ES - Update translations to today (#356)
* Translate es_ES: Globals. Admin.

* Tickets.

* Emails.

* New translations (missing).

* New translations (missing) II.

* Various.

* Opportunities: Improvement. Self-explanatory names.

* Some small fixes.

* Undo Tickets. Redo Casos.

* Fix: 'Lenguaje' to 'Idioma'.

* Fix some erros in the installation screens.

* Fix some erros in the installation screens II.

* Chamge mod

* Translate. Round 1.

* Translate ES. Stream: Actividades to Historia.

* Translate ES. Lead: Potencial to Posible Cliente.

* Translate ES. Log: Registros.

* Translate ES. Round 2.

* Translate ES. Round 3.

* Translate ES. Round 4.
2017-01-07 18:13:15 +02:00
yuri
84f261752f fix calendar edit 2017-01-05 17:32:39 +02:00
ayman-alkom
ec37ea62a2 add number fields to text filter list (#354) 2017-01-05 11:25:08 +02:00
ayman-alkom
6736f15f61 add number fields to text filter list (#354) 2017-01-05 11:23:13 +02:00
Alasdair Campbell
bc64e7ffe4 Compose from email address not sorted by primary (#351) 2017-01-04 12:54:25 +02:00
Alasdair Campbell
1e51006786 Compose from email address not sorted by primary (#351) 2017-01-04 12:53:10 +02:00
yuri
7357054517 Merge branch 'hotfix/4.3.2' 2017-01-04 12:49:02 +02:00
yuri
b25ff943e4 fix pdf footer 2017-01-04 12:48:53 +02:00
yuri
4446bc520b about 2017-01-03 12:58:18 +02:00
yuri
924d55de6e Merge branch 'hotfix/4.3.2' 2017-01-03 12:29:07 +02:00
yuri
eab9705e08 fix calendar 2017-01-03 12:28:56 +02:00
yuri
25ccc9f685 fix orm 2017-01-03 12:24:12 +02:00
yuri
62894366e6 fix opp stage change 2016-12-30 15:50:52 +02:00
yuri
d06c3f82c3 naming 2016-12-30 15:39:35 +02:00
yuri
a0fd9e05e8 read only param 2016-12-29 17:24:35 +02:00
yuri
dd3e52f230 metadata unset formula 2016-12-29 16:23:46 +02:00
yuri
af60f82322 formula ui 2016-12-29 16:17:54 +02:00
Taras Machyshyn
2e8e466a22 Unit tests fixes 2016-12-29 13:38:29 +02:00
yuri
a3ad4130af Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2016-12-29 13:37:49 +02:00
yuri
37f718f26e formula dev 2016-12-29 13:37:36 +02:00
Taras Machyshyn
c7e46ecc03 Unit tests fixes 2016-12-27 16:07:40 +02:00
yuri
1e368757ec fix dynamic logic isEmpty 2016-12-27 15:29:07 +02:00
yuri
54122e6ea2 fix dynamic logic isEmpty 2016-12-27 15:28:50 +02:00
yuri
9e3096b674 date/datetime default values 2016-12-27 15:24:14 +02:00
yuri
f0dbe8b78b field manager: opporunity probabilities 2016-12-27 12:42:45 +02:00
yuri
ab89b3c91b Merge branch 'hotfix/4.3.2' 2016-12-27 11:16:26 +02:00
yuri
54e0ee08e6 field manager: enum default 2016-12-27 11:16:14 +02:00
yuri
803e06c019 formula substring 2016-12-26 16:46:14 +02:00
yuri
2057fd7357 Merge branch 'hotfix/4.3.2' 2016-12-26 16:27:51 +02:00
yuri
2561660cf4 fix notice 2016-12-26 16:27:44 +02:00
yuri
e382c59556 formula field 2016-12-26 15:54:07 +02:00
yuri
a003efe7c9 Merge branch 'hotfix/4.3.2' 2016-12-26 11:15:55 +02:00
yuri
1975d16f3a orm: fix issue with bool column in relation table 2016-12-26 11:15:45 +02:00
yuri
da74c37ab1 Merge branch 'hotfix/4.3.1' 2016-12-23 17:15:28 +02:00
yuri
6094c69fc1 formula null 2016-12-23 13:09:36 +02:00
yuri
a11c6a23c4 formula ui 1 2016-12-23 12:52:00 +02:00
yuri
52afd6f11c Merge branch 'hotfix/4.3.1' 2016-12-22 17:23:48 +02:00
yuri
36ade17f67 formula item 2016-12-22 17:02:54 +02:00
yuri
39219b6b78 Merge branch 'hotfix/4.3.1' 2016-12-21 17:40:36 +02:00
yuri
83f78cc02c Merge branch 'hotfix/4.3.1' 2016-12-21 16:07:11 +02:00
yuri
003e884056 Merge branch 'hotfix/4.3.1' 2016-12-21 12:33:26 +02:00
yuri
f425584822 Merge branch 'hotfix/4.3.1' 2016-12-21 12:08:35 +02:00
yuri
569b995a94 Merge branch 'hotfix/4.3.1' 2016-12-21 12:00:43 +02:00
yuri
472e1ece5a Merge branch 'hotfix/4.3.1' 2016-12-20 17:52:44 +02:00
yuri
d2faec45bb close modal on location change 2016-12-20 16:10:33 +02:00
yuri
480772e022 change css list view 2016-12-20 15:17:17 +02:00
yuri
e7bd4c1790 select records create change 2016-12-20 14:37:30 +02:00
yuri
5910b28362 css modal list cache 2016-12-20 14:29:01 +02:00
yuri
a3c32d8389 css modal changes 2016-12-20 14:21:44 +02:00
yuri
e2b0bba6e6 portal users 2016-12-20 14:01:13 +02:00
yuri
4813657568 Merge branch 'hotfix/4.3.1' 2016-12-19 11:56:23 +02:00
yuri
fb87926318 cleanup 2016-12-16 16:43:39 +02:00
yuri
623d94b77f change 2016-12-16 16:34:40 +02:00
yuri
74ad0cab35 fix detailsmall edit small 2016-12-16 16:22:27 +02:00
yuri
4f81706b92 Merge branch 'hotfix/4.3.1' 2016-12-16 15:01:29 +02:00
yuri
3249c07bcd Merge branch 'hotfix/4.3.1' 2016-12-16 12:14:28 +02:00
yuri
9bfe12587f formula hook order change 2016-12-15 17:35:58 +02:00
yuri
91d4b26c1c formula 2016-12-15 16:52:29 +02:00
1450 changed files with 32520 additions and 1934 deletions

11
.editorconfig Normal file
View File

@@ -0,0 +1,11 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

4
.gitignore vendored
View File

@@ -14,6 +14,10 @@
/client/css/sakura-vertical.css
/client/css/violet.css
/client/css/violet-vertical.css
/client/css/espo-rtl.css
/client/css/hazyblue.css
/client/css/hazyblue-vertical.css
/tests/unit/testData/cache/*
!/tests/unit/testData/cache/.data
/tests/integration/config.php

0
.htaccess Executable file → Normal file
View File

View File

@@ -2,7 +2,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
@@ -76,6 +76,30 @@ module.exports = function (grunt) {
'client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
}
},
espoRtl: {
options: {
yuicompress: true
},
files: {
'client/css/espo-rtl.css': 'frontend/less/espo-rtl/main.less'
}
},
hazyblueVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/hazyblue-vertical.css': 'frontend/less/hazyblue-vertical/main.less',
}
},
hazyblue: {
options: {
yuicompress: true,
},
files: {
'client/css/hazyblue.css': 'frontend/less/hazyblue/main.less',
}
},
sakura: {
options: {
yuicompress: true,

0
api/v1/.htaccess Executable file → Normal file
View File

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

0
api/v1/portal-access/.htaccess Executable file → Normal file
View File

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

0
api/v1/portal-access/web.config Executable file → Normal file
View File

0
api/v1/web.config Executable file → Normal file
View File

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
@@ -292,5 +292,23 @@ class EntityManager extends \Espo\Core\Controllers\Base
return true;
}
public function postActionFormula($params, $data, $request)
{
if (empty($data['scope'])) {
throw new BadRequest();
}
if (!array_key_exists('data', $data)) {
throw new BadRequest();
}
$formulaData = get_object_vars($data['data']);
$this->getContainer()->get('entityManagerUtil')->setFormulaData($data['scope'], $formulaData);
$this->getContainer()->get('dataManager')->clearCache();
return true;
}
}

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
@@ -25,15 +25,28 @@
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
class Metadata extends \Espo\Core\Controllers\Base
{
public function actionRead($params, $data)
{
return $this->getMetadata()->getAll(true);
$data = $this->getMetadata()->getAll();
unset($data['formula']);
return $data;
}
public function getActionGet($params, $data, $request)
{
if (!$this->getUser()->isAdmin()) {
throw new \Forbidden();
}
$key = $request->get('key');
return $this->getMetadata()->get($key, false);
}
}

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
@@ -43,6 +43,10 @@ class Notification extends \Espo\Core\Controllers\Record
$maxSize = intval($request->get('maxSize'));
$after = $request->get('after');
if (empty($maxSize)) {
$maxSize = self::MAX_SIZE_LIMIT;
}
$params = array(
'offset' => $offset,
'maxSize' => $maxSize,

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
@@ -168,6 +168,9 @@ class Record extends Base
if ($request->get('boolFilterList')) {
$params['boolFilterList'] = $request->get('boolFilterList');
}
if ($request->get('filterList')) {
$params['filterList'] = $request->get('filterList');
}
}
public function actionListLinked($params, $data, $request)
@@ -311,9 +314,7 @@ class Record extends Base
$params['ids'] = $data['ids'];
}
$idsRemoved = $this->getRecordService()->massRemove($params);
return $idsRemoved;
return $this->getRecordService()->massRemove($params);
}
public function actionCreateLink($params, $data, $request)
@@ -461,5 +462,31 @@ class Record extends Base
return $this->getRecordService()->getDuplicateAttributes($data['id']);
}
public function postActionMassFollow($params, $data, $request)
{
if (!$this->getAcl()->check($this->name, 'stream')) {
throw new Forbidden();
}
if (array_key_exists('ids', $data)) {
$params['ids'] = $data['ids'];
}
return $this->getRecordService()->massFollow($params);
}
public function postActionMassUnfollow($params, $data, $request)
{
if (!$this->getAcl()->check($this->name, 'stream')) {
throw new Forbidden();
}
if (array_key_exists('ids', $data)) {
$params['ids'] = $data['ids'];
}
return $this->getRecordService()->massUnfollow($params);
}
}

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -3,7 +3,7 @@
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify

View File

@@ -0,0 +1,80 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
class AttributeFetcher
{
private $relatedEntitiesCacheMap = array();
public function __construct()
{
}
public function fetch(Entity $entity, $attribute, $getFetchedAttribute = false)
{
if (!is_string($attribute)) {
throw new Error();
}
if (strpos($attribute, '.') !== false) {
$arr = explode('.', $attribute);
$key = $this->buildKey($entity, $arr[0]);
if (!array_key_exists($key, $this->relatedEntitiesCacheMap)) {
$this->relatedEntitiesCacheMap[$key] = $entity->get($arr[0]);
}
$relatedEntity = $this->relatedEntitiesCacheMap[$key];
if ($relatedEntity && ($relatedEntity instanceof Entity) && count($arr) > 0) {
return $this->fetch($relatedEntity, $arr[1]);
}
return null;
}
$methodName = 'get';
if ($getFetchedAttribute) {
$methodName = 'getFetched';
}
return $entity->$methodName($attribute);
}
public function resetRuntimeCache()
{
$this->relatedEntitiesCacheMap = array();
}
protected function buildKey(Entity $entity, $link)
{
return spl_object_hash($entity) . '-' . $link;
}
}

View File

@@ -0,0 +1,66 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula;
use \Espo\Core\Exceptions\Error;
class Evaluator
{
private $functionFactory;
private $formula;
private $parser;
private $parsedHash;
public function __construct($container = null, array $functionClassNameMap = array(), array $parsedHash = array())
{
$this->functionFactory = new \Espo\Core\Formula\FunctionFactory($container, $functionClassNameMap);
$this->formula = new \Espo\Core\Formula\Formula($this->functionFactory);
$this->parser = new \Espo\Core\Formula\Parser();
$this->parsedHash = array();
}
public function process($expression, $entity = null, $variables = null)
{
if (!array_key_exists($expression, $this->parsedHash)) {
$item = $this->parser->parse($expression);
$this->parsedHash[$expression] = $item;
} else {
$item = $this->parsedHash[$expression];
}
if (!$item || !($item instanceof \StdClass)) {
throw new Error();
}
return $this->formula->process($item, $entity, $variables);
}
}

View File

@@ -0,0 +1,50 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula;
use \Espo\ORM\Entity;
class Formula
{
private $functionFactory;
public function __construct(FunctionFactory $functionFactory)
{
$this->functionFactory = $functionFactory;
}
public function process(\StdClass $item, $entity = null, $variables = null)
{
if (is_null($variables)) {
$variables = (object)[];
}
return $this->functionFactory->create($item, $entity, $variables)->process($item);
}
}

View File

@@ -0,0 +1,93 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula;
use \Espo\Core\Exceptions\Error;
use \Espo\ORM\Entity;
class FunctionFactory
{
private $container;
private $classNameMap;
public function __construct($container, $classNameMap = null)
{
$this->container = $container;
$this->attributeFetcher = new AttributeFetcher();
$this->classNameMap = $classNameMap;
}
public function create(\StdClass $item, $entity, \StdClass $variables)
{
if (!isset($item->type)) {
throw new Error('Missing type');
}
if (!is_string($item->type)) {
throw new Error('Bad type');
}
$name = $item->type;
if ($this->classNameMap && array_key_exists($name, $this->classNameMap)) {
$className = $this->classNameMap[$name];
} else {
$arr = explode('\\', $name);
foreach ($arr as $i => $part) {
if ($i < count($arr) - 1) {
$part = $part . 'Group';
}
$arr[$i] = ucfirst($part);
}
$name = implode('\\', $arr);
$className = '\\Espo\\Core\\Formula\\Functions\\' . $name . 'Type';
}
if (!class_exists($className)) {
throw new Error('Class ' . $className . ' was not found.');
}
$object = new $className($this, $entity, $variables);
$dependencyList = $object->getDependencyList();
foreach ($dependencyList as $name) {
if (!$this->container) {
throw new Error('Container required but not passed.');
}
$object->inject($name, $this->container->get($name));
}
if (property_exists($className, 'hasAttributeFetcher')) {
$object->setAttributeFetcher($this->attributeFetcher);
}
return $object;
}
}

View File

@@ -0,0 +1,63 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
class AssignType extends Base
{
public function process(\StdClass $item)
{
if (!property_exists($item, 'value')) {
throw new Error();
}
if (!is_array($item->value)) {
throw new Error();
}
if (count($item->value) < 2) {
throw new Error();
}
$name = $this->evaluate($item->value[0]);
if (!is_string($name)) {
throw new Error();
}
$value = $this->evaluate($item->value[1]);
$this->getVariables()->$name = $value;
return $value;
}
}

View File

@@ -0,0 +1,67 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
class AttributeType extends Base
{
static public $hasAttributeFetcher = true;
protected $attributeFetcher;
public function setAttributeFetcher(\Espo\Core\Formula\AttributeFetcher $attributeFetcher)
{
$this->attributeFetcher = $attributeFetcher;
}
public function process(\StdClass $item)
{
if (!property_exists($item, 'value')) {
throw new Error();
}
if (is_array($item->value)) {
$arr = [];
foreach ($item->value as $attribute) {
$arr[] = $this->getAttributeValue($attribute);
}
return $arr;
}
return $this->getAttributeValue($item->value);
}
protected function getAttributeValue($attribute)
{
return $this->attributeFetcher->fetch($this->getEntity(), $attribute);
}
}

View File

@@ -0,0 +1,113 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions;
use \Espo\Core\Interfaces\Injectable;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
abstract class Base implements Injectable
{
protected $dependencyList = [];
protected $itemFactory;
protected $injections = array();
private $entity;
private $variables;
public function inject($name, $object)
{
$this->injections[$name] = $object;
}
protected function init()
{
}
protected function getInjection($name)
{
return $this->injections[$name];
}
protected function addDependency($name)
{
$this->dependencyList[] = $name;
}
protected function addDependencyList(array $list)
{
foreach ($list as $item) {
$this->addDependency($item);
}
}
public function getDependencyList()
{
return $this->dependencyList;
}
protected function getVariables()
{
return $this->variables;
}
protected function getEntity()
{
if (!$this->entity) {
throw new Error('Entity required but not passed.');
}
return $this->entity;
}
public function __construct($itemFactory, $entity = null, $variables = null)
{
$this->itemFactory = $itemFactory;
$this->entity = $entity;
$this->variables = $variables;
$this->init();
}
protected function getFactory()
{
return $this->itemFactory;
}
protected function evaluate($item)
{
$function = $this->getFactory()->create($item, $this->entity, $this->variables);
return $function->process($item);
}
public abstract function process(\StdClass $item);
}

View File

@@ -0,0 +1,51 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
class BundleType extends Base
{
public function process(\StdClass $item)
{
if (!property_exists($item, 'value')) {
return true;
}
if (!is_array($item->value)) {
throw new Error();
}
foreach ($item->value as $value) {
$this->evaluate($value);
}
}
}

View File

@@ -0,0 +1,64 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\ORM\Entity;
use \Espo\Core\Exceptions\Error;
abstract class Base extends \Espo\Core\Formula\Functions\Base
{
public function process(\StdClass $item)
{
if (!property_exists($item, 'value')) {
throw new Error();
}
if (!is_array($item->value)) {
throw new Error('Value is not array.');
}
if (count($item->value) < 2) {
throw new Error('Bad value.');
}
if (is_object($item->value[0])) {
$left = $this->evaluate($item->value[0]);
} else {
$left = $item->value[0];
}
if (is_object($item->value[1])) {
$right = $this->evaluate($item->value[1]);
} else {
$right = $item->value[1];
}
return $this->compare($left, $right);
}
}

View File

@@ -0,0 +1,55 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\Core\Exceptions\Error;
class EqualsType extends Base
{
protected function compare($left, $right)
{
if (is_array($left) && is_array($right)) {
$result = true;
foreach ($left as $i => $value) {
if (!array_key_exists($i, $right)) {
$result = false;
break;
}
if ($value !== $right[$i]) {
$result = false;
break;
}
}
return $result;
}
return $left === $right;
}
}

View File

@@ -0,0 +1,40 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\Core\Exceptions\Error;
class GreaterThanOrEqualsType extends Base
{
protected function compare($left, $right)
{
return $left >= $right;
}
}

View File

@@ -0,0 +1,40 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\Core\Exceptions\Error;
class GreaterThanType extends Base
{
protected function compare($left, $right)
{
return $left > $right;
}
}

View File

@@ -0,0 +1,40 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\Core\Exceptions\Error;
class LessThanOrEqualsType extends Base
{
protected function compare($left, $right)
{
return $left <= $right;
}
}

View File

@@ -0,0 +1,40 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2017 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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Formula\Functions\ComparisonGroup;
use \Espo\Core\Exceptions\Error;
class LessThanType extends Base
{
protected function compare($left, $right)
{
return $left < $right;
}
}

Some files were not shown because too many files have changed in this diff Show More