Compare commits
930 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09e364625d | |||
| 35f575ed7f | |||
| 7b0d46b37f | |||
| f474137b91 | |||
| 7a18d88c50 | |||
| 8d1c9fe666 | |||
| e6566bccdc | |||
| 14ed7282f3 | |||
| b13145adce | |||
| 3cfca9845a | |||
| afa8d07bb4 | |||
| 02434e0ca1 | |||
| 11f76c507b | |||
| c68f3eb44d | |||
| 6a1d8dcdca | |||
| ba358e5847 | |||
| 5e174fd5a9 | |||
| 9af2500292 | |||
| 8e9dea260e | |||
| 29ed6cb3b0 | |||
| 4670bb49e8 | |||
| fcc18befc3 | |||
| 52ac9b1621 | |||
| 9bca545f01 | |||
| 80032f8ed7 | |||
| a63a690307 | |||
| 24dc2716f7 | |||
| 3f40896374 | |||
| 8d8778b397 | |||
| 68d3b422cc | |||
| 145420aaaa | |||
| 34ee17b7f5 | |||
| 2a0646d1dd | |||
| 52620e84cd | |||
| 4747113742 | |||
| f26d7c6a62 | |||
| 2e0d8cfd43 | |||
| db57c53652 | |||
| badf1aec6f | |||
| 19bb4514df | |||
| 778be7fea8 | |||
| 326970bcd4 | |||
| 9411bce8b0 | |||
| 244c1a426b | |||
| b3f9ca8721 | |||
| 8c66a83054 | |||
| df6a1f6613 | |||
| 1033a926fc | |||
| d339c04177 | |||
| edcf0aae84 | |||
| 20f97caab3 | |||
| 86be4e7352 | |||
| 697e271e66 | |||
| 5f74504da8 | |||
| fb3d46d389 | |||
| 875971fb6e | |||
| 1939a58f17 | |||
| 40b3374fdd | |||
| c564b1b75a | |||
| c28e73ce3f | |||
| 788a6bfdc3 | |||
| 15d1f79115 | |||
| bf699d88f7 | |||
| d7f8e4e050 | |||
| 3872d7897a | |||
| 17a1f6ce63 | |||
| eaa155eff7 | |||
| 13fba6d71c | |||
| 0d423aa349 | |||
| 2fca224ba4 | |||
| 574f85df46 | |||
| b7176983e2 | |||
| e8f19ff0dc | |||
| d3cb4607ea | |||
| 8ae0696f07 | |||
| 299c3c13fc | |||
| a79a8bcef6 | |||
| 2a0dd46b5e | |||
| 6c287bc2e2 | |||
| 7add59ffcb | |||
| 9747c43988 | |||
| 8b9a0f1437 | |||
| 1315ca007c | |||
| e753d767fc | |||
| db893859c2 | |||
| 16af3d2ad8 | |||
| f334080fe6 | |||
| b2acfbed98 | |||
| 2aca6ca28a | |||
| c96040edec | |||
| e0ebb44e64 | |||
| ee1af88f8d | |||
| 1659e583ea | |||
| 6f0575d798 | |||
| ba05c45f47 | |||
| 353caf29b3 | |||
| 7600d473bb | |||
| c9ff48245e | |||
| 4ed4a94209 | |||
| c88e01fe75 | |||
| 9e46edce79 | |||
| bae5c67839 | |||
| 635d5d9c6c | |||
| 65be8c385f | |||
| c3d44e2472 | |||
| 4a781ed5f4 | |||
| d9995512a1 | |||
| 6ed2466785 | |||
| 724c74b488 | |||
| 67887c5ba4 | |||
| ea2a0068ed | |||
| 0bfdea5976 | |||
| 305ebc293f | |||
| f17f74672e | |||
| fcaf184b13 | |||
| efe653f1f6 | |||
| c1022bf8f3 | |||
| 0f4c3988f8 | |||
| 498b7b5679 | |||
| ca445a3cb7 | |||
| 8a293749e0 | |||
| 5c034279e8 | |||
| 9460943ad2 | |||
| 5eaeabe231 | |||
| 2202b00600 | |||
| 68ba5a5c4a | |||
| e80b490152 | |||
| 380937b644 | |||
| ac72305101 | |||
| a41779b0bb | |||
| 86cdbf24b7 | |||
| 5d7bc98088 | |||
| 1359e8eb2f | |||
| f3a7003444 | |||
| 624f76b1a0 | |||
| 484ffa071c | |||
| 850fb3cb15 | |||
| 40075ed2e3 | |||
| f68bb4b491 | |||
| 473e1109b4 | |||
| c4b8b90ff5 | |||
| 70b4017353 | |||
| e6f7bf4d6c | |||
| 69385519d7 | |||
| 235ee7c383 | |||
| a6dba9f09a | |||
| f1352430b9 | |||
| b9b63a8a7c | |||
| 5358bf4a43 | |||
| 1c7a7d8147 | |||
| ca055e8ca9 | |||
| 081c058229 | |||
| a5c941b1b2 | |||
| d43e63b89e | |||
| 102886e23d | |||
| 3b8b9e392e | |||
| 226152135d | |||
| 7f6a5b626e | |||
| c5fa26ffcb | |||
| 7b2bbcfd05 | |||
| e5b336d4f3 | |||
| 2d786d9660 | |||
| a587efddde | |||
| 81dd2bc800 | |||
| b1273176a9 | |||
| 46beb8b6b7 | |||
| 264efa2e8d | |||
| f538f05ec3 | |||
| 069a50c717 | |||
| 08f1329868 | |||
| e48043c2e8 | |||
| 024aeb6d01 | |||
| c79ef63c4d | |||
| 54798b94c9 | |||
| f70f22c503 | |||
| 33adc65dac | |||
| a6541f6f21 | |||
| 0b44fee0e5 | |||
| d03aec270e | |||
| 08bca7daf7 | |||
| d5cb1f5c1b | |||
| 68b16d3de9 | |||
| daffa60cd4 | |||
| 25cb6cdfb3 | |||
| 7afecc4cdd | |||
| 0e9373cf5e | |||
| 7992b78d4e | |||
| fed5e6ded7 | |||
| 82ddd2e562 | |||
| 1470cea4ed | |||
| 43e8929368 | |||
| 6db3600a4b | |||
| 9b2324755b | |||
| dc77b3c73e | |||
| 7627afb7d2 | |||
| e68ad81d57 | |||
| 73b84d720a | |||
| 0743582ef6 | |||
| f73d26fcf3 | |||
| b1dd9f30fb | |||
| 27071695cb | |||
| 1f551b6052 | |||
| 947ebbb6f5 | |||
| 3a706cad86 | |||
| 8cb1709966 | |||
| 7533fc337e | |||
| 601f908992 | |||
| ff72489f39 | |||
| db442e0769 | |||
| 189bbd784d | |||
| 2940de57b6 | |||
| cceb9eccc3 | |||
| 410ba24bef | |||
| 292e90e6b7 | |||
| 3f9b229a9e | |||
| 05c2270f36 | |||
| f22fdd6724 | |||
| 8059669a21 | |||
| 28a8ad927a | |||
| 6f7d27a5fd | |||
| d89a173a41 | |||
| ba5fef320e | |||
| a7982acc8f | |||
| 17742fccf1 | |||
| 7a2b563cd4 | |||
| 549984d1ed | |||
| d9256074fe | |||
| 97be52a0bc | |||
| 26a4d24492 | |||
| 03dad5a178 | |||
| 4c0453d0e3 | |||
| 1299853961 | |||
| e6d792ef5a | |||
| e8e8d0d7b2 | |||
| cec0c7b374 | |||
| fd73a0b8a5 | |||
| 120ff8543e | |||
| 7b8fa73474 | |||
| 85164758ce | |||
| 8a38568617 | |||
| 0c9e795dfd | |||
| ee1a50aa16 | |||
| a13b6af04a | |||
| f847535aea | |||
| b1b03c6dc1 | |||
| eeb10c6bce | |||
| 05241cefa5 | |||
| 1861e2cd87 | |||
| 8a17cbe23c | |||
| 484458c2ba | |||
| c62cc15159 | |||
| 17f8b09782 | |||
| 9fd05672ae | |||
| 69d96450da | |||
| 7393040c12 | |||
| 9097e644d4 | |||
| 837b1691d1 | |||
| 2cdec34062 | |||
| a33e10e92d | |||
| 86631117a2 | |||
| 05dfcf7511 | |||
| 3e1582bd6b | |||
| 743f348fcf | |||
| 2b2ac2a76d | |||
| a7d2d41b0f | |||
| 6ef0081ace | |||
| 4f3304d55f | |||
| 47b6093752 | |||
| ea8d930e56 | |||
| 79f3d86384 | |||
| fff201b7cd | |||
| 1ad454ce0b | |||
| e090fe699b | |||
| f677b5614b | |||
| f7b240e6a9 | |||
| ea3a60aaf7 | |||
| 6a7cfa58ae | |||
| 482f0cc314 | |||
| 28ada61f3d | |||
| 7057210e90 | |||
| 8c5bc59c45 | |||
| b7370ff238 | |||
| fb36f769d9 | |||
| f07b728851 | |||
| 7d4ada7ec2 | |||
| 1c31a6689f | |||
| a839144796 | |||
| 87cbe603d2 | |||
| ec96916013 | |||
| 2c811a4faa | |||
| 6e089c1e25 | |||
| 2e203341b7 | |||
| 5bea143bf0 | |||
| 732494e251 | |||
| 39e1303cbe | |||
| 62c3549004 | |||
| 9bcc942f0f | |||
| e34ee34d7b | |||
| dedef4b36f | |||
| e6f6e0fcf1 | |||
| 11a9e2ab9c | |||
| 9077542f61 | |||
| cb6faaa769 | |||
| a209d5aaaf | |||
| 767cdc75ee | |||
| 3eef0e088a | |||
| 1e5ef6a070 | |||
| a2edc3cf4e | |||
| 9a5dc7b4d1 | |||
| 7b0fd40d3e | |||
| 169df31cab | |||
| 44b0ba2f33 | |||
| 8d70956607 | |||
| 5ad20c8666 | |||
| 790d4a88b5 | |||
| b72ac42068 | |||
| 0a379be049 | |||
| e0e08a1c17 | |||
| 0d825120bb | |||
| 7b81b66b76 | |||
| d39f4e2533 | |||
| 598a2f9f05 | |||
| ce9089b838 | |||
| 45b06fc154 | |||
| f44177a994 | |||
| d91b13a7c1 | |||
| bd1894322c | |||
| 90874535ea | |||
| 8c919dbca4 | |||
| 05223c5272 | |||
| afee6d564b | |||
| b4e879a369 | |||
| de4d96e260 | |||
| 89056f61c2 | |||
| afac29151c | |||
| e54430fb1b | |||
| 7d8736b98c | |||
| 216e9419d4 | |||
| 359fdd4dab | |||
| 2044a87630 | |||
| 171feed28e | |||
| 92dbbbd390 | |||
| 3166cb862e | |||
| b606cb2e04 | |||
| 724ef00d52 | |||
| 0b7857b495 | |||
| a150eb7f0e | |||
| 4cb21a4fdb | |||
| 46e13b0269 | |||
| d4d5138991 | |||
| 9fd00d9f0a | |||
| 9361938285 | |||
| cb054b2f2b | |||
| f8ff6e6cf5 | |||
| 918c1b2114 | |||
| 2026bcb021 | |||
| ce5393155a | |||
| 6f4b752b10 | |||
| 2a5a453517 | |||
| 191bba7afc | |||
| f50d2ef9e3 | |||
| 1ad744d151 | |||
| ba0f86c8d4 | |||
| 372c84bfa3 | |||
| 6ec18950e4 | |||
| 6c3168a356 | |||
| 109ee17a47 | |||
| 21702b3c34 | |||
| 159a2ee99d | |||
| d6151d33b4 | |||
| 2217e03fa8 | |||
| 794c7eb523 | |||
| 98f61c0c4b | |||
| 5f5a450d95 | |||
| 0ba9679a75 | |||
| 85e60d4e32 | |||
| a074b8a214 | |||
| ac593c1d3d | |||
| 170e62bc8b | |||
| 5d19ae42dc | |||
| 9f3fdd01bf | |||
| 65e94e237d | |||
| 7935bc59fe | |||
| f49677b5c0 | |||
| b69f829a3e | |||
| 13dfc90a1b | |||
| 6d49d39480 | |||
| f473ea9cea | |||
| db8536ac55 | |||
| e402745a86 | |||
| abcaaddc2f | |||
| 3ac375c95c | |||
| 56f65e0fc0 | |||
| 471df0034e | |||
| a1b3be9ef3 | |||
| c4f70482ac | |||
| 31a8fa387d | |||
| a0d6cb9be4 | |||
| 4586d26bd6 | |||
| 1609adc766 | |||
| aa0a9cf708 | |||
| d7dfe5fea4 | |||
| 340ed5acec | |||
| 7ec3e38e6d | |||
| 879bf13809 | |||
| 4edf4ef9ea | |||
| b44bbaffa2 | |||
| 4b24491fe4 | |||
| 96458ab26a | |||
| 4c562cb603 | |||
| 494227324a | |||
| 8eb2be46ca | |||
| 6d4b3f24cb | |||
| a26436d3de | |||
| cd7571387c | |||
| 741f7f65c2 | |||
| 1b3496edd9 | |||
| 356da4e70d | |||
| cd6da3ba87 | |||
| ba0a79cc9b | |||
| f3deffb3f6 | |||
| c76823f9ee | |||
| 8398cc4364 | |||
| 6ddda814c0 | |||
| 5b777d3f1e | |||
| 4f19109ba1 | |||
| 76ffa2def9 | |||
| 2fdc0a3a93 | |||
| 7f3b874061 | |||
| d9315763a6 | |||
| c732f30e40 | |||
| 793cb4b878 | |||
| 85c476c548 | |||
| 0dcc8d08d1 | |||
| da7635f68f | |||
| 2fc66f14f3 | |||
| 6623d9fa8b | |||
| 774984a5a4 | |||
| 30dec6bc02 | |||
| 3e56a1117d | |||
| c28d680bf4 | |||
| 89aa2950fa | |||
| d1c13bf03f | |||
| 5dc79086b7 | |||
| 406d241bc8 | |||
| 021760d75f | |||
| 77bae5a5e2 | |||
| d2cacdc8d9 | |||
| 30097c32b5 | |||
| c114e08541 | |||
| bf660e81ae | |||
| cf9c4ec0b1 | |||
| 7649f4d680 | |||
| 9d238d270e | |||
| b89a128292 | |||
| ac2e244b11 | |||
| 76551a59fe | |||
| 61c1732b9c | |||
| c54c4e9a17 | |||
| 9bc7cefbc5 | |||
| 9a918e5d97 | |||
| 5f578298b4 | |||
| cf63b1c779 | |||
| 85992dde1a | |||
| 17dac5bde8 | |||
| 3887acfbf8 | |||
| ad5a0b2060 | |||
| bb2ddb3d1d | |||
| 6a6e0adb57 | |||
| 4fa8d9b919 | |||
| 908d2f69d3 | |||
| 4c3c0db2c5 | |||
| fb4db584c2 | |||
| fcf645e73f | |||
| fac5704c9e | |||
| a3548bc194 | |||
| 055a7daad5 | |||
| e4a8bc38df | |||
| 86bd451b05 | |||
| 1101510817 | |||
| 01d8dddeac | |||
| ee2a8d2a39 | |||
| d8894d6645 | |||
| 07daf6f5a0 | |||
| 496ede69ac | |||
| 6068cbf3cc | |||
| 7264fce1dd | |||
| a8a1acdbd0 | |||
| 059c43f840 | |||
| a5cb393447 | |||
| 0b98c7beb5 | |||
| be735e572e | |||
| 807dcb7901 | |||
| 19241aca7a | |||
| 05e1145084 | |||
| 22972b32b4 | |||
| 0d89218031 | |||
| baa0dd91d0 | |||
| 09c11b2d7a | |||
| bb26bc1eab | |||
| 26a60fb68b | |||
| 3cebf73464 | |||
| 9e8550b572 | |||
| cb8b6654e7 | |||
| 8969866aec | |||
| 91ba7dfaf0 | |||
| deb4dad643 | |||
| 720635d7a3 | |||
| e5e082c48b | |||
| d8b2a13c20 | |||
| 535607e089 | |||
| 20f15e749e | |||
| d14faee83d | |||
| a53ccb66c5 | |||
| 90bc01e467 | |||
| 399ac5348a | |||
| 61c8a125c3 | |||
| 84f261752f | |||
| ec37ea62a2 | |||
| 6736f15f61 | |||
| bc64e7ffe4 | |||
| 1e51006786 | |||
| 7357054517 | |||
| b25ff943e4 | |||
| 4446bc520b | |||
| 924d55de6e | |||
| eab9705e08 | |||
| 25ccc9f685 | |||
| 62894366e6 | |||
| d06c3f82c3 | |||
| a0fd9e05e8 | |||
| dd3e52f230 | |||
| af60f82322 | |||
| 2e8e466a22 | |||
| a3ad4130af | |||
| 37f718f26e | |||
| c7e46ecc03 | |||
| 1e368757ec | |||
| 54122e6ea2 | |||
| 9e3096b674 | |||
| f0dbe8b78b | |||
| ab89b3c91b | |||
| 54e0ee08e6 | |||
| 803e06c019 | |||
| 2057fd7357 | |||
| 2561660cf4 | |||
| e382c59556 | |||
| a003efe7c9 | |||
| 1975d16f3a | |||
| da74c37ab1 | |||
| 3df9c7eb02 | |||
| 5951ac930a | |||
| 7160c0a65b | |||
| 19a9b5c91e | |||
| b6d1f26af0 | |||
| 6094c69fc1 | |||
| a11c6a23c4 | |||
| 52afd6f11c | |||
| 0c10657351 | |||
| 36ade17f67 | |||
| 469e35d8a0 | |||
| 39219b6b78 | |||
| 977b8fa8e9 | |||
| 7e0604409a | |||
| 83f78cc02c | |||
| c21ec8d5f2 | |||
| 41c566e227 | |||
| ae82ebbf74 | |||
| 177018daae | |||
| 003e884056 | |||
| 5f481fa2dd | |||
| f425584822 | |||
| 8c1142481d | |||
| 569b995a94 | |||
| d20a26680a | |||
| 472e1ece5a | |||
| 84c56256f7 | |||
| 632467a9a6 | |||
| d2faec45bb | |||
| 480772e022 | |||
| e7bd4c1790 | |||
| 5910b28362 | |||
| a3c32d8389 | |||
| e2b0bba6e6 | |||
| 4813657568 | |||
| 2989181723 | |||
| 5df8d833d5 | |||
| 449fc4cddc | |||
| fb87926318 | |||
| 623d94b77f | |||
| 74ad0cab35 | |||
| 4f81706b92 | |||
| 4e61bd6048 | |||
| 252ae4e18f | |||
| 3249c07bcd | |||
| 3def2ef0da | |||
| cb0321aa20 | |||
| 1096f719ae | |||
| 9bfe12587f | |||
| 91d4b26c1c | |||
| ef317064b4 | |||
| fa3b4f3ac2 | |||
| 052c489bf7 | |||
| f3402e2c4e | |||
| 34a3cd9ce5 | |||
| 4d5f3bcbfe | |||
| 339e1dc897 | |||
| c4e617f18e | |||
| 89bc329ea6 | |||
| eee49b215e | |||
| d9a8b83268 | |||
| def7abe3ba | |||
| 75e64b3836 | |||
| efb106c597 | |||
| 5e1087c6b4 | |||
| 5f8800defa | |||
| 445c0b3834 | |||
| 61c1e5ab6c | |||
| 2502cad0c1 | |||
| 76032493b9 | |||
| 0a3a6b3773 | |||
| 014d47d017 | |||
| 8bd7734ae3 | |||
| 7aa2ba917f | |||
| 96f0ce2381 | |||
| f1eb5b9862 | |||
| 45cb5a6e38 | |||
| 4131ea54ae | |||
| 3806affe1b | |||
| 6ea3a03de3 | |||
| 5b25e8b7e6 | |||
| 60c96ba5f7 | |||
| 9732852891 | |||
| 326b46a6e6 | |||
| 29924ea3b1 | |||
| 434506699b | |||
| eeaaaf7af1 | |||
| 3f5dab0680 | |||
| dd69658f2a | |||
| 3c2d998a30 | |||
| a0ead9d774 | |||
| 4460a105a8 | |||
| c6b369587d | |||
| 8c19ad5f7f | |||
| 1824e0d0a6 | |||
| 404bb0c3cd | |||
| 7fd6b16cf3 | |||
| 47abd1ab52 | |||
| 5c8d728ac5 | |||
| 2706bc461e | |||
| 91f52e4f42 | |||
| 5538dd45d3 | |||
| 105205a9aa | |||
| e3547717a0 | |||
| 1714e0e9a0 | |||
| afdd15ac44 | |||
| 09097dba4a | |||
| 01a8fbd5b1 | |||
| f2d5eed7e3 | |||
| cfae3cde1d | |||
| 87a0c1b293 | |||
| 486c8c8f37 | |||
| ea99ca3d38 | |||
| 2069a25f30 | |||
| baf3493044 | |||
| 543a12a475 | |||
| a73f97744a | |||
| ae135ab678 | |||
| 96366548a3 | |||
| 54cdd5180d | |||
| 0a5ce2a4d4 | |||
| a4e1ccc4bb | |||
| 55c632979e | |||
| b1208a449e | |||
| 9e2b329beb | |||
| 10d329094c | |||
| 38f44b3e5f | |||
| c99a1261d5 | |||
| 4e2e344892 | |||
| e0128bf54f | |||
| a683e6bdf8 | |||
| bc64effb14 | |||
| 6b0a280e2c | |||
| ddf25e02e3 | |||
| 967d5a6387 | |||
| a5137b85af | |||
| 1ed79fedf0 | |||
| 8a8cb08b99 | |||
| b49aaa69cc | |||
| 015357d551 | |||
| 5419d76080 | |||
| 21e1422994 | |||
| dafb076659 | |||
| 491f3d27ff | |||
| 3be58d5d09 | |||
| 8aeb23a985 | |||
| fa99040232 | |||
| 2e928f2442 | |||
| 8ebb35c0d5 | |||
| 7d17bee201 | |||
| 5c345fb4d9 | |||
| d2cd098ab0 | |||
| f4a88df067 | |||
| 8f4917eb24 | |||
| a9310b108a | |||
| 8c638dffd4 | |||
| 0151273a75 | |||
| b10dc8128c | |||
| 476d36c9c5 | |||
| 64087defd0 | |||
| 807b7bc349 | |||
| 3018c345fa | |||
| 8f35c59943 | |||
| 348332f7ca | |||
| 9ebd992222 | |||
| 9597ea0dbd | |||
| 23fb6c6e1f | |||
| ddb5033de8 | |||
| 43a49e3c31 | |||
| 5a06ee50d8 | |||
| c02f65ef81 | |||
| dbb9b20b7f | |||
| 3bfd540f53 | |||
| a971f7357f | |||
| 4918f8f985 | |||
| 988388ed16 | |||
| f1de9deb80 | |||
| 2642a6ea6e | |||
| 74b82c92d8 | |||
| ded3d112b2 | |||
| c9e7f02b23 | |||
| c7fb864e04 | |||
| 16d300445c | |||
| edc24621a6 | |||
| 17b48c0e4c | |||
| 771d58f425 | |||
| fd76459077 | |||
| 1955dff68e | |||
| 730b5fb8a9 | |||
| c1a115e2b0 | |||
| 7773e41ad4 | |||
| 304bbb62ad | |||
| 7b439ace04 | |||
| d9ef87fb90 | |||
| 2333b7a1ef | |||
| 1a00932c63 | |||
| 1f09015c86 | |||
| 5d79d8520f | |||
| dde044d8c5 | |||
| aeeb84b626 | |||
| ccb9022e16 | |||
| a9e783b5f1 | |||
| 46190df6ff | |||
| 1eb258cab7 | |||
| a3836b0091 | |||
| 7fbc9fbac8 | |||
| d0b5e2188b | |||
| dfa2d6be89 | |||
| 276941197f | |||
| 20569e4252 | |||
| 3b7f99daa1 | |||
| 5ee30d9f3f | |||
| 3cde7fa5e3 | |||
| aecb9bbdf4 | |||
| 1a95e14ee8 | |||
| 83aa07b918 | |||
| 4f8eea59fe | |||
| 248280e086 | |||
| 02b465ab8c | |||
| c9d26dc1d8 | |||
| 389b158134 | |||
| 312af9befb | |||
| b7f22bf687 | |||
| dd8082244c | |||
| 25ff7e17c1 | |||
| f4b3071a92 | |||
| 0c7b182215 | |||
| 2223a1ecf4 | |||
| f86564a580 | |||
| 58897949eb | |||
| 2dee859b2a | |||
| a9fc290627 | |||
| 12794968fc | |||
| 1b4cbb91ee | |||
| 62f1362cf6 | |||
| 49031d0b33 | |||
| 22fea07b0a | |||
| 81692371ec | |||
| a96314f0f0 | |||
| 7c554a605e | |||
| 57eeec63c1 | |||
| bd158008b2 | |||
| c0ae8d5cdd | |||
| 78347920aa | |||
| c88e662a30 | |||
| 5ae57ff5f6 | |||
| 7c74c85a66 | |||
| 07fc2123e7 | |||
| afdb47b601 | |||
| 5ea437afbb | |||
| c7041546c4 | |||
| 1d2fd21a06 | |||
| fefc003984 | |||
| 70d3bf9fff | |||
| 4a64c4b648 | |||
| 9d8fc5b8ea | |||
| 8184221d2b | |||
| 5786983d8b | |||
| 1e1468ab68 | |||
| e3f0177759 | |||
| f1fc6160fe | |||
| 38d4a39014 | |||
| 566d0c1aa0 | |||
| ce752b32fd | |||
| a61553d08b | |||
| daacb026d8 | |||
| 0ae637fba2 | |||
| b81fd66b85 | |||
| 071e94ac97 | |||
| e949a0bae6 | |||
| f7f9e2fda0 | |||
| 80a0571b0c | |||
| d91897a922 | |||
| 05180ece92 | |||
| ee8e960ce4 | |||
| 5b4a8666cd | |||
| 7240757a28 | |||
| 2a8baa2f34 | |||
| 0c44e0d101 | |||
| 63ab5b77f3 | |||
| 300198c9fa | |||
| 340af18beb | |||
| 83cff1bc42 | |||
| a75534e32a | |||
| 462eb8792c | |||
| 19f29c0401 | |||
| 27657260fc | |||
| c17fb9ab1e | |||
| d3b1114b1e | |||
| 87340e29e8 | |||
| 4f1f8d9301 | |||
| 664b294471 | |||
| 7774c12ab2 | |||
| 6592dfc4da | |||
| e823ecc178 | |||
| 74d5a737db | |||
| bf9799af66 | |||
| fc9b67672f | |||
| 6e8342511f | |||
| da2cebd765 | |||
| ef19dc3330 | |||
| 2f73a2d19b | |||
| fab257eb97 | |||
| 850c3fd696 | |||
| a619738652 | |||
| 395c575f78 | |||
| ecf8256b14 | |||
| 2d6d6a2b19 | |||
| ee404fa400 | |||
| 10fc546369 | |||
| 85b2dbac11 | |||
| 12a368054a | |||
| 0e14f2b987 | |||
| a50d97adf5 | |||
| 62e9138cf1 | |||
| 657e7f0e37 | |||
| 66d648c7d4 | |||
| 08dd77a6b6 | |||
| 037f0d4db1 | |||
| 19ff591105 | |||
| 7b1a1be366 | |||
| 1fc3ae72b5 | |||
| 991b864881 | |||
| f95fa96ae1 | |||
| e33cdf268a | |||
| dcae13f4dc | |||
| 96ac275970 | |||
| c35985e658 | |||
| 4bc5a89ac2 | |||
| b7e14d60cc | |||
| 7164a71d88 | |||
| 6bedd86e08 | |||
| d39e99cbdd | |||
| ab3134f44a | |||
| 5aaca9921c | |||
| 9223e43b7c | |||
| 3766dd16e7 | |||
| e53aff0031 | |||
| 4a40f1fba7 | |||
| 04e9bd9de3 | |||
| ed8ed591f7 | |||
| 34ff0218b9 | |||
| 2f6c928077 | |||
| eff0152f44 | |||
| a3188ce694 | |||
| 4bf81be56f | |||
| 7c22960f42 | |||
| 3d6f90ad93 | |||
| a02aebeed2 | |||
| d06afd4def | |||
| 88e148fca8 | |||
| 2d00ef314f | |||
| 0b6a29a035 | |||
| 5feb0eb7c7 | |||
| 48cb718fbe | |||
| 13ad6ec0d0 | |||
| 9cfdb3a00b | |||
| b560254df2 | |||
| 101ed19073 | |||
| 65868fd26a | |||
| d2e5b26765 | |||
| 2cac1ea608 | |||
| 9d37e68e24 | |||
| 290a1c5b31 | |||
| ff924f666f | |||
| 8c5eb9c913 | |||
| 25e72fa6a5 | |||
| 1aeee24d97 | |||
| d8cd0d31db | |||
| e72557bb59 | |||
| b54c9a797d | |||
| 737215c599 | |||
| ced0c25a08 | |||
| 5e810d2aa3 | |||
| c9e27dd190 | |||
| c5866f3d86 | |||
| 8221f7182b | |||
| ecee739b1a | |||
| 702b47296c | |||
| 656bba1d3f |
@@ -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
|
||||
|
||||
+7
-1
@@ -14,7 +14,13 @@
|
||||
/client/css/sakura-vertical.css
|
||||
/client/css/violet.css
|
||||
/client/css/violet-vertical.css
|
||||
/tests/testData/cache/*
|
||||
/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
|
||||
composer.phar
|
||||
vendor/
|
||||
/custom/Espo/Custom/*
|
||||
+7
-1
@@ -1,3 +1,9 @@
|
||||
## Pull Requests
|
||||
|
||||
Before we can merge your pull request you need to accept our CLA [here](https://github.com/espocrm/cla). It's very simple to do.
|
||||
|
||||
[Code Style Guidelines](https://github.com/espocrm/espocrm/wiki/Code-Style-Guidelines).
|
||||
[Code Style Guidelines](https://github.com/espocrm/espocrm/wiki/Code-Style-Guidelines).
|
||||
|
||||
## Issues
|
||||
|
||||
We don't provide developer help or any kind of support on github. Please use our [forum](http://forum.espocrm.com/) for this.
|
||||
|
||||
+25
-1
@@ -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,
|
||||
|
||||
@@ -8,14 +8,14 @@ Download the latest release from our [website](http://www.espocrm.com).
|
||||
|
||||
### Requirements
|
||||
|
||||
* PHP 5.4 or above (with pdo, json, gd, mcrypt extensions);
|
||||
* PHP 5.5 or above (with pdo, json, gd, mcrypt extensions);
|
||||
* MySQL 5.1 or above.
|
||||
|
||||
For more information about server configuration see [this article](http://blog.espocrm.com/administration/server-configuration-for-espocrm/).
|
||||
|
||||
### How to report bug
|
||||
|
||||
Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our [forum](http://forum.espocrm.com/bug-reports?routestring=forum/bug-reports).
|
||||
Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our [forum](http://forum.espocrm.com/forum/bug-reports).
|
||||
|
||||
### How to get started (for developers)
|
||||
|
||||
|
||||
Executable → Regular
+1
-1
@@ -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
|
||||
|
||||
Executable → Regular
@@ -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
|
||||
|
||||
Executable → Regular
Executable → Regular
@@ -0,0 +1,42 @@
|
||||
<?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\Acl;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class ActionHistoryRecord extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
return $entity->get('userId') === $user->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,0 +1,61 @@
|
||||
<?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\Acl;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class ScheduledJob extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'read');
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'edit');
|
||||
}
|
||||
|
||||
public function checkEntityDelete(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'delete');
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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\Acl;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Team extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkInTeam(\Espo\Entities\User $user, Entity $entity)
|
||||
{
|
||||
$userTeamIdList = $user->getLinkMultipleIdList('teams');
|
||||
return in_array($entity->id, $userTeamIdList);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,0 +1,71 @@
|
||||
<?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\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class ActionHistoryRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -63,7 +63,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
$scheduledJob = $this->getContainer()->get('scheduledJob');
|
||||
|
||||
return $scheduledJob->getAllNamesOnly();
|
||||
return $scheduledJob->getAvailableList();
|
||||
}
|
||||
|
||||
public function postActionUploadUpgradePackage($params, $data)
|
||||
|
||||
@@ -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
|
||||
@@ -60,11 +60,20 @@ class App extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
$userData['emailAddressList'] = $emailAddressList;
|
||||
|
||||
$settings = (object)[];
|
||||
foreach ($this->getConfig()->get('userItems') as $item) {
|
||||
$settings->$item = $this->getConfig()->get($item);
|
||||
}
|
||||
|
||||
unset($userData['authTokenId']);
|
||||
unset($userData['password']);
|
||||
|
||||
return array(
|
||||
'user' => $userData,
|
||||
'acl' => $this->getAcl()->getMap(),
|
||||
'preferences' => $preferences,
|
||||
'token' => $this->getUser()->get('token')
|
||||
'token' => $this->getUser()->get('token'),
|
||||
'settings' => $settings
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -44,12 +44,17 @@ class Attachment extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
list($prefix, $contents) = explode(',', $data);
|
||||
$contents = base64_decode($contents);
|
||||
$arr = explode(',', $data);
|
||||
if (count($arr) > 1) {
|
||||
list($prefix, $contents) = $arr;
|
||||
$contents = base64_decode($contents);
|
||||
} else {
|
||||
$contents = '';
|
||||
}
|
||||
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment');
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
$this->getContainer()->get('fileManager')->putContents('data/upload/' . $attachment->id, $contents);
|
||||
$this->getContainer()->get('fileStorageManager')->putContents($attachment, $contents);
|
||||
|
||||
return array(
|
||||
'attachmentId' => $attachment->id
|
||||
|
||||
@@ -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
|
||||
@@ -40,32 +40,49 @@ class AuthToken extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
if (
|
||||
is_array($data) &&
|
||||
array_key_exists('isActive', $data) &&
|
||||
$data['isActive'] === false &&
|
||||
count(array_keys($data)) === 1)
|
||||
{
|
||||
return parent::actionUpdate($params, $data, $request);
|
||||
}
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
if (empty($data['attributes'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$attributes = $data['attributes'];
|
||||
|
||||
if (
|
||||
is_object($attributes) &&
|
||||
isset($attributes->isActive) &&
|
||||
$attributes->isActive === false &&
|
||||
count(array_keys(get_object_vars($attributes))) === 1
|
||||
) {
|
||||
return parent::actionMassUpdate($params, $data, $request);
|
||||
}
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,7 +25,7 @@
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -34,17 +34,19 @@ use \Espo\Core\Exceptions\Error;
|
||||
class EmailTemplate extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionParse($params, $data, $request)
|
||||
{
|
||||
{
|
||||
$id = $request->get('id');
|
||||
$emailAddress = $request->get('emailAddress');
|
||||
if (empty($id)) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
|
||||
return $this->getRecordService()->parse($id, array(
|
||||
'emailAddress' => $request->get('emailAddress'),
|
||||
'parentType' => $request->get('parentType'),
|
||||
'parentId' => $request->get('parentId'),
|
||||
'relatedType' => $request->get('relatedType'),
|
||||
'relatedId' => $request->get('relatedId')
|
||||
), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -198,6 +198,13 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
|
||||
}
|
||||
|
||||
if (array_key_exists('audited', $data)) {
|
||||
$params['audited'] = $data['audited'];
|
||||
}
|
||||
if (array_key_exists('auditedForeign', $data)) {
|
||||
$params['auditedForeign'] = $data['auditedForeign'];
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->createLink($params);
|
||||
|
||||
if ($result) {
|
||||
@@ -242,6 +249,13 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
|
||||
}
|
||||
|
||||
if (array_key_exists('audited', $data)) {
|
||||
$params['audited'] = $data['audited'];
|
||||
}
|
||||
if (array_key_exists('auditedForeign', $data)) {
|
||||
$params['auditedForeign'] = $data['auditedForeign'];
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->updateLink($params);
|
||||
|
||||
if ($result) {
|
||||
@@ -278,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -29,9 +29,10 @@
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error,
|
||||
\Espo\Core\Exceptions\Forbidden,
|
||||
\Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class FieldManager extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
@@ -44,38 +45,46 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
$data = $this->getContainer()->get('fieldManager')->read($params['name'], $params['scope']);
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$data = $this->getContainer()->get('fieldManager')->read($params['scope'], $params['name']);
|
||||
|
||||
if (!isset($data)) {
|
||||
throw new NotFound();
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function postActionCreate($params, $data)
|
||||
{
|
||||
if (empty($data['name'])) {
|
||||
throw new Error("Field 'name' cannnot be empty");
|
||||
if (empty($params['scope']) || empty($data['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager->create($data['name'], $data, $params['scope']);
|
||||
$fieldManager->create($params['scope'], $data['name'], $data);
|
||||
|
||||
try {
|
||||
$this->getContainer()->get('dataManager')->rebuild($params['scope']);
|
||||
} catch (Error $e) {
|
||||
$fieldManager->delete($data['name'], $params['scope']);
|
||||
$fieldManager->delete($params['scope'], $data['name']);
|
||||
throw new Error($e->getMessage());
|
||||
}
|
||||
|
||||
return $fieldManager->read($data['name'], $params['scope']);
|
||||
return $fieldManager->read($params['scope'], $data['name']);
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function putActionUpdate($params, $data)
|
||||
{
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager->update($params['name'], $data, $params['scope']);
|
||||
$fieldManager->update($params['scope'], $params['name'], $data);
|
||||
|
||||
if ($fieldManager->isChanged()) {
|
||||
$this->getContainer()->get('dataManager')->rebuild($params['scope']);
|
||||
@@ -83,17 +92,33 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
}
|
||||
|
||||
return $fieldManager->read($params['name'], $params['scope']);
|
||||
return $fieldManager->read($params['scope'], $params['name']);
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data)
|
||||
public function deleteActionDelete($params, $data)
|
||||
{
|
||||
$res = $this->getContainer()->get('fieldManager')->delete($params['name'], $params['scope']);
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('fieldManager')->delete($params['scope'], $params['name']);
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return $res;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function postActionResetToDefault($params, $data)
|
||||
{
|
||||
if (empty($data['scope']) || empty($data['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getContainer()->get('fieldManager')->resetToDefault($data['scope'], $data['name']);
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -68,9 +68,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
protected function getFileManager()
|
||||
protected function getFileStorageManager()
|
||||
{
|
||||
return $this->getContainer()->get('fileManager');
|
||||
return $this->getContainer()->get('fileStorageManager');
|
||||
}
|
||||
|
||||
protected function getEntityManager()
|
||||
@@ -92,7 +92,7 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$attachment->set('name', 'import-file.csv');
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
|
||||
$this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents);
|
||||
$this->getFileStorageManager()->putContents($attachment, $contents);
|
||||
|
||||
return array(
|
||||
'attachmentId' => $attachment->id
|
||||
@@ -127,17 +127,65 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['fieldDelimiter'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['textQualifier'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['dateFormat'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['timeFormat'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['personNameFormat'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['decimalMark'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['defaultValues'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['action'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['attachmentId'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data['entityType'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$timezone = 'UTC';
|
||||
if (isset($data['timezone'])) {
|
||||
$timezone = $data['timezone'];
|
||||
}
|
||||
|
||||
$importParams = array(
|
||||
'headerRow' => $data['headerRow'],
|
||||
'headerRow' => !empty($data['headerRow']),
|
||||
'fieldDelimiter' => $data['fieldDelimiter'],
|
||||
'textQualifier' => $data['textQualifier'],
|
||||
'dateFormat' => $data['dateFormat'],
|
||||
'timeFormat' => $data['timeFormat'],
|
||||
'timezone' => $timezone,
|
||||
'personNameFormat' => $data['personNameFormat'],
|
||||
'decimalMark' => $data['decimalMark'],
|
||||
'currency' => $data['currency'],
|
||||
'defaultValues' => $data['defaultValues'],
|
||||
'action' => $data['action'],
|
||||
'skipDuplicateChecking' => !empty($data['skipDuplicateChecking']),
|
||||
'idleMode' => !empty($data['idleMode'])
|
||||
);
|
||||
|
||||
if (array_key_exists('updateBy', $data)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -67,6 +67,19 @@ class Integration extends \Espo\Core\Controllers\Record
|
||||
$entity->set($data);
|
||||
$this->getEntityManager()->saveEntity($entity);
|
||||
|
||||
$integrationsConfigData = $this->getConfig()->get('integrations');
|
||||
|
||||
if (!$integrationsConfigData || !($integrationsConfigData instanceof \StdClass)) {
|
||||
$integrationsConfigData = (object)[];
|
||||
}
|
||||
$integrationName = $params['id'];
|
||||
|
||||
$integrationsConfigData->$integrationName = $entity->get('enabled');
|
||||
$this->getConfig()->set('integrations', $integrationsConfigData);
|
||||
|
||||
$this->getConfig()->save();
|
||||
|
||||
|
||||
return $entity->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,0 +1,46 @@
|
||||
<?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\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class LastViewed extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function getActionIndex($params, $data, $request)
|
||||
{
|
||||
$result = $this->getServiceFactory()->create('LastViewed')->get();
|
||||
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,27 @@
|
||||
*
|
||||
* 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);
|
||||
return $this->getMetadata()->getAllForFrontend();
|
||||
}
|
||||
|
||||
public function getActionGet($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new \Forbidden();
|
||||
}
|
||||
$key = $request->get('key');
|
||||
|
||||
return $this->getMetadata()->get($key, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -37,7 +37,11 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function getConfigData()
|
||||
{
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
if ($this->getUser()->id == 'system') {
|
||||
$data = $this->getConfig()->getData();
|
||||
} else {
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
}
|
||||
|
||||
$fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields');
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -69,6 +69,11 @@ class Acl
|
||||
return $this->getAclManager()->get($this->getUser(), $permission);
|
||||
}
|
||||
|
||||
public function checkReadNo($scope)
|
||||
{
|
||||
return $this->getAclManager()->checkReadNo($this->getUser(), $scope);
|
||||
}
|
||||
|
||||
public function checkReadOnlyTeam($scope)
|
||||
{
|
||||
return $this->getAclManager()->checkReadOnlyTeam($this->getUser(), $scope);
|
||||
|
||||
@@ -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
|
||||
@@ -106,6 +106,14 @@ class Base implements Injectable
|
||||
return $data->read === 'team';
|
||||
}
|
||||
|
||||
public function checkReadNo(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data->read === 'no';
|
||||
}
|
||||
|
||||
public function checkReadOnlyOwn(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
@@ -155,7 +163,7 @@ class Base implements Injectable
|
||||
}
|
||||
|
||||
if (!isset($data->$action)) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $data->$action;
|
||||
|
||||
@@ -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
|
||||
@@ -36,7 +36,7 @@ use \Espo\Entities\User;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManager;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table
|
||||
@@ -77,7 +77,7 @@ class Table
|
||||
|
||||
protected $forbiddenFieldsCache = array();
|
||||
|
||||
public function __construct(User $user, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
|
||||
public function __construct(User $user, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManagerUtil $fieldManager = null)
|
||||
{
|
||||
$this->data = (object) [
|
||||
'table' => (object) [],
|
||||
@@ -177,7 +177,7 @@ class Table
|
||||
return $this->data->table->$scope->$action;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return 'no';
|
||||
}
|
||||
|
||||
private function load()
|
||||
@@ -459,6 +459,17 @@ class Table
|
||||
$defaultValue = (object) $defaultValue;
|
||||
}
|
||||
$table->$scope = $defaultValue;
|
||||
|
||||
if (is_object($table->$scope)) {
|
||||
$actionList = $this->getMetadata()->get(['scopes', $scope, $this->type . 'ActionList']);
|
||||
if ($actionList) {
|
||||
foreach (get_object_vars($table->$scope) as $action => $level) {
|
||||
if (!in_array($action, $actionList)) {
|
||||
unset($table->$scope->$action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -606,7 +617,9 @@ class Table
|
||||
|
||||
if (!is_object($row)) continue;
|
||||
|
||||
foreach ($this->actionList as $i => $action) {
|
||||
$actionList = $this->getMetadata()->get(['scopes', $scope, $this->type . 'ActionList'], $this->actionList);
|
||||
|
||||
foreach ($actionList as $i => $action) {
|
||||
if (isset($row->$action)) {
|
||||
$level = $row->$action;
|
||||
if (!isset($data->$scope->$action)) {
|
||||
@@ -623,7 +636,7 @@ class Table
|
||||
if (in_array($action, $this->booleanActionList)) {
|
||||
$data->$scope->$action = 'yes';
|
||||
} else {
|
||||
if (isset($data->$scope->$previousAction)) {
|
||||
if ($action === 'stream' && isset($data->$scope->$previousAction)) {
|
||||
$data->$scope->$action = $data->$scope->$previousAction;
|
||||
}
|
||||
}
|
||||
@@ -684,11 +697,12 @@ class Table
|
||||
|
||||
private function buildCache()
|
||||
{
|
||||
$contents = '<' . '?'. 'php return ' . $this->varExport($this->data) . ';';
|
||||
$this->fileManager->putContents($this->cacheFilePath, $contents);
|
||||
$this->fileManager->putPhpContents($this->cacheFilePath, $this->data, true);
|
||||
/*$contents = '<' . '?'. 'php return ' . $this->varExport($this->data) . ';';
|
||||
$this->fileManager->putContents($this->cacheFilePath, $contents);*/
|
||||
}
|
||||
|
||||
private function varExport($variable)
|
||||
/*private function varExport($variable)
|
||||
{
|
||||
if ($variable instanceof \StdClass) {
|
||||
$result = '(object) ' . $this->varExport(get_object_vars($variable), true);
|
||||
@@ -703,6 +717,6 @@ class Table
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -107,7 +107,7 @@ class AclManager
|
||||
$config = $this->getContainer()->get('config');
|
||||
$fileManager = $this->getContainer()->get('fileManager');
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager = $this->getContainer()->get('fieldManagerUtil');
|
||||
|
||||
$this->tableHashMap[$key] = new $this->tableClassName($user, $config, $fileManager, $metadata, $fieldManager);
|
||||
}
|
||||
@@ -133,6 +133,15 @@ class AclManager
|
||||
return $this->getTable($user)->get($permission);
|
||||
}
|
||||
|
||||
public function checkReadNo(User $user, $scope)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
$data = $this->getTable($user)->getScopeData($scope);
|
||||
return $this->getImplementation($scope)->checkReadNo($user, $data);
|
||||
}
|
||||
|
||||
public function checkReadOnlyTeam(User $user, $scope)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
@@ -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
|
||||
@@ -71,7 +71,7 @@ class Base extends \Espo\Core\Acl\Base
|
||||
}
|
||||
|
||||
if (!isset($data->$action)) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $data->$action;
|
||||
|
||||
@@ -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
|
||||
@@ -37,7 +37,7 @@ use \Espo\Entities\Portal;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManager;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table extends \Espo\Core\Acl\Table
|
||||
@@ -52,7 +52,7 @@ class Table extends \Espo\Core\Acl\Table
|
||||
|
||||
protected $valuePermissionList = [];
|
||||
|
||||
public function __construct(User $user, Portal $portal, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
|
||||
public function __construct(User $user, Portal $portal, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManagerUtil $fieldManager = null)
|
||||
{
|
||||
if (empty($portal)) {
|
||||
throw new Error("No portal was passed to AclPortal\\Table constructor.");
|
||||
|
||||
@@ -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
|
||||
@@ -222,7 +222,7 @@ class Application
|
||||
}
|
||||
|
||||
try {
|
||||
$controllerManager = new \Espo\Core\ControllerManager($container);
|
||||
$controllerManager = $this->getContainer()->get('controllerManager');
|
||||
$result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request());
|
||||
$container->get('output')->render($result);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -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
|
||||
@@ -128,6 +128,14 @@ class Container
|
||||
return new \Espo\Core\Utils\Api\Slim();
|
||||
}
|
||||
|
||||
protected function loadFileStorageManager()
|
||||
{
|
||||
return new \Espo\Core\FileStorage\Manager(
|
||||
$this->get('metadata')->get(['app', 'fileStorage', 'implementationClassNameMap']),
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadFileManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\File\Manager(
|
||||
@@ -135,6 +143,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadControllerManager()
|
||||
{
|
||||
return new \Espo\Core\ControllerManager(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadPreferences()
|
||||
{
|
||||
return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id);
|
||||
@@ -209,8 +224,8 @@ class Container
|
||||
protected function loadMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata(
|
||||
$this->get('config'),
|
||||
$this->get('fileManager')
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -247,7 +262,17 @@ class Container
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('entityManager'),
|
||||
$this->get('classParser')
|
||||
$this->get('classParser'),
|
||||
$this->get('ormMetadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadOrmMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata\OrmMetadata(
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -263,10 +288,20 @@ class Container
|
||||
protected function loadLanguage()
|
||||
{
|
||||
return new \Espo\Core\Utils\Language(
|
||||
\Espo\Core\Utils\Language::detectLanguage($this->get('config'), $this->get('preferences')),
|
||||
$this->get('fileManager'),
|
||||
$this->get('config'),
|
||||
$this->get('metadata'),
|
||||
$this->get('preferences')
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadDefaultLanguage()
|
||||
{
|
||||
return new \Espo\Core\Utils\Language(
|
||||
null,
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -300,6 +335,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadFieldManagerUtil()
|
||||
{
|
||||
return new \Espo\Core\Utils\FieldManagerUtil(
|
||||
$this->get('metadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadThemeManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\ThemeManager(
|
||||
@@ -316,6 +358,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadInjectableFactory()
|
||||
{
|
||||
return new \Espo\Core\InjectableFactory(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
public function setUser(\Espo\Entities\User $user)
|
||||
{
|
||||
$this->set('user', $user);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -67,7 +67,7 @@ class Record extends Base
|
||||
public function actionRead($params, $data, $request)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$entity = $this->getRecordService()->getEntity($id);
|
||||
$entity = $this->getRecordService()->readEntity($id);
|
||||
|
||||
if (empty($entity)) {
|
||||
throw new NotFound();
|
||||
@@ -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)
|
||||
@@ -226,6 +229,10 @@ class Record extends Base
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if ($this->getConfig()->get('exportDisabled') && !$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
@@ -234,10 +241,10 @@ class Record extends Base
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$ids = $request->get('ids');
|
||||
$where = $request->get('where');
|
||||
$byWhere = $request->get('byWhere');
|
||||
$selectData = $request->get('selectData');
|
||||
$ids = isset($data['ids']) ? $data['ids'] : null;
|
||||
$where = isset($data['where']) ? json_decode(json_encode($data['where']), true) : null;
|
||||
$byWhere = isset($data['byWhere']) ? $data['byWhere'] : false;
|
||||
$selectData = isset($data['selectData']) ? json_decode(json_encode($data['selectData']), true) : null;
|
||||
|
||||
$params = array();
|
||||
if ($byWhere) {
|
||||
@@ -247,6 +254,18 @@ class Record extends Base
|
||||
$params['ids'] = $ids;
|
||||
}
|
||||
|
||||
if (isset($data['attributeList'])) {
|
||||
$params['attributeList'] = $data['attributeList'];
|
||||
}
|
||||
|
||||
if (isset($data['fieldList'])) {
|
||||
$params['fieldList'] = $data['fieldList'];
|
||||
}
|
||||
|
||||
if (isset($data['format'])) {
|
||||
$params['format'] = $data['format'];
|
||||
}
|
||||
|
||||
return array(
|
||||
'id' => $this->getRecordService()->export($params)
|
||||
);
|
||||
@@ -303,9 +322,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)
|
||||
@@ -453,5 +470,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -28,6 +28,7 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
class DataManager
|
||||
{
|
||||
private $container;
|
||||
@@ -58,6 +59,8 @@ class DataManager
|
||||
|
||||
$result &= $this->rebuildDatabase($entityList);
|
||||
|
||||
$this->rebuildScheduledJobs();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -113,11 +116,45 @@ class DataManager
|
||||
|
||||
$metadata->init(true);
|
||||
|
||||
$ormMeta = $metadata->getOrmMetadata(true);
|
||||
$ormData = $this->getContainer()->get('ormMetadata')->getData(true);
|
||||
|
||||
$this->updateCacheTimestamp();
|
||||
|
||||
return empty($ormMeta) ? false : true;
|
||||
return empty($ormData) ? false : true;
|
||||
}
|
||||
|
||||
public function rebuildScheduledJobs()
|
||||
{
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$entityManager = $this->getContainer()->get('entityManager');
|
||||
|
||||
$jobs = $metadata->get(['entityDefs', 'ScheduledJob', 'jobs'], array());
|
||||
|
||||
foreach ($jobs as $jobName => $defs) {
|
||||
if ($jobName && !empty($defs['isSystem']) && !empty($defs['scheduling'])) {
|
||||
if (!$entityManager->getRepository('ScheduledJob')->where(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling']
|
||||
))->findOne()) {
|
||||
$job = $entityManager->getRepository('ScheduledJob')->where(array(
|
||||
'job' => $jobName
|
||||
))->findOne();
|
||||
if ($job) {
|
||||
$entityManager->removeEntity($job);
|
||||
}
|
||||
$job = $entityManager->getEntity('ScheduledJob');
|
||||
$job->set(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling'],
|
||||
'isInternal' => true,
|
||||
'name' => $jobName
|
||||
));
|
||||
$entityManager->saveEntity($job);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,0 +1,65 @@
|
||||
<?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\Export;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Csv extends \Espo\Core\Injectable
|
||||
{
|
||||
protected $dependencyList = [
|
||||
'config',
|
||||
'preferences'
|
||||
];
|
||||
|
||||
public function process($entityType, $params, $dataList)
|
||||
{
|
||||
if (!is_array($params['attributeList'])) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$attributeList = $params['attributeList'];
|
||||
|
||||
$delimiter = $this->getInjection('preferences')->get('exportDelimiter');
|
||||
if (empty($delimiter)) {
|
||||
$delimiter = $this->getInjection('config')->get('exportDelimiter', ';');
|
||||
}
|
||||
|
||||
$fp = fopen('php://temp', 'w');
|
||||
fputcsv($fp, $attributeList, $delimiter);
|
||||
foreach ($dataList as $row) {
|
||||
fputcsv($fp, $row, $delimiter);
|
||||
}
|
||||
rewind($fp);
|
||||
$csv = stream_get_contents($fp);
|
||||
fclose($fp);
|
||||
|
||||
return $csv;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,449 @@
|
||||
<?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\Export;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Xlsx extends \Espo\Core\Injectable
|
||||
{
|
||||
protected $dependencyList = [
|
||||
'language',
|
||||
'metadata',
|
||||
'config',
|
||||
'dateTime',
|
||||
'entityManager',
|
||||
'fileStorageManager',
|
||||
'fileManager'
|
||||
];
|
||||
|
||||
protected function getConfig()
|
||||
{
|
||||
return $this->getInjection('config');
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->getInjection('metadata');
|
||||
}
|
||||
|
||||
protected function getEntityManager()
|
||||
{
|
||||
return $this->getInjection('entityManager');
|
||||
}
|
||||
|
||||
public function loadAdditionalFields(Entity $entity, $fieldList)
|
||||
{
|
||||
foreach ($entity->getRelationList() as $link) {
|
||||
if ($entity->getRelationType($link) === 'belongsToParent') {
|
||||
if (in_array($link, $fieldList)) {
|
||||
$parent = $entity->get($link);
|
||||
if ($parent instanceof Entity) {
|
||||
$entity->set($link . 'Name', $parent->get('name'));
|
||||
}
|
||||
}
|
||||
} else if ($entity->getRelationType($link) === 'belongsTo' && $entity->getRelationParam($link, 'noJoin') && $entity->hasField($link . 'Name')) {
|
||||
if (in_array($link, $fieldList)) {
|
||||
$related = $entity->get($link);
|
||||
if ($related instanceof Entity) {
|
||||
$entity->set($link . 'Name', $related->get('name'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addAdditionalAttributes($entityType, &$attributeList, $fieldList)
|
||||
{
|
||||
$linkList = [];
|
||||
|
||||
if (!in_array('id', $attributeList)) {
|
||||
$attributeList[] = 'id';
|
||||
}
|
||||
|
||||
$linkDefs = $this->getMetadata()->get(['entityDefs', $entityType, 'links']);
|
||||
if (is_array($linkDefs)) {
|
||||
foreach ($linkDefs as $link => $defs) {
|
||||
if (empty($defs['type'])) continue;
|
||||
if ($defs['type'] === 'belongsToParent') {
|
||||
$linkList[] = $link;
|
||||
} else if ($defs['type'] === 'belongsTo' && !empty($defs['noJoin'])) {
|
||||
if ($this->getMetadata()->get(['entityDefs', $entityType, 'fields', $link])) {
|
||||
$linkList[] = $link;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($linkList as $item) {
|
||||
if (in_array($item, $fieldList) && !in_array($item . 'Name', $attributeList)) {
|
||||
$attributeList[] = $item . 'Name';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fieldList as $field) {
|
||||
$type = $this->getMetadata()->get(['entityDefs', $entityType, 'fields', $field, 'type']);
|
||||
if ($type === 'currencyConverted') {
|
||||
if (!in_array($field, $attributeList)) {
|
||||
$attributeList[] = $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function process($entityType, $params, $dataList)
|
||||
{
|
||||
if (!is_array($params['fieldList'])) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$phpExcel = new \PHPExcel();
|
||||
$sheet = $phpExcel->setActiveSheetIndex(0);
|
||||
|
||||
if (isset($params['exportName'])) {
|
||||
$exportName = $params['exportName'];
|
||||
} else {
|
||||
$exportName = $this->getInjection('language')->translate($entityType, 'scopeNamesPlural');
|
||||
}
|
||||
|
||||
$sheetName = substr($exportName, 0, 30);
|
||||
$badCharList = ['*', ':', '/', '\\', '?', '[', ']'];
|
||||
foreach ($badCharList as $badChar) {
|
||||
$sheetName = str_replace($badCharList, ' ', $sheetName);
|
||||
}
|
||||
$sheetName = str_replace('\'', '', $sheetName);
|
||||
|
||||
$sheet->setTitle($sheetName);
|
||||
|
||||
$fieldList = $params['fieldList'];
|
||||
|
||||
$titleStyle = array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
$dateStyle = array(
|
||||
'font' => array(
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->setCellValue('A1', $exportName);
|
||||
|
||||
$sheet->setCellValue('B1', \PHPExcel_Shared_Date::PHPToExcel(strtotime(date('Y-m-d H:i:s'))));
|
||||
|
||||
|
||||
$sheet->getStyle('A1')->applyFromArray($titleStyle);
|
||||
$sheet->getStyle('B1')->applyFromArray($dateStyle);
|
||||
|
||||
$sheet->getStyle('B1')->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
|
||||
$azRange = range('A', 'Z');
|
||||
$azRangeCopied = $azRange;
|
||||
foreach ($azRangeCopied as $i => $char1) {
|
||||
foreach ($azRangeCopied as $j => $char2) {
|
||||
$azRange[] = $char1 . $char2;
|
||||
if ($i * count($azRangeCopied) + $j === count($fieldList)) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rowNumber = 3;
|
||||
|
||||
$linkColList = [];
|
||||
|
||||
$lastIndex = 0;
|
||||
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
|
||||
$defs = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name]);
|
||||
|
||||
if (!$defs) {
|
||||
$defs['type'] = 'base';
|
||||
}
|
||||
|
||||
$label = $name;
|
||||
if (strpos($name, '_') !== false) {
|
||||
list($linkName, $foreignField) = explode('_', $name);
|
||||
$foreigScope = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'links', $linkName, 'entity']);
|
||||
if ($foreigScope) {
|
||||
$label = $this->getInjection('language')->translate($linkName, 'links', $entityType) . '.' . $this->getInjection('language')->translate($foreignField, 'fields', $foreigScope);
|
||||
}
|
||||
} else {
|
||||
$label = $this->getInjection('language')->translate($name, 'fields', $entityType);
|
||||
}
|
||||
|
||||
$sheet->setCellValue($col . $rowNumber, $label);
|
||||
$sheet->getColumnDimension($col)->setAutoSize(true);
|
||||
if (
|
||||
$defs['type'] == 'phone'
|
||||
|| $defs['type'] == 'email'
|
||||
|| $defs['type'] == 'url'
|
||||
|| $defs['type'] == 'link'
|
||||
|| $defs['type'] == 'linkParent'
|
||||
) {
|
||||
$linkColList[] = $col;
|
||||
} else if ($name == 'name') {
|
||||
$linkColList[] = $col;
|
||||
}
|
||||
$lastIndex = $i;
|
||||
}
|
||||
|
||||
$col = $azRange[$i];
|
||||
|
||||
$headerStyle = array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->getStyle("A$rowNumber:$col$rowNumber")->applyFromArray($headerStyle);
|
||||
$sheet->setAutoFilter("A$rowNumber:$col$rowNumber");
|
||||
|
||||
$rowNumber++;
|
||||
foreach ($dataList as $row) {
|
||||
$i = 0;
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
|
||||
$defs = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name]);
|
||||
if (!$defs) {
|
||||
$defs = array();
|
||||
$defs['type'] = 'base';
|
||||
}
|
||||
$link = null;
|
||||
if ($defs['type'] == 'link') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($defs['type'] == 'linkParent') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($defs['type'] == 'int') {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ?: 0);
|
||||
} else if ($defs['type'] == 'currency') {
|
||||
if (array_key_exists($name.'Currency', $row) && array_key_exists($name, $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ? $row[$name] : '');
|
||||
$currency = $row[$name . 'Currency'];
|
||||
$currencySymbol = $this->getMetadata()->get(['app', 'currency', 'symbolMap', $currency], '');
|
||||
|
||||
$sheet->getStyle("$col$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode('[$'.$currencySymbol.'-409]#,##0.00;-[$'.$currencySymbol.'-409]#,##0.00');
|
||||
}
|
||||
} else if ($defs['type'] == 'currencyConverted') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$currency = $this->getConfig()->get('baseCurrency');
|
||||
$currencySymbol = $this->getMetadata()->get(['app', 'currency', 'symbolMap', $currency], '');
|
||||
|
||||
$sheet->getStyle("$col$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode('[$'.$currencySymbol.'-409]#,##0.00;-[$'.$currencySymbol.'-409]#,##0.00');
|
||||
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ? $row[$name] : '');
|
||||
}
|
||||
} else if ($defs['type'] == 'personName') {
|
||||
if (!empty($row['name'])) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row['name']);
|
||||
} else {
|
||||
$personName = '';
|
||||
if (!empty($row['firstName'])) {
|
||||
$personName .= $row['firstName'];
|
||||
}
|
||||
if (!empty($row['lastName'])) {
|
||||
if (!empty($row['firstName'])) {
|
||||
$personName .= ' ';
|
||||
}
|
||||
$personName .= $row['lastName'];
|
||||
}
|
||||
$sheet->setCellValue("$col$rowNumber", $personName);
|
||||
}
|
||||
} else if ($defs['type'] == 'date') {
|
||||
if (isset($row[$name])) {
|
||||
$sheet->setCellValue("$col$rowNumber", \PHPExcel_Shared_Date::PHPToExcel(strtotime($row[$name])));
|
||||
}
|
||||
} else if ($defs['type'] == 'datetime' || $defs['type'] == 'datetimeOptional') {
|
||||
if (isset($row[$name])) {
|
||||
$sheet->setCellValue("$col$rowNumber", \PHPExcel_Shared_Date::PHPToExcel(strtotime($row[$name])));
|
||||
}
|
||||
} else if ($defs['type'] == 'image') {
|
||||
if (isset($row[$name . 'Id']) && $row[$name . 'Id']) {
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment', $row[$name . 'Id']);
|
||||
|
||||
if ($attachment) {
|
||||
$objDrawing = new \PHPExcel_Worksheet_Drawing();
|
||||
$filePath = $this->getInjection('fileStorageManager')->getLocalFilePath($attachment);
|
||||
|
||||
if ($filePath && file_exists($filePath)) {
|
||||
$objDrawing->setPath($filePath);
|
||||
$objDrawing->setHeight(100);
|
||||
$objDrawing->setCoordinates("$col$rowNumber");
|
||||
$objDrawing->setWorksheet($sheet);
|
||||
$sheet->getRowDimension($rowNumber)->setRowHeight(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($defs['type'] == 'file') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($defs['type'] == 'enum') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$value = $this->getInjection('language')->translateOption($row[$name], $name, $entityType);
|
||||
$sheet->setCellValue("$col$rowNumber", $value);
|
||||
}
|
||||
} else {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$link = false;
|
||||
|
||||
if ($name == 'name') {
|
||||
if (array_key_exists('id', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#".$entityType . "/view/" . $row['id'];
|
||||
}
|
||||
} else if ($defs['type'] == 'url') {
|
||||
if (array_key_exists($name, $row) && filter_var($row[$name], FILTER_VALIDATE_URL)) {
|
||||
$link = $row[$name];
|
||||
}
|
||||
} else if ($defs['type'] == 'link') {
|
||||
if (array_key_exists($name.'Id', $row)) {
|
||||
$foreignEntity = $this->getMetadata()->get(['entityDefs', $entityType, 'links', $name, 'entity']);
|
||||
if ($foreignEntity) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#" . $foreignEntity. "/view/". $row[$name.'Id'];
|
||||
}
|
||||
}
|
||||
} else if ($defs['type'] == 'file') {
|
||||
if (array_key_exists($name.'Id', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/?entryPoint=download&id=" . $row[$name.'Id'];
|
||||
}
|
||||
} else if ($defs['type'] == 'linkParent') {
|
||||
if (array_key_exists($name.'Id', $row) && array_key_exists($name.'Type', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#".$row[$name.'Type']."/view/". $row[$name.'Id'];
|
||||
}
|
||||
} else if ($defs['type'] == 'phone') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$link = "tel:".$row[$name];
|
||||
}
|
||||
} else if ($defs['type'] == 'email' && array_key_exists($name, $row)) {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$link = "mailto:".$row[$name];
|
||||
}
|
||||
}
|
||||
if ($link) {
|
||||
$sheet->getCell("$col$rowNumber")->getHyperlink()->setUrl($link);
|
||||
$sheet->getCell("$col$rowNumber")->getHyperlink()->setTooltip($link);
|
||||
}
|
||||
}
|
||||
$rowNumber++;
|
||||
}
|
||||
|
||||
$startingRowNumber = 4;
|
||||
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
|
||||
$defs = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name]);
|
||||
if (!$defs) {
|
||||
$defs['type'] = 'base';
|
||||
}
|
||||
|
||||
if ($col == 'A') {
|
||||
$sheet->getStyle("A2:A$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_TEXT);
|
||||
} else {
|
||||
switch($defs['type']) {
|
||||
case 'currency':
|
||||
case 'currencyConverted': {
|
||||
|
||||
} break;
|
||||
case 'int': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode('0');
|
||||
} break;
|
||||
case 'date': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateFormat());
|
||||
} break;
|
||||
case 'datetime': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
} break;
|
||||
case 'datetimeOptional': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
} break;
|
||||
default: {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode('@');
|
||||
} break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$linkStyle = [
|
||||
'font' => [
|
||||
'color' => ['rgb' => '345b7c'],
|
||||
'underline' => 'single'
|
||||
]
|
||||
];
|
||||
foreach ($linkColList as $linkColumn) {
|
||||
$sheet->getStyle($linkColumn.$startingRowNumber.':'.$linkColumn.$rowNumber)->applyFromArray($linkStyle);
|
||||
}
|
||||
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter($phpExcel, 'Excel2007');
|
||||
|
||||
if (!$this->getInjection('fileManager')->isDir('data/cache/')) {
|
||||
$this->getInjection('fileManager')->mkdir('data/cache/');
|
||||
}
|
||||
$tempFileName = 'data/cache/' . 'export_' . substr(md5(rand()), 0, 7);
|
||||
|
||||
$objWriter->save($tempFileName);
|
||||
$fp = fopen($tempFileName, 'r');
|
||||
$xlsx = stream_get_contents($fp);
|
||||
$this->getInjection('fileManager')->unlink($tempFileName);
|
||||
|
||||
return $xlsx;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,0 +1,115 @@
|
||||
<?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\FileStorage;
|
||||
|
||||
use \Espo\Entities\Attachment;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Manager
|
||||
{
|
||||
private $implementations = array();
|
||||
|
||||
private $implementationClassNameMap = array();
|
||||
|
||||
private $container;
|
||||
|
||||
public function __construct(array $implementationClassNameMap, $container)
|
||||
{
|
||||
$this->implementationClassNameMap = $implementationClassNameMap;
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
private function getImplementation($storage = null)
|
||||
{
|
||||
if (!$storage) {
|
||||
$storage = 'EspoUploadDir';
|
||||
}
|
||||
|
||||
if (array_key_exists($storage, $this->implementations)) {
|
||||
return $this->implementations[$storage];
|
||||
}
|
||||
|
||||
if (!array_key_exists($storage, $this->implementationClassNameMap)) {
|
||||
throw new Error("FileStorageManager: Unknown storage '{$storage}'");
|
||||
}
|
||||
$className = $this->implementationClassNameMap[$storage];
|
||||
|
||||
$implementation = new $className();
|
||||
foreach ($implementation->getDependencyList() as $dependencyName) {
|
||||
$implementation->inject($dependencyName, $this->container->get($dependencyName));
|
||||
}
|
||||
$this->implementations[$storage] = $implementation;
|
||||
|
||||
return $implementation;
|
||||
}
|
||||
|
||||
public function isFile(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->isFile($attachment);
|
||||
}
|
||||
|
||||
public function getContents(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getContents($attachment);
|
||||
}
|
||||
|
||||
public function putContents(Attachment $attachment, $contents)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->putContents($attachment, $contents);
|
||||
}
|
||||
|
||||
public function unlink(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->unlink($attachment);
|
||||
}
|
||||
|
||||
public function getLocalFilePath(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getLocalFilePath($attachment);
|
||||
}
|
||||
|
||||
public function hasDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->hasDownloadUrl($attachment);
|
||||
}
|
||||
|
||||
public function getDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getDownloadUrl($attachment);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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\FileStorage\Storages;
|
||||
|
||||
use \Espo\Core\Interfaces\Injectable;
|
||||
|
||||
abstract class Base implements Injectable
|
||||
{
|
||||
protected $dependencyList = [];
|
||||
|
||||
protected $injections = array();
|
||||
|
||||
public function inject($name, $object)
|
||||
{
|
||||
$this->injections[$name] = $object;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
abstract public function hasDownloadUrl(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function getDownloadUrl(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function unlink(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function getContents(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function isFile(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function putContents(\Espo\Entities\Attachment $attachment, $contents);
|
||||
|
||||
abstract public function getLocalFilePath(\Espo\Entities\Attachment $attachment);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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\FileStorage\Storages;
|
||||
|
||||
use \Espo\Entities\Attachment;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class EspoUploadDir extends Base
|
||||
{
|
||||
protected $dependencyList = ['fileManager'];
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->getInjection('fileManager');
|
||||
}
|
||||
|
||||
public function unlink(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->unlink($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function isFile(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->isFile($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function getContents(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->getContents($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function putContents(Attachment $attachment, $contents)
|
||||
{
|
||||
return $this->getFileManager()->putContents($this->getFilePath($attachment), $contents);
|
||||
}
|
||||
|
||||
public function getLocalFilePath(Attachment $attachment)
|
||||
{
|
||||
return $this->getFilePath($attachment);
|
||||
}
|
||||
|
||||
protected function getFilePath(Attachment $attachment)
|
||||
{
|
||||
$sourceId = $attachment->getSourceId();
|
||||
return 'data/upload/' . $sourceId;
|
||||
}
|
||||
|
||||
public function getDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function hasDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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';
|
||||
}
|
||||
|
||||
if ($entity->getAttributeParam($attribute, 'isParentName') && $methodName == 'get') {
|
||||
$relationName = $entity->getAttributeParam($attribute, 'relation');
|
||||
if ($parent = $entity->get($relationName)) {
|
||||
return $parent->get('name');
|
||||
}
|
||||
}
|
||||
|
||||
return $entity->$methodName($attribute);
|
||||
}
|
||||
|
||||
public function resetRuntimeCache()
|
||||
{
|
||||
$this->relatedEntitiesCacheMap = array();
|
||||
}
|
||||
|
||||
protected function buildKey(Entity $entity, $link)
|
||||
{
|
||||
return spl_object_hash($entity) . '-' . $link;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user